diff --git a/.github/scripts/manage_translation.py b/.github/scripts/manage_translation.py index 9bd60eb0a..ba357fce9 100755 --- a/.github/scripts/manage_translation.py +++ b/.github/scripts/manage_translation.py @@ -15,9 +15,11 @@ RESOURCE_NAME_MAP = {'glossary_': 'glossary'} +LANG = 'uk' + ORGANISATION_ID = 'o:python-doc' PROJECT_ID = 'o:python-doc:p:python-newest' -LANGUAGE_ID = 'l:uk' +LANGUAGE_ID = f'l:{LANG}' ORGANISATION = transifex_api.Organization.get(id=ORGANISATION_ID) PROJECT = transifex_api.Project.get(id=PROJECT_ID) LANGUAGE = transifex_api.Language.get(id=LANGUAGE_ID) @@ -46,6 +48,10 @@ def recreate_config() -> None: f'file_filter = {path}\n', 'type = PO\n', 'source_lang = en\n', + 'minimum_perc = 0\n', + f'trans.{LANG} = {path}\n', + f'source_file = {path}\n', + f'resource_name = {resource.name}\n' )) @@ -88,15 +94,8 @@ def recreate_team_stats() -> None: fo.writelines(f"| {user} | {role} | {translators[user]} | {reviewers[user]} | {proofreaders[user]} |\n") -def fetch_translations(): - """Fetch translations from Transifex, remove source lines.""" - pull_return_code = os.system(f'tx pull -l uk --force --skip') - if pull_return_code != 0: - exit(pull_return_code) - - if __name__ == "__main__": - RUNNABLE_SCRIPTS = ('recreate_config', 'recreate_resource_stats', 'recreate_team_stats', 'fetch_translations') + RUNNABLE_SCRIPTS = ('recreate_config', 'recreate_resource_stats', 'recreate_team_stats', 'fetch_translations', 'format_translations') parser = ArgumentParser() parser.add_argument('cmd', nargs=1, choices=RUNNABLE_SCRIPTS) diff --git a/.github/workflows/update-and-build.yml b/.github/workflows/update-and-build.yml index f7d7899a2..bc18b9975 100644 --- a/.github/workflows/update-and-build.yml +++ b/.github/workflows/update-and-build.yml @@ -5,13 +5,15 @@ on: - cron: '0 6 * * *' push: branches: ['main'] + pull_request: + branches: ['main'] workflow_dispatch: jobs: + update-translation: runs-on: ubuntu-latest strategy: - fail-fast: false matrix: version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] steps: @@ -22,38 +24,64 @@ jobs: with: python-version: 3 - run: sudo apt-get install -y gettext + - run: pip install transifex-python six sphinx-intl blurb - run: curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash working-directory: /usr/local/bin - - run: pip install requests cogapp polib transifex-python sphinx-lint sphinx-intl blurb six - uses: actions/checkout@master with: + repository: python/cpython ref: ${{ matrix.version }} - - run: .github/scripts/manage_translation.py recreate_config + path: cpython + - run: make -C cpython/Doc/ gettext + - run: sphinx-intl create-txconfig + working-directory: cpython/Doc/build + - run: sphinx-intl update-txconfig-resources --transifex-organization-name python-doc --transifex-project-name python-newest -d . -p gettext + working-directory: cpython/Doc/build env: TX_TOKEN: ${{ secrets.TX_TOKEN }} - - run: .github/scripts/manage_translation.py fetch_translations + - run: tx pull -l uk --force --skip + working-directory: cpython/Doc/build env: TX_TOKEN: ${{ secrets.TX_TOKEN }} - - run: git config --local user.email github-actions@github.com - - run: git config --local user.name "GitHub Action's update-translation job" - - run: git add . - - run: git commit -m 'Update translation from Transifex' || true + - run: find -name "*.po" -exec msgcat --no-location -o {} {} \; + working-directory: cpython/Doc/build + - uses: actions/checkout@master + with: + ref: ${{ matrix.version }} + path: python-docs-uk + - run: cp -r cpython/Doc/build/uk/LC_MESSAGES/ python-docs-uk/. + - run: | + git config --local user.email github-actions@github.com + git config --local user.name "GitHub Action's update-translation job" + git add . + git commit -m 'Update translation from Transifex' || true + working-directory: cpython/Doc/build/uk/LC_MESSAGES - uses: ad-m/github-push-action@master with: branch: ${{ matrix.version }} github_token: ${{ secrets.GITHUB_TOKEN }} - - uses: peter-evans/repository-dispatch@main + + lint-translation: + runs-on: ubuntu-latest + strategy: + matrix: + version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] + needs: ['update-translation'] + continue-on-error: true + steps: + - uses: actions/setup-python@master with: python-version: 3 + - run: pip install sphinx-lint - uses: actions/checkout@master with: ref: ${{ matrix.version }} - uses: rffontenelle/sphinx-lint-problem-matcher@v1.0.0 - run: sphinx-lint + build-translation: runs-on: ubuntu-latest strategy: - fail-fast: false matrix: version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] format: [html, latex] @@ -77,14 +105,15 @@ jobs: - uses: sphinx-doc/github-problem-matcher@v1.1 - run: make -e SPHINXOPTS=" -D language='uk' -W --keep-going" ${{ matrix.format }} working-directory: ./Doc + - run: make sphinx-lint - uses: actions/upload-artifact@master with: name: build-${{ matrix.version }}-${{ matrix.format }} path: Doc/build/${{ matrix.format }} + output-pdf: runs-on: ubuntu-latest strategy: - fail-fast: false matrix: version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] needs: ['build-translation'] diff --git a/.tx/config b/.tx/config index 67726d1e1..4a1fd9695 100644 --- a/.tx/config +++ b/.tx/config @@ -1,2 +1,4574 @@ [main] host = https://api.transifex.com + +[o:python-doc:p:python-newest:r:about] +file_filter = about.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = about.po +source_file = about.po +resource_name = about + +[o:python-doc:p:python-newest:r:bugs] +file_filter = bugs.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = bugs.po +source_file = bugs.po +resource_name = bugs + +[o:python-doc:p:python-newest:r:c-api--abstract] +file_filter = c-api/abstract.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/abstract.po +source_file = c-api/abstract.po +resource_name = c-api--abstract + +[o:python-doc:p:python-newest:r:c-api--allocation] +file_filter = c-api/allocation.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/allocation.po +source_file = c-api/allocation.po +resource_name = c-api--allocation + +[o:python-doc:p:python-newest:r:c-api--apiabiversion] +file_filter = c-api/apiabiversion.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/apiabiversion.po +source_file = c-api/apiabiversion.po +resource_name = c-api--apiabiversion + +[o:python-doc:p:python-newest:r:c-api--arg] +file_filter = c-api/arg.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/arg.po +source_file = c-api/arg.po +resource_name = c-api--arg + +[o:python-doc:p:python-newest:r:c-api--bool] +file_filter = c-api/bool.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/bool.po +source_file = c-api/bool.po +resource_name = c-api--bool + +[o:python-doc:p:python-newest:r:c-api--buffer] +file_filter = c-api/buffer.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/buffer.po +source_file = c-api/buffer.po +resource_name = c-api--buffer + +[o:python-doc:p:python-newest:r:c-api--bytearray] +file_filter = c-api/bytearray.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/bytearray.po +source_file = c-api/bytearray.po +resource_name = c-api--bytearray + +[o:python-doc:p:python-newest:r:c-api--bytes] +file_filter = c-api/bytes.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/bytes.po +source_file = c-api/bytes.po +resource_name = c-api--bytes + +[o:python-doc:p:python-newest:r:c-api--call] +file_filter = c-api/call.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/call.po +source_file = c-api/call.po +resource_name = c-api--call + +[o:python-doc:p:python-newest:r:c-api--capsule] +file_filter = c-api/capsule.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/capsule.po +source_file = c-api/capsule.po +resource_name = c-api--capsule + +[o:python-doc:p:python-newest:r:c-api--cell] +file_filter = c-api/cell.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/cell.po +source_file = c-api/cell.po +resource_name = c-api--cell + +[o:python-doc:p:python-newest:r:c-api--code] +file_filter = c-api/code.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/code.po +source_file = c-api/code.po +resource_name = c-api--code + +[o:python-doc:p:python-newest:r:c-api--codec] +file_filter = c-api/codec.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/codec.po +source_file = c-api/codec.po +resource_name = c-api--codec + +[o:python-doc:p:python-newest:r:c-api--complex] +file_filter = c-api/complex.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/complex.po +source_file = c-api/complex.po +resource_name = c-api--complex + +[o:python-doc:p:python-newest:r:c-api--concrete] +file_filter = c-api/concrete.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/concrete.po +source_file = c-api/concrete.po +resource_name = c-api--concrete + +[o:python-doc:p:python-newest:r:c-api--contextvars] +file_filter = c-api/contextvars.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/contextvars.po +source_file = c-api/contextvars.po +resource_name = c-api--contextvars + +[o:python-doc:p:python-newest:r:c-api--conversion] +file_filter = c-api/conversion.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/conversion.po +source_file = c-api/conversion.po +resource_name = c-api--conversion + +[o:python-doc:p:python-newest:r:c-api--coro] +file_filter = c-api/coro.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/coro.po +source_file = c-api/coro.po +resource_name = c-api--coro + +[o:python-doc:p:python-newest:r:c-api--datetime] +file_filter = c-api/datetime.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/datetime.po +source_file = c-api/datetime.po +resource_name = c-api--datetime + +[o:python-doc:p:python-newest:r:c-api--descriptor] +file_filter = c-api/descriptor.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/descriptor.po +source_file = c-api/descriptor.po +resource_name = c-api--descriptor + +[o:python-doc:p:python-newest:r:c-api--dict] +file_filter = c-api/dict.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/dict.po +source_file = c-api/dict.po +resource_name = c-api--dict + +[o:python-doc:p:python-newest:r:c-api--exceptions] +file_filter = c-api/exceptions.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/exceptions.po +source_file = c-api/exceptions.po +resource_name = c-api--exceptions + +[o:python-doc:p:python-newest:r:c-api--file] +file_filter = c-api/file.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/file.po +source_file = c-api/file.po +resource_name = c-api--file + +[o:python-doc:p:python-newest:r:c-api--float] +file_filter = c-api/float.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/float.po +source_file = c-api/float.po +resource_name = c-api--float + +[o:python-doc:p:python-newest:r:c-api--frame] +file_filter = c-api/frame.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/frame.po +source_file = c-api/frame.po +resource_name = c-api--frame + +[o:python-doc:p:python-newest:r:c-api--function] +file_filter = c-api/function.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/function.po +source_file = c-api/function.po +resource_name = c-api--function + +[o:python-doc:p:python-newest:r:c-api--gcsupport] +file_filter = c-api/gcsupport.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/gcsupport.po +source_file = c-api/gcsupport.po +resource_name = c-api--gcsupport + +[o:python-doc:p:python-newest:r:c-api--gen] +file_filter = c-api/gen.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/gen.po +source_file = c-api/gen.po +resource_name = c-api--gen + +[o:python-doc:p:python-newest:r:c-api--hash] +file_filter = c-api/hash.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/hash.po +source_file = c-api/hash.po +resource_name = c-api--hash + +[o:python-doc:p:python-newest:r:c-api--import] +file_filter = c-api/import.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/import.po +source_file = c-api/import.po +resource_name = c-api--import + +[o:python-doc:p:python-newest:r:c-api--index] +file_filter = c-api/index.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/index.po +source_file = c-api/index.po +resource_name = c-api--index + +[o:python-doc:p:python-newest:r:c-api--init] +file_filter = c-api/init.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/init.po +source_file = c-api/init.po +resource_name = c-api--init + +[o:python-doc:p:python-newest:r:c-api--init_config] +file_filter = c-api/init_config.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/init_config.po +source_file = c-api/init_config.po +resource_name = c-api--init_config + +[o:python-doc:p:python-newest:r:c-api--intro] +file_filter = c-api/intro.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/intro.po +source_file = c-api/intro.po +resource_name = c-api--intro + +[o:python-doc:p:python-newest:r:c-api--iter] +file_filter = c-api/iter.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/iter.po +source_file = c-api/iter.po +resource_name = c-api--iter + +[o:python-doc:p:python-newest:r:c-api--iterator] +file_filter = c-api/iterator.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/iterator.po +source_file = c-api/iterator.po +resource_name = c-api--iterator + +[o:python-doc:p:python-newest:r:c-api--list] +file_filter = c-api/list.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/list.po +source_file = c-api/list.po +resource_name = c-api--list + +[o:python-doc:p:python-newest:r:c-api--long] +file_filter = c-api/long.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/long.po +source_file = c-api/long.po +resource_name = c-api--long + +[o:python-doc:p:python-newest:r:c-api--mapping] +file_filter = c-api/mapping.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/mapping.po +source_file = c-api/mapping.po +resource_name = c-api--mapping + +[o:python-doc:p:python-newest:r:c-api--marshal] +file_filter = c-api/marshal.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/marshal.po +source_file = c-api/marshal.po +resource_name = c-api--marshal + +[o:python-doc:p:python-newest:r:c-api--memory] +file_filter = c-api/memory.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/memory.po +source_file = c-api/memory.po +resource_name = c-api--memory + +[o:python-doc:p:python-newest:r:c-api--memoryview] +file_filter = c-api/memoryview.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/memoryview.po +source_file = c-api/memoryview.po +resource_name = c-api--memoryview + +[o:python-doc:p:python-newest:r:c-api--method] +file_filter = c-api/method.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/method.po +source_file = c-api/method.po +resource_name = c-api--method + +[o:python-doc:p:python-newest:r:c-api--module] +file_filter = c-api/module.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/module.po +source_file = c-api/module.po +resource_name = c-api--module + +[o:python-doc:p:python-newest:r:c-api--monitoring] +file_filter = c-api/monitoring.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/monitoring.po +source_file = c-api/monitoring.po +resource_name = c-api--monitoring + +[o:python-doc:p:python-newest:r:c-api--none] +file_filter = c-api/none.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/none.po +source_file = c-api/none.po +resource_name = c-api--none + +[o:python-doc:p:python-newest:r:c-api--number] +file_filter = c-api/number.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/number.po +source_file = c-api/number.po +resource_name = c-api--number + +[o:python-doc:p:python-newest:r:c-api--object] +file_filter = c-api/object.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/object.po +source_file = c-api/object.po +resource_name = c-api--object + +[o:python-doc:p:python-newest:r:c-api--objimpl] +file_filter = c-api/objimpl.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/objimpl.po +source_file = c-api/objimpl.po +resource_name = c-api--objimpl + +[o:python-doc:p:python-newest:r:c-api--perfmaps] +file_filter = c-api/perfmaps.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/perfmaps.po +source_file = c-api/perfmaps.po +resource_name = c-api--perfmaps + +[o:python-doc:p:python-newest:r:c-api--refcounting] +file_filter = c-api/refcounting.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/refcounting.po +source_file = c-api/refcounting.po +resource_name = c-api--refcounting + +[o:python-doc:p:python-newest:r:c-api--reflection] +file_filter = c-api/reflection.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/reflection.po +source_file = c-api/reflection.po +resource_name = c-api--reflection + +[o:python-doc:p:python-newest:r:c-api--sequence] +file_filter = c-api/sequence.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/sequence.po +source_file = c-api/sequence.po +resource_name = c-api--sequence + +[o:python-doc:p:python-newest:r:c-api--set] +file_filter = c-api/set.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/set.po +source_file = c-api/set.po +resource_name = c-api--set + +[o:python-doc:p:python-newest:r:c-api--slice] +file_filter = c-api/slice.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/slice.po +source_file = c-api/slice.po +resource_name = c-api--slice + +[o:python-doc:p:python-newest:r:c-api--stable] +file_filter = c-api/stable.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/stable.po +source_file = c-api/stable.po +resource_name = c-api--stable + +[o:python-doc:p:python-newest:r:c-api--structures] +file_filter = c-api/structures.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/structures.po +source_file = c-api/structures.po +resource_name = c-api--structures + +[o:python-doc:p:python-newest:r:c-api--sys] +file_filter = c-api/sys.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/sys.po +source_file = c-api/sys.po +resource_name = c-api--sys + +[o:python-doc:p:python-newest:r:c-api--time] +file_filter = c-api/time.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/time.po +source_file = c-api/time.po +resource_name = c-api--time + +[o:python-doc:p:python-newest:r:c-api--tuple] +file_filter = c-api/tuple.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/tuple.po +source_file = c-api/tuple.po +resource_name = c-api--tuple + +[o:python-doc:p:python-newest:r:c-api--type] +file_filter = c-api/type.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/type.po +source_file = c-api/type.po +resource_name = c-api--type + +[o:python-doc:p:python-newest:r:c-api--typehints] +file_filter = c-api/typehints.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/typehints.po +source_file = c-api/typehints.po +resource_name = c-api--typehints + +[o:python-doc:p:python-newest:r:c-api--typeobj] +file_filter = c-api/typeobj.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/typeobj.po +source_file = c-api/typeobj.po +resource_name = c-api--typeobj + +[o:python-doc:p:python-newest:r:c-api--unicode] +file_filter = c-api/unicode.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/unicode.po +source_file = c-api/unicode.po +resource_name = c-api--unicode + +[o:python-doc:p:python-newest:r:c-api--utilities] +file_filter = c-api/utilities.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/utilities.po +source_file = c-api/utilities.po +resource_name = c-api--utilities + +[o:python-doc:p:python-newest:r:c-api--veryhigh] +file_filter = c-api/veryhigh.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/veryhigh.po +source_file = c-api/veryhigh.po +resource_name = c-api--veryhigh + +[o:python-doc:p:python-newest:r:c-api--weakref] +file_filter = c-api/weakref.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = c-api/weakref.po +source_file = c-api/weakref.po +resource_name = c-api--weakref + +[o:python-doc:p:python-newest:r:contents] +file_filter = contents.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = contents.po +source_file = contents.po +resource_name = contents + +[o:python-doc:p:python-newest:r:copyright] +file_filter = copyright.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = copyright.po +source_file = copyright.po +resource_name = copyright + +[o:python-doc:p:python-newest:r:deprecations--c-api-pending-removal-in-3_14] +file_filter = deprecations/c-api-pending-removal-in-3_14.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = deprecations/c-api-pending-removal-in-3_14.po +source_file = deprecations/c-api-pending-removal-in-3_14.po +resource_name = deprecations--c-api-pending-removal-in-3_14 + +[o:python-doc:p:python-newest:r:deprecations--c-api-pending-removal-in-3_15] +file_filter = deprecations/c-api-pending-removal-in-3_15.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = deprecations/c-api-pending-removal-in-3_15.po +source_file = deprecations/c-api-pending-removal-in-3_15.po +resource_name = deprecations--c-api-pending-removal-in-3_15 + +[o:python-doc:p:python-newest:r:deprecations--c-api-pending-removal-in-future] +file_filter = deprecations/c-api-pending-removal-in-future.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = deprecations/c-api-pending-removal-in-future.po +source_file = deprecations/c-api-pending-removal-in-future.po +resource_name = deprecations--c-api-pending-removal-in-future + +[o:python-doc:p:python-newest:r:deprecations--index] +file_filter = deprecations/index.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = deprecations/index.po +source_file = deprecations/index.po +resource_name = deprecations--index + +[o:python-doc:p:python-newest:r:deprecations--pending-removal-in-3_13] +file_filter = deprecations/pending-removal-in-3_13.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = deprecations/pending-removal-in-3_13.po +source_file = deprecations/pending-removal-in-3_13.po +resource_name = deprecations--pending-removal-in-3_13 + +[o:python-doc:p:python-newest:r:deprecations--pending-removal-in-3_14] +file_filter = deprecations/pending-removal-in-3_14.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = deprecations/pending-removal-in-3_14.po +source_file = deprecations/pending-removal-in-3_14.po +resource_name = deprecations--pending-removal-in-3_14 + +[o:python-doc:p:python-newest:r:deprecations--pending-removal-in-3_15] +file_filter = deprecations/pending-removal-in-3_15.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = deprecations/pending-removal-in-3_15.po +source_file = deprecations/pending-removal-in-3_15.po +resource_name = deprecations--pending-removal-in-3_15 + +[o:python-doc:p:python-newest:r:deprecations--pending-removal-in-3_16] +file_filter = deprecations/pending-removal-in-3_16.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = deprecations/pending-removal-in-3_16.po +source_file = deprecations/pending-removal-in-3_16.po +resource_name = deprecations--pending-removal-in-3_16 + +[o:python-doc:p:python-newest:r:deprecations--pending-removal-in-future] +file_filter = deprecations/pending-removal-in-future.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = deprecations/pending-removal-in-future.po +source_file = deprecations/pending-removal-in-future.po +resource_name = deprecations--pending-removal-in-future + +[o:python-doc:p:python-newest:r:distributing--index] +file_filter = distributing/index.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = distributing/index.po +source_file = distributing/index.po +resource_name = distributing--index + +[o:python-doc:p:python-newest:r:extending--building] +file_filter = extending/building.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = extending/building.po +source_file = extending/building.po +resource_name = extending--building + +[o:python-doc:p:python-newest:r:extending--embedding] +file_filter = extending/embedding.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = extending/embedding.po +source_file = extending/embedding.po +resource_name = extending--embedding + +[o:python-doc:p:python-newest:r:extending--extending] +file_filter = extending/extending.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = extending/extending.po +source_file = extending/extending.po +resource_name = extending--extending + +[o:python-doc:p:python-newest:r:extending--index] +file_filter = extending/index.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = extending/index.po +source_file = extending/index.po +resource_name = extending--index + +[o:python-doc:p:python-newest:r:extending--newtypes] +file_filter = extending/newtypes.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = extending/newtypes.po +source_file = extending/newtypes.po +resource_name = extending--newtypes + +[o:python-doc:p:python-newest:r:extending--newtypes_tutorial] +file_filter = extending/newtypes_tutorial.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = extending/newtypes_tutorial.po +source_file = extending/newtypes_tutorial.po +resource_name = extending--newtypes_tutorial + +[o:python-doc:p:python-newest:r:extending--windows] +file_filter = extending/windows.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = extending/windows.po +source_file = extending/windows.po +resource_name = extending--windows + +[o:python-doc:p:python-newest:r:faq--design] +file_filter = faq/design.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = faq/design.po +source_file = faq/design.po +resource_name = faq--design + +[o:python-doc:p:python-newest:r:faq--extending] +file_filter = faq/extending.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = faq/extending.po +source_file = faq/extending.po +resource_name = faq--extending + +[o:python-doc:p:python-newest:r:faq--general] +file_filter = faq/general.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = faq/general.po +source_file = faq/general.po +resource_name = faq--general + +[o:python-doc:p:python-newest:r:faq--gui] +file_filter = faq/gui.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = faq/gui.po +source_file = faq/gui.po +resource_name = faq--gui + +[o:python-doc:p:python-newest:r:faq--index] +file_filter = faq/index.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = faq/index.po +source_file = faq/index.po +resource_name = faq--index + +[o:python-doc:p:python-newest:r:faq--installed] +file_filter = faq/installed.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = faq/installed.po +source_file = faq/installed.po +resource_name = faq--installed + +[o:python-doc:p:python-newest:r:faq--library] +file_filter = faq/library.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = faq/library.po +source_file = faq/library.po +resource_name = faq--library + +[o:python-doc:p:python-newest:r:faq--programming] +file_filter = faq/programming.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = faq/programming.po +source_file = faq/programming.po +resource_name = faq--programming + +[o:python-doc:p:python-newest:r:faq--windows] +file_filter = faq/windows.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = faq/windows.po +source_file = faq/windows.po +resource_name = faq--windows + +[o:python-doc:p:python-newest:r:glossary_] +file_filter = glossary.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = glossary.po +source_file = glossary.po +resource_name = glossary_ + +[o:python-doc:p:python-newest:r:howto--annotations] +file_filter = howto/annotations.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = howto/annotations.po +source_file = howto/annotations.po +resource_name = howto--annotations + +[o:python-doc:p:python-newest:r:howto--argparse] +file_filter = howto/argparse.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = howto/argparse.po +source_file = howto/argparse.po +resource_name = howto--argparse + +[o:python-doc:p:python-newest:r:howto--argparse-optparse] +file_filter = howto/argparse-optparse.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = howto/argparse-optparse.po +source_file = howto/argparse-optparse.po +resource_name = howto--argparse-optparse + +[o:python-doc:p:python-newest:r:howto--clinic] +file_filter = howto/clinic.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = howto/clinic.po +source_file = howto/clinic.po +resource_name = howto--clinic + +[o:python-doc:p:python-newest:r:howto--cporting] +file_filter = howto/cporting.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = howto/cporting.po +source_file = howto/cporting.po +resource_name = howto--cporting + +[o:python-doc:p:python-newest:r:howto--curses] +file_filter = howto/curses.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = howto/curses.po +source_file = howto/curses.po +resource_name = howto--curses + +[o:python-doc:p:python-newest:r:howto--descriptor] +file_filter = howto/descriptor.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = howto/descriptor.po +source_file = howto/descriptor.po +resource_name = howto--descriptor + +[o:python-doc:p:python-newest:r:howto--enum] +file_filter = howto/enum.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = howto/enum.po +source_file = howto/enum.po +resource_name = howto--enum + +[o:python-doc:p:python-newest:r:howto--free-threading-extensions] +file_filter = howto/free-threading-extensions.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = howto/free-threading-extensions.po +source_file = howto/free-threading-extensions.po +resource_name = howto--free-threading-extensions + +[o:python-doc:p:python-newest:r:howto--free-threading-python] +file_filter = howto/free-threading-python.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = howto/free-threading-python.po +source_file = howto/free-threading-python.po +resource_name = howto--free-threading-python + +[o:python-doc:p:python-newest:r:howto--functional] +file_filter = howto/functional.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = howto/functional.po +source_file = howto/functional.po +resource_name = howto--functional + +[o:python-doc:p:python-newest:r:howto--gdb_helpers] +file_filter = howto/gdb_helpers.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = howto/gdb_helpers.po +source_file = howto/gdb_helpers.po +resource_name = howto--gdb_helpers + +[o:python-doc:p:python-newest:r:howto--index] +file_filter = howto/index.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = howto/index.po +source_file = howto/index.po +resource_name = howto--index + +[o:python-doc:p:python-newest:r:howto--instrumentation] +file_filter = howto/instrumentation.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = howto/instrumentation.po +source_file = howto/instrumentation.po +resource_name = howto--instrumentation + +[o:python-doc:p:python-newest:r:howto--ipaddress] +file_filter = howto/ipaddress.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = howto/ipaddress.po +source_file = howto/ipaddress.po +resource_name = howto--ipaddress + +[o:python-doc:p:python-newest:r:howto--isolating-extensions] +file_filter = howto/isolating-extensions.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = howto/isolating-extensions.po +source_file = howto/isolating-extensions.po +resource_name = howto--isolating-extensions + +[o:python-doc:p:python-newest:r:howto--logging] +file_filter = howto/logging.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = howto/logging.po +source_file = howto/logging.po +resource_name = howto--logging + +[o:python-doc:p:python-newest:r:howto--logging-cookbook] +file_filter = howto/logging-cookbook.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = howto/logging-cookbook.po +source_file = howto/logging-cookbook.po +resource_name = howto--logging-cookbook + +[o:python-doc:p:python-newest:r:howto--mro] +file_filter = howto/mro.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = howto/mro.po +source_file = howto/mro.po +resource_name = howto--mro + +[o:python-doc:p:python-newest:r:howto--perf_profiling] +file_filter = howto/perf_profiling.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = howto/perf_profiling.po +source_file = howto/perf_profiling.po +resource_name = howto--perf_profiling + +[o:python-doc:p:python-newest:r:howto--pyporting] +file_filter = howto/pyporting.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = howto/pyporting.po +source_file = howto/pyporting.po +resource_name = howto--pyporting + +[o:python-doc:p:python-newest:r:howto--regex] +file_filter = howto/regex.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = howto/regex.po +source_file = howto/regex.po +resource_name = howto--regex + +[o:python-doc:p:python-newest:r:howto--sockets] +file_filter = howto/sockets.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = howto/sockets.po +source_file = howto/sockets.po +resource_name = howto--sockets + +[o:python-doc:p:python-newest:r:howto--sorting] +file_filter = howto/sorting.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = howto/sorting.po +source_file = howto/sorting.po +resource_name = howto--sorting + +[o:python-doc:p:python-newest:r:howto--timerfd] +file_filter = howto/timerfd.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = howto/timerfd.po +source_file = howto/timerfd.po +resource_name = howto--timerfd + +[o:python-doc:p:python-newest:r:howto--unicode] +file_filter = howto/unicode.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = howto/unicode.po +source_file = howto/unicode.po +resource_name = howto--unicode + +[o:python-doc:p:python-newest:r:howto--urllib2] +file_filter = howto/urllib2.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = howto/urllib2.po +source_file = howto/urllib2.po +resource_name = howto--urllib2 + +[o:python-doc:p:python-newest:r:installing--index] +file_filter = installing/index.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = installing/index.po +source_file = installing/index.po +resource_name = installing--index + +[o:python-doc:p:python-newest:r:library--abc] +file_filter = library/abc.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/abc.po +source_file = library/abc.po +resource_name = library--abc + +[o:python-doc:p:python-newest:r:library--aifc] +file_filter = library/aifc.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/aifc.po +source_file = library/aifc.po +resource_name = library--aifc + +[o:python-doc:p:python-newest:r:library--allos] +file_filter = library/allos.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/allos.po +source_file = library/allos.po +resource_name = library--allos + +[o:python-doc:p:python-newest:r:library--archiving] +file_filter = library/archiving.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/archiving.po +source_file = library/archiving.po +resource_name = library--archiving + +[o:python-doc:p:python-newest:r:library--argparse] +file_filter = library/argparse.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/argparse.po +source_file = library/argparse.po +resource_name = library--argparse + +[o:python-doc:p:python-newest:r:library--array] +file_filter = library/array.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/array.po +source_file = library/array.po +resource_name = library--array + +[o:python-doc:p:python-newest:r:library--ast] +file_filter = library/ast.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/ast.po +source_file = library/ast.po +resource_name = library--ast + +[o:python-doc:p:python-newest:r:library--asynchat] +file_filter = library/asynchat.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/asynchat.po +source_file = library/asynchat.po +resource_name = library--asynchat + +[o:python-doc:p:python-newest:r:library--asyncio] +file_filter = library/asyncio.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/asyncio.po +source_file = library/asyncio.po +resource_name = library--asyncio + +[o:python-doc:p:python-newest:r:library--asyncio-api-index] +file_filter = library/asyncio-api-index.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/asyncio-api-index.po +source_file = library/asyncio-api-index.po +resource_name = library--asyncio-api-index + +[o:python-doc:p:python-newest:r:library--asyncio-dev] +file_filter = library/asyncio-dev.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/asyncio-dev.po +source_file = library/asyncio-dev.po +resource_name = library--asyncio-dev + +[o:python-doc:p:python-newest:r:library--asyncio-eventloop] +file_filter = library/asyncio-eventloop.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/asyncio-eventloop.po +source_file = library/asyncio-eventloop.po +resource_name = library--asyncio-eventloop + +[o:python-doc:p:python-newest:r:library--asyncio-exceptions] +file_filter = library/asyncio-exceptions.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/asyncio-exceptions.po +source_file = library/asyncio-exceptions.po +resource_name = library--asyncio-exceptions + +[o:python-doc:p:python-newest:r:library--asyncio-extending] +file_filter = library/asyncio-extending.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/asyncio-extending.po +source_file = library/asyncio-extending.po +resource_name = library--asyncio-extending + +[o:python-doc:p:python-newest:r:library--asyncio-future] +file_filter = library/asyncio-future.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/asyncio-future.po +source_file = library/asyncio-future.po +resource_name = library--asyncio-future + +[o:python-doc:p:python-newest:r:library--asyncio-llapi-index] +file_filter = library/asyncio-llapi-index.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/asyncio-llapi-index.po +source_file = library/asyncio-llapi-index.po +resource_name = library--asyncio-llapi-index + +[o:python-doc:p:python-newest:r:library--asyncio-platforms] +file_filter = library/asyncio-platforms.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/asyncio-platforms.po +source_file = library/asyncio-platforms.po +resource_name = library--asyncio-platforms + +[o:python-doc:p:python-newest:r:library--asyncio-policy] +file_filter = library/asyncio-policy.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/asyncio-policy.po +source_file = library/asyncio-policy.po +resource_name = library--asyncio-policy + +[o:python-doc:p:python-newest:r:library--asyncio-protocol] +file_filter = library/asyncio-protocol.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/asyncio-protocol.po +source_file = library/asyncio-protocol.po +resource_name = library--asyncio-protocol + +[o:python-doc:p:python-newest:r:library--asyncio-queue] +file_filter = library/asyncio-queue.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/asyncio-queue.po +source_file = library/asyncio-queue.po +resource_name = library--asyncio-queue + +[o:python-doc:p:python-newest:r:library--asyncio-runner] +file_filter = library/asyncio-runner.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/asyncio-runner.po +source_file = library/asyncio-runner.po +resource_name = library--asyncio-runner + +[o:python-doc:p:python-newest:r:library--asyncio-stream] +file_filter = library/asyncio-stream.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/asyncio-stream.po +source_file = library/asyncio-stream.po +resource_name = library--asyncio-stream + +[o:python-doc:p:python-newest:r:library--asyncio-subprocess] +file_filter = library/asyncio-subprocess.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/asyncio-subprocess.po +source_file = library/asyncio-subprocess.po +resource_name = library--asyncio-subprocess + +[o:python-doc:p:python-newest:r:library--asyncio-sync] +file_filter = library/asyncio-sync.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/asyncio-sync.po +source_file = library/asyncio-sync.po +resource_name = library--asyncio-sync + +[o:python-doc:p:python-newest:r:library--asyncio-task] +file_filter = library/asyncio-task.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/asyncio-task.po +source_file = library/asyncio-task.po +resource_name = library--asyncio-task + +[o:python-doc:p:python-newest:r:library--asyncore] +file_filter = library/asyncore.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/asyncore.po +source_file = library/asyncore.po +resource_name = library--asyncore + +[o:python-doc:p:python-newest:r:library--atexit] +file_filter = library/atexit.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/atexit.po +source_file = library/atexit.po +resource_name = library--atexit + +[o:python-doc:p:python-newest:r:library--audioop] +file_filter = library/audioop.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/audioop.po +source_file = library/audioop.po +resource_name = library--audioop + +[o:python-doc:p:python-newest:r:library--audit_events] +file_filter = library/audit_events.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/audit_events.po +source_file = library/audit_events.po +resource_name = library--audit_events + +[o:python-doc:p:python-newest:r:library--base64] +file_filter = library/base64.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/base64.po +source_file = library/base64.po +resource_name = library--base64 + +[o:python-doc:p:python-newest:r:library--bdb] +file_filter = library/bdb.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/bdb.po +source_file = library/bdb.po +resource_name = library--bdb + +[o:python-doc:p:python-newest:r:library--binary] +file_filter = library/binary.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/binary.po +source_file = library/binary.po +resource_name = library--binary + +[o:python-doc:p:python-newest:r:library--binascii] +file_filter = library/binascii.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/binascii.po +source_file = library/binascii.po +resource_name = library--binascii + +[o:python-doc:p:python-newest:r:library--bisect] +file_filter = library/bisect.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/bisect.po +source_file = library/bisect.po +resource_name = library--bisect + +[o:python-doc:p:python-newest:r:library--builtins] +file_filter = library/builtins.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/builtins.po +source_file = library/builtins.po +resource_name = library--builtins + +[o:python-doc:p:python-newest:r:library--bz2] +file_filter = library/bz2.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/bz2.po +source_file = library/bz2.po +resource_name = library--bz2 + +[o:python-doc:p:python-newest:r:library--calendar] +file_filter = library/calendar.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/calendar.po +source_file = library/calendar.po +resource_name = library--calendar + +[o:python-doc:p:python-newest:r:library--cgi] +file_filter = library/cgi.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/cgi.po +source_file = library/cgi.po +resource_name = library--cgi + +[o:python-doc:p:python-newest:r:library--cgitb] +file_filter = library/cgitb.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/cgitb.po +source_file = library/cgitb.po +resource_name = library--cgitb + +[o:python-doc:p:python-newest:r:library--chunk] +file_filter = library/chunk.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/chunk.po +source_file = library/chunk.po +resource_name = library--chunk + +[o:python-doc:p:python-newest:r:library--cmath] +file_filter = library/cmath.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/cmath.po +source_file = library/cmath.po +resource_name = library--cmath + +[o:python-doc:p:python-newest:r:library--cmd] +file_filter = library/cmd.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/cmd.po +source_file = library/cmd.po +resource_name = library--cmd + +[o:python-doc:p:python-newest:r:library--cmdline] +file_filter = library/cmdline.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/cmdline.po +source_file = library/cmdline.po +resource_name = library--cmdline + +[o:python-doc:p:python-newest:r:library--cmdlinelibs] +file_filter = library/cmdlinelibs.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/cmdlinelibs.po +source_file = library/cmdlinelibs.po +resource_name = library--cmdlinelibs + +[o:python-doc:p:python-newest:r:library--code] +file_filter = library/code.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/code.po +source_file = library/code.po +resource_name = library--code + +[o:python-doc:p:python-newest:r:library--codecs] +file_filter = library/codecs.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/codecs.po +source_file = library/codecs.po +resource_name = library--codecs + +[o:python-doc:p:python-newest:r:library--codeop] +file_filter = library/codeop.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/codeop.po +source_file = library/codeop.po +resource_name = library--codeop + +[o:python-doc:p:python-newest:r:library--collections] +file_filter = library/collections.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/collections.po +source_file = library/collections.po +resource_name = library--collections + +[o:python-doc:p:python-newest:r:library--collections_abc] +file_filter = library/collections_abc.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/collections_abc.po +source_file = library/collections_abc.po +resource_name = library--collections_abc + +[o:python-doc:p:python-newest:r:library--colorsys] +file_filter = library/colorsys.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/colorsys.po +source_file = library/colorsys.po +resource_name = library--colorsys + +[o:python-doc:p:python-newest:r:library--compileall] +file_filter = library/compileall.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/compileall.po +source_file = library/compileall.po +resource_name = library--compileall + +[o:python-doc:p:python-newest:r:library--concurrency] +file_filter = library/concurrency.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/concurrency.po +source_file = library/concurrency.po +resource_name = library--concurrency + +[o:python-doc:p:python-newest:r:library--concurrent] +file_filter = library/concurrent.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/concurrent.po +source_file = library/concurrent.po +resource_name = library--concurrent + +[o:python-doc:p:python-newest:r:library--concurrent_futures] +file_filter = library/concurrent_futures.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/concurrent_futures.po +source_file = library/concurrent_futures.po +resource_name = library--concurrent_futures + +[o:python-doc:p:python-newest:r:library--configparser] +file_filter = library/configparser.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/configparser.po +source_file = library/configparser.po +resource_name = library--configparser + +[o:python-doc:p:python-newest:r:library--constants] +file_filter = library/constants.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/constants.po +source_file = library/constants.po +resource_name = library--constants + +[o:python-doc:p:python-newest:r:library--contextlib] +file_filter = library/contextlib.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/contextlib.po +source_file = library/contextlib.po +resource_name = library--contextlib + +[o:python-doc:p:python-newest:r:library--contextvars] +file_filter = library/contextvars.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/contextvars.po +source_file = library/contextvars.po +resource_name = library--contextvars + +[o:python-doc:p:python-newest:r:library--copy] +file_filter = library/copy.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/copy.po +source_file = library/copy.po +resource_name = library--copy + +[o:python-doc:p:python-newest:r:library--copyreg] +file_filter = library/copyreg.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/copyreg.po +source_file = library/copyreg.po +resource_name = library--copyreg + +[o:python-doc:p:python-newest:r:library--crypt] +file_filter = library/crypt.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/crypt.po +source_file = library/crypt.po +resource_name = library--crypt + +[o:python-doc:p:python-newest:r:library--crypto] +file_filter = library/crypto.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/crypto.po +source_file = library/crypto.po +resource_name = library--crypto + +[o:python-doc:p:python-newest:r:library--csv] +file_filter = library/csv.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/csv.po +source_file = library/csv.po +resource_name = library--csv + +[o:python-doc:p:python-newest:r:library--ctypes] +file_filter = library/ctypes.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/ctypes.po +source_file = library/ctypes.po +resource_name = library--ctypes + +[o:python-doc:p:python-newest:r:library--curses] +file_filter = library/curses.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/curses.po +source_file = library/curses.po +resource_name = library--curses + +[o:python-doc:p:python-newest:r:library--curses_ascii] +file_filter = library/curses_ascii.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/curses_ascii.po +source_file = library/curses_ascii.po +resource_name = library--curses_ascii + +[o:python-doc:p:python-newest:r:library--curses_panel] +file_filter = library/curses_panel.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/curses_panel.po +source_file = library/curses_panel.po +resource_name = library--curses_panel + +[o:python-doc:p:python-newest:r:library--custominterp] +file_filter = library/custominterp.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/custominterp.po +source_file = library/custominterp.po +resource_name = library--custominterp + +[o:python-doc:p:python-newest:r:library--dataclasses] +file_filter = library/dataclasses.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/dataclasses.po +source_file = library/dataclasses.po +resource_name = library--dataclasses + +[o:python-doc:p:python-newest:r:library--datatypes] +file_filter = library/datatypes.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/datatypes.po +source_file = library/datatypes.po +resource_name = library--datatypes + +[o:python-doc:p:python-newest:r:library--datetime] +file_filter = library/datetime.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/datetime.po +source_file = library/datetime.po +resource_name = library--datetime + +[o:python-doc:p:python-newest:r:library--dbm] +file_filter = library/dbm.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/dbm.po +source_file = library/dbm.po +resource_name = library--dbm + +[o:python-doc:p:python-newest:r:library--debug] +file_filter = library/debug.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/debug.po +source_file = library/debug.po +resource_name = library--debug + +[o:python-doc:p:python-newest:r:library--decimal] +file_filter = library/decimal.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/decimal.po +source_file = library/decimal.po +resource_name = library--decimal + +[o:python-doc:p:python-newest:r:library--development] +file_filter = library/development.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/development.po +source_file = library/development.po +resource_name = library--development + +[o:python-doc:p:python-newest:r:library--devmode] +file_filter = library/devmode.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/devmode.po +source_file = library/devmode.po +resource_name = library--devmode + +[o:python-doc:p:python-newest:r:library--dialog] +file_filter = library/dialog.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/dialog.po +source_file = library/dialog.po +resource_name = library--dialog + +[o:python-doc:p:python-newest:r:library--difflib] +file_filter = library/difflib.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/difflib.po +source_file = library/difflib.po +resource_name = library--difflib + +[o:python-doc:p:python-newest:r:library--dis] +file_filter = library/dis.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/dis.po +source_file = library/dis.po +resource_name = library--dis + +[o:python-doc:p:python-newest:r:library--distribution] +file_filter = library/distribution.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/distribution.po +source_file = library/distribution.po +resource_name = library--distribution + +[o:python-doc:p:python-newest:r:library--distutils] +file_filter = library/distutils.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/distutils.po +source_file = library/distutils.po +resource_name = library--distutils + +[o:python-doc:p:python-newest:r:library--doctest] +file_filter = library/doctest.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/doctest.po +source_file = library/doctest.po +resource_name = library--doctest + +[o:python-doc:p:python-newest:r:library--email] +file_filter = library/email.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/email.po +source_file = library/email.po +resource_name = library--email + +[o:python-doc:p:python-newest:r:library--email_charset] +file_filter = library/email_charset.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/email_charset.po +source_file = library/email_charset.po +resource_name = library--email_charset + +[o:python-doc:p:python-newest:r:library--email_compat32-message] +file_filter = library/email_compat32-message.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/email_compat32-message.po +source_file = library/email_compat32-message.po +resource_name = library--email_compat32-message + +[o:python-doc:p:python-newest:r:library--email_contentmanager] +file_filter = library/email_contentmanager.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/email_contentmanager.po +source_file = library/email_contentmanager.po +resource_name = library--email_contentmanager + +[o:python-doc:p:python-newest:r:library--email_encoders] +file_filter = library/email_encoders.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/email_encoders.po +source_file = library/email_encoders.po +resource_name = library--email_encoders + +[o:python-doc:p:python-newest:r:library--email_errors] +file_filter = library/email_errors.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/email_errors.po +source_file = library/email_errors.po +resource_name = library--email_errors + +[o:python-doc:p:python-newest:r:library--email_examples] +file_filter = library/email_examples.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/email_examples.po +source_file = library/email_examples.po +resource_name = library--email_examples + +[o:python-doc:p:python-newest:r:library--email_generator] +file_filter = library/email_generator.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/email_generator.po +source_file = library/email_generator.po +resource_name = library--email_generator + +[o:python-doc:p:python-newest:r:library--email_header] +file_filter = library/email_header.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/email_header.po +source_file = library/email_header.po +resource_name = library--email_header + +[o:python-doc:p:python-newest:r:library--email_headerregistry] +file_filter = library/email_headerregistry.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/email_headerregistry.po +source_file = library/email_headerregistry.po +resource_name = library--email_headerregistry + +[o:python-doc:p:python-newest:r:library--email_iterators] +file_filter = library/email_iterators.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/email_iterators.po +source_file = library/email_iterators.po +resource_name = library--email_iterators + +[o:python-doc:p:python-newest:r:library--email_message] +file_filter = library/email_message.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/email_message.po +source_file = library/email_message.po +resource_name = library--email_message + +[o:python-doc:p:python-newest:r:library--email_mime] +file_filter = library/email_mime.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/email_mime.po +source_file = library/email_mime.po +resource_name = library--email_mime + +[o:python-doc:p:python-newest:r:library--email_parser] +file_filter = library/email_parser.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/email_parser.po +source_file = library/email_parser.po +resource_name = library--email_parser + +[o:python-doc:p:python-newest:r:library--email_policy] +file_filter = library/email_policy.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/email_policy.po +source_file = library/email_policy.po +resource_name = library--email_policy + +[o:python-doc:p:python-newest:r:library--email_utils] +file_filter = library/email_utils.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/email_utils.po +source_file = library/email_utils.po +resource_name = library--email_utils + +[o:python-doc:p:python-newest:r:library--ensurepip] +file_filter = library/ensurepip.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/ensurepip.po +source_file = library/ensurepip.po +resource_name = library--ensurepip + +[o:python-doc:p:python-newest:r:library--enum] +file_filter = library/enum.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/enum.po +source_file = library/enum.po +resource_name = library--enum + +[o:python-doc:p:python-newest:r:library--errno] +file_filter = library/errno.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/errno.po +source_file = library/errno.po +resource_name = library--errno + +[o:python-doc:p:python-newest:r:library--exceptions] +file_filter = library/exceptions.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/exceptions.po +source_file = library/exceptions.po +resource_name = library--exceptions + +[o:python-doc:p:python-newest:r:library--faulthandler] +file_filter = library/faulthandler.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/faulthandler.po +source_file = library/faulthandler.po +resource_name = library--faulthandler + +[o:python-doc:p:python-newest:r:library--fcntl] +file_filter = library/fcntl.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/fcntl.po +source_file = library/fcntl.po +resource_name = library--fcntl + +[o:python-doc:p:python-newest:r:library--filecmp] +file_filter = library/filecmp.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/filecmp.po +source_file = library/filecmp.po +resource_name = library--filecmp + +[o:python-doc:p:python-newest:r:library--fileformats] +file_filter = library/fileformats.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/fileformats.po +source_file = library/fileformats.po +resource_name = library--fileformats + +[o:python-doc:p:python-newest:r:library--fileinput] +file_filter = library/fileinput.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/fileinput.po +source_file = library/fileinput.po +resource_name = library--fileinput + +[o:python-doc:p:python-newest:r:library--filesys] +file_filter = library/filesys.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/filesys.po +source_file = library/filesys.po +resource_name = library--filesys + +[o:python-doc:p:python-newest:r:library--fnmatch] +file_filter = library/fnmatch.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/fnmatch.po +source_file = library/fnmatch.po +resource_name = library--fnmatch + +[o:python-doc:p:python-newest:r:library--fractions] +file_filter = library/fractions.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/fractions.po +source_file = library/fractions.po +resource_name = library--fractions + +[o:python-doc:p:python-newest:r:library--frameworks] +file_filter = library/frameworks.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/frameworks.po +source_file = library/frameworks.po +resource_name = library--frameworks + +[o:python-doc:p:python-newest:r:library--ftplib] +file_filter = library/ftplib.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/ftplib.po +source_file = library/ftplib.po +resource_name = library--ftplib + +[o:python-doc:p:python-newest:r:library--functional] +file_filter = library/functional.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/functional.po +source_file = library/functional.po +resource_name = library--functional + +[o:python-doc:p:python-newest:r:library--functions] +file_filter = library/functions.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/functions.po +source_file = library/functions.po +resource_name = library--functions + +[o:python-doc:p:python-newest:r:library--functools] +file_filter = library/functools.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/functools.po +source_file = library/functools.po +resource_name = library--functools + +[o:python-doc:p:python-newest:r:library--__future__] +file_filter = library/__future__.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/__future__.po +source_file = library/__future__.po +resource_name = library--__future__ + +[o:python-doc:p:python-newest:r:library--gc] +file_filter = library/gc.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/gc.po +source_file = library/gc.po +resource_name = library--gc + +[o:python-doc:p:python-newest:r:library--getopt] +file_filter = library/getopt.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/getopt.po +source_file = library/getopt.po +resource_name = library--getopt + +[o:python-doc:p:python-newest:r:library--getpass] +file_filter = library/getpass.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/getpass.po +source_file = library/getpass.po +resource_name = library--getpass + +[o:python-doc:p:python-newest:r:library--gettext] +file_filter = library/gettext.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/gettext.po +source_file = library/gettext.po +resource_name = library--gettext + +[o:python-doc:p:python-newest:r:library--glob] +file_filter = library/glob.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/glob.po +source_file = library/glob.po +resource_name = library--glob + +[o:python-doc:p:python-newest:r:library--graphlib] +file_filter = library/graphlib.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/graphlib.po +source_file = library/graphlib.po +resource_name = library--graphlib + +[o:python-doc:p:python-newest:r:library--grp] +file_filter = library/grp.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/grp.po +source_file = library/grp.po +resource_name = library--grp + +[o:python-doc:p:python-newest:r:library--gzip] +file_filter = library/gzip.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/gzip.po +source_file = library/gzip.po +resource_name = library--gzip + +[o:python-doc:p:python-newest:r:library--hashlib] +file_filter = library/hashlib.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/hashlib.po +source_file = library/hashlib.po +resource_name = library--hashlib + +[o:python-doc:p:python-newest:r:library--heapq] +file_filter = library/heapq.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/heapq.po +source_file = library/heapq.po +resource_name = library--heapq + +[o:python-doc:p:python-newest:r:library--hmac] +file_filter = library/hmac.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/hmac.po +source_file = library/hmac.po +resource_name = library--hmac + +[o:python-doc:p:python-newest:r:library--html] +file_filter = library/html.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/html.po +source_file = library/html.po +resource_name = library--html + +[o:python-doc:p:python-newest:r:library--html_entities] +file_filter = library/html_entities.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/html_entities.po +source_file = library/html_entities.po +resource_name = library--html_entities + +[o:python-doc:p:python-newest:r:library--html_parser] +file_filter = library/html_parser.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/html_parser.po +source_file = library/html_parser.po +resource_name = library--html_parser + +[o:python-doc:p:python-newest:r:library--http] +file_filter = library/http.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/http.po +source_file = library/http.po +resource_name = library--http + +[o:python-doc:p:python-newest:r:library--http_client] +file_filter = library/http_client.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/http_client.po +source_file = library/http_client.po +resource_name = library--http_client + +[o:python-doc:p:python-newest:r:library--http_cookiejar] +file_filter = library/http_cookiejar.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/http_cookiejar.po +source_file = library/http_cookiejar.po +resource_name = library--http_cookiejar + +[o:python-doc:p:python-newest:r:library--http_cookies] +file_filter = library/http_cookies.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/http_cookies.po +source_file = library/http_cookies.po +resource_name = library--http_cookies + +[o:python-doc:p:python-newest:r:library--http_server] +file_filter = library/http_server.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/http_server.po +source_file = library/http_server.po +resource_name = library--http_server + +[o:python-doc:p:python-newest:r:library--i18n] +file_filter = library/i18n.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/i18n.po +source_file = library/i18n.po +resource_name = library--i18n + +[o:python-doc:p:python-newest:r:library--idle] +file_filter = library/idle.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/idle.po +source_file = library/idle.po +resource_name = library--idle + +[o:python-doc:p:python-newest:r:library--imaplib] +file_filter = library/imaplib.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/imaplib.po +source_file = library/imaplib.po +resource_name = library--imaplib + +[o:python-doc:p:python-newest:r:library--imghdr] +file_filter = library/imghdr.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/imghdr.po +source_file = library/imghdr.po +resource_name = library--imghdr + +[o:python-doc:p:python-newest:r:library--imp] +file_filter = library/imp.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/imp.po +source_file = library/imp.po +resource_name = library--imp + +[o:python-doc:p:python-newest:r:library--importlib] +file_filter = library/importlib.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/importlib.po +source_file = library/importlib.po +resource_name = library--importlib + +[o:python-doc:p:python-newest:r:library--importlib_metadata] +file_filter = library/importlib_metadata.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/importlib_metadata.po +source_file = library/importlib_metadata.po +resource_name = library--importlib_metadata + +[o:python-doc:p:python-newest:r:library--importlib_resources] +file_filter = library/importlib_resources.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/importlib_resources.po +source_file = library/importlib_resources.po +resource_name = library--importlib_resources + +[o:python-doc:p:python-newest:r:library--importlib_resources_abc] +file_filter = library/importlib_resources_abc.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/importlib_resources_abc.po +source_file = library/importlib_resources_abc.po +resource_name = library--importlib_resources_abc + +[o:python-doc:p:python-newest:r:library--index] +file_filter = library/index.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/index.po +source_file = library/index.po +resource_name = library--index + +[o:python-doc:p:python-newest:r:library--inspect] +file_filter = library/inspect.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/inspect.po +source_file = library/inspect.po +resource_name = library--inspect + +[o:python-doc:p:python-newest:r:library--internet] +file_filter = library/internet.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/internet.po +source_file = library/internet.po +resource_name = library--internet + +[o:python-doc:p:python-newest:r:library--intro] +file_filter = library/intro.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/intro.po +source_file = library/intro.po +resource_name = library--intro + +[o:python-doc:p:python-newest:r:library--io] +file_filter = library/io.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/io.po +source_file = library/io.po +resource_name = library--io + +[o:python-doc:p:python-newest:r:library--ipaddress] +file_filter = library/ipaddress.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/ipaddress.po +source_file = library/ipaddress.po +resource_name = library--ipaddress + +[o:python-doc:p:python-newest:r:library--ipc] +file_filter = library/ipc.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/ipc.po +source_file = library/ipc.po +resource_name = library--ipc + +[o:python-doc:p:python-newest:r:library--itertools] +file_filter = library/itertools.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/itertools.po +source_file = library/itertools.po +resource_name = library--itertools + +[o:python-doc:p:python-newest:r:library--json] +file_filter = library/json.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/json.po +source_file = library/json.po +resource_name = library--json + +[o:python-doc:p:python-newest:r:library--keyword] +file_filter = library/keyword.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/keyword.po +source_file = library/keyword.po +resource_name = library--keyword + +[o:python-doc:p:python-newest:r:library--language] +file_filter = library/language.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/language.po +source_file = library/language.po +resource_name = library--language + +[o:python-doc:p:python-newest:r:library--linecache] +file_filter = library/linecache.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/linecache.po +source_file = library/linecache.po +resource_name = library--linecache + +[o:python-doc:p:python-newest:r:library--locale] +file_filter = library/locale.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/locale.po +source_file = library/locale.po +resource_name = library--locale + +[o:python-doc:p:python-newest:r:library--logging] +file_filter = library/logging.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/logging.po +source_file = library/logging.po +resource_name = library--logging + +[o:python-doc:p:python-newest:r:library--logging_config] +file_filter = library/logging_config.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/logging_config.po +source_file = library/logging_config.po +resource_name = library--logging_config + +[o:python-doc:p:python-newest:r:library--logging_handlers] +file_filter = library/logging_handlers.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/logging_handlers.po +source_file = library/logging_handlers.po +resource_name = library--logging_handlers + +[o:python-doc:p:python-newest:r:library--lzma] +file_filter = library/lzma.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/lzma.po +source_file = library/lzma.po +resource_name = library--lzma + +[o:python-doc:p:python-newest:r:library--mailbox] +file_filter = library/mailbox.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/mailbox.po +source_file = library/mailbox.po +resource_name = library--mailbox + +[o:python-doc:p:python-newest:r:library--mailcap] +file_filter = library/mailcap.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/mailcap.po +source_file = library/mailcap.po +resource_name = library--mailcap + +[o:python-doc:p:python-newest:r:library--__main__] +file_filter = library/__main__.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/__main__.po +source_file = library/__main__.po +resource_name = library--__main__ + +[o:python-doc:p:python-newest:r:library--markup] +file_filter = library/markup.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/markup.po +source_file = library/markup.po +resource_name = library--markup + +[o:python-doc:p:python-newest:r:library--marshal] +file_filter = library/marshal.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/marshal.po +source_file = library/marshal.po +resource_name = library--marshal + +[o:python-doc:p:python-newest:r:library--math] +file_filter = library/math.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/math.po +source_file = library/math.po +resource_name = library--math + +[o:python-doc:p:python-newest:r:library--mimetypes] +file_filter = library/mimetypes.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/mimetypes.po +source_file = library/mimetypes.po +resource_name = library--mimetypes + +[o:python-doc:p:python-newest:r:library--mm] +file_filter = library/mm.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/mm.po +source_file = library/mm.po +resource_name = library--mm + +[o:python-doc:p:python-newest:r:library--mmap] +file_filter = library/mmap.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/mmap.po +source_file = library/mmap.po +resource_name = library--mmap + +[o:python-doc:p:python-newest:r:library--modulefinder] +file_filter = library/modulefinder.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/modulefinder.po +source_file = library/modulefinder.po +resource_name = library--modulefinder + +[o:python-doc:p:python-newest:r:library--modules] +file_filter = library/modules.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/modules.po +source_file = library/modules.po +resource_name = library--modules + +[o:python-doc:p:python-newest:r:library--msilib] +file_filter = library/msilib.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/msilib.po +source_file = library/msilib.po +resource_name = library--msilib + +[o:python-doc:p:python-newest:r:library--msvcrt] +file_filter = library/msvcrt.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/msvcrt.po +source_file = library/msvcrt.po +resource_name = library--msvcrt + +[o:python-doc:p:python-newest:r:library--multiprocessing] +file_filter = library/multiprocessing.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/multiprocessing.po +source_file = library/multiprocessing.po +resource_name = library--multiprocessing + +[o:python-doc:p:python-newest:r:library--multiprocessing_shared_memory] +file_filter = library/multiprocessing_shared_memory.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/multiprocessing_shared_memory.po +source_file = library/multiprocessing_shared_memory.po +resource_name = library--multiprocessing_shared_memory + +[o:python-doc:p:python-newest:r:library--netdata] +file_filter = library/netdata.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/netdata.po +source_file = library/netdata.po +resource_name = library--netdata + +[o:python-doc:p:python-newest:r:library--netrc] +file_filter = library/netrc.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/netrc.po +source_file = library/netrc.po +resource_name = library--netrc + +[o:python-doc:p:python-newest:r:library--nis] +file_filter = library/nis.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/nis.po +source_file = library/nis.po +resource_name = library--nis + +[o:python-doc:p:python-newest:r:library--nntplib] +file_filter = library/nntplib.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/nntplib.po +source_file = library/nntplib.po +resource_name = library--nntplib + +[o:python-doc:p:python-newest:r:library--numbers] +file_filter = library/numbers.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/numbers.po +source_file = library/numbers.po +resource_name = library--numbers + +[o:python-doc:p:python-newest:r:library--numeric] +file_filter = library/numeric.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/numeric.po +source_file = library/numeric.po +resource_name = library--numeric + +[o:python-doc:p:python-newest:r:library--operator] +file_filter = library/operator.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/operator.po +source_file = library/operator.po +resource_name = library--operator + +[o:python-doc:p:python-newest:r:library--optparse] +file_filter = library/optparse.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/optparse.po +source_file = library/optparse.po +resource_name = library--optparse + +[o:python-doc:p:python-newest:r:library--os] +file_filter = library/os.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/os.po +source_file = library/os.po +resource_name = library--os + +[o:python-doc:p:python-newest:r:library--os_path] +file_filter = library/os_path.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/os_path.po +source_file = library/os_path.po +resource_name = library--os_path + +[o:python-doc:p:python-newest:r:library--ossaudiodev] +file_filter = library/ossaudiodev.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/ossaudiodev.po +source_file = library/ossaudiodev.po +resource_name = library--ossaudiodev + +[o:python-doc:p:python-newest:r:library--pathlib] +file_filter = library/pathlib.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/pathlib.po +source_file = library/pathlib.po +resource_name = library--pathlib + +[o:python-doc:p:python-newest:r:library--pdb] +file_filter = library/pdb.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/pdb.po +source_file = library/pdb.po +resource_name = library--pdb + +[o:python-doc:p:python-newest:r:library--persistence] +file_filter = library/persistence.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/persistence.po +source_file = library/persistence.po +resource_name = library--persistence + +[o:python-doc:p:python-newest:r:library--pickle] +file_filter = library/pickle.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/pickle.po +source_file = library/pickle.po +resource_name = library--pickle + +[o:python-doc:p:python-newest:r:library--pickletools] +file_filter = library/pickletools.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/pickletools.po +source_file = library/pickletools.po +resource_name = library--pickletools + +[o:python-doc:p:python-newest:r:library--pipes] +file_filter = library/pipes.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/pipes.po +source_file = library/pipes.po +resource_name = library--pipes + +[o:python-doc:p:python-newest:r:library--pkgutil] +file_filter = library/pkgutil.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/pkgutil.po +source_file = library/pkgutil.po +resource_name = library--pkgutil + +[o:python-doc:p:python-newest:r:library--platform] +file_filter = library/platform.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/platform.po +source_file = library/platform.po +resource_name = library--platform + +[o:python-doc:p:python-newest:r:library--plistlib] +file_filter = library/plistlib.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/plistlib.po +source_file = library/plistlib.po +resource_name = library--plistlib + +[o:python-doc:p:python-newest:r:library--poplib] +file_filter = library/poplib.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/poplib.po +source_file = library/poplib.po +resource_name = library--poplib + +[o:python-doc:p:python-newest:r:library--posix] +file_filter = library/posix.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/posix.po +source_file = library/posix.po +resource_name = library--posix + +[o:python-doc:p:python-newest:r:library--pprint] +file_filter = library/pprint.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/pprint.po +source_file = library/pprint.po +resource_name = library--pprint + +[o:python-doc:p:python-newest:r:library--profile] +file_filter = library/profile.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/profile.po +source_file = library/profile.po +resource_name = library--profile + +[o:python-doc:p:python-newest:r:library--pty] +file_filter = library/pty.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/pty.po +source_file = library/pty.po +resource_name = library--pty + +[o:python-doc:p:python-newest:r:library--pwd] +file_filter = library/pwd.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/pwd.po +source_file = library/pwd.po +resource_name = library--pwd + +[o:python-doc:p:python-newest:r:library--pyclbr] +file_filter = library/pyclbr.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/pyclbr.po +source_file = library/pyclbr.po +resource_name = library--pyclbr + +[o:python-doc:p:python-newest:r:library--py_compile] +file_filter = library/py_compile.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/py_compile.po +source_file = library/py_compile.po +resource_name = library--py_compile + +[o:python-doc:p:python-newest:r:library--pydoc] +file_filter = library/pydoc.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/pydoc.po +source_file = library/pydoc.po +resource_name = library--pydoc + +[o:python-doc:p:python-newest:r:library--pyexpat] +file_filter = library/pyexpat.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/pyexpat.po +source_file = library/pyexpat.po +resource_name = library--pyexpat + +[o:python-doc:p:python-newest:r:library--python] +file_filter = library/python.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/python.po +source_file = library/python.po +resource_name = library--python + +[o:python-doc:p:python-newest:r:library--queue] +file_filter = library/queue.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/queue.po +source_file = library/queue.po +resource_name = library--queue + +[o:python-doc:p:python-newest:r:library--quopri] +file_filter = library/quopri.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/quopri.po +source_file = library/quopri.po +resource_name = library--quopri + +[o:python-doc:p:python-newest:r:library--random] +file_filter = library/random.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/random.po +source_file = library/random.po +resource_name = library--random + +[o:python-doc:p:python-newest:r:library--re] +file_filter = library/re.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/re.po +source_file = library/re.po +resource_name = library--re + +[o:python-doc:p:python-newest:r:library--readline] +file_filter = library/readline.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/readline.po +source_file = library/readline.po +resource_name = library--readline + +[o:python-doc:p:python-newest:r:library--removed] +file_filter = library/removed.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/removed.po +source_file = library/removed.po +resource_name = library--removed + +[o:python-doc:p:python-newest:r:library--reprlib] +file_filter = library/reprlib.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/reprlib.po +source_file = library/reprlib.po +resource_name = library--reprlib + +[o:python-doc:p:python-newest:r:library--resource] +file_filter = library/resource.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/resource.po +source_file = library/resource.po +resource_name = library--resource + +[o:python-doc:p:python-newest:r:library--rlcompleter] +file_filter = library/rlcompleter.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/rlcompleter.po +source_file = library/rlcompleter.po +resource_name = library--rlcompleter + +[o:python-doc:p:python-newest:r:library--runpy] +file_filter = library/runpy.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/runpy.po +source_file = library/runpy.po +resource_name = library--runpy + +[o:python-doc:p:python-newest:r:library--sched] +file_filter = library/sched.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/sched.po +source_file = library/sched.po +resource_name = library--sched + +[o:python-doc:p:python-newest:r:library--secrets] +file_filter = library/secrets.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/secrets.po +source_file = library/secrets.po +resource_name = library--secrets + +[o:python-doc:p:python-newest:r:library--security_warnings] +file_filter = library/security_warnings.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/security_warnings.po +source_file = library/security_warnings.po +resource_name = library--security_warnings + +[o:python-doc:p:python-newest:r:library--select] +file_filter = library/select.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/select.po +source_file = library/select.po +resource_name = library--select + +[o:python-doc:p:python-newest:r:library--selectors] +file_filter = library/selectors.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/selectors.po +source_file = library/selectors.po +resource_name = library--selectors + +[o:python-doc:p:python-newest:r:library--shelve] +file_filter = library/shelve.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/shelve.po +source_file = library/shelve.po +resource_name = library--shelve + +[o:python-doc:p:python-newest:r:library--shlex] +file_filter = library/shlex.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/shlex.po +source_file = library/shlex.po +resource_name = library--shlex + +[o:python-doc:p:python-newest:r:library--shutil] +file_filter = library/shutil.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/shutil.po +source_file = library/shutil.po +resource_name = library--shutil + +[o:python-doc:p:python-newest:r:library--signal] +file_filter = library/signal.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/signal.po +source_file = library/signal.po +resource_name = library--signal + +[o:python-doc:p:python-newest:r:library--site] +file_filter = library/site.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/site.po +source_file = library/site.po +resource_name = library--site + +[o:python-doc:p:python-newest:r:library--smtpd] +file_filter = library/smtpd.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/smtpd.po +source_file = library/smtpd.po +resource_name = library--smtpd + +[o:python-doc:p:python-newest:r:library--smtplib] +file_filter = library/smtplib.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/smtplib.po +source_file = library/smtplib.po +resource_name = library--smtplib + +[o:python-doc:p:python-newest:r:library--sndhdr] +file_filter = library/sndhdr.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/sndhdr.po +source_file = library/sndhdr.po +resource_name = library--sndhdr + +[o:python-doc:p:python-newest:r:library--socket] +file_filter = library/socket.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/socket.po +source_file = library/socket.po +resource_name = library--socket + +[o:python-doc:p:python-newest:r:library--socketserver] +file_filter = library/socketserver.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/socketserver.po +source_file = library/socketserver.po +resource_name = library--socketserver + +[o:python-doc:p:python-newest:r:library--spwd] +file_filter = library/spwd.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/spwd.po +source_file = library/spwd.po +resource_name = library--spwd + +[o:python-doc:p:python-newest:r:library--sqlite3] +file_filter = library/sqlite3.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/sqlite3.po +source_file = library/sqlite3.po +resource_name = library--sqlite3 + +[o:python-doc:p:python-newest:r:library--ssl] +file_filter = library/ssl.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/ssl.po +source_file = library/ssl.po +resource_name = library--ssl + +[o:python-doc:p:python-newest:r:library--stat] +file_filter = library/stat.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/stat.po +source_file = library/stat.po +resource_name = library--stat + +[o:python-doc:p:python-newest:r:library--statistics] +file_filter = library/statistics.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/statistics.po +source_file = library/statistics.po +resource_name = library--statistics + +[o:python-doc:p:python-newest:r:library--stdtypes] +file_filter = library/stdtypes.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/stdtypes.po +source_file = library/stdtypes.po +resource_name = library--stdtypes + +[o:python-doc:p:python-newest:r:library--string] +file_filter = library/string.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/string.po +source_file = library/string.po +resource_name = library--string + +[o:python-doc:p:python-newest:r:library--stringprep] +file_filter = library/stringprep.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/stringprep.po +source_file = library/stringprep.po +resource_name = library--stringprep + +[o:python-doc:p:python-newest:r:library--struct] +file_filter = library/struct.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/struct.po +source_file = library/struct.po +resource_name = library--struct + +[o:python-doc:p:python-newest:r:library--subprocess] +file_filter = library/subprocess.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/subprocess.po +source_file = library/subprocess.po +resource_name = library--subprocess + +[o:python-doc:p:python-newest:r:library--sunau] +file_filter = library/sunau.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/sunau.po +source_file = library/sunau.po +resource_name = library--sunau + +[o:python-doc:p:python-newest:r:library--superseded] +file_filter = library/superseded.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/superseded.po +source_file = library/superseded.po +resource_name = library--superseded + +[o:python-doc:p:python-newest:r:library--symtable] +file_filter = library/symtable.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/symtable.po +source_file = library/symtable.po +resource_name = library--symtable + +[o:python-doc:p:python-newest:r:library--sys] +file_filter = library/sys.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/sys.po +source_file = library/sys.po +resource_name = library--sys + +[o:python-doc:p:python-newest:r:library--sysconfig] +file_filter = library/sysconfig.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/sysconfig.po +source_file = library/sysconfig.po +resource_name = library--sysconfig + +[o:python-doc:p:python-newest:r:library--syslog] +file_filter = library/syslog.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/syslog.po +source_file = library/syslog.po +resource_name = library--syslog + +[o:python-doc:p:python-newest:r:library--sys_monitoring] +file_filter = library/sys_monitoring.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/sys_monitoring.po +source_file = library/sys_monitoring.po +resource_name = library--sys_monitoring + +[o:python-doc:p:python-newest:r:library--sys_path_init] +file_filter = library/sys_path_init.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/sys_path_init.po +source_file = library/sys_path_init.po +resource_name = library--sys_path_init + +[o:python-doc:p:python-newest:r:library--tabnanny] +file_filter = library/tabnanny.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/tabnanny.po +source_file = library/tabnanny.po +resource_name = library--tabnanny + +[o:python-doc:p:python-newest:r:library--tarfile] +file_filter = library/tarfile.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/tarfile.po +source_file = library/tarfile.po +resource_name = library--tarfile + +[o:python-doc:p:python-newest:r:library--telnetlib] +file_filter = library/telnetlib.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/telnetlib.po +source_file = library/telnetlib.po +resource_name = library--telnetlib + +[o:python-doc:p:python-newest:r:library--tempfile] +file_filter = library/tempfile.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/tempfile.po +source_file = library/tempfile.po +resource_name = library--tempfile + +[o:python-doc:p:python-newest:r:library--termios] +file_filter = library/termios.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/termios.po +source_file = library/termios.po +resource_name = library--termios + +[o:python-doc:p:python-newest:r:library--test] +file_filter = library/test.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/test.po +source_file = library/test.po +resource_name = library--test + +[o:python-doc:p:python-newest:r:library--text] +file_filter = library/text.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/text.po +source_file = library/text.po +resource_name = library--text + +[o:python-doc:p:python-newest:r:library--textwrap] +file_filter = library/textwrap.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/textwrap.po +source_file = library/textwrap.po +resource_name = library--textwrap + +[o:python-doc:p:python-newest:r:library--_thread] +file_filter = library/_thread.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/_thread.po +source_file = library/_thread.po +resource_name = library--_thread + +[o:python-doc:p:python-newest:r:library--threading] +file_filter = library/threading.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/threading.po +source_file = library/threading.po +resource_name = library--threading + +[o:python-doc:p:python-newest:r:library--time] +file_filter = library/time.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/time.po +source_file = library/time.po +resource_name = library--time + +[o:python-doc:p:python-newest:r:library--timeit] +file_filter = library/timeit.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/timeit.po +source_file = library/timeit.po +resource_name = library--timeit + +[o:python-doc:p:python-newest:r:library--tk] +file_filter = library/tk.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/tk.po +source_file = library/tk.po +resource_name = library--tk + +[o:python-doc:p:python-newest:r:library--tkinter] +file_filter = library/tkinter.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/tkinter.po +source_file = library/tkinter.po +resource_name = library--tkinter + +[o:python-doc:p:python-newest:r:library--tkinter_colorchooser] +file_filter = library/tkinter_colorchooser.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/tkinter_colorchooser.po +source_file = library/tkinter_colorchooser.po +resource_name = library--tkinter_colorchooser + +[o:python-doc:p:python-newest:r:library--tkinter_dnd] +file_filter = library/tkinter_dnd.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/tkinter_dnd.po +source_file = library/tkinter_dnd.po +resource_name = library--tkinter_dnd + +[o:python-doc:p:python-newest:r:library--tkinter_font] +file_filter = library/tkinter_font.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/tkinter_font.po +source_file = library/tkinter_font.po +resource_name = library--tkinter_font + +[o:python-doc:p:python-newest:r:library--tkinter_messagebox] +file_filter = library/tkinter_messagebox.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/tkinter_messagebox.po +source_file = library/tkinter_messagebox.po +resource_name = library--tkinter_messagebox + +[o:python-doc:p:python-newest:r:library--tkinter_scrolledtext] +file_filter = library/tkinter_scrolledtext.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/tkinter_scrolledtext.po +source_file = library/tkinter_scrolledtext.po +resource_name = library--tkinter_scrolledtext + +[o:python-doc:p:python-newest:r:library--tkinter_ttk] +file_filter = library/tkinter_ttk.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/tkinter_ttk.po +source_file = library/tkinter_ttk.po +resource_name = library--tkinter_ttk + +[o:python-doc:p:python-newest:r:library--token] +file_filter = library/token.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/token.po +source_file = library/token.po +resource_name = library--token + +[o:python-doc:p:python-newest:r:library--tokenize] +file_filter = library/tokenize.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/tokenize.po +source_file = library/tokenize.po +resource_name = library--tokenize + +[o:python-doc:p:python-newest:r:library--tomllib] +file_filter = library/tomllib.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/tomllib.po +source_file = library/tomllib.po +resource_name = library--tomllib + +[o:python-doc:p:python-newest:r:library--trace] +file_filter = library/trace.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/trace.po +source_file = library/trace.po +resource_name = library--trace + +[o:python-doc:p:python-newest:r:library--traceback] +file_filter = library/traceback.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/traceback.po +source_file = library/traceback.po +resource_name = library--traceback + +[o:python-doc:p:python-newest:r:library--tracemalloc] +file_filter = library/tracemalloc.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/tracemalloc.po +source_file = library/tracemalloc.po +resource_name = library--tracemalloc + +[o:python-doc:p:python-newest:r:library--tty] +file_filter = library/tty.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/tty.po +source_file = library/tty.po +resource_name = library--tty + +[o:python-doc:p:python-newest:r:library--turtle] +file_filter = library/turtle.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/turtle.po +source_file = library/turtle.po +resource_name = library--turtle + +[o:python-doc:p:python-newest:r:library--types] +file_filter = library/types.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/types.po +source_file = library/types.po +resource_name = library--types + +[o:python-doc:p:python-newest:r:library--typing] +file_filter = library/typing.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/typing.po +source_file = library/typing.po +resource_name = library--typing + +[o:python-doc:p:python-newest:r:library--unicodedata] +file_filter = library/unicodedata.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/unicodedata.po +source_file = library/unicodedata.po +resource_name = library--unicodedata + +[o:python-doc:p:python-newest:r:library--unittest] +file_filter = library/unittest.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/unittest.po +source_file = library/unittest.po +resource_name = library--unittest + +[o:python-doc:p:python-newest:r:library--unittest_mock] +file_filter = library/unittest_mock.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/unittest_mock.po +source_file = library/unittest_mock.po +resource_name = library--unittest_mock + +[o:python-doc:p:python-newest:r:library--unittest_mock-examples] +file_filter = library/unittest_mock-examples.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/unittest_mock-examples.po +source_file = library/unittest_mock-examples.po +resource_name = library--unittest_mock-examples + +[o:python-doc:p:python-newest:r:library--unix] +file_filter = library/unix.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/unix.po +source_file = library/unix.po +resource_name = library--unix + +[o:python-doc:p:python-newest:r:library--urllib] +file_filter = library/urllib.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/urllib.po +source_file = library/urllib.po +resource_name = library--urllib + +[o:python-doc:p:python-newest:r:library--urllib_error] +file_filter = library/urllib_error.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/urllib_error.po +source_file = library/urllib_error.po +resource_name = library--urllib_error + +[o:python-doc:p:python-newest:r:library--urllib_parse] +file_filter = library/urllib_parse.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/urllib_parse.po +source_file = library/urllib_parse.po +resource_name = library--urllib_parse + +[o:python-doc:p:python-newest:r:library--urllib_request] +file_filter = library/urllib_request.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/urllib_request.po +source_file = library/urllib_request.po +resource_name = library--urllib_request + +[o:python-doc:p:python-newest:r:library--urllib_robotparser] +file_filter = library/urllib_robotparser.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/urllib_robotparser.po +source_file = library/urllib_robotparser.po +resource_name = library--urllib_robotparser + +[o:python-doc:p:python-newest:r:library--uu] +file_filter = library/uu.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/uu.po +source_file = library/uu.po +resource_name = library--uu + +[o:python-doc:p:python-newest:r:library--uuid] +file_filter = library/uuid.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/uuid.po +source_file = library/uuid.po +resource_name = library--uuid + +[o:python-doc:p:python-newest:r:library--venv] +file_filter = library/venv.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/venv.po +source_file = library/venv.po +resource_name = library--venv + +[o:python-doc:p:python-newest:r:library--warnings] +file_filter = library/warnings.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/warnings.po +source_file = library/warnings.po +resource_name = library--warnings + +[o:python-doc:p:python-newest:r:library--wave] +file_filter = library/wave.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/wave.po +source_file = library/wave.po +resource_name = library--wave + +[o:python-doc:p:python-newest:r:library--weakref] +file_filter = library/weakref.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/weakref.po +source_file = library/weakref.po +resource_name = library--weakref + +[o:python-doc:p:python-newest:r:library--webbrowser] +file_filter = library/webbrowser.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/webbrowser.po +source_file = library/webbrowser.po +resource_name = library--webbrowser + +[o:python-doc:p:python-newest:r:library--windows] +file_filter = library/windows.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/windows.po +source_file = library/windows.po +resource_name = library--windows + +[o:python-doc:p:python-newest:r:library--winreg] +file_filter = library/winreg.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/winreg.po +source_file = library/winreg.po +resource_name = library--winreg + +[o:python-doc:p:python-newest:r:library--winsound] +file_filter = library/winsound.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/winsound.po +source_file = library/winsound.po +resource_name = library--winsound + +[o:python-doc:p:python-newest:r:library--wsgiref] +file_filter = library/wsgiref.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/wsgiref.po +source_file = library/wsgiref.po +resource_name = library--wsgiref + +[o:python-doc:p:python-newest:r:library--xdrlib] +file_filter = library/xdrlib.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/xdrlib.po +source_file = library/xdrlib.po +resource_name = library--xdrlib + +[o:python-doc:p:python-newest:r:library--xml] +file_filter = library/xml.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/xml.po +source_file = library/xml.po +resource_name = library--xml + +[o:python-doc:p:python-newest:r:library--xml_dom] +file_filter = library/xml_dom.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/xml_dom.po +source_file = library/xml_dom.po +resource_name = library--xml_dom + +[o:python-doc:p:python-newest:r:library--xml_dom_minidom] +file_filter = library/xml_dom_minidom.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/xml_dom_minidom.po +source_file = library/xml_dom_minidom.po +resource_name = library--xml_dom_minidom + +[o:python-doc:p:python-newest:r:library--xml_dom_pulldom] +file_filter = library/xml_dom_pulldom.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/xml_dom_pulldom.po +source_file = library/xml_dom_pulldom.po +resource_name = library--xml_dom_pulldom + +[o:python-doc:p:python-newest:r:library--xml_etree_elementtree] +file_filter = library/xml_etree_elementtree.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/xml_etree_elementtree.po +source_file = library/xml_etree_elementtree.po +resource_name = library--xml_etree_elementtree + +[o:python-doc:p:python-newest:r:library--xmlrpc] +file_filter = library/xmlrpc.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/xmlrpc.po +source_file = library/xmlrpc.po +resource_name = library--xmlrpc + +[o:python-doc:p:python-newest:r:library--xmlrpc_client] +file_filter = library/xmlrpc_client.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/xmlrpc_client.po +source_file = library/xmlrpc_client.po +resource_name = library--xmlrpc_client + +[o:python-doc:p:python-newest:r:library--xmlrpc_server] +file_filter = library/xmlrpc_server.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/xmlrpc_server.po +source_file = library/xmlrpc_server.po +resource_name = library--xmlrpc_server + +[o:python-doc:p:python-newest:r:library--xml_sax] +file_filter = library/xml_sax.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/xml_sax.po +source_file = library/xml_sax.po +resource_name = library--xml_sax + +[o:python-doc:p:python-newest:r:library--xml_sax_handler] +file_filter = library/xml_sax_handler.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/xml_sax_handler.po +source_file = library/xml_sax_handler.po +resource_name = library--xml_sax_handler + +[o:python-doc:p:python-newest:r:library--xml_sax_reader] +file_filter = library/xml_sax_reader.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/xml_sax_reader.po +source_file = library/xml_sax_reader.po +resource_name = library--xml_sax_reader + +[o:python-doc:p:python-newest:r:library--xml_sax_utils] +file_filter = library/xml_sax_utils.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/xml_sax_utils.po +source_file = library/xml_sax_utils.po +resource_name = library--xml_sax_utils + +[o:python-doc:p:python-newest:r:library--zipapp] +file_filter = library/zipapp.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/zipapp.po +source_file = library/zipapp.po +resource_name = library--zipapp + +[o:python-doc:p:python-newest:r:library--zipfile] +file_filter = library/zipfile.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/zipfile.po +source_file = library/zipfile.po +resource_name = library--zipfile + +[o:python-doc:p:python-newest:r:library--zipimport] +file_filter = library/zipimport.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/zipimport.po +source_file = library/zipimport.po +resource_name = library--zipimport + +[o:python-doc:p:python-newest:r:library--zlib] +file_filter = library/zlib.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/zlib.po +source_file = library/zlib.po +resource_name = library--zlib + +[o:python-doc:p:python-newest:r:library--zoneinfo] +file_filter = library/zoneinfo.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = library/zoneinfo.po +source_file = library/zoneinfo.po +resource_name = library--zoneinfo + +[o:python-doc:p:python-newest:r:license] +file_filter = license.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = license.po +source_file = license.po +resource_name = license + +[o:python-doc:p:python-newest:r:reference--compound_stmts] +file_filter = reference/compound_stmts.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = reference/compound_stmts.po +source_file = reference/compound_stmts.po +resource_name = reference--compound_stmts + +[o:python-doc:p:python-newest:r:reference--datamodel] +file_filter = reference/datamodel.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = reference/datamodel.po +source_file = reference/datamodel.po +resource_name = reference--datamodel + +[o:python-doc:p:python-newest:r:reference--executionmodel] +file_filter = reference/executionmodel.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = reference/executionmodel.po +source_file = reference/executionmodel.po +resource_name = reference--executionmodel + +[o:python-doc:p:python-newest:r:reference--expressions] +file_filter = reference/expressions.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = reference/expressions.po +source_file = reference/expressions.po +resource_name = reference--expressions + +[o:python-doc:p:python-newest:r:reference--grammar] +file_filter = reference/grammar.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = reference/grammar.po +source_file = reference/grammar.po +resource_name = reference--grammar + +[o:python-doc:p:python-newest:r:reference--import] +file_filter = reference/import.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = reference/import.po +source_file = reference/import.po +resource_name = reference--import + +[o:python-doc:p:python-newest:r:reference--index] +file_filter = reference/index.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = reference/index.po +source_file = reference/index.po +resource_name = reference--index + +[o:python-doc:p:python-newest:r:reference--introduction] +file_filter = reference/introduction.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = reference/introduction.po +source_file = reference/introduction.po +resource_name = reference--introduction + +[o:python-doc:p:python-newest:r:reference--lexical_analysis] +file_filter = reference/lexical_analysis.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = reference/lexical_analysis.po +source_file = reference/lexical_analysis.po +resource_name = reference--lexical_analysis + +[o:python-doc:p:python-newest:r:reference--simple_stmts] +file_filter = reference/simple_stmts.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = reference/simple_stmts.po +source_file = reference/simple_stmts.po +resource_name = reference--simple_stmts + +[o:python-doc:p:python-newest:r:reference--toplevel_components] +file_filter = reference/toplevel_components.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = reference/toplevel_components.po +source_file = reference/toplevel_components.po +resource_name = reference--toplevel_components + +[o:python-doc:p:python-newest:r:sphinx] +file_filter = sphinx.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = sphinx.po +source_file = sphinx.po +resource_name = sphinx + +[o:python-doc:p:python-newest:r:tutorial--appendix] +file_filter = tutorial/appendix.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = tutorial/appendix.po +source_file = tutorial/appendix.po +resource_name = tutorial--appendix + +[o:python-doc:p:python-newest:r:tutorial--appetite] +file_filter = tutorial/appetite.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = tutorial/appetite.po +source_file = tutorial/appetite.po +resource_name = tutorial--appetite + +[o:python-doc:p:python-newest:r:tutorial--classes] +file_filter = tutorial/classes.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = tutorial/classes.po +source_file = tutorial/classes.po +resource_name = tutorial--classes + +[o:python-doc:p:python-newest:r:tutorial--controlflow] +file_filter = tutorial/controlflow.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = tutorial/controlflow.po +source_file = tutorial/controlflow.po +resource_name = tutorial--controlflow + +[o:python-doc:p:python-newest:r:tutorial--datastructures] +file_filter = tutorial/datastructures.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = tutorial/datastructures.po +source_file = tutorial/datastructures.po +resource_name = tutorial--datastructures + +[o:python-doc:p:python-newest:r:tutorial--errors] +file_filter = tutorial/errors.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = tutorial/errors.po +source_file = tutorial/errors.po +resource_name = tutorial--errors + +[o:python-doc:p:python-newest:r:tutorial--floatingpoint] +file_filter = tutorial/floatingpoint.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = tutorial/floatingpoint.po +source_file = tutorial/floatingpoint.po +resource_name = tutorial--floatingpoint + +[o:python-doc:p:python-newest:r:tutorial--index] +file_filter = tutorial/index.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = tutorial/index.po +source_file = tutorial/index.po +resource_name = tutorial--index + +[o:python-doc:p:python-newest:r:tutorial--inputoutput] +file_filter = tutorial/inputoutput.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = tutorial/inputoutput.po +source_file = tutorial/inputoutput.po +resource_name = tutorial--inputoutput + +[o:python-doc:p:python-newest:r:tutorial--interactive] +file_filter = tutorial/interactive.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = tutorial/interactive.po +source_file = tutorial/interactive.po +resource_name = tutorial--interactive + +[o:python-doc:p:python-newest:r:tutorial--interpreter] +file_filter = tutorial/interpreter.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = tutorial/interpreter.po +source_file = tutorial/interpreter.po +resource_name = tutorial--interpreter + +[o:python-doc:p:python-newest:r:tutorial--introduction] +file_filter = tutorial/introduction.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = tutorial/introduction.po +source_file = tutorial/introduction.po +resource_name = tutorial--introduction + +[o:python-doc:p:python-newest:r:tutorial--modules] +file_filter = tutorial/modules.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = tutorial/modules.po +source_file = tutorial/modules.po +resource_name = tutorial--modules + +[o:python-doc:p:python-newest:r:tutorial--stdlib] +file_filter = tutorial/stdlib.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = tutorial/stdlib.po +source_file = tutorial/stdlib.po +resource_name = tutorial--stdlib + +[o:python-doc:p:python-newest:r:tutorial--stdlib2] +file_filter = tutorial/stdlib2.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = tutorial/stdlib2.po +source_file = tutorial/stdlib2.po +resource_name = tutorial--stdlib2 + +[o:python-doc:p:python-newest:r:tutorial--venv] +file_filter = tutorial/venv.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = tutorial/venv.po +source_file = tutorial/venv.po +resource_name = tutorial--venv + +[o:python-doc:p:python-newest:r:tutorial--whatnow] +file_filter = tutorial/whatnow.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = tutorial/whatnow.po +source_file = tutorial/whatnow.po +resource_name = tutorial--whatnow + +[o:python-doc:p:python-newest:r:using--android] +file_filter = using/android.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = using/android.po +source_file = using/android.po +resource_name = using--android + +[o:python-doc:p:python-newest:r:using--cmdline] +file_filter = using/cmdline.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = using/cmdline.po +source_file = using/cmdline.po +resource_name = using--cmdline + +[o:python-doc:p:python-newest:r:using--configure] +file_filter = using/configure.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = using/configure.po +source_file = using/configure.po +resource_name = using--configure + +[o:python-doc:p:python-newest:r:using--editors] +file_filter = using/editors.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = using/editors.po +source_file = using/editors.po +resource_name = using--editors + +[o:python-doc:p:python-newest:r:using--index] +file_filter = using/index.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = using/index.po +source_file = using/index.po +resource_name = using--index + +[o:python-doc:p:python-newest:r:using--ios] +file_filter = using/ios.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = using/ios.po +source_file = using/ios.po +resource_name = using--ios + +[o:python-doc:p:python-newest:r:using--mac] +file_filter = using/mac.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = using/mac.po +source_file = using/mac.po +resource_name = using--mac + +[o:python-doc:p:python-newest:r:using--unix] +file_filter = using/unix.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = using/unix.po +source_file = using/unix.po +resource_name = using--unix + +[o:python-doc:p:python-newest:r:using--windows] +file_filter = using/windows.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = using/windows.po +source_file = using/windows.po +resource_name = using--windows + +[o:python-doc:p:python-newest:r:whatsnew--2_0] +file_filter = whatsnew/2_0.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = whatsnew/2_0.po +source_file = whatsnew/2_0.po +resource_name = whatsnew--2_0 + +[o:python-doc:p:python-newest:r:whatsnew--2_1] +file_filter = whatsnew/2_1.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = whatsnew/2_1.po +source_file = whatsnew/2_1.po +resource_name = whatsnew--2_1 + +[o:python-doc:p:python-newest:r:whatsnew--2_2] +file_filter = whatsnew/2_2.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = whatsnew/2_2.po +source_file = whatsnew/2_2.po +resource_name = whatsnew--2_2 + +[o:python-doc:p:python-newest:r:whatsnew--2_3] +file_filter = whatsnew/2_3.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = whatsnew/2_3.po +source_file = whatsnew/2_3.po +resource_name = whatsnew--2_3 + +[o:python-doc:p:python-newest:r:whatsnew--2_4] +file_filter = whatsnew/2_4.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = whatsnew/2_4.po +source_file = whatsnew/2_4.po +resource_name = whatsnew--2_4 + +[o:python-doc:p:python-newest:r:whatsnew--2_5] +file_filter = whatsnew/2_5.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = whatsnew/2_5.po +source_file = whatsnew/2_5.po +resource_name = whatsnew--2_5 + +[o:python-doc:p:python-newest:r:whatsnew--2_6] +file_filter = whatsnew/2_6.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = whatsnew/2_6.po +source_file = whatsnew/2_6.po +resource_name = whatsnew--2_6 + +[o:python-doc:p:python-newest:r:whatsnew--2_7] +file_filter = whatsnew/2_7.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = whatsnew/2_7.po +source_file = whatsnew/2_7.po +resource_name = whatsnew--2_7 + +[o:python-doc:p:python-newest:r:whatsnew--3_0] +file_filter = whatsnew/3_0.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = whatsnew/3_0.po +source_file = whatsnew/3_0.po +resource_name = whatsnew--3_0 + +[o:python-doc:p:python-newest:r:whatsnew--3_1] +file_filter = whatsnew/3_1.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = whatsnew/3_1.po +source_file = whatsnew/3_1.po +resource_name = whatsnew--3_1 + +[o:python-doc:p:python-newest:r:whatsnew--3_10] +file_filter = whatsnew/3_10.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = whatsnew/3_10.po +source_file = whatsnew/3_10.po +resource_name = whatsnew--3_10 + +[o:python-doc:p:python-newest:r:whatsnew--3_11] +file_filter = whatsnew/3_11.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = whatsnew/3_11.po +source_file = whatsnew/3_11.po +resource_name = whatsnew--3_11 + +[o:python-doc:p:python-newest:r:whatsnew--3_12] +file_filter = whatsnew/3_12.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = whatsnew/3_12.po +source_file = whatsnew/3_12.po +resource_name = whatsnew--3_12 + +[o:python-doc:p:python-newest:r:whatsnew--3_13] +file_filter = whatsnew/3_13.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = whatsnew/3_13.po +source_file = whatsnew/3_13.po +resource_name = whatsnew--3_13 + +[o:python-doc:p:python-newest:r:whatsnew--3_2] +file_filter = whatsnew/3_2.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = whatsnew/3_2.po +source_file = whatsnew/3_2.po +resource_name = whatsnew--3_2 + +[o:python-doc:p:python-newest:r:whatsnew--3_3] +file_filter = whatsnew/3_3.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = whatsnew/3_3.po +source_file = whatsnew/3_3.po +resource_name = whatsnew--3_3 + +[o:python-doc:p:python-newest:r:whatsnew--3_4] +file_filter = whatsnew/3_4.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = whatsnew/3_4.po +source_file = whatsnew/3_4.po +resource_name = whatsnew--3_4 + +[o:python-doc:p:python-newest:r:whatsnew--3_5] +file_filter = whatsnew/3_5.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = whatsnew/3_5.po +source_file = whatsnew/3_5.po +resource_name = whatsnew--3_5 + +[o:python-doc:p:python-newest:r:whatsnew--3_6] +file_filter = whatsnew/3_6.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = whatsnew/3_6.po +source_file = whatsnew/3_6.po +resource_name = whatsnew--3_6 + +[o:python-doc:p:python-newest:r:whatsnew--3_7] +file_filter = whatsnew/3_7.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = whatsnew/3_7.po +source_file = whatsnew/3_7.po +resource_name = whatsnew--3_7 + +[o:python-doc:p:python-newest:r:whatsnew--3_8] +file_filter = whatsnew/3_8.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = whatsnew/3_8.po +source_file = whatsnew/3_8.po +resource_name = whatsnew--3_8 + +[o:python-doc:p:python-newest:r:whatsnew--3_9] +file_filter = whatsnew/3_9.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = whatsnew/3_9.po +source_file = whatsnew/3_9.po +resource_name = whatsnew--3_9 + +[o:python-doc:p:python-newest:r:whatsnew--changelog] +file_filter = whatsnew/changelog.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = whatsnew/changelog.po +source_file = whatsnew/changelog.po +resource_name = whatsnew--changelog + +[o:python-doc:p:python-newest:r:whatsnew--index] +file_filter = whatsnew/index.po +type = PO +source_lang = en +minimum_perc = 0 +trans.uk = whatsnew/index.po +source_file = whatsnew/index.po +resource_name = whatsnew--index diff --git a/Makefile b/Makefile index d627ab1de..7944113e7 100644 --- a/Makefile +++ b/Makefile @@ -102,6 +102,11 @@ ensure_prerequisites: exit 1; \ fi +.PHONY: sphinx-lint +sphinx-lint: + @echo "Checking all files using sphinx-lint..." + @sphinx-lint --enable all --disable line-too-long **/*.po + .PHONY: serve serve: $(MAKE) -C $(CPYTHON_PATH)/Doc/ serve diff --git a/RESOURCE.md b/RESOURCE.md index c91d2c6e8..27b446fd2 100644 --- a/RESOURCE.md +++ b/RESOURCE.md @@ -1,503 +1,510 @@ | Файл | Перекладено | Переглянуто | Вичитано | |:-----|:-----|:-----|:-----| -| about.po | 93.4 % | 93.4 % | 0.0 % | -| bugs.po | 59.5 % | 59.5 % | 0.0 % | +| about.po | 70.8 % | 70.8 % | 0.0 % | +| bugs.po | 100.0 % | 90.9 % | 0.0 % | | contents.po | 100.0 % | 100.0 % | 0.0 % | -| copyright.po | 82.0 % | 82.0 % | 0.0 % | -| glossary.po | 93.6 % | 28.9 % | 0.0 % | -| license.po | 89.1 % | 89.1 % | 0.0 % | -| sphinx.po | 95.2 % | 95.2 % | 0.0 % | -| c-api/abstract.po | 100.0 % | 48.3 % | 0.0 % | -| c-api/allocation.po | 100.0 % | 0.0 % | 0.0 % | -| c-api/apiabiversion.po | 77.2 % | 0.0 % | 0.0 % | -| c-api/arg.po | 64.4 % | 0.0 % | 0.0 % | -| c-api/bool.po | 100.0 % | 0.0 % | 0.0 % | -| c-api/buffer.po | 99.0 % | 0.0 % | 0.0 % | -| c-api/bytearray.po | 93.0 % | 0.0 % | 0.0 % | -| c-api/bytes.po | 98.3 % | 0.0 % | 0.0 % | -| c-api/call.po | 93.1 % | 0.0 % | 0.0 % | -| c-api/capsule.po | 82.0 % | 0.0 % | 0.0 % | -| c-api/cell.po | 100.0 % | 0.0 % | 0.0 % | -| c-api/code.po | 24.5 % | 17.9 % | 0.0 % | +| copyright.po | 100.0 % | 82.0 % | 0.0 % | +| glossary.po | 67.6 % | 18.4 % | 0.0 % | +| license.po | 4.2 % | 4.2 % | 0.0 % | +| sphinx.po | 17.4 % | 17.2 % | 0.0 % | +| c-api/abstract.po | 100.0 % | 100.0 % | 0.0 % | +| c-api/allocation.po | 60.7 % | 17.0 % | 0.0 % | +| c-api/apiabiversion.po | 100.0 % | 0.0 % | 0.0 % | +| c-api/arg.po | 52.0 % | 0.3 % | 0.0 % | +| c-api/bool.po | 11.6 % | 0.0 % | 0.0 % | +| c-api/buffer.po | 73.9 % | 0.0 % | 0.0 % | +| c-api/bytearray.po | 83.5 % | 0.0 % | 0.0 % | +| c-api/bytes.po | 79.7 % | 0.0 % | 0.0 % | +| c-api/call.po | 74.3 % | 0.0 % | 0.0 % | +| c-api/capsule.po | 71.0 % | 0.0 % | 0.0 % | +| c-api/cell.po | 73.6 % | 0.0 % | 0.0 % | +| c-api/code.po | 7.6 % | 0.0 % | 0.0 % | | c-api/codec.po | 100.0 % | 0.0 % | 0.0 % | -| c-api/complex.po | 95.2 % | 0.0 % | 0.0 % | +| c-api/complex.po | 41.9 % | 0.0 % | 0.0 % | | c-api/concrete.po | 100.0 % | 0.0 % | 0.0 % | | c-api/contextvars.po | 100.0 % | 0.0 % | 0.0 % | -| c-api/conversion.po | 82.0 % | 7.0 % | 0.0 % | +| c-api/conversion.po | 60.5 % | 6.9 % | 0.0 % | | c-api/coro.po | 100.0 % | 0.0 % | 0.0 % | -| c-api/datetime.po | 98.6 % | 0.0 % | 0.0 % | +| c-api/datetime.po | 47.1 % | 4.5 % | 0.0 % | | c-api/descriptor.po | 100.0 % | 0.0 % | 0.0 % | -| c-api/dict.po | 77.0 % | 0.0 % | 0.0 % | -| c-api/exceptions.po | 84.5 % | 0.0 % | 0.0 % | -| c-api/file.po | 70.7 % | 0.0 % | 0.0 % | -| c-api/float.po | 17.3 % | 0.0 % | 0.0 % | -| c-api/function.po | 77.0 % | 0.0 % | 0.0 % | -| c-api/gcsupport.po | 100.0 % | 0.0 % | 0.0 % | +| c-api/dict.po | 33.3 % | 0.0 % | 0.0 % | +| c-api/exceptions.po | 54.2 % | 0.0 % | 0.0 % | +| c-api/file.po | 62.0 % | 0.0 % | 0.0 % | +| c-api/float.po | 12.2 % | 0.0 % | 0.0 % | +| c-api/function.po | 30.4 % | 0.0 % | 0.0 % | +| c-api/gcsupport.po | 65.3 % | 0.0 % | 0.0 % | | c-api/gen.po | 100.0 % | 0.0 % | 0.0 % | -| c-api/import.po | 94.7 % | 0.0 % | 0.0 % | +| c-api/import.po | 47.5 % | 0.0 % | 0.0 % | | c-api/index.po | 100.0 % | 0.0 % | 0.0 % | -| c-api/init.po | 91.3 % | 0.0 % | 0.0 % | -| c-api/init.config.po | 77.9 % | 0.0 % | 0.0 % | -| c-api/intro.po | 86.9 % | 0.0 % | 0.0 % | -| c-api/iter.po | 100.0 % | 28.0 % | 0.0 % | +| c-api/init.po | 51.4 % | 0.0 % | 0.0 % | +| c-api/init_config.po | 60.1 % | 0.0 % | 0.0 % | +| c-api/intro.po | 54.2 % | 0.0 % | 0.0 % | +| c-api/iter.po | 75.7 % | 21.2 % | 0.0 % | | c-api/iterator.po | 100.0 % | 0.0 % | 0.0 % | -| c-api/list.po | 97.2 % | 0.0 % | 0.0 % | -| c-api/long.po | 58.7 % | 0.0 % | 0.0 % | -| c-api/mapping.po | 100.0 % | 0.0 % | 0.0 % | -| c-api/marshal.po | 50.5 % | 0.0 % | 0.0 % | -| c-api/memory.po | 87.9 % | 0.0 % | 0.0 % | -| c-api/memoryview.po | 100.0 % | 0.0 % | 0.0 % | -| c-api/method.po | 100.0 % | 0.0 % | 0.0 % | -| c-api/module.po | 96.6 % | 0.0 % | 0.0 % | -| c-api/none.po | 100.0 % | 0.0 % | 0.0 % | -| c-api/number.po | 100.0 % | 0.0 % | 0.0 % | -| c-api/object.po | 85.9 % | 0.0 % | 0.0 % | +| c-api/list.po | 64.1 % | 0.0 % | 0.0 % | +| c-api/long.po | 18.3 % | 0.0 % | 0.0 % | +| c-api/mapping.po | 27.5 % | 0.0 % | 0.0 % | +| c-api/marshal.po | 37.2 % | 0.0 % | 0.0 % | +| c-api/memory.po | 64.5 % | 0.0 % | 0.0 % | +| c-api/memoryview.po | 92.1 % | 0.0 % | 0.0 % | +| c-api/method.po | 87.0 % | 0.0 % | 0.0 % | +| c-api/module.po | 55.5 % | 0.0 % | 0.0 % | +| c-api/none.po | 7.5 % | 0.0 % | 0.0 % | +| c-api/number.po | 89.2 % | 0.0 % | 0.0 % | +| c-api/object.po | 43.6 % | 0.0 % | 0.0 % | | c-api/objimpl.po | 100.0 % | 0.0 % | 0.0 % | -| c-api/refcounting.po | 100.0 % | 0.0 % | 0.0 % | -| c-api/reflection.po | 100.0 % | 0.0 % | 0.0 % | -| c-api/sequence.po | 100.0 % | 0.0 % | 0.0 % | -| c-api/set.po | 100.0 % | 3.0 % | 0.0 % | -| c-api/slice.po | 100.0 % | 0.0 % | 0.0 % | -| c-api/stable.po | 100.0 % | 0.0 % | 0.0 % | -| c-api/structures.po | 68.6 % | 0.0 % | 0.0 % | -| c-api/sys.po | 88.6 % | 0.0 % | 0.0 % | -| c-api/tuple.po | 89.4 % | 0.0 % | 0.0 % | -| c-api/type.po | 80.8 % | 0.0 % | 0.0 % | -| c-api/typehints.po | 37.4 % | 0.0 % | 0.0 % | -| c-api/typeobj.po | 92.3 % | 0.0 % | 0.0 % | -| c-api/unicode.po | 87.3 % | 0.0 % | 0.0 % | +| c-api/refcounting.po | 16.8 % | 0.0 % | 0.0 % | +| c-api/reflection.po | 33.0 % | 0.0 % | 0.0 % | +| c-api/sequence.po | 93.6 % | 0.0 % | 0.0 % | +| c-api/set.po | 76.2 % | 2.9 % | 0.0 % | +| c-api/slice.po | 61.6 % | 0.0 % | 0.0 % | +| c-api/stable.po | 51.4 % | 0.0 % | 0.0 % | +| c-api/structures.po | 22.7 % | 0.0 % | 0.0 % | +| c-api/sys.po | 68.5 % | 0.0 % | 0.0 % | +| c-api/tuple.po | 54.9 % | 0.0 % | 0.0 % | +| c-api/type.po | 35.9 % | 0.0 % | 0.0 % | +| c-api/typehints.po | 30.6 % | 0.0 % | 0.0 % | +| c-api/typeobj.po | 51.0 % | 0.0 % | 0.0 % | +| c-api/unicode.po | 44.8 % | 0.0 % | 0.0 % | | c-api/utilities.po | 100.0 % | 0.0 % | 0.0 % | -| c-api/veryhigh.po | 94.2 % | 0.0 % | 0.0 % | -| c-api/weakref.po | 36.8 % | 0.0 % | 0.0 % | +| c-api/veryhigh.po | 80.1 % | 0.0 % | 0.0 % | +| c-api/weakref.po | 15.8 % | 0.0 % | 0.0 % | | distributing/index.po | 100.0 % | 0.0 % | 0.0 % | -| distutils/.setuptools.disclaimer.po | 100.0 % | 0.0 % | 0.0 % | -| distutils/apiref.po | 99.6 % | 0.0 % | 0.0 % | -| distutils/builtdist.po | 100.0 % | 0.0 % | 0.0 % | -| distutils/commandref.po | 100.0 % | 0.0 % | 0.0 % | -| distutils/configfile.po | 100.0 % | 0.0 % | 0.0 % | -| distutils/examples.po | 100.0 % | 0.0 % | 0.0 % | -| distutils/extending.po | 100.0 % | 0.0 % | 0.0 % | -| distutils/index.po | 100.0 % | 0.0 % | 0.0 % | -| distutils/introduction.po | 100.0 % | 0.0 % | 0.0 % | -| distutils/packageindex.po | 100.0 % | 0.0 % | 0.0 % | -| distutils/setupscript.po | 100.0 % | 0.0 % | 0.0 % | -| distutils/sourcedist.po | 98.9 % | 0.0 % | 0.0 % | -| distutils/uploading.po | 100.0 % | 0.0 % | 0.0 % | -| extending/building.po | 97.6 % | 0.0 % | 0.0 % | -| extending/embedding.po | 99.2 % | 0.0 % | 0.0 % | -| extending/extending.po | 93.5 % | 0.0 % | 0.0 % | +| extending/building.po | 57.1 % | 0.0 % | 0.0 % | +| extending/embedding.po | 66.4 % | 0.0 % | 0.0 % | +| extending/extending.po | 65.0 % | 0.0 % | 0.0 % | | extending/index.po | 86.4 % | 0.0 % | 0.0 % | -| extending/newtypes.po | 89.9 % | 0.0 % | 0.0 % | -| extending/newtypes.tutorial.po | 97.6 % | 0.0 % | 0.0 % | -| extending/windows.po | 100.0 % | 0.0 % | 0.0 % | -| faq/design.po | 96.6 % | 96.6 % | 0.0 % | -| faq/extending.po | 90.4 % | 90.4 % | 0.0 % | -| faq/general.po | 80.6 % | 80.6 % | 0.0 % | -| faq/gui.po | 90.3 % | 90.3 % | 0.0 % | +| extending/newtypes.po | 56.2 % | 0.0 % | 0.0 % | +| extending/newtypes_tutorial.po | 31.8 % | 0.0 % | 0.0 % | +| extending/windows.po | 86.0 % | 0.0 % | 0.0 % | +| faq/design.po | 69.1 % | 69.1 % | 0.0 % | +| faq/extending.po | 75.0 % | 75.0 % | 0.0 % | +| faq/general.po | 68.8 % | 68.0 % | 0.0 % | +| faq/gui.po | 63.4 % | 63.4 % | 0.0 % | | faq/index.po | 100.0 % | 100.0 % | 0.0 % | | faq/installed.po | 100.0 % | 100.0 % | 0.0 % | -| faq/library.po | 98.5 % | 0.0 % | 0.0 % | -| faq/programming.po | 81.8 % | 0.0 % | 0.0 % | -| faq/windows.po | 87.3 % | 0.0 % | 0.0 % | -| howto/annotations.po | 96.7 % | 0.0 % | 0.0 % | -| howto/argparse.po | 100.0 % | 0.0 % | 0.0 % | -| howto/clinic.po | 98.0 % | 0.0 % | 0.0 % | +| faq/library.po | 70.5 % | 0.0 % | 0.0 % | +| faq/programming.po | 64.3 % | 0.0 % | 0.0 % | +| faq/windows.po | 83.9 % | 0.0 % | 0.0 % | +| howto/annotations.po | 84.7 % | 0.0 % | 0.0 % | +| howto/argparse.po | 36.3 % | 0.0 % | 0.0 % | +| howto/clinic.po | 100.0 % | 0.0 % | 0.0 % | | howto/cporting.po | 100.0 % | 0.0 % | 0.0 % | -| howto/curses.po | 97.4 % | 0.0 % | 0.0 % | -| howto/descriptor.po | 98.2 % | 0.0 % | 0.0 % | -| howto/enum.po | 77.8 % | 0.0 % | 0.0 % | -| howto/functional.po | 98.0 % | 0.0 % | 0.0 % | -| howto/index.po | 100.0 % | 0.0 % | 0.0 % | -| howto/instrumentation.po | 93.3 % | 0.0 % | 0.0 % | -| howto/ipaddress.po | 100.0 % | 0.0 % | 0.0 % | -| howto/logging-cookbook.po | 81.4 % | 0.0 % | 0.0 % | -| howto/logging.po | 96.6 % | 0.0 % | 0.0 % | -| howto/pyporting.po | 100.0 % | 0.0 % | 0.0 % | -| howto/regex.po | 96.2 % | 0.0 % | 0.0 % | -| howto/sockets.po | 100.0 % | 0.0 % | 0.0 % | -| howto/sorting.po | 83.3 % | 0.0 % | 0.0 % | -| howto/unicode.po | 98.0 % | 0.0 % | 0.0 % | -| howto/urllib2.po | 94.3 % | 0.0 % | 0.0 % | -| install/index.po | 97.7 % | 0.0 % | 0.0 % | -| installing/index.po | 99.2 % | 0.0 % | 0.0 % | -| library/2to3.po | 96.8 % | 0.0 % | 0.0 % | -| library/..future.po | 100.0 % | 0.0 % | 0.0 % | -| library/..main.po | 97.4 % | 0.0 % | 0.0 % | -| library/.thread.po | 91.1 % | 0.0 % | 0.0 % | -| library/abc.po | 95.6 % | 0.0 % | 0.0 % | -| library/aifc.po | 100.0 % | 0.0 % | 0.0 % | +| howto/curses.po | 63.7 % | 0.0 % | 0.0 % | +| howto/descriptor.po | 37.0 % | 0.0 % | 0.0 % | +| howto/enum.po | 30.1 % | 0.0 % | 0.0 % | +| howto/functional.po | 79.5 % | 0.0 % | 0.0 % | +| howto/index.po | 4.6 % | 0.0 % | 0.0 % | +| howto/instrumentation.po | 51.8 % | 0.0 % | 0.0 % | +| howto/ipaddress.po | 81.7 % | 0.0 % | 0.0 % | +| howto/logging-cookbook.po | 38.7 % | 0.0 % | 0.0 % | +| howto/logging.po | 77.1 % | 0.0 % | 0.0 % | +| howto/pyporting.po | 15.9 % | 0.0 % | 0.0 % | +| howto/regex.po | 90.6 % | 90.3 % | 0.0 % | +| howto/sockets.po | 93.5 % | 0.0 % | 0.0 % | +| howto/sorting.po | 42.9 % | 0.3 % | 0.0 % | +| howto/unicode.po | 82.8 % | 0.0 % | 0.0 % | +| howto/urllib2.po | 59.4 % | 0.0 % | 0.0 % | +| installing/index.po | 83.9 % | 0.0 % | 0.0 % | +| library/__future__.po | 58.8 % | 0.0 % | 0.0 % | +| library/__main__.po | 65.9 % | 0.0 % | 0.0 % | +| library/_thread.po | 74.7 % | 0.0 % | 0.0 % | +| library/abc.po | 42.8 % | 0.0 % | 0.0 % | | library/allos.po | 100.0 % | 0.0 % | 0.0 % | | library/archiving.po | 100.0 % | 0.0 % | 0.0 % | -| library/argparse.po | 84.5 % | 0.0 % | 0.0 % | -| library/array.po | 88.5 % | 0.0 % | 0.0 % | -| library/ast.po | 93.9 % | 0.0 % | 0.0 % | -| library/asynchat.po | 89.8 % | 0.0 % | 0.0 % | +| library/argparse.po | 37.3 % | 0.0 % | 0.0 % | +| library/array.po | 53.7 % | 0.0 % | 0.0 % | +| library/ast.po | 48.2 % | 0.0 % | 0.0 % | | library/asyncio-api-index.po | 80.2 % | 0.0 % | 0.0 % | -| library/asyncio-dev.po | 81.9 % | 0.0 % | 0.0 % | -| library/asyncio-eventloop.po | 85.8 % | 0.0 % | 0.0 % | -| library/asyncio-exceptions.po | 91.8 % | 0.0 % | 0.0 % | -| library/asyncio-future.po | 93.4 % | 0.0 % | 0.0 % | -| library/asyncio-llapi-index.po | 93.4 % | 0.0 % | 0.0 % | -| library/asyncio-platforms.po | 87.9 % | 0.0 % | 0.0 % | -| library/asyncio-policy.po | 86.4 % | 0.0 % | 0.0 % | -| library/asyncio-protocol.po | 97.5 % | 0.0 % | 0.0 % | -| library/asyncio-queue.po | 100.0 % | 0.0 % | 0.0 % | -| library/asyncio-stream.po | 79.3 % | 0.0 % | 0.0 % | -| library/asyncio-subprocess.po | 98.6 % | 0.0 % | 0.0 % | -| library/asyncio-sync.po | 74.6 % | 0.0 % | 0.0 % | -| library/asyncio-task.po | 57.9 % | 0.0 % | 0.0 % | -| library/asyncio.po | 81.0 % | 81.0 % | 0.0 % | -| library/asyncore.po | 97.2 % | 0.0 % | 0.0 % | -| library/atexit.po | 100.0 % | 0.0 % | 0.0 % | -| library/audioop.po | 100.0 % | 0.0 % | 0.0 % | -| library/audit.events.po | 100.0 % | 0.0 % | 0.0 % | -| library/base64.po | 90.8 % | 0.0 % | 0.0 % | -| library/bdb.po | 64.8 % | 0.0 % | 0.0 % | +| library/asyncio-dev.po | 59.5 % | 0.0 % | 0.0 % | +| library/asyncio-eventloop.po | 66.4 % | 0.0 % | 0.0 % | +| library/asyncio-exceptions.po | 86.2 % | 0.0 % | 0.0 % | +| library/asyncio-future.po | 77.8 % | 0.0 % | 0.0 % | +| library/asyncio-llapi-index.po | 91.2 % | 0.0 % | 0.0 % | +| library/asyncio-platforms.po | 79.8 % | 0.0 % | 0.0 % | +| library/asyncio-policy.po | 74.5 % | 0.0 % | 0.0 % | +| library/asyncio-protocol.po | 76.2 % | 0.0 % | 0.0 % | +| library/asyncio-queue.po | 55.2 % | 0.0 % | 0.0 % | +| library/asyncio-stream.po | 59.4 % | 0.0 % | 0.0 % | +| library/asyncio-subprocess.po | 70.7 % | 0.0 % | 0.0 % | +| library/asyncio-sync.po | 57.7 % | 0.0 % | 0.0 % | +| library/asyncio-task.po | 34.8 % | 0.0 % | 0.0 % | +| library/asyncio.po | 54.2 % | 50.0 % | 0.0 % | +| library/atexit.po | 72.6 % | 0.0 % | 0.0 % | +| library/audit_events.po | 73.0 % | 0.0 % | 0.0 % | +| library/base64.po | 84.8 % | 0.0 % | 0.0 % | +| library/bdb.po | 48.7 % | 0.0 % | 0.0 % | | library/binary.po | 100.0 % | 0.0 % | 0.0 % | -| library/binascii.po | 86.0 % | 0.0 % | 0.0 % | -| library/binhex.po | 4.8 % | 0.0 % | 0.0 % | -| library/bisect.po | 97.8 % | 0.0 % | 0.0 % | -| library/builtins.po | 100.0 % | 0.0 % | 0.0 % | -| library/bz2.po | 94.0 % | 0.0 % | 0.0 % | -| library/calendar.po | 95.1 % | 0.0 % | 0.0 % | -| library/cgi.po | 93.4 % | 0.0 % | 0.0 % | -| library/cgitb.po | 100.0 % | 0.0 % | 0.0 % | -| library/chunk.po | 100.0 % | 0.0 % | 0.0 % | -| library/cmath.po | 68.3 % | 0.0 % | 0.0 % | -| library/cmd.po | 97.6 % | 0.0 % | 0.0 % | -| library/code.po | 100.0 % | 0.0 % | 0.0 % | -| library/codecs.po | 99.2 % | 0.0 % | 0.0 % | -| library/codeop.po | 57.0 % | 0.0 % | 0.0 % | -| library/collections.abc.po | 88.7 % | 0.0 % | 0.0 % | -| library/collections.po | 98.6 % | 0.0 % | 0.0 % | -| library/colorsys.po | 100.0 % | 0.0 % | 0.0 % | -| library/compileall.po | 96.4 % | 0.0 % | 0.0 % | +| library/binascii.po | 83.2 % | 0.0 % | 0.0 % | +| library/bisect.po | 22.8 % | 0.0 % | 0.0 % | +| library/builtins.po | 63.1 % | 0.0 % | 0.0 % | +| library/bz2.po | 82.4 % | 0.0 % | 0.0 % | +| library/calendar.po | 48.4 % | 0.0 % | 0.0 % | +| library/cmath.po | 27.1 % | 0.0 % | 0.0 % | +| library/cmd.po | 40.4 % | 0.0 % | 0.0 % | +| library/code.po | 67.8 % | 0.0 % | 0.0 % | +| library/codecs.po | 95.1 % | 0.0 % | 0.0 % | +| library/codeop.po | 44.8 % | 0.0 % | 0.0 % | +| library/collections_abc.po | 25.5 % | 0.0 % | 0.0 % | +| library/collections.po | 66.4 % | 0.0 % | 0.0 % | +| library/colorsys.po | 41.8 % | 0.0 % | 0.0 % | +| library/compileall.po | 88.0 % | 0.0 % | 0.0 % | | library/concurrency.po | 100.0 % | 3.4 % | 0.0 % | -| library/concurrent.futures.po | 75.6 % | 0.0 % | 0.0 % | -| library/concurrent.po | 100.0 % | 0.0 % | 0.0 % | -| library/configparser.po | 97.7 % | 0.0 % | 0.0 % | -| library/constants.po | 100.0 % | 0.0 % | 0.0 % | -| library/contextlib.po | 95.0 % | 0.0 % | 0.0 % | -| library/contextvars.po | 91.6 % | 0.0 % | 0.0 % | -| library/copy.po | 100.0 % | 0.0 % | 0.0 % | -| library/copyreg.po | 54.8 % | 0.0 % | 0.0 % | -| library/crypt.po | 95.2 % | 0.0 % | 0.0 % | -| library/crypto.po | 100.0 % | 0.0 % | 0.0 % | -| library/csv.po | 97.1 % | 0.0 % | 0.0 % | -| library/ctypes.po | 87.8 % | 0.0 % | 0.0 % | -| library/curses.ascii.po | 99.5 % | 0.0 % | 0.0 % | -| library/curses.panel.po | 100.0 % | 0.0 % | 0.0 % | -| library/curses.po | 97.3 % | 0.0 % | 0.0 % | +| library/concurrent_futures.po | 52.4 % | 0.0 % | 0.0 % | +| library/concurrent.po | 82.4 % | 0.0 % | 0.0 % | +| library/configparser.po | 64.5 % | 0.0 % | 0.0 % | +| library/constants.po | 49.5 % | 0.0 % | 0.0 % | +| library/contextlib.po | 58.0 % | 0.0 % | 0.0 % | +| library/contextvars.po | 48.2 % | 0.0 % | 0.0 % | +| library/copy.po | 66.8 % | 0.0 % | 0.0 % | +| library/copyreg.po | 51.4 % | 0.0 % | 0.0 % | +| library/crypto.po | 7.1 % | 0.0 % | 0.0 % | +| library/csv.po | 56.8 % | 0.0 % | 0.0 % | +| library/ctypes.po | 48.9 % | 0.0 % | 0.0 % | +| library/curses_ascii.po | 97.6 % | 0.0 % | 0.0 % | +| library/curses_panel.po | 97.5 % | 0.0 % | 0.0 % | +| library/curses.po | 92.5 % | 0.0 % | 0.0 % | | library/custominterp.po | 19.4 % | 0.0 % | 0.0 % | -| library/dataclasses.po | 80.1 % | 0.0 % | 0.0 % | +| library/dataclasses.po | 10.8 % | 0.0 % | 0.0 % | | library/datatypes.po | 100.0 % | 0.0 % | 0.0 % | -| library/datetime.po | 96.7 % | 0.0 % | 0.0 % | -| library/dbm.po | 99.2 % | 0.0 % | 0.0 % | +| library/datetime.po | 45.7 % | 1.3 % | 0.0 % | +| library/dbm.po | 18.4 % | 0.0 % | 0.0 % | | library/debug.po | 100.0 % | 0.0 % | 0.0 % | -| library/decimal.po | 72.4 % | 0.0 % | 0.0 % | +| library/decimal.po | 54.2 % | 0.0 % | 0.0 % | | library/development.po | 100.0 % | 0.0 % | 0.0 % | -| library/devmode.po | 100.0 % | 0.0 % | 0.0 % | +| library/devmode.po | 75.1 % | 0.0 % | 0.0 % | | library/dialog.po | 100.0 % | 0.0 % | 0.0 % | -| library/difflib.po | 99.0 % | 0.0 % | 0.0 % | -| library/dis.po | 61.8 % | 0.0 % | 0.0 % | +| library/difflib.po | 71.4 % | 0.0 % | 0.0 % | +| library/dis.po | 23.1 % | 0.0 % | 0.0 % | | library/distribution.po | 100.0 % | 0.0 % | 0.0 % | -| library/distutils.po | 100.0 % | 0.0 % | 0.0 % | -| library/doctest.po | 98.7 % | 0.0 % | 0.0 % | -| library/email.charset.po | 88.7 % | 0.0 % | 0.0 % | -| library/email.compat32-message.po | 96.0 % | 0.0 % | 0.0 % | -| library/email.contentmanager.po | 100.0 % | 0.0 % | 0.0 % | -| library/email.encoders.po | 100.0 % | 0.0 % | 0.0 % | -| library/email.errors.po | 100.0 % | 0.0 % | 0.0 % | -| library/email.examples.po | 100.0 % | 0.0 % | 0.0 % | -| library/email.generator.po | 93.8 % | 0.0 % | 0.0 % | -| library/email.header.po | 100.0 % | 0.0 % | 0.0 % | -| library/email.headerregistry.po | 94.1 % | 0.0 % | 0.0 % | -| library/email.iterators.po | 100.0 % | 0.0 % | 0.0 % | -| library/email.message.po | 100.0 % | 0.0 % | 0.0 % | -| library/email.mime.po | 81.9 % | 0.0 % | 0.0 % | -| library/email.parser.po | 100.0 % | 0.0 % | 0.0 % | -| library/email.policy.po | 100.0 % | 0.0 % | 0.0 % | -| library/email.po | 100.0 % | 0.0 % | 0.0 % | -| library/email.utils.po | 100.0 % | 0.0 % | 0.0 % | -| library/ensurepip.po | 95.5 % | 0.0 % | 0.0 % | -| library/enum.po | 8.6 % | 0.0 % | 0.0 % | -| library/errno.po | 97.4 % | 0.0 % | 0.0 % | -| library/exceptions.po | 86.2 % | 0.0 % | 0.0 % | -| library/faulthandler.po | 95.3 % | 0.0 % | 0.0 % | -| library/fcntl.po | 95.4 % | 0.0 % | 0.0 % | -| library/filecmp.po | 100.0 % | 0.0 % | 0.0 % | +| library/doctest.po | 74.4 % | 0.0 % | 0.0 % | +| library/email_charset.po | 86.8 % | 0.0 % | 0.0 % | +| library/email_compat32-message.po | 91.6 % | 0.0 % | 0.0 % | +| library/email_contentmanager.po | 86.5 % | 0.0 % | 0.0 % | +| library/email_encoders.po | 81.5 % | 0.0 % | 0.0 % | +| library/email_errors.po | 42.6 % | 0.0 % | 0.0 % | +| library/email_examples.po | 14.1 % | 0.0 % | 0.0 % | +| library/email_generator.po | 83.4 % | 0.0 % | 0.0 % | +| library/email_header.po | 90.7 % | 0.0 % | 0.0 % | +| library/email_headerregistry.po | 88.7 % | 0.0 % | 0.0 % | +| library/email_iterators.po | 91.1 % | 0.0 % | 0.0 % | +| library/email_message.po | 89.5 % | 0.0 % | 0.0 % | +| library/email_mime.po | 81.2 % | 0.0 % | 0.0 % | +| library/email_parser.po | 94.9 % | 0.0 % | 0.0 % | +| library/email_policy.po | 93.3 % | 0.0 % | 0.0 % | +| library/email.po | 91.2 % | 0.0 % | 0.0 % | +| library/email_utils.po | 84.4 % | 0.0 % | 0.0 % | +| library/ensurepip.po | 81.3 % | 0.0 % | 0.0 % | +| library/enum.po | 2.4 % | 0.0 % | 0.0 % | +| library/errno.po | 84.6 % | 0.0 % | 0.0 % | +| library/exceptions.po | 61.6 % | 0.0 % | 0.0 % | +| library/faulthandler.po | 61.0 % | 0.0 % | 0.0 % | +| library/fcntl.po | 22.9 % | 0.0 % | 0.0 % | +| library/filecmp.po | 80.4 % | 0.0 % | 0.0 % | | library/fileformats.po | 100.0 % | 0.0 % | 0.0 % | -| library/fileinput.po | 91.7 % | 0.0 % | 0.0 % | +| library/fileinput.po | 83.0 % | 0.0 % | 0.0 % | | library/filesys.po | 100.0 % | 0.0 % | 0.0 % | -| library/fnmatch.po | 91.1 % | 0.0 % | 0.0 % | -| library/fractions.po | 75.4 % | 0.0 % | 0.0 % | +| library/fnmatch.po | 46.6 % | 14.0 % | 0.0 % | +| library/fractions.po | 27.9 % | 0.0 % | 0.0 % | | library/frameworks.po | 100.0 % | 0.0 % | 0.0 % | -| library/ftplib.po | 98.7 % | 0.0 % | 0.0 % | +| library/ftplib.po | 52.5 % | 0.0 % | 0.0 % | | library/functional.po | 100.0 % | 0.0 % | 0.0 % | -| library/functions.po | 86.8 % | 3.4 % | 0.0 % | -| library/functools.po | 93.5 % | 0.0 % | 0.0 % | -| library/gc.po | 100.0 % | 0.0 % | 0.0 % | -| library/getopt.po | 100.0 % | 0.0 % | 0.0 % | -| library/getpass.po | 88.5 % | 0.0 % | 0.0 % | -| library/gettext.po | 96.2 % | 0.0 % | 0.0 % | -| library/glob.po | 80.1 % | 0.0 % | 0.0 % | -| library/graphlib.po | 96.4 % | 0.0 % | 0.0 % | -| library/grp.po | 86.7 % | 0.0 % | 0.0 % | -| library/gzip.po | 86.2 % | 0.0 % | 0.0 % | -| library/hashlib.po | 94.0 % | 0.0 % | 0.0 % | -| library/heapq.po | 100.0 % | 0.0 % | 0.0 % | -| library/hmac.po | 88.0 % | 0.0 % | 0.0 % | -| library/html.entities.po | 98.3 % | 0.0 % | 0.0 % | -| library/html.parser.po | 100.0 % | 0.0 % | 0.0 % | +| library/functions.po | 59.4 % | 2.7 % | 0.0 % | +| library/functools.po | 50.2 % | 0.0 % | 0.0 % | +| library/gc.po | 81.6 % | 0.0 % | 0.0 % | +| library/getopt.po | 30.9 % | 0.0 % | 0.0 % | +| library/getpass.po | 59.3 % | 0.0 % | 0.0 % | +| library/gettext.po | 63.3 % | 0.0 % | 0.0 % | +| library/glob.po | 52.8 % | 0.0 % | 0.0 % | +| library/graphlib.po | 70.8 % | 0.0 % | 0.0 % | +| library/grp.po | 93.2 % | 0.0 % | 0.0 % | +| library/gzip.po | 57.4 % | 0.0 % | 0.0 % | +| library/hashlib.po | 61.9 % | 0.0 % | 0.0 % | +| library/heapq.po | 79.8 % | 0.0 % | 0.0 % | +| library/hmac.po | 81.0 % | 0.0 % | 0.0 % | +| library/html_entities.po | 73.1 % | 0.0 % | 0.0 % | +| library/html_parser.po | 67.3 % | 0.0 % | 0.0 % | | library/html.po | 100.0 % | 0.0 % | 0.0 % | -| library/http.client.po | 85.0 % | 0.0 % | 0.0 % | -| library/http.cookiejar.po | 95.2 % | 0.0 % | 0.0 % | -| library/http.cookies.po | 100.0 % | 0.0 % | 0.0 % | -| library/http.po | 85.3 % | 0.0 % | 0.0 % | -| library/http.server.po | 88.0 % | 0.0 % | 0.0 % | +| library/http_client.po | 60.5 % | 0.0 % | 0.0 % | +| library/http_cookiejar.po | 92.1 % | 0.0 % | 0.0 % | +| library/http_cookies.po | 62.7 % | 0.0 % | 0.0 % | +| library/http.po | 42.8 % | 0.0 % | 0.0 % | +| library/http_server.po | 64.8 % | 0.0 % | 0.0 % | | library/i18n.po | 100.0 % | 0.0 % | 0.0 % | -| library/idle.po | 91.9 % | 0.0 % | 0.0 % | -| library/imaplib.po | 98.9 % | 0.0 % | 0.0 % | -| library/imghdr.po | 100.0 % | 0.0 % | 0.0 % | -| library/imp.po | 100.0 % | 0.0 % | 0.0 % | -| library/importlib.metadata.po | 42.5 % | 0.0 % | 0.0 % | -| library/importlib.po | 81.3 % | 0.0 % | 0.0 % | -| library/index.po | 84.1 % | 0.0 % | 0.0 % | -| library/inspect.po | 84.7 % | 0.0 % | 0.0 % | -| library/internet.po | 100.0 % | 0.0 % | 0.0 % | -| library/intro.po | 56.8 % | 0.0 % | 0.0 % | -| library/io.po | 94.3 % | 0.2 % | 0.0 % | -| library/ipaddress.po | 100.0 % | 0.0 % | 0.0 % | +| library/idle.po | 84.0 % | 0.0 % | 0.0 % | +| library/imaplib.po | 78.3 % | 0.0 % | 0.0 % | +| library/importlib_metadata.po | 11.6 % | 0.0 % | 0.0 % | +| library/importlib.po | 58.5 % | 0.0 % | 0.0 % | +| library/index.po | 100.0 % | 0.0 % | 0.0 % | +| library/inspect.po | 58.7 % | 0.0 % | 0.0 % | +| library/internet.po | 90.9 % | 0.0 % | 0.0 % | +| library/intro.po | 38.0 % | 0.0 % | 0.0 % | +| library/io.po | 72.2 % | 0.1 % | 0.0 % | +| library/ipaddress.po | 89.3 % | 0.0 % | 0.0 % | | library/ipc.po | 100.0 % | 0.0 % | 0.0 % | -| library/itertools.po | 71.7 % | 0.0 % | 0.0 % | -| library/json.po | 89.5 % | 0.0 % | 0.0 % | +| library/itertools.po | 20.5 % | 1.4 % | 0.0 % | +| library/json.po | 49.0 % | 0.0 % | 0.0 % | | library/keyword.po | 100.0 % | 0.0 % | 0.0 % | | library/language.po | 100.0 % | 0.0 % | 0.0 % | -| library/linecache.po | 100.0 % | 0.0 % | 0.0 % | -| library/locale.po | 88.7 % | 0.0 % | 0.0 % | -| library/logging.config.po | 89.6 % | 0.0 % | 0.0 % | -| library/logging.handlers.po | 93.1 % | 0.0 % | 0.0 % | -| library/logging.po | 92.9 % | 0.0 % | 0.0 % | -| library/lzma.po | 98.4 % | 0.0 % | 0.0 % | -| library/mailbox.po | 99.0 % | 0.0 % | 0.0 % | -| library/mailcap.po | 86.0 % | 0.0 % | 0.0 % | +| library/linecache.po | 94.5 % | 0.0 % | 0.0 % | +| library/locale.po | 68.3 % | 0.0 % | 0.0 % | +| library/logging_config.po | 70.5 % | 0.0 % | 0.0 % | +| library/logging_handlers.po | 87.8 % | 0.0 % | 0.0 % | +| library/logging.po | 70.1 % | 0.0 % | 0.0 % | +| library/lzma.po | 90.1 % | 0.0 % | 0.0 % | +| library/mailbox.po | 53.4 % | 0.0 % | 0.0 % | | library/markup.po | 100.0 % | 0.0 % | 0.0 % | -| library/marshal.po | 100.0 % | 0.0 % | 0.0 % | -| library/math.po | 94.0 % | 0.0 % | 0.0 % | -| library/mimetypes.po | 100.0 % | 0.0 % | 0.0 % | +| library/marshal.po | 32.8 % | 0.0 % | 0.0 % | +| library/math.po | 56.2 % | 0.0 % | 0.0 % | +| library/mimetypes.po | 81.9 % | 0.0 % | 0.0 % | | library/mm.po | 100.0 % | 0.0 % | 0.0 % | -| library/mmap.po | 94.1 % | 94.1 % | 0.0 % | -| library/modulefinder.po | 100.0 % | 0.0 % | 0.0 % | +| library/mmap.po | 70.1 % | 69.4 % | 0.0 % | +| library/modulefinder.po | 75.9 % | 0.0 % | 0.0 % | | library/modules.po | 100.0 % | 0.0 % | 0.0 % | -| library/msilib.po | 95.0 % | 0.0 % | 0.0 % | -| library/msvcrt.po | 100.0 % | 0.0 % | 0.0 % | -| library/multiprocessing.po | 96.7 % | 0.0 % | 0.0 % | -| library/multiprocessing.shared.memory.po | 1.5 % | 0.0 % | 0.0 % | +| library/msvcrt.po | 25.2 % | 0.0 % | 0.0 % | +| library/multiprocessing.po | 70.0 % | 0.0 % | 0.0 % | +| library/multiprocessing_shared_memory.po | 3.9 % | 2.8 % | 0.0 % | | library/netdata.po | 100.0 % | 0.0 % | 0.0 % | -| library/netrc.po | 85.3 % | 0.0 % | 0.0 % | -| library/nis.po | 87.9 % | 0.0 % | 0.0 % | -| library/nntplib.po | 98.9 % | 0.0 % | 0.0 % | -| library/numbers.po | 94.7 % | 0.0 % | 0.0 % | +| library/netrc.po | 73.1 % | 0.0 % | 0.0 % | +| library/numbers.po | 42.1 % | 0.0 % | 0.0 % | | library/numeric.po | 100.0 % | 0.0 % | 0.0 % | -| library/operator.po | 97.3 % | 0.0 % | 0.0 % | -| library/optparse.po | 97.4 % | 0.0 % | 0.0 % | -| library/os.path.po | 88.0 % | 0.0 % | 0.0 % | -| library/os.po | 91.0 % | 0.0 % | 0.0 % | -| library/ossaudiodev.po | 100.0 % | 0.0 % | 0.0 % | -| library/othergui.po | 100.0 % | 0.0 % | 0.0 % | -| library/pathlib.po | 92.3 % | 0.0 % | 0.0 % | -| library/pdb.po | 78.0 % | 0.0 % | 0.0 % | +| library/operator.po | 84.5 % | 0.0 % | 0.0 % | +| library/optparse.po | 69.8 % | 0.0 % | 0.0 % | +| library/os_path.po | 59.2 % | 0.0 % | 0.0 % | +| library/os.po | 68.1 % | 0.0 % | 0.0 % | +| library/pathlib.po | 29.5 % | 0.0 % | 0.0 % | +| library/pdb.po | 50.1 % | 0.0 % | 0.0 % | | library/persistence.po | 100.0 % | 0.0 % | 0.0 % | -| library/pickle.po | 96.4 % | 0.0 % | 0.0 % | -| library/pickletools.po | 100.0 % | 0.0 % | 0.0 % | -| library/pipes.po | 98.3 % | 0.0 % | 0.0 % | -| library/pkgutil.po | 100.0 % | 0.0 % | 0.0 % | -| library/platform.po | 100.0 % | 0.0 % | 0.0 % | -| library/plistlib.po | 100.0 % | 0.0 % | 0.0 % | -| library/poplib.po | 94.6 % | 0.0 % | 0.0 % | -| library/posix.po | 72.8 % | 0.0 % | 0.0 % | -| library/pprint.po | 85.1 % | 0.0 % | 0.0 % | -| library/profile.po | 98.5 % | 0.0 % | 0.0 % | -| library/pty.po | 100.0 % | 0.0 % | 0.0 % | -| library/pwd.po | 90.7 % | 0.0 % | 0.0 % | -| library/py.compile.po | 84.1 % | 0.0 % | 0.0 % | -| library/pyclbr.po | 100.0 % | 0.0 % | 0.0 % | -| library/pydoc.po | 74.9 % | 0.0 % | 0.0 % | -| library/pyexpat.po | 98.0 % | 0.0 % | 0.0 % | +| library/pickle.po | 66.1 % | 0.0 % | 0.0 % | +| library/pickletools.po | 88.9 % | 0.0 % | 0.0 % | +| library/pkgutil.po | 83.4 % | 0.0 % | 0.0 % | +| library/platform.po | 70.4 % | 0.0 % | 0.0 % | +| library/plistlib.po | 64.3 % | 0.0 % | 0.0 % | +| library/poplib.po | 86.8 % | 0.0 % | 0.0 % | +| library/posix.po | 68.0 % | 0.0 % | 0.0 % | +| library/pprint.po | 31.7 % | 0.0 % | 0.0 % | +| library/profile.po | 86.5 % | 0.0 % | 0.0 % | +| library/pty.po | 79.7 % | 0.0 % | 0.0 % | +| library/pwd.po | 68.3 % | 0.0 % | 0.0 % | +| library/py_compile.po | 77.4 % | 0.0 % | 0.0 % | +| library/pyclbr.po | 71.0 % | 0.0 % | 0.0 % | +| library/pydoc.po | 31.5 % | 0.0 % | 0.0 % | +| library/pyexpat.po | 85.3 % | 0.0 % | 0.0 % | | library/python.po | 100.0 % | 0.0 % | 0.0 % | -| library/queue.po | 68.8 % | 0.0 % | 0.0 % | -| library/quopri.po | 100.0 % | 0.0 % | 0.0 % | -| library/random.po | 89.2 % | 0.5 % | 0.0 % | -| library/re.po | 88.5 % | 0.0 % | 0.0 % | -| library/readline.po | 98.7 % | 0.0 % | 0.0 % | -| library/reprlib.po | 97.9 % | 0.0 % | 0.0 % | -| library/resource.po | 96.3 % | 0.0 % | 0.0 % | -| library/rlcompleter.po | 100.0 % | 0.0 % | 0.0 % | -| library/runpy.po | 100.0 % | 0.0 % | 0.0 % | -| library/sched.po | 100.0 % | 0.0 % | 0.0 % | -| library/secrets.po | 86.3 % | 0.0 % | 0.0 % | -| library/select.po | 85.2 % | 0.0 % | 0.0 % | -| library/selectors.po | 97.0 % | 0.0 % | 0.0 % | -| library/shelve.po | 99.4 % | 0.0 % | 0.0 % | -| library/shlex.po | 100.0 % | 0.0 % | 0.0 % | -| library/shutil.po | 96.2 % | 0.0 % | 0.0 % | -| library/signal.po | 91.5 % | 0.0 % | 0.0 % | -| library/site.po | 99.5 % | 0.0 % | 0.0 % | -| library/smtpd.po | 93.7 % | 0.0 % | 0.0 % | -| library/smtplib.po | 99.1 % | 0.0 % | 0.0 % | -| library/sndhdr.po | 81.3 % | 0.0 % | 0.0 % | -| library/socket.po | 91.1 % | 0.0 % | 0.0 % | -| library/socketserver.po | 95.1 % | 0.0 % | 0.0 % | -| library/spwd.po | 90.1 % | 0.0 % | 0.0 % | -| library/sqlite3.po | 16.0 % | 0.0 % | 0.0 % | -| library/ssl.po | 96.3 % | 0.0 % | 0.0 % | -| library/stat.po | 100.0 % | 0.0 % | 0.0 % | -| library/statistics.po | 91.8 % | 0.0 % | 0.0 % | -| library/stdtypes.po | 92.5 % | 0.0 % | 0.0 % | -| library/string.po | 96.1 % | 0.0 % | 0.0 % | -| library/stringprep.po | 100.0 % | 0.0 % | 0.0 % | -| library/struct.po | 55.0 % | 0.0 % | 0.0 % | -| library/subprocess.po | 85.2 % | 0.0 % | 0.0 % | -| library/sunau.po | 100.0 % | 0.0 % | 0.0 % | -| library/superseded.po | 100.0 % | 0.0 % | 0.0 % | -| library/symtable.po | 95.8 % | 0.0 % | 0.0 % | -| library/sys.po | 87.6 % | 0.0 % | 0.0 % | -| library/sysconfig.po | 90.7 % | 0.0 % | 0.0 % | -| library/syslog.po | 84.4 % | 0.0 % | 0.0 % | +| library/queue.po | 57.8 % | 0.0 % | 0.0 % | +| library/quopri.po | 95.8 % | 0.0 % | 0.0 % | +| library/random.po | 46.8 % | 0.4 % | 0.0 % | +| library/re.po | 49.5 % | 0.0 % | 0.0 % | +| library/readline.po | 27.1 % | 0.0 % | 0.0 % | +| library/reprlib.po | 48.5 % | 0.0 % | 0.0 % | +| library/resource.po | 86.1 % | 0.0 % | 0.0 % | +| library/rlcompleter.po | 21.4 % | 0.0 % | 0.0 % | +| library/runpy.po | 34.3 % | 0.0 % | 0.0 % | +| library/sched.po | 76.3 % | 0.0 % | 0.0 % | +| library/secrets.po | 66.9 % | 0.0 % | 0.0 % | +| library/select.po | 62.4 % | 0.0 % | 0.0 % | +| library/selectors.po | 81.4 % | 0.0 % | 0.0 % | +| library/shelve.po | 65.8 % | 0.0 % | 0.0 % | +| library/shlex.po | 93.8 % | 0.0 % | 0.0 % | +| library/shutil.po | 61.0 % | 0.0 % | 0.0 % | +| library/signal.po | 80.4 % | 0.0 % | 0.0 % | +| library/site.po | 61.1 % | 0.0 % | 0.0 % | +| library/smtplib.po | 80.1 % | 0.0 % | 0.0 % | +| library/socket.po | 62.1 % | 0.0 % | 0.0 % | +| library/socketserver.po | 59.8 % | 0.0 % | 0.0 % | +| library/sqlite3.po | 9.7 % | 0.0 % | 0.0 % | +| library/ssl.po | 72.9 % | 0.0 % | 0.0 % | +| library/stat.po | 76.1 % | 0.0 % | 0.0 % | +| library/statistics.po | 54.5 % | 0.0 % | 0.0 % | +| library/stdtypes.po | 73.6 % | 0.0 % | 0.0 % | +| library/string.po | 63.2 % | 0.0 % | 0.0 % | +| library/stringprep.po | 90.1 % | 0.0 % | 0.0 % | +| library/struct.po | 47.8 % | 0.0 % | 0.0 % | +| library/subprocess.po | 64.9 % | 0.0 % | 0.0 % | +| library/superseded.po | 1.4 % | 0.0 % | 0.0 % | +| library/symtable.po | 47.1 % | 0.0 % | 0.0 % | +| library/sys.po | 64.6 % | 0.0 % | 0.0 % | +| library/sysconfig.po | 59.3 % | 0.0 % | 0.0 % | +| library/syslog.po | 61.6 % | 0.0 % | 0.0 % | | library/tabnanny.po | 100.0 % | 0.0 % | 0.0 % | -| library/tarfile.po | 96.0 % | 0.0 % | 0.0 % | -| library/telnetlib.po | 97.2 % | 0.0 % | 0.0 % | -| library/tempfile.po | 98.1 % | 0.0 % | 0.0 % | -| library/termios.po | 88.1 % | 0.0 % | 0.0 % | -| library/test.po | 98.3 % | 0.0 % | 0.0 % | +| library/tarfile.po | 54.3 % | 0.0 % | 0.0 % | +| library/tempfile.po | 54.0 % | 0.0 % | 0.0 % | +| library/termios.po | 69.7 % | 0.0 % | 0.0 % | +| library/test.po | 86.3 % | 0.0 % | 0.0 % | | library/text.po | 100.0 % | 0.0 % | 0.0 % | -| library/textwrap.po | 100.0 % | 0.0 % | 0.0 % | -| library/threading.po | 95.7 % | 0.0 % | 0.0 % | -| library/time.po | 88.1 % | 0.0 % | 0.0 % | -| library/timeit.po | 98.9 % | 0.0 % | 0.0 % | -| library/tk.po | 100.0 % | 0.0 % | 0.0 % | -| library/tkinter.colorchooser.po | 100.0 % | 0.0 % | 0.0 % | -| library/tkinter.dnd.po | 100.0 % | 0.0 % | 0.0 % | -| library/tkinter.font.po | 100.0 % | 0.0 % | 0.0 % | -| library/tkinter.messagebox.po | 100.0 % | 0.0 % | 0.0 % | -| library/tkinter.po | 98.5 % | 0.0 % | 0.0 % | -| library/tkinter.scrolledtext.po | 100.0 % | 0.0 % | 0.0 % | -| library/tkinter.tix.po | 46.4 % | 0.0 % | 0.0 % | -| library/tkinter.ttk.po | 97.2 % | 0.0 % | 0.0 % | -| library/token.po | 100.0 % | 0.0 % | 0.0 % | -| library/tokenize.po | 100.0 % | 0.0 % | 0.0 % | -| library/trace.po | 100.0 % | 0.0 % | 0.0 % | -| library/traceback.po | 91.0 % | 0.0 % | 0.0 % | -| library/tracemalloc.po | 100.0 % | 0.0 % | 0.0 % | -| library/tty.po | 100.0 % | 0.0 % | 0.0 % | -| library/turtle.po | 90.2 % | 0.0 % | 0.0 % | -| library/types.po | 95.1 % | 0.0 % | 0.0 % | -| library/typing.po | 65.5 % | 0.0 % | 0.0 % | -| library/undoc.po | 100.0 % | 0.0 % | 0.0 % | -| library/unicodedata.po | 94.7 % | 0.0 % | 0.0 % | -| library/unittest.mock-examples.po | 96.9 % | 0.0 % | 0.0 % | -| library/unittest.mock.po | 98.2 % | 0.0 % | 0.0 % | -| library/unittest.po | 95.7 % | 0.0 % | 0.0 % | +| library/textwrap.po | 77.9 % | 0.0 % | 0.0 % | +| library/threading.po | 80.0 % | 0.0 % | 0.0 % | +| library/time.po | 73.0 % | 0.0 % | 0.0 % | +| library/timeit.po | 66.0 % | 0.0 % | 0.0 % | +| library/tk.po | 77.3 % | 0.0 % | 0.0 % | +| library/tkinter_colorchooser.po | 100.0 % | 0.0 % | 0.0 % | +| library/tkinter_dnd.po | 86.9 % | 0.0 % | 0.0 % | +| library/tkinter_font.po | 100.0 % | 0.0 % | 0.0 % | +| library/tkinter_messagebox.po | 2.1 % | 0.0 % | 0.0 % | +| library/tkinter.po | 91.2 % | 0.0 % | 0.0 % | +| library/tkinter_scrolledtext.po | 100.0 % | 0.0 % | 0.0 % | +| library/tkinter_ttk.po | 86.8 % | 0.0 % | 0.0 % | +| library/token.po | 21.0 % | 0.0 % | 0.0 % | +| library/tokenize.po | 64.8 % | 0.0 % | 0.0 % | +| library/trace.po | 87.8 % | 0.0 % | 0.0 % | +| library/traceback.po | 20.3 % | 0.0 % | 0.0 % | +| library/tracemalloc.po | 74.2 % | 0.0 % | 0.0 % | +| library/tty.po | 14.6 % | 0.0 % | 0.0 % | +| library/turtle.po | 59.8 % | 0.0 % | 0.0 % | +| library/types.po | 64.7 % | 0.0 % | 0.0 % | +| library/typing.po | 16.1 % | 0.0 % | 0.0 % | +| library/unicodedata.po | 93.8 % | 0.0 % | 0.0 % | +| library/unittest_mock-examples.po | 78.8 % | 0.0 % | 0.0 % | +| library/unittest_mock.po | 70.3 % | 0.0 % | 0.0 % | +| library/unittest.po | 83.3 % | 0.0 % | 0.0 % | | library/unix.po | 100.0 % | 0.0 % | 0.0 % | -| library/urllib.error.po | 100.0 % | 0.0 % | 0.0 % | -| library/urllib.parse.po | 99.8 % | 0.0 % | 0.0 % | +| library/urllib_error.po | 54.0 % | 0.0 % | 0.0 % | +| library/urllib_parse.po | 78.4 % | 0.0 % | 0.0 % | | library/urllib.po | 100.0 % | 0.0 % | 0.0 % | -| library/urllib.request.po | 98.6 % | 0.0 % | 0.0 % | -| library/urllib.robotparser.po | 100.0 % | 0.0 % | 0.0 % | -| library/uu.po | 100.0 % | 0.0 % | 0.0 % | -| library/uuid.po | 98.4 % | 0.0 % | 0.0 % | -| library/venv.po | 54.2 % | 0.0 % | 0.0 % | -| library/warnings.po | 96.8 % | 0.0 % | 0.0 % | -| library/wave.po | 95.5 % | 0.0 % | 0.0 % | -| library/weakref.po | 90.3 % | 0.0 % | 0.0 % | -| library/webbrowser.po | 95.8 % | 0.0 % | 0.0 % | +| library/urllib_request.po | 75.6 % | 0.0 % | 0.0 % | +| library/urllib_robotparser.po | 86.4 % | 0.0 % | 0.0 % | +| library/uuid.po | 60.3 % | 0.0 % | 0.0 % | +| library/venv.po | 19.2 % | 0.3 % | 0.0 % | +| library/warnings.po | 77.3 % | 0.0 % | 0.0 % | +| library/wave.po | 61.7 % | 0.0 % | 0.0 % | +| library/weakref.po | 72.3 % | 0.0 % | 0.0 % | +| library/webbrowser.po | 66.9 % | 0.0 % | 0.0 % | | library/windows.po | 100.0 % | 0.0 % | 0.0 % | -| library/winreg.po | 96.7 % | 0.0 % | 0.0 % | -| library/winsound.po | 100.0 % | 0.0 % | 0.0 % | -| library/wsgiref.po | 86.8 % | 0.0 % | 0.0 % | -| library/xdrlib.po | 100.0 % | 0.0 % | 0.0 % | -| library/xml.dom.minidom.po | 92.0 % | 0.0 % | 0.0 % | -| library/xml.dom.po | 100.0 % | 0.0 % | 0.0 % | -| library/xml.dom.pulldom.po | 98.3 % | 0.0 % | 0.0 % | -| library/xml.etree.elementtree.po | 100.0 % | 0.0 % | 0.0 % | -| library/xml.po | 90.8 % | 0.0 % | 0.0 % | -| library/xml.sax.handler.po | 100.0 % | 0.0 % | 0.0 % | -| library/xml.sax.po | 100.0 % | 0.0 % | 0.0 % | -| library/xml.sax.reader.po | 100.0 % | 0.0 % | 0.0 % | -| library/xml.sax.utils.po | 100.0 % | 0.0 % | 0.0 % | -| library/xmlrpc.client.po | 89.1 % | 0.0 % | 0.0 % | -| library/xmlrpc.po | 100.0 % | 0.0 % | 0.0 % | -| library/xmlrpc.server.po | 97.0 % | 0.0 % | 0.0 % | -| library/zipapp.po | 97.0 % | 0.0 % | 0.0 % | -| library/zipfile.po | 81.5 % | 0.0 % | 0.0 % | -| library/zipimport.po | 100.0 % | 0.0 % | 0.0 % | -| library/zlib.po | 92.1 % | 0.0 % | 0.0 % | -| library/zoneinfo.po | 98.4 % | 0.0 % | 0.0 % | -| reference/compound.stmts.po | 81.6 % | 0.0 % | 0.0 % | -| reference/datamodel.po | 92.8 % | 0.0 % | 0.0 % | -| reference/executionmodel.po | 92.5 % | 0.0 % | 0.0 % | -| reference/expressions.po | 90.2 % | 0.0 % | 0.0 % | -| reference/grammar.po | 32.1 % | 0.0 % | 0.0 % | -| reference/import.po | 93.1 % | 0.0 % | 0.0 % | +| library/winreg.po | 91.4 % | 0.0 % | 0.0 % | +| library/winsound.po | 58.7 % | 0.0 % | 0.0 % | +| library/wsgiref.po | 72.3 % | 0.0 % | 0.0 % | +| library/xml_dom_minidom.po | 80.6 % | 0.0 % | 0.0 % | +| library/xml_dom.po | 98.9 % | 0.0 % | 0.0 % | +| library/xml_dom_pulldom.po | 78.7 % | 0.0 % | 0.0 % | +| library/xml_etree_elementtree.po | 77.5 % | 0.0 % | 0.0 % | +| library/xml.po | 62.1 % | 0.0 % | 0.0 % | +| library/xml_sax_handler.po | 95.2 % | 0.0 % | 0.0 % | +| library/xml_sax.po | 99.3 % | 0.0 % | 0.0 % | +| library/xml_sax_reader.po | 99.5 % | 0.0 % | 0.0 % | +| library/xml_sax_utils.po | 79.1 % | 0.0 % | 0.0 % | +| library/xmlrpc_client.po | 69.2 % | 0.0 % | 0.0 % | +| library/xmlrpc.po | 89.2 % | 0.0 % | 0.0 % | +| library/xmlrpc_server.po | 72.6 % | 0.0 % | 0.0 % | +| library/zipapp.po | 88.4 % | 0.0 % | 0.0 % | +| library/zipfile.po | 75.0 % | 0.0 % | 0.0 % | +| library/zipimport.po | 89.2 % | 0.0 % | 0.0 % | +| library/zlib.po | 90.7 % | 0.0 % | 0.0 % | +| library/zoneinfo.po | 82.2 % | 0.0 % | 0.0 % | +| reference/compound_stmts.po | 58.1 % | 0.0 % | 0.0 % | +| reference/datamodel.po | 49.6 % | 0.0 % | 0.0 % | +| reference/executionmodel.po | 50.1 % | 0.0 % | 0.0 % | +| reference/expressions.po | 63.6 % | 0.0 % | 0.0 % | +| reference/grammar.po | 0.5 % | 0.0 % | 0.0 % | +| reference/import.po | 83.4 % | 0.0 % | 0.0 % | | reference/index.po | 100.0 % | 0.0 % | 0.0 % | -| reference/introduction.po | 82.3 % | 0.0 % | 0.0 % | -| reference/lexical.analysis.po | 94.7 % | 0.0 % | 0.0 % | -| reference/simple.stmts.po | 96.3 % | 0.0 % | 0.0 % | -| reference/toplevel.components.po | 100.0 % | 0.0 % | 0.0 % | -| tutorial/appendix.po | 100.0 % | 74.2 % | 0.0 % | -| tutorial/appetite.po | 100.0 % | 76.1 % | 0.0 % | -| tutorial/classes.po | 96.6 % | 0.0 % | 0.0 % | -| tutorial/controlflow.po | 98.1 % | 0.0 % | 0.0 % | -| tutorial/datastructures.po | 97.2 % | 0.0 % | 0.0 % | -| tutorial/errors.po | 65.9 % | 33.6 % | 0.0 % | -| tutorial/floatingpoint.po | 95.3 % | 0.0 % | 0.0 % | +| reference/introduction.po | 79.2 % | 0.0 % | 0.0 % | +| reference/lexical_analysis.po | 65.1 % | 0.0 % | 0.0 % | +| reference/simple_stmts.po | 65.9 % | 0.0 % | 0.0 % | +| reference/toplevel_components.po | 96.8 % | 0.0 % | 0.0 % | +| tutorial/appendix.po | 58.4 % | 39.9 % | 0.0 % | +| tutorial/appetite.po | 100.0 % | 100.0 % | 0.0 % | +| tutorial/classes.po | 63.8 % | 0.0 % | 0.0 % | +| tutorial/controlflow.po | 60.1 % | 0.0 % | 0.0 % | +| tutorial/datastructures.po | 54.6 % | 0.6 % | 0.0 % | +| tutorial/errors.po | 36.0 % | 17.4 % | 0.0 % | +| tutorial/floatingpoint.po | 33.7 % | 0.0 % | 0.0 % | | tutorial/index.po | 100.0 % | 100.0 % | 0.0 % | -| tutorial/inputoutput.po | 92.0 % | 0.0 % | 0.0 % | -| tutorial/interactive.po | 100.0 % | 0.0 % | 0.0 % | -| tutorial/interpreter.po | 85.6 % | 0.0 % | 0.0 % | -| tutorial/introduction.po | 96.8 % | 0.0 % | 0.0 % | -| tutorial/modules.po | 88.5 % | 0.0 % | 0.0 % | -| tutorial/stdlib.po | 100.0 % | 0.0 % | 0.0 % | -| tutorial/stdlib2.po | 100.0 % | 0.0 % | 0.0 % | -| tutorial/venv.po | 76.1 % | 0.0 % | 0.0 % | -| tutorial/whatnow.po | 77.2 % | 77.2 % | 0.0 % | -| using/cmdline.po | 88.7 % | 0.0 % | 0.0 % | -| using/configure.po | 79.3 % | 0.0 % | 0.0 % | -| using/editors.po | 100.0 % | 0.0 % | 0.0 % | +| tutorial/inputoutput.po | 61.1 % | 0.0 % | 0.0 % | +| tutorial/interactive.po | 77.2 % | 0.0 % | 0.0 % | +| tutorial/interpreter.po | 79.9 % | 0.0 % | 0.0 % | +| tutorial/introduction.po | 51.8 % | 0.0 % | 0.0 % | +| tutorial/modules.po | 56.1 % | 0.0 % | 0.0 % | +| tutorial/stdlib.po | 59.7 % | 0.0 % | 0.0 % | +| tutorial/stdlib2.po | 54.4 % | 0.0 % | 0.0 % | +| tutorial/venv.po | 50.5 % | 0.0 % | 0.0 % | +| tutorial/whatnow.po | 100.0 % | 77.2 % | 0.0 % | +| using/cmdline.po | 59.8 % | 0.0 % | 0.0 % | +| using/configure.po | 31.8 % | 0.0 % | 0.0 % | +| using/editors.po | 25.0 % | 0.0 % | 0.0 % | | using/index.po | 100.0 % | 0.0 % | 0.0 % | -| using/mac.po | 81.7 % | 0.0 % | 0.0 % | -| using/unix.po | 83.9 % | 0.0 % | 0.0 % | -| using/windows.po | 80.2 % | 0.0 % | 0.0 % | -| whatsnew/2.0.po | 97.3 % | 0.0 % | 0.0 % | -| whatsnew/2.1.po | 98.8 % | 0.0 % | 0.0 % | -| whatsnew/2.2.po | 98.2 % | 0.0 % | 0.0 % | -| whatsnew/2.3.po | 97.6 % | 0.0 % | 0.0 % | -| whatsnew/2.4.po | 94.4 % | 0.0 % | 0.0 % | -| whatsnew/2.5.po | 94.0 % | 0.0 % | 0.0 % | -| whatsnew/2.6.po | 97.1 % | 0.0 % | 0.0 % | -| whatsnew/2.7.po | 97.2 % | 0.0 % | 0.0 % | -| whatsnew/3.0.po | 99.2 % | 0.0 % | 0.0 % | -| whatsnew/3.1.po | 94.1 % | 0.0 % | 0.0 % | -| whatsnew/3.10.po | 90.4 % | 0.0 % | 0.0 % | -| whatsnew/3.2.po | 96.4 % | 0.0 % | 0.0 % | -| whatsnew/3.3.po | 97.3 % | 0.0 % | 0.0 % | -| whatsnew/3.4.po | 98.8 % | 0.0 % | 0.0 % | -| whatsnew/3.5.po | 98.5 % | 0.0 % | 0.0 % | -| whatsnew/3.6.po | 98.0 % | 0.0 % | 0.0 % | -| whatsnew/3.7.po | 96.3 % | 0.0 % | 0.0 % | -| whatsnew/3.8.po | 98.9 % | 0.0 % | 0.0 % | -| whatsnew/3.9.po | 98.2 % | 0.0 % | 0.0 % | -| whatsnew/changelog.po | 100.0 % | 0.0 % | 0.0 % | +| using/mac.po | 1.3 % | 0.0 % | 0.0 % | +| using/unix.po | 53.4 % | 0.0 % | 0.0 % | +| using/windows.po | 67.3 % | 0.0 % | 0.0 % | +| whatsnew/2_0.po | 61.1 % | 0.0 % | 0.0 % | +| whatsnew/2_1.po | 62.3 % | 0.0 % | 0.0 % | +| whatsnew/2_2.po | 57.2 % | 0.0 % | 0.0 % | +| whatsnew/2_3.po | 49.5 % | 0.0 % | 0.0 % | +| whatsnew/2_4.po | 73.1 % | 0.0 % | 0.0 % | +| whatsnew/2_5.po | 74.2 % | 0.0 % | 0.0 % | +| whatsnew/2_6.po | 71.9 % | 0.0 % | 0.0 % | +| whatsnew/2_7.po | 64.4 % | 0.0 % | 0.0 % | +| whatsnew/3_0.po | 65.0 % | 0.0 % | 0.0 % | +| whatsnew/3_1.po | 62.8 % | 0.0 % | 0.0 % | +| whatsnew/3_10.po | 65.9 % | 0.0 % | 0.0 % | +| whatsnew/3_2.po | 63.9 % | 0.0 % | 0.0 % | +| whatsnew/3_3.po | 82.1 % | 0.0 % | 0.0 % | +| whatsnew/3_4.po | 86.0 % | 0.0 % | 0.0 % | +| whatsnew/3_5.po | 83.1 % | 0.2 % | 0.0 % | +| whatsnew/3_6.po | 80.8 % | 0.0 % | 0.0 % | +| whatsnew/3_7.po | 86.3 % | 0.0 % | 0.0 % | +| whatsnew/3_8.po | 77.1 % | 0.0 % | 0.0 % | +| whatsnew/3_9.po | 69.0 % | 0.0 % | 0.0 % | +| whatsnew/changelog.po | 0.1 % | 0.0 % | 0.0 % | | whatsnew/index.po | 100.0 % | 0.0 % | 0.0 % | -| c-api/objbuffer.po | 100.0 % | 0.0 % | 0.0 % | -| library/security.warnings.po | 62.6 % | 0.0 % | 0.0 % | +| library/security_warnings.po | 60.9 % | 0.0 % | 0.0 % | | c-api/frame.po | 0.0 % | 0.0 % | 0.0 % | -| howto/isolating-extensions.po | 0.3 % | 0.0 % | 0.0 % | -| includes/wasm-notavail.po | 0.0 % | 0.0 % | 0.0 % | +| howto/isolating-extensions.po | 0.2 % | 0.0 % | 0.0 % | | library/asyncio-extending.po | 0.0 % | 0.0 % | 0.0 % | | library/asyncio-runner.po | 0.2 % | 0.0 % | 0.0 % | -| library/importlib.resources.po | 0.0 % | 0.0 % | 0.0 % | -| library/importlib.resources.abc.po | 85.0 % | 0.0 % | 0.0 % | -| library/sys.path.init.po | 0.3 % | 0.0 % | 0.0 % | -| library/tomllib.po | 6.5 % | 0.0 % | 0.0 % | -| whatsnew/3.11.po | 1.4 % | 0.0 % | 0.0 % | +| library/importlib_resources.po | 0.2 % | 0.0 % | 0.0 % | +| library/importlib_resources_abc.po | 56.6 % | 0.0 % | 0.0 % | +| library/sys_path_init.po | 0.3 % | 0.0 % | 0.0 % | +| library/tomllib.po | 5.8 % | 0.0 % | 0.0 % | +| whatsnew/3_11.po | 1.2 % | 0.0 % | 0.0 % | +| c-api/perfmaps.po | 0.0 % | 0.0 % | 0.0 % | +| howto/perf_profiling.po | 0.1 % | 0.0 % | 0.0 % | +| whatsnew/3_12.po | 3.4 % | 0.0 % | 0.0 % | +| library/sys_monitoring.po | 0.0 % | 0.0 % | 0.0 % | +| library/cmdline.po | 0.0 % | 0.0 % | 0.0 % | +| c-api/hash.po | 0.0 % | 0.0 % | 0.0 % | +| howto/gdb_helpers.po | 0.1 % | 0.0 % | 0.0 % | +| howto/mro.po | 0.1 % | 0.0 % | 0.0 % | +| c-api/monitoring.po | 0.2 % | 0.0 % | 0.0 % | +| c-api/time.po | 0.3 % | 0.0 % | 0.0 % | +| howto/timerfd.po | 0.2 % | 0.0 % | 0.0 % | +| using/ios.po | 0.0 % | 0.0 % | 0.0 % | +| whatsnew/3_13.po | 4.3 % | 0.0 % | 0.0 % | +| howto/free-threading-extensions.po | 0.1 % | 0.0 % | 0.0 % | +| deprecations/pending-removal-in-3_14.po | 0.0 % | 0.0 % | 0.0 % | +| deprecations/pending-removal-in-3_15.po | 0.0 % | 0.0 % | 0.0 % | +| deprecations/pending-removal-in-3_16.po | 0.0 % | 0.0 % | 0.0 % | +| deprecations/pending-removal-in-future.po | 0.0 % | 0.0 % | 0.0 % | +| deprecations/pending-removal-in-3_13.po | 0.0 % | 0.0 % | 0.0 % | +| deprecations/index.po | 0.0 % | 0.0 % | 0.0 % | +| deprecations/c-api-pending-removal-in-3_14.po | 0.0 % | 0.0 % | 0.0 % | +| deprecations/c-api-pending-removal-in-3_15.po | 0.0 % | 0.0 % | 0.0 % | +| deprecations/c-api-pending-removal-in-future.po | 0.0 % | 0.0 % | 0.0 % | +| using/android.po | 0.0 % | 0.0 % | 0.0 % | +| howto/free-threading-python.po | 0.4 % | 0.0 % | 0.0 % | +| howto/argparse-optparse.po | 52.8 % | 0.0 % | 0.0 % | +| library/aifc.po | 0.0 % | 0.0 % | 0.0 % | +| library/asynchat.po | 0.0 % | 0.0 % | 0.0 % | +| library/asyncore.po | 0.0 % | 0.0 % | 0.0 % | +| library/audioop.po | 0.0 % | 0.0 % | 0.0 % | +| library/cgi.po | 0.0 % | 0.0 % | 0.0 % | +| library/cgitb.po | 0.0 % | 0.0 % | 0.0 % | +| library/chunk.po | 0.0 % | 0.0 % | 0.0 % | +| library/crypt.po | 0.0 % | 0.0 % | 0.0 % | +| library/distutils.po | 0.0 % | 0.0 % | 0.0 % | +| library/imghdr.po | 0.0 % | 0.0 % | 0.0 % | +| library/imp.po | 0.0 % | 0.0 % | 0.0 % | +| library/mailcap.po | 0.0 % | 0.0 % | 0.0 % | +| library/msilib.po | 0.0 % | 0.0 % | 0.0 % | +| library/nntplib.po | 0.0 % | 0.0 % | 0.0 % | +| library/nis.po | 0.0 % | 0.0 % | 0.0 % | +| library/ossaudiodev.po | 0.0 % | 0.0 % | 0.0 % | +| library/pipes.po | 0.0 % | 0.0 % | 0.0 % | +| library/removed.po | 0.0 % | 0.0 % | 0.0 % | +| library/smtpd.po | 0.0 % | 0.0 % | 0.0 % | +| library/sndhdr.po | 0.0 % | 0.0 % | 0.0 % | +| library/spwd.po | 0.0 % | 0.0 % | 0.0 % | +| library/sunau.po | 0.0 % | 0.0 % | 0.0 % | +| library/telnetlib.po | 0.0 % | 0.0 % | 0.0 % | +| library/uu.po | 0.0 % | 0.0 % | 0.0 % | +| library/xdrlib.po | 0.0 % | 0.0 % | 0.0 % | +| library/cmdlinelibs.po | 0.0 % | 0.0 % | 0.0 % | diff --git a/about.po b/about.po new file mode 100644 index 000000000..fa9b3422e --- /dev/null +++ b/about.po @@ -0,0 +1,86 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2023 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:47+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2023\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "About this documentation" +msgstr "" + +msgid "" +"Python's documentation is generated from `reStructuredText`_ sources using " +"`Sphinx`_, a documentation generator originally created for Python and now " +"maintained as an independent project." +msgstr "" + +msgid "" +"Development of the documentation and its toolchain is an entirely volunteer " +"effort, just like Python itself. If you want to contribute, please take a " +"look at the :ref:`reporting-bugs` page for information on how to do so. New " +"volunteers are always welcome!" +msgstr "" +"Розробка документації та її інструментарію є повністю волонтерською роботою, " +"як і сам Python. Якщо ви хочете внести свій внесок, подивіться на сторінку :" +"ref:`reporting-bugs`, щоб дізнатися, як це зробити. Завжди раді новим " +"волонтерам!" + +msgid "Many thanks go to:" +msgstr "Велика подяка:" + +msgid "" +"Fred L. Drake, Jr., the creator of the original Python documentation toolset " +"and author of much of the content;" +msgstr "" + +msgid "" +"the `Docutils `_ project for creating " +"reStructuredText and the Docutils suite;" +msgstr "" +"`Docutils `_ проект для створення " +"reStructuredText and і пакету Docutils;" + +msgid "" +"Fredrik Lundh for his Alternative Python Reference project from which Sphinx " +"got many good ideas." +msgstr "" +"Fredrik Lundh за його проєкт Alternative Python Reference, з якого Sphinx " +"взяв багато хороших ідей." + +msgid "Contributors to the Python documentation" +msgstr "" + +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 "" +"Багато людей зробили внесок у мову Python, стандартну бібліотеку Python і " +"документацію Python. Перегляньте :source:`Misc/ACKS` у вихідному коді Python " +"з неповним списком учасників." + +msgid "" +"It is only with the input and contributions of the Python community that " +"Python has such wonderful documentation -- Thank You!" +msgstr "" +"Лише завдяки внеску спільноти Python має таку чудову документацію -- Дякуємо!" diff --git a/bugs.po b/bugs.po new file mode 100644 index 000000000..5a2da1e21 --- /dev/null +++ b/bugs.po @@ -0,0 +1,255 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2023 +# Ivan Prytula, 2023 +# Yuliia Shevchenko, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:47+0000\n" +"Last-Translator: Yuliia Shevchenko, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Dealing with Bugs" +msgstr "Робота з помилками" + +msgid "" +"Python is a mature programming language which has established a reputation " +"for stability. In order to maintain this reputation, the developers would " +"like to know of any deficiencies you find in Python." +msgstr "" +"Python — це розвинута мова програмування, яка заслужила репутацію " +"стабільної. Щоб зберегти цю репутацію, розробники хотіли б знати про будь-" +"які недоліки, які ви знайдете в Python." + +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 `." +msgstr "" +"Іноді швидше виправити помилки самостійно та внести виправлення в Python, " +"оскільки це спрощує процес і залучає менше людей. Прочитайте як :ref:" +"`зробити внесок `." + +msgid "Documentation bugs" +msgstr "Помилки в документації" + +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." +msgstr "" +"Якщо ви знайшли помилку в цій документації або бажаєте запропонувати " +"покращення, надішліть звіт про помилку на :ref:`трекер `. " +"Якщо у вас є пропозиції щодо того, як це виправити, також додайте їх у звіт." + +msgid "" +"You can also open a discussion item on our `Documentation Discourse forum " +"`_." +msgstr "" +"Ви також можете відкрити тему для обговорення на нашому `Documentation " +"Discourse forum `_." + +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 " +"tracker `_." +msgstr "" +"Якщо ви знайдете помилку в темі (HTML / CSS / JavaScript) документації, будь " +"ласка, подайте звіт про помилку в `системі відстеження помилок python-doc-" +"theme `_." + +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 "" +"Якщо у вас мало часу, ви також можете надіслати звіт про помилки в " +"документації електронною поштою на адресу docs@python.org (поведінкові " +"помилки можна надіслати на адресу python-list@python.org). 'docs@' — це " +"список розсилки, який ведуть волонтери; ваш запит буде занотовано, хоча і " +"обробка може зайняти деякий час." + +msgid "`Documentation bugs`_" +msgstr "Помилки в документації - `Documentation bugs`_" + +msgid "" +"A list of documentation bugs that have been submitted to the Python issue " +"tracker." +msgstr "" +"Список помилок в документації, які були надіслані до трекера помилок Python." + +msgid "`Issue Tracking `_" +msgstr "`Трекер помилок `_" + +msgid "" +"Overview of the process involved in reporting an improvement on the tracker." +msgstr "Огляд процесу інформування щодо покращення на трекері." + +msgid "" +"`Helping with Documentation `_" +msgstr "" +"`Допомога з документацією `_" + +msgid "" +"Comprehensive guide for individuals that are interested in contributing to " +"Python documentation." +msgstr "" +"Вичерпний посібник для осіб, що зацікавлені у внесенні змін в документацію " +"Python." + +msgid "" +"`Documentation Translations `_" +msgstr "" +"`Переклади документації `_" + +msgid "" +"A list of GitHub pages for documentation translation and their primary " +"contacts." +msgstr "" +"Список сторінок GitHub для перекладу документації та їхні основні контакти." + +msgid "Using the Python issue tracker" +msgstr "Використання трекеру помилок Python" + +msgid "" +"Issue reports for Python itself should be submitted via the GitHub issues " +"tracker (https://github.com/python/cpython/issues). The GitHub issues " +"tracker offers a web form which allows pertinent information to be entered " +"and submitted to the developers." +msgstr "" +"Звіти про проблеми для самого Python слід надсилати через засіб відстеження " +"проблем GitHub (https://github.com/python/cpython/issues). Відстеження " +"проблем GitHub пропонує веб-форму, яка дозволяє вводити відповідну " +"інформацію та надсилати її розробникам." + +msgid "" +"The first step in filing a report is to determine whether the problem has " +"already been reported. The advantage in doing so, aside from saving the " +"developers' time, is that you learn what has been done to fix it; it may be " +"that the problem has already been fixed for the next release, or additional " +"information is needed (in which case you are welcome to provide it if you " +"can!). To do this, search the tracker using the search box at the top of the " +"page." +msgstr "" +"Першим кроком у поданні звіту є визначення того, чи вже повідомлялося про " +"проблему. Перевага в цьому, окрім економії часу розробників, полягає в тому, " +"що ви дізнаєтесь, що було зроблено, щоб це виправити; можливо, проблему вже " +"виправлено для наступного випуску або потрібна додаткова інформація (у " +"такому випадку ви можете надати її, якщо можете!). Для цього виконайте пошук " +"у трекері за допомогою вікна пошуку у верхній частині сторінки." + +msgid "" +"If the problem you're reporting is not already in the list, log in to " +"GitHub. If you don't already have a GitHub account, create a new account " +"using the \"Sign up\" link. It is not possible to submit a bug report " +"anonymously." +msgstr "" +"Якщо проблема, про яку ви повідомляєте, ще немає у списку, увійдіть на " +"GitHub. Якщо у вас ще немає облікового запису GitHub, створіть новий " +"обліковий запис за допомогою посилання «Sign up». Неможливо подати звіт про " +"помилку анонімно." + +msgid "" +"Being now logged in, you can submit an issue. Click on the \"New issue\" " +"button in the top bar to report a new issue." +msgstr "" +"Увійшовши в систему, ви можете надіслати проблему. Натисніть кнопку \"New " +"issue\" на верхній панелі, щоб повідомити про нову проблему." + +msgid "The submission form has two fields, \"Title\" and \"Comment\"." +msgstr "Форма подання має два поля \"Title\" та \"Comment\"." + +msgid "" +"For the \"Title\" field, enter a *very* short description of the problem; " +"fewer than ten words is good." +msgstr "" +"У полі \"Назва\" введіть *дуже* короткий опис проблеми; достатньо менше " +"десяти слів." + +msgid "" +"In the \"Comment\" field, describe the problem in detail, including what you " +"expected to happen and what did happen. Be sure to include whether any " +"extension modules were involved, and what hardware and software platform you " +"were using (including version information as appropriate)." +msgstr "" +"У полі \"Comment\" детально опишіть проблему, включно з тим, що ви очікували " +"статися і що сталося. Обов’язково вкажіть, чи були задіяні якісь модулі " +"розширення, а також яку апаратну та програмну платформу ви використовували " +"(включно з інформацією про версію, якщо це необхідно)." + +msgid "" +"Each issue report will be reviewed by a developer who will determine what " +"needs to be done to correct the problem. You will receive an update each " +"time an action is taken on the issue." +msgstr "" +"Кожен звіт про проблему розглядатиметься розробником, який визначить, що " +"потрібно зробити, щоб вирішити проблему. Ви отримуватимете оновлення щоразу, " +"коли буде виконано певну дію щодо проблеми." + +msgid "" +"`How to Report Bugs Effectively `_" +msgstr "" +"`Як ефективно повідомляти про помилки `_" + +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." +msgstr "" +"Стаття, в якій детально описано, як створити корисний звіт про помилку. Вона " +"описує, яка інформація є корисною та чому вона корисна." + +msgid "" +"`Bug Writing Guidelines `_" +msgstr "" +"`Правила опису помилок `_" + +msgid "" +"Information about writing a good bug report. Some of this is specific to " +"the Mozilla project, but describes general good practices." +msgstr "" +"Інформація про написання хорошого звіту про помилку. Дещо з цього стосується " +"лише проєкту Mozilla, але взагалом описані загальні хороші практики." + +msgid "Getting started contributing to Python yourself" +msgstr "Початок власного внеску в Python" + +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 " +"patching Python in the `Python Developer's Guide`_. If you have questions, " +"the `core-mentorship mailing list`_ is a friendly place to get answers to " +"any and all questions pertaining to the process of fixing issues in Python." +msgstr "" +"Окрім повідомлення про знайдені помилки, ви також можете виправлення їх " +"самостійно. Ви можете знайти більше інформації про те, як почати виправляти " +"Python, у посібнику `Python Developer's Guide`_. Якщо у вас є запитання, " +"`core-mentorship mailing list`_ — це дружнє місце, де можна отримати " +"відповіді на будь-які питання, що стосуються процесу вирішення проблем у " +"Python." diff --git a/c-api/abstract.po b/c-api/abstract.po new file mode 100644 index 000000000..d3d4c6ef3 --- /dev/null +++ b/c-api/abstract.po @@ -0,0 +1,51 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:47+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Abstract Objects Layer" +msgstr "Шар абстрактних об'єктів" + +msgid "" +"The functions in this chapter interact with Python objects regardless of " +"their type, or with wide classes of object types (e.g. all numerical types, " +"or all sequence types). When used on object types for which they do not " +"apply, they will raise a Python exception." +msgstr "" +"Функції в цьому розділі взаємодіють з об’єктами Python незалежно від їх типу " +"або з широкими класами типів об’єктів (наприклад, усі числові типи або всі " +"типи послідовностей). При використанні на типах об’єктів, для яких вони не " +"застосовуються, вони викликають виняток Python." + +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." +msgstr "" +"Ці функції неможливо використовувати для об’єктів, які не були " +"ініціалізовані належним чином, наприклад, об’єкт списку, який створений за " +"допомогою :c:func:`PyList_New`, проте для його елементів не було задано " +"значення відмінні від ``NULL``." diff --git a/c-api/allocation.po b/c-api/allocation.po new file mode 100644 index 000000000..45d8efcdb --- /dev/null +++ b/c-api/allocation.po @@ -0,0 +1,111 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# Ivan Prytula, 2023 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-04 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:47+0000\n" +"Last-Translator: Ivan Prytula, 2023\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Allocating Objects on the Heap" +msgstr "Розміщення об'єктів у купі" + +msgid "" +"Initialize a newly allocated object *op* with its type and initial " +"reference. Returns the initialized object. Other fields of the object are " +"not affected." +msgstr "" + +msgid "" +"This does everything :c:func:`PyObject_Init` does, and also initializes the " +"length information for a variable-size object." +msgstr "" +"Це робить все, що робить :c:func:`PyObject_Init`, а також ініціалізує " +"інформацію про довжину для об’єкта змінного розміру." + +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." +msgstr "" + +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 "" + +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 allocated memory allows for " +"the *TYPE* structure plus *size* (``Py_ssize_t``) fields of the size given " +"by the :c:member:`~PyTypeObject.tp_itemsize` field of *typeobj*. This is " +"useful for implementing objects like tuples, which are able to determine " +"their size at construction time. Embedding the array of fields into the " +"same allocation decreases the number of allocations, improving the memory " +"management efficiency." +msgstr "" +"Виділяє новий об'єкт Python, використовуючи структурний тип C *TYPE* та " +"об'єкт типу Python *typeobj* (``PyTypeObject*``). Поля, не визначені в " +"заголовку об'єкта Python, не ініціалізуються. Виділена пам'ять дозволяє " +"розмістити структуру *TYPE* плюс поля *size* (``Py_ssize_t``) розміром, " +"заданим полем :c:member:`~PyTypeObject.tp_itemsize` об'єкта *typeobj*. Це " +"корисно для реалізації об'єктів типу кортежів, які можуть визначати свій " +"розмір під час конструювання. Вбудовування масиву полів в один розподіл " +"зменшує кількість розподілів, покращуючи ефективність управління пам'яттю." + +msgid "" +"Note that this function is unsuitable if *typeobj* has :c:macro:" +"`Py_TPFLAGS_HAVE_GC` set. For such objects, use :c:func:`PyObject_GC_NewVar` " +"instead." +msgstr "" + +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." +msgstr "" +"Звільняє пам'ять, виділену для об'єкта за допомогою :c:macro:`PyObject_New` " +"або :c:macro:`PyObject_NewVar`. Зазвичай викликається з обробника :c:member:" +"`~PyTypeObject.tp_dealloc`, вказаного в типі об'єкта. Після цього виклику " +"не слід звертатися до полів об'єкта, оскільки пам'ять більше не є дійсним " +"об'єктом Python." + +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 " +"object." +msgstr "" +"Об’єкт, видимий у Python як ``None``. Доступ до нього можна отримати лише за " +"допомогою макросу :c:macro:`Py_None`, який обчислює вказівник на цей об’єкт." + +msgid ":c:func:`PyModule_Create`" +msgstr ":c:func:`PyModule_Create`" + +msgid "To allocate and create extension modules." +msgstr "Для розміщення та створення модулів розширення." diff --git a/c-api/apiabiversion.po b/c-api/apiabiversion.po new file mode 100644 index 000000000..62501870e --- /dev/null +++ b/c-api/apiabiversion.po @@ -0,0 +1,169 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# Pavlo Slavynskyy, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:47+0000\n" +"Last-Translator: Pavlo Slavynskyy, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "API and ABI Versioning" +msgstr "Керування версіями API та ABI" + +msgid "" +"CPython exposes its version number in the following macros. Note that these " +"correspond to the version code is **built** with, not necessarily the " +"version used at **run time**." +msgstr "" +"CPython розкриває номер своєї версії в наступних макросах. Зауважте, що вони " +"відповідають коду версії, з яким **зібрано**, не обов’язково версії, яка " +"використовується під час **виконання**." + +msgid "" +"See :ref:`stable` for a discussion of API and ABI stability across versions." +msgstr "" +"Перегляньте :ref:`stable` для обговорення стабільності API та ABI у різних " +"версіях." + +msgid "The ``3`` in ``3.4.1a2``." +msgstr "``3`` в ``3.4.1a2``." + +msgid "The ``4`` in ``3.4.1a2``." +msgstr "``4`` в ``3.4.1a2``." + +msgid "The ``1`` in ``3.4.1a2``." +msgstr "``1`` в ``3.4.1a2``." + +msgid "" +"The ``a`` in ``3.4.1a2``. This can be ``0xA`` for alpha, ``0xB`` for beta, " +"``0xC`` for release candidate or ``0xF`` for final." +msgstr "" +"``a`` в ``3.4.1a2``. Це може бути ``0xA`` для альфа-версії, ``0xB`` для бета-" +"версії, ``0xC`` для кандидата на випуск або ``0xF`` для фіналу." + +msgid "The ``2`` in ``3.4.1a2``. Zero for final releases." +msgstr "``2`` в ``3.4.1a2``. Нуль для остаточних випусків." + +msgid "The Python version number encoded in a single integer." +msgstr "Номер версії Python, закодований одним цілим числом." + +msgid "" +"The underlying version information can be found by treating it as a 32 bit " +"number in the following manner:" +msgstr "" +"Базову інформацію про версію можна знайти, розглядаючи її як 32-розрядне " +"число таким чином:" + +msgid "Bytes" +msgstr "Байти" + +msgid "Bits (big endian order)" +msgstr "Біти (великий порядок байтів)" + +msgid "Meaning" +msgstr "Значення" + +msgid "Value for ``3.4.1a2``" +msgstr "Значення для ``3.4.1a2``" + +msgid "1" +msgstr "1" + +msgid "1-8" +msgstr "1-8" + +msgid "``PY_MAJOR_VERSION``" +msgstr "``PY_MAJOR_VERSION``" + +msgid "``0x03``" +msgstr "``0x03``" + +msgid "2" +msgstr "2" + +msgid "9-16" +msgstr "9-16" + +msgid "``PY_MINOR_VERSION``" +msgstr "``PY_MINOR_VERSION``" + +msgid "``0x04``" +msgstr "``0x04``" + +msgid "3" +msgstr "3" + +msgid "17-24" +msgstr "17-24" + +msgid "``PY_MICRO_VERSION``" +msgstr "``PY_MICRO_VERSION``" + +msgid "``0x01``" +msgstr "``0x01``" + +msgid "4" +msgstr "4" + +msgid "25-28" +msgstr "25-28" + +msgid "``PY_RELEASE_LEVEL``" +msgstr "``PY_RELEASE_LEVEL``" + +msgid "``0xA``" +msgstr "``0xA``" + +msgid "29-32" +msgstr "29-32" + +msgid "``PY_RELEASE_SERIAL``" +msgstr "``PY_RELEASE_SERIAL``" + +msgid "``0x2``" +msgstr "``0x2``" + +msgid "" +"Thus ``3.4.1a2`` is hexversion ``0x030401a2`` and ``3.10.0`` is hexversion " +"``0x030a00f0``." +msgstr "" +"Таким чином, ``3.4.1a2`` є шістнадцятковою версією ``0x030401a2``, а " +"``3.10.0`` є шістнадцятковою версією ``0x030a00f0``." + +msgid "Use this for numeric comparisons, e.g. ``#if PY_VERSION_HEX >= ...``." +msgstr "" +"Використовується для числових порівнянь, напр. ``#if PY_VERSION_HEX >= ...``" + +msgid "This version is also available via the symbol :c:var:`Py_Version`." +msgstr "Ця версія також доступна як :c:var:`Py_Version`." + +msgid "" +"The Python runtime version number encoded in a single constant integer, with " +"the same format as the :c:macro:`PY_VERSION_HEX` macro. This contains the " +"Python version used at run time." +msgstr "" +"Версія середовища виконання Python, представлена як єдина ціла константа, у " +"тому ж форматі, що й макрос :c:macro:`PY_VERSION_HEX`. Містить версію " +"Python, що використовується під час виконання." + +msgid "All the given macros are defined in :source:`Include/patchlevel.h`." +msgstr "Усі вказані макроси визначено в :source:`Include/patchlevel.h`." diff --git a/c-api/arg.po b/c-api/arg.po new file mode 100644 index 000000000..ed305f926 --- /dev/null +++ b/c-api/arg.po @@ -0,0 +1,1202 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2024 +# Pavlo Slavynskyy, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:47+0000\n" +"Last-Translator: Pavlo Slavynskyy, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Parsing arguments and building values" +msgstr "Розбір аргументів і створення значень" + +msgid "" +"These functions are useful when creating your own extension functions and " +"methods. Additional information and examples are available in :ref:" +"`extending-index`." +msgstr "" + +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." +msgstr "" +"Перші три з цих описаних функцій, :c:func:`PyArg_ParseTuple`, :c:func:" +"`PyArg_ParseTupleAndKeywords` і :c:func:`PyArg_Parse`, усі використовують " +"*форматні рядки*, які використовуються, щоб повідомити функції про очікувані " +"аргументи. Рядки формату використовують однаковий синтаксис для кожної з цих " +"функцій." + +msgid "Parsing arguments" +msgstr "Розбір аргументів" + +msgid "" +"A format string consists of zero or more \"format units.\" A format unit " +"describes one Python object; it is usually a single character or a " +"parenthesized sequence of format units. With a few exceptions, a format " +"unit that is not a parenthesized sequence normally corresponds to a single " +"address argument to these functions. In the following description, the " +"quoted form is the format unit; the entry in (round) parentheses is the " +"Python object type that matches the format unit; and the entry in [square] " +"brackets is the type of the C variable(s) whose address should be passed." +msgstr "" +"Рядок формату складається з нуля або більше \"одиниць формату\". Одиниця " +"формату описує один об’єкт Python; зазвичай це один символ або послідовність " +"одиниць формату в дужках. За кількома винятками, одиниця формату, яка не є " +"послідовністю в дужках, зазвичай відповідає одному аргументу адреси для цих " +"функцій. У наступному описі форма в лапках є одиницею формату; запис у " +"(круглих) дужках — це тип об’єкта Python, який відповідає одиниці формату; а " +"запис у [квадратних] дужках — це тип змінної (змінних) C, адреса якої має " +"бути передана." + +msgid "Strings and buffers" +msgstr "Рядки та буфери" + +msgid "" +"On Python 3.12 and older, the macro :c:macro:`!PY_SSIZE_T_CLEAN` must be " +"defined before including :file:`Python.h` to use all ``#`` variants of " +"formats (``s#``, ``y#``, etc.) explained below. This is not necessary on " +"Python 3.13 and later." +msgstr "" +"Для Python 3.12 і старших версій, макрос :c:macro:`!PY_SSIZE_T_CLEAN`має " +"бути визначено перед включенням :file:`Python.h`, щоб скористатися усіма " +"варіантами форматів ``#`` (``s#``, ``y#`` і т.п.), про які йдеться нижче. " +"Його можна не визначати для Python 3.13 і пізніших версій." + +msgid "" +"These formats allow accessing an object as a contiguous chunk of memory. You " +"don't have to provide raw storage for the returned unicode or bytes area." +msgstr "" +"Ці формати дозволяють отримати доступ до об’єкта як до безперервної частини " +"пам’яті. Вам не потрібно надавати необроблене сховище для поверненої області " +"Юнікоду або байтів." + +msgid "Unless otherwise stated, buffers are not NUL-terminated." +msgstr "Якщо не зазначено інше, буфери не завершуються NUL." + +msgid "There are three ways strings and buffers can be converted to C:" +msgstr "Є три способи конвертування рядків і буферів для використання в C:" + +msgid "" +"Formats such as ``y*`` and ``s*`` fill a :c:type:`Py_buffer` structure. This " +"locks the underlying buffer so that the caller can subsequently use the " +"buffer even inside a :c:type:`Py_BEGIN_ALLOW_THREADS` block without the risk " +"of mutable data being resized or destroyed. As a result, **you have to " +"call** :c:func:`PyBuffer_Release` after you have finished processing the " +"data (or in any early abort case)." +msgstr "" +"Такі формати, як ``y*`` і ``s*``, заповнюють структуру :c:type:`Py_buffer`. " +"Це блокує буфер, що лежить в основі, щоб функція, що викликала, могла згодом " +"використовувати буфер навіть всередині блоку :c:type:" +"`Py_BEGIN_ALLOW_THREADS` без ризику, що мутабельні дані будуть змінені або " +"знищені. В результаті, **ви маєте викликати** :c:func:`PyBuffer_Release` " +"після того, як ви закінчите обробку даних (або в будь-якому випадку " +"дострокового переривання)." + +msgid "" +"The ``es``, ``es#``, ``et`` and ``et#`` formats allocate the result buffer. " +"**You have to call** :c:func:`PyMem_Free` after you have finished processing " +"the data (or in any early abort case)." +msgstr "" + +msgid "" +"Other formats take a :class:`str` or a read-only :term:`bytes-like object`, " +"such as :class:`bytes`, and provide a ``const char *`` pointer to its " +"buffer. In this case the buffer is \"borrowed\": it is managed by the " +"corresponding Python object, and shares the lifetime of this object. You " +"won't have to release any memory yourself." +msgstr "" + +msgid "" +"To ensure that the underlying buffer may be safely borrowed, the object's :c:" +"member:`PyBufferProcs.bf_releasebuffer` field must be ``NULL``. This " +"disallows common mutable objects such as :class:`bytearray`, but also some " +"read-only objects such as :class:`memoryview` of :class:`bytes`." +msgstr "" + +msgid "" +"Besides this ``bf_releasebuffer`` requirement, there is no check to verify " +"whether the input object is immutable (e.g. whether it would honor a request " +"for a writable buffer, or whether another thread can mutate the data)." +msgstr "" + +msgid "``s`` (:class:`str`) [const char \\*]" +msgstr "``s`` (:class:`str`) [const char \\*]" + +msgid "" +"Convert a Unicode object to a C pointer to a character string. A pointer to " +"an existing string is stored in the character pointer variable whose address " +"you pass. The C string is NUL-terminated. The Python string must not " +"contain embedded null code points; if it does, a :exc:`ValueError` exception " +"is raised. Unicode objects are converted to C strings using ``'utf-8'`` " +"encoding. If this conversion fails, a :exc:`UnicodeError` is raised." +msgstr "" +"Перетворення об’єкта Unicode на покажчик C на рядок символів. Покажчик на " +"існуючий рядок зберігається в змінній покажчика символів, адресу якої ви " +"передаєте. Рядок C закінчується NUL. Рядок Python не повинен містити " +"вбудованих нульових кодових точок; якщо це так, виникає виняток :exc:" +"`ValueError`. Об’єкти Unicode перетворюються на рядки C за допомогою " +"кодування ``'utf-8``. Якщо це перетворення не вдається, виникає помилка :exc:" +"`UnicodeError`." + +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*." +msgstr "" +"Цей формат не приймає :term:`байтоподібні об’єкти `. Якщо " +"ви хочете прийняти шляхи до файлової системи та перетворити їх на рядки " +"символів C, бажано використовувати формат ``O&`` з :c:func:" +"`PyUnicode_FSConverter` як *перетворювач*." + +msgid "" +"Previously, :exc:`TypeError` was raised when embedded null code points were " +"encountered in the Python string." +msgstr "" +"Раніше помилка :exc:`TypeError` виникала, коли в рядку Python зустрічалися " +"вбудовані нульові кодові точки." + +msgid "``s*`` (:class:`str` or :term:`bytes-like object`) [Py_buffer]" +msgstr "``s*`` (:class:`str` або :term:`bytes-like object`) [Py_buffer]" + +msgid "" +"This format accepts Unicode objects as well as bytes-like objects. It fills " +"a :c:type:`Py_buffer` structure provided by the caller. In this case the " +"resulting C string may contain embedded NUL bytes. Unicode objects are " +"converted to C strings using ``'utf-8'`` encoding." +msgstr "" +"Цей формат приймає як об’єкти Unicode, так і байтоподібні об’єкти. Він " +"заповнює структуру :c:type:`Py_buffer`, надану абонентом. У цьому випадку " +"результуючий рядок C може містити вбудовані байти NUL. Об’єкти Unicode " +"перетворюються на рядки C за допомогою кодування ``'utf-8``." + +msgid "" +"``s#`` (:class:`str`, read-only :term:`bytes-like object`) [const char \\*, :" +"c:type:`Py_ssize_t`]" +msgstr "" +"``s#`` (:class:`str`, лише для читання :term:`bytes-like object`) [const " +"char \\*, :c:type:`Py_ssize_t`]" + +msgid "" +"Like ``s*``, except that it provides a :ref:`borrowed buffer `. The result is stored into two C variables, the first one a pointer " +"to a C string, the second one its length. The string may contain embedded " +"null bytes. Unicode objects are converted to C strings using ``'utf-8'`` " +"encoding." +msgstr "" + +msgid "``z`` (:class:`str` or ``None``) [const char \\*]" +msgstr "``z`` (:class:`str` або ``None``) [const char \\*]" + +msgid "" +"Like ``s``, but the Python object may also be ``None``, in which case the C " +"pointer is set to ``NULL``." +msgstr "" +"Подібно до ``s``, але об’єкт Python також може мати значення ``None``, у " +"цьому випадку вказівник C встановлено на ``NULL``." + +msgid "" +"``z*`` (:class:`str`, :term:`bytes-like object` or ``None``) [Py_buffer]" +msgstr "" +"``z*`` (:class:`str`, :term:`bytes-like object` або ``None``) [Py_buffer]" + +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 "" +"Подібно до ``s*``, але об’єкт Python також може бути ``None``, у цьому " +"випадку ``buf`` член структури :c:type:`Py_buffer` має значення ``NULL`` ." + +msgid "" +"``z#`` (:class:`str`, read-only :term:`bytes-like object` or ``None``) " +"[const char \\*, :c:type:`Py_ssize_t`]" +msgstr "" +"``z#`` (:class:`str`, лише для читання :term:`bytes-like object` або " +"``None``) [const char \\*, :c:type:`Py_ssize_t`]" + +msgid "" +"Like ``s#``, but the Python object may also be ``None``, in which case the C " +"pointer is set to ``NULL``." +msgstr "" +"Подібно до ``s#``, але об’єкт Python також може мати значення ``None``, у " +"цьому випадку вказівник на C встановлюється як ``NULL``." + +msgid "``y`` (read-only :term:`bytes-like object`) [const char \\*]" +msgstr "``y`` (тільки для читання :term:`bytes-like object`) [const char \\*]" + +msgid "" +"This format converts a bytes-like object to a C pointer to a :ref:`borrowed " +"` character string; it does not accept Unicode " +"objects. The bytes buffer must not contain embedded null bytes; if it does, " +"a :exc:`ValueError` exception is raised." +msgstr "" + +msgid "" +"Previously, :exc:`TypeError` was raised when embedded null bytes were " +"encountered in the bytes buffer." +msgstr "" +"Раніше помилка :exc:`TypeError` виникала, коли в буфері байтів зустрічалися " +"вбудовані нульові байти." + +msgid "``y*`` (:term:`bytes-like object`) [Py_buffer]" +msgstr "``y*`` (:term:`bytes-like object`) [Py_buffer]" + +msgid "" +"This variant on ``s*`` doesn't accept Unicode objects, only bytes-like " +"objects. **This is the recommended way to accept binary data.**" +msgstr "" +"Цей варіант ``s*`` не приймає об’єкти Unicode, лише байтоподібні об’єкти. " +"**Це рекомендований спосіб приймати двійкові дані.**" + +msgid "" +"``y#`` (read-only :term:`bytes-like object`) [const char \\*, :c:type:" +"`Py_ssize_t`]" +msgstr "" +"``y#`` (тільки для читання :term:`bytes-like object`) [const char \\*, :c:" +"type:`Py_ssize_t`]" + +msgid "" +"This variant on ``s#`` doesn't accept Unicode objects, only bytes-like " +"objects." +msgstr "" +"Цей варіант ``s#`` не приймає об’єкти Unicode, лише байтоподібні об’єкти." + +msgid "``S`` (:class:`bytes`) [PyBytesObject \\*]" +msgstr "``S`` (:class:`bytes`) [PyBytesObject \\*]" + +msgid "" +"Requires that the Python object is a :class:`bytes` object, without " +"attempting any conversion. Raises :exc:`TypeError` if the object is not a " +"bytes object. The C variable may also be declared as :c:expr:`PyObject*`." +msgstr "" + +msgid "``Y`` (:class:`bytearray`) [PyByteArrayObject \\*]" +msgstr "``Y`` (:class:`bytearray`) [PyByteArrayObject \\*]" + +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*`." +msgstr "" + +msgid "``U`` (:class:`str`) [PyObject \\*]" +msgstr "``U`` (:class:`str`) [PyObject \\*]" + +msgid "" +"Requires that the Python object is a Unicode object, without attempting any " +"conversion. Raises :exc:`TypeError` if the object is not a Unicode object. " +"The C variable may also be declared as :c:expr:`PyObject*`." +msgstr "" + +msgid "``w*`` (read-write :term:`bytes-like object`) [Py_buffer]" +msgstr "``w*`` (читання-запис :term:`bytes-like object`) [Py_buffer]" + +msgid "" +"This format accepts any object which implements the read-write buffer " +"interface. It fills a :c:type:`Py_buffer` structure provided by the caller. " +"The buffer may contain embedded null bytes. The caller have to call :c:func:" +"`PyBuffer_Release` when it is done with the buffer." +msgstr "" +"Цей формат приймає будь-який об’єкт, який реалізує інтерфейс буфера читання-" +"запису. Він заповнює структуру :c:type:`Py_buffer`, надану абонентом. Буфер " +"може містити вбудовані нульові байти. Виклик має викликати :c:func:" +"`PyBuffer_Release`, коли це буде зроблено з буфером." + +msgid "``es`` (:class:`str`) [const char \\*encoding, char \\*\\*buffer]" +msgstr "``es`` (:class:`str`) [const char \\*кодування, char \\*\\*buffer]" + +msgid "" +"This variant on ``s`` is used for encoding Unicode into a character buffer. " +"It only works for encoded data without embedded NUL bytes." +msgstr "" +"Цей варіант на ``s`` використовується для кодування Юнікоду в символьний " +"буфер. Він працює лише для закодованих даних без вбудованих байтів NUL." + +msgid "" +"This format requires two arguments. The first is only used as input, and " +"must be a :c:expr:`const char*` which points to the name of an encoding as a " +"NUL-terminated string, or ``NULL``, in which case ``'utf-8'`` encoding is " +"used. An exception is raised if the named encoding is not known to Python. " +"The second argument must be a :c:expr:`char**`; the value of the pointer it " +"references will be set to a buffer with the contents of the argument text. " +"The text will be encoded in the encoding specified by the first argument." +msgstr "" + +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." +msgstr "" +":c:func:`PyArg_ParseTuple` виділить буфер необхідного розміру, скопіює " +"закодовані дані в цей буфер і налаштує *\\*buffer* для посилання на щойно " +"виділене сховище. Виклик відповідає за виклик :c:func:`PyMem_Free`, щоб " +"звільнити виділений буфер після використання." + +msgid "" +"``et`` (:class:`str`, :class:`bytes` or :class:`bytearray`) [const char " +"\\*encoding, char \\*\\*buffer]" +msgstr "" +"``et`` (:class:`str`, :class:`bytes` або :class:`bytearray`) [const char " +"\\*кодування, char \\*\\*buffer]" + +msgid "" +"Same as ``es`` except that byte string objects are passed through without " +"recoding them. Instead, the implementation assumes that the byte string " +"object uses the encoding passed in as parameter." +msgstr "" +"Те саме, що ``es``, за винятком того, що об’єкти рядків байтів передаються " +"без їх перекодування. Натомість реалізація припускає, що об’єкт рядка байтів " +"використовує кодування, передане як параметр." + +msgid "" +"``es#`` (:class:`str`) [const char \\*encoding, char \\*\\*buffer, :c:type:" +"`Py_ssize_t` \\*buffer_length]" +msgstr "" +"``es#`` (:class:`str`) [const char \\*кодування, char \\*\\*буфер, :c:type:" +"`Py_ssize_t` \\*buffer_length]" + +msgid "" +"This variant on ``s#`` is used for encoding Unicode into a character buffer. " +"Unlike the ``es`` format, this variant allows input data which contains NUL " +"characters." +msgstr "" +"Цей варіант ``s#`` використовується для кодування Юнікоду в символьний " +"буфер. На відміну від формату ``es``, цей варіант дозволяє вводити дані, які " +"містять символи NUL." + +msgid "" +"It requires three arguments. The first is only used as input, and must be " +"a :c:expr:`const char*` which points to the name of an encoding as a NUL-" +"terminated string, or ``NULL``, in which case ``'utf-8'`` encoding is used. " +"An exception is raised if the named encoding is not known to Python. The " +"second argument must be a :c:expr:`char**`; the value of the pointer it " +"references will be set to a buffer with the contents of the argument text. " +"The text will be encoded in the encoding specified by the first argument. " +"The third argument must be a pointer to an integer; the referenced integer " +"will be set to the number of bytes in the output buffer." +msgstr "" + +msgid "There are two modes of operation:" +msgstr "Є два режими роботи:" + +msgid "" +"If *\\*buffer* points a ``NULL`` pointer, the function will allocate a " +"buffer of the needed size, copy the encoded data into this buffer and set " +"*\\*buffer* to reference the newly allocated storage. The caller is " +"responsible for calling :c:func:`PyMem_Free` to free the allocated buffer " +"after usage." +msgstr "" +"Якщо *\\*buffer* вказує на вказівник ``NULL``, функція виділить буфер " +"необхідного розміру, скопіює закодовані дані в цей буфер і встановить " +"*\\*buffer* для посилання на щойно виділене сховище. Виклик відповідає за " +"виклик :c:func:`PyMem_Free`, щоб звільнити виділений буфер після " +"використання." + +msgid "" +"If *\\*buffer* points to a non-``NULL`` pointer (an already allocated " +"buffer), :c:func:`PyArg_ParseTuple` will use this location as the buffer and " +"interpret the initial value of *\\*buffer_length* as the buffer size. It " +"will then copy the encoded data into the buffer and NUL-terminate it. If " +"the buffer is not large enough, a :exc:`ValueError` will be set." +msgstr "" +"Якщо *\\*buffer* вказує на вказівник, відмінний від ``NULL`` (уже виділений " +"буфер), :c:func:`PyArg_ParseTuple` використовуватиме це розташування як " +"буфер та інтерпретуватиме початкове значення *\\*buffer_length* як розмір " +"буфера. Потім він скопіює закодовані дані в буфер і завершить його NUL. Якщо " +"буфер недостатньо великий, буде встановлено :exc:`ValueError`." + +msgid "" +"In both cases, *\\*buffer_length* is set to the length of the encoded data " +"without the trailing NUL byte." +msgstr "" +"В обох випадках *\\*buffer_length* встановлюється на довжину закодованих " +"даних без кінцевого байта NUL." + +msgid "" +"``et#`` (:class:`str`, :class:`bytes` or :class:`bytearray`) [const char " +"\\*encoding, char \\*\\*buffer, :c:type:`Py_ssize_t` \\*buffer_length]" +msgstr "" +"``et#`` (:class:`str`, :class:`bytes` або :class:`bytearray`) [const char " +"\\*кодування, char \\*\\*buffer, :c:type:`Py_ssize_t` \\*buffer_length]" + +msgid "" +"Same as ``es#`` except that byte string objects are passed through without " +"recoding them. Instead, the implementation assumes that the byte string " +"object uses the encoding passed in as parameter." +msgstr "" +"Те саме, що ``es#``, за винятком того, що байтові рядкові об’єкти " +"передаються без їх перекодування. Натомість реалізація припускає, що об’єкт " +"рядка байтів використовує кодування, передане як параметр." + +msgid "" +"``u``, ``u#``, ``Z``, and ``Z#`` are removed because they used a legacy " +"``Py_UNICODE*`` representation." +msgstr "" + +msgid "Numbers" +msgstr "Числа" + +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 "" + +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 "" + +msgid "``b`` (:class:`int`) [unsigned char]" +msgstr "``b`` (:class:`int`) [беззнаковий символ]" + +msgid "" +"Convert a nonnegative Python integer to an unsigned tiny integer, stored in " +"a C :c:expr:`unsigned char`." +msgstr "" + +msgid "``B`` (:class:`int`) [unsigned char]" +msgstr "``B`` (:class:`int`) [беззнаковий символ]" + +msgid "" +"Convert a Python integer to a tiny integer without overflow checking, stored " +"in a C :c:expr:`unsigned char`." +msgstr "" + +msgid "``h`` (:class:`int`) [short int]" +msgstr "``h`` (:class:`int`) [короткий int]" + +msgid "Convert a Python integer to a C :c:expr:`short int`." +msgstr "Перетворює ціле число Python на C :c:expr:`short int`." + +msgid "``H`` (:class:`int`) [unsigned short int]" +msgstr "``H`` (:class:`int`) [unsigned short int]" + +msgid "" +"Convert a Python integer to a C :c:expr:`unsigned short int`, without " +"overflow checking." +msgstr "" +"Перетворює ціле число Python на C :c:expr:`unsigned short int` без перевірки " +"переповнення." + +msgid "``i`` (:class:`int`) [int]" +msgstr "``i`` (:class:`int`) [int]" + +msgid "Convert a Python integer to a plain C :c:expr:`int`." +msgstr "" + +msgid "``I`` (:class:`int`) [unsigned int]" +msgstr "``I`` (:class:`int`) [unsigned int]" + +msgid "" +"Convert a Python integer to a C :c:expr:`unsigned int`, without overflow " +"checking." +msgstr "" + +msgid "``l`` (:class:`int`) [long int]" +msgstr "``l`` (:class:`int`) [довге ціле]" + +msgid "Convert a Python integer to a C :c:expr:`long int`." +msgstr "" + +msgid "``k`` (:class:`int`) [unsigned long]" +msgstr "``k`` (:class:`int`) [беззнаковий довгий]" + +msgid "" +"Convert a Python integer to a C :c:expr:`unsigned long` without overflow " +"checking." +msgstr "" + +msgid "``L`` (:class:`int`) [long long]" +msgstr "``L`` (:class:`int`) [довгий довгий]" + +msgid "Convert a Python integer to a C :c:expr:`long long`." +msgstr "" + +msgid "``K`` (:class:`int`) [unsigned long long]" +msgstr "``K`` (:class:`int`) [беззнаковий довгий довгий]" + +msgid "" +"Convert a Python integer to a C :c:expr:`unsigned long long` without " +"overflow checking." +msgstr "" + +msgid "``n`` (:class:`int`) [:c:type:`Py_ssize_t`]" +msgstr "``n`` (:class:`int`) [:c:type:`Py_ssize_t`]" + +msgid "Convert a Python integer to a C :c:type:`Py_ssize_t`." +msgstr "Перетворіть ціле число Python на C :c:type:`Py_ssize_t`." + +msgid "``c`` (:class:`bytes` or :class:`bytearray` of length 1) [char]" +msgstr "``c`` (:class:`bytes` або :class:`bytearray` довжиною 1) [char]" + +msgid "" +"Convert a Python byte, represented as a :class:`bytes` or :class:`bytearray` " +"object of length 1, to a C :c:expr:`char`." +msgstr "" + +msgid "Allow :class:`bytearray` objects." +msgstr "Дозволити об’єкти :class:`bytearray`." + +msgid "``C`` (:class:`str` of length 1) [int]" +msgstr "``C`` (:class:`str` довжини 1) [int]" + +msgid "" +"Convert a Python character, represented as a :class:`str` object of length " +"1, to a C :c:expr:`int`." +msgstr "" + +msgid "``f`` (:class:`float`) [float]" +msgstr "``f`` (:class:`float`) [float]" + +msgid "Convert a Python floating-point number to a C :c:expr:`float`." +msgstr "" + +msgid "``d`` (:class:`float`) [double]" +msgstr "``d`` (:class:`float`) [double]" + +msgid "Convert a Python floating-point number to a C :c:expr:`double`." +msgstr "" + +msgid "``D`` (:class:`complex`) [Py_complex]" +msgstr "``D`` (:class:`complex`) [Py_complex]" + +msgid "Convert a Python complex number to a C :c:type:`Py_complex` structure." +msgstr "" +"Перетворіть комплексне число Python на структуру C :c:type:`Py_complex`." + +msgid "Other objects" +msgstr "Інші об'єкти" + +msgid "``O`` (object) [PyObject \\*]" +msgstr "``O`` (об'єкт) [PyObject \\*]" + +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``." +msgstr "" + +msgid "``O!`` (object) [*typeobject*, PyObject \\*]" +msgstr "``O!`` (об'єкт) [*typeobject*, PyObject \\*]" + +msgid "" +"Store a Python object in a C object pointer. This is similar to ``O``, but " +"takes two C arguments: the first is the address of a Python type object, the " +"second is the address of the C variable (of type :c:expr:`PyObject*`) into " +"which the object pointer is stored. If the Python object does not have the " +"required type, :exc:`TypeError` is raised." +msgstr "" + +msgid "``O&`` (object) [*converter*, *address*]" +msgstr "" + +msgid "" +"Convert a Python object to a C variable through a *converter* function. " +"This takes two arguments: the first is a function, the second is the address " +"of a C variable (of arbitrary type), converted to :c:expr:`void *`. The " +"*converter* function in turn is called as follows::" +msgstr "" + +msgid "status = converter(object, address);" +msgstr "" + +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 "" + +msgid "" +"If the *converter* returns :c:macro:`!Py_CLEANUP_SUPPORTED`, it may get " +"called a second time if the argument parsing eventually fails, giving the " +"converter a chance to release any memory that it had already allocated. In " +"this second call, the *object* parameter will be ``NULL``; *address* will " +"have the same value as in the original call." +msgstr "" + +msgid "" +"Examples of converters: :c:func:`PyUnicode_FSConverter` and :c:func:" +"`PyUnicode_FSDecoder`." +msgstr "" + +msgid ":c:macro:`!Py_CLEANUP_SUPPORTED` was added." +msgstr "" + +msgid "``p`` (:class:`bool`) [int]" +msgstr "``p`` (:class:`bool`) [int]" + +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 " +"int to ``1`` if the expression was true and ``0`` if it was false. This " +"accepts any valid Python value. See :ref:`truth` for more information about " +"how Python tests values for truth." +msgstr "" +"Перевіряє передане значення на істинність (логічне значення **p**\\ повторне " +"визначення) і перетворює результат на еквівалентне ціле значення C true/" +"false. Встановлює int на ``1``, якщо вираз був істинним, і ``0``, якщо він " +"був false. Це приймає будь-яке дійсне значення Python. Перегляньте :ref:" +"`truth` для отримання додаткової інформації про те, як Python перевіряє " +"значення на істинність." + +msgid "``(items)`` (:class:`tuple`) [*matching-items*]" +msgstr "``(items)`` (:class:`tuple`) [*matching-items*]" + +msgid "" +"The object must be a Python sequence whose length is the number of format " +"units in *items*. The C arguments must correspond to the individual format " +"units in *items*. Format units for sequences may be nested." +msgstr "" +"Об’єкт має бути послідовністю Python, довжина якої дорівнює кількості " +"одиниць формату в *елементах*. Аргументи C мають відповідати окремим " +"одиницям формату в *items*. Одиниці формату для послідовностей можуть бути " +"вкладеними." + +msgid "" +"A few other characters have a meaning in a format string. These may not " +"occur inside nested parentheses. They are:" +msgstr "" +"Кілька інших символів мають значення в рядку формату. Вони можуть не " +"знаходитися всередині вкладених дужок. Вони є:" + +msgid "``|``" +msgstr "``|``" + +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)." +msgstr "" +"Вказує, що решта аргументів у списку аргументів Python необов’язкові. Змінні " +"C, які відповідають необов’язковим аргументам, мають бути ініціалізовані " +"значенням за замовчуванням --- коли необов’язковий аргумент не вказано, :c:" +"func:`PyArg_ParseTuple` не торкається вмісту відповідних змінних C." + +msgid "``$``" +msgstr "``$``" + +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` only: вказує, що решта аргументів у " +"списку аргументів Python є лише ключовими словами. Наразі всі аргументи лише " +"для ключових слів також мають бути необов’язковими, тому ``|`` завжди " +"потрібно вказувати перед ``$`` у рядку формату." + +msgid "``:``" +msgstr "``:``" + +msgid "" +"The list of format units ends here; the string after the colon is used as " +"the function name in error messages (the \"associated value\" of the " +"exception that :c:func:`PyArg_ParseTuple` raises)." +msgstr "" +"Тут список одиниць формату закінчується; рядок після двокрапки " +"використовується як ім’я функції в повідомленнях про помилки (\"пов’язане " +"значення\" винятку, яке викликає :c:func:`PyArg_ParseTuple`)." + +msgid "``;``" +msgstr "``;``" + +msgid "" +"The list of format units ends here; the string after the semicolon is used " +"as the error message *instead* of the default error message. ``:`` and ``;" +"`` mutually exclude each other." +msgstr "" +"Тут список одиниць формату закінчується; рядок після крапки з комою " +"використовується як повідомлення про помилку *замість* повідомлення про " +"помилку за замовчуванням. ``:`` і ``;`` взаємно виключають один одного." + +msgid "" +"Note that any Python object references which are provided to the caller are " +"*borrowed* references; do not release them (i.e. do not decrement their " +"reference count)!" +msgstr "" + +msgid "" +"Additional arguments passed to these functions must be addresses of " +"variables whose type is determined by the format string; these are used to " +"store values from the input tuple. There are a few cases, as described in " +"the list of format units above, where these parameters are used as input " +"values; they should match what is specified for the corresponding format " +"unit in that case." +msgstr "" +"Додатковими аргументами, що передаються цим функціям, повинні бути адреси " +"змінних, тип яких визначається рядком формату; вони використовуються для " +"зберігання значень із вхідного кортежу. Є кілька випадків, як описано у " +"списку одиниць формату вище, де ці параметри використовуються як вхідні " +"значення; вони повинні відповідати тому, що вказано для відповідної одиниці " +"формату в цьому випадку." + +msgid "" +"For the conversion to succeed, the *arg* object must match the format and " +"the format must be exhausted. On success, the ``PyArg_Parse*`` functions " +"return true, otherwise they return false and raise an appropriate exception. " +"When the ``PyArg_Parse*`` functions fail due to conversion failure in one of " +"the format units, the variables at the addresses corresponding to that and " +"the following format units are left untouched." +msgstr "" + +msgid "API Functions" +msgstr "Функції API" + +msgid "" +"Parse the parameters of a function that takes only positional parameters " +"into local variables. Returns true on success; on failure, it returns false " +"and raises the appropriate exception." +msgstr "" +"Проаналізуйте параметри функції, яка приймає лише позиційні параметри в " +"локальні змінні. Повертає true в разі успіху; у разі невдачі повертає false " +"і викликає відповідний виняток." + +msgid "" +"Identical to :c:func:`PyArg_ParseTuple`, except that it accepts a va_list " +"rather than a variable number of arguments." +msgstr "" +"Ідентичний :c:func:`PyArg_ParseTuple`, за винятком того, що він приймає " +"va_list, а не змінну кількість аргументів." + +msgid "" +"Parse the parameters of a function that takes both positional and keyword " +"parameters into local variables. The *keywords* argument is a ``NULL``-" +"terminated array of keyword parameter names specified as null-terminated " +"ASCII or UTF-8 encoded C strings. Empty names denote :ref:`positional-only " +"parameters `. Returns true on success; on " +"failure, it returns false and raises the appropriate exception." +msgstr "" + +msgid "" +"The *keywords* parameter declaration is :c:expr:`char * const *` in C and :c:" +"expr:`const char * const *` in C++. This can be overridden with the :c:macro:" +"`PY_CXX_CONST` macro." +msgstr "" + +msgid "" +"Added support for :ref:`positional-only parameters `." +msgstr "" +"Додано підтримку :ref:`позиційних параметрів `." + +msgid "" +"The *keywords* parameter has now type :c:expr:`char * const *` in C and :c:" +"expr:`const char * const *` in C++, instead of :c:expr:`char **`. Added " +"support for non-ASCII keyword parameter names." +msgstr "" + +msgid "" +"Identical to :c:func:`PyArg_ParseTupleAndKeywords`, except that it accepts a " +"va_list rather than a variable number of arguments." +msgstr "" +"Ідентичний :c:func:`PyArg_ParseTupleAndKeywords`, за винятком того, що він " +"приймає va_list, а не змінну кількість аргументів." + +msgid "" +"Ensure that the keys in the keywords argument dictionary are strings. This " +"is only needed if :c:func:`PyArg_ParseTupleAndKeywords` is not used, since " +"the latter already does this check." +msgstr "" +"Переконайтеся, що ключі в словнику аргументів ключових слів є рядками. Це " +"потрібно, лише якщо :c:func:`PyArg_ParseTupleAndKeywords` не " +"використовується, оскільки останній вже виконує цю перевірку." + +msgid "" +"Parse the parameter of a function that takes a single positional parameter " +"into a local variable. Returns true on success; on failure, it returns " +"false and raises the appropriate exception." +msgstr "" + +msgid "Example::" +msgstr "Приклад::" + +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 "" + +msgid "" +"A simpler form of parameter retrieval which does not use a format string to " +"specify the types of the arguments. Functions which use this method to " +"retrieve their parameters should be declared as :c:macro:`METH_VARARGS` in " +"function or method tables. The tuple containing the actual parameters " +"should be passed as *args*; it must actually be a tuple. The length of the " +"tuple must be at least *min* and no more than *max*; *min* and *max* may be " +"equal. Additional arguments must be passed to the function, each of which " +"should be a pointer to a :c:expr:`PyObject*` variable; these will be filled " +"in with the values from *args*; they will contain :term:`borrowed references " +"`. The variables which correspond to optional parameters " +"not given by *args* will not be filled in; these should be initialized by " +"the caller. This function returns true on success and false if *args* is not " +"a tuple or contains the wrong number of elements; an exception will be set " +"if there was a failure." +msgstr "" + +msgid "" +"This is an example of the use of this function, taken from the sources for " +"the :mod:`!_weakref` helper module for weak references::" +msgstr "" + +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 "" + +msgid "" +"The call to :c:func:`PyArg_UnpackTuple` in this example is entirely " +"equivalent to this call to :c:func:`PyArg_ParseTuple`::" +msgstr "" +"Виклик :c:func:`PyArg_UnpackTuple` у цьому прикладі повністю еквівалентний " +"виклику :c:func:`PyArg_ParseTuple`::" + +msgid "PyArg_ParseTuple(args, \"O|O:ref\", &object, &callback)" +msgstr "" + +msgid "" +"The value to be inserted, if any, before :c:expr:`char * const *` in the " +"*keywords* parameter declaration of :c:func:`PyArg_ParseTupleAndKeywords` " +"and :c:func:`PyArg_VaParseTupleAndKeywords`. Default empty for C and " +"``const`` for C++ (:c:expr:`const char * const *`). To override, define it " +"to the desired value before including :file:`Python.h`." +msgstr "" + +msgid "Building values" +msgstr "Формування цінностей" + +msgid "" +"Create a new value based on a format string similar to those accepted by the " +"``PyArg_Parse*`` family of functions and a sequence of values. Returns the " +"value or ``NULL`` in the case of an error; an exception will be raised if " +"``NULL`` is returned." +msgstr "" + +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 " +"string is empty, it returns ``None``; if it contains exactly one format " +"unit, it returns whatever object is described by that format unit. To force " +"it to return a tuple of size 0 or one, parenthesize the format string." +msgstr "" +":c:func:`Py_BuildValue` не завжди створює кортеж. Він створює кортеж, лише " +"якщо його рядок формату містить дві або більше одиниць формату. Якщо рядок " +"формату порожній, повертається ``None``; якщо він містить рівно одну одиницю " +"формату, він повертає будь-який об’єкт, описаний цією одиницею формату. Щоб " +"змусити його повертати кортеж розміром 0 або одиницю, візьміть рядок формату " +"в дужки." + +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." +msgstr "" +"Коли буфери пам’яті передаються як параметри для надання даних для створення " +"об’єктів, як і для форматів ``s`` і ``s#``, необхідні дані копіюються. " +"Об’єкти, створені :c:func:`Py_BuildValue`, ніколи не посилаються на буфери, " +"надані абонентом. Іншими словами, якщо ваш код викликає :c:func:`malloc` і " +"передає виділену пам’ять :c:func:`Py_BuildValue`, ваш код відповідальний за " +"виклик :c:func:`free` для цієї пам’яті один раз :c:func:`Py_BuildValue` " +"повертає." + +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 " +"return; and the entry in [square] brackets is the type of the C value(s) to " +"be passed." +msgstr "" +"У наступному описі форма в лапках є одиницею формату; запис у (круглих) " +"дужках — це тип об’єкта Python, який поверне блок формату; і запис у " +"[квадратних] дужках є типом значень C, які потрібно передати." + +msgid "" +"The characters space, tab, colon and comma are ignored in format strings " +"(but not within format units such as ``s#``). This can be used to make long " +"format strings a tad more readable." +msgstr "" +"Символи пробілу, табуляції, двокрапки та коми ігноруються в рядках " +"форматування (але не в одиницях форматування, таких як ``s#``). Це можна " +"використати, щоб зробити рядки довгого формату трохи більш читабельними." + +msgid "``s`` (:class:`str` or ``None``) [const char \\*]" +msgstr "``s`` (:class:`str` або ``None``) [const char \\*]" + +msgid "" +"Convert a null-terminated C string to a Python :class:`str` object using " +"``'utf-8'`` encoding. If the C string pointer is ``NULL``, ``None`` is used." +msgstr "" +"Перетворіть рядок C із нульовим закінченням на об’єкт Python :class:`str` за " +"допомогою кодування ``'utf-8'``. Якщо вказівник на рядок C має значення " +"``NULL``, використовується ``None``." + +msgid "" +"``s#`` (:class:`str` or ``None``) [const char \\*, :c:type:`Py_ssize_t`]" +msgstr "" +"``s#`` (:class:`str` або ``None``) [const char \\*, :c:type:`Py_ssize_t`]" + +msgid "" +"Convert a C string and its length to a Python :class:`str` object using " +"``'utf-8'`` encoding. If the C string pointer is ``NULL``, the length is " +"ignored and ``None`` is returned." +msgstr "" +"Перетворіть рядок C та його довжину на об’єкт Python :class:`str` за " +"допомогою кодування ``'utf-8'``. Якщо покажчик рядка C має значення " +"``NULL``, довжина ігнорується і повертається ``None``." + +msgid "``y`` (:class:`bytes`) [const char \\*]" +msgstr "``y`` (:class:`bytes`) [const char \\*]" + +msgid "" +"This converts a C string to a Python :class:`bytes` object. If the C string " +"pointer is ``NULL``, ``None`` is returned." +msgstr "" +"Це перетворює рядок C на об’єкт Python :class:`bytes`. Якщо вказівник на " +"рядок C має значення ``NULL``, повертається ``None``." + +msgid "``y#`` (:class:`bytes`) [const char \\*, :c:type:`Py_ssize_t`]" +msgstr "``y#`` (:class:`bytes`) [const char \\*, :c:type:`Py_ssize_t`]" + +msgid "" +"This converts a C string and its lengths to a Python object. If the C " +"string pointer is ``NULL``, ``None`` is returned." +msgstr "" +"Це перетворює рядок C та його довжину на об’єкт Python. Якщо вказівник на " +"рядок C має значення ``NULL``, повертається ``None``." + +msgid "Same as ``s``." +msgstr "Те саме, що ``s``." + +msgid "" +"``z#`` (:class:`str` or ``None``) [const char \\*, :c:type:`Py_ssize_t`]" +msgstr "" +"``z#`` (:class:`str` або ``None``) [const char \\*, :c:type:`Py_ssize_t`]" + +msgid "Same as ``s#``." +msgstr "Те саме, що ``s#``." + +msgid "``u`` (:class:`str`) [const wchar_t \\*]" +msgstr "``u`` (:class:`str`) [const wchar_t \\*]" + +msgid "" +"Convert a null-terminated :c:type:`wchar_t` buffer of Unicode (UTF-16 or " +"UCS-4) data to a Python Unicode object. If the Unicode buffer pointer is " +"``NULL``, ``None`` is returned." +msgstr "" +"Перетворіть буфер даних Unicode (UTF-16 або UCS-4) :c:type:`wchar_t` із " +"закінченням нульовим символом на об’єкт Python Unicode. Якщо покажчик буфера " +"Unicode має значення ``NULL``, повертається ``None``." + +msgid "``u#`` (:class:`str`) [const wchar_t \\*, :c:type:`Py_ssize_t`]" +msgstr "``u#`` (:class:`str`) [const wchar_t \\*, :c:type:`Py_ssize_t`]" + +msgid "" +"Convert a Unicode (UTF-16 or UCS-4) data buffer and its length to a Python " +"Unicode object. If the Unicode buffer pointer is ``NULL``, the length is " +"ignored and ``None`` is returned." +msgstr "" +"Перетворіть буфер даних Unicode (UTF-16 або UCS-4) і його довжину на об’єкт " +"Python Unicode. Якщо покажчик буфера Unicode має значення ``NULL``, довжина " +"ігнорується і повертається ``None``." + +msgid "``U`` (:class:`str` or ``None``) [const char \\*]" +msgstr "``U`` (:class:`str` або ``None``) [const char \\*]" + +msgid "" +"``U#`` (:class:`str` or ``None``) [const char \\*, :c:type:`Py_ssize_t`]" +msgstr "" +"``U#`` (:class:`str` або ``None``) [const char \\*, :c:type:`Py_ssize_t`]" + +msgid "Convert a plain C :c:expr:`int` to a Python integer object." +msgstr "" + +msgid "``b`` (:class:`int`) [char]" +msgstr "``b`` (:class:`int`) [символ]" + +msgid "Convert a plain C :c:expr:`char` to a Python integer object." +msgstr "" + +msgid "Convert a plain C :c:expr:`short int` to a Python integer object." +msgstr "" + +msgid "Convert a C :c:expr:`long int` to a Python integer object." +msgstr "" + +msgid "Convert a C :c:expr:`unsigned char` to a Python integer object." +msgstr "" + +msgid "Convert a C :c:expr:`unsigned short int` to a Python integer object." +msgstr "" + +msgid "Convert a C :c:expr:`unsigned int` to a Python integer object." +msgstr "" + +msgid "Convert a C :c:expr:`unsigned long` to a Python integer object." +msgstr "" + +msgid "Convert a C :c:expr:`long long` to a Python integer object." +msgstr "" + +msgid "Convert a C :c:expr:`unsigned long long` to a Python integer object." +msgstr "" + +msgid "Convert a C :c:type:`Py_ssize_t` to a Python integer." +msgstr "Перетворіть C :c:type:`Py_ssize_t` на ціле число Python." + +msgid "``c`` (:class:`bytes` of length 1) [char]" +msgstr "``c`` (:class:`bytes` довжиною 1) [символ]" + +msgid "" +"Convert a C :c:expr:`int` representing a byte to a Python :class:`bytes` " +"object of length 1." +msgstr "" + +msgid "" +"Convert a C :c:expr:`int` representing a character to Python :class:`str` " +"object of length 1." +msgstr "" + +msgid "Convert a C :c:expr:`double` to a Python floating-point number." +msgstr "" + +msgid "Convert a C :c:expr:`float` to a Python floating-point number." +msgstr "" + +msgid "``D`` (:class:`complex`) [Py_complex \\*]" +msgstr "``D`` (:class:`complex`) [Py_complex \\*]" + +msgid "Convert a C :c:type:`Py_complex` structure to a Python complex number." +msgstr "" +"Перетворіть структуру C :c:type:`Py_complex` на комплексне число Python." + +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." +msgstr "" + +msgid "``S`` (object) [PyObject \\*]" +msgstr "``S`` (об'єкт) [PyObject \\*]" + +msgid "Same as ``O``." +msgstr "Те саме, що \"О\"." + +msgid "``N`` (object) [PyObject \\*]" +msgstr "``N`` (об'єкт) [PyObject \\*]" + +msgid "" +"Same as ``O``, except it doesn't create a new :term:`strong reference`. " +"Useful when the object is created by a call to an object constructor in the " +"argument list." +msgstr "" + +msgid "``O&`` (object) [*converter*, *anything*]" +msgstr "``O&`` (об'єкт) [*конвертер*, *що завгодно*]" + +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." +msgstr "" + +msgid "" +"Convert a sequence of C values to a Python tuple with the same number of " +"items." +msgstr "" +"Перетворіть послідовність значень C на кортеж Python із такою ж кількістю " +"елементів." + +msgid "``[items]`` (:class:`list`) [*matching-items*]" +msgstr "``[items]`` (:class:`list`) [*matching-items*]" + +msgid "" +"Convert a sequence of C values to a Python list with the same number of " +"items." +msgstr "" +"Перетворіть послідовність значень C на список Python з такою ж кількістю " +"елементів." + +msgid "``{items}`` (:class:`dict`) [*matching-items*]" +msgstr "``{items}`` (:class:`dict`) [*відповідні-елементи*]" + +msgid "" +"Convert a sequence of C values to a Python dictionary. Each pair of " +"consecutive C values adds one item to the dictionary, serving as key and " +"value, respectively." +msgstr "" +"Перетворіть послідовність значень C у словник Python. Кожна пара послідовних " +"значень C додає один елемент до словника, який виконує функції ключа та " +"значення відповідно." + +msgid "" +"If there is an error in the format string, the :exc:`SystemError` exception " +"is set and ``NULL`` returned." +msgstr "" +"Якщо в рядку формату є помилка, встановлюється виняток :exc:`SystemError` і " +"повертається ``NULL``." + +msgid "" +"Identical to :c:func:`Py_BuildValue`, except that it accepts a va_list " +"rather than a variable number of arguments." +msgstr "" +"Ідентичний :c:func:`Py_BuildValue`, за винятком того, що він приймає " +"va_list, а не змінну кількість аргументів." diff --git a/c-api/bool.po b/c-api/bool.po new file mode 100644 index 000000000..70856ec3c --- /dev/null +++ b/c-api/bool.po @@ -0,0 +1,75 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:47+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Boolean Objects" +msgstr "Логічні об'єкти" + +msgid "" +"Booleans in Python are implemented as a subclass of integers. There are " +"only two booleans, :c:data:`Py_False` and :c:data:`Py_True`. As such, the " +"normal creation and deletion functions don't apply to booleans. The " +"following macros are available, however." +msgstr "" + +msgid "" +"This instance of :c:type:`PyTypeObject` represents the Python boolean type; " +"it is the same object as :class:`bool` in the Python layer." +msgstr "" + +msgid "" +"Return true if *o* is of type :c:data:`PyBool_Type`. This function always " +"succeeds." +msgstr "" +"Повертає true, якщо *o* має тип :c:data:`PyBool_Type`. Ця функція завжди " +"успішна." + +msgid "" +"The Python ``False`` object. This object has no methods and is :term:" +"`immortal`." +msgstr "" + +msgid ":c:data:`Py_False` is :term:`immortal`." +msgstr "" + +msgid "" +"The Python ``True`` object. This object has no methods and is :term:" +"`immortal`." +msgstr "" + +msgid ":c:data:`Py_True` is :term:`immortal`." +msgstr "" + +msgid "Return :c:data:`Py_False` from a function." +msgstr "" + +msgid "Return :c:data:`Py_True` from a function." +msgstr "" + +msgid "" +"Return :c:data:`Py_True` or :c:data:`Py_False`, depending on the truth value " +"of *v*." +msgstr "" diff --git a/c-api/buffer.po b/c-api/buffer.po new file mode 100644 index 000000000..589f6bf1f --- /dev/null +++ b/c-api/buffer.po @@ -0,0 +1,838 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# Vadim Kashirny, 2023 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:47+0000\n" +"Last-Translator: Vadim Kashirny, 2023\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Buffer Protocol" +msgstr "Буферний протокол" + +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." +msgstr "" +"Певні об’єкти, доступні в Python, обертають доступ до базового масиву " +"пам’яті або *буфера*. До таких об’єктів належать вбудовані :class:`bytes` і :" +"class:`bytearray`, а також деякі типи розширень, наприклад :class:`array." +"array`. Бібліотеки сторонніх розробників можуть визначати власні типи для " +"спеціальних цілей, таких як обробка зображень або числовий аналіз." + +msgid "" +"While each of these types have their own semantics, they share the common " +"characteristic of being backed by a possibly large memory buffer. It is " +"then desirable, in some situations, to access that buffer directly and " +"without intermediate copying." +msgstr "" +"У той час як кожен із цих типів має власну семантику, вони поділяють спільну " +"характеристику, що вони підтримуються можливо великим буфером пам’яті. Тоді " +"в деяких ситуаціях бажано отримати доступ до цього буфера безпосередньо й " +"без проміжного копіювання." + +msgid "" +"Python provides such a facility at the C level in the form of the :ref:" +"`buffer protocol `. This protocol has two sides:" +msgstr "" +"Python надає таку можливість на рівні C у формі :ref:`протоколу буфера " +"`. Цей протокол має дві сторони:" + +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`;" +msgstr "" +"на стороні виробника тип може експортувати \"інтерфейс буфера\", який " +"дозволяє об’єктам цього типу надавати інформацію про їхній базовий буфер. " +"Цей інтерфейс описано в розділі :ref:`buffer-structs`;" + +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)." +msgstr "" +"на стороні споживача доступно кілька засобів для отримання вказівника на " +"необроблені базові дані об’єкта (наприклад, параметр методу)." + +msgid "" +"Simple objects such as :class:`bytes` and :class:`bytearray` expose their " +"underlying buffer in byte-oriented form. Other forms are possible; for " +"example, the elements exposed by an :class:`array.array` can be multi-byte " +"values." +msgstr "" +"Прості об’єкти, такі як :class:`bytes` і :class:`bytearray`, надають свій " +"базовий буфер у байт-орієнтованій формі. Можливі інші форми; наприклад, " +"елементи, представлені :class:`array.array`, можуть мати багатобайтові " +"значення." + +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 "" + +msgid "" +"There are two ways for a consumer of the buffer interface to acquire a " +"buffer over a target object:" +msgstr "" +"Споживач інтерфейсу буфера може отримати буфер над цільовим об’єктом двома " +"способами:" + +msgid "call :c:func:`PyObject_GetBuffer` with the right parameters;" +msgstr "викликати :c:func:`PyObject_GetBuffer` з правильними параметрами;" + +msgid "" +"call :c:func:`PyArg_ParseTuple` (or one of its siblings) with one of the " +"``y*``, ``w*`` or ``s*`` :ref:`format codes `." +msgstr "" +"викликати :c:func:`PyArg_ParseTuple` (або один із його братів і сестер) з " +"одним із ``y*``, ``w*`` або ``s*`` :ref:`кодів формату `." + +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 "" +"В обох випадках :c:func:`PyBuffer_Release` потрібно викликати, коли буфер " +"більше не потрібен. Якщо цього не зробити, це може призвести до " +"різноманітних проблем, наприклад до витоку ресурсів." + +msgid "Buffer structure" +msgstr "Буферна структура" + +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 " +"used as a zero-copy slicing mechanism. Using their ability to reference a " +"block of memory, it is possible to expose any data to the Python programmer " +"quite easily. The memory could be a large, constant array in a C extension, " +"it could be a raw block of memory for manipulation before passing to an " +"operating system library, or it could be used to pass around structured data " +"in its native, in-memory format." +msgstr "" +"Буферні структури (або просто \"буфери\") корисні як спосіб надати двійкові " +"дані з іншого об’єкта програмісту Python. Їх також можна використовувати як " +"механізм нарізки без копіювання. Використовуючи їх здатність посилатися на " +"блок пам’яті, можна досить легко надати будь-які дані програмісту Python. " +"Пам’ять може бути великим постійним масивом у розширенні C, це може бути " +"необроблений блок пам’яті для маніпуляцій перед передачею в бібліотеку " +"операційної системи, або її можна використовувати для передачі " +"структурованих даних у їх рідному форматі в пам’яті. ." + +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 " +"them to be created and copied very simply. When a generic wrapper around a " +"buffer is needed, a :ref:`memoryview ` object can be " +"created." +msgstr "" +"На відміну від більшості типів даних, наданих інтерпретатором Python, буфери " +"не є покажчиками :c:type:`PyObject`, а досить простими структурами C. Це " +"дозволяє дуже просто створювати та копіювати їх. Якщо потрібна загальна " +"обгортка навколо буфера, можна створити об’єкт :ref:`memoryview `." + +msgid "" +"For short instructions how to write an exporting object, see :ref:`Buffer " +"Object Structures `. For obtaining a buffer, see :c:func:" +"`PyObject_GetBuffer`." +msgstr "" +"Щоб отримати короткі інструкції щодо написання об’єкта експорту, " +"перегляньте :ref:`Структури об’єктів буфера `. Щоб отримати " +"буфер, перегляньте :c:func:`PyObject_GetBuffer`." + +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 " +"of the exporter. For example, with negative :c:member:`~Py_buffer.strides` " +"the value may point to the end of the memory block." +msgstr "" +"Покажчик на початок логічної структури, описаної полями буфера. Це може бути " +"будь-яке розташування в базовому блоці фізичної пам’яті експортера. " +"Наприклад, з негативним :c:member:`~Py_buffer.strides` значення може " +"вказувати на кінець блоку пам’яті." + +msgid "" +"For :term:`contiguous` arrays, the value points to the beginning of the " +"memory block." +msgstr "" +"Для масивів :term:`contiguous` значення вказує на початок блоку пам’яті." + +msgid "" +"A new reference to the exporting object. The reference is owned by the " +"consumer and automatically released (i.e. reference count decremented) and " +"set to ``NULL`` by :c:func:`PyBuffer_Release`. The field is the equivalent " +"of the return value of any standard C-API function." +msgstr "" + +msgid "" +"As a special case, for *temporary* buffers that are wrapped by :c:func:" +"`PyMemoryView_FromBuffer` or :c:func:`PyBuffer_FillInfo` this field is " +"``NULL``. In general, exporting objects MUST NOT use this scheme." +msgstr "" +"Як окремий випадок, для *тимчасових* буферів, які обернуті :c:func:" +"`PyMemoryView_FromBuffer` або :c:func:`PyBuffer_FillInfo`, це поле має " +"значення ``NULL``. Загалом, експорт об’єктів НЕ ПОВИНЕН використовувати цю " +"схему." + +msgid "" +"``product(shape) * itemsize``. For contiguous arrays, this is the length of " +"the underlying memory block. For non-contiguous arrays, it is the length " +"that the logical structure would have if it were copied to a contiguous " +"representation." +msgstr "" +"``product(shape) * itemsize``. Для безперервних масивів це довжина основного " +"блоку пам’яті. Для несуміжних масивів це довжина, яку мала б логічна " +"структура, якби її було скопійовано до безперервного представлення." + +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`." +msgstr "" +"Доступ до ``((char *)buf)[0] до ((char *)buf)[len-1]`` дійсний, лише якщо " +"буфер було отримано за запитом, який гарантує безперервність. У більшості " +"випадків такий запит буде :c:macro:`PyBUF_SIMPLE` або :c:macro:" +"`PyBUF_WRITABLE`." + +msgid "" +"An indicator of whether the buffer is read-only. This field is controlled by " +"the :c:macro:`PyBUF_WRITABLE` flag." +msgstr "" +"Індикатор того, чи буфер доступний лише для читання. Це поле контролюється " +"прапорцем :c:macro:`PyBUF_WRITABLE`." + +msgid "" +"Item size in bytes of a single element. Same as the value of :func:`struct." +"calcsize` called on non-``NULL`` :c:member:`~Py_buffer.format` values." +msgstr "" +"Розмір елемента в байтах одного елемента. Те саме, що значення :func:`struct." +"calcsize`, викликане для не-``NULL`` значень :c:member:`~Py_buffer.format`." + +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." +msgstr "" +"Важливий виняток: якщо споживач запитує буфер без прапора :c:macro:" +"`PyBUF_FORMAT`, :c:member:`~Py_buffer.format` буде встановлено на ``NULL``, " +"але :c:member:`~Py_buffer.itemsize` все ще має значення для вихідного " +"формату." + +msgid "" +"If :c:member:`~Py_buffer.shape` is present, the equality ``product(shape) * " +"itemsize == len`` still holds and the consumer can use :c:member:`~Py_buffer." +"itemsize` to navigate the buffer." +msgstr "" +"Якщо :c:member:`~Py_buffer.shape` присутній, рівність ``product(shape) * " +"itemsize == len`` все ще виконується, і споживач може використовувати :c:" +"member:`~Py_buffer.itemsize` для навігації буфер." + +msgid "" +"If :c:member:`~Py_buffer.shape` is ``NULL`` as a result of a :c:macro:" +"`PyBUF_SIMPLE` or a :c:macro:`PyBUF_WRITABLE` request, the consumer must " +"disregard :c:member:`~Py_buffer.itemsize` and assume ``itemsize == 1``." +msgstr "" +"Якщо :c:member:`~Py_buffer.shape` має значення ``NULL`` в результаті запиту :" +"c:macro:`PyBUF_SIMPLE` або :c:macro:`PyBUF_WRITABLE`, споживач повинен " +"ігнорувати :c:member:`~Py_buffer.itemsize` і припустимо ``itemsize == 1``." + +msgid "" +"A *NULL* terminated string in :mod:`struct` module style syntax describing " +"the contents of a single item. If this is ``NULL``, ``\"B\"`` (unsigned " +"bytes) is assumed." +msgstr "" + +msgid "This field is controlled by the :c:macro:`PyBUF_FORMAT` flag." +msgstr "Це поле контролюється прапорцем :c:macro:`PyBUF_FORMAT`." + +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`." +msgstr "" + +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`." +msgstr "" +"Масив :c:type:`Py_ssize_t` довжини :c:member:`~Py_buffer.ndim`, що вказує " +"форму пам’яті як n-вимірного масиву. Зауважте, що ``shape[0] * ... * " +"shape[ndim-1] * itemsize`` ПОВИНЕН дорівнювати :c:member:`~Py_buffer.len`." + +msgid "" +"Shape values are restricted to ``shape[n] >= 0``. The case ``shape[n] == 0`` " +"requires special attention. See `complex arrays`_ for further information." +msgstr "" +"Значення форми обмежені ``shape[n] >= 0``. Випадок ``shape[n] == 0`` вимагає " +"особливої уваги. Див. `complex arrays`_ для отримання додаткової інформації." + +msgid "The shape array is read-only for the consumer." +msgstr "Масив форм доступний лише для читання для споживача." + +msgid "" +"An array of :c:type:`Py_ssize_t` of length :c:member:`~Py_buffer.ndim` " +"giving the number of bytes to skip to get to a new element in each dimension." +msgstr "" +"Масив :c:type:`Py_ssize_t` довжини :c:member:`~Py_buffer.ndim`, що вказує " +"кількість байтів, які потрібно пропустити, щоб перейти до нового елемента в " +"кожному вимірі." + +msgid "" +"Stride values can be any integer. For regular arrays, strides are usually " +"positive, but a consumer MUST be able to handle the case ``strides[n] <= " +"0``. See `complex arrays`_ for further information." +msgstr "" +"Величина кроку може бути будь-яким цілим числом. Для звичайних масивів кроки " +"зазвичай позитивні, але споживач ПОВИНЕН вміти впоратися з випадком " +"``ступені[n] <= 0``. Див. `complex arrays`_ для отримання додаткової " +"інформації." + +msgid "The strides array is read-only for the consumer." +msgstr "Масив strides доступний лише для читання для споживача." + +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 " +"pointers and the suboffset value dictates how many bytes to add to each " +"pointer after de-referencing. A suboffset value that is negative indicates " +"that no de-referencing should occur (striding in a contiguous memory block)." +msgstr "" +"Масив :c:type:`Py_ssize_t` довжини :c:member:`~Py_buffer.ndim`. Якщо " +"``suboffsets[n] >= 0``, значення, що зберігаються вздовж n-го виміру, є " +"вказівниками, а значення suboffset визначає, скільки байтів потрібно додати " +"до кожного покажчика після видалення посилань. Від’ємне значення субзміщення " +"вказує на те, що не повинно відбуватися видалення посилань (переміщення в " +"безперервному блоці пам’яті)." + +msgid "" +"If all suboffsets are negative (i.e. no de-referencing is needed), then this " +"field must be ``NULL`` (the default value)." +msgstr "" +"Якщо всі підзміщення є від’ємними (тобто не потрібно знімати посилання), " +"тоді це поле має бути ``NULL`` (значення за замовчуванням)." + +msgid "" +"This type of array representation is used by the Python Imaging Library " +"(PIL). See `complex arrays`_ for further information how to access elements " +"of such an array." +msgstr "" +"Цей тип представлення масиву використовується бібліотекою зображень Python " +"(PIL). Див. `complex arrays`_ для отримання додаткової інформації про доступ " +"до елементів такого масиву." + +msgid "The suboffsets array is read-only for the consumer." +msgstr "Масив suboffsets доступний лише для читання для споживача." + +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 " +"whether or not the shape, strides, and suboffsets arrays must be freed when " +"the buffer is released. The consumer MUST NOT alter this value." +msgstr "" +"Це для внутрішнього використання об’єктом експорту. Наприклад, це може бути " +"перетворено як ціле число експортером і використано для зберігання прапорів " +"про те, чи потрібно звільняти масиви форми, кроків і підзміщень, коли буфер " +"звільняється. Споживач НЕ ПОВИНЕН змінювати це значення." + +msgid "Constants:" +msgstr "" + +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 "" + +msgid "Buffer request types" +msgstr "Типи запитів на буфер" + +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 " +"structure of the memory can vary drastically, the consumer uses the *flags* " +"argument to specify the exact buffer type it can handle." +msgstr "" +"Буфери зазвичай отримують шляхом надсилання запиту на буфер до об’єкта " +"експорту через :c:func:`PyObject_GetBuffer`. Оскільки складність логічної " +"структури пам’яті може різко змінюватися, споживач використовує аргумент " +"*flags*, щоб визначити точний тип буфера, який він може обробляти." + +msgid "" +"All :c:type:`Py_buffer` fields are unambiguously defined by the request type." +msgstr "" + +msgid "request-independent fields" +msgstr "поля, незалежні від запиту" + +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`." +msgstr "" +"На наступні поля не впливають *прапорці*, і їх потрібно завжди заповнювати " +"правильними значеннями: :c:member:`~Py_buffer.obj`, :c:member:`~Py_buffer." +"buf`, :c:member:`~Py_buffer.len`, :c:member:`~Py_buffer.itemsize`, :c:member:" +"`~Py_buffer.ndim`." + +msgid "readonly, format" +msgstr "тільки для читання, формат" + +msgid "" +"Controls the :c:member:`~Py_buffer.readonly` field. If set, the exporter " +"MUST provide a writable buffer or else report failure. Otherwise, the " +"exporter MAY provide either a read-only or writable buffer, but the choice " +"MUST be consistent for all consumers. For example, :c:expr:`PyBUF_SIMPLE | " +"PyBUF_WRITABLE` can be used to request a simple writable buffer." +msgstr "" + +msgid "" +"Controls the :c:member:`~Py_buffer.format` field. If set, this field MUST be " +"filled in correctly. Otherwise, this field MUST be ``NULL``." +msgstr "" +"Керує полем :c:member:`~Py_buffer.format`. Якщо встановлено, це поле ПОВИННО " +"бути заповнене правильно. В іншому випадку це поле ПОВИННО мати значення " +"``NULL``." + +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." +msgstr "" +":c:macro:`PyBUF_WRITABLE` можна приєднати до будь-якого з прапорів у " +"наступному розділі. Оскільки :c:macro:`PyBUF_SIMPLE` визначено як 0, :c:" +"macro:`PyBUF_WRITABLE` можна використовувати як окремий прапор для запиту " +"простого буфера для запису." + +msgid "" +":c:macro:`PyBUF_FORMAT` must be \\|'d to any of the flags except :c:macro:" +"`PyBUF_SIMPLE`, because the latter already implies format ``B`` (unsigned " +"bytes). :c:macro:`!PyBUF_FORMAT` cannot be used on its own." +msgstr "" + +msgid "shape, strides, suboffsets" +msgstr "форма, кроки, підзміщення" + +msgid "" +"The flags that control the logical structure of the memory are listed in " +"decreasing order of complexity. Note that each flag contains all bits of the " +"flags below it." +msgstr "" +"Прапори, які керують логічною структурою пам'яті, перераховані в порядку " +"зменшення складності. Зауважте, що кожен прапор містить усі біти прапорів " +"під ним." + +msgid "Request" +msgstr "запит" + +msgid "shape" +msgstr "форму" + +msgid "strides" +msgstr "кроками" + +msgid "suboffsets" +msgstr "підзміщення" + +msgid "yes" +msgstr "так" + +msgid "if needed" +msgstr "при необхідності" + +msgid "NULL" +msgstr "НУЛЬ" + +msgid "contiguity requests" +msgstr "запити суміжності" + +msgid "" +"C or Fortran :term:`contiguity ` can be explicitly requested, " +"with and without stride information. Without stride information, the buffer " +"must be C-contiguous." +msgstr "" +"C або Fortran :term:`contiguity ` можна запитати явно, з " +"інформацією про крок або без неї. Без інформації про кроки буфер має бути C-" +"суміжним." + +msgid "contig" +msgstr "контиг" + +msgid "C" +msgstr "C" + +msgid "F" +msgstr "Ф" + +msgid "C or F" +msgstr "C або F" + +msgid ":c:macro:`PyBUF_ND`" +msgstr ":c:macro:`PyBUF_ND`" + +msgid "compound requests" +msgstr "складені запити" + +msgid "" +"All possible requests are fully defined by some combination of the flags in " +"the previous section. For convenience, the buffer protocol provides " +"frequently used combinations as single flags." +msgstr "" +"Усі можливі запити повністю визначені деякою комбінацією прапорів у " +"попередньому розділі. Для зручності протокол буфера надає часто " +"використовувані комбінації як окремі прапорці." + +msgid "" +"In the following table *U* stands for undefined contiguity. The consumer " +"would have to call :c:func:`PyBuffer_IsContiguous` to determine contiguity." +msgstr "" +"У наступній таблиці *U* означає невизначену суміжність. Споживач мав би " +"викликати :c:func:`PyBuffer_IsContiguous`, щоб визначити суміжність." + +msgid "readonly" +msgstr "лише для читання" + +msgid "format" +msgstr "формат" + +msgid "U" +msgstr "U" + +msgid "0" +msgstr "0" + +msgid "1 or 0" +msgstr "1 або 0" + +msgid "Complex arrays" +msgstr "Складні масиви" + +msgid "NumPy-style: shape and strides" +msgstr "NumPy-стиль: форма та кроки" + +msgid "" +"The logical structure of NumPy-style arrays is defined by :c:member:" +"`~Py_buffer.itemsize`, :c:member:`~Py_buffer.ndim`, :c:member:`~Py_buffer." +"shape` and :c:member:`~Py_buffer.strides`." +msgstr "" +"Логічна структура масивів у стилі NumPy визначається :c:member:`~Py_buffer." +"itemsize`, :c:member:`~Py_buffer.ndim`, :c:member:`~Py_buffer.shape` і :c:" +"member:`~Py_buffer.strides`." + +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``." +msgstr "" +"Якщо ``ndim == 0``, розташування пам'яті, на яке вказує :c:member:" +"`~Py_buffer.buf`, інтерпретується як скаляр розміру :c:member:`~Py_buffer." +"itemsize`. У цьому випадку і :c:member:`~Py_buffer.shape`, і :c:member:" +"`~Py_buffer.strides` мають значення ``NULL``." + +msgid "" +"If :c:member:`~Py_buffer.strides` is ``NULL``, the array is interpreted as a " +"standard n-dimensional C-array. Otherwise, the consumer must access an n-" +"dimensional array as follows:" +msgstr "" +"Якщо :c:member:`~Py_buffer.strides` має значення ``NULL``, масив " +"інтерпретується як стандартний n-вимірний C-масив. В іншому випадку споживач " +"повинен отримати доступ до n-вимірного масиву наступним чином:" + +msgid "" +"ptr = (char *)buf + indices[0] * strides[0] + ... + indices[n-1] * " +"strides[n-1];\n" +"item = *((typeof(item) *)ptr);" +msgstr "" + +msgid "" +"As noted above, :c:member:`~Py_buffer.buf` can point to any location within " +"the actual memory block. An exporter can check the validity of a buffer with " +"this function:" +msgstr "" +"Як зазначалося вище, :c:member:`~Py_buffer.buf` може вказувати на будь-яке " +"місце в межах фактичного блоку пам’яті. Експортер може перевірити дійсність " +"буфера за допомогою цієї функції:" + +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 "" + +msgid "PIL-style: shape, strides and suboffsets" +msgstr "PIL-стиль: форма, кроки та підзміщення" + +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 " +"example, the regular three-dimensional C-array ``char v[2][2][3]`` can also " +"be viewed as an array of 2 pointers to 2 two-dimensional arrays: ``char " +"(*v[2])[2][3]``. In suboffsets representation, those two pointers can be " +"embedded at the start of :c:member:`~Py_buffer.buf`, pointing to two ``char " +"x[2][3]`` arrays that can be located anywhere in memory." +msgstr "" +"Окрім звичайних елементів, масиви у стилі PIL можуть містити вказівники, за " +"якими потрібно слідувати, щоб перейти до наступного елемента у вимірі. " +"Наприклад, звичайний тривимірний C-масив ``char v[2][2][3]`` також можна " +"розглядати як масив із 2 покажчиків на 2 двовимірні масиви: ``char (*v[ 2])" +"[2][3]``. У представленні субзсувів ці два вказівники можуть бути вбудовані " +"на початку :c:member:`~Py_buffer.buf`, вказуючи на два масиви ``char x[2]" +"[3]``, які можуть бути розташовані будь-де в пам’яті." + +msgid "" +"Here is a function that returns a pointer to the element in an N-D array " +"pointed to by an N-dimensional index when there are both non-``NULL`` " +"strides and suboffsets::" +msgstr "" +"Ось функція, яка повертає вказівник на елемент у N-D масиві, на який вказує " +"N-вимірний індекс, коли є як кроки, так і підзміщення, відмінні від " +"``NULL``::" + +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 "" + +msgid "Buffer-related functions" +msgstr "Функції, пов'язані з буфером" + +msgid "" +"Return ``1`` if *obj* supports the buffer interface otherwise ``0``. When " +"``1`` is returned, it doesn't guarantee that :c:func:`PyObject_GetBuffer` " +"will succeed. This function always succeeds." +msgstr "" +"Повертає ``1``, якщо *obj* підтримує інтерфейс буфера, інакше ``0``. Коли " +"повертається ``1``, це не гарантує, що :c:func:`PyObject_GetBuffer` буде " +"успішним. Ця функція завжди успішна." + +msgid "" +"Send a request to *exporter* to fill in *view* as specified by *flags*. If " +"the exporter cannot provide a buffer of the exact type, it MUST raise :exc:" +"`BufferError`, set ``view->obj`` to ``NULL`` and return ``-1``." +msgstr "" + +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 " +"redirect requests to a single object, ``view->obj`` MAY refer to this object " +"instead of *exporter* (See :ref:`Buffer Object Structures `)." +msgstr "" +"У разі успіху заповніть *view*, встановіть ``view->obj`` на нове посилання " +"на *exporter* і поверніть 0. У випадку зв’язаних постачальників буферів, які " +"перенаправляють запити до одного об’єкта, ``view-> obj`` МОЖЕ посилатися на " +"цей об’єкт замість *exporter* (Див. :ref:`Структури об’єктів буфера `)." + +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." +msgstr "" +"Успішні виклики :c:func:`PyObject_GetBuffer` повинні бути поєднані з " +"викликами :c:func:`PyBuffer_Release`, подібно до :c:func:`malloc` і :c:func:" +"`free`. Таким чином, після того, як споживач завершить роботу з буфером, :c:" +"func:`PyBuffer_Release` потрібно викликати рівно один раз." + +msgid "" +"Release the buffer *view* and release the :term:`strong reference` (i.e. " +"decrement the reference count) to the view's supporting object, ``view-" +">obj``. This function MUST be called when the buffer is no longer being " +"used, otherwise reference leaks may occur." +msgstr "" + +msgid "" +"It is an error to call this function on a buffer that was not obtained via :" +"c:func:`PyObject_GetBuffer`." +msgstr "" +"Виклик цієї функції в буфері, який не було отримано через :c:func:" +"`PyObject_GetBuffer`, є помилкою." + +msgid "" +"Return the implied :c:member:`~Py_buffer.itemsize` from :c:member:" +"`~Py_buffer.format`. On error, raise an exception and return -1." +msgstr "" + +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 " +"one (*order* is ``'A'``). Return ``0`` otherwise. This function always " +"succeeds." +msgstr "" +"Повертає ``1``, якщо пам’ять, визначена *view*, є стилем C (*order* це " +"``'C''``) або стилем Fortran (*order* це ``'F'``) :term:`contiguous` або " +"один (*порядок* це ``'A'``). Інакше поверніть ``0``. Ця функція завжди " +"успішна." + +msgid "" +"Get the memory area pointed to by the *indices* inside the given *view*. " +"*indices* must point to an array of ``view->ndim`` indices." +msgstr "" +"Отримайте область пам’яті, на яку вказують *індекси* в даному *виді*. " +"*індекси* повинні вказувати на масив індексів ``view->ndim``." + +msgid "" +"Copy contiguous *len* bytes from *buf* to *view*. *fort* can be ``'C'`` or " +"``'F'`` (for C-style or Fortran-style ordering). ``0`` is returned on " +"success, ``-1`` on error." +msgstr "" +"Скопіюйте послідовні *len* байти з *buf* у *view*. *fort* може бути ``'C'`` " +"або ``'F'`` (для впорядкування у стилі C або Fortran). ``0`` повертається в " +"разі успіху, ``-1`` у разі помилки." + +msgid "" +"Copy *len* bytes from *src* to its contiguous representation in *buf*. " +"*order* can be ``'C'`` or ``'F'`` or ``'A'`` (for C-style or Fortran-style " +"ordering or either one). ``0`` is returned on success, ``-1`` on error." +msgstr "" +"Скопіюйте *len* байти з *src* до його безперервного представлення в *buf*. " +"*order* може бути ``'C'`` або ``'F'`` або ``'A'`` (для впорядкування в стилі " +"C або Fortran або будь-якого з них). ``0`` повертається в разі успіху, " +"``-1`` у разі помилки." + +msgid "This function fails if *len* != *src->len*." +msgstr "Ця функція не працює, якщо *len* != *src->len*." + +msgid "" +"Copy data from *src* to *dest* buffer. Can convert between C-style and or " +"Fortran-style buffers." +msgstr "" + +msgid "``0`` is returned on success, ``-1`` on error." +msgstr "" + +msgid "" +"Fill the *strides* array with byte-strides of a :term:`contiguous` (C-style " +"if *order* is ``'C'`` or Fortran-style if *order* is ``'F'``) array of the " +"given shape with the given number of bytes per element." +msgstr "" +"Заповніть масив *strides* байтовими кроками :term:`contiguous` (у стилі C, " +"якщо *order* має значення ``'C'``, або у стилі Fortran, якщо *order* має " +"значення ``'F'`` ) масив заданої форми із заданою кількістю байтів на " +"елемент." + +msgid "" +"Handle buffer requests for an exporter that wants to expose *buf* of size " +"*len* with writability set according to *readonly*. *buf* is interpreted as " +"a sequence of unsigned bytes." +msgstr "" +"Обробляти запити буфера для експортера, який хоче відкрити *buf* розміру " +"*len* із можливістю запису, встановленою відповідно до *readonly*. *buf* " +"інтерпретується як послідовність байтів без знаку." + +msgid "" +"The *flags* argument indicates the request type. This function always fills " +"in *view* as specified by flags, unless *buf* has been designated as read-" +"only and :c:macro:`PyBUF_WRITABLE` is set in *flags*." +msgstr "" +"Аргумент *flags* вказує на тип запиту. Ця функція завжди заповнює *view*, як " +"зазначено прапорцями, якщо *buf* не призначено лише для читання і :c:macro:" +"`PyBUF_WRITABLE` встановлено у *flags*." + +msgid "" +"On success, set ``view->obj`` to a new reference to *exporter* and return 0. " +"Otherwise, raise :exc:`BufferError`, set ``view->obj`` to ``NULL`` and " +"return ``-1``;" +msgstr "" + +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 " +"unmodified. Otherwise, *exporter* MUST be ``NULL``." +msgstr "" +"Якщо ця функція використовується як частина :ref:`getbufferproc `, *exporter* ПОВИНЕН бути встановлений на об’єкт експорту, а " +"*flags* мають бути передані без змін. В іншому випадку *exporter* ПОВИНЕН " +"бути ``NULL``." + +msgid "buffer protocol" +msgstr "" + +msgid "buffer interface" +msgstr "" + +msgid "(see buffer protocol)" +msgstr "" + +msgid "buffer object" +msgstr "" + +msgid "PyBufferProcs (C type)" +msgstr "" + +msgid "contiguous" +msgstr "суміжний" + +msgid "C-contiguous" +msgstr "" + +msgid "Fortran contiguous" +msgstr "" diff --git a/c-api/bytearray.po b/c-api/bytearray.po new file mode 100644 index 000000000..787b6801d --- /dev/null +++ b/c-api/bytearray.po @@ -0,0 +1,111 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2023 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:47+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2023\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Byte Array Objects" +msgstr "Об’єкти байтового масиву" + +msgid "" +"This subtype of :c:type:`PyObject` represents a Python bytearray object." +msgstr "Цей підтип :c:type:`PyObject` представляє об’єкт Python bytearray." + +msgid "" +"This instance of :c:type:`PyTypeObject` represents the Python bytearray " +"type; it is the same object as :class:`bytearray` in the Python layer." +msgstr "" +"Цей екземпляр :c:type:`PyTypeObject` представляє тип Python bytearray; це " +"той самий об’єкт, що й :class:`bytearray` на рівні Python." + +msgid "Type check macros" +msgstr "Макроси перевірки типу" + +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." +msgstr "" +"Повертає true, якщо об’єкт *o* є об’єктом bytearray або екземпляром підтипу " +"типу bytearray. Ця функція завжди успішна." + +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." +msgstr "" +"Повертає true, якщо об’єкт *o* є об’єктом bytearray, але не екземпляром " +"підтипу типу bytearray. Ця функція завжди успішна." + +msgid "Direct API functions" +msgstr "Прямі функції API" + +msgid "" +"Return a new bytearray object from any object, *o*, that implements the :ref:" +"`buffer protocol `." +msgstr "" +"Повертає новий об’єкт bytearray з будь-якого об’єкта, *o*, який реалізує :" +"ref:`протокол буфера `." + +msgid "On failure, return ``NULL`` with an exception set." +msgstr "" + +msgid "Create a new bytearray object from *string* and its length, *len*." +msgstr "" + +msgid "" +"Concat bytearrays *a* and *b* and return a new bytearray with the result." +msgstr "" +"Об’єднайте масиви байтів *a* і *b* та поверніть новий масив байтів із " +"результатом." + +msgid "Return the size of *bytearray* after checking for a ``NULL`` pointer." +msgstr "Повертає розмір *bytearray* після перевірки вказівника ``NULL``." + +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." +msgstr "" +"Повертає вміст *bytearray* як масив char після перевірки вказівника " +"``NULL``. Повернений масив завжди має додатковий нульовий байт." + +msgid "Resize the internal buffer of *bytearray* to *len*." +msgstr "Змініть розмір внутрішнього буфера *bytearray* на *len*." + +msgid "Macros" +msgstr "Макроси" + +msgid "These macros trade safety for speed and they don't check pointers." +msgstr "" +"Ці макроси замінюють безпеку на швидкість, і вони не перевіряють покажчики." + +msgid "Similar to :c:func:`PyByteArray_AsString`, but without error checking." +msgstr "" + +msgid "Similar to :c:func:`PyByteArray_Size`, but without error checking." +msgstr "" + +msgid "object" +msgstr "об'єкт" + +msgid "bytearray" +msgstr "" diff --git a/c-api/bytes.po b/c-api/bytes.po new file mode 100644 index 000000000..c686f304f --- /dev/null +++ b/c-api/bytes.po @@ -0,0 +1,331 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2023 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:47+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2023\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Bytes Objects" +msgstr "Об'єкти Bytes" + +msgid "" +"These functions raise :exc:`TypeError` when expecting a bytes parameter and " +"called with a non-bytes parameter." +msgstr "" +"Ці функції викликають :exc:`TypeError`, коли очікується параметр bytes і " +"викликаються з параметром, який не є байтом." + +msgid "This subtype of :c:type:`PyObject` represents a Python bytes object." +msgstr "Цей підтип :c:type:`PyObject` представляє об’єкт Python bytes." + +msgid "" +"This instance of :c:type:`PyTypeObject` represents the Python bytes type; it " +"is the same object as :class:`bytes` in the Python layer." +msgstr "" +"Цей екземпляр :c:type:`PyTypeObject` представляє тип Python bytes; це той " +"самий об’єкт, що й :class:`bytes` на рівні Python." + +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." +msgstr "" +"Повертає true, якщо об’єкт *o* є об’єктом bytes або екземпляром підтипу типу " +"bytes. Ця функція завжди успішна." + +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." +msgstr "" +"Повертає true, якщо об’єкт *o* є об’єктом bytes, але не екземпляром підтипу " +"типу bytes. Ця функція завжди успішна." + +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 " +"not be checked." +msgstr "" +"Повертає новий об’єкт bytes із копією рядка *v* як значення в разі успіху та " +"``NULL`` у разі помилки. Параметр *v* не має бути ``NULL``; перевірятися не " +"буде." + +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 " +"of the bytes object are uninitialized." +msgstr "" +"Повертає новий об’єкт bytes із копією рядка *v* як значення та довжиною " +"*len* у разі успіху та ``NULL`` у разі помилки. Якщо *v* має значення " +"``NULL``, вміст об’єкта bytes не ініціалізується." + +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 " +"return a bytes object with the values formatted into it. The variable " +"arguments must be C types and must correspond exactly to the format " +"characters in the *format* string. The following format characters are " +"allowed:" +msgstr "" +"Візьміть рядок *format* у стилі C :c:func:`printf`\\ і змінну кількість " +"аргументів, обчисліть розмір результуючого об’єкта Python bytes і поверніть " +"об’єкт bytes із відформатованими значеннями. Змінні аргументи мають бути " +"типу C і точно відповідати символам формату в рядку *format*. Дозволяються " +"такі символи формату:" + +msgid "Format Characters" +msgstr "Формат символів" + +msgid "Type" +msgstr "Тип" + +msgid "Comment" +msgstr "коментар" + +msgid "``%%``" +msgstr "``%%``" + +msgid "*n/a*" +msgstr "*немає*" + +msgid "The literal % character." +msgstr "Літеральний символ %." + +msgid "``%c``" +msgstr "``%c``" + +msgid "int" +msgstr "внутр" + +msgid "A single byte, represented as a C int." +msgstr "Один байт, представлений як C int." + +msgid "``%d``" +msgstr "``%d``" + +msgid "Equivalent to ``printf(\"%d\")``. [1]_" +msgstr "Еквівалент ``printf(\"%d\")``. [1]_" + +msgid "``%u``" +msgstr "``%u``" + +msgid "unsigned int" +msgstr "unsigned int" + +msgid "Equivalent to ``printf(\"%u\")``. [1]_" +msgstr "Еквівалент ``printf(\"%u\")``. [1]_" + +msgid "``%ld``" +msgstr "" + +msgid "long" +msgstr "довгота" + +msgid "Equivalent to ``printf(\"%ld\")``. [1]_" +msgstr "Еквівалент ``printf(\"%ld\")``. [1]_" + +msgid "``%lu``" +msgstr "" + +msgid "unsigned long" +msgstr "беззнаковий довгий" + +msgid "Equivalent to ``printf(\"%lu\")``. [1]_" +msgstr "Еквівалент ``printf(\"%lu\")``. [1]_" + +msgid "``%zd``" +msgstr "" + +msgid ":c:type:`\\ Py_ssize_t`" +msgstr ":c:type:`\\ Py_ssize_t`" + +msgid "Equivalent to ``printf(\"%zd\")``. [1]_" +msgstr "Еквівалент ``printf(\"%zd\")``. [1]_" + +msgid "``%zu``" +msgstr "" + +msgid "size_t" +msgstr "size_t" + +msgid "Equivalent to ``printf(\"%zu\")``. [1]_" +msgstr "Еквівалент ``printf(\"%zu\")``. [1]_" + +msgid "``%i``" +msgstr "``%i``" + +msgid "Equivalent to ``printf(\"%i\")``. [1]_" +msgstr "Еквівалент ``printf(\"%i\")``. [1]_" + +msgid "``%x``" +msgstr "``%x``" + +msgid "Equivalent to ``printf(\"%x\")``. [1]_" +msgstr "Еквівалент ``printf(\"%x\")``. [1]_" + +msgid "``%s``" +msgstr "``%s``" + +msgid "const char\\*" +msgstr "const char\\*" + +msgid "A null-terminated C character array." +msgstr "Масив символів C із закінченням нулем." + +msgid "``%p``" +msgstr "``%p``" + +msgid "const void\\*" +msgstr "const void\\*" + +msgid "" +"The hex representation of a C pointer. Mostly equivalent to " +"``printf(\"%p\")`` except that it is guaranteed to start with the literal " +"``0x`` regardless of what the platform's ``printf`` yields." +msgstr "" +"Шістнадцяткове представлення покажчика C. Здебільшого еквівалентний " +"``printf(\"%p\")`` за винятком того, що він гарантовано починається з " +"літералу ``0x`` незалежно від того, що дає ``printf`` платформи." + +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." +msgstr "" +"Нерозпізнаний символ формату спричиняє копіювання всієї решти рядка формату " +"в об’єкт результату як є, а будь-які додаткові аргументи відкидаються." + +msgid "" +"For integer specifiers (d, u, ld, lu, zd, zu, i, x): the 0-conversion flag " +"has effect even when a precision is given." +msgstr "" +"Для цілочисельних специфікаторів (d, u, ld, lu, zd, zu, i, x): прапор 0-" +"конверсії діє, навіть якщо задано точність." + +msgid "" +"Identical to :c:func:`PyBytes_FromFormat` except that it takes exactly two " +"arguments." +msgstr "" +"Ідентичний :c:func:`PyBytes_FromFormat` за винятком того, що він приймає " +"рівно два аргументи." + +msgid "" +"Return the bytes representation of object *o* that implements the buffer " +"protocol." +msgstr "" +"Повертає представлення байтів об’єкта *o*, який реалізує протокол буфера." + +msgid "Return the length of the bytes in bytes object *o*." +msgstr "Повертає довжину байтів у байтах об'єкт *o*." + +msgid "Similar to :c:func:`PyBytes_Size`, but without error checking." +msgstr "" + +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`." +msgstr "" +"Повернути вказівник на вміст *o*. Покажчик посилається на внутрішній буфер " +"*o*, який складається з ``len(o) + 1`` байтів. Останній байт у буфері завжди " +"нульовий, незалежно від того, чи є інші нульові байти. Дані не можна " +"змінювати жодним чином, якщо об’єкт не було щойно створено за допомогою " +"``PyBytes_FromStringAndSize(NULL, size)``. Його не можна звільняти. Якщо *o* " +"взагалі не є об’єктом bytes, :c:func:`PyBytes_AsString` повертає ``NULL`` і " +"викликає :exc:`TypeError`." + +msgid "Similar to :c:func:`PyBytes_AsString`, but without error checking." +msgstr "" + +msgid "" +"Return the null-terminated contents of the object *obj* through the output " +"variables *buffer* and *length*. Returns ``0`` on success." +msgstr "" + +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 "" +"Якщо *length* дорівнює ``NULL``, об’єкт bytes може не містити вбудованих " +"нульових байтів; якщо це так, функція повертає ``-1`` і викликає :exc:" +"`ValueError`." + +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 " +"not be modified in any way, unless the object was just created using " +"``PyBytes_FromStringAndSize(NULL, size)``. It must not be deallocated. If " +"*obj* is not a bytes object at all, :c:func:`PyBytes_AsStringAndSize` " +"returns ``-1`` and raises :exc:`TypeError`." +msgstr "" +"Буфер відноситься до внутрішнього буфера *obj*, який містить додатковий " +"нульовий байт у кінці (не враховується в *довжині*). Дані не можна змінювати " +"жодним чином, якщо об’єкт не було щойно створено за допомогою " +"``PyBytes_FromStringAndSize(NULL, size)``. Його не можна звільняти. Якщо " +"*obj* взагалі не є об’єктом bytes, :c:func:`PyBytes_AsStringAndSize` " +"повертає ``-1`` і викликає :exc:`TypeError`." + +msgid "" +"Previously, :exc:`TypeError` was raised when embedded null bytes were " +"encountered in the bytes object." +msgstr "" +"Раніше :exc:`TypeError` виникало, коли в об’єкті bytes зустрічалися " +"вбудовані нульові байти." + +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." +msgstr "" +"Створіть новий об’єкт bytes у *\\*bytes*, що містить вміст *newpart*, " +"доданий до *bytes*; абонент буде володіти новим посиланням. Посилання на " +"старе значення *bytes* буде викрадено. Якщо новий об’єкт неможливо створити, " +"старе посилання на *bytes* все одно буде відкинуто, а значення *\\*bytes* " +"буде встановлено на ``NULL``; буде встановлено відповідний виняток." + +msgid "" +"Create a new bytes object in *\\*bytes* containing the contents of *newpart* " +"appended to *bytes*. This version releases the :term:`strong reference` to " +"*newpart* (i.e. decrements its reference count)." +msgstr "" + +msgid "" +"Resize a bytes object. *newsize* will be the new length of the bytes object. " +"You can think of it as creating a new bytes object and destroying the old " +"one, only more efficiently. Pass the address of an existing bytes object as " +"an lvalue (it may be written into), and the new size desired. On success, " +"*\\*bytes* holds the resized bytes object and ``0`` is returned; the address " +"in *\\*bytes* may differ from its input value. If the reallocation fails, " +"the original bytes object at *\\*bytes* is deallocated, *\\*bytes* is set to " +"``NULL``, :exc:`MemoryError` is set, and ``-1`` is returned." +msgstr "" + +msgid "object" +msgstr "об'єкт" + +msgid "bytes" +msgstr "байтів" diff --git a/c-api/call.po b/c-api/call.po new file mode 100644 index 000000000..95da935b7 --- /dev/null +++ b/c-api/call.po @@ -0,0 +1,573 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:47+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Call Protocol" +msgstr "Протокол виклику" + +msgid "" +"CPython supports two different calling protocols: *tp_call* and vectorcall." +msgstr "CPython підтримує два різні протоколи виклику: *tp_call* і vectorcall." + +msgid "The *tp_call* Protocol" +msgstr "Протокол *tp_call*" + +msgid "" +"Instances of classes that set :c:member:`~PyTypeObject.tp_call` are " +"callable. The signature of the slot is::" +msgstr "" +"Примірники класів, які встановлюють :c:member:`~PyTypeObject.tp_call`, можна " +"викликати. Сигнатура слота:" + +msgid "" +"PyObject *tp_call(PyObject *callable, PyObject *args, PyObject *kwargs);" +msgstr "" + +msgid "" +"A call is made using a tuple for the positional arguments and a dict for the " +"keyword arguments, similarly to ``callable(*args, **kwargs)`` in Python " +"code. *args* must be non-NULL (use an empty tuple if there are no arguments) " +"but *kwargs* may be *NULL* if there are no keyword arguments." +msgstr "" +"Виклик здійснюється за допомогою кортежу для позиційних аргументів і dict " +"для ключових аргументів, подібно до ``callable(*args, **kwargs)`` у коді " +"Python. *args* не має бути NULL (використовуйте порожній кортеж, якщо немає " +"аргументів), але *kwargs* може мати значення *NULL*, якщо немає ключових " +"аргументів." + +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." +msgstr "" +"Ця угода використовується не лише *tp_call*: :c:member:`~PyTypeObject." +"tp_new` і :c:member:`~PyTypeObject.tp_init` також передають аргументи таким " +"чином." + +msgid "" +"To call an object, use :c:func:`PyObject_Call` or another :ref:`call API " +"`." +msgstr "" +"Щоб викликати об’єкт, використовуйте :c:func:`PyObject_Call` або інший :ref:" +"`API виклику `." + +msgid "The Vectorcall Protocol" +msgstr "Протокол Vectorcall" + +msgid "" +"The vectorcall protocol was introduced in :pep:`590` as an additional " +"protocol for making calls more efficient." +msgstr "" +"Протокол vectorcall був представлений у :pep:`590` як додатковий протокол " +"для підвищення ефективності викликів." + +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 "" +"Як правило, CPython віддасть перевагу vectorcall для внутрішніх викликів, " +"якщо виклик підтримує його. Однак це не жорстке правило. Крім того, деякі " +"сторонні розширення використовують безпосередньо *tp_call* (замість " +"використання :c:func:`PyObject_Call`). Таким чином, клас, який підтримує " +"векторний виклик, також повинен реалізовувати :c:member:`~PyTypeObject." +"tp_call`. Крім того, виклик має вести себе однаково незалежно від того, який " +"протокол використовується. Рекомендований спосіб досягти цього — встановити :" +"c:member:`~PyTypeObject.tp_call` на :c:func:`PyVectorcall_Call`. Варто " +"повторити:" + +msgid "" +"A class supporting vectorcall **must** also implement :c:member:" +"`~PyTypeObject.tp_call` with the same semantics." +msgstr "" +"Клас, що підтримує векторний виклик, **повинен** також реалізувати :c:member:" +"`~PyTypeObject.tp_call` з тією самою семантикою." + +msgid "" +"The :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` flag is now removed from a class " +"when the class's :py:meth:`~object.__call__` method is reassigned. (This " +"internally sets :c:member:`~PyTypeObject.tp_call` only, and thus may make it " +"behave differently than the vectorcall function.) In earlier Python " +"versions, vectorcall should only be used with :c:macro:`immutable " +"` or static types." +msgstr "" + +msgid "" +"A class should not implement vectorcall if that would be slower than " +"*tp_call*. For example, if the callee needs to convert the arguments to an " +"args tuple and kwargs dict anyway, then there is no point in implementing " +"vectorcall." +msgstr "" +"Клас не повинен реалізовувати vectorcall, якщо це буде повільніше, ніж " +"*tp_call*. Наприклад, якщо викликаному потрібно перетворити аргументи на " +"кортеж args і kwargs dict у будь-якому випадку, тоді немає сенсу в " +"реалізації vectorcall." + +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:" +msgstr "" + +msgid "*callable* is the object being called." +msgstr "*callable* — об’єкт, який викликається." + +msgid "" +"*args* is a C array consisting of the positional arguments followed by the" +msgstr "" +"*args* — це масив C, що складається з позиційних аргументів, за якими йде" + +msgid "" +"values of the keyword arguments. This can be *NULL* if there are no " +"arguments." +msgstr "" +"значення аргументів ключових слів. Це може бути *NULL*, якщо немає " +"аргументів." + +msgid "*nargsf* is the number of positional arguments plus possibly the" +msgstr "*nargsf* — це кількість позиційних аргументів плюс, можливо," + +msgid "" +":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET` flag. To get the actual number of " +"positional arguments from *nargsf*, use :c:func:`PyVectorcall_NARGS`." +msgstr "" + +msgid "*kwnames* is a tuple containing the names of the keyword arguments;" +msgstr "*kwnames* — це кортеж, що містить імена аргументів ключових слів;" + +msgid "" +"in other words, the keys of the kwargs dict. These names must be strings " +"(instances of ``str`` or a subclass) and they must be unique. If there are " +"no keyword arguments, then *kwnames* can instead be *NULL*." +msgstr "" +"іншими словами, ключі kwargs dict. Ці імена мають бути рядками (примірниками " +"``str`` або підкласом) і вони мають бути унікальними. Якщо аргументів " +"ключового слова немає, замість цього *kwnames* може бути *NULL*." + +msgid "" +"If this flag is set in a vectorcall *nargsf* argument, the callee is allowed " +"to temporarily change ``args[-1]``. In other words, *args* points to " +"argument 1 (not 0) in the allocated vector. The callee must restore the " +"value of ``args[-1]`` before returning." +msgstr "" +"Якщо цей прапор встановлено в аргументі *nargsf* векторного виклику, " +"викликаному дозволено тимчасово змінювати ``args[-1]``. Іншими словами, " +"*args* вказує на аргумент 1 (а не 0) у виділеному векторі. Викликаний має " +"відновити значення ``args[-1]`` перед поверненням." + +msgid "" +"For :c:func:`PyObject_VectorcallMethod`, this flag means instead that " +"``args[0]`` may be changed." +msgstr "" +"Для :c:func:`PyObject_VectorcallMethod` цей прапорець натомість означає, що " +"``args[0]`` можна змінити." + +msgid "" +"Whenever they can do so cheaply (without additional allocation), callers are " +"encouraged to use :c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`. Doing so will " +"allow callables such as bound methods to make their onward calls (which " +"include a prepended *self* argument) very efficiently." +msgstr "" + +msgid "" +"To call an object that implements vectorcall, use a :ref:`call API ` function as with any other callable. :c:func:`PyObject_Vectorcall` " +"will usually be most efficient." +msgstr "" +"Щоб викликати об’єкт, який реалізує vectorcall, скористайтеся :ref:`call API " +"` функцією, як і будь-якою іншою можливістю виклику. :c:func:" +"`PyObject_Vectorcall` зазвичай буде найефективнішим." + +msgid "Recursion Control" +msgstr "Контроль рекурсії" + +msgid "" +"When using *tp_call*, callees do not need to worry about :ref:`recursion " +"`: CPython uses :c:func:`Py_EnterRecursiveCall` and :c:func:" +"`Py_LeaveRecursiveCall` for calls made using *tp_call*." +msgstr "" +"Під час використання *tp_call* абонентам не потрібно турбуватися про :ref:" +"`recursion `: CPython використовує :c:func:" +"`Py_EnterRecursiveCall` і :c:func:`Py_LeaveRecursiveCall` для викликів, " +"здійснених за допомогою *tp_call*." + +msgid "" +"For efficiency, this is not the case for calls done using vectorcall: the " +"callee should use *Py_EnterRecursiveCall* and *Py_LeaveRecursiveCall* if " +"needed." +msgstr "" +"Для ефективності це не стосується викликів, виконаних за допомогою " +"vectorcall: виклик має використовувати *Py_EnterRecursiveCall* і " +"*Py_LeaveRecursiveCall*, якщо це необхідно." + +msgid "Vectorcall Support API" +msgstr "API підтримки Vectorcall" + +msgid "" +"Given a vectorcall *nargsf* argument, return the actual number of arguments. " +"Currently equivalent to::" +msgstr "" +"За наявності аргументу *nargsf* для векторного виклику повертає фактичну " +"кількість аргументів. На даний момент еквівалентно::" + +msgid "(Py_ssize_t)(nargsf & ~PY_VECTORCALL_ARGUMENTS_OFFSET)" +msgstr "" + +msgid "" +"However, the function ``PyVectorcall_NARGS`` should be used to allow for " +"future extensions." +msgstr "" +"Проте, функція ``PyVectorcall_NARGS`` повинна використовуватися, щоб " +"дозволити майбутні розширення." + +msgid "" +"If *op* does not support the vectorcall protocol (either because the type " +"does not or because the specific instance does not), return *NULL*. " +"Otherwise, return the vectorcall function pointer stored in *op*. This " +"function never raises an exception." +msgstr "" +"Якщо *op* не підтримує протокол vectorcall (або тому, що тип не підтримує, " +"або тому, що конкретний екземпляр не підтримує), повертає *NULL*. В іншому " +"випадку поверніть покажчик функції vectorcall, що зберігається в *op*. Ця " +"функція ніколи не викликає винятків." + +msgid "" +"This is mostly useful to check whether or not *op* supports vectorcall, " +"which can be done by checking ``PyVectorcall_Function(op) != NULL``." +msgstr "" +"Це здебільшого корисно, щоб перевірити, чи *op* підтримує векторний виклик, " +"що можна зробити, перевіривши ``PyVectorcall_Function(op) != NULL``." + +msgid "" +"Call *callable*'s :c:type:`vectorcallfunc` with positional and keyword " +"arguments given in a tuple and dict, respectively." +msgstr "" +"Викликати *callable* :c:type:`vectorcallfunc` з позиційними та ключовими " +"аргументами, заданими у кортежі та dict відповідно." + +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``." +msgstr "" + +msgid "Object Calling API" +msgstr "API виклику об’єктів" + +msgid "" +"Various functions are available for calling a Python object. Each converts " +"its arguments to a convention supported by the called object – either " +"*tp_call* or vectorcall. In order to do as little conversion as possible, " +"pick one that best fits the format of data you have available." +msgstr "" +"Для виклику об’єкта Python доступні різні функції. Кожен перетворює свої " +"аргументи на конвенцію, яка підтримується викликаним об’єктом – *tp_call* " +"або vectorcall. Щоб зробити якомога менше перетворення, виберіть той, який " +"найкраще відповідає формату доступних даних." + +msgid "" +"The following table summarizes the available functions; please see " +"individual documentation for details." +msgstr "" +"У наведеній нижче таблиці підсумовано доступні функції; подробиці див. в " +"індивідуальній документації." + +msgid "Function" +msgstr "функція" + +msgid "callable" +msgstr "викликний" + +msgid "args" +msgstr "арг" + +msgid "kwargs" +msgstr "kwargs" + +msgid ":c:func:`PyObject_Call`" +msgstr ":c:func:`PyObject_Call`" + +msgid "``PyObject *``" +msgstr "``PyObject *``" + +msgid "tuple" +msgstr "кортеж" + +msgid "dict/``NULL``" +msgstr "dict/``NULL``" + +msgid ":c:func:`PyObject_CallNoArgs`" +msgstr ":c:func:`PyObject_CallNoArgs`" + +msgid "---" +msgstr "---" + +msgid ":c:func:`PyObject_CallOneArg`" +msgstr ":c:func:`PyObject_CallOneArg`" + +msgid "1 object" +msgstr "1 об'єкт" + +msgid ":c:func:`PyObject_CallObject`" +msgstr ":c:func:`PyObject_CallObject`" + +msgid "tuple/``NULL``" +msgstr "кортеж/``NULL``" + +msgid ":c:func:`PyObject_CallFunction`" +msgstr ":c:func:`PyObject_CallFunction`" + +msgid "format" +msgstr "формат" + +msgid ":c:func:`PyObject_CallMethod`" +msgstr ":c:func:`PyObject_CallMethod`" + +msgid "obj + ``char*``" +msgstr "obj + ``char*``" + +msgid ":c:func:`PyObject_CallFunctionObjArgs`" +msgstr ":c:func:`PyObject_CallFunctionObjArgs`" + +msgid "variadic" +msgstr "варіативний" + +msgid ":c:func:`PyObject_CallMethodObjArgs`" +msgstr ":c:func:`PyObject_CallMethodObjArgs`" + +msgid "obj + name" +msgstr "obj + ім'я" + +msgid ":c:func:`PyObject_CallMethodNoArgs`" +msgstr ":c:func:`PyObject_CallMethodNoArgs`" + +msgid ":c:func:`PyObject_CallMethodOneArg`" +msgstr ":c:func:`PyObject_CallMethodOneArg`" + +msgid ":c:func:`PyObject_Vectorcall`" +msgstr ":c:func:`PyObject_Vectorcall`" + +msgid "vectorcall" +msgstr "векторний виклик" + +msgid ":c:func:`PyObject_VectorcallDict`" +msgstr ":c:func:`PyObject_VectorcallDict`" + +msgid ":c:func:`PyObject_VectorcallMethod`" +msgstr ":c:func:`PyObject_VectorcallMethod`" + +msgid "arg + name" +msgstr "аргумент + ім'я" + +msgid "" +"Call a callable Python object *callable*, with arguments given by the tuple " +"*args*, and named arguments given by the dictionary *kwargs*." +msgstr "" +"Викликайте викликний об’єкт Python *callable* з аргументами, заданими " +"кортежем *args*, і іменованими аргументами, заданими словником *kwargs*." + +msgid "" +"*args* must not be *NULL*; use an empty tuple if no arguments are needed. If " +"no named arguments are needed, *kwargs* can be *NULL*." +msgstr "" +"*args* не має бути *NULL*; використовуйте порожній кортеж, якщо аргументи не " +"потрібні. Якщо іменовані аргументи не потрібні, *kwargs* може бути *NULL*." + +msgid "" +"Return the result of the call on success, or raise an exception and return " +"*NULL* on failure." +msgstr "" +"Повернути результат виклику в разі успіху або створити виняток і повернути " +"*NULL* у разі невдачі." + +msgid "" +"This is the equivalent of the Python expression: ``callable(*args, " +"**kwargs)``." +msgstr "Це еквівалент виразу Python: ``callable(*args, **kwargs)``." + +msgid "" +"Call a callable Python object *callable* without any arguments. It is the " +"most efficient way to call a callable Python object without any argument." +msgstr "" +"Викликати об'єкт Python, який можна викликати, *callable* без аргументів. Це " +"найефективніший спосіб викликати викликаний об’єкт Python без будь-яких " +"аргументів." + +msgid "" +"Call a callable Python object *callable* with exactly 1 positional argument " +"*arg* and no keyword arguments." +msgstr "" +"Викликайте об’єкт Python, який можна викликати, *callable*, точно 1 " +"позиційний аргумент *arg* і без ключових аргументів." + +msgid "" +"Call a callable Python object *callable*, with arguments given by the tuple " +"*args*. If no arguments are needed, then *args* can be *NULL*." +msgstr "" +"Викликайте викликний об’єкт Python *callable* з аргументами, заданими " +"кортежем *args*. Якщо аргументи не потрібні, *args* може бути *NULL*." + +msgid "This is the equivalent of the Python expression: ``callable(*args)``." +msgstr "Це еквівалент виразу Python: ``callable(*args)``." + +msgid "" +"Call a callable Python object *callable*, with a variable number of C " +"arguments. The C arguments are described using a :c:func:`Py_BuildValue` " +"style format string. The format can be *NULL*, indicating that no arguments " +"are provided." +msgstr "" +"Викликайте об'єкт Python, який можна викликати, *callable*, зі змінною " +"кількістю аргументів C. Аргументи C описані за допомогою рядка формату " +"стилю :c:func:`Py_BuildValue`. Формат може бути *NULL*, що вказує на " +"відсутність аргументів." + +msgid "" +"Note that if you only pass :c:expr:`PyObject *` args, :c:func:" +"`PyObject_CallFunctionObjArgs` is a faster alternative." +msgstr "" + +msgid "The type of *format* was changed from ``char *``." +msgstr "Тип *format* було змінено з ``char *``." + +msgid "" +"Call the method named *name* of object *obj* with a variable number of C " +"arguments. The C arguments are described by a :c:func:`Py_BuildValue` " +"format string that should produce a tuple." +msgstr "" +"Викличте метод з назвою *name* об’єкта *obj* зі змінною кількістю аргументів " +"C. Аргументи C описуються рядком формату :c:func:`Py_BuildValue`, який має " +"створити кортеж." + +msgid "The format can be *NULL*, indicating that no arguments are provided." +msgstr "Формат може бути *NULL*, що вказує на відсутність аргументів." + +msgid "" +"This is the equivalent of the Python expression: ``obj.name(arg1, " +"arg2, ...)``." +msgstr "Це еквівалент виразу Python: ``obj.name(arg1, arg2, ...)``." + +msgid "" +"Note that if you only pass :c:expr:`PyObject *` args, :c:func:" +"`PyObject_CallMethodObjArgs` is a faster alternative." +msgstr "" + +msgid "The types of *name* and *format* were changed from ``char *``." +msgstr "Типи *name* і *format* були змінені з ``char *``." + +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*." +msgstr "" + +msgid "" +"This is the equivalent of the Python expression: ``callable(arg1, " +"arg2, ...)``." +msgstr "Це еквівалент виразу Python: ``callable(arg1, arg2, ...)``." + +msgid "" +"Call a method of the Python object *obj*, where the name of the method is " +"given as a Python string object in *name*. It is called with a variable " +"number of :c:expr:`PyObject *` arguments. The arguments are provided as a " +"variable number of parameters followed by *NULL*." +msgstr "" + +msgid "" +"Call a method of the Python object *obj* without arguments, where the name " +"of the method is given as a Python string object in *name*." +msgstr "" +"Виклик методу об’єкта Python *obj* без аргументів, де ім’я методу вказано як " +"рядковий об’єкт Python у *name*." + +msgid "" +"Call a method of the Python object *obj* with a single positional argument " +"*arg*, where the name of the method is given as a Python string object in " +"*name*." +msgstr "" +"Викличте метод об’єкта Python *obj* за допомогою одного позиційного " +"аргументу *arg*, де ім’я методу вказано як рядковий об’єкт Python у *name*." + +msgid "" +"Call a callable Python object *callable*. The arguments are the same as for :" +"c:type:`vectorcallfunc`. If *callable* supports vectorcall_, this directly " +"calls the vectorcall function stored in *callable*." +msgstr "" +"Викликайте викликаний об'єкт Python *callable*. Аргументи такі самі, як і " +"для :c:type:`vectorcallfunc`. Якщо *callable* підтримує vectorcall_, це " +"безпосередньо викликає функцію vectorcall, збережену в *callable*." + +msgid "" +"Call *callable* with positional arguments passed exactly as in the " +"vectorcall_ protocol, but with keyword arguments passed as a dictionary " +"*kwdict*. The *args* array contains only the positional arguments." +msgstr "" +"Виклик *callable* з позиційними аргументами, що передаються точно так само, " +"як у протоколі vectorcall_, але з ключовими аргументами, що передаються як " +"словник *kwdict*. Масив *args* містить лише позиційні аргументи." + +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 " +"already has a dictionary ready to use for the keyword arguments, but not a " +"tuple for the positional arguments." +msgstr "" +"Незалежно від того, який протокол використовується внутрішньо, необхідно " +"виконати перетворення аргументів. Таким чином, цю функцію слід " +"використовувати, лише якщо у абонента вже є словник, готовий до використання " +"для ключових аргументів, але не кортеж для позиційних аргументів." + +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`." +msgstr "" + +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." +msgstr "" + +msgid "Call Support API" +msgstr "API виклику служби підтримки" + +msgid "" +"Determine if the object *o* is callable. Return ``1`` if the object is " +"callable and ``0`` otherwise. This function always succeeds." +msgstr "" +"Визначте, чи можна викликати об’єкт *o*. Повертає ``1``, якщо об’єкт можна " +"викликати, і ``0`` інакше. Ця функція завжди успішна." diff --git a/c-api/capsule.po b/c-api/capsule.po new file mode 100644 index 000000000..163915f0a --- /dev/null +++ b/c-api/capsule.po @@ -0,0 +1,238 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:47+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Capsules" +msgstr "Капсули" + +msgid "" +"Refer to :ref:`using-capsules` for more information on using these objects." +msgstr "" +"Зверніться до :ref:`using-capsules` для отримання додаткової інформації про " +"використання цих об’єктів." + +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*` " +"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 "" + +msgid "The type of a destructor callback for a capsule. Defined as::" +msgstr "Тип зворотного виклику деструктора для капсули. Визначається як::" + +msgid "typedef void (*PyCapsule_Destructor)(PyObject *);" +msgstr "" + +msgid "" +"See :c:func:`PyCapsule_New` for the semantics of PyCapsule_Destructor " +"callbacks." +msgstr "" +"Перегляньте :c:func:`PyCapsule_New` для семантики зворотних викликів " +"PyCapsule_Destructor." + +msgid "" +"Return true if its argument is a :c:type:`PyCapsule`. This function always " +"succeeds." +msgstr "" +"Повертає true, якщо його аргумент :c:type:`PyCapsule`. Ця функція завжди " +"успішна." + +msgid "" +"Create a :c:type:`PyCapsule` encapsulating the *pointer*. The *pointer* " +"argument may not be ``NULL``." +msgstr "" +"Створіть :c:type:`PyCapsule`, що інкапсулює *вказівник*. Аргумент *покажчик* " +"не може бути ``NULL``." + +msgid "On failure, set an exception and return ``NULL``." +msgstr "У разі помилки встановіть виняток і поверніть ``NULL``." + +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 " +"permitted to free it inside the *destructor*.)" +msgstr "" +"Рядок *name* може бути ``NULL`` або вказівником на дійсний рядок C. Якщо " +"значення не NULL, цей рядок має пережити капсулу. (Хоча його можна звільнити " +"всередині *деструктора*.)" + +msgid "" +"If the *destructor* argument is not ``NULL``, it will be called with the " +"capsule as its argument when it is destroyed." +msgstr "" +"Якщо аргумент *destructor* не дорівнює ``NULL``, він буде викликаний з " +"капсулою як аргументом під час її знищення." + +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 " +"modules to import the capsule using :c:func:`PyCapsule_Import`." +msgstr "" +"Якщо ця капсула зберігатиметься як атрибут модуля, *ім’я* слід вказати як " +"``modulename.attributename``. Це дозволить іншим модулям імпортувати капсулу " +"за допомогою :c:func:`PyCapsule_Import`." + +msgid "" +"Retrieve the *pointer* stored in the capsule. On failure, set an exception " +"and return ``NULL``." +msgstr "" +"Отримайте *вказівник*, що зберігається в капсулі. У разі помилки встановіть " +"виняток і поверніть ``NULL``." + +msgid "" +"The *name* parameter must compare exactly to the name stored in the capsule. " +"If the name stored in the capsule is ``NULL``, the *name* passed in must " +"also be ``NULL``. Python uses the C function :c:func:`!strcmp` to compare " +"capsule names." +msgstr "" + +msgid "" +"Return the current destructor stored in the capsule. On failure, set an " +"exception and return ``NULL``." +msgstr "" +"Повертає поточний деструктор, що зберігається в капсулі. У разі помилки " +"встановіть виняток і поверніть ``NULL``." + +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." +msgstr "" +"Для капсули допустимо мати деструктор ``NULL``. Це робить код повернення " +"``NULL`` дещо неоднозначним; використовуйте :c:func:`PyCapsule_IsValid` або :" +"c:func:`PyErr_Occurred` для усунення неоднозначності." + +msgid "" +"Return the current context stored in the capsule. On failure, set an " +"exception and return ``NULL``." +msgstr "" +"Повертає поточний контекст, що зберігається в капсулі. У разі помилки " +"встановіть виняток і поверніть ``NULL``." + +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." +msgstr "" +"Для капсули допустимо мати контекст ``NULL``. Це робить код повернення " +"``NULL`` дещо неоднозначним; використовуйте :c:func:`PyCapsule_IsValid` або :" +"c:func:`PyErr_Occurred` для усунення неоднозначності." + +msgid "" +"Return the current name stored in the capsule. On failure, set an exception " +"and return ``NULL``." +msgstr "" +"Повернути поточну назву, збережену в капсулі. У разі помилки встановіть " +"виняток і поверніть ``NULL``." + +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." +msgstr "" +"Для капсули є законним ім’я ``NULL``. Це робить код повернення ``NULL`` дещо " +"неоднозначним; використовуйте :c:func:`PyCapsule_IsValid` або :c:func:" +"`PyErr_Occurred` для усунення неоднозначності." + +msgid "" +"Import a pointer to a C object from a capsule attribute in a module. The " +"*name* parameter should specify the full name to the attribute, as in " +"``module.attribute``. The *name* stored in the capsule must match this " +"string exactly." +msgstr "" + +msgid "" +"Return the capsule's internal *pointer* on success. On failure, set an " +"exception and return ``NULL``." +msgstr "" +"Поверніть внутрішній *покажчик* капсули в разі успіху. У разі помилки " +"встановіть виняток і поверніть ``NULL``." + +msgid "*no_block* has no effect anymore." +msgstr "" + +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`` " +"pointer stored in it, and its internal name matches the *name* parameter. " +"(See :c:func:`PyCapsule_GetPointer` for information on how capsule names are " +"compared.)" +msgstr "" +"Визначає, чи є *capsule* дійсною капсулою. Дійсна капсула не є ``NULL``, " +"передає :c:func:`PyCapsule_CheckExact`, має збережений вказівник не " +"``NULL``, а її внутрішнє ім’я збігається з параметром *name*. (Див. :c:func:" +"`PyCapsule_GetPointer` для отримання інформації про те, як порівнюються " +"назви капсул.)" + +msgid "" +"In other words, if :c:func:`PyCapsule_IsValid` returns a true value, calls " +"to any of the accessors (any function starting with ``PyCapsule_Get``) are " +"guaranteed to succeed." +msgstr "" + +msgid "" +"Return a nonzero value if the object is valid and matches the name passed " +"in. Return ``0`` otherwise. This function will not fail." +msgstr "" +"Повертає ненульове значення, якщо об’єкт дійсний і відповідає переданому " +"імені. В іншому випадку повертає ``0``. Ця функція не дасть збою." + +msgid "Set the context pointer inside *capsule* to *context*." +msgstr "Встановіть покажчик контексту всередині *capsule* на *context*." + +msgid "" +"Return ``0`` on success. Return nonzero and set an exception on failure." +msgstr "" +"У разі успіху повертає ``0``. Повертає ненульове значення та встановлює " +"виняток у разі помилки." + +msgid "Set the destructor inside *capsule* to *destructor*." +msgstr "Встановіть для деструктора всередині *capsule* значення *destructor*." + +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 " +"``NULL``, no attempt is made to free it." +msgstr "" +"Встановіть назву всередині *capsule* на *name*. Якщо значення не NULL, ім’я " +"має пережити капсулу. Якщо попереднє *ім’я*, збережене в капсулі, не було " +"``NULL``, спроба звільнити його не робиться." + +msgid "" +"Set the void pointer inside *capsule* to *pointer*. The pointer may not be " +"``NULL``." +msgstr "" +"Встановіть вказівник пустоти всередині *capsule* на *pointer*. Покажчик не " +"може бути ``NULL``." + +msgid "object" +msgstr "об'єкт" + +msgid "Capsule" +msgstr "" diff --git a/c-api/cell.po b/c-api/cell.po new file mode 100644 index 000000000..88a664964 --- /dev/null +++ b/c-api/cell.po @@ -0,0 +1,101 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:47+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Cell Objects" +msgstr "Об'єкти клітинки" + +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 " +"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 "" +"Об’єкти \"Cell\" використовуються для реалізації змінних, на які посилаються " +"кілька областей. Для кожної такої змінної створюється об’єкт комірки для " +"зберігання значення; локальні змінні кожного фрейму стека, який посилається " +"на значення, містять посилання на клітинки із зовнішніх областей, які також " +"використовують цю змінну. Коли здійснюється доступ до значення, значення, що " +"міститься в комірці, використовується замість самого об’єкта комірки. Це " +"депосилання об'єкта комірки вимагає підтримки згенерованого байт-коду; вони " +"не знімаються автоматично під час доступу. Об’єкти клітинок навряд чи " +"знадобляться в інших місцях." + +msgid "The C structure used for cell objects." +msgstr "Структура C, яка використовується для об’єктів клітинки." + +msgid "The type object corresponding to cell objects." +msgstr "Об’єкт типу, що відповідає об’єктам комірки." + +msgid "" +"Return true if *ob* is a cell object; *ob* must not be ``NULL``. This " +"function always succeeds." +msgstr "" +"Повертає true, якщо *ob* є об’єктом клітинки; *ob* не має бути ``NULL``. Ця " +"функція завжди успішна." + +msgid "" +"Create and return a new cell object containing the value *ob*. The parameter " +"may be ``NULL``." +msgstr "" +"Створіть і поверніть новий об’єкт клітинки, що містить значення *ob*. " +"Параметр може бути ``NULL``." + +msgid "" +"Return the contents of the cell *cell*, which can be ``NULL``. If *cell* is " +"not a cell object, returns ``NULL`` with an exception set." +msgstr "" + +msgid "" +"Return the contents of the cell *cell*, but without checking that *cell* is " +"non-``NULL`` and a cell object." +msgstr "" +"Повертає вміст комірки *cell*, але без перевірки того, що *cell* не є " +"``NULL`` і є об’єктом комірки." + +msgid "" +"Set the contents of the cell object *cell* to *value*. This releases the " +"reference to any current content of the cell. *value* may be ``NULL``. " +"*cell* must be non-``NULL``." +msgstr "" + +msgid "" +"On success, return ``0``. If *cell* is not a cell object, set an exception " +"and return ``-1``." +msgstr "" + +msgid "" +"Sets the value of the cell object *cell* to *value*. No reference counts " +"are adjusted, and no checks are made for safety; *cell* must be non-``NULL`` " +"and must be a cell object." +msgstr "" +"Встановлює для об’єкта клітинки *cell* значення *value*. Підрахунок посилань " +"не коригується, і перевірки безпеки не проводяться; *cell* не має бути " +"``NULL`` і має бути об’єктом клітинки." diff --git a/c-api/code.po b/c-api/code.po new file mode 100644 index 000000000..8ae0bd8e4 --- /dev/null +++ b/c-api/code.po @@ -0,0 +1,325 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# CrispCrow, 2024 +# Dmytro Kazanzhy, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:48+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Code Objects" +msgstr "Об'єкти коду" + +msgid "" +"Code objects are a low-level detail of the CPython implementation. Each one " +"represents a chunk of executable code that hasn't yet been bound into a " +"function." +msgstr "" +"Об’єкти коду є низькорівневими деталями реалізації CPython. Кожен з них " +"представляє фрагмент виконуваного коду, який ще не прив’язано до функції." + +msgid "" +"The C structure of the objects used to describe code objects. The fields of " +"this type are subject to change at any time." +msgstr "" +"Структура C об’єктів, яка використовується для опису об’єктів коду. Поля " +"цього типу можуть бути змінені в будь-який час." + +msgid "" +"This is an instance of :c:type:`PyTypeObject` representing the Python :ref:" +"`code object `." +msgstr "" + +msgid "" +"Return true if *co* is a :ref:`code object `. This function " +"always succeeds." +msgstr "" + +msgid "" +"Return the number of :term:`free (closure) variables ` in " +"a code object." +msgstr "" + +msgid "" +"Return the position of the first :term:`free (closure) variable ` in a code object." +msgstr "" + +msgid "" +"Renamed from ``PyCode_GetFirstFree`` as part of :ref:`unstable-c-api`. The " +"old name is deprecated, but will remain available until the signature " +"changes again." +msgstr "" + +msgid "" +"Return a new code object. If you need a dummy code object to create a " +"frame, use :c:func:`PyCode_NewEmpty` instead." +msgstr "" + +msgid "" +"Since the definition of the bytecode changes often, calling :c:func:" +"`PyUnstable_Code_New` directly can bind you to a precise Python version." +msgstr "" + +msgid "" +"The many arguments of this function are inter-dependent in complex ways, " +"meaning that subtle changes to values are likely to result in incorrect " +"execution or VM crashes. Use this function only with extreme care." +msgstr "" + +msgid "Added ``qualname`` and ``exceptiontable`` parameters." +msgstr "" + +msgid "" +"Renamed from ``PyCode_New`` as part of :ref:`unstable-c-api`. The old name " +"is deprecated, but will remain available until the signature changes again." +msgstr "" + +msgid "" +"Similar to :c:func:`PyUnstable_Code_New`, but with an extra " +"\"posonlyargcount\" for positional-only arguments. The same caveats that " +"apply to ``PyUnstable_Code_New`` also apply to this function." +msgstr "" + +msgid "as ``PyCode_NewWithPosOnlyArgs``" +msgstr "" + +msgid "Added ``qualname`` and ``exceptiontable`` parameters." +msgstr "" + +msgid "" +"Renamed to ``PyUnstable_Code_NewWithPosOnlyArgs``. The old name is " +"deprecated, but will remain available until the signature changes again." +msgstr "" + +msgid "" +"Return a new empty code object with the specified filename, function name, " +"and first line number. The resulting code object will raise an ``Exception`` " +"if executed." +msgstr "" + +msgid "" +"Return the line number of the instruction that occurs on or before " +"``byte_offset`` and ends after it. If you just need the line number of a " +"frame, use :c:func:`PyFrame_GetLineNumber` instead." +msgstr "" +"Повертає номер рядка інструкції, яка виникає до або перед ``byte_offset`` і " +"закінчується після нього. Якщо вам потрібен лише номер рядка кадру, " +"використовуйте натомість :c:func:`PyFrame_GetLineNumber`." + +msgid "" +"For efficiently iterating over the line numbers in a code object, use :pep:" +"`the API described in PEP 626 <0626#out-of-process-debuggers-and-profilers>`." +msgstr "" + +msgid "" +"Sets the passed ``int`` pointers to the source code line and column numbers " +"for the instruction at ``byte_offset``. Sets the value to ``0`` when " +"information is not available for any particular element." +msgstr "" + +msgid "Returns ``1`` if the function succeeds and 0 otherwise." +msgstr "" + +msgid "" +"Equivalent to the Python code ``getattr(co, 'co_code')``. Returns a strong " +"reference to a :c:type:`PyBytesObject` representing the bytecode in a code " +"object. On error, ``NULL`` is returned and an exception is raised." +msgstr "" + +msgid "" +"This ``PyBytesObject`` may be created on-demand by the interpreter and does " +"not necessarily represent the bytecode actually executed by CPython. The " +"primary use case for this function is debuggers and profilers." +msgstr "" + +msgid "" +"Equivalent to the Python code ``getattr(co, 'co_varnames')``. Returns a new " +"reference to a :c:type:`PyTupleObject` containing the names of the local " +"variables. On error, ``NULL`` is returned and an exception is raised." +msgstr "" + +msgid "" +"Equivalent to the Python code ``getattr(co, 'co_cellvars')``. Returns a new " +"reference to a :c:type:`PyTupleObject` containing the names of the local " +"variables that are referenced by nested functions. On error, ``NULL`` is " +"returned and an exception is raised." +msgstr "" + +msgid "" +"Equivalent to the Python code ``getattr(co, 'co_freevars')``. Returns a new " +"reference to a :c:type:`PyTupleObject` containing the names of the :term:" +"`free (closure) variables `. On error, ``NULL`` is " +"returned and an exception is raised." +msgstr "" + +msgid "" +"Register *callback* as a code object watcher for the current interpreter. " +"Return an ID which may be passed to :c:func:`PyCode_ClearWatcher`. In case " +"of error (e.g. no more watcher IDs available), return ``-1`` and set an " +"exception." +msgstr "" + +msgid "" +"Clear watcher identified by *watcher_id* previously returned from :c:func:" +"`PyCode_AddWatcher` for the current interpreter. Return ``0`` on success, or " +"``-1`` and set an exception on error (e.g. if the given *watcher_id* was " +"never registered.)" +msgstr "" + +msgid "" +"Enumeration of possible code object watcher events: - " +"``PY_CODE_EVENT_CREATE`` - ``PY_CODE_EVENT_DESTROY``" +msgstr "" + +msgid "Type of a code object watcher callback function." +msgstr "" + +msgid "" +"If *event* is ``PY_CODE_EVENT_CREATE``, then the callback is invoked after " +"`co` has been fully initialized. Otherwise, the callback is invoked before " +"the destruction of *co* takes place, so the prior state of *co* can be " +"inspected." +msgstr "" + +msgid "" +"If *event* is ``PY_CODE_EVENT_DESTROY``, taking a reference in the callback " +"to the about-to-be-destroyed code object will resurrect it and prevent it " +"from being freed at this time. When the resurrected object is destroyed " +"later, any watcher callbacks active at that time will be called again." +msgstr "" + +msgid "" +"Users of this API should not rely on internal runtime implementation " +"details. Such details may include, but are not limited to, the exact order " +"and timing of creation and destruction of code objects. While changes in " +"these details may result in differences observable by watchers (including " +"whether a callback is invoked or not), it does not change the semantics of " +"the Python code being executed." +msgstr "" + +msgid "" +"If the callback sets an exception, it must return ``-1``; this exception " +"will be printed as an unraisable exception using :c:func:" +"`PyErr_WriteUnraisable`. Otherwise it should return ``0``." +msgstr "" + +msgid "" +"There may already be a pending exception set on entry to the callback. In " +"this case, the callback should return ``0`` with the same exception still " +"set. This means the callback may not call any other API that can set an " +"exception unless it saves and clears the exception state first, and restores " +"it before returning." +msgstr "" + +msgid "Extra information" +msgstr "" + +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 "" + +msgid "" +"These functions are part of the unstable C API tier: this functionality is a " +"CPython implementation detail, and the API may change without deprecation " +"warnings." +msgstr "" + +msgid "Return a new an opaque index value used to adding data to code objects." +msgstr "" + +msgid "" +"You generally call this function once (per interpreter) and use the result " +"with ``PyCode_GetExtra`` and ``PyCode_SetExtra`` to manipulate data on " +"individual code objects." +msgstr "" + +msgid "" +"If *free* is not ``NULL``: when a code object is deallocated, *free* will be " +"called on non-``NULL`` data stored under the new index. Use :c:func:" +"`Py_DecRef` when storing :c:type:`PyObject`." +msgstr "" + +msgid "as ``_PyEval_RequestCodeExtraIndex``" +msgstr "" + +msgid "" +"Renamed to ``PyUnstable_Eval_RequestCodeExtraIndex``. The old private name " +"is deprecated, but will be available until the API changes." +msgstr "" + +msgid "" +"Set *extra* to the extra data stored under the given index. Return 0 on " +"success. Set an exception and return -1 on failure." +msgstr "" + +msgid "" +"If no data was set under the index, set *extra* to ``NULL`` and return 0 " +"without setting an exception." +msgstr "" + +msgid "as ``_PyCode_GetExtra``" +msgstr "" + +msgid "" +"Renamed to ``PyUnstable_Code_GetExtra``. The old private name is deprecated, " +"but will be available until the API changes." +msgstr "" + +msgid "" +"Set the extra data stored under the given index to *extra*. Return 0 on " +"success. Set an exception and return -1 on failure." +msgstr "" + +msgid "as ``_PyCode_SetExtra``" +msgstr "" + +msgid "" +"Renamed to ``PyUnstable_Code_SetExtra``. The old private name is deprecated, " +"but will be available until the API changes." +msgstr "" + +msgid "object" +msgstr "об'єкт" + +msgid "code" +msgstr "код" + +msgid "code object" +msgstr "об'єкт коду" + +msgid "PyCode_New (C function)" +msgstr "" + +msgid "PyCode_NewWithPosOnlyArgs (C function)" +msgstr "" + +msgid "_PyEval_RequestCodeExtraIndex (C function)" +msgstr "" + +msgid "_PyCode_GetExtra (C function)" +msgstr "" + +msgid "_PyCode_SetExtra (C function)" +msgstr "" diff --git a/c-api/codec.po b/c-api/codec.po new file mode 100644 index 000000000..0e31e0528 --- /dev/null +++ b/c-api/codec.po @@ -0,0 +1,201 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2024 +# Yuliia Shevchenko, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:48+0000\n" +"Last-Translator: Yuliia Shevchenko, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Codec registry and support functions" +msgstr "Реєстр кодеків і функції підтримки" + +msgid "Register a new codec search function." +msgstr "Зареєструйте нову функцію пошуку кодеків." + +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." +msgstr "" +"Як побічний ефект, це намагається завантажити пакет :mod:`!encodings`, якщо " +"він ще не був завантажений, щоб переконатися, що він завжди перший у списку " +"функцій пошуку." + +msgid "" +"Unregister a codec search function and clear the registry's cache. If the " +"search function is not registered, do nothing. Return 0 on success. Raise an " +"exception and return -1 on error." +msgstr "" +"Скасуйте реєстрацію функції пошуку кодеків і очистіть кеш реєстру. Якщо " +"функція пошуку не зареєстрована, нічого не робіть. Повернути 0 у разі " +"успіху. Викликати виняток і повертати -1 у разі помилки." + +msgid "" +"Return ``1`` or ``0`` depending on whether there is a registered codec for " +"the given *encoding*. This function always succeeds." +msgstr "" +"Повертає ``1`` або ``0`` залежно від того, чи існує зареєстрований кодек для " +"даного *кодування*. Ця функція завжди успішна." + +msgid "Generic codec based encoding API." +msgstr "API кодування на основі універсального кодека." + +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." +msgstr "" +"*об’єкт* передається через функцію кодувальника, знайдену для даного " +"*кодування* за допомогою методу обробки помилок, визначеного *errors*. " +"*помилки* можуть бути ``NULL`` для використання методу за замовчуванням, " +"визначеного для кодека. Викликає :exc:`LookupError`, якщо кодувальник не " +"знайдено." + +msgid "Generic codec based decoding API." +msgstr "Загальний API декодування на основі кодеків." + +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." +msgstr "" +"*об’єкт* передається через функцію декодера, знайдену для даного *кодування* " +"за допомогою методу обробки помилок, визначеного *errors*. *помилки* можуть " +"бути ``NULL`` для використання методу за замовчуванням, визначеного для " +"кодека. Викликає :exc:`LookupError`, якщо кодувальник не знайдено." + +msgid "Codec lookup API" +msgstr "API пошуку кодеків" + +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." +msgstr "" +"У наведених нижче функціях рядок *encoding* перетворюється на всі символи " +"нижнього регістру, що робить кодування, які шукаються за допомогою цього " +"механізму, без урахування регістру. Якщо кодек не знайдено, встановлюється :" +"exc:`KeyError` і повертається ``NULL``." + +msgid "Get an encoder function for the given *encoding*." +msgstr "Отримайте функцію кодувальника для заданого *кодування*." + +msgid "Get a decoder function for the given *encoding*." +msgstr "Отримайте функцію декодера для заданого *кодування*." + +msgid "" +"Get an :class:`~codecs.IncrementalEncoder` object for the given *encoding*." +msgstr "" +"Отримайте об’єкт :class:`~codecs.IncrementalEncoder` для вказаного " +"*кодування*." + +msgid "" +"Get an :class:`~codecs.IncrementalDecoder` object for the given *encoding*." +msgstr "" +"Отримайте об’єкт :class:`~codecs.IncrementalDecoder` для вказаного " +"*кодування*." + +msgid "" +"Get a :class:`~codecs.StreamReader` factory function for the given " +"*encoding*." +msgstr "" +"Отримати фабричну функцію :class:`~codecs.StreamReader` для заданого " +"*кодування*." + +msgid "" +"Get a :class:`~codecs.StreamWriter` factory function for the given " +"*encoding*." +msgstr "" +"Отримати фабричну функцію :class:`~codecs.StreamWriter` для вказаного " +"*кодування*." + +msgid "Registry API for Unicode encoding error handlers" +msgstr "API реєстру для обробників помилок кодування Unicode" + +msgid "" +"Register the error handling callback function *error* under the given " +"*name*. This callback function will be called by a codec when it encounters " +"unencodable characters/undecodable bytes and *name* is specified as the " +"error parameter in the call to the encode/decode function." +msgstr "" +"Зареєструйте функцію зворотного виклику обробки помилок *error* під вказаним " +"*ім’ям*. Ця функція зворотного виклику буде викликана кодеком, коли він " +"зустріне некодовані символи/некодовані байти, а *name* вказано як параметр " +"помилки під час виклику функції кодування/декодування." + +msgid "" +"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 " +"tuple containing the replacement for the problematic sequence, and an " +"integer giving the offset in the original string at which encoding/decoding " +"should be resumed." +msgstr "" +"Зворотний виклик отримує один аргумент, екземпляр :exc:" +"`UnicodeEncodeError`, :exc:`UnicodeDecodeError` або :exc:" +"`UnicodeTranslateError`, який містить інформацію про проблемну послідовність " +"символів або байтів та їх зсув у вихідному рядку (див. :ref:" +"`unicodeexceptions` для функцій для отримання цієї інформації). Зворотний " +"виклик повинен або викликати заданий виняток, або повертати кортеж із двох " +"елементів, що містить заміну для проблемної послідовності, і ціле число, що " +"дає зсув у вихідному рядку, на якому кодування/декодування має бути " +"відновлено." + +msgid "Return ``0`` on success, ``-1`` on error." +msgstr "Повертає ``0`` в разі успіху, ``-1`` у разі помилки." + +msgid "" +"Lookup the error handling callback function registered under *name*. As a " +"special case ``NULL`` can be passed, in which case the error handling " +"callback for \"strict\" will be returned." +msgstr "" +"Пошук функції зворотного виклику обробки помилок, зареєстрованої під " +"*ім’ям*. Як особливий випадок можна передати ``NULL``, у цьому випадку буде " +"повернено зворотний виклик обробки помилок для \"strict\"." + +msgid "Raise *exc* as an exception." +msgstr "Підніміть *exc* як виняток." + +msgid "Ignore the unicode error, skipping the faulty input." +msgstr "Ігноруйте помилку Юнікоду, пропускаючи неправильне введення." + +msgid "Replace the unicode encode error with ``?`` or ``U+FFFD``." +msgstr "Замініть помилку кодування Unicode на ``?`` або ``U+FFFD``." + +msgid "Replace the unicode encode error with XML character references." +msgstr "Замініть помилку кодування Unicode посиланнями на символи XML." + +msgid "" +"Replace the unicode encode error with backslash escapes (``\\x``, ``\\u`` " +"and ``\\U``)." +msgstr "" +"Замініть помилку кодування Unicode на екранування зворотної похилої риски " +"(``\\x``, ``\\u`` і ``\\U``)." + +msgid "Replace the unicode encode error with ``\\N{...}`` escapes." +msgstr "Замініть помилку кодування Юнікод на символи ``\\N{...}``." diff --git a/c-api/complex.po b/c-api/complex.po new file mode 100644 index 000000000..4516cb918 --- /dev/null +++ b/c-api/complex.po @@ -0,0 +1,215 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2023 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:48+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2023\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Complex Number Objects" +msgstr "Об’єкти комплексних чисел" + +msgid "" +"Python's complex number objects are implemented as two distinct types when " +"viewed from the C API: one is the Python object exposed to Python programs, " +"and the other is a C structure which represents the actual complex number " +"value. The API provides functions for working with both." +msgstr "" +"Об’єкти комплексних чисел Python реалізуються як два різних типи, якщо " +"дивитися через C API: один є об’єктом Python, відкритим для програм Python, " +"а інший є структурою C, яка представляє фактичне значення комплексного " +"числа. API надає функції для роботи з обома." + +msgid "Complex Numbers as C Structures" +msgstr "Комплексні числа як C структури" + +msgid "" +"Note that the functions which accept these structures as parameters and " +"return them as results do so *by value* rather than dereferencing them " +"through pointers. This is consistent throughout the API." +msgstr "" +"Зауважте, що функції, які приймають ці структури як параметри та повертають " +"їх як результати, роблять це *за значенням*, а не розіменовують їх через " +"покажчики. Це узгоджено в усьому API." + +msgid "" +"The C structure which corresponds to the value portion of a Python complex " +"number object. Most of the functions for dealing with complex number " +"objects use structures of this type as input or output values, as " +"appropriate." +msgstr "" + +msgid "The structure is defined as::" +msgstr "" + +msgid "" +"typedef struct {\n" +" double real;\n" +" double imag;\n" +"} Py_complex;" +msgstr "" + +msgid "" +"Return the sum of two complex numbers, using the C :c:type:`Py_complex` " +"representation." +msgstr "" +"Повертає суму двох комплексних чисел, використовуючи представлення C :c:type:" +"`Py_complex`." + +msgid "" +"Return the difference between two complex numbers, using the C :c:type:" +"`Py_complex` representation." +msgstr "" +"Повертає різницю між двома комплексними числами, використовуючи " +"представлення C :c:type:`Py_complex`." + +msgid "" +"Return the negation of the complex number *num*, using the C :c:type:" +"`Py_complex` representation." +msgstr "" +"Повертає заперечення комплексного числа *num*, використовуючи представлення " +"C :c:type:`Py_complex`." + +msgid "" +"Return the product of two complex numbers, using the C :c:type:`Py_complex` " +"representation." +msgstr "" +"Повертає добуток двох комплексних чисел, використовуючи представлення C :c:" +"type:`Py_complex`." + +msgid "" +"Return the quotient of two complex numbers, using the C :c:type:`Py_complex` " +"representation." +msgstr "" +"Повертає частку двох комплексних чисел, використовуючи представлення C :c:" +"type:`Py_complex`." + +msgid "" +"If *divisor* is null, this method returns zero and sets :c:data:`errno` to :" +"c:macro:`!EDOM`." +msgstr "" + +msgid "" +"Return the exponentiation of *num* by *exp*, using the C :c:type:" +"`Py_complex` representation." +msgstr "" +"Повертає піднесення *num* до степеня *exp*, використовуючи представлення C :" +"c:type:`Py_complex`." + +msgid "" +"If *num* is null and *exp* is not a positive real number, this method " +"returns zero and sets :c:data:`errno` to :c:macro:`!EDOM`." +msgstr "" + +msgid "Complex Numbers as Python Objects" +msgstr "Комплексні числа як об’єкти Python" + +msgid "" +"This subtype of :c:type:`PyObject` represents a Python complex number object." +msgstr "" +"Цей підтип :c:type:`PyObject` представляє об’єкт комплексного числа Python." + +msgid "" +"This instance of :c:type:`PyTypeObject` represents the Python complex number " +"type. It is the same object as :class:`complex` in the Python layer." +msgstr "" +"Цей екземпляр :c:type:`PyTypeObject` представляє тип комплексного числа " +"Python. Це той самий об’єкт, що й :class:`complex` на рівні Python." + +msgid "" +"Return true if its argument is a :c:type:`PyComplexObject` or a subtype of :" +"c:type:`PyComplexObject`. This function always succeeds." +msgstr "" +"Повертає true, якщо його аргумент є :c:type:`PyComplexObject` або підтипом :" +"c:type:`PyComplexObject`. Ця функція завжди успішна." + +msgid "" +"Return true if its argument is a :c:type:`PyComplexObject`, but not a " +"subtype of :c:type:`PyComplexObject`. This function always succeeds." +msgstr "" +"Повертає true, якщо його аргумент є :c:type:`PyComplexObject`, але не " +"підтипом :c:type:`PyComplexObject`. Ця функція завжди успішна." + +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 "" + +msgid "" +"Return a new :c:type:`PyComplexObject` object from *real* and *imag*. Return " +"``NULL`` with an exception set on error." +msgstr "" + +msgid "Return the real part of *op* as a C :c:expr:`double`." +msgstr "" + +msgid "" +"If *op* is not a Python complex number object but has a :meth:`~object." +"__complex__` method, this method will first be called to convert *op* to a " +"Python complex number object. If :meth:`!__complex__` is not defined then " +"it falls back to call :c:func:`PyFloat_AsDouble` and returns its result." +msgstr "" + +msgid "" +"Upon failure, this method returns ``-1.0`` with an exception set, so one " +"should call :c:func:`PyErr_Occurred` to check for errors." +msgstr "" + +msgid "Use :meth:`~object.__complex__` if available." +msgstr "" + +msgid "Return the imaginary part of *op* as a C :c:expr:`double`." +msgstr "" + +msgid "" +"If *op* is not a Python complex number object but has a :meth:`~object." +"__complex__` method, this method will first be called to convert *op* to a " +"Python complex number object. If :meth:`!__complex__` is not defined then " +"it falls back to call :c:func:`PyFloat_AsDouble` and returns ``0.0`` on " +"success." +msgstr "" + +msgid "Return the :c:type:`Py_complex` value of the complex number *op*." +msgstr "Повертає значення :c:type:`Py_complex` комплексного числа *op*." + +msgid "" +"If *op* is not a Python complex number object but has a :meth:`~object." +"__complex__` method, this method will first be called to convert *op* to a " +"Python complex number object. If :meth:`!__complex__` is not defined then " +"it falls back to :meth:`~object.__float__`. If :meth:`!__float__` is not " +"defined then it falls back to :meth:`~object.__index__`." +msgstr "" + +msgid "" +"Upon failure, this method returns :c:type:`Py_complex` with :c:member:" +"`~Py_complex.real` set to ``-1.0`` and with an exception set, so one should " +"call :c:func:`PyErr_Occurred` to check for errors." +msgstr "" + +msgid "Use :meth:`~object.__index__` if available." +msgstr "" + +msgid "object" +msgstr "об'єкт" + +msgid "complex number" +msgstr "комплексне число" diff --git a/c-api/concrete.po b/c-api/concrete.po new file mode 100644 index 000000000..f897bdbe6 --- /dev/null +++ b/c-api/concrete.po @@ -0,0 +1,102 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2023 +# Yuliia Shevchenko, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:48+0000\n" +"Last-Translator: Yuliia Shevchenko, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Concrete Objects Layer" +msgstr "Шар бетонних об'єктів" + +msgid "" +"The functions in this chapter are specific to certain Python object types. " +"Passing them an object of the wrong type is not a good idea; if you receive " +"an object from a Python program and you are not sure that it has the right " +"type, you must perform a type check first; for example, to check that an " +"object is a dictionary, use :c:func:`PyDict_Check`. The chapter is " +"structured like the \"family tree\" of Python object types." +msgstr "" +"Функції в цій главі є специфічними для певних типів об’єктів Python. " +"Передавати їм об’єкт неправильного типу – не дуже гарна ідея; якщо ви " +"отримуєте об’єкт із програми Python і не впевнені, що він має правильний " +"тип, ви повинні спочатку виконати перевірку типу; наприклад, щоб перевірити, " +"що об’єкт є словником, використовуйте :c:func:`PyDict_Check`. Глава " +"структурована як \"генеалогічне дерево\" типів об’єктів Python." + +msgid "" +"While the functions described in this chapter carefully check the type of " +"the objects which are passed in, many of them do not check for ``NULL`` " +"being passed instead of a valid object. Allowing ``NULL`` to be passed in " +"can cause memory access violations and immediate termination of the " +"interpreter." +msgstr "" +"У той час як функції, описані в цій главі, ретельно перевіряють тип " +"об’єктів, які передаються, багато з них не перевіряють ``NULL``, який " +"передається замість дійсного об’єкта. Дозвіл на передачу ``NULL`` може " +"спричинити порушення доступу до пам’яті та негайне припинення роботи " +"інтерпретатора." + +msgid "Fundamental Objects" +msgstr "Фундаментальні об'єкти" + +msgid "" +"This section describes Python type objects and the singleton object ``None``." +msgstr "" +"У цьому розділі описано об’єкти типу Python і одиночний об’єкт ``None``." + +msgid "Numeric Objects" +msgstr "Числові об'єкти" + +msgid "Sequence Objects" +msgstr "Об’єкти послідовності" + +msgid "" +"Generic operations on sequence objects were discussed in the previous " +"chapter; this section deals with the specific kinds of sequence objects that " +"are intrinsic to the Python language." +msgstr "" +"Загальні операції над об’єктами послідовності обговорювалися в попередньому " +"розділі; у цьому розділі розглядаються конкретні типи об’єктів " +"послідовності, властиві мові Python." + +msgid "Container Objects" +msgstr "Контейнерні об’єкти" + +msgid "Function Objects" +msgstr "Функціональні об’єкти" + +msgid "Other Objects" +msgstr "Інші об'єкти" + +msgid "object" +msgstr "об'єкт" + +msgid "numeric" +msgstr "числовий" + +msgid "sequence" +msgstr "послідовність" + +msgid "mapping" +msgstr "відображення" diff --git a/c-api/contextvars.po b/c-api/contextvars.po new file mode 100644 index 000000000..d84038638 --- /dev/null +++ b/c-api/contextvars.po @@ -0,0 +1,209 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# Yuliia Shevchenko, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:48+0000\n" +"Last-Translator: Yuliia Shevchenko, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Context Variables Objects" +msgstr "Об’єкти змінних контексту" + +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.::" +msgstr "" +"У Python 3.7.1 підписи всіх контекстних змінних C API були **змінені** на " +"використання покажчиків :c:type:`PyObject` замість :c:type:`PyContext`, :c:" +"type:`PyContextVar`, і :c:type:`PyContextToken`, наприклад::" + +msgid "" +"// in 3.7.0:\n" +"PyContext *PyContext_New(void);\n" +"\n" +"// in 3.7.1+:\n" +"PyObject *PyContext_New(void);" +msgstr "" +"// в 3.7.0:\n" +"PyContext *PyContext_New(void);\n" +"\n" +"// в 3.7.1+:\n" +"PyObject *PyContext_New(void);" + +msgid "See :issue:`34762` for more details." +msgstr "Дивіться :issue:`34762` для отримання додаткової інформації." + +msgid "" +"This section details the public C API for the :mod:`contextvars` module." +msgstr "" +"У цьому розділі детально описано публічний API C для модуля :mod:" +"`contextvar`." + +msgid "" +"The C structure used to represent a :class:`contextvars.Context` object." +msgstr "" +"Структура C, яка використовується для представлення об’єкта :class:" +"`contextvars.Context`." + +msgid "" +"The C structure used to represent a :class:`contextvars.ContextVar` object." +msgstr "" +"Структура C, яка використовується для представлення об’єкта :class:" +"`contextvars.ContextVar`." + +msgid "The C structure used to represent a :class:`contextvars.Token` object." +msgstr "" +"Структура C, яка використовується для представлення об’єкта :class:" +"`contextvars.Token`." + +msgid "The type object representing the *context* type." +msgstr "Об’єкт типу, що представляє тип *context*." + +msgid "The type object representing the *context variable* type." +msgstr "Об’єкт типу, що представляє тип *контекстної змінної*." + +msgid "The type object representing the *context variable token* type." +msgstr "Об’єкт типу, що представляє тип *токен змінної контексту*." + +msgid "Type-check macros:" +msgstr "Макроси перевірки типу:" + +msgid "" +"Return true if *o* is of type :c:data:`PyContext_Type`. *o* must not be " +"``NULL``. This function always succeeds." +msgstr "" +"Повертає true, якщо *o* має тип :c:data:`PyContext_Type`. *o* не має бути " +"``NULL``. Ця функція завжди успішна." + +msgid "" +"Return true if *o* is of type :c:data:`PyContextVar_Type`. *o* must not be " +"``NULL``. This function always succeeds." +msgstr "" +"Повертає true, якщо *o* має тип :c:data:`PyContextVar_Type`. *o* не має бути " +"``NULL``. Ця функція завжди успішна." + +msgid "" +"Return true if *o* is of type :c:data:`PyContextToken_Type`. *o* must not be " +"``NULL``. This function always succeeds." +msgstr "" +"Повертає true, якщо *o* має тип :c:data:`PyContextToken_Type`. *o* не має " +"бути ``NULL``. Ця функція завжди успішна." + +msgid "Context object management functions:" +msgstr "Функції керування об’єктами контексту:" + +msgid "" +"Create a new empty context object. Returns ``NULL`` if an error has " +"occurred." +msgstr "" +"Створіть новий порожній контекстний об’єкт. Повертає ``NULL``, якщо сталася " +"помилка." + +msgid "" +"Create a shallow copy of the passed *ctx* context object. Returns ``NULL`` " +"if an error has occurred." +msgstr "" +"Створіть поверхневу копію переданого контекстного об’єкта *ctx*. Повертає " +"``NULL``, якщо сталася помилка." + +msgid "" +"Create a shallow copy of the current thread context. Returns ``NULL`` if an " +"error has occurred." +msgstr "" +"Створіть поверхневу копію контексту поточного потоку. Повертає ``NULL``, " +"якщо сталася помилка." + +msgid "" +"Set *ctx* as the current context for the current thread. Returns ``0`` on " +"success, and ``-1`` on error." +msgstr "" +"Установіть *ctx* як поточний контекст для поточного потоку. Повертає ``0`` у " +"разі успіху та ``-1`` у разі помилки." + +msgid "" +"Deactivate the *ctx* context and restore the previous context as the current " +"context for the current thread. Returns ``0`` on success, and ``-1`` on " +"error." +msgstr "" +"Дезактивуйте контекст *ctx* і відновіть попередній контекст як поточний " +"контекст для поточного потоку. Повертає ``0`` у разі успіху та ``-1`` у разі " +"помилки." + +msgid "Context variable functions:" +msgstr "Функції контекстної змінної:" + +msgid "" +"Create a new ``ContextVar`` object. The *name* parameter is used for " +"introspection and debug purposes. The *def* parameter specifies a default " +"value for the context variable, or ``NULL`` for no default. If an error has " +"occurred, this function returns ``NULL``." +msgstr "" +"Створіть новий об’єкт ``ContextVar``. Параметр *name* використовується для " +"самоаналізу та налагодження. Параметр *def* визначає значення за " +"замовчуванням для змінної контексту або ``NULL`` для відсутності " +"замовчування. Якщо сталася помилка, ця функція повертає ``NULL``." + +msgid "" +"Get the value of a context variable. Returns ``-1`` if an error has " +"occurred during lookup, and ``0`` if no error occurred, whether or not a " +"value was found." +msgstr "" +"Отримати значення контекстної змінної. Повертає ``-1``, якщо під час пошуку " +"сталася помилка, і ``0``, якщо помилки не сталося, незалежно від того, чи " +"було знайдено значення." + +msgid "" +"If the context variable was found, *value* will be a pointer to it. If the " +"context variable was *not* found, *value* will point to:" +msgstr "" +"Якщо контекстну змінну знайдено, *value* буде вказівником на неї. Якщо " +"контекстну змінну *не* знайдено, *значення* вказуватиме на:" + +msgid "*default_value*, if not ``NULL``;" +msgstr "*default_value*, якщо не ``NULL``;" + +msgid "the default value of *var*, if not ``NULL``;" +msgstr "значення за замовчуванням *var*, якщо не ``NULL``;" + +msgid "``NULL``" +msgstr "``NULL``" + +msgid "Except for ``NULL``, the function returns a new reference." +msgstr "За винятком ``NULL``, функція повертає нове посилання." + +msgid "" +"Set the value of *var* to *value* in the current context. Returns a new " +"token object for this change, or ``NULL`` if an error has occurred." +msgstr "" +"Установіть для *var* значення *value* у поточному контексті. Повертає новий " +"об’єкт маркера для цієї зміни або ``NULL``, якщо сталася помилка." + +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." +msgstr "" +"Скинути стан контекстної змінної *var* до того, у якому вона була до " +"виклику :c:func:`PyContextVar_Set`, який повернув *токен*. Ця функція " +"повертає ``0`` у разі успіху та ``-1`` у разі помилки." diff --git a/c-api/conversion.po b/c-api/conversion.po new file mode 100644 index 000000000..d9e97637d --- /dev/null +++ b/c-api/conversion.po @@ -0,0 +1,274 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:48+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "String conversion and formatting" +msgstr "Перетворення та форматування рядків" + +msgid "Functions for number conversion and formatted string output." +msgstr "Функції для перетворення чисел і виведення форматованого рядка." + +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)`." +msgstr "" +"Виводити не більше *size* байтів до *str* відповідно до рядка формату " +"*format* і додаткових аргументів. Перегляньте сторінку довідки Unix :manpage:" +"`snprintf(3)`." + +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)`." +msgstr "" +"Виводити не більше *size* байтів до *str* відповідно до рядка формату " +"*format* і списку змінних аргументів *va*. Довідкова сторінка Unix :manpage:" +"`vsnprintf(3)`." + +msgid "" +":c:func:`PyOS_snprintf` and :c:func:`PyOS_vsnprintf` wrap the Standard C " +"library functions :c:func:`snprintf` and :c:func:`vsnprintf`. Their purpose " +"is to guarantee consistent behavior in corner cases, which the Standard C " +"functions do not." +msgstr "" +":c:func:`PyOS_snprintf` і :c:func:`PyOS_vsnprintf` обгортають стандартні " +"функції бібліотеки C :c:func:`snprintf` і :c:func:`vsnprintf`. Їх мета " +"полягає в тому, щоб гарантувати послідовну поведінку в кутових випадках, " +"чого немає у стандартних функціях C." + +msgid "" +"The wrappers ensure that ``str[size-1]`` is always ``'\\0'`` upon return. " +"They never write more than *size* bytes (including the trailing ``'\\0'``) " +"into str. Both functions require that ``str != NULL``, ``size > 0``, " +"``format != NULL`` and ``size < INT_MAX``. Note that this means there is no " +"equivalent to the C99 ``n = snprintf(NULL, 0, ...)`` which would determine " +"the necessary buffer size." +msgstr "" + +msgid "" +"The return value (*rv*) for these functions should be interpreted as follows:" +msgstr "" +"Повернене значення (*rv*) для цих функцій слід інтерпретувати таким чином:" + +msgid "" +"When ``0 <= rv < size``, the output conversion was successful and *rv* " +"characters were written to *str* (excluding the trailing ``'\\0'`` byte at " +"``str[rv]``)." +msgstr "" +"Коли ``0 <= rv < size``, вихідне перетворення було успішним і *rv* символи " +"були записані в *str* (за винятком кінцевого байта ``'\\0''`` у " +"``str[rv]`` )." + +msgid "" +"When ``rv >= size``, the output conversion was truncated and a buffer with " +"``rv + 1`` bytes would have been needed to succeed. ``str[size-1]`` is " +"``'\\0'`` in this case." +msgstr "" +"Коли rv >= size, вихідне перетворення було скорочено, і для успіху " +"знадобився буфер із rv + 1 байтами. ``str[size-1]`` у цьому випадку є " +"``'\\0''``." + +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." +msgstr "" +"Коли ``rv < 0``, \"сталося щось погане\". ``str[size-1]`` у цьому випадку " +"також є ``'\\0''``, але решта *str* не визначена. Точна причина помилки " +"залежить від основної платформи." + +msgid "" +"The following functions provide locale-independent string to number " +"conversions." +msgstr "" +"Наступні функції забезпечують перетворення рядка в число, незалежне від " +"локалі." + +msgid "" +"Convert the initial part of the string in ``str`` to an :c:expr:`unsigned " +"long` value according to the given ``base``, which must be between ``2`` and " +"``36`` inclusive, or be the special value ``0``." +msgstr "" + +msgid "" +"Leading white space and case of characters are ignored. If ``base`` is zero " +"it looks for a leading ``0b``, ``0o`` or ``0x`` to tell which base. If " +"these are absent it defaults to ``10``. Base must be 0 or between 2 and 36 " +"(inclusive). If ``ptr`` is non-``NULL`` it will contain a pointer to the " +"end of the scan." +msgstr "" + +msgid "" +"If the converted value falls out of range of corresponding return type, " +"range error occurs (:c:data:`errno` is set to :c:macro:`!ERANGE`) and :c:" +"macro:`!ULONG_MAX` is returned. If no conversion can be performed, ``0`` is " +"returned." +msgstr "" + +msgid "See also the Unix man page :manpage:`strtoul(3)`." +msgstr "" + +msgid "" +"Convert the initial part of the string in ``str`` to an :c:expr:`long` value " +"according to the given ``base``, which must be between ``2`` and ``36`` " +"inclusive, or be the special value ``0``." +msgstr "" + +msgid "" +"Same as :c:func:`PyOS_strtoul`, but return a :c:expr:`long` value instead " +"and :c:macro:`LONG_MAX` on overflows." +msgstr "" + +msgid "See also the Unix man page :manpage:`strtol(3)`." +msgstr "" + +msgid "" +"Convert a string ``s`` to a :c:expr:`double`, raising a Python exception on " +"failure. The set of accepted strings corresponds to the set of strings " +"accepted by Python's :func:`float` constructor, except that ``s`` must not " +"have leading or trailing whitespace. The conversion is independent of the " +"current locale." +msgstr "" + +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." +msgstr "" +"Якщо ``endptr`` має значення ``NULL``, перетворити весь рядок. Викликайте :" +"exc:`ValueError` і повертайте ``-1.0``, якщо рядок не є дійсним " +"представленням числа з плаваючою комою." + +msgid "" +"If endptr is not ``NULL``, convert as much of the string as possible and set " +"``*endptr`` to point to the first unconverted character. If no initial " +"segment of the string is the valid representation of a floating-point " +"number, set ``*endptr`` to point to the beginning of the string, raise " +"ValueError, and return ``-1.0``." +msgstr "" +"Якщо endptr не дорівнює NULL, перетворіть якомога більшу частину рядка та " +"встановіть ``*endptr`` так, щоб він вказував на перший неперетворений " +"символ. Якщо жоден початковий сегмент рядка не є дійсним представленням " +"числа з плаваючою комою, установіть ``*endptr``, щоб вказувати на початок " +"рядка, викликайте ValueError і поверніть ``-1.0``." + +msgid "" +"If ``s`` represents a value that is too large to store in a float (for " +"example, ``\"1e500\"`` is such a string on many platforms) then if " +"``overflow_exception`` is ``NULL`` return ``Py_HUGE_VAL`` (with an " +"appropriate sign) and don't set any exception. Otherwise, " +"``overflow_exception`` must point to a Python exception object; raise that " +"exception and return ``-1.0``. In both cases, set ``*endptr`` to point to " +"the first character after the converted value." +msgstr "" +"Якщо ``s`` представляє значення, яке є надто великим для зберігання в float " +"(наприклад, ``\"1e500\"`` є таким рядком на багатьох платформах), тоді " +"``overflow_exception`` має значення ``NULL`` поверніть ``Py_HUGE_VAL`` (з " +"відповідним знаком) і не встановлюйте винятків. В іншому випадку " +"``overflow_exception`` має вказувати на об’єкт винятку Python; викликати цей " +"виняток і повернути ``-1.0``. В обох випадках встановіть ``*endptr``, щоб " +"вказувати на перший символ після перетвореного значення." + +msgid "" +"If any other error occurs during the conversion (for example an out-of-" +"memory error), set the appropriate Python exception and return ``-1.0``." +msgstr "" +"Якщо під час перетворення виникає будь-яка інша помилка (наприклад, помилка " +"браку пам’яті), установіть відповідний виняток Python і поверніть ``-1.0``." + +msgid "" +"Convert a :c:expr:`double` *val* to a string using supplied *format_code*, " +"*precision*, and *flags*." +msgstr "" + +msgid "" +"*format_code* must be one of ``'e'``, ``'E'``, ``'f'``, ``'F'``, ``'g'``, " +"``'G'`` or ``'r'``. For ``'r'``, the supplied *precision* must be 0 and is " +"ignored. The ``'r'`` format code specifies the standard :func:`repr` format." +msgstr "" +"*format_code* має бути одним із ``'e'``, ``'E'``, ``'f'``, ``'F'``, ``'g'``, " +"``'G'`` або ``'r''``. Для ``'r'`` надана *точність* має бути 0 і " +"ігнорується. Код формату ``'r'`` визначає стандартний формат :func:`repr`." + +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:" +msgstr "" +"*flags* може мати нуль або більше значень ``Py_DTSF_SIGN``, " +"``Py_DTSF_ADD_DOT_0`` або ``Py_DTSF_ALT``, або об’єднані разом:" + +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`` означає, що перед поверненим рядком завжди ставиться знак, " +"навіть якщо *val* є невід’ємним." + +msgid "" +"``Py_DTSF_ADD_DOT_0`` means to ensure that the returned string will not look " +"like an integer." +msgstr "" +"``Py_DTSF_ADD_DOT_0`` означає, що повернутий рядок не буде виглядати як ціле " +"число." + +msgid "" +"``Py_DTSF_ALT`` means to apply \"alternate\" formatting rules. See the " +"documentation for the :c:func:`PyOS_snprintf` ``'#'`` specifier for details." +msgstr "" +"``Py_DTSF_ALT`` означає застосування \"альтернативних\" правил форматування. " +"Перегляньте документацію для специфікатора :c:func:`PyOS_snprintf` ``'#''`` " +"для отримання детальної інформації." + +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." +msgstr "" +"Якщо *ptype* не є ``NULL``, тоді значення, на яке він вказує, буде " +"встановлено на одне з ``Py_DTST_FINITE``, ``Py_DTST_INFINITE`` або " +"``Py_DTST_NAN``, що означає, що *val* є кінцеве число, нескінченне число або " +"не число відповідно." + +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 " +"returned string by calling :c:func:`PyMem_Free`." +msgstr "" +"Поверненим значенням є вказівник на *buffer* із перетвореним рядком або " +"``NULL``, якщо перетворення не вдалося. Виклик відповідає за звільнення " +"повернутого рядка шляхом виклику :c:func:`PyMem_Free`." + +msgid "" +"Case insensitive comparison of strings. The function works almost " +"identically to :c:func:`!strcmp` except that it ignores the case." +msgstr "" + +msgid "" +"Case insensitive comparison of strings. The function works almost " +"identically to :c:func:`!strncmp` except that it ignores the case." +msgstr "" diff --git a/c-api/coro.po b/c-api/coro.po new file mode 100644 index 000000000..8778bb751 --- /dev/null +++ b/c-api/coro.po @@ -0,0 +1,60 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:48+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Coroutine Objects" +msgstr "Об’єкти співпрограми" + +msgid "" +"Coroutine objects are what functions declared with an ``async`` keyword " +"return." +msgstr "" +"Об’єкти співпрограми – це те, що повертають функції, оголошені за допомогою " +"ключового слова ``async``." + +msgid "The C structure used for coroutine objects." +msgstr "Структура C, яка використовується для об’єктів співпрограми." + +msgid "The type object corresponding to coroutine objects." +msgstr "Об’єкт типу, що відповідає об’єктам співпрограми." + +msgid "" +"Return true if *ob*'s type is :c:type:`PyCoro_Type`; *ob* must not be " +"``NULL``. This function always succeeds." +msgstr "" +"Повертає true, якщо *ob* має тип :c:type:`PyCoro_Type`; *ob* не має бути " +"``NULL``. Ця функція завжди успішна." + +msgid "" +"Create and return a new coroutine 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``." +msgstr "" +"Створіть і поверніть новий об’єкт співпрограми на основі об’єкта *frame* із " +"параметрами ``__name__`` і ``__qualname__``, встановленими на *name* і " +"*qualname*. Ця функція викрадає посилання на *frame*. Аргумент *frame* не " +"має бути ``NULL``." diff --git a/c-api/datetime.po b/c-api/datetime.po new file mode 100644 index 000000000..7aefb1dc8 --- /dev/null +++ b/c-api/datetime.po @@ -0,0 +1,296 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2025 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:48+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2025\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "DateTime Objects" +msgstr "Об’єкти 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 "" + +msgid "This subtype of :c:type:`PyObject` represents a Python date object." +msgstr "Цей підтип :c:type:`PyObject` представляє об'єкт date в Python." + +msgid "This subtype of :c:type:`PyObject` represents a Python datetime object." +msgstr "Цей підтип :c:type:`PyObject` представляє об'єкт datetime в Python." + +msgid "This subtype of :c:type:`PyObject` represents a Python time object." +msgstr "Цей підтип :c:type:`PyObject` представляє об'єкт time в Python." + +msgid "" +"This subtype of :c:type:`PyObject` represents the difference between two " +"datetime values." +msgstr "" +"Цей підтип :c:type:`PyObject` представляє різницю між двома значеннями " +"datetime." + +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 "" + +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 "" + +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 "" + +msgid "" +"This instance of :c:type:`PyTypeObject` represents Python type for the " +"difference between two datetime values; it is the same object as :class:" +"`datetime.timedelta` in the Python layer." +msgstr "" + +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 "" + +msgid "Macro for access to the UTC singleton:" +msgstr "Макрос для доступу до синглтону UTC:" + +msgid "" +"Returns the time zone singleton representing UTC, the same object as :attr:" +"`datetime.timezone.utc`." +msgstr "" +"Повертає синглтон часового поясу, який представляє UTC, той самий об’єкт, що " +"й :attr:`datetime.timezone.utc`." + +msgid "Type-check macros:" +msgstr "Макроси перевірки типу:" + +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 "" + +msgid "" +"Return true if *ob* is of type :c:data:`PyDateTime_DateType`. *ob* must not " +"be ``NULL``. This function always succeeds." +msgstr "" +"Повертає true, якщо *ob* має тип :c:data:`PyDateTime_DateType`. *ob* не має " +"бути ``NULL``. Ця функція завжди успішна." + +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 "" + +msgid "" +"Return true if *ob* is of type :c:data:`PyDateTime_DateTimeType`. *ob* must " +"not be ``NULL``. This function always succeeds." +msgstr "" +"Повертає true, якщо *ob* має тип :c:data:`PyDateTime_DateTimeType`. *ob* не " +"має бути ``NULL``. Ця функція завжди успішна." + +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 "" + +msgid "" +"Return true if *ob* is of type :c:data:`PyDateTime_TimeType`. *ob* must not " +"be ``NULL``. This function always succeeds." +msgstr "" +"Повертає true, якщо *ob* має тип :c:data:`PyDateTime_TimeType`. *ob* не має " +"бути ``NULL``. Ця функція завжди успішна." + +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 "" + +msgid "" +"Return true if *ob* is of type :c:data:`PyDateTime_DeltaType`. *ob* must not " +"be ``NULL``. This function always succeeds." +msgstr "" +"Повертає true, якщо *ob* має тип :c:data:`PyDateTime_DeltaType`. *ob* не має " +"бути ``NULL``. Ця функція завжди успішна." + +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 "" + +msgid "" +"Return true if *ob* is of type :c:data:`PyDateTime_TZInfoType`. *ob* must " +"not be ``NULL``. This function always succeeds." +msgstr "" +"Повертає true, якщо *ob* має тип :c:data:`PyDateTime_TZInfoType`. *ob* не " +"має бути ``NULL``. Ця функція завжди успішна." + +msgid "Macros to create objects:" +msgstr "Макроси для створення об'єктів:" + +msgid "" +"Return a :class:`datetime.date` object with the specified year, month and " +"day." +msgstr "" +"Повертає об’єкт :class:`datetime.date` із зазначеним роком, місяцем і днем." + +msgid "" +"Return a :class:`datetime.datetime` object with the specified year, month, " +"day, hour, minute, second and microsecond." +msgstr "" +"Повертає об’єкт :class:`datetime.datetime` із вказаним роком, місяцем, днем, " +"годиною, хвилиною, секундою та мікросекундою." + +msgid "" +"Return a :class:`datetime.datetime` object with the specified year, month, " +"day, hour, minute, second, microsecond and fold." +msgstr "" +"Повертає об’єкт :class:`datetime.datetime` із вказаним роком, місяцем, днем, " +"годиною, хвилиною, секундою, мікросекундою та кратністю." + +msgid "" +"Return a :class:`datetime.time` object with the specified hour, minute, " +"second and microsecond." +msgstr "" +"Повертає об’єкт :class:`datetime.time` із вказаною годиною, хвилиною, " +"секундою та мікросекундою." + +msgid "" +"Return a :class:`datetime.time` object with the specified hour, minute, " +"second, microsecond and fold." +msgstr "" +"Повертає об’єкт :class:`datetime.time` із вказаною годиною, хвилиною, " +"секундою, мікросекундою та кратністю." + +msgid "" +"Return a :class:`datetime.timedelta` object representing the given number of " +"days, seconds and microseconds. Normalization is performed so that the " +"resulting number of microseconds and seconds lie in the ranges documented " +"for :class:`datetime.timedelta` objects." +msgstr "" +"Повертає об’єкт :class:`datetime.timedelta`, що представляє задану кількість " +"днів, секунд і мікросекунд. Нормалізація виконується таким чином, щоб " +"результуюча кількість мікросекунд і секунд лежала в діапазонах, " +"задокументованих для об’єктів :class:`datetime.timedelta`." + +msgid "" +"Return a :class:`datetime.timezone` object with an unnamed fixed offset " +"represented by the *offset* argument." +msgstr "" +"Повертає об’єкт :class:`datetime.timezone` із фіксованим зсувом без назви, " +"представленим аргументом *offset*." + +msgid "" +"Return a :class:`datetime.timezone` object with a fixed offset represented " +"by the *offset* argument and with tzname *name*." +msgstr "" +"Повертає об’єкт :class:`datetime.timezone` із фіксованим зсувом, " +"представленим аргументом *offset*, і з tzname *name*." + +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:" +msgstr "" + +msgid "Return the year, as a positive int." +msgstr "Повернути рік, як позитивне внутр." + +msgid "Return the month, as an int from 1 through 12." +msgstr "Повертає місяць як int від 1 до 12." + +msgid "Return the day, as an int from 1 through 31." +msgstr "Повертає день як int від 1 до 31." + +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 "" + +msgid "Return the hour, as an int from 0 through 23." +msgstr "Повертає годину як int від 0 до 23." + +msgid "Return the minute, as an int from 0 through 59." +msgstr "Повертає хвилини як int від 0 до 59." + +msgid "Return the second, as an int from 0 through 59." +msgstr "Повертає секунду як int від 0 до 59." + +msgid "Return the microsecond, as an int from 0 through 999999." +msgstr "Повертає мікросекунду як int від 0 до 999999." + +msgid "Return the fold, as an int from 0 through 1." +msgstr "" + +msgid "Return the tzinfo (which may be ``None``)." +msgstr "Повертає tzinfo (яка може бути ``None``)." + +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 "" + +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 "" + +msgid "Return the number of days, as an int from -999999999 to 999999999." +msgstr "Повертає кількість днів у вигляді int від -999999999 до 999999999." + +msgid "Return the number of seconds, as an int from 0 through 86399." +msgstr "Повертає кількість секунд у вигляді цілого типу від 0 до 86399." + +msgid "Return the number of microseconds, as an int from 0 through 999999." +msgstr "" +"Повертає кількість мікросекунд у вигляді цілого значення від 0 до 999999." + +msgid "Macros for the convenience of modules implementing the DB API:" +msgstr "Макроси для зручності модулів, що реалізують API БД:" + +msgid "" +"Create and return a new :class:`datetime.datetime` object given an argument " +"tuple suitable for passing to :meth:`datetime.datetime.fromtimestamp`." +msgstr "" + +msgid "" +"Create and return a new :class:`datetime.date` object given an argument " +"tuple suitable for passing to :meth:`datetime.date.fromtimestamp`." +msgstr "" diff --git a/c-api/descriptor.po b/c-api/descriptor.po new file mode 100644 index 000000000..3d0a26e0e --- /dev/null +++ b/c-api/descriptor.po @@ -0,0 +1,48 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:48+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Descriptor Objects" +msgstr "Об'єкти-дескриптори" + +msgid "" +"\"Descriptors\" are objects that describe some attribute of an object. They " +"are found in the dictionary of type objects." +msgstr "" +"\"Дескриптори\" - це об'єкти, які описують деякі атрибути об'єкта. Вони " +"знаходяться в словнику об'єктів типу." + +msgid "The type object for the built-in descriptor types." +msgstr "Об’єкт типу для вбудованих типів дескрипторів." + +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." +msgstr "" +"Повертає ненульове значення, якщо об’єкти дескриптора *descr* описують " +"атрибут даних, або ``0``, якщо він описує метод. *descr* має бути об’єктом " +"дескриптора; немає перевірки помилок." diff --git a/c-api/dict.po b/c-api/dict.po new file mode 100644 index 000000000..1fbe5c1a7 --- /dev/null +++ b/c-api/dict.po @@ -0,0 +1,477 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2023 +# Yuliia Shevchenko, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:48+0000\n" +"Last-Translator: Yuliia Shevchenko, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Dictionary Objects" +msgstr "Об’єкти словника" + +msgid "" +"This subtype of :c:type:`PyObject` represents a Python dictionary object." +msgstr "Цей підтип :c:type:`PyObject` представляє об’єкт словника Python." + +msgid "" +"This instance of :c:type:`PyTypeObject` represents the Python dictionary " +"type. This is the same object as :class:`dict` in the Python layer." +msgstr "" +"Цей екземпляр :c:type:`PyTypeObject` представляє тип словника Python. Це той " +"самий об’єкт, що й :class:`dict` на рівні Python." + +msgid "" +"Return true if *p* is a dict object or an instance of a subtype of the dict " +"type. This function always succeeds." +msgstr "" +"Повертає true, якщо *p* є об’єктом dict або екземпляром підтипу типу dict. " +"Ця функція завжди успішна." + +msgid "" +"Return true if *p* is a dict object, but not an instance of a subtype of the " +"dict type. This function always succeeds." +msgstr "" +"Повертає true, якщо *p* є об’єктом dict, але не екземпляром підтипу типу " +"dict. Ця функція завжди успішна." + +msgid "Return a new empty dictionary, or ``NULL`` on failure." +msgstr "Повертає новий порожній словник або ``NULL`` у разі помилки." + +msgid "" +"Return a :class:`types.MappingProxyType` object for a mapping which enforces " +"read-only behavior. This is normally used to create a view to prevent " +"modification of the dictionary for non-dynamic class types." +msgstr "" +"Повертає об’єкт :class:`types.MappingProxyType` для зіставлення, яке " +"забезпечує поведінку лише для читання. Зазвичай це використовується для " +"створення представлення для запобігання модифікації словника для " +"нединамічних типів класів." + +msgid "Empty an existing dictionary of all key-value pairs." +msgstr "Очистити існуючий словник від усіх пар ключ-значення." + +msgid "" +"Determine if dictionary *p* contains *key*. If an item in *p* is matches " +"*key*, return ``1``, otherwise return ``0``. On error, return ``-1``. This " +"is equivalent to the Python expression ``key in p``." +msgstr "" +"Визначте, чи словник *p* містить *ключ*. Якщо елемент у *p* відповідає " +"*ключу*, поверніть ``1``, інакше поверніть ``0``. У разі помилки повертає " +"``-1``. Це еквівалентно виразу Python ``key in p``." + +msgid "" +"This is the same as :c:func:`PyDict_Contains`, but *key* is specified as a :" +"c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" +"`PyObject*`." +msgstr "" + +msgid "Return a new dictionary that contains the same key-value pairs as *p*." +msgstr "" +"Повертає новий словник, який містить ті самі пари ключ-значення, що й *p*." + +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*." +msgstr "" +"Вставте *val* у словник *p* з ключем *key*. *ключ* має бути :term:" +"`hashable`; якщо це не так, буде викликано :exc:`TypeError`. Повертає ``0`` " +"у разі успіху або ``-1`` у разі невдачі. Ця функція *не* викрадає посилання " +"на *val*." + +msgid "" +"This is the same as :c:func:`PyDict_SetItem`, but *key* is specified as a :c:" +"expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" +"`PyObject*`." +msgstr "" + +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." +msgstr "" + +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*`." +msgstr "" + +msgid "" +"Return a new :term:`strong reference` to the object from dictionary *p* " +"which has a key *key*:" +msgstr "" + +msgid "" +"If the key is present, set *\\*result* to a new :term:`strong reference` to " +"the value and return ``1``." +msgstr "" + +msgid "If the key is missing, set *\\*result* to ``NULL`` and return ``0``." +msgstr "" + +msgid "On error, raise an exception and return ``-1``." +msgstr "" + +msgid "See also the :c:func:`PyObject_GetItem` function." +msgstr "" + +msgid "" +"Return a :term:`borrowed reference` to the object from dictionary *p* which " +"has a key *key*. Return ``NULL`` if the key *key* is missing *without* " +"setting an exception." +msgstr "" + +msgid "" +"Exceptions that occur while this calls :meth:`~object.__hash__` and :meth:" +"`~object.__eq__` methods are silently ignored. Prefer the :c:func:" +"`PyDict_GetItemWithError` function instead." +msgstr "" + +msgid "" +"Calling this API without :term:`GIL` held had been allowed for historical " +"reason. It is no longer allowed." +msgstr "" +"Виклик цього API без утримання :term:`GIL` був дозволений з історичних " +"причин. Це більше не дозволено." + +msgid "" +"Variant of :c:func:`PyDict_GetItem` that does not suppress exceptions. " +"Return ``NULL`` **with** an exception set if an exception occurred. Return " +"``NULL`` **without** an exception set if the key wasn't present." +msgstr "" +"Варіант :c:func:`PyDict_GetItem`, який не пригнічує винятки. Повертає " +"``NULL`` **з** встановленим винятком, якщо виняток стався. Повертає ``NULL`` " +"**без** набору винятків, якщо ключ відсутній." + +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*`." +msgstr "" + +msgid "" +"Exceptions that occur while this calls :meth:`~object.__hash__` and :meth:" +"`~object.__eq__` methods or while creating the temporary :class:`str` object " +"are silently ignored. Prefer using the :c:func:`PyDict_GetItemWithError` " +"function with your own :c:func:`PyUnicode_FromString` *key* instead." +msgstr "" + +msgid "" +"Similar to :c:func:`PyDict_GetItemRef`, but *key* is specified as a :c:expr:" +"`const char*` UTF-8 encoded bytes string, rather than a :c:expr:`PyObject*`." +msgstr "" + +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 " +"key is not in the dict, it is inserted with value *defaultobj* and " +"*defaultobj* is returned. This function evaluates the hash function of " +"*key* only once, instead of evaluating it independently for the lookup and " +"the insertion." +msgstr "" +"Це те саме, що на рівні Python :meth:`dict.setdefault`. Якщо він присутній, " +"він повертає значення, що відповідає *key* зі словника *p*. Якщо ключа немає " +"в dict, він вставляється зі значенням *defaultobj* і повертається " +"*defaultobj*. Ця функція обчислює хеш-функцію *key* лише один раз, замість " +"того, щоб оцінювати її незалежно для пошуку та вставки." + +msgid "" +"Inserts *default_value* into the dictionary *p* with a key of *key* if the " +"key is not already present in the dictionary. If *result* is not ``NULL``, " +"then *\\*result* is set to a :term:`strong reference` to either " +"*default_value*, if the key was not present, or the existing value, if *key* " +"was already present in the dictionary. Returns ``1`` if the key was present " +"and *default_value* was not inserted, or ``0`` if the key was not present " +"and *default_value* was inserted. On failure, returns ``-1``, sets an " +"exception, and sets ``*result`` to ``NULL``." +msgstr "" + +msgid "" +"For clarity: if you have a strong reference to *default_value* before " +"calling this function, then after it returns, you hold a strong reference to " +"both *default_value* and *\\*result* (if it's not ``NULL``). These may refer " +"to the same object: in that case you hold two separate references to it." +msgstr "" + +msgid "" +"Remove *key* from dictionary *p* and optionally return the removed value. Do " +"not raise :exc:`KeyError` if the key missing." +msgstr "" + +msgid "" +"If the key is present, set *\\*result* to a new reference to the removed " +"value if *result* is not ``NULL``, and return ``1``." +msgstr "" + +msgid "" +"If the key is missing, set *\\*result* to ``NULL`` if *result* is not " +"``NULL``, and return ``0``." +msgstr "" + +msgid "" +"Similar to :meth:`dict.pop`, but without the default value and not raising :" +"exc:`KeyError` if the key missing." +msgstr "" + +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 "" + +msgid "" +"Return a :c:type:`PyListObject` containing all the items from the dictionary." +msgstr "Повертає :c:type:`PyListObject`, що містить усі елементи зі словника." + +msgid "" +"Return a :c:type:`PyListObject` containing all the keys from the dictionary." +msgstr "Повертає :c:type:`PyListObject`, що містить усі ключі зі словника." + +msgid "" +"Return a :c:type:`PyListObject` containing all the values from the " +"dictionary *p*." +msgstr "" +"Повертає :c:type:`PyListObject`, що містить усі значення зі словника *p*." + +msgid "" +"Return the number of items in the dictionary. This is equivalent to " +"``len(p)`` on a dictionary." +msgstr "" +"Повернути кількість елементів у словнику. Це еквівалентно ``len(p)`` у " +"словнику." + +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 "" + +msgid "For example::" +msgstr "Наприклад::" + +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 "" + +msgid "" +"The dictionary *p* should not be mutated during iteration. It is safe to " +"modify the values of the keys as you iterate over the dictionary, but only " +"so long as the set of keys does not change. For example::" +msgstr "" +"Словник *p* не повинен змінюватися під час ітерації. Безпечно змінювати " +"значення ключів під час перегляду словника, але лише до тих пір, поки набір " +"ключів не зміниться. Наприклад::" + +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 "" + +msgid "" +"The function is not thread-safe in the :term:`free-threaded ` build without external synchronization. You can use :c:macro:" +"`Py_BEGIN_CRITICAL_SECTION` to lock the dictionary while iterating over it::" +msgstr "" + +msgid "" +"Py_BEGIN_CRITICAL_SECTION(self->dict);\n" +"while (PyDict_Next(self->dict, &pos, &key, &value)) {\n" +" ...\n" +"}\n" +"Py_END_CRITICAL_SECTION();" +msgstr "" + +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` " +"and :c:func:`PyObject_GetItem`. If *override* is true, existing pairs in *a* " +"will be replaced if a matching key is found in *b*, otherwise pairs will " +"only be added if there is not a matching key in *a*. Return ``0`` on success " +"or ``-1`` if an exception was raised." +msgstr "" +"Ітерація об’єкта відображення *b*, додавання пар ключ-значення до словника " +"*a*. *b* може бути словником або будь-яким об’єктом, що підтримує :c:func:" +"`PyMapping_Keys` і :c:func:`PyObject_GetItem`. Якщо *override* має значення " +"true, існуючі пари в *a* буде замінено, якщо відповідний ключ буде знайдено " +"в *b*, інакше пари будуть додані, лише якщо в *a* немає відповідного ключа. " +"Повертає ``0`` у разі успіху або ``-1``, якщо було викликано виключення." + +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 " +"exception was raised." +msgstr "" +"Це те саме, що ``PyDict_Merge(a, b, 1)`` у C, і схоже на ``a.update(b)`` у " +"Python, за винятком того, що :c:func:`PyDict_Update` не падає повернутися до " +"повторення послідовності пар ключ-значення, якщо другий аргумент не має " +"атрибута \"ключі\". Повертає ``0`` у разі успіху або ``-1``, якщо було " +"викликано виключення." + +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, " +"viewed as key-value pairs. In case of duplicate keys, the last wins if " +"*override* is true, else the first wins. Return ``0`` on success or ``-1`` " +"if an exception was raised. Equivalent Python (except for the return value)::" +msgstr "" +"Оновіть або об’єднайте в словник *a* з пар ключ-значення в *seq2*. *seq2* " +"має бути повторюваним об’єктом, що створює ітеровані об’єкти довжини 2, які " +"розглядаються як пари ключ-значення. У випадку дублікатів ключів, останній " +"виграє, якщо *override* має значення true, інакше виграє перший. Повертає " +"``0`` в разі успіху або ``-1``, якщо було викликано виключення. " +"Еквівалентний Python (за винятком значення, що повертається)::" + +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 "" + +msgid "" +"Register *callback* as a dictionary watcher. Return a non-negative integer " +"id which must be passed to future calls to :c:func:`PyDict_Watch`. In case " +"of error (e.g. no more watcher IDs available), return ``-1`` and set an " +"exception." +msgstr "" + +msgid "" +"Clear watcher identified by *watcher_id* previously returned from :c:func:" +"`PyDict_AddWatcher`. Return ``0`` on success, ``-1`` on error (e.g. if the " +"given *watcher_id* was never registered.)" +msgstr "" + +msgid "" +"Mark dictionary *dict* as watched. The callback granted *watcher_id* by :c:" +"func:`PyDict_AddWatcher` will be called when *dict* is modified or " +"deallocated. Return ``0`` on success or ``-1`` on error." +msgstr "" + +msgid "" +"Mark dictionary *dict* as no longer watched. The callback granted " +"*watcher_id* by :c:func:`PyDict_AddWatcher` will no longer be called when " +"*dict* is modified or deallocated. The dict must previously have been " +"watched by this watcher. Return ``0`` on success or ``-1`` on error." +msgstr "" + +msgid "" +"Enumeration of possible dictionary watcher events: ``PyDict_EVENT_ADDED``, " +"``PyDict_EVENT_MODIFIED``, ``PyDict_EVENT_DELETED``, " +"``PyDict_EVENT_CLONED``, ``PyDict_EVENT_CLEARED``, or " +"``PyDict_EVENT_DEALLOCATED``." +msgstr "" + +msgid "Type of a dict watcher callback function." +msgstr "" + +msgid "" +"If *event* is ``PyDict_EVENT_CLEARED`` or ``PyDict_EVENT_DEALLOCATED``, both " +"*key* and *new_value* will be ``NULL``. If *event* is ``PyDict_EVENT_ADDED`` " +"or ``PyDict_EVENT_MODIFIED``, *new_value* will be the new value for *key*. " +"If *event* is ``PyDict_EVENT_DELETED``, *key* is being deleted from the " +"dictionary and *new_value* will be ``NULL``." +msgstr "" + +msgid "" +"``PyDict_EVENT_CLONED`` occurs when *dict* was previously empty and another " +"dict is merged into it. To maintain efficiency of this operation, per-key " +"``PyDict_EVENT_ADDED`` events are not issued in this case; instead a single " +"``PyDict_EVENT_CLONED`` is issued, and *key* will be the source dictionary." +msgstr "" + +msgid "" +"The callback may inspect but must not modify *dict*; doing so could have " +"unpredictable effects, including infinite recursion. Do not trigger Python " +"code execution in the callback, as it could modify the dict as a side effect." +msgstr "" + +msgid "" +"If *event* is ``PyDict_EVENT_DEALLOCATED``, taking a new reference in the " +"callback to the about-to-be-destroyed dictionary will resurrect it and " +"prevent it from being freed at this time. When the resurrected object is " +"destroyed later, any watcher callbacks active at that time will be called " +"again." +msgstr "" + +msgid "" +"Callbacks occur before the notified modification to *dict* takes place, so " +"the prior state of *dict* can be inspected." +msgstr "" + +msgid "" +"If the callback sets an exception, it must return ``-1``; this exception " +"will be printed as an unraisable exception using :c:func:" +"`PyErr_WriteUnraisable`. Otherwise it should return ``0``." +msgstr "" + +msgid "" +"There may already be a pending exception set on entry to the callback. In " +"this case, the callback should return ``0`` with the same exception still " +"set. This means the callback may not call any other API that can set an " +"exception unless it saves and clears the exception state first, and restores " +"it before returning." +msgstr "" + +msgid "object" +msgstr "об'єкт" + +msgid "dictionary" +msgstr "словник" + +msgid "built-in function" +msgstr "вбудована функція" + +msgid "len" +msgstr "" diff --git a/c-api/exceptions.po b/c-api/exceptions.po new file mode 100644 index 000000000..253404afe --- /dev/null +++ b/c-api/exceptions.po @@ -0,0 +1,1824 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2023 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:48+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2023\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Exception Handling" +msgstr "Обробка винятків" + +msgid "" +"The functions described in this chapter will let you handle and raise Python " +"exceptions. It is important to understand some of the basics of Python " +"exception handling. It works somewhat like the POSIX :c:data:`errno` " +"variable: there is a global indicator (per thread) of the last error that " +"occurred. Most C API functions don't clear this on success, but will set it " +"to indicate the cause of the error on failure. Most C API functions also " +"return an error indicator, usually ``NULL`` if they are supposed to return a " +"pointer, or ``-1`` if they return an integer (exception: the ``PyArg_*`` " +"functions return ``1`` for success and ``0`` for failure)." +msgstr "" + +msgid "" +"Concretely, the error indicator consists of three object pointers: the " +"exception's type, the exception's value, and the traceback object. Any of " +"those pointers can be ``NULL`` if non-set (although some combinations are " +"forbidden, for example you can't have a non-``NULL`` traceback if the " +"exception type is ``NULL``)." +msgstr "" +"Зокрема, індикатор помилки складається з трьох покажчиків на об’єкти: тип " +"винятку, значення винятку та об’єкт трасування. Будь-який із цих покажчиків " +"може бути ``NULL``, якщо не встановлено (хоча деякі комбінації заборонені, " +"наприклад, ви не можете мати не ``NULL`` трасування, якщо тип винятку " +"``NULL``)." + +msgid "" +"When a function must fail because some function it called failed, it " +"generally doesn't set the error indicator; the function it called already " +"set it. It is responsible for either handling the error and clearing the " +"exception or returning after cleaning up any resources it holds (such as " +"object references or memory allocations); it should *not* continue normally " +"if it is not prepared to handle the error. If returning due to an error, it " +"is important to indicate to the caller that an error has been set. If the " +"error is not handled or carefully propagated, additional calls into the " +"Python/C API may not behave as intended and may fail in mysterious ways." +msgstr "" +"Коли функція повинна вийти з ладу через те, що якась викликана нею функція " +"вийшла з ладу, вона зазвичай не встановлює індикатор помилки; викликана ним " +"функція вже встановила його. Він відповідає або за обробку помилки та " +"очищення виняткової ситуації, або за повернення після очищення будь-яких " +"ресурсів, які він утримує (наприклад, посилання на об’єкти чи розподіл " +"пам’яті); він *не* повинен продовжуватися нормально, якщо він не готовий " +"обробити помилку. Якщо ви повертаєтеся через помилку, важливо вказати " +"абоненту, що була встановлена помилка. Якщо помилку не обробляти або " +"ретельно розповсюджувати, додаткові виклики API Python/C можуть не працювати " +"належним чином і можуть виникати загадкові збої." + +msgid "" +"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 "" + +msgid "Printing and clearing" +msgstr "Друк та розчистка" + +msgid "" +"Clear the error indicator. If the error indicator is not set, there is no " +"effect." +msgstr "" +"Очистіть індикатор помилки. Якщо індикатор помилки не встановлено, ефекту " +"немає." + +msgid "" +"Print a standard traceback to ``sys.stderr`` and clear the error indicator. " +"**Unless** the error is a ``SystemExit``, in that case no traceback is " +"printed and the Python process will exit with the error code specified by " +"the ``SystemExit`` instance." +msgstr "" +"Надрукуйте стандартне відстеження до ``sys.stderr`` і очистіть індикатор " +"помилки. **Якщо** помилка не є ``SystemExit``, у такому випадку трасування " +"не друкується, і процес Python завершить роботу з кодом помилки, указаним " +"екземпляром ``SystemExit``." + +msgid "" +"Call this function **only** when the error indicator is set. Otherwise it " +"will cause a fatal error!" +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." +msgstr "" + +msgid "The setting of :data:`sys.last_exc` was added." +msgstr "" + +msgid "Alias for ``PyErr_PrintEx(1)``." +msgstr "Псевдонім для ``PyErr_PrintEx(1)``." + +msgid "" +"Call :func:`sys.unraisablehook` using the current exception and *obj* " +"argument." +msgstr "" +"Викликайте :func:`sys.unraisablehook`, використовуючи поточний виняток і " +"аргумент *obj*." + +msgid "" +"This utility function prints a warning message to ``sys.stderr`` when an " +"exception has been set but it is impossible for the interpreter to actually " +"raise the exception. It is used, for example, when an exception occurs in " +"an :meth:`~object.__del__` method." +msgstr "" + +msgid "" +"The function is called with a single argument *obj* that identifies the " +"context in which the unraisable exception occurred. If possible, the repr of " +"*obj* will be printed in the warning message. If *obj* is ``NULL``, only the " +"traceback is printed." +msgstr "" + +msgid "An exception must be set when calling this function." +msgstr "При виклику цієї функції необхідно встановити виняток." + +msgid "Print a traceback. Print only traceback if *obj* is ``NULL``." +msgstr "" + +msgid "Use :func:`sys.unraisablehook`." +msgstr "" + +msgid "" +"Similar to :c:func:`PyErr_WriteUnraisable`, but the *format* and subsequent " +"parameters help format the warning message; they have the same meaning and " +"values as in :c:func:`PyUnicode_FromFormat`. ``PyErr_WriteUnraisable(obj)`` " +"is roughly equivalent to ``PyErr_FormatUnraisable(\"Exception ignored in: " +"%R\", obj)``. If *format* is ``NULL``, only the traceback is printed." +msgstr "" + +msgid "" +"Print the standard traceback display of ``exc`` to ``sys.stderr``, including " +"chained exceptions and notes." +msgstr "" + +msgid "Raising exceptions" +msgstr "Створення винятків" + +msgid "" +"These functions help you set the current thread's error indicator. For " +"convenience, some of these functions will always return a ``NULL`` pointer " +"for use in a ``return`` statement." +msgstr "" +"Ці функції допомагають встановити індикатор помилки поточного потоку. Для " +"зручності деякі з цих функцій завжди повертатимуть покажчик ``NULL`` для " +"використання в операторі ``return``." + +msgid "" +"This is the most common way to set the error indicator. The first argument " +"specifies the exception type; it is normally one of the standard exceptions, " +"e.g. :c:data:`PyExc_RuntimeError`. You need not create a new :term:`strong " +"reference` to it (e.g. with :c:func:`Py_INCREF`). The second argument is an " +"error message; it is decoded from ``'utf-8'``." +msgstr "" + +msgid "" +"This function is similar to :c:func:`PyErr_SetString` but lets you specify " +"an arbitrary Python object for the \"value\" of the exception." +msgstr "" +"Ця функція схожа на :c:func:`PyErr_SetString`, але дозволяє вказати " +"довільний об’єкт Python для \"значення\" винятку." + +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." +msgstr "" +"Ця функція встановлює індикатор помилки та повертає ``NULL``. *exception* " +"має бути класом винятків Python. *format* і наступні параметри допомагають " +"відформатувати повідомлення про помилку; вони мають те саме значення та " +"значення, що й у :c:func:`PyUnicode_FromFormat`. *format* — це рядок у " +"кодуванні ASCII." + +msgid "" +"Same as :c:func:`PyErr_Format`, but taking a :c:type:`va_list` argument " +"rather than a variable number of arguments." +msgstr "" +"Те саме, що :c:func:`PyErr_Format`, але приймає аргумент :c:type:`va_list`, " +"а не змінну кількість аргументів." + +msgid "This is a shorthand for ``PyErr_SetObject(type, Py_None)``." +msgstr "Це скорочення для ``PyErr_SetObject(type, Py_None)``." + +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 "" +"Це скорочення для ``PyErr_SetString(PyExc_TypeError, повідомлення)``, де " +"*повідомлення* вказує на те, що вбудовану операцію було викликано з " +"недопустимим аргументом. В основному він призначений для внутрішнього " +"використання." + +msgid "" +"This is a shorthand for ``PyErr_SetNone(PyExc_MemoryError)``; it returns " +"``NULL`` so an object allocation function can write ``return " +"PyErr_NoMemory();`` when it runs out of memory." +msgstr "" +"Це скорочення для ``PyErr_SetNone(PyExc_MemoryError)``; він повертає " +"``NULL``, тому функція розподілу об’єктів може написати ``return " +"PyErr_NoMemory();``, коли їй вичерпується пам’ять." + +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 "" + +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 "" + +msgid "" +"Similar to :c:func:`PyErr_SetFromErrnoWithFilenameObject`, but takes a " +"second filename object, for raising errors when a function that takes two " +"filenames fails." +msgstr "" +"Подібно до :c:func:`PyErr_SetFromErrnoWithFilenameObject`, але приймає " +"другий об’єкт імені файлу, щоб викликати помилки, коли функція, яка приймає " +"два імені файлу, виходить з ладу." + +msgid "" +"Similar to :c:func:`PyErr_SetFromErrnoWithFilenameObject`, but the filename " +"is given as a C string. *filename* is decoded from the :term:`filesystem " +"encoding and error handler`." +msgstr "" +"Подібно до :c:func:`PyErr_SetFromErrnoWithFilenameObject`, але ім’я файлу " +"подається як рядок C. *ім’я файлу* розшифровується з :term:`filesystem " +"encoding and error handler`." + +msgid "" +"This is a convenience function to raise :exc:`OSError`. If called with " +"*ierr* of ``0``, the error code returned by a call to :c:func:`!" +"GetLastError` is used instead. It calls the Win32 function :c:func:`!" +"FormatMessage` to retrieve the Windows description of error code given by " +"*ierr* or :c:func:`!GetLastError`, then it constructs a :exc:`OSError` " +"object with the :attr:`~OSError.winerror` attribute set to the error code, " +"the :attr:`~OSError.strerror` attribute set to the corresponding error " +"message (gotten from :c:func:`!FormatMessage`), and then calls " +"``PyErr_SetObject(PyExc_OSError, object)``. This function always returns " +"``NULL``." +msgstr "" + +msgid "Availability" +msgstr "" + +msgid "" +"Similar to :c:func:`PyErr_SetFromWindowsErr`, with an additional parameter " +"specifying the exception type to be raised." +msgstr "" +"Подібно до :c:func:`PyErr_SetFromWindowsErr`, з додатковим параметром, що " +"визначає тип винятку, який буде створено." + +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." +msgstr "" + +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 "" + +msgid "" +"Similar to :c:func:`PyErr_SetExcFromWindowsErrWithFilenameObject`, but " +"accepts a second filename object." +msgstr "" +"Подібно до :c:func:`PyErr_SetExcFromWindowsErrWithFilenameObject`, але " +"приймає другий об’єкт імені файлу." + +msgid "" +"Similar to :c:func:`PyErr_SetFromWindowsErrWithFilename`, with an additional " +"parameter specifying the exception type to be raised." +msgstr "" +"Подібно до :c:func:`PyErr_SetFromWindowsErrWithFilename`, з додатковим " +"параметром, що визначає тип винятку, який буде створено." + +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 "" +"Це зручна функція для виклику :exc:`ImportError`. *msg* буде встановлено як " +"рядок повідомлення винятку. *name* і *path*, обидва з яких можуть мати " +"значення ``NULL``, буде встановлено як відповідні атрибути ``name`` і " +"``path`` :exc:`ImportError`." + +msgid "" +"Much like :c:func:`PyErr_SetImportError` but this function allows for " +"specifying a subclass of :exc:`ImportError` to raise." +msgstr "" +"Дуже схоже на :c:func:`PyErr_SetImportError`, але ця функція дозволяє " +"вказати підклас :exc:`ImportError` для підвищення." + +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 "" +"Установіть інформацію про файл, рядок і зсув для поточного винятку. Якщо " +"поточний виняток не є :exc:`SyntaxError`, тоді він встановлює додаткові " +"атрибути, які змушують підсистему друку виключення вважати, що виняток є :" +"exc:`SyntaxError`." + +msgid "" +"Like :c:func:`PyErr_SyntaxLocationObject`, but *filename* is a byte string " +"decoded from the :term:`filesystem encoding and error handler`." +msgstr "" +"Подібно до :c:func:`PyErr_SyntaxLocationObject`, але *filename* — це рядок " +"байтів, декодований з :term:`filesystem encoding and error handler`." + +msgid "" +"Like :c:func:`PyErr_SyntaxLocationEx`, but the *col_offset* parameter is " +"omitted." +msgstr "" +"Як :c:func:`PyErr_SyntaxLocationEx`, але параметр *col_offset* опущено." + +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 "" +"Це скорочення для ``PyErr_SetString(PyExc_SystemError, повідомлення)``, де " +"*повідомлення* вказує на те, що внутрішня операція (наприклад, функція " +"Python/C API) була викликана з недопустимим аргументом. В основному він " +"призначений для внутрішнього використання." + +msgid "Issuing warnings" +msgstr "Винесення попереджень" + +msgid "" +"Use these functions to issue warnings from C code. They mirror similar " +"functions exported by the Python :mod:`warnings` module. They normally " +"print a warning message to *sys.stderr*; however, it is also possible that " +"the user has specified that warnings are to be turned into errors, and in " +"that case they will raise an exception. It is also possible that the " +"functions raise an exception because of a problem with the warning " +"machinery. The return value is ``0`` if no exception is raised, or ``-1`` if " +"an exception is raised. (It is not possible to determine whether a warning " +"message is actually printed, nor what the reason is for the exception; this " +"is intentional.) If an exception is raised, the caller should do its normal " +"exception handling (for example, :c:func:`Py_DECREF` owned references and " +"return an error value)." +msgstr "" +"Використовуйте ці функції, щоб видавати попередження з коду C. Вони " +"відображають аналогічні функції, експортовані модулем Python :mod:" +"`warnings`. Зазвичай вони друкують попередження на *sys.stderr*; однак також " +"можливо, що користувач вказав, що попередження потрібно перетворити на " +"помилки, і в такому випадку вони викличуть виняток. Також можливо, що " +"функції викликають виняток через проблему з механізмом попередження. " +"Повертається значення ``0``, якщо не викликається виняткова ситуація, або " +"``-1``, якщо виникає виняток. (Неможливо визначити, чи справді друкується " +"попереджувальне повідомлення, а також причину винятку; це навмисно.) Якщо " +"виникає виняток, абонент, що викликає, має виконати звичайну обробку " +"винятків (наприклад, :c:func:`Py_DECREF` належать посилання та повертають " +"значення помилки)." + +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." +msgstr "" +"Видавати попереджувальне повідомлення. Аргумент *category* є категорією " +"попередження (див. нижче) або ``NULL``; аргумент *message* — це рядок у " +"кодуванні UTF-8. *stack_level* — додатне число, яке дає кількість кадрів " +"стека; попередження буде видано з поточного рядка коду в цьому фреймі стека. " +"*Stack_level* 1 — це функція, яка викликає :c:func:`PyErr_WarnEx`, 2 — це " +"функція, яка стоїть вище, і так далі." + +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`." +msgstr "" +"Категорії попереджень мають бути підкласами :c:data:`PyExc_Warning`; :c:data:" +"`PyExc_Warning` є підкласом :c:data:`PyExc_Exception`; стандартна категорія " +"попередження: :c:data:`PyExc_RuntimeWarning`. Стандартні категорії " +"попереджень Python доступні як глобальні змінні, імена яких пронумеровані в :" +"ref:`standardwarningcategories`." + +msgid "" +"For information about warning control, see the documentation for the :mod:" +"`warnings` module and the :option:`-W` option in the command line " +"documentation. There is no C API for warning control." +msgstr "" +"Щоб отримати інформацію про керування попередженнями, перегляньте " +"документацію до модуля :mod:`warnings` і опції :option:`-W` у документації " +"командного рядка. Немає C API для керування попередженнями." + +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." +msgstr "" +"Видавати попереджувальне повідомлення з явним керуванням усіма атрибутами " +"попередження. Це проста обгортка функції Python :func:`warnings." +"warn_explicit`; дивіться там для отримання додаткової інформації. Для " +"аргументів *module* і *registry* можна встановити значення ``NULL``, щоб " +"отримати описаний там ефект за замовчуванням." + +msgid "" +"Similar to :c:func:`PyErr_WarnExplicitObject` except that *message* and " +"*module* are UTF-8 encoded strings, and *filename* is decoded from the :term:" +"`filesystem encoding and error handler`." +msgstr "" +"Подібно до :c:func:`PyErr_WarnExplicitObject`, за винятком того, що " +"*message* і *module* є рядками в кодуванні UTF-8, а *filename* декодується " +"з :term:`filesystem encoding and error handler`." + +msgid "" +"Function similar to :c:func:`PyErr_WarnEx`, but use :c:func:" +"`PyUnicode_FromFormat` to format the warning message. *format* is an ASCII-" +"encoded string." +msgstr "" +"Функція схожа на :c:func:`PyErr_WarnEx`, але використовуйте :c:func:" +"`PyUnicode_FromFormat` для форматування повідомлення попередження. *format* " +"— це рядок у кодуванні ASCII." + +msgid "" +"Function similar to :c:func:`PyErr_WarnFormat`, but *category* is :exc:" +"`ResourceWarning` and it passes *source* to :class:`!warnings." +"WarningMessage`." +msgstr "" + +msgid "Querying the error indicator" +msgstr "Запит індикатора помилки" + +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." +msgstr "" + +msgid "The caller must hold the GIL." +msgstr "Абонент повинен тримати GIL." + +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.)" +msgstr "" +"Не порівнюйте повернуте значення з певним винятком; замість цього " +"використовуйте :c:func:`PyErr_ExceptionMatches`, як показано нижче. " +"(Порівняння може бути легко невдалим, оскільки виняток може бути екземпляром " +"замість класу, у випадку винятку класу, або він може бути підкласом " +"очікуваного винятку.)" + +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 "" +"Еквівалент ``PyErr_GivenExceptionMatches(PyErr_Occurred(), exc)``. Це слід " +"викликати лише тоді, коли фактично встановлено виняток; порушення доступу до " +"пам'яті відбудеться, якщо не було викликано жодного винятку." + +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 " +"instance of a subclass. If *exc* is a tuple, all exception types in the " +"tuple (and recursively in subtuples) are searched for a match." +msgstr "" +"Повертає true, якщо *given* виняток відповідає типу винятку в *exc*. Якщо " +"*exc* є об’єктом класу, це також повертає true, коли *given* є екземпляром " +"підкласу. Якщо *exc* є кортежем, усі типи винятків у кортежі (і рекурсивно в " +"підкортежах) шукаються на відповідність." + +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 "" + +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 "" + +msgid "For example::" +msgstr "Наприклад::" + +msgid "" +"{\n" +" PyObject *exc = PyErr_GetRaisedException();\n" +"\n" +" /* ... code that might produce other errors ... */\n" +"\n" +" PyErr_SetRaisedException(exc);\n" +"}" +msgstr "" + +msgid "" +":c:func:`PyErr_GetHandledException`, to save the exception currently being " +"handled." +msgstr "" + +msgid "" +"Set *exc* as the exception currently being raised, clearing the existing " +"exception if one is set." +msgstr "" + +msgid "This call steals a reference to *exc*, which must be a valid exception." +msgstr "" + +msgid "Use :c:func:`PyErr_GetRaisedException` instead." +msgstr "" + +msgid "" +"Retrieve the error indicator into three variables whose addresses are " +"passed. If the error indicator is not set, set all three variables to " +"``NULL``. If it is set, it will be cleared and you own a reference to each " +"object retrieved. The value and traceback object may be ``NULL`` even when " +"the type object is not." +msgstr "" +"Отримати індикатор помилки в трьох змінних, адреси яких передано. Якщо " +"індикатор помилки не встановлено, установіть для всіх трьох змінних значення " +"``NULL``. Якщо його встановлено, його буде очищено, і ви матимете посилання " +"на кожен отриманий об’єкт. Значення та об’єкт трасування можуть бути " +"``NULL``, навіть якщо об’єкт типу не є таким." + +msgid "" +"This function is normally only used by legacy code that needs to catch " +"exceptions or save and restore the error indicator temporarily." +msgstr "" + +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 "" + +msgid "Use :c:func:`PyErr_SetRaisedException` instead." +msgstr "" + +msgid "" +"Set the error indicator from the three objects, *type*, *value*, and " +"*traceback*, clearing the existing exception if one is set. If the objects " +"are ``NULL``, the error indicator is cleared. Do not pass a ``NULL`` type " +"and non-``NULL`` value or traceback. The exception type should be a class. " +"Do not pass an invalid exception type or value. (Violating these rules will " +"cause subtle problems later.) This call takes away a reference to each " +"object: you must own a reference to each object before the call and after " +"the call you no longer own these references. (If you don't understand this, " +"don't use this function. I warned you.)" +msgstr "" + +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 "" + +msgid "" +"Use :c:func:`PyErr_GetRaisedException` instead, to avoid any possible de-" +"normalization." +msgstr "" + +msgid "" +"Under certain circumstances, the values returned by :c:func:`PyErr_Fetch` " +"below can be \"unnormalized\", meaning that ``*exc`` is a class object but " +"``*val`` is not an instance of the same class. This function can be used " +"to instantiate the class in that case. If the values are already " +"normalized, nothing happens. The delayed normalization is implemented to " +"improve performance." +msgstr "" +"За певних обставин значення, які повертає :c:func:`PyErr_Fetch` нижче, " +"можуть бути \"ненормалізованими\", тобто ``*exc`` є об’єктом класу, але " +"``*val`` не є екземпляром того самого класу . У цьому випадку цю функцію " +"можна використовувати для створення екземпляра класу. Якщо значення вже " +"нормалізовані, нічого не відбувається. Відкладену нормалізацію реалізовано " +"для покращення продуктивності." + +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 "" + +msgid "" +"if (tb != NULL) {\n" +" PyException_SetTraceback(val, tb);\n" +"}" +msgstr "" + +msgid "" +"Retrieve the active exception instance, as would be returned by :func:`sys." +"exception`. This refers to an exception that was *already caught*, not to an " +"exception that was freshly raised. Returns a new reference to the exception " +"or ``NULL``. Does not modify the interpreter's exception state." +msgstr "" + +msgid "" +"This function is not normally used by code that wants to handle exceptions. " +"Rather, it can be used when code needs to save and restore the exception " +"state temporarily. Use :c:func:`PyErr_SetHandledException` to restore or " +"clear the exception state." +msgstr "" + +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 "" + +msgid "" +"This function is not normally used by code that wants to handle exceptions. " +"Rather, it can be used when code needs to save and restore the exception " +"state temporarily. Use :c:func:`PyErr_GetHandledException` to get the " +"exception state." +msgstr "" + +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`." +msgstr "" + +msgid "" +"This function is not normally used by code that wants to handle exceptions. " +"Rather, it can be used when code needs to save and restore the exception " +"state temporarily. Use :c:func:`PyErr_SetExcInfo` to restore or clear the " +"exception state." +msgstr "" +"Ця функція зазвичай не використовується кодом, який хоче обробляти винятки. " +"Натомість його можна використовувати, коли коду потрібно тимчасово зберегти " +"та відновити винятковий стан. Використовуйте :c:func:`PyErr_SetExcInfo`, щоб " +"відновити або видалити винятковий стан." + +msgid "" +"Set the exception info, as known from ``sys.exc_info()``. This refers to an " +"exception that was *already caught*, not to an exception that was freshly " +"raised. This function steals the references of the arguments. To clear the " +"exception state, pass ``NULL`` for all three arguments. This function is " +"kept for backwards compatibility. Prefer using :c:func:" +"`PyErr_SetHandledException`." +msgstr "" + +msgid "" +"This function is not normally used by code that wants to handle exceptions. " +"Rather, it can be used when code needs to save and restore the exception " +"state temporarily. Use :c:func:`PyErr_GetExcInfo` to read the exception " +"state." +msgstr "" +"Ця функція зазвичай не використовується кодом, який хоче обробляти винятки. " +"Натомість його можна використовувати, коли коду потрібно тимчасово зберегти " +"та відновити винятковий стан. Використовуйте :c:func:`PyErr_GetExcInfo`, щоб " +"прочитати винятковий стан." + +msgid "" +"The ``type`` and ``traceback`` arguments are no longer used and can be NULL. " +"The interpreter now derives them from the exception instance (the ``value`` " +"argument). The function still steals references of all three arguments." +msgstr "" + +msgid "Signal Handling" +msgstr "Обробка сигналів" + +msgid "This function interacts with Python's signal handling." +msgstr "Ця функція взаємодіє з обробкою сигналів Python." + +msgid "" +"If the function is called from the main thread and under the main Python " +"interpreter, it checks whether a signal has been sent to the processes and " +"if so, invokes the corresponding signal handler. If the :mod:`signal` " +"module is supported, this can invoke a signal handler written in Python." +msgstr "" +"Якщо функція викликається з головного потоку та під основним інтерпретатором " +"Python, вона перевіряє, чи було надіслано сигнал до процесів, і якщо так, " +"викликає відповідний обробник сигналу. Якщо модуль :mod:`signal` " +"підтримується, це може викликати обробник сигналів, написаний на Python." + +msgid "" +"The function attempts to handle all pending signals, and then returns ``0``. " +"However, if a Python signal handler raises an exception, the error indicator " +"is set and the function returns ``-1`` immediately (such that other pending " +"signals may not have been handled yet: they will be on the next :c:func:" +"`PyErr_CheckSignals()` invocation)." +msgstr "" +"Функція намагається обробити всі незавершені сигнали, а потім повертає " +"``0``. Однак, якщо обробник сигналів Python викликає виняток, індикатор " +"помилки встановлюється, і функція негайно повертає ``-1`` (наприклад, інші " +"сигнали, що очікують на розгляд, ще не були оброблені: вони будуть на " +"наступному :c:func:`PyErr_CheckSignals()` виклик)." + +msgid "" +"If the function is called from a non-main thread, or under a non-main Python " +"interpreter, it does nothing and returns ``0``." +msgstr "" +"Якщо функція викликається з неосновного потоку або під неосновним " +"інтерпретатором Python, вона нічого не робить і повертає ``0``." + +msgid "" +"This function can be called by long-running C code that wants to be " +"interruptible by user requests (such as by pressing Ctrl-C)." +msgstr "" +"Ця функція може бути викликана довгостроковим кодом C, який хоче бути " +"перерваним запитами користувача (наприклад, натисканням Ctrl-C)." + +msgid "" +"The default Python signal handler for :c:macro:`!SIGINT` raises the :exc:" +"`KeyboardInterrupt` exception." +msgstr "" + +msgid "" +"Simulate the effect of a :c:macro:`!SIGINT` signal arriving. This is " +"equivalent to ``PyErr_SetInterruptEx(SIGINT)``." +msgstr "" + +msgid "" +"This function is async-signal-safe. It can be called without the :term:" +"`GIL` and from a C signal handler." +msgstr "" +"Ця функція безпечна для асинхронного сигналу. Його можна викликати без :term:" +"`GIL` і з обробника сигналів C." + +msgid "" +"Simulate the effect of a signal arriving. The next time :c:func:" +"`PyErr_CheckSignals` is called, the Python signal handler for the given " +"signal number will be called." +msgstr "" +"Імітація ефекту надходження сигналу. Під час наступного виклику :c:func:" +"`PyErr_CheckSignals` буде викликано обробник сигналу Python для заданого " +"номера сигналу." + +msgid "" +"This function can be called by C code that sets up its own signal handling " +"and wants Python signal handlers to be invoked as expected when an " +"interruption is requested (for example when the user presses Ctrl-C to " +"interrupt an operation)." +msgstr "" +"Цю функцію можна викликати за допомогою коду C, який налаштовує власну " +"обробку сигналів і хоче, щоб обробники сигналів Python викликалися належним " +"чином, коли надходить запит на переривання (наприклад, коли користувач " +"натискає Ctrl-C, щоб перервати операцію)." + +msgid "" +"If the given signal isn't handled by Python (it was set to :py:const:`signal." +"SIG_DFL` or :py:const:`signal.SIG_IGN`), it will be ignored." +msgstr "" + +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 "" +"Якщо *signum* знаходиться за межами дозволеного діапазону чисел сигналу, " +"повертається ``-1``. В іншому випадку повертається ``0``. Ця функція ніколи " +"не змінює індикатор помилки." + +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 "" +"Ця допоміжна функція вказує дескриптор файлу, до якого номер сигналу " +"записується як один байт кожного разу, коли надходить сигнал. *fd* має бути " +"неблокуючим. Він повертає попередній такий файловий дескриптор." + +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 " +"checking. *fd* should be a valid file descriptor. The function should only " +"be called from the main thread." +msgstr "" +"Значення ``-1`` вимикає функцію; це початковий стан. Це еквівалентно :func:" +"`signal.set_wakeup_fd` у Python, але без перевірки помилок. *fd* має бути " +"дійсним дескриптором файлу. Функцію слід викликати лише з основного потоку." + +msgid "On Windows, the function now also supports socket handles." +msgstr "У Windows функція тепер також підтримує ручки сокетів." + +msgid "Exception Classes" +msgstr "Виняткові класи" + +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 " +"``module.classname``. The *base* and *dict* arguments are normally " +"``NULL``. This creates a class object derived from :exc:`Exception` " +"(accessible in C as :c:data:`PyExc_Exception`)." +msgstr "" +"Ця службова функція створює та повертає новий клас винятків. Аргумент *name* " +"має бути назвою нового винятку, рядком C у формі ``module.classname``. " +"Аргументи *base* і *dict* зазвичай мають значення ``NULL``. Це створює " +"об’єкт класу, похідний від :exc:`Exception` (доступний у C як :c:data:" +"`PyExc_Exception`)." + +msgid "" +"The :attr:`~type.__module__` attribute of the new class is set to the first " +"part (up to the last dot) of the *name* argument, and the class name is set " +"to the last part (after the last dot). The *base* argument can be used to " +"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 "" + +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:func:`PyErr_NewException`, за винятком того, що новому класу " +"винятків можна легко надати рядок документації: якщо *doc* не є ``NULL``, " +"він використовуватиметься як рядок документації для класу винятків." + +msgid "Exception Objects" +msgstr "Об’єкти винятків" + +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 "" + +msgid "" +"Set the traceback associated with the exception to *tb*. Use ``Py_None`` to " +"clear it." +msgstr "" +"Установіть для трасування, пов’язаного з винятком, значення *tb*. " +"Використовуйте ``Py_None``, щоб очистити його." + +msgid "" +"Return the context (another exception instance during whose handling *ex* " +"was raised) associated with the exception as a new reference, as accessible " +"from Python through the :attr:`~BaseException.__context__` attribute. If " +"there is no context associated, this returns ``NULL``." +msgstr "" + +msgid "" +"Set the context associated with the exception to *ctx*. Use ``NULL`` to " +"clear it. There is no type check to make sure that *ctx* is an exception " +"instance. This steals a reference to *ctx*." +msgstr "" +"Установіть для контексту, пов’язаного з винятком, значення *ctx*. Щоб " +"очистити його, використовуйте ``NULL``. Немає перевірки типу, щоб " +"переконатися, що *ctx* є винятком. Це краде посилання на *ctx*." + +msgid "" +"Return the cause (either an exception instance, or ``None``, set by " +"``raise ... from ...``) associated with the exception as a new reference, as " +"accessible from Python through the :attr:`~BaseException.__cause__` " +"attribute." +msgstr "" + +msgid "" +"Set the cause associated with the exception to *cause*. Use ``NULL`` to " +"clear it. There is no type check to make sure that *cause* is either an " +"exception instance or ``None``. This steals a reference to *cause*." +msgstr "" + +msgid "" +"The :attr:`~BaseException.__suppress_context__` attribute is implicitly set " +"to ``True`` by this function." +msgstr "" + +msgid "Return :attr:`~BaseException.args` of exception *ex*." +msgstr "" + +msgid "Set :attr:`~BaseException.args` of exception *ex* to *args*." +msgstr "" + +msgid "" +"Implement part of the interpreter's implementation of :keyword:`!except*`. " +"*orig* is the original exception that was caught, and *excs* is the list of " +"the exceptions that need to be raised. This list contains the unhandled part " +"of *orig*, if any, as well as the exceptions that were raised from the :" +"keyword:`!except*` clauses (so they have a different traceback from *orig*) " +"and those that were reraised (and have the same traceback as *orig*). Return " +"the :exc:`ExceptionGroup` that needs to be reraised in the end, or ``None`` " +"if there is nothing to reraise." +msgstr "" + +msgid "Unicode Exception Objects" +msgstr "Виняткові об’єкти Unicode" + +msgid "" +"The following functions are used to create and modify Unicode exceptions " +"from C." +msgstr "" +"Наступні функції використовуються для створення та зміни винятків Unicode з " +"C." + +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 "" +"Створіть об’єкт :class:`UnicodeDecodeError` з атрибутами *encoding*, " +"*object*, *length*, *start*, *end* і *reason*. *encoding* і *reason* є " +"рядками в кодуванні UTF-8." + +msgid "Return the *encoding* attribute of the given exception object." +msgstr "Повертає атрибут *encoding* даного об’єкта винятку." + +msgid "Return the *object* attribute of the given exception object." +msgstr "Повертає атрибут *object* даного об’єкта винятку." + +msgid "" +"Get the *start* attribute of the given exception object and place it into " +"*\\*start*. *start* must not be ``NULL``. Return ``0`` on success, ``-1`` " +"on failure." +msgstr "" +"Отримайте атрибут *start* даного об’єкта винятку та помістіть його в " +"*\\*start*. *початок* не має бути ``NULL``. Повертає ``0`` в разі успіху, " +"``-1`` у випадку невдачі." + +msgid "" +"Set the *start* attribute of the given exception object to *start*. Return " +"``0`` on success, ``-1`` on failure." +msgstr "" +"Установіть для атрибута *start* даного об’єкта винятку значення *start*. " +"Повертає ``0`` в разі успіху, ``-1`` у випадку невдачі." + +msgid "" +"Get the *end* attribute of the given exception object and place it into " +"*\\*end*. *end* must not be ``NULL``. Return ``0`` on success, ``-1`` on " +"failure." +msgstr "" +"Отримайте атрибут *end* даного об’єкта винятку та помістіть його в *\\*end*. " +"*end* не має бути ``NULL``. Повертає ``0`` в разі успіху, ``-1`` у випадку " +"невдачі." + +msgid "" +"Set the *end* attribute of the given exception object to *end*. Return " +"``0`` on success, ``-1`` on failure." +msgstr "" +"Установіть для атрибута *end* даного об’єкта винятку значення *end*. " +"Повертає ``0`` в разі успіху, ``-1`` у випадку невдачі." + +msgid "Return the *reason* attribute of the given exception object." +msgstr "Повертає атрибут *reason* даного об’єкта винятку." + +msgid "" +"Set the *reason* attribute of the given exception object to *reason*. " +"Return ``0`` on success, ``-1`` on failure." +msgstr "" +"Установіть для атрибута *reason* даного об’єкта винятку значення *reason*. " +"Повертає ``0`` в разі успіху, ``-1`` у випадку невдачі." + +msgid "Recursion Control" +msgstr "Контроль рекурсії" + +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 " +"recursive code does not necessarily invoke Python code (which tracks its " +"recursion depth automatically). They are also not needed for *tp_call* " +"implementations because the :ref:`call protocol ` takes care of " +"recursion handling." +msgstr "" +"Ці дві функції забезпечують спосіб виконання безпечних рекурсивних викликів " +"на рівні C, як в ядрі, так і в модулях розширення. Вони потрібні, якщо " +"рекурсивний код не обов’язково викликає код Python (який автоматично " +"відстежує глибину рекурсії). Вони також не потрібні для реалізації " +"*tp_call*, оскільки :ref:`протокол виклику ` піклується про обробку " +"рекурсії." + +msgid "Marks a point where a recursive C-level call is about to be performed." +msgstr "Позначає точку, де має бути виконано рекурсивний виклик C-рівня." + +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 "" + +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 "" +"Потім функція перевіряє, чи досягнуто обмеження рекурсії. Якщо це так, " +"встановлюється :exc:`RecursionError` і повертається ненульове значення. В " +"іншому випадку повертається нуль." + +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 "" +"*де* має бути рядок у кодуванні UTF-8, такий як ``\" у перевірці " +"екземпляра\"``, який об’єднується з повідомленням :exc:`RecursionError`, " +"спричиненим обмеженням глибини рекурсії." + +msgid "" +"This function is now also available in the :ref:`limited API `." +msgstr "" + +msgid "" +"Ends a :c:func:`Py_EnterRecursiveCall`. Must be called once for each " +"*successful* invocation of :c:func:`Py_EnterRecursiveCall`." +msgstr "" +"Завершує :c:func:`Py_EnterRecursiveCall`. Потрібно викликати один раз для " +"кожного *успішного* виклику :c:func:`Py_EnterRecursiveCall`." + +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`." +msgstr "" +"Правильна реалізація :c:member:`~PyTypeObject.tp_repr` для типів контейнерів " +"вимагає спеціальної обробки рекурсії. Окрім захисту стека, :c:member:" +"`~PyTypeObject.tp_repr` також має відстежувати об’єкти, щоб запобігти " +"циклам. Наступні дві функції полегшують цю функцію. По суті, це C " +"еквівалент :func:`reprlib.recursive_repr`." + +msgid "" +"Called at the beginning of the :c:member:`~PyTypeObject.tp_repr` " +"implementation to detect cycles." +msgstr "" +"Викликається на початку реалізації :c:member:`~PyTypeObject.tp_repr` для " +"виявлення циклів." + +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 ``[...]``." +msgstr "" +"Якщо об’єкт уже оброблено, функція повертає додатне ціле число. У цьому " +"випадку реалізація :c:member:`~PyTypeObject.tp_repr` має повертати рядковий " +"об’єкт, що вказує на цикл. Як приклад, об’єкти :class:`dict` повертають " +"``{...}``, а об’єкти :class:`list` повертають ``[...]``." + +msgid "" +"The function will return a negative integer if the recursion limit is " +"reached. In that case the :c:member:`~PyTypeObject.tp_repr` implementation " +"should typically return ``NULL``." +msgstr "" +"Функція поверне від’ємне ціле число, якщо досягнуто обмеження рекурсії. У " +"цьому випадку реалізація :c:member:`~PyTypeObject.tp_repr` зазвичай повинна " +"повертати ``NULL``." + +msgid "" +"Otherwise, the function returns zero and the :c:member:`~PyTypeObject." +"tp_repr` implementation can continue normally." +msgstr "" +"В іншому випадку функція повертає нуль, і реалізація :c:member:" +"`~PyTypeObject.tp_repr` може продовжуватися нормально." + +msgid "" +"Ends a :c:func:`Py_ReprEnter`. Must be called once for each invocation of :" +"c:func:`Py_ReprEnter` that returns zero." +msgstr "" +"Завершує :c:func:`Py_ReprEnter`. Потрібно викликати один раз для кожного " +"виклику :c:func:`Py_ReprEnter`, який повертає нуль." + +msgid "Standard Exceptions" +msgstr "Стандартні винятки" + +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:" +msgstr "" + +msgid "C Name" +msgstr "C Назва" + +msgid "Python Name" +msgstr "Назва Python" + +msgid "Notes" +msgstr "Примітки" + +msgid ":c:data:`PyExc_BaseException`" +msgstr ":c:data:`PyExc_BaseException`" + +msgid ":exc:`BaseException`" +msgstr ":exc:`BaseException`" + +msgid "[1]_" +msgstr "[1]_" + +msgid ":c:data:`PyExc_Exception`" +msgstr ":c:data:`PyExc_Exception`" + +msgid ":exc:`Exception`" +msgstr ":exc:`Exception`" + +msgid ":c:data:`PyExc_ArithmeticError`" +msgstr ":c:data:`PyExc_ArithmeticError`" + +msgid ":exc:`ArithmeticError`" +msgstr ":exc:`ArithmeticError`" + +msgid ":c:data:`PyExc_AssertionError`" +msgstr ":c:data:`PyExc_AssertionError`" + +msgid ":exc:`AssertionError`" +msgstr ":exc:`AssertionError`" + +msgid ":c:data:`PyExc_AttributeError`" +msgstr ":c:data:`PyExc_AttributeError`" + +msgid ":exc:`AttributeError`" +msgstr ":exc:`AttributeError`" + +msgid ":c:data:`PyExc_BlockingIOError`" +msgstr ":c:data:`PyExc_BlockingIOError`" + +msgid ":exc:`BlockingIOError`" +msgstr ":exc:`BlockingIOError`" + +msgid ":c:data:`PyExc_BrokenPipeError`" +msgstr ":c:data:`PyExc_BrokenPipeError`" + +msgid ":exc:`BrokenPipeError`" +msgstr ":exc:`Помилка BrokenPipeError`" + +msgid ":c:data:`PyExc_BufferError`" +msgstr ":c:data:`PyExc_BufferError`" + +msgid ":exc:`BufferError`" +msgstr ":exc:`BufferError`" + +msgid ":c:data:`PyExc_ChildProcessError`" +msgstr ":c:data:`PyExc_ChildProcessError`" + +msgid ":exc:`ChildProcessError`" +msgstr ":exc:`ChildProcessError`" + +msgid ":c:data:`PyExc_ConnectionAbortedError`" +msgstr ":c:data:`PyExc_ConnectionAbortedError`" + +msgid ":exc:`ConnectionAbortedError`" +msgstr ":exc:`ConnectionAbortedError`" + +msgid ":c:data:`PyExc_ConnectionError`" +msgstr ":c:data:`PyExc_ConnectionError`" + +msgid ":exc:`ConnectionError`" +msgstr ":exc:`ConnectionError`" + +msgid ":c:data:`PyExc_ConnectionRefusedError`" +msgstr ":c:data:`PyExc_ConnectionRefusedError`" + +msgid ":exc:`ConnectionRefusedError`" +msgstr ":exc:`ConnectionRefusedError`" + +msgid ":c:data:`PyExc_ConnectionResetError`" +msgstr ":c:data:`PyExc_ConnectionResetError`" + +msgid ":exc:`ConnectionResetError`" +msgstr ":exc:`ConnectionResetError`" + +msgid ":c:data:`PyExc_EOFError`" +msgstr ":c:data:`PyExc_EOFError`" + +msgid ":exc:`EOFError`" +msgstr ":exc:`EOFError`" + +msgid ":c:data:`PyExc_FileExistsError`" +msgstr ":c:data:`PyExc_FileExistsError`" + +msgid ":exc:`FileExistsError`" +msgstr ":exc:`FileExistsError`" + +msgid ":c:data:`PyExc_FileNotFoundError`" +msgstr ":c:data:`PyExc_FileNotFoundError`" + +msgid ":exc:`FileNotFoundError`" +msgstr ":exc:`FileNotFoundError`" + +msgid ":c:data:`PyExc_FloatingPointError`" +msgstr ":c:data:`PyExc_FloatingPointError`" + +msgid ":exc:`FloatingPointError`" +msgstr ":exc:`FloatingPointError`" + +msgid ":c:data:`PyExc_GeneratorExit`" +msgstr ":c:data:`PyExc_GeneratorExit`" + +msgid ":exc:`GeneratorExit`" +msgstr ":exc:`GeneratorExit`" + +msgid ":c:data:`PyExc_ImportError`" +msgstr ":c:data:`PyExc_ImportError`" + +msgid ":exc:`ImportError`" +msgstr ":exc:`ImportError`" + +msgid ":c:data:`PyExc_IndentationError`" +msgstr ":c:data:`PyExc_IndentationError`" + +msgid ":exc:`IndentationError`" +msgstr ":exc:`IndentationError`" + +msgid ":c:data:`PyExc_IndexError`" +msgstr ":c:data:`PyExc_IndexError`" + +msgid ":exc:`IndexError`" +msgstr ":exc:`IndexError`" + +msgid ":c:data:`PyExc_InterruptedError`" +msgstr ":c:data:`PyExc_InterruptedError`" + +msgid ":exc:`InterruptedError`" +msgstr ":exc:`InterruptedError`" + +msgid ":c:data:`PyExc_IsADirectoryError`" +msgstr ":c:data:`PyExc_IsADirectoryError`" + +msgid ":exc:`IsADirectoryError`" +msgstr ":exc:`IsADirectoryError`" + +msgid ":c:data:`PyExc_KeyError`" +msgstr ":c:data:`PyExc_KeyError`" + +msgid ":exc:`KeyError`" +msgstr ":exc:`KeyError`" + +msgid ":c:data:`PyExc_KeyboardInterrupt`" +msgstr ":c:data:`PyExc_KeyboardInterrupt`" + +msgid ":exc:`KeyboardInterrupt`" +msgstr ":exc:`KeyboardInterrupt`" + +msgid ":c:data:`PyExc_LookupError`" +msgstr ":c:data:`PyExc_LookupError`" + +msgid ":exc:`LookupError`" +msgstr ":exc:`LookupError`" + +msgid ":c:data:`PyExc_MemoryError`" +msgstr ":c:data:`PyExc_MemoryError`" + +msgid ":exc:`MemoryError`" +msgstr ":exc:`помилка пам'яті`" + +msgid ":c:data:`PyExc_ModuleNotFoundError`" +msgstr ":c:data:`PyExc_ModuleNotFoundError`" + +msgid ":exc:`ModuleNotFoundError`" +msgstr ":exc:`ModuleNotFoundError`" + +msgid ":c:data:`PyExc_NameError`" +msgstr ":c:data:`PyExc_NameError`" + +msgid ":exc:`NameError`" +msgstr ":exc:`NameError`" + +msgid ":c:data:`PyExc_NotADirectoryError`" +msgstr ":c:data:`PyExc_NotADirectoryError`" + +msgid ":exc:`NotADirectoryError`" +msgstr ":exc:`NotADirectoryError`" + +msgid ":c:data:`PyExc_NotImplementedError`" +msgstr ":c:data:`PyExc_NotImplementedError`" + +msgid ":exc:`NotImplementedError`" +msgstr ":exc:`NotImplementedError`" + +msgid ":c:data:`PyExc_OSError`" +msgstr ":c:data:`PyExc_OSError`" + +msgid ":exc:`OSError`" +msgstr ":exc:`OSError`" + +msgid ":c:data:`PyExc_OverflowError`" +msgstr ":c:data:`PyExc_OverflowError`" + +msgid ":exc:`OverflowError`" +msgstr ":exc:`OverflowError`" + +msgid ":c:data:`PyExc_PermissionError`" +msgstr ":c:data:`PyExc_PermissionError`" + +msgid ":exc:`PermissionError`" +msgstr ":exc:`PermissionError`" + +msgid ":c:data:`PyExc_ProcessLookupError`" +msgstr ":c:data:`PyExc_ProcessLookupError`" + +msgid ":exc:`ProcessLookupError`" +msgstr ":exc:`ProcessLookupError`" + +msgid ":c:data:`PyExc_PythonFinalizationError`" +msgstr "" + +msgid ":exc:`PythonFinalizationError`" +msgstr "" + +msgid ":c:data:`PyExc_RecursionError`" +msgstr ":c:data:`PyExc_RecursionError`" + +msgid ":exc:`RecursionError`" +msgstr ":exc:`RecursionError`" + +msgid ":c:data:`PyExc_ReferenceError`" +msgstr ":c:data:`PyExc_ReferenceError`" + +msgid ":exc:`ReferenceError`" +msgstr ":exc:`ReferenceError`" + +msgid ":c:data:`PyExc_RuntimeError`" +msgstr ":c:data:`PyExc_RuntimeError`" + +msgid ":exc:`RuntimeError`" +msgstr ":exc:`RuntimeError`" + +msgid ":c:data:`PyExc_StopAsyncIteration`" +msgstr ":c:data:`PyExc_StopAsyncIteration`" + +msgid ":exc:`StopAsyncIteration`" +msgstr ":exc:`StopAsyncIteration`" + +msgid ":c:data:`PyExc_StopIteration`" +msgstr ":c:data:`PyExc_StopIteration`" + +msgid ":exc:`StopIteration`" +msgstr ":exc:`StopIteration`" + +msgid ":c:data:`PyExc_SyntaxError`" +msgstr ":c:data:`PyExc_SyntaxError`" + +msgid ":exc:`SyntaxError`" +msgstr ":exc:`SyntaxError`" + +msgid ":c:data:`PyExc_SystemError`" +msgstr ":c:data:`PyExc_SystemError`" + +msgid ":exc:`SystemError`" +msgstr ":exc:`SystemError`" + +msgid ":c:data:`PyExc_SystemExit`" +msgstr ":c:data:`PyExc_SystemExit`" + +msgid ":exc:`SystemExit`" +msgstr ":exc:`SystemError`" + +msgid ":c:data:`PyExc_TabError`" +msgstr ":c:data:`PyExc_TabError`" + +msgid ":exc:`TabError`" +msgstr ":exc:`TabError`" + +msgid ":c:data:`PyExc_TimeoutError`" +msgstr ":c:data:`PyExc_TimeoutError`" + +msgid ":exc:`TimeoutError`" +msgstr ":exc:`TimeoutError`" + +msgid ":c:data:`PyExc_TypeError`" +msgstr ":c:data:`PyExc_TypeError`" + +msgid ":exc:`TypeError`" +msgstr ":exc:`TypeError`" + +msgid ":c:data:`PyExc_UnboundLocalError`" +msgstr ":c:data:`PyExc_UnboundLocalError`" + +msgid ":exc:`UnboundLocalError`" +msgstr ":exc:`UnboundLocalError`" + +msgid ":c:data:`PyExc_UnicodeDecodeError`" +msgstr ":c:data:`PyExc_UnicodeDecodeError`" + +msgid ":exc:`UnicodeDecodeError`" +msgstr ":exc:`Помилка UnicodeDecodeError`" + +msgid ":c:data:`PyExc_UnicodeEncodeError`" +msgstr ":c:data:`PyExc_UnicodeEncodeError`" + +msgid ":exc:`UnicodeEncodeError`" +msgstr ":exc:`UnicodeEncodeError`" + +msgid ":c:data:`PyExc_UnicodeError`" +msgstr ":c:data:`PyExc_UnicodeError`" + +msgid ":exc:`UnicodeError`" +msgstr ":exc:`Помилка Unicode`" + +msgid ":c:data:`PyExc_UnicodeTranslateError`" +msgstr ":c:data:`PyExc_UnicodeTranslateError`" + +msgid ":exc:`UnicodeTranslateError`" +msgstr ":exc:`Помилка UnicodeTranslateError`" + +msgid ":c:data:`PyExc_ValueError`" +msgstr ":c:data:`PyExc_ValueError`" + +msgid ":exc:`ValueError`" +msgstr ":exc:`ValueError`" + +msgid ":c:data:`PyExc_ZeroDivisionError`" +msgstr ":c:data:`PyExc_ZeroDivisionError`" + +msgid ":exc:`ZeroDivisionError`" +msgstr ":exc:`Помилка ZeroDivisionError`" + +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` і :c:data:" +"`PyExc_TimeoutError` були представлені після :pep:`3151`." + +msgid ":c:data:`PyExc_StopAsyncIteration` and :c:data:`PyExc_RecursionError`." +msgstr ":c:data:`PyExc_StopAsyncIteration` і :c:data:`PyExc_RecursionError`." + +msgid ":c:data:`PyExc_ModuleNotFoundError`." +msgstr ":c:data:`PyExc_ModuleNotFoundError`." + +msgid "These are compatibility aliases to :c:data:`PyExc_OSError`:" +msgstr "Це псевдоніми сумісності з :c:data:`PyExc_OSError`:" + +msgid ":c:data:`!PyExc_EnvironmentError`" +msgstr "" + +msgid ":c:data:`!PyExc_IOError`" +msgstr "" + +msgid ":c:data:`!PyExc_WindowsError`" +msgstr "" + +msgid "[2]_" +msgstr "[2]_" + +msgid "These aliases used to be separate exception types." +msgstr "Раніше ці псевдоніми були окремими типами винятків." + +msgid "Notes:" +msgstr "Примітки:" + +msgid "This is a base class for other standard exceptions." +msgstr "Це базовий клас для інших стандартних винятків." + +msgid "" +"Only defined on Windows; protect code that uses this by testing that the " +"preprocessor macro ``MS_WINDOWS`` is defined." +msgstr "" +"Визначається лише в Windows; захистити код, який використовує це, " +"перевіривши, чи визначено макрос препроцесора ``MS_WINDOWS``." + +msgid "Standard Warning Categories" +msgstr "Стандартні категорії попереджень" + +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:" +msgstr "" + +msgid ":c:data:`PyExc_Warning`" +msgstr ":c:data:`PyExc_Warning`" + +msgid ":exc:`Warning`" +msgstr ":exc:`Warning`" + +msgid "[3]_" +msgstr "[3]_" + +msgid ":c:data:`PyExc_BytesWarning`" +msgstr ":c:data:`PyExc_BytesWarning`" + +msgid ":exc:`BytesWarning`" +msgstr ":exc:`BytesWarning`" + +msgid ":c:data:`PyExc_DeprecationWarning`" +msgstr ":c:data:`PyExc_DeprecationWarning`" + +msgid ":exc:`DeprecationWarning`" +msgstr ":exc:`DeprecationWarning`" + +msgid ":c:data:`PyExc_FutureWarning`" +msgstr ":c:data:`PyExc_FutureWarning`" + +msgid ":exc:`FutureWarning`" +msgstr ":exc:`FutureWarning`" + +msgid ":c:data:`PyExc_ImportWarning`" +msgstr ":c:data:`PyExc_ImportWarning`" + +msgid ":exc:`ImportWarning`" +msgstr ":exc:`ImportWarning`" + +msgid ":c:data:`PyExc_PendingDeprecationWarning`" +msgstr ":c:data:`PyExc_PendingDeprecationWarning`" + +msgid ":exc:`PendingDeprecationWarning`" +msgstr ":exc:`PendingDeprecationWarning`" + +msgid ":c:data:`PyExc_ResourceWarning`" +msgstr ":c:data:`PyExc_ResourceWarning`" + +msgid ":exc:`ResourceWarning`" +msgstr ":exc:`ResourceWarning`" + +msgid ":c:data:`PyExc_RuntimeWarning`" +msgstr ":c:data:`PyExc_RuntimeWarning`" + +msgid ":exc:`RuntimeWarning`" +msgstr ":exc:`RuntimeWarning`" + +msgid ":c:data:`PyExc_SyntaxWarning`" +msgstr ":c:data:`PyExc_SyntaxWarning`" + +msgid ":exc:`SyntaxWarning`" +msgstr ":exc:`SyntaxWarning`" + +msgid ":c:data:`PyExc_UnicodeWarning`" +msgstr ":c:data:`PyExc_UnicodeWarning`" + +msgid ":exc:`UnicodeWarning`" +msgstr ":exc:`Попередження Unicode`" + +msgid ":c:data:`PyExc_UserWarning`" +msgstr ":c:data:`PyExc_UserWarning`" + +msgid ":exc:`UserWarning`" +msgstr ":exc:`UserWarning`" + +msgid ":c:data:`PyExc_ResourceWarning`." +msgstr ":c:data:`PyExc_ResourceWarning`." + +msgid "This is a base class for other standard warning categories." +msgstr "Це базовий клас для інших стандартних категорій попереджень." + +msgid "strerror (C function)" +msgstr "" + +msgid "module" +msgstr "модуль" + +msgid "signal" +msgstr "сигнал" + +msgid "SIGINT (C macro)" +msgstr "" + +msgid "KeyboardInterrupt (built-in exception)" +msgstr "" + +msgid "PyExc_BaseException (C var)" +msgstr "" + +msgid "PyExc_Exception (C var)" +msgstr "" + +msgid "PyExc_ArithmeticError (C var)" +msgstr "" + +msgid "PyExc_AssertionError (C var)" +msgstr "" + +msgid "PyExc_AttributeError (C var)" +msgstr "" + +msgid "PyExc_BlockingIOError (C var)" +msgstr "" + +msgid "PyExc_BrokenPipeError (C var)" +msgstr "" + +msgid "PyExc_BufferError (C var)" +msgstr "" + +msgid "PyExc_ChildProcessError (C var)" +msgstr "" + +msgid "PyExc_ConnectionAbortedError (C var)" +msgstr "" + +msgid "PyExc_ConnectionError (C var)" +msgstr "" + +msgid "PyExc_ConnectionRefusedError (C var)" +msgstr "" + +msgid "PyExc_ConnectionResetError (C var)" +msgstr "" + +msgid "PyExc_EOFError (C var)" +msgstr "" + +msgid "PyExc_FileExistsError (C var)" +msgstr "" + +msgid "PyExc_FileNotFoundError (C var)" +msgstr "" + +msgid "PyExc_FloatingPointError (C var)" +msgstr "" + +msgid "PyExc_GeneratorExit (C var)" +msgstr "" + +msgid "PyExc_ImportError (C var)" +msgstr "" + +msgid "PyExc_IndentationError (C var)" +msgstr "" + +msgid "PyExc_IndexError (C var)" +msgstr "" + +msgid "PyExc_InterruptedError (C var)" +msgstr "" + +msgid "PyExc_IsADirectoryError (C var)" +msgstr "" + +msgid "PyExc_KeyError (C var)" +msgstr "" + +msgid "PyExc_KeyboardInterrupt (C var)" +msgstr "" + +msgid "PyExc_LookupError (C var)" +msgstr "" + +msgid "PyExc_MemoryError (C var)" +msgstr "" + +msgid "PyExc_ModuleNotFoundError (C var)" +msgstr "" + +msgid "PyExc_NameError (C var)" +msgstr "" + +msgid "PyExc_NotADirectoryError (C var)" +msgstr "" + +msgid "PyExc_NotImplementedError (C var)" +msgstr "" + +msgid "PyExc_OSError (C var)" +msgstr "" + +msgid "PyExc_OverflowError (C var)" +msgstr "" + +msgid "PyExc_PermissionError (C var)" +msgstr "" + +msgid "PyExc_ProcessLookupError (C var)" +msgstr "" + +msgid "PyExc_PythonFinalizationError (C var)" +msgstr "" + +msgid "PyExc_RecursionError (C var)" +msgstr "" + +msgid "PyExc_ReferenceError (C var)" +msgstr "" + +msgid "PyExc_RuntimeError (C var)" +msgstr "" + +msgid "PyExc_StopAsyncIteration (C var)" +msgstr "" + +msgid "PyExc_StopIteration (C var)" +msgstr "" + +msgid "PyExc_SyntaxError (C var)" +msgstr "" + +msgid "PyExc_SystemError (C var)" +msgstr "" + +msgid "PyExc_SystemExit (C var)" +msgstr "" + +msgid "PyExc_TabError (C var)" +msgstr "" + +msgid "PyExc_TimeoutError (C var)" +msgstr "" + +msgid "PyExc_TypeError (C var)" +msgstr "" + +msgid "PyExc_UnboundLocalError (C var)" +msgstr "" + +msgid "PyExc_UnicodeDecodeError (C var)" +msgstr "" + +msgid "PyExc_UnicodeEncodeError (C var)" +msgstr "" + +msgid "PyExc_UnicodeError (C var)" +msgstr "" + +msgid "PyExc_UnicodeTranslateError (C var)" +msgstr "" + +msgid "PyExc_ValueError (C var)" +msgstr "" + +msgid "PyExc_ZeroDivisionError (C var)" +msgstr "" + +msgid "PyExc_EnvironmentError (C var)" +msgstr "" + +msgid "PyExc_IOError (C var)" +msgstr "" + +msgid "PyExc_WindowsError (C var)" +msgstr "" + +msgid "PyExc_Warning (C var)" +msgstr "" + +msgid "PyExc_BytesWarning (C var)" +msgstr "" + +msgid "PyExc_DeprecationWarning (C var)" +msgstr "" + +msgid "PyExc_FutureWarning (C var)" +msgstr "" + +msgid "PyExc_ImportWarning (C var)" +msgstr "" + +msgid "PyExc_PendingDeprecationWarning (C var)" +msgstr "" + +msgid "PyExc_ResourceWarning (C var)" +msgstr "" + +msgid "PyExc_RuntimeWarning (C var)" +msgstr "" + +msgid "PyExc_SyntaxWarning (C var)" +msgstr "" + +msgid "PyExc_UnicodeWarning (C var)" +msgstr "" + +msgid "PyExc_UserWarning (C var)" +msgstr "" diff --git a/c-api/file.po b/c-api/file.po new file mode 100644 index 000000000..c19343a4d --- /dev/null +++ b/c-api/file.po @@ -0,0 +1,174 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:48+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "File Objects" +msgstr "Файлові об’єкти" + +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." +msgstr "" + +msgid "" +"Create a Python file object from the file descriptor of an already opened " +"file *fd*. The arguments *name*, *encoding*, *errors* and *newline* can be " +"``NULL`` to use the defaults; *buffering* can be *-1* to use the default. " +"*name* is ignored and kept for backward compatibility. Return ``NULL`` on " +"failure. For a more comprehensive description of the arguments, please refer " +"to the :func:`io.open` function documentation." +msgstr "" +"Створіть файловий об’єкт Python із файлового дескриптора вже відкритого " +"файлу *fd*. Аргументи *name*, *encoding*, *errors* і *newline* можуть бути " +"``NULL`` для використання типових значень; *buffering* може бути *-1*, щоб " +"використовувати значення за замовчуванням. *name* ігнорується та " +"зберігається для зворотної сумісності. Повертає ``NULL`` у разі помилки. Щоб " +"отримати докладніший опис аргументів, зверніться до документації функції :" +"func:`io.open`." + +msgid "" +"Since Python streams have their own buffering layer, mixing them with OS-" +"level file descriptors can produce various issues (such as unexpected " +"ordering of data)." +msgstr "" +"Оскільки потоки Python мають власний рівень буферизації, змішування їх із " +"файловими дескрипторами рівня ОС може спричинити різноманітні проблеми " +"(наприклад, несподіване впорядкування даних)." + +msgid "Ignore *name* attribute." +msgstr "Ігнорувати атрибут *name*." + +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." +msgstr "" + +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." +msgstr "" +"Еквівалентна ``p.readline([n])``, ця функція читає один рядок з об’єкта *p*. " +"*p* може бути файловим об’єктом або будь-яким об’єктом із методом :meth:`~io." +"IOBase.readline`. Якщо *n* дорівнює ``0``, читається рівно один рядок, " +"незалежно від довжини рядка. Якщо *n* більше ніж ``0``, з файлу буде " +"прочитано не більше ніж *n* байт; можна повернути часткову лінію. В обох " +"випадках повертається порожній рядок, якщо кінець файлу досягнуто негайно. " +"Однак якщо *n* менше ніж ``0``, один рядок читається незалежно від довжини, " +"але :exc:`EOFError` викликається, якщо кінець файлу досягнуто негайно." + +msgid "" +"Overrides the normal behavior of :func:`io.open_code` to pass its parameter " +"through the provided handler." +msgstr "" +"Перевизначає звичайну поведінку :func:`io.open_code` для передачі його " +"параметра через наданий обробник." + +msgid "The *handler* is a function of type:" +msgstr "" + +msgid "" +"Equivalent of :c:expr:`PyObject *(\\*)(PyObject *path, void *userData)`, " +"where *path* is guaranteed to be :c:type:`PyUnicodeObject`." +msgstr "" + +msgid "" +"The *userData* pointer is passed into the hook function. Since hook " +"functions may be called from different runtimes, this pointer should not " +"refer directly to Python state." +msgstr "" +"Покажчик *userData* передається в функцію-перехоплювач. Оскільки функції " +"підключення можуть викликатися з різних середовищ виконання, цей вказівник " +"не повинен посилатися безпосередньо на стан Python." + +msgid "" +"As this hook is intentionally used during import, avoid importing new " +"modules during its execution unless they are known to be frozen or available " +"in ``sys.modules``." +msgstr "" +"Оскільки цей хук навмисно використовується під час імпорту, уникайте імпорту " +"нових модулів під час його виконання, якщо тільки відомо, що вони заморожені " +"або доступні в ``sys.modules``." + +msgid "" +"Once a hook has been set, it cannot be removed or replaced, and later calls " +"to :c:func:`PyFile_SetOpenCodeHook` will fail. On failure, the function " +"returns -1 and sets an exception if the interpreter has been initialized." +msgstr "" +"Після того, як хук встановлено, його не можна видалити або замінити, а " +"пізніші виклики :c:func:`PyFile_SetOpenCodeHook` не вдадуться. У разі " +"помилки функція повертає -1 і встановлює виняток, якщо інтерпретатор був " +"ініціалізований." + +msgid "This function is safe to call before :c:func:`Py_Initialize`." +msgstr "Цю функцію безпечно викликати перед :c:func:`Py_Initialize`." + +msgid "" +"Raises an :ref:`auditing event ` ``setopencodehook`` with no " +"arguments." +msgstr "" +"Викликає :ref:`подію аудиту ` ``setopencodehook`` без аргументів." + +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." +msgstr "" + +msgid "" +"Write string *s* to file object *p*. Return ``0`` on success or ``-1`` on " +"failure; the appropriate exception will be set." +msgstr "" +"Записати рядок *s* до файлового об’єкта *p*. Повертає ``0`` у разі успіху " +"або ``-1`` у разі невдачі; буде встановлено відповідний виняток." + +msgid "object" +msgstr "об'єкт" + +msgid "file" +msgstr "" + +msgid "EOFError (built-in exception)" +msgstr "" + +msgid "Py_PRINT_RAW (C macro)" +msgstr "" diff --git a/c-api/float.po b/c-api/float.po new file mode 100644 index 000000000..17298695f --- /dev/null +++ b/c-api/float.po @@ -0,0 +1,201 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2023 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:48+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2023\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Floating-Point Objects" +msgstr "" + +msgid "" +"This subtype of :c:type:`PyObject` represents a Python floating-point object." +msgstr "" + +msgid "" +"This instance of :c:type:`PyTypeObject` represents the Python floating-point " +"type. This is the same object as :class:`float` in the Python layer." +msgstr "" + +msgid "" +"Return true if its argument is a :c:type:`PyFloatObject` or a subtype of :c:" +"type:`PyFloatObject`. This function always succeeds." +msgstr "" +"Повертає true, якщо його аргумент є :c:type:`PyFloatObject` або підтипом :c:" +"type:`PyFloatObject`. Ця функція завжди успішна." + +msgid "" +"Return true if its argument is a :c:type:`PyFloatObject`, but not a subtype " +"of :c:type:`PyFloatObject`. This function always succeeds." +msgstr "" +"Повертає true, якщо його аргумент є :c:type:`PyFloatObject`, але не " +"підтипом :c:type:`PyFloatObject`. Ця функція завжди успішна." + +msgid "" +"Create a :c:type:`PyFloatObject` object based on the string value in *str*, " +"or ``NULL`` on failure." +msgstr "" +"Створіть об’єкт :c:type:`PyFloatObject` на основі рядкового значення в *str* " +"або ``NULL`` у разі помилки." + +msgid "" +"Create a :c:type:`PyFloatObject` object from *v*, or ``NULL`` on failure." +msgstr "" +"Створіть об’єкт :c:type:`PyFloatObject` з *v* або ``NULL`` у разі помилки." + +msgid "" +"Return a C :c:expr:`double` representation of the contents of *pyfloat*. If " +"*pyfloat* is not a Python floating-point object but has a :meth:`~object." +"__float__` method, this method will first be called to convert *pyfloat* " +"into a float. If :meth:`!__float__` is not defined then it falls back to :" +"meth:`~object.__index__`. This method returns ``-1.0`` upon failure, so one " +"should call :c:func:`PyErr_Occurred` to check for errors." +msgstr "" + +msgid "Use :meth:`~object.__index__` if available." +msgstr "" + +msgid "" +"Return a C :c:expr:`double` representation of the contents of *pyfloat*, but " +"without error checking." +msgstr "" + +msgid "" +"Return a structseq instance which contains information about the precision, " +"minimum and maximum values of a float. It's a thin wrapper around the header " +"file :file:`float.h`." +msgstr "" +"Повертає екземпляр structseq, який містить інформацію про точність, " +"мінімальне та максимальне значення float. Це тонка обгортка навколо файлу " +"заголовка :file:`float.h`." + +msgid "" +"Return the maximum representable finite float *DBL_MAX* as C :c:expr:" +"`double`." +msgstr "" + +msgid "" +"Return the minimum normalized positive float *DBL_MIN* as C :c:expr:`double`." +msgstr "" + +msgid "Pack and Unpack functions" +msgstr "" + +msgid "" +"The pack and unpack functions provide an efficient platform-independent way " +"to store floating-point values as byte strings. The Pack routines produce a " +"bytes string from a C :c:expr:`double`, and the Unpack routines produce a C :" +"c:expr:`double` from such a bytes string. The suffix (2, 4 or 8) specifies " +"the number of bytes in the bytes string." +msgstr "" + +msgid "" +"On platforms that appear to use IEEE 754 formats these functions work by " +"copying bits. On other platforms, the 2-byte format is identical to the IEEE " +"754 binary16 half-precision format, the 4-byte format (32-bit) is identical " +"to the IEEE 754 binary32 single precision format, and the 8-byte format to " +"the IEEE 754 binary64 double precision format, although the packing of INFs " +"and NaNs (if such things exist on the platform) isn't handled correctly, and " +"attempting to unpack a bytes string containing an IEEE INF or NaN will raise " +"an exception." +msgstr "" + +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 "" + +msgid "Pack functions" +msgstr "" + +msgid "" +"The pack routines write 2, 4 or 8 bytes, starting at *p*. *le* is an :c:expr:" +"`int` argument, non-zero if you want the bytes string in little-endian " +"format (exponent last, at ``p+1``, ``p+3``, or ``p+6`` ``p+7``), zero if you " +"want big-endian format (exponent first, at *p*). The :c:macro:" +"`PY_BIG_ENDIAN` constant can be used to use the native endian: it is equal " +"to ``1`` on big endian processor, or ``0`` on little endian processor." +msgstr "" + +msgid "" +"Return value: ``0`` if all is OK, ``-1`` if error (and an exception is set, " +"most likely :exc:`OverflowError`)." +msgstr "" + +msgid "There are two problems on non-IEEE platforms:" +msgstr "" + +msgid "What this does is undefined if *x* is a NaN or infinity." +msgstr "" + +msgid "``-0.0`` and ``+0.0`` produce the same bytes string." +msgstr "" + +msgid "Pack a C double as the IEEE 754 binary16 half-precision format." +msgstr "" + +msgid "Pack a C double as the IEEE 754 binary32 single precision format." +msgstr "" + +msgid "Pack a C double as the IEEE 754 binary64 double precision format." +msgstr "" + +msgid "Unpack functions" +msgstr "" + +msgid "" +"The unpack routines read 2, 4 or 8 bytes, starting at *p*. *le* is an :c:" +"expr:`int` argument, non-zero if the bytes string is in little-endian format " +"(exponent last, at ``p+1``, ``p+3`` or ``p+6`` and ``p+7``), zero if big-" +"endian (exponent first, at *p*). The :c:macro:`PY_BIG_ENDIAN` constant can " +"be used to use the native endian: it is equal to ``1`` on big endian " +"processor, or ``0`` on little endian processor." +msgstr "" + +msgid "" +"Return value: The unpacked double. On error, this is ``-1.0`` and :c:func:" +"`PyErr_Occurred` is true (and an exception is set, most likely :exc:" +"`OverflowError`)." +msgstr "" + +msgid "" +"Note that on a non-IEEE platform this will refuse to unpack a bytes string " +"that represents a NaN or infinity." +msgstr "" + +msgid "Unpack the IEEE 754 binary16 half-precision format as a C double." +msgstr "" + +msgid "Unpack the IEEE 754 binary32 single precision format as a C double." +msgstr "" + +msgid "Unpack the IEEE 754 binary64 double precision format as a C double." +msgstr "" + +msgid "object" +msgstr "об'єкт" + +msgid "floating-point" +msgstr "" diff --git a/c-api/frame.po b/c-api/frame.po new file mode 100644 index 000000000..8e9c060c7 --- /dev/null +++ b/c-api/frame.po @@ -0,0 +1,177 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2022-11-05 19:48+0000\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Frame Objects" +msgstr "" + +msgid "The C structure of the objects used to describe frame objects." +msgstr "" + +msgid "There are no public members in this structure." +msgstr "" + +msgid "" +"The members of this structure were removed from the public C API. Refer to " +"the :ref:`What's New entry ` for details." +msgstr "" + +msgid "" +"The :c:func:`PyEval_GetFrame` and :c:func:`PyThreadState_GetFrame` functions " +"can be used to get a frame object." +msgstr "" + +msgid "See also :ref:`Reflection `." +msgstr "" + +msgid "" +"The type of frame objects. It is the same object as :py:class:`types." +"FrameType` in the Python layer." +msgstr "" + +msgid "" +"Previously, this type was only available after including ````." +msgstr "" + +msgid "Return non-zero if *obj* is a frame object." +msgstr "" + +msgid "" +"Previously, this function was only available after including ````." +msgstr "" + +msgid "Get the *frame* next outer frame." +msgstr "" + +msgid "" +"Return a :term:`strong reference`, or ``NULL`` if *frame* has no outer frame." +msgstr "" + +msgid "Get the *frame*'s :attr:`~frame.f_builtins` attribute." +msgstr "" + +msgid "Return a :term:`strong reference`. The result cannot be ``NULL``." +msgstr "" + +msgid "Get the *frame* code." +msgstr "" + +msgid "Return a :term:`strong reference`." +msgstr "" + +msgid "The result (frame code) cannot be ``NULL``." +msgstr "" + +msgid "" +"Get the generator, coroutine, or async generator that owns this frame, or " +"``NULL`` if this frame is not owned by a generator. Does not raise an " +"exception, even if the return value is ``NULL``." +msgstr "" + +msgid "Return a :term:`strong reference`, or ``NULL``." +msgstr "" + +msgid "Get the *frame*'s :attr:`~frame.f_globals` attribute." +msgstr "" + +msgid "Get the *frame*'s :attr:`~frame.f_lasti` attribute." +msgstr "" + +msgid "Returns -1 if ``frame.f_lasti`` is ``None``." +msgstr "" + +msgid "Get the variable *name* of *frame*." +msgstr "" + +msgid "Return a :term:`strong reference` to the variable value on success." +msgstr "" + +msgid "" +"Raise :exc:`NameError` and return ``NULL`` if the variable does not exist." +msgstr "" + +msgid "Raise an exception and return ``NULL`` on error." +msgstr "" + +msgid "*name* type must be a :class:`str`." +msgstr "" + +msgid "" +"Similar to :c:func:`PyFrame_GetVar`, but the variable name is a C string " +"encoded in UTF-8." +msgstr "" + +msgid "" +"Get the *frame*'s :attr:`~frame.f_locals` attribute. If the frame refers to " +"an :term:`optimized scope`, this returns a write-through proxy object that " +"allows modifying the locals. In all other cases (classes, modules, :func:" +"`exec`, :func:`eval`) it returns the mapping representing the frame locals " +"directly (as described for :func:`locals`)." +msgstr "" + +msgid "" +"As part of :pep:`667`, return an instance of :c:var:" +"`PyFrameLocalsProxy_Type`." +msgstr "" + +msgid "Return the line number that *frame* is currently executing." +msgstr "" + +msgid "Frame Locals Proxies" +msgstr "" + +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 "" + +msgid "See :pep:`667` for more information." +msgstr "" + +msgid "The type of frame :func:`locals` proxy objects." +msgstr "" + +msgid "Return non-zero if *obj* is a frame :func:`locals` proxy." +msgstr "" + +msgid "Internal Frames" +msgstr "" + +msgid "Unless using :pep:`523`, you will not need this." +msgstr "" + +msgid "The interpreter's internal frame representation." +msgstr "" + +msgid "Return a :term:`strong reference` to the code object for the frame." +msgstr "" + +msgid "Return the byte offset into the last executed instruction." +msgstr "" + +msgid "" +"Return the currently executing line number, or -1 if there is no line number." +msgstr "" diff --git a/c-api/function.po b/c-api/function.po new file mode 100644 index 000000000..6f439a6bb --- /dev/null +++ b/c-api/function.po @@ -0,0 +1,232 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2023 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:48+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2023\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Function Objects" +msgstr "Функціональні об’єкти" + +msgid "There are a few functions specific to Python functions." +msgstr "Є кілька функцій, специфічних для функцій Python." + +msgid "The C structure used for functions." +msgstr "Структура C, яка використовується для функцій." + +msgid "" +"This is an instance of :c:type:`PyTypeObject` and represents the Python " +"function type. It is exposed to Python programmers as ``types." +"FunctionType``." +msgstr "" +"Це екземпляр :c:type:`PyTypeObject` і представляє тип функції Python. Він " +"надається програмістам Python як ``types.FunctionType``." + +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." +msgstr "" +"Повертає true, якщо *o* є об’єктом функції (має тип :c:data:" +"`PyFunction_Type`). Параметр не має бути ``NULL``. Ця функція завжди успішна." + +msgid "" +"Return a new function object associated with the code object *code*. " +"*globals* must be a dictionary with the global variables accessible to the " +"function." +msgstr "" +"Повертає новий об’єкт функції, пов’язаний з об’єктом коду *code*. *globals* " +"має бути словником із глобальними змінними, доступними для функції." + +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." +msgstr "" + +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." +msgstr "" + +msgid "Return the code object associated with the function object *op*." +msgstr "Повертає об’єкт коду, пов’язаний з об’єктом функції *op*." + +msgid "Return the globals dictionary associated with the function object *op*." +msgstr "Повертає словник globals, пов’язаний з об’єктом функції *op*." + +msgid "" +"Return a :term:`borrowed reference` to the :attr:`~function.__module__` " +"attribute of the :ref:`function object ` *op*. It can be " +"*NULL*." +msgstr "" + +msgid "" +"This is normally a :class:`string ` containing the module name, but can " +"be set to any other object by Python code." +msgstr "" + +msgid "" +"Return the argument default values of the function object *op*. This can be " +"a tuple of arguments or ``NULL``." +msgstr "" +"Повертає стандартні значення аргументу об’єкта функції *op*. Це може бути " +"кортеж аргументів або ``NULL``." + +msgid "" +"Set the argument default values for the function object *op*. *defaults* " +"must be ``Py_None`` or a tuple." +msgstr "" +"Установіть значення аргументу за замовчуванням для об’єкта функції *op*. *за " +"замовчуванням* має бути ``Py_None`` або кортеж." + +msgid "Raises :exc:`SystemError` and returns ``-1`` on failure." +msgstr "Викликає :exc:`SystemError` і повертає ``-1`` у разі помилки." + +msgid "Set the vectorcall field of a given function object *func*." +msgstr "" + +msgid "" +"Warning: extensions using this API must preserve the behavior of the " +"unaltered (default) vectorcall function!" +msgstr "" + +msgid "" +"Return the closure associated with the function object *op*. This can be " +"``NULL`` or a tuple of cell objects." +msgstr "" +"Повертає закриття, пов’язане з об’єктом функції *op*. Це може бути ``NULL`` " +"або кортеж об’єктів клітинки." + +msgid "" +"Set the closure associated with the function object *op*. *closure* must be " +"``Py_None`` or a tuple of cell objects." +msgstr "" +"Установіть закриття, пов’язане з функціональним об’єктом *op*. *закриття* " +"має бути ``Py_None`` або кортеж об’єктів клітинки." + +msgid "" +"Return the annotations of the function object *op*. This can be a mutable " +"dictionary or ``NULL``." +msgstr "" +"Повертає анотації об’єкта функції *op*. Це може бути змінний словник або " +"``NULL``." + +msgid "" +"Set the annotations for the function object *op*. *annotations* must be a " +"dictionary or ``Py_None``." +msgstr "" +"Встановіть анотації для об’єкта функції *op*. *анотації* мають бути " +"словником або ``Py_None``." + +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 "" + +msgid "" +"Clear watcher identified by *watcher_id* previously returned from :c:func:" +"`PyFunction_AddWatcher` for the current interpreter. Return ``0`` on " +"success, or ``-1`` and set an exception on error (e.g. if the given " +"*watcher_id* was never registered.)" +msgstr "" + +msgid "Enumeration of possible function watcher events:" +msgstr "" + +msgid "``PyFunction_EVENT_CREATE``" +msgstr "" + +msgid "``PyFunction_EVENT_DESTROY``" +msgstr "" + +msgid "``PyFunction_EVENT_MODIFY_CODE``" +msgstr "" + +msgid "``PyFunction_EVENT_MODIFY_DEFAULTS``" +msgstr "" + +msgid "``PyFunction_EVENT_MODIFY_KWDEFAULTS``" +msgstr "" + +msgid "Type of a function watcher callback function." +msgstr "" + +msgid "" +"If *event* is ``PyFunction_EVENT_CREATE`` or ``PyFunction_EVENT_DESTROY`` " +"then *new_value* will be ``NULL``. Otherwise, *new_value* will hold a :term:" +"`borrowed reference` to the new value that is about to be stored in *func* " +"for the attribute that is being modified." +msgstr "" + +msgid "" +"The callback may inspect but must not modify *func*; doing so could have " +"unpredictable effects, including infinite recursion." +msgstr "" + +msgid "" +"If *event* is ``PyFunction_EVENT_CREATE``, then the callback is invoked " +"after `func` has been fully initialized. Otherwise, the callback is invoked " +"before the modification to *func* takes place, so the prior state of *func* " +"can be inspected. The runtime is permitted to optimize away the creation of " +"function objects when possible. In such cases no event will be emitted. " +"Although this creates the possibility of an observable difference of runtime " +"behavior depending on optimization decisions, it does not change the " +"semantics of the Python code being executed." +msgstr "" + +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 "" + +msgid "" +"If the callback sets an exception, it must return ``-1``; this exception " +"will be printed as an unraisable exception using :c:func:" +"`PyErr_WriteUnraisable`. Otherwise it should return ``0``." +msgstr "" + +msgid "" +"There may already be a pending exception set on entry to the callback. In " +"this case, the callback should return ``0`` with the same exception still " +"set. This means the callback may not call any other API that can set an " +"exception unless it saves and clears the exception state first, and restores " +"it before returning." +msgstr "" + +msgid "object" +msgstr "об'єкт" + +msgid "function" +msgstr "функція" + +msgid "MethodType (in module types)" +msgstr "" diff --git a/c-api/gcsupport.po b/c-api/gcsupport.po new file mode 100644 index 000000000..f82e4c4c6 --- /dev/null +++ b/c-api/gcsupport.po @@ -0,0 +1,399 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:48+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Supporting Cyclic Garbage Collection" +msgstr "Підтримка циклічного збирання сміття" + +msgid "" +"Python's support for detecting and collecting garbage which involves " +"circular references requires support from object types which are " +"\"containers\" for other objects which may also be containers. Types which " +"do not store references to other objects, or which only store references to " +"atomic types (such as numbers or strings), do not need to provide any " +"explicit support for garbage collection." +msgstr "" +"Підтримка Python для виявлення та збирання сміття, яке включає циклічні " +"посилання, вимагає підтримки типів об’єктів, які є \"контейнерами\" для " +"інших об’єктів, які також можуть бути контейнерами. Типи, які не зберігають " +"посилання на інші об’єкти, або які зберігають лише посилання на атомарні " +"типи (такі як числа або рядки), не потребують явної підтримки для збирання " +"сміття." + +msgid "" +"To create a container type, the :c:member:`~PyTypeObject.tp_flags` field of " +"the type object must include the :c:macro:`Py_TPFLAGS_HAVE_GC` and provide " +"an implementation of the :c:member:`~PyTypeObject.tp_traverse` handler. If " +"instances of the type are mutable, a :c:member:`~PyTypeObject.tp_clear` " +"implementation must also be provided." +msgstr "" + +msgid ":c:macro:`Py_TPFLAGS_HAVE_GC`" +msgstr "" + +msgid "" +"Objects with a type with this flag set must conform with the rules " +"documented here. For convenience these objects will be referred to as " +"container objects." +msgstr "" +"Об’єкти типу з цим прапорцем мають відповідати задокументованим тут " +"правилам. Для зручності ці об'єкти будуть називатися об'єктами-контейнерами." + +msgid "Constructors for container types must conform to two rules:" +msgstr "Конструктори для типів контейнерів повинні відповідати двом правилам:" + +msgid "" +"The memory for the object must be allocated using :c:macro:`PyObject_GC_New` " +"or :c:macro:`PyObject_GC_NewVar`." +msgstr "" + +msgid "" +"Once all the fields which may contain references to other containers are " +"initialized, it must call :c:func:`PyObject_GC_Track`." +msgstr "" +"Після ініціалізації всіх полів, які можуть містити посилання на інші " +"контейнери, він повинен викликати :c:func:`PyObject_GC_Track`." + +msgid "" +"Similarly, the deallocator for the object must conform to a similar pair of " +"rules:" +msgstr "" +"Подібним чином, делокатор для об’єкта має відповідати подібній парі правил:" + +msgid "" +"Before fields which refer to other containers are invalidated, :c:func:" +"`PyObject_GC_UnTrack` must be called." +msgstr "" +"Перш ніж поля, які посилаються на інші контейнери, стануть недійсними, " +"необхідно викликати :c:func:`PyObject_GC_UnTrack`." + +msgid "" +"The object's memory must be deallocated using :c:func:`PyObject_GC_Del`." +msgstr "" +"Пам’ять об’єкта має бути звільнено за допомогою :c:func:`PyObject_GC_Del`." + +msgid "" +"If a type adds the Py_TPFLAGS_HAVE_GC, then it *must* implement at least a :" +"c:member:`~PyTypeObject.tp_traverse` handler or explicitly use one from its " +"subclass or subclasses." +msgstr "" +"Якщо тип додає Py_TPFLAGS_HAVE_GC, тоді він *має* реалізувати принаймні " +"обробник :c:member:`~PyTypeObject.tp_traverse` або явно використовувати один " +"із свого підкласу або підкласів." + +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." +msgstr "" + +msgid "" +"Analogous to :c:macro:`PyObject_New` but for container objects with the :c:" +"macro:`Py_TPFLAGS_HAVE_GC` flag set." +msgstr "" + +msgid "" +"Analogous to :c:macro:`PyObject_NewVar` but for container objects with the :" +"c:macro:`Py_TPFLAGS_HAVE_GC` flag set." +msgstr "" + +msgid "" +"Analogous to :c:macro:`PyObject_GC_New` but allocates *extra_size* bytes at " +"the end of the object (at offset :c:member:`~PyTypeObject.tp_basicsize`). " +"The allocated memory is initialized to zeros, except for the :c:type:`Python " +"object header `." +msgstr "" + +msgid "" +"The extra data will be deallocated with the object, but otherwise it is not " +"managed by Python." +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." +msgstr "" + +msgid "" +"Resize an object allocated by :c:macro:`PyObject_NewVar`. Returns the " +"resized object of type ``TYPE*`` (refers to any C type) or ``NULL`` on " +"failure." +msgstr "" + +msgid "" +"*op* must be of type :c:expr:`PyVarObject *` and must not be tracked by the " +"collector yet. *newsize* must be of type :c:type:`Py_ssize_t`." +msgstr "" + +msgid "" +"Adds the object *op* to the set of container objects tracked by the " +"collector. The collector can run at unexpected times so objects must be " +"valid while being tracked. This should be called once all the fields " +"followed by the :c:member:`~PyTypeObject.tp_traverse` handler become valid, " +"usually near the end of the constructor." +msgstr "" +"Додає об’єкт *op* до набору об’єктів-контейнерів, які відстежує збирач. " +"Збирач може запускатися в несподіваний час, тому об’єкти мають бути дійсними " +"під час відстеження. Його слід викликати, коли всі поля, за якими йде " +"обробник :c:member:`~PyTypeObject.tp_traverse`, стануть дійсними, як " +"правило, ближче до кінця конструктора." + +msgid "" +"Returns non-zero if the object implements the garbage collector protocol, " +"otherwise returns 0." +msgstr "" +"Повертає ненульове значення, якщо об’єкт реалізує протокол збирача сміття, " +"інакше повертає 0." + +msgid "" +"The object cannot be tracked by the garbage collector if this function " +"returns 0." +msgstr "Збирач сміття не може відстежувати об’єкт, якщо ця функція повертає 0." + +msgid "" +"Returns 1 if the object type of *op* implements the GC protocol and *op* is " +"being currently tracked by the garbage collector and 0 otherwise." +msgstr "" +"Повертає 1, якщо тип об’єкта *op* реалізує протокол GC і *op* зараз " +"відстежується збирачем сміття, і 0 в іншому випадку." + +msgid "This is analogous to the Python function :func:`gc.is_tracked`." +msgstr "Це аналогічно функції Python :func:`gc.is_tracked`." + +msgid "" +"Returns 1 if the object type of *op* implements the GC protocol and *op* has " +"been already finalized by the garbage collector and 0 otherwise." +msgstr "" +"Повертає 1, якщо тип об’єкта *op* реалізує протокол GC і *op* вже завершено " +"збирачем сміття, і 0 в іншому випадку." + +msgid "This is analogous to the Python function :func:`gc.is_finalized`." +msgstr "Це аналогічно функції Python :func:`gc.is_finalized`." + +msgid "" +"Releases memory allocated to an object using :c:macro:`PyObject_GC_New` or :" +"c:macro:`PyObject_GC_NewVar`." +msgstr "" + +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." +msgstr "" +"Видаліть об’єкт *op* із набору об’єктів-контейнерів, які відстежує збирач. " +"Зауважте, що :c:func:`PyObject_GC_Track` можна знову викликати для цього " +"об’єкта, щоб додати його назад до набору відстежуваних об’єктів. Deallocator " +"(:c:member:`~PyTypeObject.tp_dealloc` обробник) має викликати це для об’єкта " +"до того, як будь-яке з полів, що використовуються :c:member:`~PyTypeObject." +"tp_traverse` обробником, стане недійсним." + +msgid "" +"The :c:func:`!_PyObject_GC_TRACK` and :c:func:`!_PyObject_GC_UNTRACK` macros " +"have been removed from the public C API." +msgstr "" + +msgid "" +"The :c:member:`~PyTypeObject.tp_traverse` handler accepts a function " +"parameter of this type:" +msgstr "" +"Обробник :c:member:`~PyTypeObject.tp_traverse` приймає параметр функції " +"такого типу:" + +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." +msgstr "" +"Тип функції відвідувача, переданої обробнику :c:member:`~PyTypeObject." +"tp_traverse`. Функція має бути викликана з об’єктом для проходження як " +"*object* і третім параметром для обробника :c:member:`~PyTypeObject." +"tp_traverse` як *arg*. Ядро Python використовує кілька функцій відвідувачів " +"для реалізації циклічного виявлення сміття; не очікується, що користувачам " +"доведеться писати власні функції відвідувачів." + +msgid "" +"The :c:member:`~PyTypeObject.tp_traverse` handler must have the following " +"type:" +msgstr "Обробник :c:member:`~PyTypeObject.tp_traverse` повинен мати такий тип:" + +msgid "" +"Traversal function for a container object. Implementations must call the " +"*visit* function for each object directly contained by *self*, with the " +"parameters to *visit* being the contained object and the *arg* value passed " +"to the handler. The *visit* function must not be called with a ``NULL`` " +"object argument. If *visit* returns a non-zero value that value should be " +"returned immediately." +msgstr "" +"Функція обходу для об’єкта-контейнера. Реалізації повинні викликати функцію " +"*visit* для кожного об’єкта, який безпосередньо міститься в *self*, з " +"параметрами *visit*, які містять об’єкт, а значення *arg* передається " +"обробнику. Функцію *visit* не можна викликати з аргументом об’єкта ``NULL``. " +"Якщо *visit* повертає ненульове значення, це значення має бути повернуто " +"негайно." + +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:member:`~PyTypeObject.tp_traverse` " +"передбачено макрос :c:func:`Py_VISIT`. Щоб використовувати цей макрос, " +"реалізація :c:member:`~PyTypeObject.tp_traverse` має назвати свої аргументи " +"точно *visit* і *arg*:" + +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::" +msgstr "" +"Якщо *o* не є ``NULL``, викличте зворотній виклик *visit* з аргументами *o* " +"і *arg*. Якщо *visit* повертає ненульове значення, поверніть його. За " +"допомогою цього макросу обробники :c:member:`~PyTypeObject.tp_traverse` " +"виглядають так:" + +msgid "" +"static int\n" +"my_traverse(Noddy *self, visitproc visit, void *arg)\n" +"{\n" +" Py_VISIT(self->foo);\n" +" Py_VISIT(self->bar);\n" +" return 0;\n" +"}" +msgstr "" + +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:member:`~PyTypeObject.tp_clear` має бути типу :c:type:`inquiry` " +"або ``NULL``, якщо об’єкт є незмінним." + +msgid "" +"Drop references that may have created reference cycles. Immutable objects " +"do not have to define this method since they can never directly create " +"reference cycles. Note that the object must still be valid after calling " +"this method (don't just call :c:func:`Py_DECREF` on a reference). The " +"collector will call this method if it detects that this object is involved " +"in a reference cycle." +msgstr "" +"Видалити посилання, які могли створити цикли посилань. Незмінні об’єкти не " +"повинні визначати цей метод, оскільки вони ніколи не можуть безпосередньо " +"створювати еталонні цикли. Зауважте, що об’єкт все ще має бути дійсним після " +"виклику цього методу (не просто викликайте :c:func:`Py_DECREF` за " +"посиланням). Збирач викличе цей метод, якщо виявить, що цей об’єкт бере " +"участь у еталонному циклі." + +msgid "Controlling the Garbage Collector State" +msgstr "Контроль стану Garbage Collector" + +msgid "" +"The C-API provides the following functions for controlling garbage " +"collection runs." +msgstr "C-API надає такі функції для керування виконанням збирання сміття." + +msgid "" +"Perform a full garbage collection, if the garbage collector is enabled. " +"(Note that :func:`gc.collect` runs it unconditionally.)" +msgstr "" +"Виконати повне збирання сміття, якщо ввімкнено збирач сміття. (Зверніть " +"увагу, що :func:`gc.collect` запускає його безумовно.)" + +msgid "" +"Returns the number of collected + unreachable objects which cannot be " +"collected. If the garbage collector is disabled or already collecting, " +"returns ``0`` immediately. Errors during garbage collection are passed to :" +"data:`sys.unraisablehook`. This function does not raise exceptions." +msgstr "" +"Повертає кількість зібраних + недосяжних об’єктів, які неможливо зібрати. " +"Якщо збирач сміття вимкнено або вже збирає, негайно повертає ``0``. Помилки " +"під час збирання сміття передаються до :data:`sys.unraisablehook`. Ця " +"функція не викликає винятків." + +msgid "" +"Enable the garbage collector: similar to :func:`gc.enable`. Returns the " +"previous state, 0 for disabled and 1 for enabled." +msgstr "" +"Увімкніть збирач сміття: подібно до :func:`gc.enable`. Повертає попередній " +"стан, 0 для вимкнено та 1 для ввімкнено." + +msgid "" +"Disable the garbage collector: similar to :func:`gc.disable`. Returns the " +"previous state, 0 for disabled and 1 for enabled." +msgstr "" +"Вимкнути збирач сміття: подібно до :func:`gc.disable`. Повертає попередній " +"стан, 0 для вимкнено та 1 для ввімкнено." + +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 "" +"Запитайте стан збирача сміття: подібно до :func:`gc.isenabled`. Повертає " +"поточний стан, 0 для вимкнено та 1 для ввімкнено." + +msgid "Querying Garbage Collector State" +msgstr "" + +msgid "" +"The C-API provides the following interface for querying information about " +"the garbage collector." +msgstr "" + +msgid "" +"Run supplied *callback* on all live GC-capable objects. *arg* is passed " +"through to all invocations of *callback*." +msgstr "" + +msgid "" +"If new objects are (de)allocated by the callback it is undefined if they " +"will be visited." +msgstr "" + +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 "" + +msgid "" +"Type of the visitor function to be passed to :c:func:" +"`PyUnstable_GC_VisitObjects`. *arg* is the same as the *arg* passed to " +"``PyUnstable_GC_VisitObjects``. Return ``1`` to continue iteration, return " +"``0`` to stop iteration. Other return values are reserved for now so " +"behavior on returning anything else is undefined." +msgstr "" diff --git a/c-api/gen.po b/c-api/gen.po new file mode 100644 index 000000000..1561889f2 --- /dev/null +++ b/c-api/gen.po @@ -0,0 +1,78 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:48+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Generator Objects" +msgstr "Генератор об'єктів" + +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`." +msgstr "" +"Об’єкти-генератори – це те, що Python використовує для реалізації ітераторів-" +"генераторів. Зазвичай вони створюються шляхом повторення функції, яка видає " +"значення, замість явного виклику :c:func:`PyGen_New` або :c:func:" +"`PyGen_NewWithQualName`." + +msgid "The C structure used for generator objects." +msgstr "Структура C, яка використовується для генераторних об’єктів." + +msgid "The type object corresponding to generator objects." +msgstr "Об’єкт типу, що відповідає об’єктам-генераторам." + +msgid "" +"Return true if *ob* is a generator object; *ob* must not be ``NULL``. This " +"function always succeeds." +msgstr "" +"Повертає true, якщо *ob* є генераторним об’єктом; *ob* не має бути ``NULL``. " +"Ця функція завжди успішна." + +msgid "" +"Return true if *ob*'s type is :c:type:`PyGen_Type`; *ob* must not be " +"``NULL``. This function always succeeds." +msgstr "" +"Повертає true, якщо *ob* має тип :c:type:`PyGen_Type`; *ob* не має бути " +"``NULL``. Ця функція завжди успішна." + +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``." +msgstr "" +"Створіть і поверніть новий об’єкт-генератор на основі об’єкта *frame*. Ця " +"функція викрадає посилання на *frame*. Аргумент не має бути ``NULL``." + +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``." +msgstr "" +"Створіть і поверніть новий об’єкт генератора на основі об’єкта *frame* із " +"значеннями *name* і *qualname* для ``__name__`` і ``__qualname__``. Ця " +"функція викрадає посилання на *frame*. Аргумент *frame* не має бути ``NULL``." diff --git a/c-api/hash.po b/c-api/hash.po new file mode 100644 index 000000000..f69c002b3 --- /dev/null +++ b/c-api/hash.po @@ -0,0 +1,86 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2024-02-23 14:15+0000\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "PyHash API" +msgstr "" + +msgid "" +"See also the :c:member:`PyTypeObject.tp_hash` member and :ref:`numeric-hash`." +msgstr "" + +msgid "Hash value type: signed integer." +msgstr "" + +msgid "Hash value type: unsigned integer." +msgstr "" + +msgid "" +"The `Mersenne prime `_ ``P = " +"2**n -1``, used for numeric hash scheme." +msgstr "" + +msgid "The exponent ``n`` of ``P`` in :c:macro:`PyHASH_MODULUS`." +msgstr "" + +msgid "Prime multiplier used in string and various other hashes." +msgstr "" + +msgid "The hash value returned for a positive infinity." +msgstr "" + +msgid "The multiplier used for the imaginary part of a complex number." +msgstr "" + +msgid "Hash function definition used by :c:func:`PyHash_GetFuncDef`." +msgstr "" + +msgid "Hash function name (UTF-8 encoded string)." +msgstr "" + +msgid "Internal size of the hash value in bits." +msgstr "" + +msgid "Size of seed input in bits." +msgstr "" + +msgid "Get the hash function definition." +msgstr "" + +msgid ":pep:`456` \"Secure and interchangeable hash algorithm\"." +msgstr "" + +msgid "" +"Hash a pointer value: process the pointer value as an integer (cast it to " +"``uintptr_t`` internally). The pointer is not dereferenced." +msgstr "" + +msgid "The function cannot fail: it cannot return ``-1``." +msgstr "" + +msgid "" +"Generic hashing function that is meant to be put into a type object's " +"``tp_hash`` slot. Its result only depends on the object's identity." +msgstr "" + +msgid "In CPython, it is equivalent to :c:func:`Py_HashPointer`." +msgstr "" diff --git a/c-api/import.po b/c-api/import.po new file mode 100644 index 000000000..d434d4c2a --- /dev/null +++ b/c-api/import.po @@ -0,0 +1,420 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# Yuliia Shevchenko, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:48+0000\n" +"Last-Translator: Yuliia Shevchenko, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Importing Modules" +msgstr "Імпорт модулів" + +msgid "" +"This is a wrapper around :c:func:`PyImport_Import()` which takes a :c:expr:" +"`const char *` as an argument instead of a :c:expr:`PyObject *`." +msgstr "" + +msgid "This function is a deprecated alias of :c:func:`PyImport_ImportModule`." +msgstr "Ця функція є застарілим псевдонімом :c:func:`PyImport_ImportModule`." + +msgid "" +"This function used to fail immediately when the import lock was held by " +"another thread. In Python 3.3 though, the locking scheme switched to per-" +"module locks for most purposes, so this function's special behaviour isn't " +"needed anymore." +msgstr "" +"Раніше ця функція відразу виходила з ладу, коли блокування імпорту " +"утримувалося іншим потоком. Однак у Python 3.3 схема блокування перейшла на " +"блокування по модулю для більшості цілей, тому особлива поведінка цієї " +"функції більше не потрібна." + +msgid "Use :c:func:`PyImport_ImportModule` instead." +msgstr "" + +msgid "" +"Import a module. This is best described by referring to the built-in Python " +"function :func:`__import__`." +msgstr "" +"Імпортувати модуль. Найкраще це можна описати, звернувшись до вбудованої " +"функції Python :func:`__import__`." + +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." +msgstr "" +"Значення, що повертається, є новим посиланням на імпортований модуль або " +"пакет верхнього рівня, або ``NULL`` з винятком, встановленим у разі помилки. " +"Як і для :func:`__import__`, значення, що повертається, коли запитується " +"підмодуль пакету, зазвичай є пакетом верхнього рівня, якщо не було надано " +"непорожній *fromlist*." + +msgid "" +"Failing imports remove incomplete module objects, like with :c:func:" +"`PyImport_ImportModule`." +msgstr "" +"Невдалий імпорт видаляє неповні об’єкти модуля, як-от :c:func:" +"`PyImport_ImportModule`." + +msgid "" +"Import a module. This is best described by referring to the built-in Python " +"function :func:`__import__`, as the standard :func:`__import__` function " +"calls this function directly." +msgstr "" +"Імпортувати модуль. Найкраще це можна описати, звернувшись до вбудованої " +"функції Python :func:`__import__`, оскільки стандартна функція :func:" +"`__import__` викликає цю функцію безпосередньо." + +msgid "" +"Similar to :c:func:`PyImport_ImportModuleLevelObject`, but the name is a " +"UTF-8 encoded string instead of a Unicode object." +msgstr "" +"Подібно до :c:func:`PyImport_ImportModuleLevelObject`, але ім’я є рядком у " +"кодуванні UTF-8 замість об’єкта Unicode." + +msgid "Negative values for *level* are no longer accepted." +msgstr "Від’ємні значення для *рівня* більше не приймаються." + +msgid "" +"This is a higher-level interface that calls the current \"import hook " +"function\" (with an explicit *level* of 0, meaning absolute import). It " +"invokes the :func:`__import__` function from the ``__builtins__`` of the " +"current globals. This means that the import is done using whatever import " +"hooks are installed in the current environment." +msgstr "" +"Це інтерфейс вищого рівня, який викликає поточну \"функцію перехоплення " +"імпорту\" (з явним *рівнем* 0, що означає абсолютний імпорт). Він викликає " +"функцію :func:`__import__` з ``__builtins__`` поточних глобалів. Це означає, " +"що імпорт виконується за допомогою будь-яких хуків імпорту, встановлених у " +"поточному середовищі." + +msgid "This function always uses absolute imports." +msgstr "Ця функція завжди використовує абсолютний імпорт." + +msgid "" +"Reload a module. Return a new reference to the reloaded module, or ``NULL`` " +"with an exception set on failure (the module still exists in this case)." +msgstr "" +"Перезавантажте модуль. Повертає нове посилання на перезавантажений модуль " +"або ``NULL`` з винятком, встановленим у разі помилки (у цьому випадку модуль " +"все ще існує)." + +msgid "Return the module object corresponding to a module name." +msgstr "" + +msgid "" +"The *name* argument may be of the form ``package.module``. First check the " +"modules dictionary if there's one there, and if not, create a new one and " +"insert it in the modules dictionary." +msgstr "" + +msgid "" +"Return a :term:`strong reference` to the module on success. Return ``NULL`` " +"with an exception set on failure." +msgstr "" + +msgid "The module name *name* is decoded from UTF-8." +msgstr "" + +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." +msgstr "" + +msgid "" +"Similar to :c:func:`PyImport_AddModuleRef`, but return a :term:`borrowed " +"reference` and *name* is a Python :class:`str` object." +msgstr "" + +msgid "" +"Similar to :c:func:`PyImport_AddModuleRef`, but return a :term:`borrowed " +"reference`." +msgstr "" + +msgid "" +"Given a module name (possibly of the form ``package.module``) and a code " +"object read from a Python bytecode file or obtained from the built-in " +"function :func:`compile`, load the module. Return a new reference to the " +"module object, or ``NULL`` with an exception set if an error occurred. " +"*name* is removed from :data:`sys.modules` in error cases, even if *name* " +"was already in :data:`sys.modules` on entry to :c:func:" +"`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 "" + +msgid "" +"The module's :attr:`~module.__spec__` and :attr:`~module.__loader__` will be " +"set, if not set already, with the appropriate values. The spec's loader " +"will be set to the module's :attr:`!__loader__` (if set) and to an instance " +"of :class:`~importlib.machinery.SourceFileLoader` otherwise." +msgstr "" + +msgid "" +"The module's :attr:`~module.__file__` attribute will be set to the code " +"object's :attr:`~codeobject.co_filename`. If applicable, :attr:`~module." +"__cached__` will also be set." +msgstr "" + +msgid "" +"This function will reload the module if it was already imported. See :c:" +"func:`PyImport_ReloadModule` for the intended way to reload a module." +msgstr "" +"Ця функція перезавантажить модуль, якщо він уже був імпортований. " +"Перегляньте :c:func:`PyImport_ReloadModule` для передбачуваного способу " +"перезавантаження модуля." + +msgid "" +"If *name* points to a dotted name of the form ``package.module``, any " +"package structures not already created will still not be created." +msgstr "" +"Якщо *name* вказує на ім’я з крапками у формі ``package.module``, будь-які " +"ще не створені структури пакунків не будуть створені." + +msgid "" +"See also :c:func:`PyImport_ExecCodeModuleEx` and :c:func:" +"`PyImport_ExecCodeModuleWithPathnames`." +msgstr "" +"Дивіться також :c:func:`PyImport_ExecCodeModuleEx` і :c:func:" +"`PyImport_ExecCodeModuleWithPathnames`." + +msgid "" +"The setting of :attr:`~module.__cached__` and :attr:`~module.__loader__` is " +"deprecated. See :class:`~importlib.machinery.ModuleSpec` for alternatives." +msgstr "" + +msgid "" +"Like :c:func:`PyImport_ExecCodeModule`, but the :attr:`~module.__file__` " +"attribute of the module object is set to *pathname* if it is non-``NULL``." +msgstr "" + +msgid "See also :c:func:`PyImport_ExecCodeModuleWithPathnames`." +msgstr "Дивіться також :c:func:`PyImport_ExecCodeModuleWithPathnames`." + +msgid "" +"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 "" + +msgid "" +"Setting :attr:`~module.__cached__` is deprecated. See :class:`~importlib." +"machinery.ModuleSpec` for alternatives." +msgstr "" + +msgid "" +"Like :c:func:`PyImport_ExecCodeModuleObject`, but *name*, *pathname* and " +"*cpathname* are UTF-8 encoded strings. Attempts are also made to figure out " +"what the value for *pathname* should be from *cpathname* if the former is " +"set to ``NULL``." +msgstr "" +"Як :c:func:`PyImport_ExecCodeModuleObject`, але *name*, *pathname* і " +"*cpathname* є рядками в кодуванні UTF-8. Також робляться спроби з’ясувати, " +"яким має бути значення *pathname* від *cpathname*, якщо для першого " +"встановлено значення ``NULL``." + +msgid "" +"Uses :func:`!imp.source_from_cache` in calculating the source path if only " +"the bytecode path is provided." +msgstr "" + +msgid "No longer uses the removed :mod:`!imp` module." +msgstr "" + +msgid "" +"Return the magic number for Python bytecode files (a.k.a. :file:`.pyc` " +"file). The magic number should be present in the first four bytes of the " +"bytecode file, in little-endian byte order. Returns ``-1`` on error." +msgstr "" +"Повертає магічне число для файлів байт-коду Python (він же файл :file:`." +"pyc`). Магічне число має бути присутнім у перших чотирьох байтах файлу байт-" +"коду в порядку байтів у порядку байтів. Повертає ``-1`` у разі помилки." + +msgid "Return value of ``-1`` upon failure." +msgstr "Повертає значення \"-1\" у разі помилки." + +msgid "" +"Return the magic tag string for :pep:`3147` format Python bytecode file " +"names. Keep in mind that the value at ``sys.implementation.cache_tag`` is " +"authoritative and should be used instead of this function." +msgstr "" +"Повертає рядок чарівного тегу для імен файлів байт-коду Python у форматі :" +"pep:`3147`. Майте на увазі, що значення в ``sys.implementation.cache_tag`` є " +"авторитетним і має використовуватися замість цієї функції." + +msgid "" +"Return the dictionary used for the module administration (a.k.a. ``sys." +"modules``). Note that this is a per-interpreter variable." +msgstr "" +"Повертає словник, який використовується для адміністрування модуля (він же " +"``sys.modules``). Зверніть увагу, що це змінна для кожного інтерпретатора." + +msgid "" +"Return the already imported module with the given name. If the module has " +"not been imported yet then returns ``NULL`` but does not set an error. " +"Returns ``NULL`` and sets an error if the lookup failed." +msgstr "" +"Повернути вже імпортований модуль із вказаною назвою. Якщо модуль ще не було " +"імпортовано, повертає ``NULL``, але не встановлює помилку. Повертає ``NULL`` " +"і встановлює помилку, якщо пошук не вдався." + +msgid "" +"Return a finder object for a :data:`sys.path`/:attr:`!pkg.__path__` item " +"*path*, possibly by fetching it from the :data:`sys.path_importer_cache` " +"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." +msgstr "" + +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.)" +msgstr "" +"Завантажте заморожений модуль під назвою *name*. Повертає ``1`` для успіху, " +"``0``, якщо модуль не знайдено, ``-1`` із встановленим винятком, якщо " +"ініціалізація не вдалася. Щоб отримати доступ до імпортованого модуля після " +"успішного завантаження, використовуйте :c:func:`PyImport_ImportModule`. " +"(Зверніть увагу на неправильну назву --- ця функція перезавантажить модуль, " +"якщо його вже було імпортовано.)" + +msgid "The ``__file__`` attribute is no longer set on the module." +msgstr "Атрибут ``__file__`` більше не встановлено в модулі." + +msgid "" +"Similar to :c:func:`PyImport_ImportFrozenModuleObject`, but the name is a " +"UTF-8 encoded string instead of a Unicode object." +msgstr "" +"Подібно до :c:func:`PyImport_ImportFrozenModuleObject`, але ім’я є рядком у " +"кодуванні UTF-8 замість об’єкта Unicode." + +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::" +msgstr "" +"Це визначення типу структури для закріплених дескрипторів модулів, створених " +"утилітою :program:`freeze` (див. :file:`Tools/freeze/` у вихідному коді " +"Python). Його визначення, знайдене в :file:`Include/import.h`, таке:" + +msgid "" +"struct _frozen {\n" +" const char *name;\n" +" const unsigned char *code;\n" +" int size;\n" +" bool is_package;\n" +"};" +msgstr "" + +msgid "" +"The new ``is_package`` field indicates whether the module is a package or " +"not. This replaces setting the ``size`` field to a negative value." +msgstr "" + +msgid "" +"This pointer is initialized to point to an array of :c:struct:`_frozen` " +"records, terminated by one whose members are all ``NULL`` or zero. When a " +"frozen module is imported, it is searched in this table. Third-party code " +"could play tricks with this to provide a dynamically created collection of " +"frozen modules." +msgstr "" + +msgid "" +"Add a single module to the existing table of built-in modules. This is a " +"convenience wrapper around :c:func:`PyImport_ExtendInittab`, returning " +"``-1`` if the table could not be extended. The new module can be imported " +"by the name *name*, and uses the function *initfunc* as the initialization " +"function called on the first attempted import. This should be called " +"before :c:func:`Py_Initialize`." +msgstr "" +"Додайте один модуль до існуючої таблиці вбудованих модулів. Це зручна " +"обгортка навколо :c:func:`PyImport_ExtendInittab`, яка повертає ``-1``, якщо " +"таблицю не можна розширити. Новий модуль можна імпортувати під назвою *name* " +"і використовувати функцію *initfunc* як функцію ініціалізації, викликану під " +"час першої спроби імпорту. Його слід викликати перед :c:func:`Py_Initialize`." + +msgid "" +"Structure describing a single entry in the list of built-in modules. " +"Programs which embed Python may use an array of these structures in " +"conjunction with :c:func:`PyImport_ExtendInittab` to provide additional " +"built-in modules. The structure consists of two members:" +msgstr "" + +msgid "The module name, as an ASCII encoded string." +msgstr "" + +msgid "Initialization function for a module built into the interpreter." +msgstr "" + +msgid "" +"Add a collection of modules to the table of built-in modules. The *newtab* " +"array must end with a sentinel entry which contains ``NULL`` for the :c:" +"member:`~_inittab.name` field; failure to provide the sentinel value can " +"result in a memory fault. Returns ``0`` on success or ``-1`` if insufficient " +"memory could be allocated to extend the internal table. In the event of " +"failure, no modules are added to the internal table. This must be called " +"before :c:func:`Py_Initialize`." +msgstr "" + +msgid "" +"If Python is initialized multiple times, :c:func:`PyImport_AppendInittab` " +"or :c:func:`PyImport_ExtendInittab` must be called before each Python " +"initialization." +msgstr "" +"Якщо Python ініціалізовано кілька разів, перед кожною ініціалізацією Python " +"потрібно викликати :c:func:`PyImport_AppendInittab` або :c:func:" +"`PyImport_ExtendInittab`." + +msgid "package variable" +msgstr "" + +msgid "__all__" +msgstr "" + +msgid "__all__ (package variable)" +msgstr "" + +msgid "modules (in module sys)" +msgstr "" + +msgid "built-in function" +msgstr "вбудована функція" + +msgid "__import__" +msgstr "" + +msgid "compile" +msgstr "" + +msgid "freeze utility" +msgstr "" diff --git a/c-api/index.po b/c-api/index.po new file mode 100644 index 000000000..1e7a16dc7 --- /dev/null +++ b/c-api/index.po @@ -0,0 +1,40 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:48+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Python/C API Reference Manual" +msgstr "Довідковий посібник з API Python/C" + +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." +msgstr "" +"Цей посібник документує API, який використовують програмісти на C і C++, які " +"хочуть писати модулі розширення або вбудовувати Python. Він є доповненням " +"до :ref:`extending-index`, який описує загальні принципи написання " +"розширень, але не документує детально функції API." diff --git a/c-api/init.po b/c-api/init.po new file mode 100644 index 000000000..e4ac769fa --- /dev/null +++ b/c-api/init.po @@ -0,0 +1,3129 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:49+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Initialization, Finalization, and Threads" +msgstr "Ініціалізація, фіналізація та потоки" + +msgid "" +"See :ref:`Python Initialization Configuration ` for details on " +"how to configure the interpreter prior to initialization." +msgstr "" + +msgid "Before Python Initialization" +msgstr "Перед ініціалізацією Python" + +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 " +"exception of a few functions and the :ref:`global configuration variables " +"`." +msgstr "" +"У програмі, яка вбудовує Python, функція :c:func:`Py_Initialize` має бути " +"викликана перед використанням будь-яких інших функцій API Python/C; за " +"винятком кількох функцій і :ref:`глобальних змінних конфігурації `." + +msgid "" +"The following functions can be safely called before Python is initialized:" +msgstr "Наступні функції можна безпечно викликати до ініціалізації Python:" + +msgid "Functions that initialize the interpreter:" +msgstr "" + +msgid ":c:func:`Py_Initialize`" +msgstr "" + +msgid ":c:func:`Py_InitializeEx`" +msgstr "" + +msgid ":c:func:`Py_InitializeFromConfig`" +msgstr ":c:func:`Py_InitializeFromConfig`" + +msgid ":c:func:`Py_BytesMain`" +msgstr ":c:func:`Py_BytesMain`" + +msgid ":c:func:`Py_Main`" +msgstr "" + +msgid "the runtime pre-initialization functions covered in :ref:`init-config`" +msgstr "" + +msgid "Configuration functions:" +msgstr "Функції конфігурації:" + +msgid ":c:func:`PyImport_AppendInittab`" +msgstr ":c:func:`PyImport_AppendInittab`" + +msgid ":c:func:`PyImport_ExtendInittab`" +msgstr ":c:func:`PyImport_ExtendInittab`" + +msgid ":c:func:`!PyInitFrozenExtensions`" +msgstr "" + +msgid ":c:func:`PyMem_SetAllocator`" +msgstr ":c:func:`PyMem_SetAllocator`" + +msgid ":c:func:`PyMem_SetupDebugHooks`" +msgstr ":c:func:`PyMem_SetupDebugHooks`" + +msgid ":c:func:`PyObject_SetArenaAllocator`" +msgstr ":c:func:`PyObject_SetArenaAllocator`" + +msgid ":c:func:`Py_SetProgramName`" +msgstr ":c:func:`Py_SetProgramName`" + +msgid ":c:func:`Py_SetPythonHome`" +msgstr ":c:func:`Py_SetPythonHome`" + +msgid ":c:func:`PySys_ResetWarnOptions`" +msgstr ":c:func:`PySys_ResetWarnOptions`" + +msgid "the configuration functions covered in :ref:`init-config`" +msgstr "" + +msgid "Informative functions:" +msgstr "Інформативні функції:" + +msgid ":c:func:`Py_IsInitialized`" +msgstr ":c:func:`Py_IsInitialized`" + +msgid ":c:func:`PyMem_GetAllocator`" +msgstr ":c:func:`PyMem_GetAllocator`" + +msgid ":c:func:`PyObject_GetArenaAllocator`" +msgstr ":c:func:`PyObject_GetArenaAllocator`" + +msgid ":c:func:`Py_GetBuildInfo`" +msgstr ":c:func:`Py_GetBuildInfo`" + +msgid ":c:func:`Py_GetCompiler`" +msgstr ":c:func:`Py_GetCompiler`" + +msgid ":c:func:`Py_GetCopyright`" +msgstr ":c:func:`Py_GetCopyright`" + +msgid ":c:func:`Py_GetPlatform`" +msgstr ":c:func:`Py_GetPlatform`" + +msgid ":c:func:`Py_GetVersion`" +msgstr ":c:func:`Py_GetVersion`" + +msgid "Utilities:" +msgstr "Утиліти:" + +msgid ":c:func:`Py_DecodeLocale`" +msgstr ":c:func:`Py_DecodeLocale`" + +msgid "" +"the status reporting and utility functions covered in :ref:`init-config`" +msgstr "" + +msgid "Memory allocators:" +msgstr "Розподільники пам'яті:" + +msgid ":c:func:`PyMem_RawMalloc`" +msgstr ":c:func:`PyMem_RawMalloc`" + +msgid ":c:func:`PyMem_RawRealloc`" +msgstr ":c:func:`PyMem_RawRealloc`" + +msgid ":c:func:`PyMem_RawCalloc`" +msgstr ":c:func:`PyMem_RawCalloc`" + +msgid ":c:func:`PyMem_RawFree`" +msgstr ":c:func:`PyMem_RawFree`" + +msgid "Synchronization:" +msgstr "" + +msgid ":c:func:`PyMutex_Lock`" +msgstr "" + +msgid ":c:func:`PyMutex_Unlock`" +msgstr "" + +msgid "" +"Despite their apparent similarity to some of the functions listed above, the " +"following functions **should not be called** before the interpreter has been " +"initialized: :c:func:`Py_EncodeLocale`, :c:func:`Py_GetPath`, :c:func:" +"`Py_GetPrefix`, :c:func:`Py_GetExecPrefix`, :c:func:" +"`Py_GetProgramFullPath`, :c:func:`Py_GetPythonHome`, :c:func:" +"`Py_GetProgramName`, :c:func:`PyEval_InitThreads`, and :c:func:`Py_RunMain`." +msgstr "" + +msgid "Global configuration variables" +msgstr "Глобальні змінні конфігурації" + +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 `." +msgstr "" +"Python має змінні для глобальної конфігурації для керування різними " +"функціями та параметрами. За замовчуванням ці позначки контролюються :ref:" +"`параметрами командного рядка `." + +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." +msgstr "" +"Коли параметр встановлює прапор, значення прапора дорівнює кількості разів, " +"коли цей параметр було встановлено. Наприклад, ``-b`` встановлює :c:data:" +"`Py_BytesWarningFlag` на 1, а ``-bb`` встановлює :c:data:" +"`Py_BytesWarningFlag` на 2." + +msgid "" +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"bytes_warning` should be used instead, see :ref:`Python Initialization " +"Configuration `." +msgstr "" + +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``." +msgstr "" +"Видає попередження, коли порівнює :class:`bytes` або :class:`bytearray` з :" +"class:`str` або :class:`bytes` з :class:`int`. Видає помилку, якщо більше " +"або дорівнює ``2``." + +msgid "Set by the :option:`-b` option." +msgstr "Встановлюється параметром :option:`-b`." + +msgid "" +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"parser_debug` should be used instead, see :ref:`Python Initialization " +"Configuration `." +msgstr "" + +msgid "" +"Turn on parser debugging output (for expert only, depending on compilation " +"options)." +msgstr "" +"Увімкніть вихід налагодження аналізатора (лише для експерта, залежно від " +"параметрів компіляції)." + +msgid "" +"Set by the :option:`-d` option and the :envvar:`PYTHONDEBUG` environment " +"variable." +msgstr "" +"Встановлюється параметром :option:`-d` і змінною середовища :envvar:" +"`PYTHONDEBUG`." + +msgid "" +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"write_bytecode` should be used instead, see :ref:`Python Initialization " +"Configuration `." +msgstr "" + +msgid "" +"If set to non-zero, Python won't try to write ``.pyc`` files on the import " +"of source modules." +msgstr "" +"Якщо встановлено ненульове значення, Python не намагатиметься записати файли " +"``.pyc`` під час імпорту вихідних модулів." + +msgid "" +"Set by the :option:`-B` option and the :envvar:`PYTHONDONTWRITEBYTECODE` " +"environment variable." +msgstr "" +"Встановлюється параметром :option:`-B` і змінною середовища :envvar:" +"`PYTHONDONTWRITEBYTECODE`." + +msgid "" +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"pathconfig_warnings` should be used instead, see :ref:`Python Initialization " +"Configuration `." +msgstr "" + +msgid "" +"Suppress error messages when calculating the module search path in :c:func:" +"`Py_GetPath`." +msgstr "" +"Придушити повідомлення про помилки під час обчислення шляху пошуку модуля в :" +"c:func:`Py_GetPath`." + +msgid "Private flag used by ``_freeze_module`` and ``frozenmain`` programs." +msgstr "" + +msgid "" +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"hash_seed` and :c:member:`PyConfig.use_hash_seed` should be used instead, " +"see :ref:`Python Initialization Configuration `." +msgstr "" + +msgid "" +"Set to ``1`` if the :envvar:`PYTHONHASHSEED` environment variable is set to " +"a non-empty string." +msgstr "" +"Установіть значення ``1``, якщо змінна середовища :envvar:`PYTHONHASHSEED` " +"має значення непорожнього рядка." + +msgid "" +"If the flag is non-zero, read the :envvar:`PYTHONHASHSEED` environment " +"variable to initialize the secret hash seed." +msgstr "" +"Якщо прапорець відмінний від нуля, прочитайте змінну середовища :envvar:" +"`PYTHONHASHSEED`, щоб ініціалізувати секретне початкове значення хешу." + +msgid "" +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"use_environment` should be used instead, see :ref:`Python Initialization " +"Configuration `." +msgstr "" + +msgid "" +"Ignore all :envvar:`!PYTHON*` environment variables, e.g. :envvar:" +"`PYTHONPATH` and :envvar:`PYTHONHOME`, that might be set." +msgstr "" + +msgid "Set by the :option:`-E` and :option:`-I` options." +msgstr "Встановлюється параметрами :option:`-E` і :option:`-I`." + +msgid "" +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"inspect` should be used instead, see :ref:`Python Initialization " +"Configuration `." +msgstr "" + +msgid "" +"When a script is passed as first argument or the :option:`-c` option is " +"used, enter interactive mode after executing the script or the command, even " +"when :data:`sys.stdin` does not appear to be a terminal." +msgstr "" +"Якщо сценарій передається як перший аргумент або використовується параметр :" +"option:`-c`, увійдіть в інтерактивний режим після виконання сценарію або " +"команди, навіть якщо :data:`sys.stdin` не виглядає як термінал." + +msgid "" +"Set by the :option:`-i` option and the :envvar:`PYTHONINSPECT` environment " +"variable." +msgstr "" +"Встановлюється параметром :option:`-i` і змінною середовища :envvar:" +"`PYTHONINSPECT`." + +msgid "" +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"interactive` should be used instead, see :ref:`Python Initialization " +"Configuration `." +msgstr "" + +msgid "Set by the :option:`-i` option." +msgstr "Встановлюється параметром :option:`-i`." + +msgid "" +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"isolated` should be used instead, see :ref:`Python Initialization " +"Configuration `." +msgstr "" + +msgid "" +"Run Python in isolated mode. In isolated mode :data:`sys.path` contains " +"neither the script's directory nor the user's site-packages directory." +msgstr "" +"Запустіть Python в ізольованому режимі. В ізольованому режимі :data:`sys." +"path` не містить ані каталогу сценарію, ані каталогу сайту-пакетів " +"користувача." + +msgid "Set by the :option:`-I` option." +msgstr "Встановлюється параметром :option:`-I`." + +msgid "" +"This API is kept for backward compatibility: setting :c:member:`PyPreConfig." +"legacy_windows_fs_encoding` should be used instead, see :ref:`Python " +"Initialization Configuration `." +msgstr "" + +msgid "" +"If the flag is non-zero, use the ``mbcs`` encoding with ``replace`` error " +"handler, instead of the UTF-8 encoding with ``surrogatepass`` error handler, " +"for the :term:`filesystem encoding and error handler`." +msgstr "" +"Якщо прапорець відмінний від нуля, використовуйте кодування ``mbcs`` із " +"обробником помилок ``replace``, замість кодування UTF-8 із ``surrogatepass`` " +"обробником помилок, для :term:`filesystem encoding and error handler`." + +msgid "" +"Set to ``1`` if the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` environment " +"variable is set to a non-empty string." +msgstr "" +"Установіть значення ``1``, якщо змінна середовища :envvar:" +"`PYTHONLEGACYWINDOWSFSENCODING` має значення непорожнього рядка." + +msgid "See :pep:`529` for more details." +msgstr "Дивіться :pep:`529` для більш детальної інформації." + +msgid "Availability" +msgstr "" + +msgid "" +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"legacy_windows_stdio` should be used instead, see :ref:`Python " +"Initialization Configuration `." +msgstr "" + +msgid "" +"If the flag is non-zero, use :class:`io.FileIO` instead of :class:`!io." +"_WindowsConsoleIO` for :mod:`sys` standard streams." +msgstr "" + +msgid "" +"Set to ``1`` if the :envvar:`PYTHONLEGACYWINDOWSSTDIO` environment variable " +"is set to a non-empty string." +msgstr "" +"Установіть значення ``1``, якщо змінна середовища :envvar:" +"`PYTHONLEGACYWINDOWSSTDIO` має значення непорожнього рядка." + +msgid "See :pep:`528` for more details." +msgstr "Дивіться :pep:`528` для більш детальної інформації." + +msgid "" +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"site_import` should be used instead, see :ref:`Python Initialization " +"Configuration `." +msgstr "" + +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)." +msgstr "" +"Вимкніть імпорт модуля :mod:`site` і залежні від сайту маніпуляції :data:" +"`sys.path`, які він передбачає. Також вимкніть ці маніпуляції, якщо :mod:" +"`site` буде явно імпортовано пізніше (викличте :func:`site.main`, якщо ви " +"хочете, щоб вони були активовані)." + +msgid "Set by the :option:`-S` option." +msgstr "Встановлюється параметром :option:`-S`." + +msgid "" +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"user_site_directory` should be used instead, see :ref:`Python Initialization " +"Configuration `." +msgstr "" + +msgid "" +"Don't add the :data:`user site-packages directory ` to :data:" +"`sys.path`." +msgstr "" +"Не додавайте каталог :data:`user site-packages ` до :data:" +"`sys.path`." + +msgid "" +"Set by the :option:`-s` and :option:`-I` options, and the :envvar:" +"`PYTHONNOUSERSITE` environment variable." +msgstr "" +"Встановлюється параметрами :option:`-s` і :option:`-I`, а також змінною " +"середовища :envvar:`PYTHONNOUSERSITE`." + +msgid "" +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"optimization_level` should be used instead, see :ref:`Python Initialization " +"Configuration `." +msgstr "" + +msgid "" +"Set by the :option:`-O` option and the :envvar:`PYTHONOPTIMIZE` environment " +"variable." +msgstr "" +"Встановлюється параметром :option:`-O` і змінною середовища :envvar:" +"`PYTHONOPTIMIZE`." + +msgid "" +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"quiet` should be used instead, see :ref:`Python Initialization Configuration " +"`." +msgstr "" + +msgid "" +"Don't display the copyright and version messages even in interactive mode." +msgstr "" +"Не відображайте повідомлення про авторські права та версію навіть в " +"інтерактивному режимі." + +msgid "Set by the :option:`-q` option." +msgstr "Встановлюється параметром :option:`-q`." + +msgid "" +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"buffered_stdio` should be used instead, see :ref:`Python Initialization " +"Configuration `." +msgstr "" + +msgid "Force the stdout and stderr streams to be unbuffered." +msgstr "Примусово розбуферизувати потоки stdout і stderr." + +msgid "" +"Set by the :option:`-u` option and the :envvar:`PYTHONUNBUFFERED` " +"environment variable." +msgstr "" +"Встановлюється параметром :option:`-u` і змінною середовища :envvar:" +"`PYTHONUNBUFFERED`." + +msgid "" +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"verbose` should be used instead, see :ref:`Python Initialization " +"Configuration `." +msgstr "" + +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 " +"to ``2``, print a message for each file that is checked for when searching " +"for a module. Also provides information on module cleanup at exit." +msgstr "" +"Друкувати повідомлення кожного разу, коли модуль ініціалізовано, із " +"зазначенням місця (ім’я файлу чи вбудованого модуля), з якого він " +"завантажується. Якщо більше або дорівнює ``2``, друкувати повідомлення для " +"кожного файлу, який перевіряється під час пошуку модуля. Також надає " +"інформацію про очищення модуля при виході." + +msgid "" +"Set by the :option:`-v` option and the :envvar:`PYTHONVERBOSE` environment " +"variable." +msgstr "" +"Встановлюється параметром :option:`-v` і змінною середовища :envvar:" +"`PYTHONVERBOSE`." + +msgid "Initializing and finalizing the interpreter" +msgstr "Ініціалізація та завершення інтерпретатора" + +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." +msgstr "" +"Ініціалізація інтерпретатора Python. У програмі, що вбудовує Python, це слід " +"викликати перед використанням будь-яких інших функцій API Python/C; див. :" +"ref:`Перед ініціалізацією Python ` для кількох винятків." + +msgid "" +"This initializes the table of loaded modules (``sys.modules``), and creates " +"the fundamental modules :mod:`builtins`, :mod:`__main__` and :mod:`sys`. It " +"also initializes the module search path (``sys.path``). It does not set " +"``sys.argv``; use the :ref:`Python Initialization Configuration ` API for that. This is a no-op when called for a second time " +"(without calling :c:func:`Py_FinalizeEx` first). There is no return value; " +"it is a fatal error if the initialization fails." +msgstr "" + +msgid "" +"Use :c:func:`Py_InitializeFromConfig` to customize the :ref:`Python " +"Initialization Configuration `." +msgstr "" + +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 "" +"У Windows змінює режим консолі з ``O_TEXT`` на ``O_BINARY``, що також вплине " +"на використання консолі не на Python за допомогою C Runtime." + +msgid "" +"This function works like :c:func:`Py_Initialize` if *initsigs* is ``1``. If " +"*initsigs* is ``0``, it skips initialization registration of signal " +"handlers, which may be useful when CPython is embedded as part of a larger " +"application." +msgstr "" + +msgid "" +"Initialize Python from *config* configuration, as described in :ref:`init-" +"from-config`." +msgstr "" + +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 "" + +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 "" +"Повертає істину (не нуль), якщо інтерпретатор Python ініціалізовано, і false " +"(нуль), якщо ні. Після виклику :c:func:`Py_FinalizeEx` повертається false, " +"доки :c:func:`Py_Initialize` не буде викликано знову." + +msgid "" +"Return true (non-zero) if the main Python interpreter is :term:`shutting " +"down `. Return false (zero) otherwise." +msgstr "" + +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)." +msgstr "" + +msgid "" +"Since this is the reverse of :c:func:`Py_Initialize`, it should be called in " +"the same thread with the same interpreter active. That means the main " +"thread and the main interpreter. This should never be called while :c:func:" +"`Py_RunMain` is running." +msgstr "" + +msgid "" +"Normally the return value is ``0``. If there were errors during finalization " +"(flushing buffered data), ``-1`` is returned." +msgstr "" + +msgid "" +"This function is provided for a number of reasons. An embedding application " +"might want to restart Python without having to restart the application " +"itself. An application that has loaded the Python interpreter from a " +"dynamically loadable library (or DLL) might want to free all memory " +"allocated by Python before unloading the DLL. During a hunt for memory leaks " +"in an application a developer might want to free all memory allocated by " +"Python before exiting from the application." +msgstr "" +"Ця функція передбачена з кількох причин. Програма для вбудовування може " +"захотіти перезапустити Python без необхідності перезапускати саму програму. " +"Програма, яка завантажила інтерпретатор Python із динамічно завантажуваної " +"бібліотеки (або DLL), може захотіти звільнити всю пам’ять, виділену Python, " +"перед вивантаженням DLL. Під час пошуку витоків пам’яті в програмі розробник " +"може захотіти звільнити всю пам’ять, виділену Python, перш ніж вийти з " +"програми." + +msgid "" +"**Bugs and caveats:** The destruction of modules and objects in modules is " +"done in random order; this may cause destructors (:meth:`~object.__del__` " +"methods) to fail when they depend on other objects (even functions) or " +"modules. Dynamically loaded extension modules loaded by Python are not " +"unloaded. Small amounts of memory allocated by the Python interpreter may " +"not be freed (if you find a leak, please report it). Memory tied up in " +"circular references between objects is not freed. Some memory allocated by " +"extension modules may not be freed. Some extensions may not work properly " +"if their initialization routine is called more than once; this can happen if " +"an application calls :c:func:`Py_Initialize` and :c:func:`Py_FinalizeEx` " +"more than once." +msgstr "" + +msgid "" +"Raises an :ref:`auditing event ` ``cpython." +"_PySys_ClearAuditHooks`` with no arguments." +msgstr "" +"Викликає :ref:`подію аудиту ` ``cpython._PySys_ClearAuditHooks`` " +"без аргументів." + +msgid "" +"This is a backwards-compatible version of :c:func:`Py_FinalizeEx` that " +"disregards the return value." +msgstr "" +"Це зворотно сумісна версія :c:func:`Py_FinalizeEx`, яка не враховує " +"значення, що повертається." + +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 "" + +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 "" + +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 "" + +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 "" + +msgid "" +"The return value will be ``0`` if the interpreter exits normally (i.e., " +"without an exception), ``1`` if the interpreter exits due to an exception, " +"or ``2`` if the argument list does not represent a valid Python command line." +msgstr "" + +msgid "" +"Note that if an otherwise unhandled :exc:`SystemExit` is raised, this " +"function will not return ``1``, but exit the process, as long as " +"``Py_InspectFlag`` is not set. If ``Py_InspectFlag`` is set, execution will " +"drop into the interactive Python prompt, at which point a second otherwise " +"unhandled :exc:`SystemExit` will still exit the process, while any other " +"means of exiting will set the return value as described above." +msgstr "" + +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 "" + +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 "" + +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 "" + +msgid "Executes the main module in a fully configured CPython runtime." +msgstr "" + +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 "" + +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), or ``1`` if the interpreter exits due to an exception. If an " +"otherwise unhandled :exc:`SystemExit` is raised, the function will " +"immediately exit the process instead of returning ``1``." +msgstr "" + +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: returning ``0`` if the " +"session terminates without raising an unhandled exception, exiting " +"immediately for an unhandled :exc:`SystemExit`, and returning ``1`` for any " +"other unhandled exception." +msgstr "" + +msgid "" +"This function always finalizes the Python interpreter regardless of whether " +"it returns a value or immediately exits the process due to an unhandled :exc:" +"`SystemExit` exception." +msgstr "" + +msgid "" +"See :ref:`Python Configuration ` for an example of a " +"customized Python that always runs in isolated mode using :c:func:" +"`Py_RunMain`." +msgstr "" + +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 "" + +msgid "The :term:`GIL` must be held for *interp*." +msgstr "" + +msgid "Process-wide parameters" +msgstr "Параметри для всього процесу" + +msgid "" +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"program_name` should be used instead, see :ref:`Python Initialization " +"Configuration `." +msgstr "" + +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 " +"of the ``argv[0]`` argument to the :c:func:`main` function of the program " +"(converted to wide characters). This is used by :c:func:`Py_GetPath` and " +"some other functions below to find the Python run-time libraries relative to " +"the interpreter executable. The default value is ``'python'``. The " +"argument should point to a zero-terminated wide 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 "" +"Цю функцію слід викликати перед першим викликом :c:func:`Py_Initialize`, " +"якщо вона взагалі викликається. Він повідомляє інтерпретатору значення " +"аргументу ``argv[0]`` для функції :c:func:`main` програми (перетворене на " +"широкі символи). Це використовується :c:func:`Py_GetPath` та деякими іншими " +"функціями нижче для пошуку бібліотек часу виконання Python відносно " +"виконуваного файлу інтерпретатора. Значення за замовчуванням - ``'python'``. " +"Аргумент має вказувати на широкий символьний рядок із нульовим закінченням у " +"статичній пам’яті, вміст якої не змінюватиметься протягом виконання " +"програми. Жоден код інтерпретатора Python не змінить вміст цього сховища." + +msgid "" +"Use :c:func:`Py_DecodeLocale` to decode a bytes string to get a :c:expr:" +"`wchar_t*` string." +msgstr "" + +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 "" + +msgid "" +"This function should not be called before :c:func:`Py_Initialize`, otherwise " +"it returns ``NULL``." +msgstr "" +"Цю функцію не слід викликати перед :c:func:`Py_Initialize`, інакше вона " +"повертає ``NULL``." + +msgid "It now returns ``NULL`` if called before :c:func:`Py_Initialize`." +msgstr "" +"Тепер він повертає ``NULL``, якщо викликаний перед :c:func:`Py_Initialize`." + +msgid "Get :data:`sys.executable` instead." +msgstr "" + +msgid "" +"Return the *prefix* for installed platform-independent files. This is " +"derived through a number of complicated rules from the program name set " +"with :c:member:`PyConfig.program_name` and some environment variables; for " +"example, if the program name is ``'/usr/local/bin/python'``, the prefix is " +"``'/usr/local'``. The returned string points into static storage; the caller " +"should not modify its value. This corresponds to the :makevar:`prefix` " +"variable in the top-level :file:`Makefile` and the :option:`--prefix` " +"argument to the :program:`configure` script at build time. The value is " +"available to Python code as ``sys.base_prefix``. It is only useful on Unix. " +"See also the next function." +msgstr "" + +msgid "" +"Get :data:`sys.base_prefix` instead, or :data:`sys.prefix` if :ref:`virtual " +"environments ` need to be handled." +msgstr "" + +msgid "" +"Return the *exec-prefix* for installed platform-*dependent* files. This is " +"derived through a number of complicated rules from the program name set " +"with :c:member:`PyConfig.program_name` and some environment variables; for " +"example, if the program name is ``'/usr/local/bin/python'``, the exec-prefix " +"is ``'/usr/local'``. The returned string points into static storage; the " +"caller should not modify its value. This corresponds to the :makevar:" +"`exec_prefix` variable in the top-level :file:`Makefile` and the ``--exec-" +"prefix`` argument to the :program:`configure` script at build time. The " +"value is available to Python code as ``sys.base_exec_prefix``. It is only " +"useful on Unix." +msgstr "" + +msgid "" +"Background: The exec-prefix differs from the prefix when platform dependent " +"files (such as executables and shared libraries) are installed in a " +"different directory tree. In a typical installation, platform dependent " +"files may be installed in the :file:`/usr/local/plat` subtree while platform " +"independent may be installed in :file:`/usr/local`." +msgstr "" +"Довідкова інформація: префікс exec відрізняється від префікса, коли залежні " +"від платформи файли (такі як виконувані файли та спільні бібліотеки) " +"інстальовано в іншому дереві каталогів. У типовій інсталяції залежні від " +"платформи файли можна інсталювати у піддереві :file:`/usr/local/plat`, а " +"незалежні від платформи — у :file:`/usr/local`." + +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 " +"considered the same platform, but Intel machines running Solaris 2.x are " +"another platform, and Intel machines running Linux are yet another " +"platform. Different major revisions of the same operating system generally " +"also form different platforms. Non-Unix operating systems are a different " +"story; the installation strategies on those systems are so different that " +"the prefix and exec-prefix are meaningless, and set to the empty string. " +"Note that compiled Python bytecode files are platform independent (but not " +"independent from the Python version by which they were compiled!)." +msgstr "" +"Загалом, платформа – це комбінація сімейства апаратного та програмного " +"забезпечення, напр. Машини Sparc під керуванням операційної системи Solaris " +"2.x вважаються тією самою платформою, але машини Intel під керуванням " +"Solaris 2.x є іншою платформою, а машини Intel під керуванням Linux є ще " +"іншою платформою. Різні основні версії однієї операційної системи, як " +"правило, створюють різні платформи. Інша історія — операційні системи, " +"відмінні від Unix; стратегії встановлення в цих системах настільки різні, що " +"префікс і префікс exec не мають сенсу та встановлюються як порожній рядок. " +"Зауважте, що скомпільовані файли байт-коду Python не залежать від платформи " +"(але не залежать від версії Python, за допомогою якої вони були " +"скомпільовані!)." + +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." +msgstr "" +"Системні адміністратори знатимуть, як налаштувати програми :program:`mount` " +"або :program:`automount` для спільного використання :file:`/usr/local` між " +"платформами, використовуючи :file:`/usr/local/plat` різні файлові системи " +"для кожної платформи." + +msgid "" +"Get :data:`sys.base_exec_prefix` instead, or :data:`sys.exec_prefix` if :ref:" +"`virtual environments ` need to be handled." +msgstr "" + +msgid "" +"Return the full program name of the Python executable; this is computed as " +"a side-effect of deriving the default module search path from the program " +"name (set by :c:member:`PyConfig.program_name`). The returned string points " +"into static storage; the caller should not modify its value. The value is " +"available to Python code as ``sys.executable``." +msgstr "" + +msgid "" +"Return the default module search path; this is computed from the program " +"name (set by :c:member:`PyConfig.program_name`) and some environment " +"variables. The returned string consists of a series of directory names " +"separated by a platform dependent delimiter character. The delimiter " +"character is ``':'`` on Unix and macOS, ``';'`` on Windows. The returned " +"string points into static storage; the caller should not modify its value. " +"The list :data:`sys.path` is initialized with this value on interpreter " +"startup; it can be (and usually is) modified later to change the search path " +"for loading modules." +msgstr "" + +msgid "Get :data:`sys.path` instead." +msgstr "" + +msgid "" +"Return the version of this Python interpreter. This is a string that looks " +"something like ::" +msgstr "" +"Повернути версію цього інтерпретатора Python. Це рядок, який виглядає " +"приблизно так::" + +msgid "\"3.0a5+ (py3k:63103M, May 12 2008, 00:53:55) \\n[GCC 4.2.3]\"" +msgstr "" + +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`." +msgstr "" +"Перше слово (до першого символу пробілу) є поточною версією Python; перші " +"символи — це головна та другорядна версії, розділені крапкою. Повернений " +"рядок вказує на статичне сховище; абонент не повинен змінювати його " +"значення. Значення доступне для коду Python як :data:`sys.version`." + +msgid "See also the :c:var:`Py_Version` constant." +msgstr "" + +msgid "" +"Return the platform identifier for the current platform. On Unix, this is " +"formed from the \"official\" name of the operating system, converted to " +"lower case, followed by the major revision number; e.g., for Solaris 2.x, " +"which is also known as SunOS 5.x, the value is ``'sunos5'``. On macOS, it " +"is ``'darwin'``. On Windows, it is ``'win'``. The returned string points " +"into static storage; the caller should not modify its value. The value is " +"available to Python code as ``sys.platform``." +msgstr "" +"Повертає ідентифікатор платформи для поточної платформи. В Unix це " +"формується з \"офіційної\" назви операційної системи, перетвореної на нижній " +"регістр, за якою йде основний номер версії; наприклад, для Solaris 2.x, яка " +"також відома як SunOS 5.x, значенням є ``'sunos5``. У macOS це ``'darwin'``. " +"У Windows це ``'win'``. Повернений рядок вказує на статичне сховище; абонент " +"не повинен змінювати його значення. Значення доступне для коду Python як " +"``sys.platform``." + +msgid "" +"Return the official copyright string for the current Python version, for " +"example" +msgstr "" +"Поверніть, наприклад, офіційний рядок авторських прав для поточної версії " +"Python" + +msgid "``'Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam'``" +msgstr "" +"``'Авторське право 1991-1995 Stichting Mathematisch Centrum, Amsterdam'``" + +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 "" +"Повернений рядок вказує на статичне сховище; абонент не повинен змінювати " +"його значення. Значення доступне для коду Python як ``sys.copyright``." + +msgid "" +"Return an indication of the compiler used to build the current Python " +"version, in square brackets, for example::" +msgstr "" +"Повертає вказівку компілятора, використаного для створення поточної версії " +"Python, у квадратних дужках, наприклад::" + +msgid "\"[GCC 2.7.2.2]\"" +msgstr "" + +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 "" +"Повернений рядок вказує на статичне сховище; абонент не повинен змінювати " +"його значення. Значення доступне для коду Python як частина змінної ``sys." +"version``." + +msgid "" +"Return information about the sequence number and build date and time of the " +"current Python interpreter instance, for example ::" +msgstr "" +"Повертає інформацію про порядковий номер, дату й час збирання поточного " +"екземпляра інтерпретатора Python, наприклад::" + +msgid "\"#67, Aug 1 1997, 22:34:28\"" +msgstr "" + +msgid "" +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"argv`, :c:member:`PyConfig.parse_argv` and :c:member:`PyConfig.safe_path` " +"should be used instead, see :ref:`Python Initialization Configuration `." +msgstr "" + +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 " +"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 *argv* can be an " +"empty string. If this function fails to initialize :data:`sys.argv`, a " +"fatal condition is signalled using :c:func:`Py_FatalError`." +msgstr "" +"Встановити :data:`sys.argv` на основі *argc* і *argv*. Ці параметри подібні " +"до тих, що передаються до функції програми :c:func:`main` з тією різницею, " +"що перший запис має посилатися на файл сценарію, який буде виконано, а не на " +"виконуваний файл, у якому розміщено інтерпретатор Python. Якщо сценарію, " +"який буде запущено, немає, перший запис у *argv* може бути порожнім рядком. " +"Якщо цій функції не вдається ініціалізувати :data:`sys.argv`, за допомогою :" +"c:func:`Py_FatalError` повідомляється про фатальну умову." + +msgid "" +"If *updatepath* is zero, this is all the function does. If *updatepath* is " +"non-zero, the function also modifies :data:`sys.path` according to the " +"following algorithm:" +msgstr "" +"Якщо *updatepath* дорівнює нулю, це все, що функція робить. Якщо " +"*updatepath* відмінний від нуля, функція також змінює :data:`sys.path` " +"відповідно до наступного алгоритму:" + +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`." +msgstr "" +"Якщо ім’я існуючого сценарію передається в ``argv[0]``, абсолютний шлях до " +"каталогу, де розташований сценарій, додається до :data:`sys.path`." + +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 "" +"В іншому випадку (тобто, якщо *argc* дорівнює ``0`` або ``argv[0]`` не " +"вказує на існуюче ім’я файлу), до :data:`sys.path` додається порожній рядок, " +"що те саме, що додавати поточний робочий каталог (``\".\"``)." + +msgid "" +"See also :c:member:`PyConfig.orig_argv` and :c:member:`PyConfig.argv` " +"members of the :ref:`Python Initialization Configuration `." +msgstr "" + +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 "" + +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::" +msgstr "" +"У версіях до 3.1.3 ви можете досягти того самого ефекту, вручну витягнувши " +"перший елемент :data:`sys.path` після виклику :c:func:`PySys_SetArgv`, " +"наприклад, використовуючи::" + +msgid "PyRun_SimpleString(\"import sys; sys.path.pop(0)\\n\");" +msgstr "" + +msgid "" +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"argv` and :c:member:`PyConfig.parse_argv` should be used instead, see :ref:" +"`Python Initialization Configuration `." +msgstr "" + +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`." +msgstr "" +"Ця функція працює як :c:func:`PySys_SetArgvEx` з *updatepath*, встановленим " +"на ``1``, якщо інтерпретатор :program:`python` не було запущено з :option:`-" +"I`." + +msgid "The *updatepath* value depends on :option:`-I`." +msgstr "Значення *updatepath* залежить від :option:`-I`." + +msgid "" +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"home` should be used instead, see :ref:`Python Initialization Configuration " +"`." +msgstr "" + +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 "" +"Встановіть типовий \"домашній\" каталог, тобто розташування стандартних " +"бібліотек Python. Дивіться :envvar:`PYTHONHOME` для визначення значення " +"рядка аргументу." + +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 "" +"Аргумент має вказувати на символьний рядок із нульовим закінченням у " +"статичному сховищі, вміст якого не змінюватиметься протягом виконання " +"програми. Жоден код інтерпретатора Python не змінить вміст цього сховища." + +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." +msgstr "" + +msgid "" +"Get :c:member:`PyConfig.home` or :envvar:`PYTHONHOME` environment variable " +"instead." +msgstr "" + +msgid "Thread State and the Global Interpreter Lock" +msgstr "Стан потоку та глобальне блокування інтерпретатора" + +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 " +"interpreter lock` or :term:`GIL`, that must be held by the current thread " +"before it can safely access Python objects. Without the lock, even the " +"simplest operations could cause problems in a multi-threaded program: for " +"example, when two threads simultaneously increment the reference count of " +"the same object, the reference count could end up being incremented only " +"once instead of twice." +msgstr "" +"Інтерпретатор Python не є повністю потокобезпечним. Щоб підтримувати " +"багатопотокові програми Python, існує глобальне блокування, яке називається :" +"term:`global interpreter lock` або :term:`GIL`, яке має утримуватися " +"поточним потоком, перш ніж він зможе безпечно отримати доступ до об’єктів " +"Python. Без блокування навіть найпростіші операції можуть спричинити " +"проблеми в багатопотоковій програмі: наприклад, коли два потоки одночасно " +"збільшують кількість посилань на один і той же об’єкт, кількість посилань " +"може збільшитися лише один раз, а не двічі." + +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." +msgstr "" +"Тому існує правило, згідно з яким лише потік, який отримав :term:`GIL`, може " +"працювати з об’єктами Python або викликати функції API Python/C. Щоб " +"імітувати паралельне виконання, інтерпретатор регулярно намагається " +"перемикати потоки (див. :func:`sys.setswitchinterval`). Блокування також " +"знімається навколо можливого блокування операцій введення-виведення, таких " +"як читання або запис файлу, щоб тим часом могли працювати інші потоки Python." + +msgid "" +"The Python interpreter keeps some thread-specific bookkeeping information " +"inside a data structure called :c:type:`PyThreadState`. There's also one " +"global variable pointing to the current :c:type:`PyThreadState`: it can be " +"retrieved using :c:func:`PyThreadState_Get`." +msgstr "" +"Інтерпретатор Python зберігає певну облікову інформацію про потоки в " +"структурі даних під назвою :c:type:`PyThreadState`. Існує також одна " +"глобальна змінна, яка вказує на поточний :c:type:`PyThreadState`: її можна " +"отримати за допомогою :c:func:`PyThreadState_Get`." + +msgid "Releasing the GIL from extension code" +msgstr "Реліз GIL від коду розширення" + +msgid "" +"Most extension code manipulating the :term:`GIL` has the following simple " +"structure::" +msgstr "" +"Більшість кодів розширення, які маніпулюють :term:`GIL`, мають таку просту " +"структуру:" + +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 "" + +msgid "This is so common that a pair of macros exists to simplify it::" +msgstr "" +"Це настільки поширене явище, що для його спрощення існує пара макросів:" + +msgid "" +"Py_BEGIN_ALLOW_THREADS\n" +"... Do some blocking I/O operation ...\n" +"Py_END_ALLOW_THREADS" +msgstr "" + +msgid "" +"The :c:macro:`Py_BEGIN_ALLOW_THREADS` macro opens a new block and declares a " +"hidden local variable; the :c:macro:`Py_END_ALLOW_THREADS` macro closes the " +"block." +msgstr "" +"Макрос :c:macro:`Py_BEGIN_ALLOW_THREADS` відкриває новий блок і оголошує " +"приховану локальну змінну; макрос :c:macro:`Py_END_ALLOW_THREADS` закриває " +"блок." + +msgid "The block above expands to the following code::" +msgstr "Блок вище розширюється до наступного коду::" + +msgid "" +"PyThreadState *_save;\n" +"\n" +"_save = PyEval_SaveThread();\n" +"... Do some blocking I/O operation ...\n" +"PyEval_RestoreThread(_save);" +msgstr "" + +msgid "" +"Here is how these functions work: the global interpreter lock is used to " +"protect the pointer to the current thread state. When releasing the lock " +"and saving the thread state, the current thread state pointer must be " +"retrieved before the lock is released (since another thread could " +"immediately acquire the lock and store its own thread state in the global " +"variable). Conversely, when acquiring the lock and restoring the thread " +"state, the lock must be acquired before storing the thread state pointer." +msgstr "" +"Ось як ці функції працюють: глобальне блокування інтерпретатора " +"використовується для захисту вказівника на поточний стан потоку. При знятті " +"блокування та збереженні стану потоку вказівник поточного стану потоку " +"повинен бути отриманий до зняття блокування (оскільки інший потік може " +"негайно отримати блокування та зберегти свій власний стан потоку в " +"глобальній змінній). І навпаки, під час отримання блокування та відновлення " +"стану потоку, блокування має бути отримано перед збереженням покажчика стану " +"потоку." + +msgid "" +"Calling system I/O functions is the most common use case for releasing the " +"GIL, but it can also be useful before calling long-running computations " +"which don't need access to Python objects, such as compression or " +"cryptographic functions operating over memory buffers. For example, the " +"standard :mod:`zlib` and :mod:`hashlib` modules release the GIL when " +"compressing or hashing data." +msgstr "" +"Виклик системних функцій вводу-виводу є найпоширенішим варіантом " +"використання для випуску GIL, але він також може бути корисним перед " +"викликом тривалих обчислень, яким не потрібен доступ до об’єктів Python, " +"таких як стиснення або криптографічні функції, що працюють над буферами " +"пам’яті. Наприклад, стандартні модулі :mod:`zlib` і :mod:`hashlib` " +"звільняють GIL під час стиснення або хешування даних." + +msgid "Non-Python created threads" +msgstr "Потоки, створені не на Python" + +msgid "" +"When threads are created using the dedicated Python APIs (such as the :mod:" +"`threading` module), a thread state is automatically associated to them and " +"the code showed above is therefore correct. However, when threads are " +"created from C (for example by a third-party library with its own thread " +"management), they don't hold the GIL, nor is there a thread state structure " +"for them." +msgstr "" +"Коли потоки створюються за допомогою спеціальних API Python (таких як " +"модуль :mod:`threading`), стан потоку автоматично пов’язується з ними, і " +"код, показаний вище, є правильним. Однак, коли потоки створюються з C " +"(наприклад, сторонньою бібліотекою з власним керуванням потоками), вони не " +"містять GIL, а також для них не існує структури стану потоку." + +msgid "" +"If you need to call Python code from these threads (often this will be part " +"of a callback API provided by the aforementioned third-party library), you " +"must first register these threads with the interpreter by creating a thread " +"state data structure, then acquiring the GIL, and finally storing their " +"thread state pointer, before you can start using the Python/C API. When you " +"are done, you should reset the thread state pointer, release the GIL, and " +"finally free the thread state data structure." +msgstr "" +"Якщо вам потрібно викликати код Python із цих потоків (часто це буде " +"частиною API зворотного виклику, наданого вищезгаданою сторонньою " +"бібліотекою), ви повинні спочатку зареєструвати ці потоки в інтерпретаторі, " +"створивши структуру даних стану потоку, а потім отримати GIL і, нарешті, " +"збереження покажчика стану потоку, перш ніж ви зможете почати " +"використовувати API Python/C. Коли ви закінчите, ви повинні скинути " +"вказівник стану потоку, звільнити GIL і, нарешті, звільнити структуру даних " +"стану потоку." + +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:func:`PyGILState_Ensure` і :c:func:`PyGILState_Release` виконують " +"усе вищезазначене автоматично. Типова ідіома виклику Python із потоку C:" + +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 "" + +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." +msgstr "" + +msgid "Cautions about fork()" +msgstr "Застереження щодо fork()" + +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 " +"process forks only the thread that issued the fork will exist. This has a " +"concrete impact both on how locks must be handled and on all stored state in " +"CPython's runtime." +msgstr "" +"Ще одна важлива річ, на яку слід звернути увагу щодо потоків, це їхня " +"поведінка перед викликом C :c:func:`fork`. У більшості систем із :c:func:" +"`fork` після розгалуження процесу існуватиме лише потік, який видав " +"розгалуження. Це має конкретний вплив як на те, як потрібно обробляти " +"блокування, так і на весь збережений стан у середовищі виконання CPython." + +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` " +"by acquiring the locks it uses internally before the fork, and releasing " +"them afterwards. In addition, it resets any :ref:`lock-objects` in the " +"child. When extending or embedding Python, there is no way to inform Python " +"of additional (non-Python) locks that need to be acquired before or reset " +"after a fork. OS facilities such as :c:func:`!pthread_atfork` would need to " +"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." +msgstr "" + +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 " +"means finalizing all other :c:type:`PyThreadState` objects belonging to the " +"current interpreter and all other :c:type:`PyInterpreterState` objects. Due " +"to this and the special nature of the :ref:`\"main\" interpreter `, :c:func:`fork` should only be called in that " +"interpreter's \"main\" thread, where the CPython global runtime was " +"originally initialized. The only exception is if :c:func:`exec` will be " +"called immediately after." +msgstr "" +"Той факт, що всі інші потоки зникають, також означає, що стан виконання " +"CPython там має бути належним чином очищено, що й робить :func:`os.fork`. Це " +"означає завершення всіх інших об’єктів :c:type:`PyThreadState`, що належать " +"поточному інтерпретатору, і всіх інших об’єктів :c:type:" +"`PyInterpreterState`. Через це та особливу природу :ref:`\"main\" " +"інтерпретатора `, :c:func:`fork` слід викликати " +"лише в тому \"main\" потоці цього інтерпретатора, де початково " +"ініціалізовано глобальне середовище виконання CPython. Єдиним винятком є те, " +"що :c:func:`exec` буде викликано одразу після." + +msgid "High-level API" +msgstr "API високого рівня" + +msgid "" +"These are the most commonly used types and functions when writing C " +"extension code, or when embedding the Python interpreter:" +msgstr "" +"Це типи та функції, які найчастіше використовуються під час написання коду " +"розширення C або під час вбудовування інтерпретатора Python:" + +msgid "" +"This data structure represents the state shared by a number of cooperating " +"threads. Threads belonging to the same interpreter share their module " +"administration and a few other internal items. There are no public members " +"in this structure." +msgstr "" +"Ця структура даних представляє стан, спільний для кількох взаємодіючих " +"потоків. Потоки, що належать одному інтерпретатору, спільно використовують " +"адміністрування модуля та кілька інших внутрішніх елементів. У цій структурі " +"немає громадських учасників." + +msgid "" +"Threads belonging to different interpreters initially share nothing, except " +"process state like available memory, open file descriptors and such. The " +"global interpreter lock is also shared by all threads, regardless of to " +"which interpreter they belong." +msgstr "" +"Потоки, що належать різним інтерпретаторам, спочатку нічого спільного не " +"мають, окрім стану процесу, наприклад доступної пам’яті, відкритих файлових " +"дескрипторів тощо. Глобальне блокування інтерпретатора також " +"використовується для всіх потоків, незалежно від того, до якого " +"інтерпретатора вони належать." + +msgid "" +"This data structure represents the state of a single thread. The only " +"public data member is:" +msgstr "" + +msgid "This thread's interpreter state." +msgstr "" + +msgid "Deprecated function which does nothing." +msgstr "Застаріла функція, яка нічого не робить." + +msgid "" +"In Python 3.6 and older, this function created the GIL if it didn't exist." +msgstr "" +"У Python 3.6 і старіших версіях ця функція створювала GIL, якщо його не " +"існувало." + +msgid "The function now does nothing." +msgstr "Тепер функція нічого не робить." + +msgid "" +"This function is now called by :c:func:`Py_Initialize()`, so you don't have " +"to call it yourself anymore." +msgstr "" +"Ця функція тепер викликається :c:func:`Py_Initialize()`, тому вам більше не " +"потрібно викликати її самостійно." + +msgid "" +"This function cannot be called before :c:func:`Py_Initialize()` anymore." +msgstr "Цю функцію більше не можна викликати до :c:func:`Py_Initialize()`." + +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 " +"``NULL``). If the lock has been created, the current thread must have " +"acquired it." +msgstr "" +"Звільніть глобальне блокування інтерпретатора (якщо його було створено) і " +"скиньте стан потоку до ``NULL``, повертаючи попередній стан потоку (який не " +"є ``NULL``). Якщо блокування було створено, поточний потік повинен отримати " +"його." + +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 " +"created, the current thread must not have acquired it, otherwise deadlock " +"ensues." +msgstr "" +"Отримайте глобальне блокування інтерпретатора (якщо його було створено) і " +"встановіть стан потоку на *tstate*, який не має бути ``NULL``. Якщо " +"блокування було створено, поточний потік не повинен отримати його, інакше " +"виникає взаємоблокування." + +msgid "" +"Calling this function from a thread when the runtime is finalizing will " +"terminate the thread, even if the thread was not created by Python. You can " +"use :c:func:`Py_IsFinalizing` or :func:`sys.is_finalizing` to check if the " +"interpreter is in process of being finalized before calling this function to " +"avoid unwanted termination." +msgstr "" + +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 "" +"Повертає поточний стан потоку. Необхідно утримувати глобальне блокування " +"інтерпретатора. Коли поточний стан потоку ``NULL``, це викликає фатальну " +"помилку (тому абоненту не потрібно перевіряти ``NULL``)." + +msgid "See also :c:func:`PyThreadState_GetUnchecked`." +msgstr "" + +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 "" + +msgid "" +"In Python 3.5 to 3.12, the function was private and known as " +"``_PyThreadState_UncheckedGet()``." +msgstr "" + +msgid "" +"Swap the current thread state with the thread state given by the argument " +"*tstate*, which may be ``NULL``. The global interpreter lock must be held " +"and is not released." +msgstr "" +"Замінити поточний стан потоку на стан потоку, заданий аргументом *tstate*, " +"який може бути ``NULL``. Глобальне блокування інтерпретатора має бути " +"утримано та не звільнене." + +msgid "" +"The following functions use thread-local storage, and are not compatible " +"with sub-interpreters:" +msgstr "" +"Наступні функції використовують локальне сховище потоків і несумісні з " +"підінтерпретаторами:" + +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." +msgstr "" +"Переконайтеся, що поточний потік готовий викликати API Python C незалежно " +"від поточного стану Python або глобального блокування інтерпретатора. Це " +"може бути викликано скільки завгодно разів потоком, якщо кожен виклик " +"відповідає виклику :c:func:`PyGILState_Release`. Загалом, між викликами :c:" +"func:`PyGILState_Ensure` і :c:func:`PyGILState_Release` можна " +"використовувати інші пов’язані з потоками API, якщо стан потоку відновлено " +"до попереднього стану до Release(). Наприклад, нормальне використання " +"макросів :c:macro:`Py_BEGIN_ALLOW_THREADS` і :c:macro:`Py_END_ALLOW_THREADS` " +"є прийнятним." + +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`." +msgstr "" +"Значення, що повертається, є непрозорим \"дескриптором\" стану потоку під " +"час виклику :c:func:`PyGILState_Ensure`, і його потрібно передати в :c:func:" +"`PyGILState_Release`, щоб Python залишався в тому самому стані. Незважаючи " +"на те, що рекурсивні виклики дозволені, ці дескриптори *не можна* спільно " +"використовувати — кожен унікальний виклик :c:func:`PyGILState_Ensure` " +"повинен зберігати дескриптор для свого виклику :c:func:`PyGILState_Release`." + +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 "" +"Коли функція повертається, поточний потік зберігатиме GIL і зможе викликати " +"довільний код Python. Невдача є фатальною помилкою." + +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)." +msgstr "" +"Вивільніть будь-які раніше отримані ресурси. Після цього виклику стан Python " +"буде таким же, як і до відповідного виклику :c:func:`PyGILState_Ensure` (але " +"зазвичай цей стан буде невідомий абоненту, тому використовується GILState " +"API)." + +msgid "" +"Every call to :c:func:`PyGILState_Ensure` must be matched by a call to :c:" +"func:`PyGILState_Release` on the same thread." +msgstr "" +"Кожен виклик :c:func:`PyGILState_Ensure` має відповідати виклику :c:func:" +"`PyGILState_Release` у тому самому потоці." + +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 " +"always has such a thread-state, even if no auto-thread-state call has been " +"made on the main thread. This is mainly a helper/diagnostic function." +msgstr "" +"Отримати поточний стан потоку для цього потоку. Може повертати ``NULL``, " +"якщо API GILState не використовувався в поточному потоці. Зверніть увагу, що " +"основний потік завжди має такий стан потоку, навіть якщо в основному потоці " +"не було зроблено виклик автоматичного стану потоку. Це в основному допоміжна/" +"діагностична функція." + +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 " +"its Python thread state initialized and currently is holding the GIL will it " +"return ``1``. This is mainly a helper/diagnostic function. It can be useful " +"for example in callback contexts or memory allocation functions when knowing " +"that the GIL is locked can allow the caller to perform sensitive actions or " +"otherwise behave differently." +msgstr "" +"Повертає ``1``, якщо поточний потік містить GIL, і ``0`` інакше. Цю функцію " +"можна викликати з будь-якого потоку в будь-який час. Лише якщо він " +"ініціалізував стан потоку Python і зараз утримує GIL, він поверне ``1``. Це " +"в основному допоміжна/діагностична функція. Це може бути корисно, наприклад, " +"у контекстах зворотного виклику або функціях виділення пам’яті, коли знання " +"про те, що GIL заблоковано, може дозволити абоненту виконувати конфіденційні " +"дії або іншим чином поводитися по-іншому." + +msgid "" +"The following macros are normally used without a trailing semicolon; look " +"for example usage in the Python source distribution." +msgstr "" +"Наступні макроси зазвичай використовуються без крапки з комою в кінці; " +"подивіться, наприклад, використання в вихідному дистрибутиві Python." + +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." +msgstr "" +"Цей макрос розширюється до ``{ PyThreadState *_save; _save = " +"PyEval_SaveThread();``. Зауважте, що він містить відкриваючу дужку; він " +"повинен відповідати наступному макросу :c:macro:`Py_END_ALLOW_THREADS`. " +"Дивіться вище для подальшого обговорення цього макросу." + +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." +msgstr "" +"Цей макрос розширюється до ``PyEval_RestoreThread(_save); }``. Зверніть " +"увагу, що він містить закриваючу дужку; він повинен відповідати попередньому " +"макросу :c:macro:`Py_BEGIN_ALLOW_THREADS`. Дивіться вище для подальшого " +"обговорення цього макросу." + +msgid "" +"This macro expands to ``PyEval_RestoreThread(_save);``: it is equivalent to :" +"c:macro:`Py_END_ALLOW_THREADS` without the closing brace." +msgstr "" +"Цей макрос розширюється до ``PyEval_RestoreThread(_save);``: він " +"еквівалентний :c:macro:`Py_END_ALLOW_THREADS` без закриваючої дужки." + +msgid "" +"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 "" +"Цей макрос розширюється до ``_save = PyEval_SaveThread();``: він " +"еквівалентний :c:macro:`Py_BEGIN_ALLOW_THREADS` без відкриваючої дужки та " +"оголошення змінної." + +msgid "Low-level API" +msgstr "API низького рівня" + +msgid "" +"All of the following functions must be called after :c:func:`Py_Initialize`." +msgstr "" +"Усі наведені нижче функції мають викликатися після :c:func:`Py_Initialize`." + +msgid ":c:func:`Py_Initialize()` now initializes the :term:`GIL`." +msgstr ":c:func:`Py_Initialize()` тепер ініціалізує :term:`GIL`." + +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 "" +"Створіть новий об’єкт стану інтерпретатора. Глобальне блокування " +"інтерпретатора не потрібно утримувати, але можна утримувати, якщо необхідно " +"серіалізувати виклики цієї функції." + +msgid "" +"Raises an :ref:`auditing event ` ``cpython." +"PyInterpreterState_New`` with no arguments." +msgstr "" +"Викликає :ref:`подію аудиту ` ``cpython.PyInterpreterState_New`` " +"без аргументів." + +msgid "" +"Reset all information in an interpreter state object. The global " +"interpreter lock must be held." +msgstr "" +"Скинути всю інформацію в об’єкті стану інтерпретатора. Необхідно утримувати " +"глобальне блокування інтерпретатора." + +msgid "" +"Raises an :ref:`auditing event ` ``cpython." +"PyInterpreterState_Clear`` with no arguments." +msgstr "" +"Викликає :ref:`подію аудиту ` ``cpython.PyInterpreterState_Clear`` " +"без аргументів." + +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:func:`PyInterpreterState_Clear`." + +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 "" +"Створіть новий об’єкт стану потоку, що належить даному об’єкту " +"інтерпретатора. Глобальне блокування інтерпретатора не потрібно утримувати, " +"але можна утримувати, якщо необхідно серіалізувати виклики цієї функції." + +msgid "" +"Reset all information in a thread state object. The global interpreter lock " +"must be held." +msgstr "" +"Скинути всю інформацію в об’єкті стану потоку. Необхідно утримувати " +"глобальне блокування інтерпретатора." + +msgid "" +"This function now calls the :c:member:`PyThreadState.on_delete` callback. " +"Previously, that happened in :c:func:`PyThreadState_Delete`." +msgstr "" +"Ця функція тепер викликає зворотний виклик :c:member:`PyThreadState." +"on_delete`. Раніше це траплялося в :c:func:`PyThreadState_Delete`." + +msgid "The :c:member:`PyThreadState.on_delete` callback was removed." +msgstr "" + +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`." +msgstr "" +"Знищити об’єкт стану потоку. Глобальне блокування інтерпретатора не потрібно " +"утримувати. Стан потоку має бути скинуто попереднім викликом :c:func:" +"`PyThreadState_Clear`." + +msgid "" +"Destroy the current thread state and release the global interpreter lock. " +"Like :c:func:`PyThreadState_Delete`, the global interpreter lock must be " +"held. The thread state must have been reset with a previous call to :c:func:" +"`PyThreadState_Clear`." +msgstr "" + +msgid "Get the current frame of the Python thread state *tstate*." +msgstr "Отримати поточний кадр стану потоку Python *tstate*." + +msgid "" +"Return a :term:`strong reference`. Return ``NULL`` if no frame is currently " +"executing." +msgstr "" +"Повертає :term:`strong reference`. Повертає ``NULL``, якщо наразі не " +"виконується жоден кадр." + +msgid "See also :c:func:`PyEval_GetFrame`." +msgstr "Дивіться також :c:func:`PyEval_GetFrame`." + +msgid "*tstate* must not be ``NULL``." +msgstr "*tstate* не має бути ``NULL``." + +msgid "" +"Get the unique thread state identifier of the Python thread state *tstate*." +msgstr "Отримайте унікальний ідентифікатор стану потоку Python *tstate*." + +msgid "Get the interpreter of the Python thread state *tstate*." +msgstr "Отримайте інтерпретатор стану потоку Python *tstate*." + +msgid "Suspend tracing and profiling in the Python thread state *tstate*." +msgstr "" + +msgid "Resume them using the :c:func:`PyThreadState_LeaveTracing` function." +msgstr "" + +msgid "" +"Resume tracing and profiling in the Python thread state *tstate* suspended " +"by the :c:func:`PyThreadState_EnterTracing` function." +msgstr "" + +msgid "" +"See also :c:func:`PyEval_SetTrace` and :c:func:`PyEval_SetProfile` functions." +msgstr "" + +msgid "Get the current interpreter." +msgstr "Отримати поточний перекладач." + +msgid "" +"Issue a fatal error if there no current Python thread state or no current " +"interpreter. It cannot return NULL." +msgstr "" +"Видає фатальну помилку, якщо немає поточного стану потоку Python або " +"поточного інтерпретатора. Він не може повертати NULL." + +msgid "The caller must hold the GIL." +msgstr "Абонент повинен тримати GIL." + +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 "" +"Повернути унікальний ідентифікатор перекладача. Якщо під час цього сталася " +"якась помилка, повертається ``-1`` і встановлюється помилка." + +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 "" +"Повертає словник, у якому можуть зберігатися дані інтерпретатора. Якщо ця " +"функція повертає ``NULL``, це означає, що жодного винятку не було викликано, " +"і абонент повинен припустити, що недоступний dict інтерпретатора." + +msgid "" +"This is not a replacement for :c:func:`PyModule_GetState()`, which " +"extensions should use to store interpreter-specific state information." +msgstr "" +"Це не заміна :c:func:`PyModule_GetState()`, який розширення мають " +"використовувати для зберігання інформації про стан інтерпретатора." + +msgid "" +"Return a :term:`strong reference` to the ``__main__`` :ref:`module object " +"` for the given interpreter." +msgstr "" + +msgid "Type of a frame evaluation function." +msgstr "Тип функції оцінки фрейму." + +msgid "" +"The *throwflag* parameter is used by the ``throw()`` method of generators: " +"if non-zero, handle the current exception." +msgstr "" +"Параметр *throwflag* використовується методом ``throw()`` генераторів: якщо " +"він відмінний від нуля, обробити поточний виняток." + +msgid "The function now takes a *tstate* parameter." +msgstr "Тепер функція приймає параметр *tstate*." + +msgid "" +"The *frame* parameter changed from ``PyFrameObject*`` to " +"``_PyInterpreterFrame*``." +msgstr "" + +msgid "Get the frame evaluation function." +msgstr "Отримати функцію оцінки фрейму." + +msgid "See the :pep:`523` \"Adding a frame evaluation API to CPython\"." +msgstr "Перегляньте :pep:`523` \"Додавання API оцінки фрейму до CPython\"." + +msgid "Set the frame evaluation function." +msgstr "Встановіть функцію оцінки кадру." + +msgid "" +"Return a dictionary in which extensions can store thread-specific state " +"information. Each extension should use a unique key to use to store state " +"in the dictionary. It is okay to call this function when no current thread " +"state is available. If this function returns ``NULL``, no exception has been " +"raised and the caller should assume no current thread state is available." +msgstr "" +"Повертає словник, у якому розширення можуть зберігати інформацію про стан " +"потоку. Кожне розширення має використовувати унікальний ключ для збереження " +"стану в словнику. Цю функцію можна викликати, якщо поточний стан потоку " +"недоступний. Якщо ця функція повертає ``NULL``, це означає, що жодного " +"винятку не було викликано, і абонент повинен вважати, що поточний стан " +"потоку недоступний." + +msgid "" +"Asynchronously raise an exception in a thread. The *id* argument is the " +"thread id of the target thread; *exc* is the exception object to be raised. " +"This function does not steal any references to *exc*. To prevent naive " +"misuse, you must write your own C extension to call this. Must be called " +"with the GIL held. Returns the number of thread states modified; this is " +"normally one, but will be zero if the thread id isn't found. If *exc* is " +"``NULL``, the pending exception (if any) for the thread is cleared. This " +"raises no exceptions." +msgstr "" + +msgid "" +"The type of the *id* parameter changed from :c:expr:`long` to :c:expr:" +"`unsigned long`." +msgstr "" + +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 "" +"Отримайте глобальне блокування інтерпретатора та встановіть поточний стан " +"потоку на *tstate*, який не має бути ``NULL``. Замок повинен бути створений " +"раніше. Якщо цей потік уже має блокування, виникає взаємоблокування." + +msgid "" +"Updated to be consistent with :c:func:`PyEval_RestoreThread`, :c:func:" +"`Py_END_ALLOW_THREADS`, and :c:func:`PyGILState_Ensure`, and terminate the " +"current thread if called while the interpreter is finalizing." +msgstr "" +"Оновлено для узгодження з :c:func:`PyEval_RestoreThread`, :c:func:" +"`Py_END_ALLOW_THREADS` і :c:func:`PyGILState_Ensure`, а також завершує " +"поточний потік, якщо він викликається, поки інтерпретатор завершує роботу." + +msgid "" +":c:func:`PyEval_RestoreThread` is a higher-level function which is always " +"available (even when threads have not been initialized)." +msgstr "" +":c:func:`PyEval_RestoreThread` — це функція вищого рівня, яка завжди " +"доступна (навіть якщо потоки не ініціалізовано)." + +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 " +"by the current thread. The *tstate* argument, which must not be ``NULL``, " +"is only used to check that it represents the current thread state --- if it " +"isn't, a fatal error is reported." +msgstr "" +"Скиньте поточний стан потоку на ``NULL`` і звільніть глобальне блокування " +"інтерпретатора. Блокування має бути створено раніше та утримуватися поточним " +"потоком. Аргумент *tstate*, який не має бути ``NULL``, використовується лише " +"для перевірки того, що він представляє поточний стан потоку --- якщо це не " +"так, повідомляється про фатальну помилку." + +msgid "" +":c:func:`PyEval_SaveThread` is a higher-level function which is always " +"available (even when threads have not been initialized)." +msgstr "" +":c:func:`PyEval_SaveThread` — це функція вищого рівня, яка завжди доступна " +"(навіть якщо потоки не ініціалізовано)." + +msgid "Sub-interpreter support" +msgstr "Підтримка субінтерпретатора" + +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 " +"same process and perhaps even in the same thread. Sub-interpreters allow you " +"to do that." +msgstr "" +"Хоча в більшості випадків ви вбудовуєте лише один інтерпретатор Python, є " +"випадки, коли вам потрібно створити кілька незалежних інтерпретаторів в " +"одному процесі і, можливо, навіть в одному потоці. Суб-інтерпретатори " +"дозволяють це зробити." + +msgid "" +"The \"main\" interpreter is the first one created when the runtime " +"initializes. It is usually the only Python interpreter in a process. Unlike " +"sub-interpreters, the main interpreter has unique process-global " +"responsibilities like signal handling. It is also responsible for execution " +"during runtime initialization and is usually the active interpreter during " +"runtime finalization. The :c:func:`PyInterpreterState_Main` function " +"returns a pointer to its state." +msgstr "" +"\"Головний\" інтерпретатор є першим, який створюється під час ініціалізації " +"середовища виконання. Зазвичай це єдиний інтерпретатор Python у процесі. На " +"відміну від субінтерпретаторів, головний інтерпретатор має унікальні " +"глобальні обов’язки процесу, такі як обробка сигналів. Він також відповідає " +"за виконання під час ініціалізації середовища виконання та зазвичай є " +"активним інтерпретатором під час завершення виконання. Функція :c:func:" +"`PyInterpreterState_Main` повертає вказівник на його стан." + +msgid "" +"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:func:" +"`PyThreadState_Swap`. Ви можете створювати та знищувати їх за допомогою " +"таких функцій:" + +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 "" + +msgid "Structure fields:" +msgstr "Поля структури:" + +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 "" + +msgid "" +"If this is ``0`` then :c:member:`~PyInterpreterConfig." +"check_multi_interp_extensions` must be ``1`` (non-zero). If this is ``1`` " +"then :c:member:`~PyInterpreterConfig.gil` must not be :c:macro:" +"`PyInterpreterConfig_OWN_GIL`." +msgstr "" + +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 "" + +msgid "" +"Note that the :mod:`subprocess` module still works when fork is disallowed." +msgstr "" + +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 "" + +msgid "" +"Note that the :mod:`subprocess` module still works when exec is disallowed." +msgstr "" + +msgid "" +"If this is ``0`` then the sub-interpreter's :mod:`threading` module won't " +"create threads. Otherwise threads are allowed." +msgstr "" + +msgid "" +"If this is ``0`` then the sub-interpreter's :mod:`threading` module won't " +"create daemon threads. Otherwise daemon threads are allowed (as long as :c:" +"member:`~PyInterpreterConfig.allow_threads` is non-zero)." +msgstr "" + +msgid "" +"If this is ``0`` then all extension modules may be imported, including " +"legacy (single-phase init) modules, in any thread where the sub-interpreter " +"is currently active. Otherwise only multi-phase init extension modules (see :" +"pep:`489`) may be imported. (Also see :c:macro:" +"`Py_mod_multiple_interpreters`.)" +msgstr "" + +msgid "" +"This must be ``1`` (non-zero) if :c:member:`~PyInterpreterConfig." +"use_main_obmalloc` is ``0``." +msgstr "" + +msgid "" +"This determines the operation of the GIL for the sub-interpreter. It may be " +"one of the following:" +msgstr "" + +msgid "Use the default selection (:c:macro:`PyInterpreterConfig_SHARED_GIL`)." +msgstr "" + +msgid "Use (share) the main interpreter's GIL." +msgstr "" + +msgid "Use the sub-interpreter's own GIL." +msgstr "" + +msgid "" +"If this is :c:macro:`PyInterpreterConfig_OWN_GIL` then :c:member:" +"`PyInterpreterConfig.use_main_obmalloc` must be ``0``." +msgstr "" + +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)." +msgstr "" +"Створіть новий підінтерпретатор. Це (майже) повністю окреме середовище для " +"виконання коду Python. Зокрема, новий інтерпретатор має окремі незалежні " +"версії всіх імпортованих модулів, включаючи фундаментальні модулі :mod:" +"`builtins`, :mod:`__main__` і :mod:`sys`. Таблиця завантажених модулів " +"(``sys.modules``) і шлях пошуку модуля (``sys.path``) також окремі. Нове " +"середовище не має змінної ``sys.argv``. Він має нові стандартні файлові " +"об’єкти потоку вводу/виводу ``sys.stdin``, ``sys.stdout`` і ``sys.stderr`` " +"(однак вони посилаються на ті самі основні дескриптори файлів)." + +msgid "" +"The given *config* controls the options with which the interpreter is " +"initialized." +msgstr "" + +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 " +"state. Note that no actual thread is created; see the discussion of thread " +"states below. If creation of the new interpreter is unsuccessful, " +"*tstate_p* is set to ``NULL``; no exception is set since the exception state " +"is stored in the current thread state and there may not be a current thread " +"state." +msgstr "" + +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. " +"Likewise a current thread state must be set on entry. On success, the " +"returned thread state will be set as current. If the sub-interpreter is " +"created with its own GIL then the GIL of the calling interpreter will be " +"released. When the function returns, the new interpreter's GIL will be held " +"by the current thread and the previously interpreter's GIL will remain " +"released here." +msgstr "" + +msgid "" +"Sub-interpreters are most effective when isolated from each other, with " +"certain functionality restricted::" +msgstr "" + +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 "" + +msgid "" +"Note that the config is used only briefly and does not get modified. During " +"initialization the config's values are converted into various :c:type:" +"`PyInterpreterState` values. A read-only copy of the config may be stored " +"internally on the :c:type:`PyInterpreterState`." +msgstr "" + +msgid "Extension modules are shared between (sub-)interpreters as follows:" +msgstr "" +"Модулі розширення розподіляються між (під)інтерпретаторами наступним чином:" + +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." +msgstr "" +"Для модулів, які використовують багатофазову ініціалізацію, напр. :c:func:" +"`PyModule_FromDefAndSpec`, окремий об’єкт модуля створюється та " +"ініціалізується для кожного інтерпретатора. Лише статичні та глобальні " +"змінні рівня C використовуються між цими об’єктами модуля." + +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)." +msgstr "" +"Для модулів, які використовують однофазну ініціалізацію, напр. :c:func:" +"`PyModule_Create`, коли конкретне розширення імпортується вперше, воно " +"ініціалізується звичайним чином, а (неглибока) копія словника його модуля " +"видаляється. Коли те саме розширення імпортується іншим " +"(під)інтерпретатором, новий модуль ініціалізується та заповнюється вмістом " +"цієї копії; функція ``init`` розширення не викликається. Таким чином, " +"об’єкти в словнику модуля розподіляються між (суб-)інтерпретаторами, що може " +"спричинити небажану поведінку (див. `Bugs and caveats`_ нижче)." + +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." +msgstr "" +"Зауважте, що це відрізняється від того, що відбувається, коли розширення " +"імпортується після повної повторної ініціалізації інтерпретатора викликом :c:" +"func:`Py_FinalizeEx` і :c:func:`Py_Initialize`; у цьому випадку функція " +"``initmodule`` розширення *викликається* знову. Як і у випадку з " +"багатофазною ініціалізацією, це означає, що ці модулі спільно використовують " +"лише статичні та глобальні змінні рівня C." + +msgid "" +"Create a new sub-interpreter. This is essentially just a wrapper around :c:" +"func:`Py_NewInterpreterFromConfig` with a config that preserves the existing " +"behavior. The result is an unisolated sub-interpreter that shares the main " +"interpreter's GIL, allows fork/exec, allows daemon threads, and allows " +"single-phase init modules." +msgstr "" + +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 " +"thread states below. When the call returns, the current thread state is " +"``NULL``. All thread states associated with this interpreter are " +"destroyed. The global interpreter lock used by the target interpreter must " +"be held before calling this function. No GIL is held when it returns." +msgstr "" + +msgid "" +":c:func:`Py_FinalizeEx` will destroy all sub-interpreters that haven't been " +"explicitly destroyed at that point." +msgstr "" + +msgid "A Per-Interpreter GIL" +msgstr "" + +msgid "" +"Using :c:func:`Py_NewInterpreterFromConfig` you can create a sub-interpreter " +"that is completely isolated from other interpreters, including having its " +"own GIL. The most important benefit of this isolation is that such an " +"interpreter can execute Python code without being blocked by other " +"interpreters or blocking any others. Thus a single Python process can truly " +"take advantage of multiple CPU cores when running Python code. The " +"isolation also encourages a different approach to concurrency than that of " +"just using threads. (See :pep:`554`.)" +msgstr "" + +msgid "" +"Using an isolated interpreter requires vigilance in preserving that " +"isolation. That especially means not sharing any objects or mutable state " +"without guarantees about thread-safety. Even objects that are otherwise " +"immutable (e.g. ``None``, ``(1, 5)``) can't normally be shared because of " +"the refcount. One simple but less-efficient approach around this is to use " +"a global lock around all use of some state (or object). Alternately, " +"effectively immutable objects (like integers or strings) can be made safe in " +"spite of their refcounts by making them :term:`immortal`. In fact, this has " +"been done for the builtin singletons, small integers, and a number of other " +"builtin objects." +msgstr "" + +msgid "" +"If you preserve isolation then you will have access to proper multi-core " +"computing without the complications that come with free-threading. Failure " +"to preserve isolation will expose you to the full consequences of free-" +"threading, including races and hard-to-debug crashes." +msgstr "" + +msgid "" +"Aside from that, one of the main challenges of using multiple isolated " +"interpreters is how to communicate between them safely (not break isolation) " +"and efficiently. The runtime and stdlib do not provide any standard " +"approach to this yet. A future stdlib module would help mitigate the effort " +"of preserving isolation and expose effective tools for communicating (and " +"sharing) data between interpreters." +msgstr "" + +msgid "Bugs and caveats" +msgstr "Помилки та застереження" + +msgid "" +"Because sub-interpreters (and the main interpreter) are part of the same " +"process, the insulation between them isn't perfect --- for example, using " +"low-level file operations like :func:`os.close` they can (accidentally or " +"maliciously) affect each other's open files. Because of the way extensions " +"are shared between (sub-)interpreters, some extensions may not work " +"properly; this is especially likely when using single-phase initialization " +"or (static) global variables. It is possible to insert objects created in " +"one sub-interpreter into a namespace of another (sub-)interpreter; this " +"should be avoided if possible." +msgstr "" +"Оскільки субінтерпретатори (і головний інтерпретатор) є частиною одного " +"процесу, ізоляція між ними не є ідеальною --- наприклад, використовуючи " +"низькорівневі файлові операції, такі як :func:`os.close`, вони можуть " +"(випадково або зловмисно) впливають на відкриті файли один одного. Через те, " +"як розширення розподіляються між (під)інтерпретаторами, деякі розширення " +"можуть не працювати належним чином; це особливо ймовірно при використанні " +"однофазної ініціалізації або (статичних) глобальних змінних. Можна вставляти " +"об’єкти, створені в одному суб-інтерпретаторі, у простір імен іншого " +"(суб-)інтерпретатора; цього слід уникати, якщо це можливо." + +msgid "" +"Special care should be taken to avoid sharing user-defined functions, " +"methods, instances or classes between sub-interpreters, since import " +"operations executed by such objects may affect the wrong (sub-)interpreter's " +"dictionary of loaded modules. It is equally important to avoid sharing " +"objects from which the above are reachable." +msgstr "" +"Слід приділяти особливу увагу уникненню спільного використання визначених " +"користувачем функцій, методів, екземплярів або класів між " +"підінтерпретаторами, оскільки операції імпорту, які виконуються такими " +"об’єктами, можуть вплинути на неправильний (під)інтерпретатор словник " +"завантажених модулів. Не менш важливо уникати спільного використання " +"об’єктів, з яких доступні вищевказані." + +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." +msgstr "" + +msgid "Asynchronous Notifications" +msgstr "Асинхронні сповіщення" + +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 "" +"Надається механізм для створення асинхронних сповіщень головному потоку " +"інтерпретатора. Ці сповіщення приймають форму вказівника функції та " +"аргументу вказівника void." + +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 "" +"Заплануйте виклик функції з основного потоку інтерпретатора. У разі успіху " +"повертається ``0`` і *func* ставиться в чергу для виклику в основному " +"потоці. У разі помилки повертається ``-1`` без встановлення винятків." + +msgid "" +"When successfully queued, *func* will be *eventually* called from the main " +"interpreter thread with the argument *arg*. It will be called " +"asynchronously with respect to normally running Python code, but with both " +"these conditions met:" +msgstr "" +"Після успішного розміщення в черзі *func* буде *зрештою* викликано з " +"основного потоку інтерпретатора з аргументом *arg*. Його буде викликано " +"асинхронно щодо нормально запущеного коду Python, але з дотриманням обох цих " +"умов:" + +msgid "on a :term:`bytecode` boundary;" +msgstr "на межі :term:`bytecode`;" + +msgid "" +"with the main thread holding the :term:`global interpreter lock` (*func* can " +"therefore use the full C API)." +msgstr "" +"з головним потоком, який утримує :term:`global interpreter lock` (*func* " +"може використовувати повний C API)." + +msgid "" +"*func* must return ``0`` on success, or ``-1`` on failure with an exception " +"set. *func* won't be interrupted to perform another asynchronous " +"notification recursively, but it can still be interrupted to switch threads " +"if the global interpreter lock is released." +msgstr "" +"*func* має повернути ``0`` у разі успіху або ``-1`` у разі помилки з набором " +"винятків. *func* не буде перервано для рекурсивного виконання іншого " +"асинхронного сповіщення, але його все одно можна перервати для перемикання " +"потоків, якщо глобальне блокування інтерпретатора звільнено." + +msgid "" +"This function doesn't need a current thread state to run, and it doesn't " +"need the global interpreter lock." +msgstr "" +"Цій функції не потрібен поточний стан потоку для запуску, і їй не потрібне " +"блокування глобального інтерпретатора." + +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 "" +"Щоб викликати цю функцію в підінтерпретаторі, абонент, що викликає, повинен " +"мати GIL. В іншому випадку функція *func* може бути запланована для виклику " +"з неправильного інтерпретатора." + +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`." +msgstr "" +"Це функція низького рівня, корисна лише в дуже особливих випадках. Немає " +"гарантії, що *func* буде викликано якомога швидше. Якщо основний потік " +"зайнятий виконанням системного виклику, *func* не буде викликано до " +"повернення системного виклику. Ця функція зазвичай **не** підходить для " +"виклику коду Python із довільних потоків C. Замість цього використовуйте :" +"ref:`PyGILState API `." + +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 " +"from the main interpreter. Each subinterpreter now has its own list of " +"scheduled calls." +msgstr "" +"Якщо ця функція викликається у підінтерпретаторі, функція *func* тепер " +"запланована для виклику з підінтерпретатора, а не з основного " +"інтерпретатора. Кожен субінтерпретатор тепер має власний список запланованих " +"викликів." + +msgid "Profiling and Tracing" +msgstr "Профілювання та трасування" + +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 "" +"Інтерпретатор Python надає деяку низькорівневу підтримку для підключення " +"засобів профілювання та трасування виконання. Вони використовуються для " +"інструментів профілювання, налагодження та аналізу покриття." + +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 " +"call instead. The essential attributes of the facility have not changed; " +"the interface allows trace functions to be installed per-thread, and the " +"basic events reported to the trace function are the same as had been " +"reported to the Python-level trace functions in previous versions." +msgstr "" +"Цей інтерфейс C дозволяє коду профілювання або трасування уникнути накладних " +"витрат на виклик через викликані об’єкти на рівні Python, замість цього " +"здійснюючи прямий виклик функції C. Основні атрибути закладу не змінилися; " +"інтерфейс дозволяє встановлювати функції трасування для кожного потоку, а " +"основні події, які повідомляються у функцію трасування, є такими самими, як " +"повідомлялося функціям трасування на рівні Python у попередніх версіях." + +msgid "" +"The type of the trace function registered using :c:func:`PyEval_SetProfile` " +"and :c:func:`PyEval_SetTrace`. The first parameter is the object passed to " +"the registration function as *obj*, *frame* is the frame object to which the " +"event pertains, *what* is one of the constants :c:data:`PyTrace_CALL`, :c:" +"data:`PyTrace_EXCEPTION`, :c:data:`PyTrace_LINE`, :c:data:`PyTrace_RETURN`, :" +"c:data:`PyTrace_C_CALL`, :c:data:`PyTrace_C_EXCEPTION`, :c:data:" +"`PyTrace_C_RETURN`, or :c:data:`PyTrace_OPCODE`, and *arg* depends on the " +"value of *what*:" +msgstr "" + +msgid "Value of *what*" +msgstr "Значення *чого*" + +msgid "Meaning of *arg*" +msgstr "Значення *arg*" + +msgid ":c:data:`PyTrace_CALL`" +msgstr "" + +msgid "Always :c:data:`Py_None`." +msgstr "Завжди :c:data:`Py_None`." + +msgid ":c:data:`PyTrace_EXCEPTION`" +msgstr "" + +msgid "Exception information as returned by :func:`sys.exc_info`." +msgstr "Інформація про винятки, яку повертає :func:`sys.exc_info`." + +msgid ":c:data:`PyTrace_LINE`" +msgstr "" + +msgid ":c:data:`PyTrace_RETURN`" +msgstr "" + +msgid "" +"Value being returned to the caller, or ``NULL`` if caused by an exception." +msgstr "" +"Значення, що повертається абоненту, або ``NULL``, якщо викликано винятком." + +msgid ":c:data:`PyTrace_C_CALL`" +msgstr "" + +msgid "Function object being called." +msgstr "Об’єкт функції, що викликається." + +msgid ":c:data:`PyTrace_C_EXCEPTION`" +msgstr "" + +msgid ":c:data:`PyTrace_C_RETURN`" +msgstr "" + +msgid ":c:data:`PyTrace_OPCODE`" +msgstr "" + +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 " +"generator. Note that the creation of the iterator for a generator function " +"is not reported as there is no control transfer to the Python bytecode in " +"the corresponding frame." +msgstr "" +"Значення параметра *what* для функції :c:type:`Py_tracefunc`, коли " +"повідомляється про новий виклик функції чи методу або новий запис у " +"генераторі. Зауважте, що створення ітератора для функції генератора не " +"повідомляється, оскільки немає передачі керування до байт-коду Python у " +"відповідному кадрі." + +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 " +"value for *what* when after any bytecode is processed after which the " +"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 " +"profiler." +msgstr "" +"Значення параметра *what* для функції :c:type:`Py_tracefunc`, коли виникає " +"виняткова ситуація. Функція зворотного виклику викликається з цим значенням " +"для *what*, коли після обробки будь-якого байт-коду, після чого виняток стає " +"встановленим у кадрі, що виконується. Наслідком цього є те, що коли " +"розповсюдження винятку спричиняє розгортання стека Python, зворотний виклик " +"викликається після повернення до кожного кадру під час поширення винятку. " +"Лише функції трасування отримують ці події; вони не потрібні профайлеру." + +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." +msgstr "" + +msgid "" +"The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " +"a call is about to return." +msgstr "" +"Значення для параметра *what* для :c:type:`Py_tracefunc` функціонує, коли " +"виклик збирається повернутися." + +msgid "" +"The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " +"a C function is about to be called." +msgstr "" +"Значення параметра *what* для функцій :c:type:`Py_tracefunc`, коли має бути " +"викликана функція C." + +msgid "" +"The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " +"a C function has raised an exception." +msgstr "" +"Значення для параметра *what* для функцій :c:type:`Py_tracefunc`, коли " +"функція C викликала виняткову ситуацію." + +msgid "" +"The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " +"a C function has returned." +msgstr "" +"Значення для параметра *what* для функцій :c:type:`Py_tracefunc`, коли " +"функція C повертає." + +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." +msgstr "" + +msgid "" +"Set the profiler function to *func*. The *obj* parameter is passed to the " +"function as its first parameter, and may be any Python object, or ``NULL``. " +"If the profile function needs to maintain state, using a different value for " +"*obj* for each thread provides a convenient and thread-safe place to store " +"it. The profile function is called for all monitored events except :c:data:" +"`PyTrace_LINE` :c:data:`PyTrace_OPCODE` and :c:data:`PyTrace_EXCEPTION`." +msgstr "" + +msgid "See also the :func:`sys.setprofile` function." +msgstr "" + +msgid "The caller must hold the :term:`GIL`." +msgstr "Абонент повинен утримувати :term:`GIL`." + +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 "" + +msgid "" +"As :c:func:`PyEval_SetProfile`, this function ignores any exceptions raised " +"while setting the profile functions in all threads." +msgstr "" + +msgid "" +"Set the tracing function to *func*. This is similar to :c:func:" +"`PyEval_SetProfile`, except the tracing function does receive line-number " +"events and per-opcode events, but does not receive any event related to C " +"function objects being called. Any trace function registered using :c:func:" +"`PyEval_SetTrace` will not receive :c:data:`PyTrace_C_CALL`, :c:data:" +"`PyTrace_C_EXCEPTION` or :c:data:`PyTrace_C_RETURN` as a value for the " +"*what* parameter." +msgstr "" + +msgid "See also the :func:`sys.settrace` function." +msgstr "" + +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 "" + +msgid "" +"As :c:func:`PyEval_SetTrace`, this function ignores any exceptions raised " +"while setting the trace functions in all threads." +msgstr "" + +msgid "Reference tracing" +msgstr "" + +msgid "" +"The type of the trace function registered using :c:func:" +"`PyRefTracer_SetTracer`. The first parameter is a Python object that has " +"been just created (when **event** is set to :c:data:`PyRefTracer_CREATE`) or " +"about to be destroyed (when **event** is set to :c:data:" +"`PyRefTracer_DESTROY`). The **data** argument is the opaque pointer that was " +"provided when :c:func:`PyRefTracer_SetTracer` was called." +msgstr "" + +msgid "" +"The value for the *event* parameter to :c:type:`PyRefTracer` functions when " +"a Python object has been created." +msgstr "" + +msgid "" +"The value for the *event* parameter to :c:type:`PyRefTracer` functions when " +"a Python object has been destroyed." +msgstr "" + +msgid "" +"Register a reference tracer function. The function will be called when a new " +"Python has been created or when an object is going to be destroyed. If " +"**data** is provided it must be an opaque pointer that will be provided when " +"the tracer function is called. Return ``0`` on success. Set an exception and " +"return ``-1`` on error." +msgstr "" + +msgid "" +"Not that tracer functions **must not** create Python objects inside or " +"otherwise the call will be re-entrant. The tracer also **must not** clear " +"any existing exception or set an exception. The GIL will be held every time " +"the tracer function is called." +msgstr "" + +msgid "The GIL must be held when calling this function." +msgstr "" + +msgid "" +"Get the registered reference tracer function and the value of the opaque " +"data pointer that was registered when :c:func:`PyRefTracer_SetTracer` was " +"called. If no tracer was registered this function will return NULL and will " +"set the **data** pointer to NULL." +msgstr "" + +msgid "Advanced Debugger Support" +msgstr "Розширена підтримка налагоджувача" + +msgid "" +"These functions are only intended to be used by advanced debugging tools." +msgstr "" +"Ці функції призначені лише для використання розширеними інструментами " +"налагодження." + +msgid "" +"Return the interpreter state object at the head of the list of all such " +"objects." +msgstr "" +"Повертає об’єкт стану інтерпретатора на початку списку всіх таких об’єктів." + +msgid "Return the main interpreter state object." +msgstr "Повертає основний об'єкт стану інтерпретатора." + +msgid "" +"Return the next interpreter state object after *interp* from the list of all " +"such objects." +msgstr "" +"Повертає наступний об’єкт стану інтерпретатора після *interp* зі списку всіх " +"таких об’єктів." + +msgid "" +"Return the pointer to the first :c:type:`PyThreadState` object in the list " +"of threads associated with the interpreter *interp*." +msgstr "" +"Поверніть вказівник на перший об’єкт :c:type:`PyThreadState` у списку " +"потоків, пов’язаних з інтерпретатором *interp*." + +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 "" +"Повертає наступний об’єкт стану потоку після *tstate* зі списку всіх таких " +"об’єктів, що належать до того самого об’єкта :c:type:`PyInterpreterState`." + +msgid "Thread Local Storage Support" +msgstr "Підтримка потокового локального сховища" + +msgid "" +"The Python interpreter provides low-level support for thread-local storage " +"(TLS) which wraps the underlying native TLS implementation to support the " +"Python-level thread local storage API (:class:`threading.local`). The " +"CPython C level APIs are similar to those offered by pthreads and Windows: " +"use a thread key and functions to associate a :c:expr:`void*` value per " +"thread." +msgstr "" + +msgid "" +"The GIL does *not* need to be held when calling these functions; they supply " +"their own locking." +msgstr "" +"GIL *не* потрібно утримувати під час виклику цих функцій; вони забезпечують " +"власний замок." + +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 "" +"Зауважте, що :file:`Python.h` не містить оголошення TLS API, вам потрібно " +"включити :file:`pythread.h`, щоб використовувати локальне сховище потоків." + +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." +msgstr "" + +msgid "Thread Specific Storage (TSS) API" +msgstr "API для спеціального зберігання потоків (TSS)." + +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 "" + +msgid "\"A New C-API for Thread-Local Storage in CPython\" (:pep:`539`)" +msgstr "" +"\"Новий C-API для локального зберігання потоків у CPython\" (:pep:`539`)" + +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 " +"internal field representing the key's initialization state. There are no " +"public members in this structure." +msgstr "" +"Ця структура даних представляє стан ключа потоку, визначення якого може " +"залежати від базової реалізації TLS, і вона має внутрішнє поле, що " +"представляє стан ініціалізації ключа. У цій структурі немає громадських " +"учасників." + +msgid "" +"When :ref:`Py_LIMITED_API ` is not defined, static allocation of " +"this type by :c:macro:`Py_tss_NEEDS_INIT` is allowed." +msgstr "" +"Якщо :ref:`Py_LIMITED_API ` не визначено, статичний розподіл цього " +"типу за допомогою :c:macro:`Py_tss_NEEDS_INIT` дозволений." + +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:type:`Py_tss_t`. " +"Зауважте, що цей макрос не буде визначено за допомогою :ref:`Py_LIMITED_API " +"`." + +msgid "Dynamic Allocation" +msgstr "Динамічний розподіл" + +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:type:`Py_tss_t`, необхідне в модулях розширення, " +"створених за допомогою :ref:`Py_LIMITED_API `, де статичне " +"розміщення цього типу неможливе через те, що його реалізація непрозора під " +"час створення." + +msgid "" +"Return a value which is the same state as a value initialized with :c:macro:" +"`Py_tss_NEEDS_INIT`, or ``NULL`` in the case of dynamic allocation failure." +msgstr "" +"Повертає значення, яке є таким самим станом, як і значення, ініціалізоване " +"за допомогою :c:macro:`Py_tss_NEEDS_INIT` або ``NULL`` у разі помилки " +"динамічного розподілу." + +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 "" + +msgid "" +"A freed key becomes a dangling pointer. You should reset the key to ``NULL``." +msgstr "" + +msgid "Methods" +msgstr "методи" + +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`." +msgstr "" +"Параметр *key* цих функцій не має бути ``NULL``. Крім того, поведінка :c:" +"func:`PyThread_tss_set` і :c:func:`PyThread_tss_get` є невизначеною, якщо " +"даний :c:type:`Py_tss_t` не був ініціалізований :c:func:" +"`PyThread_tss_create`." + +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:type:`Py_tss_t` ініціалізовано :" +"c:func:`PyThread_tss_create`." + +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 " +"initialized by :c:macro:`Py_tss_NEEDS_INIT`. This function can be called " +"repeatedly on the same key -- calling it on an already initialized key is a " +"no-op and immediately returns success." +msgstr "" +"Повертає нульове значення в разі успішної ініціалізації ключа TSS. Поведінка " +"не визначена, якщо значення, на яке вказує аргумент *key*, не " +"ініціалізовано :c:macro:`Py_tss_NEEDS_INIT`. Цю функцію можна викликати " +"неодноразово для одного і того ж ключа — виклик її для вже ініціалізованого " +"ключа є безопераційним і негайно повертає успіх." + +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." +msgstr "" +"Знищіть ключ TSS, щоб забути значення, пов’язані з ключем у всіх потоках, і " +"змініть стан ініціалізації ключа на неініціалізований. Знищений ключ можна " +"знову ініціалізувати за допомогою :c:func:`PyThread_tss_create`. Цю функцію " +"можна багаторазово викликати для одного і того ж ключа – виклик її для вже " +"знищеного ключа є безопераційним." + +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 "" + +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 "" + +msgid "Thread Local Storage (TLS) API" +msgstr "API локального зберігання потоків (TLS)." + +msgid "" +"This API is superseded by :ref:`Thread Specific Storage (TSS) API `." +msgstr "" +"Цей API замінено :ref:`API спеціального зберігання потоків (TSS) `." + +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 " +"platforms, :c:func:`PyThread_create_key` will return immediately with a " +"failure status, and the other TLS functions will all be no-ops on such " +"platforms." +msgstr "" +"Ця версія API не підтримує платформи, де власний ключ TLS визначено таким " +"чином, що його неможливо безпечно перевести в ``int``. На таких платформах :" +"c:func:`PyThread_create_key` негайно повернеться зі статусом помилки, а всі " +"інші функції TLS будуть безопераційними на таких платформах." + +msgid "" +"Due to the compatibility problem noted above, this version of the API should " +"not be used in new code." +msgstr "" +"Через проблему сумісності, зазначену вище, цю версію API не слід " +"використовувати в новому коді." + +msgid "Synchronization Primitives" +msgstr "Примітиви синхронізації" + +msgid "The C-API provides a basic mutual exclusion lock." +msgstr "" + +msgid "" +"A mutual exclusion lock. The :c:type:`!PyMutex` should be initialized to " +"zero to represent the unlocked state. For example::" +msgstr "" + +msgid "PyMutex mutex = {0};" +msgstr "" + +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 "" + +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 "" + +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 "" + +msgid "" +"Unlock mutex *m*. The mutex must be locked --- otherwise, the function will " +"issue a fatal error." +msgstr "" + +msgid "Python Critical Section API" +msgstr "" + +msgid "" +"The critical section API provides a deadlock avoidance layer on top of per-" +"object locks for :term:`free-threaded ` CPython. They are " +"intended to replace reliance on the :term:`global interpreter lock`, and are " +"no-ops in versions of Python with the global interpreter lock." +msgstr "" + +msgid "" +"Critical sections avoid deadlocks by implicitly suspending active critical " +"sections and releasing the locks during calls to :c:func:" +"`PyEval_SaveThread`. When :c:func:`PyEval_RestoreThread` is called, the most " +"recent critical section is resumed, and its locks reacquired. This means " +"the critical section API provides weaker guarantees than traditional locks " +"-- they are useful because their behavior is similar to the :term:`GIL`." +msgstr "" + +msgid "" +"The functions and structs used by the macros are exposed for cases where C " +"macros are not available. They should only be used as in the given macro " +"expansions. Note that the sizes and contents of the structures may change in " +"future Python versions." +msgstr "" + +msgid "" +"Operations that need to lock two objects at once must use :c:macro:" +"`Py_BEGIN_CRITICAL_SECTION2`. You *cannot* use nested critical sections to " +"lock more than one object at once, because the inner critical section may " +"suspend the outer critical sections. This API does not provide a way to " +"lock more than two objects at once." +msgstr "" + +msgid "Example usage::" +msgstr "Приклад використання::" + +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 "" + +msgid "" +"In the above example, :c:macro:`Py_SETREF` calls :c:macro:`Py_DECREF`, which " +"can call arbitrary code through an object's deallocation function. The " +"critical section API avoids potential deadlocks due to reentrancy and lock " +"ordering by allowing the runtime to temporarily suspend the critical section " +"if the code triggered by the finalizer blocks and calls :c:func:" +"`PyEval_SaveThread`." +msgstr "" + +msgid "" +"Acquires the per-object lock for the object *op* and begins a critical " +"section." +msgstr "" + +msgid "In the free-threaded build, this macro expands to::" +msgstr "" + +msgid "" +"{\n" +" PyCriticalSection _py_cs;\n" +" PyCriticalSection_Begin(&_py_cs, (PyObject*)(op))" +msgstr "" + +msgid "In the default build, this macro expands to ``{``." +msgstr "" + +msgid "Ends the critical section and releases the per-object lock." +msgstr "" + +msgid "" +" PyCriticalSection_End(&_py_cs);\n" +"}" +msgstr "" + +msgid "In the default build, this macro expands to ``}``." +msgstr "" + +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 "" + +msgid "" +"{\n" +" PyCriticalSection2 _py_cs2;\n" +" PyCriticalSection2_Begin(&_py_cs2, (PyObject*)(a), (PyObject*)(b))" +msgstr "" + +msgid "Ends the critical section and releases the per-object locks." +msgstr "" + +msgid "" +" PyCriticalSection2_End(&_py_cs2);\n" +"}" +msgstr "" + +msgid "PyEval_InitThreads()" +msgstr "" + +msgid "modules (in module sys)" +msgstr "" + +msgid "path (in module sys)" +msgstr "" + +msgid "module" +msgstr "модуль" + +msgid "builtins" +msgstr "вбудовані елементи" + +msgid "__main__" +msgstr "" + +msgid "sys" +msgstr "система" + +msgid "search" +msgstr "" + +msgid "path" +msgstr "" + +msgid "Py_FinalizeEx (C function)" +msgstr "" + +msgid "Py_Initialize()" +msgstr "" + +msgid "main()" +msgstr "" + +msgid "Py_GetPath()" +msgstr "" + +msgid "executable (in module sys)" +msgstr "" + +msgid "version (in module sys)" +msgstr "" + +msgid "platform (in module sys)" +msgstr "" + +msgid "copyright (in module sys)" +msgstr "" + +msgid "Py_FatalError()" +msgstr "" + +msgid "argv (in module sys)" +msgstr "" + +msgid "global interpreter lock" +msgstr "глобальне блокування інтерпретатора" + +msgid "interpreter lock" +msgstr "" + +msgid "lock, interpreter" +msgstr "" + +msgid "setswitchinterval (in module sys)" +msgstr "" + +msgid "PyThreadState (C type)" +msgstr "" + +msgid "Py_BEGIN_ALLOW_THREADS (C macro)" +msgstr "" + +msgid "Py_END_ALLOW_THREADS (C macro)" +msgstr "" + +msgid "PyEval_RestoreThread (C function)" +msgstr "" + +msgid "PyEval_SaveThread (C function)" +msgstr "" + +msgid "PyEval_AcquireThread()" +msgstr "" + +msgid "PyEval_ReleaseThread()" +msgstr "" + +msgid "PyEval_SaveThread()" +msgstr "" + +msgid "PyEval_RestoreThread()" +msgstr "" + +msgid "_thread" +msgstr "_thread" + +msgid "stdout (in module sys)" +msgstr "" + +msgid "stderr (in module sys)" +msgstr "" + +msgid "stdin (in module sys)" +msgstr "" + +msgid "Py_Initialize (C function)" +msgstr "" + +msgid "close (in module os)" +msgstr "" diff --git a/c-api/init_config.po b/c-api/init_config.po new file mode 100644 index 000000000..fdc6fb0ec --- /dev/null +++ b/c-api/init_config.po @@ -0,0 +1,2265 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:49+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Python Initialization Configuration" +msgstr "Конфігурація ініціалізації Python" + +msgid "" +"Python can be initialized with :c:func:`Py_InitializeFromConfig` and the :c:" +"type:`PyConfig` structure. It can be preinitialized with :c:func:" +"`Py_PreInitialize` and the :c:type:`PyPreConfig` structure." +msgstr "" +"Python можна ініціалізувати за допомогою :c:func:`Py_InitializeFromConfig` і " +"структури :c:type:`PyConfig`. Його можна попередньо ініціалізувати за " +"допомогою :c:func:`Py_PreInitialize` і структури :c:type:`PyPreConfig`." + +msgid "There are two kinds of configuration:" +msgstr "Існує два види конфігурації:" + +msgid "" +"The :ref:`Python Configuration ` can be used to build a " +"customized Python which behaves as the regular Python. For example, " +"environment variables and command line arguments are used to configure " +"Python." +msgstr "" +":ref:`Налаштування Python ` можна використовувати для " +"створення налаштованого Python, який веде себе як звичайний Python. " +"Наприклад, змінні середовища та аргументи командного рядка використовуються " +"для налаштування Python." + +msgid "" +"The :ref:`Isolated Configuration ` can be used to embed " +"Python into an application. It isolates Python from the system. For example, " +"environment variables are ignored, the LC_CTYPE locale is left unchanged and " +"no signal handler is registered." +msgstr "" +":ref:`Ізольована конфігурація ` може бути використана " +"для вбудовування Python у програму. Він ізолює Python від системи. " +"Наприклад, змінні середовища ігноруються, локаль LC_CTYPE не змінюється, а " +"обробник сигналів не реєструється." + +msgid "" +"The :c:func:`Py_RunMain` function can be used to write a customized Python " +"program." +msgstr "" +"Функцію :c:func:`Py_RunMain` можна використовувати для написання спеціальної " +"програми Python." + +msgid "" +"See also :ref:`Initialization, Finalization, and Threads `." +msgstr "" +"Дивіться також :ref:`Ініціалізація, фіналізація та потоки `." + +msgid ":pep:`587` \"Python Initialization Configuration\"." +msgstr ":pep:`587` \"Конфігурація ініціалізації Python\"." + +msgid "Example" +msgstr "приклад" + +msgid "Example of customized Python always running in isolated mode::" +msgstr "" +"Приклад налаштованого Python, який завжди працює в ізольованому режимі::" + +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 "" + +msgid "PyWideStringList" +msgstr "PyWideStringList" + +msgid "List of ``wchar_t*`` strings." +msgstr "Список рядків ``wchar_t*``." + +msgid "" +"If *length* is non-zero, *items* must be non-``NULL`` and all strings must " +"be non-``NULL``." +msgstr "" +"Якщо *length* не дорівнює нулю, *items* не мають бути ``NULL``, а всі рядки " +"мають бути не ``NULL``." + +msgid "Methods:" +msgstr "Методи:" + +msgid "Append *item* to *list*." +msgstr "Додайте *елемент* до *списку*." + +msgid "Python must be preinitialized to call this function." +msgstr "Щоб викликати цю функцію, Python має бути попередньо ініціалізований." + +msgid "Insert *item* into *list* at *index*." +msgstr "Вставте *елемент* у *список* за *індексом*." + +msgid "" +"If *index* is greater than or equal to *list* length, append *item* to " +"*list*." +msgstr "" +"Якщо *index* більше або дорівнює довжині *list*, додайте *item* до *list*." + +msgid "*index* must be greater than or equal to ``0``." +msgstr "" + +msgid "Structure fields:" +msgstr "Поля структури:" + +msgid "List length." +msgstr "Довжина списку." + +msgid "List items." +msgstr "Список елементів." + +msgid "PyStatus" +msgstr "PyStatus" + +msgid "" +"Structure to store an initialization function status: success, error or exit." +msgstr "" +"Структура для збереження стану функції ініціалізації: успіх, помилка або " +"вихід." + +msgid "For an error, it can store the C function name which created the error." +msgstr "Для помилки він може зберегти назву функції C, яка створила помилку." + +msgid "Exit code. Argument passed to ``exit()``." +msgstr "Код виходу. Аргумент, переданий до ``exit()``." + +msgid "Error message." +msgstr "Повідомлення про помилку." + +msgid "Name of the function which created an error, can be ``NULL``." +msgstr "Ім'я функції, яка створила помилку, може бути ``NULL``." + +msgid "Functions to create a status:" +msgstr "Функції для створення статусу:" + +msgid "Success." +msgstr "Успіх." + +msgid "Initialization error with a message." +msgstr "Помилка ініціалізації з повідомленням." + +msgid "*err_msg* must not be ``NULL``." +msgstr "*err_msg* не має бути ``NULL``." + +msgid "Memory allocation failure (out of memory)." +msgstr "Помилка виділення пам'яті (брак пам'яті)." + +msgid "Exit Python with the specified exit code." +msgstr "Вийдіть із Python із вказаним кодом виходу." + +msgid "Functions to handle a status:" +msgstr "Функції для обробки статусу:" + +msgid "" +"Is the status an error or an exit? If true, the exception must be handled; " +"by calling :c:func:`Py_ExitStatusException` for example." +msgstr "" +"Статус помилка чи вихід? Якщо істина, виняток потрібно обробити; наприклад, " +"викликом :c:func:`Py_ExitStatusException`." + +msgid "Is the result an error?" +msgstr "Чи є результат помилкою?" + +msgid "Is the result an exit?" +msgstr "Результат – це вихід?" + +msgid "" +"Call ``exit(exitcode)`` if *status* is an exit. Print the error message and " +"exit with a non-zero exit code if *status* is an error. Must only be called " +"if ``PyStatus_Exception(status)`` is non-zero." +msgstr "" +"Викличте ``exit(exitcode)``, якщо *status* є виходом. Роздрукуйте " +"повідомлення про помилку та вийдіть із ненульовим кодом виходу, якщо " +"*статус* є помилкою. Потрібно викликати, лише якщо " +"``PyStatus_Exception(status)`` не дорівнює нулю." + +msgid "" +"Internally, Python uses macros which set ``PyStatus.func``, whereas " +"functions to create a status set ``func`` to ``NULL``." +msgstr "" +"Внутрішньо Python використовує макроси, які встановлюють ``PyStatus.func``, " +"тоді як функції для створення стану встановлюють ``func`` на ``NULL``." + +msgid "Example::" +msgstr "Приклад::" + +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 "" + +msgid "PyPreConfig" +msgstr "PyPreConfig" + +msgid "Structure used to preinitialize Python." +msgstr "Структура, яка використовується для попередньої ініціалізації Python." + +msgid "Function to initialize a preconfiguration:" +msgstr "Функція ініціалізації попередньої конфігурації:" + +msgid "" +"Initialize the preconfiguration with :ref:`Python Configuration `." +msgstr "" +"Ініціалізуйте попередню конфігурацію за допомогою :ref:`Налаштування Python " +"`." + +msgid "" +"Initialize the preconfiguration with :ref:`Isolated Configuration `." +msgstr "" +"Ініціалізуйте попередню конфігурацію за допомогою :ref:`Ізольованої " +"конфігурації `." + +msgid "Name of the Python memory allocators:" +msgstr "Ім'я розподілювачів пам'яті Python:" + +msgid "" +"``PYMEM_ALLOCATOR_NOT_SET`` (``0``): don't change memory allocators (use " +"defaults)." +msgstr "" +"``PYMEM_ALLOCATOR_NOT_SET`` (``0``): не змінювати розподільники пам'яті " +"(використовувати значення за замовчуванням)." + +msgid "" +"``PYMEM_ALLOCATOR_DEFAULT`` (``1``): :ref:`default memory allocators " +"`." +msgstr "" +"``PYMEM_ALLOCATOR_DEFAULT`` (``1``): :ref:`розподіл пам'яті за замовчуванням " +"`." + +msgid "" +"``PYMEM_ALLOCATOR_DEBUG`` (``2``): :ref:`default memory allocators ` with :ref:`debug hooks `." +msgstr "" +"``PYMEM_ALLOCATOR_DEBUG`` (``2``): :ref:`розподільники пам’яті за " +"замовчуванням ` з :ref:`налагоджувальними хуками " +"`." + +msgid "``PYMEM_ALLOCATOR_MALLOC`` (``3``): use ``malloc()`` of the C library." +msgstr "" +"``PYMEM_ALLOCATOR_MALLOC`` (``3``): використовуйте ``malloc()`` бібліотеки C." + +msgid "" +"``PYMEM_ALLOCATOR_MALLOC_DEBUG`` (``4``): force usage of ``malloc()`` with :" +"ref:`debug hooks `." +msgstr "" +"``PYMEM_ALLOCATOR_MALLOC_DEBUG`` (``4``): примусове використання " +"``malloc()`` з :ref:`налагоджувальними хуками `." + +msgid "" +"``PYMEM_ALLOCATOR_PYMALLOC`` (``5``): :ref:`Python pymalloc memory allocator " +"`." +msgstr "" +"``PYMEM_ALLOCATOR_PYMALLOC`` (``5``): :ref:`Виділювач пам'яті Python " +"pymalloc `." + +msgid "" +"``PYMEM_ALLOCATOR_PYMALLOC_DEBUG`` (``6``): :ref:`Python pymalloc memory " +"allocator ` with :ref:`debug hooks `." +msgstr "" +"``PYMEM_ALLOCATOR_PYMALLOC_DEBUG`` (``6``): :ref:`Розподіл пам’яті Python " +"pymalloc ` з :ref:`налагоджувальними хуками `." + +msgid "" +"``PYMEM_ALLOCATOR_MIMALLOC`` (``6``): use ``mimalloc``, a fast malloc " +"replacement." +msgstr "" + +msgid "" +"``PYMEM_ALLOCATOR_MIMALLOC_DEBUG`` (``7``): use ``mimalloc``, a fast malloc " +"replacement with :ref:`debug hooks `." +msgstr "" + +msgid "" +"``PYMEM_ALLOCATOR_PYMALLOC`` and ``PYMEM_ALLOCATOR_PYMALLOC_DEBUG`` are not " +"supported if Python is :option:`configured using --without-pymalloc <--" +"without-pymalloc>`." +msgstr "" +"``PYMEM_ALLOCATOR_PYMALLOC`` і ``PYMEM_ALLOCATOR_PYMALLOC_DEBUG`` не " +"підтримуються, якщо Python :option:`налаштовано за допомогою --without-" +"pymalloc <--without-pymalloc>`." + +msgid "" +"``PYMEM_ALLOCATOR_MIMALLOC`` and ``PYMEM_ALLOCATOR_MIMALLOC_DEBUG`` are not " +"supported if Python is :option:`configured using --without-mimalloc <--" +"without-mimalloc>` or if the underlying atomic support isn't available." +msgstr "" + +msgid "See :ref:`Memory Management `." +msgstr "Перегляньте :ref:`Керування пам’яттю `." + +msgid "Default: ``PYMEM_ALLOCATOR_NOT_SET``." +msgstr "Типове значення: ``PYMEM_ALLOCATOR_NOT_SET``." + +msgid "Set the LC_CTYPE locale to the user preferred locale." +msgstr "" + +msgid "" +"If equals to ``0``, set :c:member:`~PyPreConfig.coerce_c_locale` and :c:" +"member:`~PyPreConfig.coerce_c_locale_warn` members to ``0``." +msgstr "" + +msgid "See the :term:`locale encoding`." +msgstr "Перегляньте :term:`locale encoding`." + +msgid "Default: ``1`` in Python config, ``0`` in isolated config." +msgstr "" +"За замовчуванням: ``1`` у конфігурації Python, ``0`` в ізольованій " +"конфігурації." + +msgid "If equals to ``2``, coerce the C locale." +msgstr "" + +msgid "" +"If equals to ``1``, read the LC_CTYPE locale to decide if it should be " +"coerced." +msgstr "" + +msgid "Default: ``-1`` in Python config, ``0`` in isolated config." +msgstr "" +"За замовчуванням: ``-1`` у конфігурації Python, ``0`` в ізольованій " +"конфігурації." + +msgid "If non-zero, emit a warning if the C locale is coerced." +msgstr "" +"Якщо значення відмінне від нуля, видати попередження, якщо локаль C виведена " +"примусово." + +msgid "" +":ref:`Python Development Mode `: see :c:member:`PyConfig.dev_mode`." +msgstr "" + +msgid "Default: ``-1`` in Python mode, ``0`` in isolated mode." +msgstr "Типове значення: ``-1`` в режимі Python, ``0`` в ізольованому режимі." + +msgid "Isolated mode: see :c:member:`PyConfig.isolated`." +msgstr "Ізольований режим: див. :c:member:`PyConfig.isolated`." + +msgid "Default: ``0`` in Python mode, ``1`` in isolated mode." +msgstr "Типове значення: ``0`` в режимі Python, ``1`` в ізольованому режимі." + +msgid "If non-zero:" +msgstr "Якщо відмінне від нуля:" + +msgid "Set :c:member:`PyPreConfig.utf8_mode` to ``0``," +msgstr "Установіть :c:member:`PyPreConfig.utf8_mode` на ``0``," + +msgid "Set :c:member:`PyConfig.filesystem_encoding` to ``\"mbcs\"``," +msgstr "Установіть :c:member:`PyConfig.filesystem_encoding` на ``\"mbcs\"``," + +msgid "Set :c:member:`PyConfig.filesystem_errors` to ``\"replace\"``." +msgstr "Установіть :c:member:`PyConfig.filesystem_errors` на ``\"replace\"``." + +msgid "" +"Initialized from the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` environment " +"variable value." +msgstr "" + +msgid "" +"Only available on Windows. ``#ifdef MS_WINDOWS`` macro can be used for " +"Windows specific code." +msgstr "" +"Доступно лише для Windows. Макрос ``#ifdef MS_WINDOWS`` можна " +"використовувати для спеціального коду Windows." + +msgid "Default: ``0``." +msgstr "Типове значення: ``0``." + +msgid "" +"If non-zero, :c:func:`Py_PreInitializeFromArgs` and :c:func:" +"`Py_PreInitializeFromBytesArgs` parse their ``argv`` argument the same way " +"the regular Python parses command line arguments: see :ref:`Command Line " +"Arguments `." +msgstr "" +"Якщо значення відмінне від нуля, :c:func:`Py_PreInitializeFromArgs` і :c:" +"func:`Py_PreInitializeFromBytesArgs` аналізують свій аргумент ``argv`` так " +"само, як звичайний Python аналізує аргументи командного рядка: див. :ref:" +"`Аргументи командного рядка `." + +msgid "" +"Use :ref:`environment variables `? See :c:member:`PyConfig." +"use_environment`." +msgstr "" +"Використовувати :ref:`змінні середовища `? Перегляньте :c:" +"member:`PyConfig.use_environment`." + +msgid "Default: ``1`` in Python config and ``0`` in isolated config." +msgstr "" +"За замовчуванням: ``1`` у конфігурації Python і ``0`` в ізольованій " +"конфігурації." + +msgid "If non-zero, enable the :ref:`Python UTF-8 Mode `." +msgstr "Якщо не нуль, увімкніть :ref:`Режим Python UTF-8 `." + +msgid "" +"Set to ``0`` or ``1`` by the :option:`-X utf8 <-X>` command line option and " +"the :envvar:`PYTHONUTF8` environment variable." +msgstr "" + +msgid "Also set to ``1`` if the ``LC_CTYPE`` locale is ``C`` or ``POSIX``." +msgstr "" + +msgid "Default: ``-1`` in Python config and ``0`` in isolated config." +msgstr "" +"За замовчуванням: ``-1`` у конфігурації Python і ``0`` в ізольованій " +"конфігурації." + +msgid "Preinitialize Python with PyPreConfig" +msgstr "Попередня ініціалізація Python за допомогою PyPreConfig" + +msgid "The preinitialization of Python:" +msgstr "Попередня ініціалізація Python:" + +msgid "Set the Python memory allocators (:c:member:`PyPreConfig.allocator`)" +msgstr "" +"Встановіть розподільники пам’яті Python (:c:member:`PyPreConfig.allocator`)" + +msgid "Configure the LC_CTYPE locale (:term:`locale encoding`)" +msgstr "Налаштувати локаль LC_CTYPE (:term:`locale encoding`)" + +msgid "" +"Set the :ref:`Python UTF-8 Mode ` (:c:member:`PyPreConfig." +"utf8_mode`)" +msgstr "" +"Установіть режим :ref:`Python UTF-8 Mode ` (:c:member:" +"`PyPreConfig.utf8_mode`)" + +msgid "" +"The current preconfiguration (``PyPreConfig`` type) is stored in " +"``_PyRuntime.preconfig``." +msgstr "" +"Поточна попередня конфігурація (тип ``PyPreConfig``) зберігається в " +"``_PyRuntime.preconfig``." + +msgid "Functions to preinitialize Python:" +msgstr "Функції для попередньої ініціалізації Python:" + +msgid "Preinitialize Python from *preconfig* preconfiguration." +msgstr "" +"Попередньо ініціалізуйте Python із попередньої конфігурації *preconfig*." + +msgid "*preconfig* must not be ``NULL``." +msgstr "*preconfig* не має бути ``NULL``." + +msgid "" +"Parse *argv* command line arguments (bytes strings) if :c:member:" +"`~PyPreConfig.parse_argv` of *preconfig* is non-zero." +msgstr "" +"Проаналізуйте аргументи командного рядка *argv* (рядки байтів), якщо :c:" +"member:`~PyPreConfig.parse_argv` *preconfig* не дорівнює нулю." + +msgid "" +"Parse *argv* command line arguments (wide strings) if :c:member:" +"`~PyPreConfig.parse_argv` of *preconfig* is non-zero." +msgstr "" +"Проаналізуйте аргументи командного рядка *argv* (широкі рядки), якщо :c:" +"member:`~PyPreConfig.parse_argv` *preconfig* не дорівнює нулю." + +msgid "" +"The caller is responsible to handle exceptions (error or exit) using :c:func:" +"`PyStatus_Exception` and :c:func:`Py_ExitStatusException`." +msgstr "" +"Виклик відповідає за обробку винятків (помилка або вихід) за допомогою :c:" +"func:`PyStatus_Exception` і :c:func:`Py_ExitStatusException`." + +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 "" +"Для :ref:`Конфігурації Python ` (:c:func:" +"`PyPreConfig_InitPythonConfig`), якщо Python ініціалізовано аргументами " +"командного рядка, аргументи командного рядка також потрібно передати для " +"попередньої ініціалізації Python, оскільки вони впливають на попередні " +"конфігурація, як кодування. Наприклад, параметр командного рядка :option:`-X " +"utf8 <-X>` вмикає :ref:`Режим Python UTF-8 `." + +msgid "" +"``PyMem_SetAllocator()`` can be called after :c:func:`Py_PreInitialize` and " +"before :c:func:`Py_InitializeFromConfig` to install a custom memory " +"allocator. It can be called before :c:func:`Py_PreInitialize` if :c:member:" +"`PyPreConfig.allocator` is set to ``PYMEM_ALLOCATOR_NOT_SET``." +msgstr "" +"``PyMem_SetAllocator()`` можна викликати після :c:func:`Py_PreInitialize` і " +"перед :c:func:`Py_InitializeFromConfig`, щоб встановити спеціальний " +"розподільник пам’яті. Його можна викликати перед :c:func:`Py_PreInitialize`, " +"якщо :c:member:`PyPreConfig.allocator` має значення " +"``PYMEM_ALLOCATOR_NOT_SET``." + +msgid "" +"Python memory allocation functions like :c:func:`PyMem_RawMalloc` must not " +"be used before the Python preinitialization, whereas calling directly " +"``malloc()`` and ``free()`` is always safe. :c:func:`Py_DecodeLocale` must " +"not be called before the Python preinitialization." +msgstr "" +"Функції виділення пам’яті Python, такі як :c:func:`PyMem_RawMalloc`, не " +"можна використовувати до попередньої ініціалізації Python, тоді як прямий " +"виклик ``malloc()`` і ``free()`` завжди безпечний. :c:func:`Py_DecodeLocale` " +"не можна викликати до попередньої ініціалізації Python." + +msgid "" +"Example using the preinitialization to enable the :ref:`Python UTF-8 Mode " +"`::" +msgstr "" +"Приклад використання попередньої ініціалізації для ввімкнення режиму :ref:" +"`Python UTF-8 `::" + +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 "" + +msgid "PyConfig" +msgstr "PyConfig" + +msgid "Structure containing most parameters to configure Python." +msgstr "Структура, що містить більшість параметрів для налаштування Python." + +msgid "" +"When done, the :c:func:`PyConfig_Clear` function must be used to release the " +"configuration memory." +msgstr "" +"Після завершення необхідно використати функцію :c:func:`PyConfig_Clear`, щоб " +"звільнити конфігураційну пам’ять." + +msgid "Structure methods:" +msgstr "Методи будови:" + +msgid "" +"Initialize configuration with the :ref:`Python Configuration `." +msgstr "" +"Ініціалізуйте конфігурацію за допомогою :ref:`Налаштування Python `." + +msgid "" +"Initialize configuration with the :ref:`Isolated Configuration `." +msgstr "" +"Ініціалізуйте конфігурацію за допомогою :ref:`ізольованої конфігурації `." + +msgid "Copy the wide character string *str* into ``*config_str``." +msgstr "Скопіюйте широкий символьний рядок *str* у ``*config_str``." + +msgid ":ref:`Preinitialize Python ` if needed." +msgstr ":ref:`Попередньо ініціалізуйте Python `, якщо потрібно." + +msgid "" +"Decode *str* using :c:func:`Py_DecodeLocale` and set the result into " +"``*config_str``." +msgstr "" +"Декодуйте *str* за допомогою :c:func:`Py_DecodeLocale` і встановіть " +"результат у ``*config_str``." + +msgid "" +"Set command line arguments (:c:member:`~PyConfig.argv` member of *config*) " +"from the *argv* list of wide character strings." +msgstr "" +"Установіть аргументи командного рядка (:c:member:`~PyConfig.argv` член " +"*config*) зі списку *argv* рядків широких символів." + +msgid "" +"Set command line arguments (:c:member:`~PyConfig.argv` member of *config*) " +"from the *argv* list of bytes strings. Decode bytes using :c:func:" +"`Py_DecodeLocale`." +msgstr "" +"Установіть аргументи командного рядка (:c:member:`~PyConfig.argv` член " +"*config*) зі списку *argv* рядків байтів. Декодуйте байти за допомогою :c:" +"func:`Py_DecodeLocale`." + +msgid "Set the list of wide strings *list* to *length* and *items*." +msgstr "" +"Установіть для списку широких рядків *list* значення *length* і *items*." + +msgid "Read all Python configuration." +msgstr "Прочитайте всю конфігурацію Python." + +msgid "Fields which are already initialized are left unchanged." +msgstr "Поля, які вже ініціалізовані, залишаються без змін." + +msgid "" +"Fields for :ref:`path configuration ` are no longer " +"calculated or modified when calling this function, as of Python 3.11." +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." +msgstr "" + +msgid "" +"The :c:member:`PyConfig.argv` arguments are now only parsed once, :c:member:" +"`PyConfig.parse_argv` is set to ``2`` after arguments are parsed, and " +"arguments are only parsed if :c:member:`PyConfig.parse_argv` equals ``1``." +msgstr "" +"Аргументи :c:member:`PyConfig.argv` тепер аналізуються лише один раз, :c:" +"member:`PyConfig.parse_argv` встановлюється на ``2`` після аналізу " +"аргументів, і аргументи аналізуються, лише якщо :c:member:`PyConfig." +"parse_argv` дорівнює ``1``." + +msgid "" +":c:func:`PyConfig_Read` no longer calculates all paths, and so fields listed " +"under :ref:`Python Path Configuration ` may no longer be " +"updated until :c:func:`Py_InitializeFromConfig` is called." +msgstr "" + +msgid "Release configuration memory." +msgstr "Звільніть конфігураційну пам'ять." + +msgid "" +"Most ``PyConfig`` methods :ref:`preinitialize Python ` if needed. " +"In that case, the Python preinitialization configuration (:c:type:" +"`PyPreConfig`) in based on the :c:type:`PyConfig`. If configuration fields " +"which are in common with :c:type:`PyPreConfig` are tuned, they must be set " +"before calling a :c:type:`PyConfig` method:" +msgstr "" +"Більшість методів ``PyConfig`` :ref:`за необхідності попередньо " +"ініціалізують Python `. У цьому випадку конфігурація попередньої " +"ініціалізації Python (:c:type:`PyPreConfig`) базується на :c:type:" +"`PyConfig`. Якщо поля конфігурації, які є спільними з :c:type:`PyPreConfig`, " +"налаштовано, їх потрібно встановити перед викликом методу :c:type:`PyConfig`:" + +msgid ":c:member:`PyConfig.dev_mode`" +msgstr ":c:member:`PyConfig.dev_mode`" + +msgid ":c:member:`PyConfig.isolated`" +msgstr ":c:member:`PyConfig.isolated`" + +msgid ":c:member:`PyConfig.parse_argv`" +msgstr ":c:member:`PyConfig.parse_argv`" + +msgid ":c:member:`PyConfig.use_environment`" +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)." +msgstr "" + +msgid "" +"The caller of these methods is responsible to handle exceptions (error or " +"exit) using ``PyStatus_Exception()`` and ``Py_ExitStatusException()``." +msgstr "" +"Виклик цих методів відповідає за обробку винятків (помилка або вихід) за " +"допомогою ``PyStatus_Exception()`` і ``Py_ExitStatusException()``." + +msgid "" +"Set :data:`sys.argv` command line arguments based on :c:member:`~PyConfig." +"argv`. These parameters are similar to those passed to the program's :c:" +"func:`main` function with the difference that the first entry should refer " +"to the script file to be executed rather than the executable hosting the " +"Python interpreter. If there isn't a script that will be run, the first " +"entry in :c:member:`~PyConfig.argv` can be an empty string." +msgstr "" + +msgid "" +"Set :c:member:`~PyConfig.parse_argv` to ``1`` to parse :c:member:`~PyConfig." +"argv` the same way the regular Python parses Python command line arguments " +"and then to strip Python arguments from :c:member:`~PyConfig.argv`." +msgstr "" +"Установіть для :c:member:`~PyConfig.parse_argv` значення ``1``, щоб " +"аналізувати :c:member:`~PyConfig.argv` так само, як звичайний Python " +"аналізує аргументи командного рядка Python, а потім видаляти аргументи " +"Python з :c:member:`~PyConfig.argv`." + +msgid "" +"If :c:member:`~PyConfig.argv` is empty, an empty string is added to ensure " +"that :data:`sys.argv` always exists and is never empty." +msgstr "" +"Якщо :c:member:`~PyConfig.argv` порожній, додається порожній рядок, щоб " +"гарантувати, що :data:`sys.argv` завжди існує і ніколи не буде порожнім." + +msgid "Default: ``NULL``." +msgstr "Типове значення: ``NULL``." + +msgid "See also the :c:member:`~PyConfig.orig_argv` member." +msgstr "Дивіться також елемент :c:member:`~PyConfig.orig_argv`." + +msgid "" +"If equals to zero, ``Py_RunMain()`` prepends a potentially unsafe path to :" +"data:`sys.path` at startup:" +msgstr "" + +msgid "" +"If :c:member:`argv[0] ` is equal to ``L\"-m\"`` (``python -m " +"module``), prepend the current working directory." +msgstr "" + +msgid "" +"If running a script (``python script.py``), prepend the script's directory. " +"If it's a symbolic link, resolve symbolic links." +msgstr "" + +msgid "" +"Otherwise (``python -c code`` and ``python``), prepend an empty string, " +"which means the current working directory." +msgstr "" + +msgid "" +"Set to ``1`` by the :option:`-P` command line option and the :envvar:" +"`PYTHONSAFEPATH` environment variable." +msgstr "" + +msgid "Default: ``0`` in Python config, ``1`` in isolated config." +msgstr "" + +msgid ":data:`sys.base_exec_prefix`." +msgstr ":data:`sys.base_exec_prefix`." + +msgid "Part of the :ref:`Python Path Configuration ` output." +msgstr "Частина виведення :ref:`Налаштування шляху Python `." + +msgid "See also :c:member:`PyConfig.exec_prefix`." +msgstr "" + +msgid "Python base executable: :data:`sys._base_executable`." +msgstr "Базовий виконуваний файл Python: :data:`sys._base_executable`." + +msgid "Set by the :envvar:`__PYVENV_LAUNCHER__` environment variable." +msgstr "Встановлюється змінною середовища :envvar:`__PYVENV_LAUNCHER__`." + +msgid "Set from :c:member:`PyConfig.executable` if ``NULL``." +msgstr "Установити з :c:member:`PyConfig.executable`, якщо ``NULL``." + +msgid "See also :c:member:`PyConfig.executable`." +msgstr "" + +msgid ":data:`sys.base_prefix`." +msgstr ":data:`sys.base_prefix`." + +msgid "See also :c:member:`PyConfig.prefix`." +msgstr "" + +msgid "" +"If equals to ``0`` and :c:member:`~PyConfig.configure_c_stdio` is non-zero, " +"disable buffering on the C streams stdout and stderr." +msgstr "" + +msgid "" +"Set to ``0`` by the :option:`-u` command line option and the :envvar:" +"`PYTHONUNBUFFERED` environment variable." +msgstr "" + +msgid "stdin is always opened in buffered mode." +msgstr "stdin завжди відкривається в режимі буферизації." + +msgid "Default: ``1``." +msgstr "Типове значення: ``1``." + +msgid "" +"If equals to ``1``, issue a warning when comparing :class:`bytes` or :class:" +"`bytearray` with :class:`str`, or comparing :class:`bytes` with :class:`int`." +msgstr "" + +msgid "" +"If equal or greater to ``2``, raise a :exc:`BytesWarning` exception in these " +"cases." +msgstr "" + +msgid "Incremented by the :option:`-b` command line option." +msgstr "Збільшується параметром командного рядка :option:`-b`." + +msgid "" +"If non-zero, emit a :exc:`EncodingWarning` warning when :class:`io." +"TextIOWrapper` uses its default encoding. See :ref:`io-encoding-warning` for " +"details." +msgstr "" +"Якщо не нуль, видавати попередження :exc:`EncodingWarning`, коли :class:`io." +"TextIOWrapper` використовує кодування за замовчуванням. Дивіться :ref:`io-" +"encoding-warning` для деталей." + +msgid "" +"If equals to ``0``, disables the inclusion of the end line and column " +"mappings in code objects. Also disables traceback printing carets to " +"specific error locations." +msgstr "" + +msgid "" +"Set to ``0`` by the :envvar:`PYTHONNODEBUGRANGES` environment variable and " +"by the :option:`-X no_debug_ranges <-X>` command line option." +msgstr "" + +msgid "" +"Control the validation behavior of hash-based ``.pyc`` files: value of the :" +"option:`--check-hash-based-pycs` command line option." +msgstr "" +"Керуйте поведінкою перевірки файлів ``.pyc`` на основі хешу: значення " +"параметра командного рядка :option:`--check-hash-based-pycs`." + +msgid "Valid values:" +msgstr "Дійсні значення:" + +msgid "" +"``L\"always\"``: Hash the source file for invalidation regardless of value " +"of the 'check_source' flag." +msgstr "" +"``L\"always\"``: хеш вихідного файлу для визнання недійсним незалежно від " +"значення позначки 'check_source'." + +msgid "``L\"never\"``: Assume that hash-based pycs always are valid." +msgstr "``L\"never\"``: припустимо, що pics на основі хешу завжди дійсні." + +msgid "" +"``L\"default\"``: The 'check_source' flag in hash-based pycs determines " +"invalidation." +msgstr "" +"``L\"default\"``: прапор 'check_source' у pycs на основі хешу визначає " +"недійсність." + +msgid "Default: ``L\"default\"``." +msgstr "Типове значення: ``L\"default\"``." + +msgid "See also :pep:`552` \"Deterministic pycs\"." +msgstr "Дивіться також :pep:`552` \"Детерміновані фото\"." + +msgid "If non-zero, configure C standard streams:" +msgstr "Якщо не нуль, налаштуйте стандартні потоки C:" + +msgid "" +"On Windows, set the binary mode (``O_BINARY``) on stdin, stdout and stderr." +msgstr "" +"У Windows установіть бінарний режим (``O_BINARY``) для stdin, stdout і " +"stderr." + +msgid "" +"If :c:member:`~PyConfig.buffered_stdio` equals zero, disable buffering of " +"stdin, stdout and stderr streams." +msgstr "" +"Якщо :c:member:`~PyConfig.buffered_stdio` дорівнює нулю, вимкніть " +"буферизацію потоків stdin, stdout і stderr." + +msgid "" +"If :c:member:`~PyConfig.interactive` is non-zero, enable stream buffering on " +"stdin and stdout (only stdout on Windows)." +msgstr "" +"Якщо :c:member:`~PyConfig.interactive` не дорівнює нулю, увімкніть " +"буферизацію потоку на stdin і stdout (лише stdout у Windows)." + +msgid "If non-zero, enable the :ref:`Python Development Mode `." +msgstr "Якщо не нуль, увімкніть :ref:`Режим розробки Python `." + +msgid "" +"Set to ``1`` by the :option:`-X dev <-X>` option and the :envvar:" +"`PYTHONDEVMODE` environment variable." +msgstr "" + +msgid "Dump Python references?" +msgstr "Скинути посилання на Python?" + +msgid "If non-zero, dump all objects which are still alive at exit." +msgstr "" +"Якщо значення відмінне від нуля, скинути всі об’єкти, які ще живі при виході." + +msgid "Set to ``1`` by the :envvar:`PYTHONDUMPREFS` environment variable." +msgstr "" +"Установіть значення ``1`` за допомогою змінної середовища :envvar:" +"`PYTHONDUMPREFS`." + +msgid "" +"Needs a special build of Python with the ``Py_TRACE_REFS`` macro defined: " +"see the :option:`configure --with-trace-refs option <--with-trace-refs>`." +msgstr "" + +msgid "" +"The site-specific directory prefix where the platform-dependent Python files " +"are installed: :data:`sys.exec_prefix`." +msgstr "" +"Префікс каталогу сайту, де встановлено файли Python, залежні від платформи: :" +"data:`sys.exec_prefix`." + +msgid "See also :c:member:`PyConfig.base_exec_prefix`." +msgstr "" + +msgid "" +"The absolute path of the executable binary for the Python interpreter: :data:" +"`sys.executable`." +msgstr "" +"Абсолютний шлях виконуваного двійкового файлу для інтерпретатора Python: :" +"data:`sys.executable`." + +msgid "See also :c:member:`PyConfig.base_executable`." +msgstr "" + +msgid "Enable faulthandler?" +msgstr "Увімкнути обробник помилок?" + +msgid "If non-zero, call :func:`faulthandler.enable` at startup." +msgstr "Якщо не нуль, викликати :func:`faulthandler.enable` під час запуску." + +msgid "" +"Set to ``1`` by :option:`-X faulthandler <-X>` and the :envvar:" +"`PYTHONFAULTHANDLER` environment variable." +msgstr "" +"Установіть значення ``1`` за допомогою :option:`-X faulthandler <-X>` і " +"змінної середовища :envvar:`PYTHONFAULTHANDLER`." + +msgid "" +":term:`Filesystem encoding `: :func:" +"`sys.getfilesystemencoding`." +msgstr "" +":term:`Кодування файлової системи `: :" +"func:`sys.getfilesystemencoding`." + +msgid "On macOS, Android and VxWorks: use ``\"utf-8\"`` by default." +msgstr "" +"У macOS, Android і VxWorks: використовуйте ``\"utf-8\"`` за умовчанням." + +msgid "" +"On Windows: use ``\"utf-8\"`` by default, or ``\"mbcs\"`` if :c:member:" +"`~PyPreConfig.legacy_windows_fs_encoding` of :c:type:`PyPreConfig` is non-" +"zero." +msgstr "" +"У Windows: використовуйте ``\"utf-8\"`` за замовчуванням або ``\"mbcs\"``, " +"якщо :c:member:`~PyPreConfig.legacy_windows_fs_encoding` :c:type:" +"`PyPreConfig` не дорівнює нулю." + +msgid "Default encoding on other platforms:" +msgstr "Стандартне кодування на інших платформах:" + +msgid "``\"utf-8\"`` if :c:member:`PyPreConfig.utf8_mode` is non-zero." +msgstr "``\"utf-8\"``, якщо :c:member:`PyPreConfig.utf8_mode` не нульовий." + +msgid "" +"``\"ascii\"`` if Python detects that ``nl_langinfo(CODESET)`` announces the " +"ASCII encoding, whereas the ``mbstowcs()`` function decodes from a different " +"encoding (usually Latin1)." +msgstr "" +"``\"ascii\"``, якщо Python виявляє, що ``nl_langinfo(CODESET)`` повідомляє " +"про кодування ASCII, тоді як функція ``mbstowcs()`` декодує з іншого " +"кодування (зазвичай Latin1)." + +msgid "``\"utf-8\"`` if ``nl_langinfo(CODESET)`` returns an empty string." +msgstr "``\"utf-8\"``, якщо ``nl_langinfo(CODESET)`` повертає порожній рядок." + +msgid "" +"Otherwise, use the :term:`locale encoding`: ``nl_langinfo(CODESET)`` result." +msgstr "" +"В іншому випадку використовуйте результат :term:`locale encoding`: " +"``nl_langinfo(CODESET)``." + +msgid "" +"At Python startup, the encoding name is normalized to the Python codec name. " +"For example, ``\"ANSI_X3.4-1968\"`` is replaced with ``\"ascii\"``." +msgstr "" +"Під час запуску Python назва кодування нормалізується до назви кодека " +"Python. Наприклад, ``\"ANSI_X3.4-1968\"`` замінюється на ``\"ascii\"``." + +msgid "See also the :c:member:`~PyConfig.filesystem_errors` member." +msgstr "Дивіться також елемент :c:member:`~PyConfig.filesystem_errors`." + +msgid "" +":term:`Filesystem error handler `: :" +"func:`sys.getfilesystemencodeerrors`." +msgstr "" +":term:`Обробник помилок файлової системи `: :func:`sys.getfilesystemencodeerrors`." + +msgid "" +"On Windows: use ``\"surrogatepass\"`` by default, or ``\"replace\"`` if :c:" +"member:`~PyPreConfig.legacy_windows_fs_encoding` of :c:type:`PyPreConfig` is " +"non-zero." +msgstr "" +"У Windows: використовуйте ``\"surrogatepass\"`` за замовчуванням або " +"``\"replace\"``, якщо :c:member:`~PyPreConfig.legacy_windows_fs_encoding` :c:" +"type:`PyPreConfig` не дорівнює нулю." + +msgid "On other platforms: use ``\"surrogateescape\"`` by default." +msgstr "" +"На інших платформах: використовуйте ``\"surrogateescape\"`` за умовчанням." + +msgid "Supported error handlers:" +msgstr "Підтримувані засоби обробки помилок:" + +msgid "``\"strict\"``" +msgstr "``\"суворий\"``" + +msgid "``\"surrogateescape\"``" +msgstr "``\"сурогатна втеча\"``" + +msgid "``\"surrogatepass\"`` (only supported with the UTF-8 encoding)" +msgstr "``\"surrogatepass\"`` (підтримується лише з кодуванням UTF-8)" + +msgid "See also the :c:member:`~PyConfig.filesystem_encoding` member." +msgstr "Дивіться також елемент :c:member:`~PyConfig.filesystem_encoding`." + +msgid "Randomized hash function seed." +msgstr "Рандомізоване початкове значення хеш-функції." + +msgid "" +"If :c:member:`~PyConfig.use_hash_seed` is zero, a seed is chosen randomly at " +"Python startup, and :c:member:`~PyConfig.hash_seed` is ignored." +msgstr "" +"Якщо :c:member:`~PyConfig.use_hash_seed` дорівнює нулю, початкове значення " +"вибирається випадковим чином під час запуску Python, а :c:member:`~PyConfig." +"hash_seed` ігнорується." + +msgid "Set by the :envvar:`PYTHONHASHSEED` environment variable." +msgstr "Встановлюється змінною середовища :envvar:`PYTHONHASHSEED`." + +msgid "" +"Default *use_hash_seed* value: ``-1`` in Python mode, ``0`` in isolated mode." +msgstr "" +"Значення *use_hash_seed* за замовчуванням: ``-1`` у режимі Python, ``0`` в " +"ізольованому режимі." + +msgid "" +"Set the default Python \"home\" directory, that is, the location of the " +"standard Python libraries (see :envvar:`PYTHONHOME`)." +msgstr "" + +msgid "Set by the :envvar:`PYTHONHOME` environment variable." +msgstr "Встановлюється змінною середовища :envvar:`PYTHONHOME`." + +msgid "Part of the :ref:`Python Path Configuration ` input." +msgstr "" +"Частина вхідних даних :ref:`Налаштування шляху Python `." + +msgid "If non-zero, profile import time." +msgstr "Якщо не нуль, час імпорту профілю." + +msgid "" +"Set the ``1`` by the :option:`-X importtime <-X>` option and the :envvar:" +"`PYTHONPROFILEIMPORTTIME` environment variable." +msgstr "" +"Установіть ``1`` за допомогою параметра :option:`-X importtime <-X>` і " +"змінної середовища :envvar:`PYTHONPROFILEIMPORTTIME`." + +msgid "Enter interactive mode after executing a script or a command." +msgstr "Увійти в інтерактивний режим після виконання сценарію або команди." + +msgid "" +"If greater than ``0``, enable inspect: when a script is passed as first " +"argument or the -c option is used, enter interactive mode after executing " +"the script or the command, even when :data:`sys.stdin` does not appear to be " +"a terminal." +msgstr "" + +msgid "" +"Incremented by the :option:`-i` command line option. Set to ``1`` if the :" +"envvar:`PYTHONINSPECT` environment variable is non-empty." +msgstr "" +"Збільшується параметром командного рядка :option:`-i`. Установіть значення " +"``1``, якщо змінна середовища :envvar:`PYTHONINSPECT` не порожня." + +msgid "Install Python signal handlers?" +msgstr "Установити обробники сигналів Python?" + +msgid "Default: ``1`` in Python mode, ``0`` in isolated mode." +msgstr "Типове значення: ``1`` в режимі Python, ``0`` в ізольованому режимі." + +msgid "If greater than ``0``, enable the interactive mode (REPL)." +msgstr "" + +msgid "Incremented by the :option:`-i` command line option." +msgstr "Збільшується параметром командного рядка :option:`-i`." + +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." +msgstr "" + +msgid "" +"Configured by the :option:`-X int_max_str_digits <-X>` command line flag or " +"the :envvar:`PYTHONINTMAXSTRDIGITS` environment variable." +msgstr "" + +msgid "" +"Default: ``-1`` in Python mode. 4300 (:data:`sys.int_info." +"default_max_str_digits`) in isolated mode." +msgstr "" + +msgid "" +"If the value of :c:member:`~PyConfig.cpu_count` is not ``-1`` then it will " +"override the return values of :func:`os.cpu_count`, :func:`os." +"process_cpu_count`, and :func:`multiprocessing.cpu_count`." +msgstr "" + +msgid "" +"Configured by the :samp:`-X cpu_count={n|default}` command line flag or the :" +"envvar:`PYTHON_CPU_COUNT` environment variable." +msgstr "" + +msgid "Default: ``-1``." +msgstr "" + +msgid "If greater than ``0``, enable isolated mode:" +msgstr "" + +msgid "" +"Set :c:member:`~PyConfig.safe_path` to ``1``: don't prepend a potentially " +"unsafe path to :data:`sys.path` at Python startup, such as the current " +"directory, the script's directory or an empty string." +msgstr "" + +msgid "" +"Set :c:member:`~PyConfig.use_environment` to ``0``: ignore ``PYTHON`` " +"environment variables." +msgstr "" + +msgid "" +"Set :c:member:`~PyConfig.user_site_directory` to ``0``: don't add the user " +"site directory to :data:`sys.path`." +msgstr "" + +msgid "" +"Python REPL doesn't import :mod:`readline` nor enable default readline " +"configuration on interactive prompts." +msgstr "" +"Python REPL не імпортує :mod:`readline` і не вмикає стандартну конфігурацію " +"readline в інтерактивних підказках." + +msgid "Set to ``1`` by the :option:`-I` command line option." +msgstr "" + +msgid "" +"See also the :ref:`Isolated Configuration ` and :c:" +"member:`PyPreConfig.isolated`." +msgstr "" + +msgid "" +"If non-zero, use :class:`io.FileIO` instead of :class:`!io." +"_WindowsConsoleIO` for :data:`sys.stdin`, :data:`sys.stdout` and :data:`sys." +"stderr`." +msgstr "" + +msgid "" +"Set to ``1`` if the :envvar:`PYTHONLEGACYWINDOWSSTDIO` environment variable " +"is set to a non-empty string." +msgstr "" +"Установіть значення ``1``, якщо змінна середовища :envvar:" +"`PYTHONLEGACYWINDOWSSTDIO` має значення непорожнього рядка." + +msgid "See also the :pep:`528` (Change Windows console encoding to UTF-8)." +msgstr "" +"Дивіться також :pep:`528` (Змінити кодування консолі Windows на UTF-8)." + +msgid "" +"If non-zero, dump statistics on :ref:`Python pymalloc memory allocator " +"` at exit." +msgstr "" +"Якщо значення відмінне від нуля, вивести статистику на :ref:`Python pymalloc " +"memory allocator ` при виході." + +msgid "Set to ``1`` by the :envvar:`PYTHONMALLOCSTATS` environment variable." +msgstr "" +"Установіть значення ``1`` за допомогою змінної середовища :envvar:" +"`PYTHONMALLOCSTATS`." + +msgid "" +"The option is ignored if Python is :option:`configured using the --without-" +"pymalloc option <--without-pymalloc>`." +msgstr "" +"Параметр ігнорується, якщо Python :option:`налаштовано за допомогою " +"параметра --without-pymalloc <--without-pymalloc>`." + +msgid "Platform library directory name: :data:`sys.platlibdir`." +msgstr "Назва каталогу бібліотеки платформи: :data:`sys.platlibdir`." + +msgid "Set by the :envvar:`PYTHONPLATLIBDIR` environment variable." +msgstr "Встановлюється змінною середовища :envvar:`PYTHONPLATLIBDIR`." + +msgid "" +"Default: value of the ``PLATLIBDIR`` macro which is set by the :option:" +"`configure --with-platlibdir option <--with-platlibdir>` (default: " +"``\"lib\"``, or ``\"DLLs\"`` on Windows)." +msgstr "" + +msgid "" +"This macro is now used on Windows to locate the standard library extension " +"modules, typically under ``DLLs``. However, for compatibility, note that " +"this value is ignored for any non-standard layouts, including in-tree builds " +"and virtual environments." +msgstr "" + +msgid "" +"Module search paths (:data:`sys.path`) as a string separated by ``DELIM`` (:" +"data:`os.pathsep`)." +msgstr "" + +msgid "Set by the :envvar:`PYTHONPATH` environment variable." +msgstr "Встановлюється змінною середовища :envvar:`PYTHONPATH`." + +msgid "Module search paths: :data:`sys.path`." +msgstr "Шляхи пошуку модуля: :data:`sys.path`." + +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``." +msgstr "" + +msgid "" +"Default: empty list (``module_search_paths``) and ``0`` " +"(``module_search_paths_set``)." +msgstr "" +"За замовчуванням: порожній список (``module_search_paths``) і ``0`` " +"(``module_search_paths_set``)." + +msgid "Compilation optimization level:" +msgstr "Рівень оптимізації компіляції:" + +msgid "``0``: Peephole optimizer, set ``__debug__`` to ``True``." +msgstr "``0``: оптимізатор Peephole, встановіть ``__debug__`` на ``True``." + +msgid "``1``: Level 0, remove assertions, set ``__debug__`` to ``False``." +msgstr "" +"``1``: Рівень 0, видалити твердження, встановити ``__debug__`` на ``False``." + +msgid "``2``: Level 1, strip docstrings." +msgstr "``2``: Рівень 1, рядки документації." + +msgid "" +"Incremented by the :option:`-O` command line option. Set to the :envvar:" +"`PYTHONOPTIMIZE` environment variable value." +msgstr "" +"Збільшується параметром командного рядка :option:`-O`. Установіть значення " +"змінної середовища :envvar:`PYTHONOPTIMIZE`." + +msgid "" +"The list of the original command line arguments passed to the Python " +"executable: :data:`sys.orig_argv`." +msgstr "" +"Список вихідних аргументів командного рядка, переданих у виконуваний файл " +"Python: :data:`sys.orig_argv`." + +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)." +msgstr "" +"Якщо список :c:member:`~PyConfig.orig_argv` порожній і :c:member:`~PyConfig." +"argv` не є списком, який містить лише порожній рядок, :c:func:" +"`PyConfig_Read` копіює :c:member:`~PyConfig.argv` в :c:member:`~PyConfig." +"orig_argv` перед зміною :c:member:`~PyConfig.argv` (якщо :c:member:" +"`~PyConfig.parse_argv` не дорівнює нулю) ." + +msgid "" +"See also the :c:member:`~PyConfig.argv` member and the :c:func:" +"`Py_GetArgcArgv` function." +msgstr "" +"Дивіться також член :c:member:`~PyConfig.argv` і функцію :c:func:" +"`Py_GetArgcArgv`." + +msgid "Default: empty list." +msgstr "За замовчуванням: порожній список." + +msgid "Parse command line arguments?" +msgstr "Розібрати аргументи командного рядка?" + +msgid "" +"If equals to ``1``, parse :c:member:`~PyConfig.argv` the same way the " +"regular Python parses :ref:`command line arguments `, and " +"strip Python arguments from :c:member:`~PyConfig.argv`." +msgstr "" +"Якщо дорівнює ``1``, аналізувати :c:member:`~PyConfig.argv` так само, як " +"звичайний Python аналізує :ref:`аргументи командного рядка `, і видаляти аргументи Python з :c:member:`~PyConfig.argv`." + +msgid "" +"The :c:member:`PyConfig.argv` arguments are now only parsed if :c:member:" +"`PyConfig.parse_argv` equals to ``1``." +msgstr "" +"Аргументи :c:member:`PyConfig.argv` тепер аналізуються, лише якщо :c:member:" +"`PyConfig.parse_argv` дорівнює ``1``." + +msgid "" +"Parser debug mode. If greater than ``0``, turn on parser debugging output " +"(for expert only, depending on compilation options)." +msgstr "" + +msgid "" +"Incremented by the :option:`-d` command line option. Set to the :envvar:" +"`PYTHONDEBUG` environment variable value." +msgstr "" +"Збільшується параметром командного рядка :option:`-d`. Установіть значення " +"змінної середовища :envvar:`PYTHONDEBUG`." + +msgid "" +"Needs a :ref:`debug build of Python ` (the ``Py_DEBUG`` macro " +"must be defined)." +msgstr "" + +msgid "" +"If non-zero, calculation of path configuration is allowed to log warnings " +"into ``stderr``. If equals to ``0``, suppress these warnings." +msgstr "" + +msgid "Now also applies on Windows." +msgstr "" + +msgid "" +"The site-specific directory prefix where the platform independent Python " +"files are installed: :data:`sys.prefix`." +msgstr "" +"Префікс каталогу сайту, де встановлено незалежні від платформи файли " +"Python: :data:`sys.prefix`." + +msgid "See also :c:member:`PyConfig.base_prefix`." +msgstr "" + +msgid "" +"Program name used to initialize :c:member:`~PyConfig.executable` and in " +"early error messages during Python initialization." +msgstr "" +"Ім’я програми, що використовується для ініціалізації :c:member:`~PyConfig." +"executable` і в ранніх повідомленнях про помилки під час ініціалізації " +"Python." + +msgid "On macOS, use :envvar:`PYTHONEXECUTABLE` environment variable if set." +msgstr "" +"У macOS використовуйте змінну середовища :envvar:`PYTHONEXECUTABLE`, якщо " +"встановлено." + +msgid "" +"If the ``WITH_NEXT_FRAMEWORK`` macro is defined, use :envvar:" +"`__PYVENV_LAUNCHER__` environment variable if set." +msgstr "" +"Якщо визначено макрос ``WITH_NEXT_FRAMEWORK``, використовуйте змінну " +"середовища :envvar:`__PYVENV_LAUNCHER__`, якщо встановлено." + +msgid "" +"Use ``argv[0]`` of :c:member:`~PyConfig.argv` if available and non-empty." +msgstr "" +"Використовуйте ``argv[0]`` :c:member:`~PyConfig.argv`, якщо доступний і не є " +"порожнім." + +msgid "" +"Otherwise, use ``L\"python\"`` on Windows, or ``L\"python3\"`` on other " +"platforms." +msgstr "" +"В іншому випадку використовуйте ``L\"python\"`` у Windows або " +"``L\"python3\"`` на інших платформах." + +msgid "" +"Directory where cached ``.pyc`` files are written: :data:`sys." +"pycache_prefix`." +msgstr "" +"Каталог, де записуються кешовані файли ``.pyc``: :data:`sys.pycache_prefix`." + +msgid "" +"Set by the :option:`-X pycache_prefix=PATH <-X>` command line option and " +"the :envvar:`PYTHONPYCACHEPREFIX` environment variable. The command-line " +"option takes precedence." +msgstr "" + +msgid "If ``NULL``, :data:`sys.pycache_prefix` is set to ``None``." +msgstr "Якщо ``NULL``, :data:`sys.pycache_prefix` має значення ``None``." + +msgid "" +"Quiet mode. If greater than ``0``, don't display the copyright and version " +"at Python startup in interactive mode." +msgstr "" + +msgid "Incremented by the :option:`-q` command line option." +msgstr "Збільшується параметром командного рядка :option:`-q`." + +msgid "Value of the :option:`-c` command line option." +msgstr "Значення параметра командного рядка :option:`-c`." + +msgid "Used by :c:func:`Py_RunMain`." +msgstr "Використовується :c:func:`Py_RunMain`." + +msgid "" +"Filename passed on the command line: trailing command line argument without :" +"option:`-c` or :option:`-m`. It is used by the :c:func:`Py_RunMain` function." +msgstr "" + +msgid "" +"For example, it is set to ``script.py`` by the ``python3 script.py arg`` " +"command line." +msgstr "" + +msgid "See also the :c:member:`PyConfig.skip_source_first_line` option." +msgstr "" + +msgid "Value of the :option:`-m` command line option." +msgstr "Значення параметра командного рядка :option:`-m`." + +msgid "" +"``package.module`` path to module that should be imported before ``site.py`` " +"is run." +msgstr "" + +msgid "" +"Set by the :option:`-X presite=package.module <-X>` command-line option and " +"the :envvar:`PYTHON_PRESITE` environment variable. The command-line option " +"takes precedence." +msgstr "" + +msgid "" +"Show total reference count at exit (excluding :term:`immortal` objects)?" +msgstr "" + +msgid "Set to ``1`` by :option:`-X showrefcount <-X>` command line option." +msgstr "" + +msgid "" +"Needs a :ref:`debug build of Python ` (the ``Py_REF_DEBUG`` " +"macro must be defined)." +msgstr "" + +msgid "Import the :mod:`site` module at startup?" +msgstr "Імпортувати модуль :mod:`site` під час запуску?" + +msgid "" +"If equal to zero, disable the import of the module site and the site-" +"dependent manipulations of :data:`sys.path` that it entails." +msgstr "" +"Якщо дорівнює нулю, вимкніть імпорт сайту модуля та залежні від сайту " +"маніпуляції :data:`sys.path`, які він тягне за собою." + +msgid "" +"Also disable these manipulations if the :mod:`site` module is explicitly " +"imported later (call :func:`site.main` if you want them to be triggered)." +msgstr "" +"Також вимкніть ці маніпуляції, якщо модуль :mod:`site` буде явно імпортовано " +"пізніше (викличте :func:`site.main`, якщо ви хочете, щоб вони були " +"активовані)." + +msgid "Set to ``0`` by the :option:`-S` command line option." +msgstr "Установіть ``0`` за допомогою параметра командного рядка :option:`-S`." + +msgid "" +":data:`sys.flags.no_site ` is set to the inverted value of :c:" +"member:`~PyConfig.site_import`." +msgstr "" + +msgid "" +"If non-zero, skip the first line of the :c:member:`PyConfig.run_filename` " +"source." +msgstr "" +"Якщо значення не нульове, пропустіть перший рядок джерела :c:member:" +"`PyConfig.run_filename`." + +msgid "" +"It allows the usage of non-Unix forms of ``#!cmd``. This is intended for a " +"DOS specific hack only." +msgstr "" +"Це дозволяє використовувати не-Unix форми ``#!cmd``. Це призначено лише для " +"спеціального злому DOS." + +msgid "Set to ``1`` by the :option:`-x` command line option." +msgstr "" +"Установіть значення ``1`` за допомогою параметра командного рядка :option:`-" +"x`." + +msgid "" +"Encoding and encoding errors of :data:`sys.stdin`, :data:`sys.stdout` and :" +"data:`sys.stderr` (but :data:`sys.stderr` always uses " +"``\"backslashreplace\"`` error handler)." +msgstr "" +"Кодування та помилки кодування :data:`sys.stdin`, :data:`sys.stdout` і :data:" +"`sys.stderr` (але :data:`sys.stderr` завжди використовує " +"``\"backslashreplace\"`` обробник помилок)." + +msgid "" +"Use the :envvar:`PYTHONIOENCODING` environment variable if it is non-empty." +msgstr "" +"Використовуйте змінну середовища :envvar:`PYTHONIOENCODING`, якщо вона " +"непорожня." + +msgid "Default encoding:" +msgstr "Стандартне кодування:" + +msgid "``\"UTF-8\"`` if :c:member:`PyPreConfig.utf8_mode` is non-zero." +msgstr "``\"UTF-8\"``, якщо :c:member:`PyPreConfig.utf8_mode` не нульовий." + +msgid "Otherwise, use the :term:`locale encoding`." +msgstr "В іншому випадку використовуйте :term:`locale encoding`." + +msgid "Default error handler:" +msgstr "Обробник помилок за замовчуванням:" + +msgid "On Windows: use ``\"surrogateescape\"``." +msgstr "У Windows: використовуйте ``\"surrogateescape\"``." + +msgid "" +"``\"surrogateescape\"`` if :c:member:`PyPreConfig.utf8_mode` is non-zero, or " +"if the LC_CTYPE locale is \"C\" or \"POSIX\"." +msgstr "" +"``\"surrogateescape\"``, якщо :c:member:`PyPreConfig.utf8_mode` не нульовий, " +"або якщо LC_CTYPE локаль \"C\" або \"POSIX\"." + +msgid "``\"strict\"`` otherwise." +msgstr "``\"строгий\"`` інакше." + +msgid "See also :c:member:`PyConfig.legacy_windows_stdio`." +msgstr "" + +msgid "Enable tracemalloc?" +msgstr "Увімкнути tracemalloc?" + +msgid "If non-zero, call :func:`tracemalloc.start` at startup." +msgstr "Якщо не нуль, викликати :func:`tracemalloc.start` під час запуску." + +msgid "" +"Set by :option:`-X tracemalloc=N <-X>` command line option and by the :" +"envvar:`PYTHONTRACEMALLOC` environment variable." +msgstr "" +"Встановлюється параметром командного рядка :option:`-X tracemalloc=N <-X>` і " +"змінною середовища :envvar:`PYTHONTRACEMALLOC`." + +msgid "Enable compatibility mode with the perf profiler?" +msgstr "" + +msgid "" +"If non-zero, initialize the perf trampoline. See :ref:`perf_profiling` for " +"more information." +msgstr "" + +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." +msgstr "" + +msgid "Use :ref:`environment variables `?" +msgstr "Використовувати :ref:`змінні середовища `?" + +msgid "" +"If equals to zero, ignore the :ref:`environment variables `." +msgstr "" +"Якщо дорівнює нулю, ігноруйте :ref:`змінні середовища `." + +msgid "Set to ``0`` by the :option:`-E` environment variable." +msgstr "" + +msgid "If non-zero, add the user site directory to :data:`sys.path`." +msgstr "" +"Якщо значення не нульове, додайте каталог сайту користувача до :data:`sys." +"path`." + +msgid "Set to ``0`` by the :option:`-s` and :option:`-I` command line options." +msgstr "" +"Установіть значення ``0`` за допомогою параметрів командного рядка :option:`-" +"s` і :option:`-I`." + +msgid "Set to ``0`` by the :envvar:`PYTHONNOUSERSITE` environment variable." +msgstr "" +"Установлено значення ``0`` за допомогою змінної середовища :envvar:" +"`PYTHONNOUSERSITE`." + +msgid "" +"Verbose mode. If greater than ``0``, print a message each time a module is " +"imported, showing the place (filename or built-in module) from which it is " +"loaded." +msgstr "" + +msgid "" +"If greater than or equal to ``2``, print a message for each file that is " +"checked for when searching for a module. Also provides information on module " +"cleanup at exit." +msgstr "" + +msgid "Incremented by the :option:`-v` command line option." +msgstr "Збільшується параметром командного рядка :option:`-v`." + +msgid "Set by the :envvar:`PYTHONVERBOSE` environment variable value." +msgstr "" + +msgid "" +"Options of the :mod:`warnings` module to build warnings filters, lowest to " +"highest priority: :data:`sys.warnoptions`." +msgstr "" +"Параметри модуля :mod:`warnings` для створення фільтрів попереджень, від " +"найнижчого до найвищого пріоритету: :data:`sys.warnoptions`." + +msgid "" +"The :mod:`warnings` module adds :data:`sys.warnoptions` in the reverse " +"order: the last :c:member:`PyConfig.warnoptions` item becomes the first item " +"of :data:`warnings.filters` which is checked first (highest priority)." +msgstr "" +"Модуль :mod:`warnings` додає :data:`sys.warnoptions` у зворотному порядку: " +"останній елемент :c:member:`PyConfig.warnoptions` стає першим елементом :" +"data:`warnings.filters`, який є перевіряється першим (найвищий пріоритет)." + +msgid "" +"The :option:`-W` command line options adds its value to :c:member:`~PyConfig." +"warnoptions`, it can be used multiple times." +msgstr "" +"Параметр командного рядка :option:`-W` додає значення до :c:member:" +"`~PyConfig.warnoptions`, тому його можна використовувати кілька разів." + +msgid "" +"The :envvar:`PYTHONWARNINGS` environment variable can also be used to add " +"warning options. Multiple options can be specified, separated by commas (``," +"``)." +msgstr "" +"Змінну середовища :envvar:`PYTHONWARNINGS` також можна використовувати для " +"додавання параметрів попередження. Можна вказати декілька параметрів, " +"розділених комами (``,``)." + +msgid "" +"If equal to ``0``, Python won't try to write ``.pyc`` files on the import of " +"source modules." +msgstr "" + +msgid "" +"Set to ``0`` by the :option:`-B` command line option and the :envvar:" +"`PYTHONDONTWRITEBYTECODE` environment variable." +msgstr "" +"Установіть значення ``0`` за допомогою параметра командного рядка :option:`-" +"B` і змінної середовища :envvar:`PYTHONDONTWRITEBYTECODE`." + +msgid "" +":data:`sys.dont_write_bytecode` is initialized to the inverted value of :c:" +"member:`~PyConfig.write_bytecode`." +msgstr "" +":data:`sys.dont_write_bytecode` ініціалізується інвертованим значенням :c:" +"member:`~PyConfig.write_bytecode`." + +msgid "Values of the :option:`-X` command line options: :data:`sys._xoptions`." +msgstr "" +"Значення параметрів командного рядка :option:`-X`: :data:`sys._xoptions`." + +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`." +msgstr "" +"Якщо :c:member:`~PyConfig.parse_argv` не дорівнює нулю, аргументи :c:member:" +"`~PyConfig.argv` аналізуються так само, як звичайний Python аналізує :ref:" +"`аргументи командного рядка `, і Python аргументи " +"видаляються з :c:member:`~PyConfig.argv`." + +msgid "" +"The :c:member:`~PyConfig.xoptions` options are parsed to set other options: " +"see the :option:`-X` command line option." +msgstr "" +"Параметри :c:member:`~PyConfig.xoptions` аналізуються, щоб встановити інші " +"параметри: дивіться параметр командного рядка :option:`-X`." + +msgid "The ``show_alloc_count`` field has been removed." +msgstr "Поле ``show_alloc_count`` видалено." + +msgid "Initialization with PyConfig" +msgstr "Ініціалізація за допомогою PyConfig" + +msgid "" +"Initializing the interpreter from a populated configuration struct is " +"handled by calling :c:func:`Py_InitializeFromConfig`." +msgstr "" + +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." +msgstr "" +"Якщо :c:func:`PyImport_FrozenModules`, :c:func:`PyImport_AppendInittab` або :" +"c:func:`PyImport_ExtendInittab` використовуються, їх потрібно встановити або " +"викликати після попередньої ініціалізації Python та перед ініціалізацією " +"Python. Якщо Python ініціалізовано кілька разів, перед кожною ініціалізацією " +"Python потрібно викликати :c:func:`PyImport_AppendInittab` або :c:func:" +"`PyImport_ExtendInittab`." + +msgid "" +"The current configuration (``PyConfig`` type) is stored in " +"``PyInterpreterState.config``." +msgstr "" +"Поточна конфігурація (тип ``PyConfig``) зберігається в ``PyInterpreterState." +"config``." + +msgid "Example setting the program name::" +msgstr "Приклад налаштування імені програми::" + +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 "" + +msgid "" +"More complete example modifying the default configuration, read the " +"configuration, and then override some parameters. Note that since 3.11, many " +"parameters are not calculated until initialization, and so values cannot be " +"read from the configuration structure. Any values set before initialize is " +"called will be left unchanged by initialization::" +msgstr "" + +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 "" + +msgid "Isolated Configuration" +msgstr "Ізольована конфігурація" + +msgid "" +":c:func:`PyPreConfig_InitIsolatedConfig` and :c:func:" +"`PyConfig_InitIsolatedConfig` functions create a configuration to isolate " +"Python from the system. For example, to embed Python into an application." +msgstr "" +"Функції :c:func:`PyPreConfig_InitIsolatedConfig` і :c:func:" +"`PyConfig_InitIsolatedConfig` створюють конфігурацію для ізоляції Python від " +"системи. Наприклад, щоб вбудувати Python у програму." + +msgid "" +"This configuration ignores global configuration variables, environment " +"variables, command line arguments (:c:member:`PyConfig.argv` is not parsed) " +"and user site directory. The C standard streams (ex: ``stdout``) and the " +"LC_CTYPE locale are left unchanged. Signal handlers are not installed." +msgstr "" +"Ця конфігурація ігнорує глобальні змінні конфігурації, змінні середовища, " +"аргументи командного рядка (:c:member:`PyConfig.argv` не аналізується) і " +"каталог сайту користувача. Стандартні потоки C (наприклад: ``stdout``) і " +"локаль LC_CTYPE залишаються без змін. Обробники сигналів не встановлені." + +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 "" + +msgid "Python Configuration" +msgstr "Конфігурація Python" + +msgid "" +":c:func:`PyPreConfig_InitPythonConfig` and :c:func:" +"`PyConfig_InitPythonConfig` functions create a configuration to build a " +"customized Python which behaves as the regular Python." +msgstr "" +"Функції :c:func:`PyPreConfig_InitPythonConfig` і :c:func:" +"`PyConfig_InitPythonConfig` створюють конфігурацію для створення " +"налаштованого Python, який веде себе як звичайний Python." + +msgid "" +"Environments variables and command line arguments are used to configure " +"Python, whereas global configuration variables are ignored." +msgstr "" +"Для налаштування Python використовуються змінні середовища та аргументи " +"командного рядка, тоді як глобальні змінні конфігурації ігноруються." + +msgid "" +"This function enables C locale coercion (:pep:`538`) and :ref:`Python UTF-8 " +"Mode ` (:pep:`540`) depending on the LC_CTYPE locale, :envvar:" +"`PYTHONUTF8` and :envvar:`PYTHONCOERCECLOCALE` environment variables." +msgstr "" +"Ця функція вмикає примусове налаштування локалі C (:pep:`538`) і :ref:" +"`Python UTF-8 Mode ` (:pep:`540`) залежно від локалі LC_CTYPE, :" +"envvar:`PYTHONUTF8` і Змінні середовища :envvar:`PYTHONCOERCECLOCALE`." + +msgid "Python Path Configuration" +msgstr "Конфігурація шляху Python" + +msgid ":c:type:`PyConfig` contains multiple fields for the path configuration:" +msgstr ":c:type:`PyConfig` містить кілька полів для конфігурації шляху:" + +msgid "Path configuration inputs:" +msgstr "Вхідні дані конфігурації шляху:" + +msgid ":c:member:`PyConfig.home`" +msgstr ":c:member:`PyConfig.home`" + +msgid ":c:member:`PyConfig.platlibdir`" +msgstr ":c:member:`PyConfig.platlibdir`" + +msgid ":c:member:`PyConfig.pathconfig_warnings`" +msgstr ":c:member:`PyConfig.pathconfig_warnings`" + +msgid ":c:member:`PyConfig.program_name`" +msgstr ":c:member:`PyConfig.program_name`" + +msgid ":c:member:`PyConfig.pythonpath_env`" +msgstr ":c:member:`PyConfig.pythonpath_env`" + +msgid "current working directory: to get absolute paths" +msgstr "поточний робочий каталог: щоб отримати абсолютні шляхи" + +msgid "" +"``PATH`` environment variable to get the program full path (from :c:member:" +"`PyConfig.program_name`)" +msgstr "" +"Змінна середовища ``PATH``, щоб отримати повний шлях до програми (з :c:" +"member:`PyConfig.program_name`)" + +msgid "``__PYVENV_LAUNCHER__`` environment variable" +msgstr "Змінна середовища ``__PYVENV_LAUNCHER__``" + +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 "" +"(Лише для Windows) Шляхи програм у реєстрі в розділі " +"\"Software\\Python\\PythonCore\\X.Y\\PythonPath\" HKEY_CURRENT_USER і " +"HKEY_LOCAL_MACHINE (де X.Y — версія Python)." + +msgid "Path configuration output fields:" +msgstr "Поля виведення конфігурації шляху:" + +msgid ":c:member:`PyConfig.base_exec_prefix`" +msgstr ":c:member:`PyConfig.base_exec_prefix`" + +msgid ":c:member:`PyConfig.base_executable`" +msgstr ":c:member:`PyConfig.base_executable`" + +msgid ":c:member:`PyConfig.base_prefix`" +msgstr ":c:member:`PyConfig.base_prefix`" + +msgid ":c:member:`PyConfig.exec_prefix`" +msgstr ":c:member:`PyConfig.exec_prefix`" + +msgid ":c:member:`PyConfig.executable`" +msgstr ":c:member:`PyConfig.executable`" + +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`" + +msgid ":c:member:`PyConfig.prefix`" +msgstr ":c:member:`PyConfig.prefix`" + +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``." +msgstr "" + +msgid "" +"It is possible to completely ignore the function calculating the default " +"path configuration by setting explicitly all path configuration output " +"fields listed above. A string is considered as set even if it is non-empty. " +"``module_search_paths`` is considered as set if ``module_search_paths_set`` " +"is set to ``1``. In this case, ``module_search_paths`` will be used without " +"modification." +msgstr "" + +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 "" + +msgid "" +"If :c:member:`~PyConfig.base_prefix` or :c:member:`~PyConfig." +"base_exec_prefix` fields are not set, they inherit their value from :c:" +"member:`~PyConfig.prefix` and :c:member:`~PyConfig.exec_prefix` respectively." +msgstr "" +"Якщо поля :c:member:`~PyConfig.base_prefix` або :c:member:`~PyConfig." +"base_exec_prefix` не встановлені, вони успадковують свої значення від :c:" +"member:`~PyConfig.prefix` і :c:member:`~PyConfig.exec_prefix` відповідно." + +msgid ":c:func:`Py_RunMain` and :c:func:`Py_Main` modify :data:`sys.path`:" +msgstr ":c:func:`Py_RunMain` і :c:func:`Py_Main` змінюють :data:`sys.path`:" + +msgid "" +"If :c:member:`~PyConfig.run_filename` is set and is a directory which " +"contains a ``__main__.py`` script, prepend :c:member:`~PyConfig." +"run_filename` to :data:`sys.path`." +msgstr "" +"Якщо :c:member:`~PyConfig.run_filename` встановлено і це каталог, який " +"містить сценарій ``__main__.py``, додайте :c:member:`~PyConfig.run_filename` " +"до :data:`sys.path`." + +msgid "If :c:member:`~PyConfig.isolated` is zero:" +msgstr "Якщо :c:member:`~PyConfig.isolated` дорівнює нулю:" + +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:member:`~PyConfig.run_module`, додайте поточний каталог " +"до :data:`sys.path`. Нічого не робити, якщо поточний каталог неможливо " +"прочитати." + +msgid "" +"If :c:member:`~PyConfig.run_filename` is set, prepend the directory of the " +"filename to :data:`sys.path`." +msgstr "" +"Якщо встановлено :c:member:`~PyConfig.run_filename`, додайте каталог імені " +"файлу перед :data:`sys.path`." + +msgid "Otherwise, prepend an empty string to :data:`sys.path`." +msgstr "В іншому випадку додайте порожній рядок до :data:`sys.path`." + +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`." +msgstr "" +"Якщо :c:member:`~PyConfig.site_import` не дорівнює нулю, :data:`sys.path` " +"можна змінити за допомогою модуля :mod:`site`. Якщо :c:member:`~PyConfig." +"user_site_directory` не дорівнює нулю, а каталог пакетів сайту користувача " +"існує, модуль :mod:`site` додає каталог пакетів сайту користувача до :data:" +"`sys.path`." + +msgid "The following configuration files are used by the path configuration:" +msgstr "У конфігурації шляху використовуються такі файли конфігурації:" + +msgid "``pyvenv.cfg``" +msgstr "``pyvenv.cfg``" + +msgid "``._pth`` file (ex: ``python._pth``)" +msgstr "" + +msgid "``pybuilddir.txt`` (Unix only)" +msgstr "``pybuilddir.txt`` (лише Unix)" + +msgid "If a ``._pth`` file is present:" +msgstr "" + +msgid "Set :c:member:`~PyConfig.isolated` to ``1``." +msgstr "" + +msgid "Set :c:member:`~PyConfig.use_environment` to ``0``." +msgstr "" + +msgid "Set :c:member:`~PyConfig.site_import` to ``0``." +msgstr "" + +msgid "Set :c:member:`~PyConfig.safe_path` to ``1``." +msgstr "" + +msgid "" +"The ``__PYVENV_LAUNCHER__`` environment variable is used to set :c:member:" +"`PyConfig.base_executable`." +msgstr "" + +msgid "Py_GetArgcArgv()" +msgstr "Py_GetArgcArgv()" + +msgid "Get the original command line arguments, before Python modified them." +msgstr "" +"Отримайте оригінальні аргументи командного рядка до того, як Python їх " +"змінив." + +msgid "See also :c:member:`PyConfig.orig_argv` member." +msgstr "Дивіться також член :c:member:`PyConfig.orig_argv`." + +msgid "Multi-Phase Initialization Private Provisional API" +msgstr "Приватний тимчасовий API багатофазної ініціалізації" + +msgid "" +"This section is a private provisional API introducing multi-phase " +"initialization, the core feature of :pep:`432`:" +msgstr "" +"Цей розділ є приватним тимчасовим API, який представляє багатофазову " +"ініціалізацію, основну функцію :pep:`432`:" + +msgid "\"Core\" initialization phase, \"bare minimum Python\":" +msgstr "Фаза ініціалізації \"Core\", \"мінімум Python\":" + +msgid "Builtin types;" +msgstr "Вбудовані типи;" + +msgid "Builtin exceptions;" +msgstr "Вбудовані винятки;" + +msgid "Builtin and frozen modules;" +msgstr "Вбудовані та заморожені модулі;" + +msgid "" +"The :mod:`sys` module is only partially initialized (ex: :data:`sys.path` " +"doesn't exist yet)." +msgstr "" +"Модуль :mod:`sys` ініціалізовано лише частково (наприклад: :data:`sys.path` " +"ще не існує)." + +msgid "\"Main\" initialization phase, Python is fully initialized:" +msgstr "\"Основна\" фаза ініціалізації, Python повністю ініціалізовано:" + +msgid "Install and configure :mod:`importlib`;" +msgstr "Встановити та налаштувати :mod:`importlib`;" + +msgid "Apply the :ref:`Path Configuration `;" +msgstr "Застосуйте :ref:`Конфігурацію шляху `;" + +msgid "Install signal handlers;" +msgstr "встановити обробники сигналів;" + +msgid "" +"Finish :mod:`sys` module initialization (ex: create :data:`sys.stdout` and :" +"data:`sys.path`);" +msgstr "" +"Завершити ініціалізацію модуля :mod:`sys` (наприклад, створити :data:`sys." +"stdout` і :data:`sys.path`);" + +msgid "" +"Enable optional features like :mod:`faulthandler` and :mod:`tracemalloc`;" +msgstr "" +"Увімкнути додаткові функції, такі як :mod:`faulthandler` і :mod:" +"`tracemalloc`;" + +msgid "Import the :mod:`site` module;" +msgstr "Імпортуйте модуль :mod:`site`;" + +msgid "etc." +msgstr "тощо" + +msgid "Private provisional API:" +msgstr "Приватний тимчасовий API:" + +msgid "" +":c:member:`PyConfig._init_main`: if set to ``0``, :c:func:" +"`Py_InitializeFromConfig` stops at the \"Core\" initialization phase." +msgstr "" + +msgid "" +"Move to the \"Main\" initialization phase, finish the Python initialization." +msgstr "" +"Перейдіть до фази ініціалізації \"Main\", завершіть ініціалізацію Python." + +msgid "" +"No module is imported during the \"Core\" phase and the ``importlib`` module " +"is not configured: the :ref:`Path Configuration ` is only " +"applied during the \"Main\" phase. It may allow to customize Python in " +"Python to override or tune the :ref:`Path Configuration `, " +"maybe install a custom :data:`sys.meta_path` importer or an import hook, etc." +msgstr "" +"Жоден модуль не імпортується під час фази \"Core\", а модуль ``importlib`` " +"не налаштовано: :ref:`Конфігурація шляху ` застосовується " +"лише під час фази \"Main\". Це може дозволити налаштувати Python у Python, " +"щоб перевизначити або налаштувати :ref:`Конфігурацію шляху `, можливо, встановити спеціальний імпортер :data:`sys.meta_path` або " +"хук імпорту тощо." + +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 "" + +msgid "" +"The \"Core\" phase is not properly defined: what should be and what should " +"not be available at this phase is not specified yet. The API is marked as " +"private and provisional: the API can be modified or even be removed anytime " +"until a proper public API is designed." +msgstr "" +"Фаза \"Core\" не визначена належним чином: що має бути, а що не має бути " +"доступним на цій фазі, ще не визначено. API позначено як приватний і " +"тимчасовий: API можна змінити або навіть видалити в будь-який час, доки не " +"буде розроблено відповідний публічний API." + +msgid "" +"Example running Python code between \"Core\" and \"Main\" initialization " +"phases::" +msgstr "" +"Приклад виконання коду Python між фазами ініціалізації \"Core\" і \"Main\"::" + +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 "" + +msgid "main()" +msgstr "" + +msgid "argv (in module sys)" +msgstr "" diff --git a/c-api/intro.po b/c-api/intro.po new file mode 100644 index 000000000..c05d0fdf6 --- /dev/null +++ b/c-api/intro.po @@ -0,0 +1,1252 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Taras Kuzyo , 2023 +# Dmytro Kazanzhy, 2023 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:49+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2023\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Introduction" +msgstr "Вступ" + +msgid "" +"The Application Programmer's Interface to Python gives C and C++ programmers " +"access to the Python interpreter at a variety of levels. The API is equally " +"usable from C++, but for brevity it is generally referred to as the Python/C " +"API. There are two fundamentally different reasons for using the Python/C " +"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." +msgstr "" +"Інтерфейс прикладного програміста для Python надає програмістам C і C++ " +"доступ до інтерпретатора Python на різних рівнях. API так само можна " +"використовувати з C++, але для стислості його зазвичай називають Python/C " +"API. Є дві принципово різні причини використання Python/C API. Перша причина " +"полягає в написанні *модулів розширення* для певних цілей; це модулі C, які " +"розширюють інтерпретатор Python. Мабуть, це найпоширеніше використання. " +"Друга причина полягає в тому, щоб використовувати Python як компонент у " +"більшій програмі; цей прийом зазвичай називають :dfn:`embedding` Python у " +"програму." + +msgid "" +"Writing an extension module is a relatively well-understood process, where a " +"\"cookbook\" approach works well. There are several tools that automate the " +"process to some extent. While people have embedded Python in other " +"applications since its early existence, the process of embedding Python is " +"less straightforward than writing an extension." +msgstr "" +"Написання модуля розширення є відносно добре зрозумілим процесом, де добре " +"працює підхід \"кулінарної книги\". Є кілька інструментів, які певною мірою " +"автоматизують процес. Хоча люди вбудовували Python в інші програми з самого " +"початку його існування, процес вбудовування Python менш простий, ніж " +"написання розширення." + +msgid "" +"Many API functions are useful independent of whether you're embedding or " +"extending Python; moreover, most applications that embed Python will need " +"to provide a custom extension as well, so it's probably a good idea to " +"become familiar with writing an extension before attempting to embed Python " +"in a real application." +msgstr "" +"Багато функцій API корисні незалежно від того, чи ви вбудовуєте чи " +"розширюєте Python; крім того, більшість програм, які вбудовують Python, " +"потребуватимуть також надати спеціальне розширення, тому, мабуть, доцільно " +"ознайомитися з написанням розширення перед тим, як намагатися вставити " +"Python у реальну програму." + +msgid "Coding standards" +msgstr "Стандарти кодування" + +msgid "" +"If you're writing C code for inclusion in CPython, you **must** follow the " +"guidelines and standards defined in :PEP:`7`. These guidelines apply " +"regardless of the version of Python you are contributing to. Following " +"these conventions is not necessary for your own third party extension " +"modules, unless you eventually expect to contribute them to Python." +msgstr "" +"Якщо ви пишете код C для включення в CPython, ви **повинні** дотримуватися " +"вказівок і стандартів, визначених у :PEP:`7`. Ці вказівки застосовуються " +"незалежно від версії Python, до якої ви робите внесок. Дотримання цих умов " +"не є обов’язковим для ваших власних модулів розширення сторонніх " +"розробників, якщо тільки ви не плануєте додати їх до Python." + +msgid "Include Files" +msgstr "Включати файли" + +msgid "" +"All function, type and macro definitions needed to use the Python/C API are " +"included in your code by the following line::" +msgstr "" +"Усі визначення функцій, типів і макросів, необхідні для використання API " +"Python/C, включено у ваш код у такий рядок::" + +msgid "" +"#define PY_SSIZE_T_CLEAN\n" +"#include " +msgstr "" + +msgid "" +"This implies inclusion of the following standard headers: ````, " +"````, ````, ````, ```` and ```` (if available)." +msgstr "" +"This implies inclusion of the following standard headers: ````, " +"````, ````, ````, ```` and ```` (if available)." + +msgid "" +"Since Python may define some pre-processor definitions which affect the " +"standard headers on some systems, you *must* include :file:`Python.h` before " +"any standard headers are included." +msgstr "" +"Оскільки Python може визначати деякі визначення попереднього процесора, які " +"впливають на стандартні заголовки в деяких системах, ви *мусите* включити :" +"file:`Python.h` перед тим, як включити будь-які стандартні заголовки." + +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 "" +"Рекомендується завжди визначати ``PY_SSIZE_T_CLEAN`` перед включенням " +"``Python.h``. Перегляньте :ref:`arg-parsing` для опису цього макросу." + +msgid "" +"All user visible names defined by Python.h (except those defined by the " +"included standard headers) have one of the prefixes ``Py`` or ``_Py``. " +"Names beginning with ``_Py`` are for internal use by the Python " +"implementation and should not be used by extension writers. Structure member " +"names do not have a reserved prefix." +msgstr "" +"Усі видимі для користувача імена, визначені Python.h (крім тих, що визначені " +"включеними стандартними заголовками), мають один із префіксів ``Py`` або " +"``_Py``. Імена, що починаються з ``_Py`` призначені для внутрішнього " +"використання реалізацією Python і не повинні використовуватися розробниками " +"розширень. Імена членів структури не мають зарезервованого префікса." + +msgid "" +"User code should never define names that begin with ``Py`` or ``_Py``. This " +"confuses the reader, and jeopardizes the portability of the user code to " +"future Python versions, which may define additional names beginning with one " +"of these prefixes." +msgstr "" +"Код користувача ніколи не повинен визначати імена, які починаються з ``Py`` " +"або ``_Py``. Це заплутує читача та ставить під загрозу перенесення коду " +"користувача на майбутні версії Python, які можуть визначати додаткові імена, " +"що починаються з одного з цих префіксів." + +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." +msgstr "" + +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>`." +msgstr "" + +msgid "" +"C++ users should note that although the API is defined entirely using C, the " +"header files properly declare the entry points to be ``extern \"C\"``. As a " +"result, there is no need to do anything special to use the API from C++." +msgstr "" +"Користувачі C++ повинні мати на увазі, що хоча API повністю визначено за " +"допомогою C, файли заголовків належним чином оголошують точки входу як " +"``extern \"C\"``. Як наслідок, немає потреби робити щось особливе для " +"використання API із C++." + +msgid "Useful macros" +msgstr "Корисні макроси" + +msgid "" +"Several useful macros are defined in the Python header files. Many are " +"defined closer to where they are useful (e.g. :c:macro:`Py_RETURN_NONE`). " +"Others of a more general utility are defined here. This is not necessarily " +"a complete listing." +msgstr "" +"У файлах заголовків Python визначено кілька корисних макросів. Багато " +"визначено ближче до того, де вони корисні (наприклад, :c:macro:" +"`Py_RETURN_NONE`). Тут визначено інші більш загальні корисності. Це не " +"обов’язково повний список." + +msgid "" +"Declare an extension module ``PyInit`` initialization function. The function " +"return type is :c:expr:`PyObject*`. The macro declares any special linkage " +"declarations required by the platform, and for C++ declares the function as " +"``extern \"C\"``." +msgstr "" + +msgid "" +"The initialization function must be named :samp:`PyInit_{name}`, where " +"*name* is the name of the module, and should be the only non-\\ ``static`` " +"item defined in the module file. Example::" +msgstr "" + +msgid "" +"static struct PyModuleDef spam_module = {\n" +" PyModuleDef_HEAD_INIT,\n" +" .m_name = \"spam\",\n" +" ...\n" +"};\n" +"\n" +"PyMODINIT_FUNC\n" +"PyInit_spam(void)\n" +"{\n" +" return PyModule_Create(&spam_module);\n" +"}" +msgstr "" + +msgid "Return the absolute value of ``x``." +msgstr "Повертає абсолютне значення ``x``." + +msgid "" +"Ask the compiler to always inline a static inline function. The compiler can " +"ignore it and decide to not inline the function." +msgstr "" + +msgid "" +"It can be used to inline performance critical static inline functions when " +"building Python in debug mode with function inlining disabled. For example, " +"MSC disables function inlining when building in debug mode." +msgstr "" + +msgid "" +"Marking blindly a static inline function with Py_ALWAYS_INLINE can result in " +"worse performances (due to increased code size for example). The compiler is " +"usually smarter than the developer for the cost/benefit analysis." +msgstr "" + +msgid "" +"If Python is :ref:`built in debug mode ` (if the :c:macro:" +"`Py_DEBUG` macro is defined), the :c:macro:`Py_ALWAYS_INLINE` macro does " +"nothing." +msgstr "" + +msgid "It must be specified before the function return type. Usage::" +msgstr "" + +msgid "static inline Py_ALWAYS_INLINE int random(void) { return 4; }" +msgstr "" + +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``." +msgstr "" +"Аргумент має бути символом або цілим числом у діапазоні [-128, 127] або [0, " +"255]. Цей макрос повертає ``c``, приведений до ``unsigned char``." + +msgid "" +"Use this for deprecated declarations. The macro must be placed before the " +"symbol name." +msgstr "" +"Використовуйте це для застарілих декларацій. Макрос необхідно розмістити " +"перед назвою символу." + +msgid "Example::" +msgstr "Приклад::" + +msgid "Py_DEPRECATED(3.8) PyAPI_FUNC(int) Py_OldFunction(void);" +msgstr "" + +msgid "MSVC support was added." +msgstr "Додано підтримку MSVC." + +msgid "" +"Like ``getenv(s)``, but returns ``NULL`` if :option:`-E` was passed on the " +"command line (see :c:member:`PyConfig.use_environment`)." +msgstr "" + +msgid "Return the maximum value between ``x`` and ``y``." +msgstr "Повертає максимальне значення між ``x`` і ``y``." + +msgid "Return the size of a structure (``type``) ``member`` in bytes." +msgstr "Повертає розмір члена структури (``type``) у байтах." + +msgid "Return the minimum value between ``x`` and ``y``." +msgstr "Повертає мінімальне значення між ``x`` і ``y``." + +msgid "" +"Disable inlining on a function. For example, it reduces the C stack " +"consumption: useful on LTO+PGO builds which heavily inline code (see :issue:" +"`33720`)." +msgstr "" + +msgid "Usage::" +msgstr "Використання::" + +msgid "Py_NO_INLINE static int random(void) { return 4; }" +msgstr "" + +msgid "" +"Convert ``x`` to a C string. E.g. ``Py_STRINGIFY(123)`` returns ``\"123\"``." +msgstr "" +"Перетворіть ``x`` на рядок C. наприклад ``Py_STRINGIFY(123)`` повертає " +"``\"123\"``." + +msgid "" +"Use this when you have a code path that cannot be reached by design. For " +"example, in the ``default:`` clause in a ``switch`` statement for which all " +"possible values are covered in ``case`` statements. Use this in places " +"where you might be tempted to put an ``assert(0)`` or ``abort()`` call." +msgstr "" +"Використовуйте це, якщо у вас є шлях коду, який неможливий за проектом. " +"Наприклад, у реченні ``default:`` в операторі ``switch``, для якого всі " +"можливі значення охоплюються в операторах ``case``. Використовуйте це в " +"місцях, де у вас може виникнути спокуса викликати ``assert(0)`` або " +"``abort()``." + +msgid "" +"In release mode, the macro helps the compiler to optimize the code, and " +"avoids a warning about unreachable code. For example, the macro is " +"implemented with ``__builtin_unreachable()`` on GCC in release mode." +msgstr "" +"У режимі випуску макрос допомагає компілятору оптимізувати код і уникає " +"попередження про недоступність коду. Наприклад, макрос реалізовано за " +"допомогою ``__builtin_unreachable()`` на GCC у режимі випуску." + +msgid "" +"A use for ``Py_UNREACHABLE()`` is following a call a function that never " +"returns but that is not declared :c:macro:`_Py_NO_RETURN`." +msgstr "" +"Використання ``Py_UNREACHABLE()`` — це виклик функції, яка ніколи не " +"повертається, але не оголошена :c:macro:`_Py_NO_RETURN`." + +msgid "" +"If a code path is very unlikely code but can be reached under exceptional " +"case, this macro must not be used. For example, under low memory condition " +"or if a system call returns a value out of the expected range. In this " +"case, it's better to report the error to the caller. If the error cannot be " +"reported to caller, :c:func:`Py_FatalError` can be used." +msgstr "" +"Якщо кодовий шлях є дуже малоймовірним кодом, але його можна досягти у " +"виняткових випадках, цей макрос не можна використовувати. Наприклад, у разі " +"недостатнього обсягу пам’яті або якщо системний виклик повертає значення за " +"межами очікуваного діапазону. У цьому випадку краще повідомити про помилку " +"абонента. Якщо про помилку неможливо повідомити абоненту, можна використати :" +"c:func:`Py_FatalError`." + +msgid "" +"Use this for unused arguments in a function definition to silence compiler " +"warnings. Example: ``int func(int a, int Py_UNUSED(b)) { return a; }``." +msgstr "" +"Використовуйте це для невикористаних аргументів у визначенні функції, щоб " +"заглушити попередження компілятора. Приклад: ``int func(int a, int " +"Py_UNUSED(b)) { return a; }``." + +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 "" +"Створює змінну з назвою ``name``, яку можна використовувати в рядках " +"документів. Якщо Python створено без рядків документації, значення буде " +"порожнім." + +msgid "" +"Use :c:macro:`PyDoc_STRVAR` for docstrings to support building Python " +"without docstrings, as specified in :pep:`7`." +msgstr "" +"Використовуйте :c:macro:`PyDoc_STRVAR` для рядків документів, щоб " +"підтримувати створення Python без рядків документів, як зазначено в :pep:`7`." + +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 "" + +msgid "" +"Creates a docstring for the given input string or an empty string if " +"docstrings are disabled." +msgstr "" +"Створює рядок документації для заданого рядка введення або порожній рядок, " +"якщо рядки документації вимкнено." + +msgid "" +"Use :c:macro:`PyDoc_STR` in specifying docstrings to support building Python " +"without docstrings, as specified in :pep:`7`." +msgstr "" +"Використовуйте :c:macro:`PyDoc_STR` у визначенні рядків документів, щоб " +"підтримувати створення Python без рядків документів, як зазначено в :pep:`7`." + +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 "" + +msgid "Objects, Types and Reference Counts" +msgstr "Об’єкти, типи та кількість посилань" + +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 " +"type representing an arbitrary Python object. Since all Python object types " +"are treated the same way by the Python language in most situations (e.g., " +"assignments, scope rules, and argument passing), it is only fitting that " +"they should be represented by a single C type. Almost all Python objects " +"live on the heap: you never declare an automatic or static variable of type :" +"c:type:`PyObject`, only pointer variables of type :c:expr:`PyObject*` can " +"be declared. The sole exception are the type objects; since these must " +"never be deallocated, they are typically static :c:type:`PyTypeObject` " +"objects." +msgstr "" + +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, " +"``PyList_Check(a)`` is true if (and only if) the object pointed to by *a* is " +"a Python list." +msgstr "" +"Усі об’єкти Python (навіть цілі числа Python) мають :dfn:`type` і :dfn:" +"`reference counting`. Тип об’єкта визначає тип об’єкта (наприклад, ціле " +"число, список або визначена користувачем функція; їх багато інших, як " +"пояснюється в :ref:`types`). Для кожного з добре відомих типів існує макрос, " +"щоб перевірити, чи належить об’єкт до цього типу; наприклад, " +"``PyList_Check(a)`` є істинним, якщо (і тільки якщо) об’єкт, на який вказує " +"*a*, є списком Python." + +msgid "Reference Counts" +msgstr "Довідкова кількість" + +msgid "" +"The reference count is important because today's computers have a finite " +"(and often severely limited) memory size; it counts how many different " +"places there are that have a :term:`strong reference` to an object. Such a " +"place could be another object, or a global (or static) C variable, or a " +"local variable in some C function. When the last :term:`strong reference` to " +"an object is released (i.e. its reference count becomes zero), the object is " +"deallocated. If it contains references to other objects, those references " +"are released. Those other objects may be deallocated in turn, if there are " +"no more references to them, and so on. (There's an obvious problem with " +"objects that reference each other here; for now, the solution is \"don't do " +"that.\")" +msgstr "" + +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 "" + +msgid "" +"It is not necessary to hold a :term:`strong reference` (i.e. increment the " +"reference count) for every local variable that contains a pointer to an " +"object. In theory, the object's reference count goes up by one when the " +"variable is made to point to it and it goes down by one when the variable " +"goes out of scope. However, these two cancel each other out, so at the end " +"the reference count hasn't changed. The only real reason to use the " +"reference count is to prevent the object from being deallocated as long as " +"our variable is pointing to it. If we know that there is at least one " +"other reference to the object that lives at least as long as our variable, " +"there is no need to take a new :term:`strong reference` (i.e. increment the " +"reference count) temporarily. An important situation where this arises is in " +"objects that are passed as arguments to C functions in an extension module " +"that are called from Python; the call mechanism guarantees to hold a " +"reference to every argument for the duration of the call." +msgstr "" + +msgid "" +"However, a common pitfall is to extract an object from a list and hold on to " +"it for a while without taking a new reference. Some other operation might " +"conceivably remove the object from the list, releasing that reference, and " +"possibly deallocating it. The real danger is that innocent-looking " +"operations may invoke arbitrary Python code which could do this; there is a " +"code path which allows control to flow back to the user from a :c:func:" +"`Py_DECREF`, so almost any operation is potentially dangerous." +msgstr "" + +msgid "" +"A safe approach is to always use the generic operations (functions whose " +"name begins with ``PyObject_``, ``PyNumber_``, ``PySequence_`` or " +"``PyMapping_``). These operations always create a new :term:`strong " +"reference` (i.e. increment the reference count) of the object they return. " +"This leaves the caller with the responsibility to call :c:func:`Py_DECREF` " +"when they are done with the result; this soon becomes second nature." +msgstr "" + +msgid "Reference Count Details" +msgstr "Деталі кількості посилань" + +msgid "" +"The reference count behavior of functions in the Python/C API is best " +"explained in terms of *ownership of references*. Ownership pertains to " +"references, never to objects (objects are not owned: they are always " +"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 "" + +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 "" +"І навпаки, коли функція, що викликає, передає посилання на об’єкт, є дві " +"можливості: функція *вкрадає* посилання на об’єкт або ні. *Крадіжка " +"посилання* означає, що коли ви передаєте посилання на функцію, ця функція " +"припускає, що вона тепер володіє цим посиланням, і ви більше не несете за це " +"відповідальності." + +msgid "" +"Few functions steal references; the two notable exceptions are :c:func:" +"`PyList_SetItem` and :c:func:`PyTuple_SetItem`, which steal a reference to " +"the item (but not to the tuple or list into which the item is put!). These " +"functions were designed to steal a reference because of a common idiom for " +"populating a tuple or list with newly created objects; for example, the code " +"to create the tuple ``(1, 2, \"three\")`` could look like this (forgetting " +"about error handling for the moment; a better way to code this is shown " +"below)::" +msgstr "" +"Кілька функцій викрадають посилання; двома помітними винятками є :c:func:" +"`PyList_SetItem` і :c:func:`PyTuple_SetItem`, які викрадають посилання на " +"елемент (але не на кортеж або список, до якого поміщено елемент!). Ці " +"функції були розроблені для викрадення посилання через загальну ідіому для " +"заповнення кортежу або списку новоствореними об’єктами; наприклад, код для " +"створення кортежу ``(1, 2, \"three\")`` може виглядати так (наразі забувши " +"про обробку помилок; кращий спосіб кодування цього показано нижче):" + +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 "" + +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 " +"although the reference to it will be stolen, use :c:func:`Py_INCREF` to grab " +"another reference before calling the reference-stealing function." +msgstr "" +"Тут :c:func:`PyLong_FromLong` повертає нове посилання, яке негайно викрадає :" +"c:func:`PyTuple_SetItem`. Якщо ви хочете продовжувати використовувати " +"об’єкт, хоча посилання на нього буде вкрадено, використовуйте :c:func:" +"`Py_INCREF`, щоб захопити інше посилання перед викликом функції викрадання " +"посилань." + +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." +msgstr "" +"До речі, :c:func:`PyTuple_SetItem` є *єдиним* способом встановлення " +"елементів кортежу; :c:func:`PySequence_SetItem` і :c:func:`PyObject_SetItem` " +"відмовляються робити це, оскільки кортежі є незмінним типом даних. Ви " +"повинні використовувати лише :c:func:`PyTuple_SetItem` для кортежів, які ви " +"створюєте самостійно." + +msgid "" +"Equivalent code for populating a list can be written using :c:func:" +"`PyList_New` and :c:func:`PyList_SetItem`." +msgstr "" +"Еквівалентний код для заповнення списку можна написати за допомогою :c:func:" +"`PyList_New` і :c:func:`PyList_SetItem`." + +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)::" +msgstr "" +"Однак на практиці ви рідко будете використовувати ці способи створення та " +"заповнення кортежу чи списку. Існує загальна функція, :c:func:" +"`Py_BuildValue`, яка може створювати найбільш поширені об’єкти зі значень C, " +"керованих :dfn:`format string`. Наприклад, наведені вище два блоки коду " +"можна замінити наступним (який також піклується про перевірку помилок):" + +msgid "" +"PyObject *tuple, *list;\n" +"\n" +"tuple = Py_BuildValue(\"(iis)\", 1, 2, \"three\");\n" +"list = Py_BuildValue(\"[iis]\", 1, 2, \"three\");" +msgstr "" + +msgid "" +"It is much more common to use :c:func:`PyObject_SetItem` and friends with " +"items whose references you are only borrowing, like arguments that were " +"passed in to the function you are writing. In that case, their behaviour " +"regarding references is much saner, since you don't have to take a new " +"reference just so you can give that reference away (\"have it be stolen\"). " +"For example, this function sets all items of a list (actually, any mutable " +"sequence) to a given item::" +msgstr "" + +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 "" + +msgid "" +"The situation is slightly different for function return values. While " +"passing a reference to most functions does not change your ownership " +"responsibilities for that reference, many functions that return a reference " +"to an object give you ownership of the reference. The reason is simple: in " +"many cases, the returned object is created on the fly, and the reference " +"you get is the only reference to the object. Therefore, the generic " +"functions that return object references, like :c:func:`PyObject_GetItem` " +"and :c:func:`PySequence_GetItem`, always return a new reference (the caller " +"becomes the owner of the reference)." +msgstr "" +"Ситуація дещо інша для значень, що повертаються функцією. Хоча передача " +"посилання на більшість функцій не змінює вашу відповідальність за це " +"посилання, багато функцій, які повертають посилання на об’єкт, передають вам " +"право власності на посилання. Причина проста: у багатьох випадках повернутий " +"об’єкт створюється на льоту, і отримане вами посилання є єдиним посиланням " +"на об’єкт. Тому загальні функції, які повертають посилання на об’єкти, як-" +"от :c:func:`PyObject_GetItem` і :c:func:`PySequence_GetItem`, завжди " +"повертають нове посилання (викликач стає власником посилання)." + +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 " +"of the object passed as an argument to the function) *doesn't enter into it!" +"* Thus, if you extract an item from a list using :c:func:`PyList_GetItem`, " +"you don't own the reference --- but if you obtain the same item from the " +"same list using :c:func:`PySequence_GetItem` (which happens to take exactly " +"the same arguments), you do own a reference to the returned object." +msgstr "" +"Важливо розуміти, що чи володієте ви посиланням, яке повертає функція, " +"залежить лише від того, яку функцію ви викликаєте --- *оперення* (тип " +"об’єкта, переданого як аргумент функції) *не входить до нього !* Таким " +"чином, якщо ви витягуєте елемент зі списку за допомогою :c:func:" +"`PyList_GetItem`, ви не володієте посиланням --- але якщо ви отримуєте той " +"самий елемент із того самого списку за допомогою :c:func:" +"`PySequence_GetItem` (який приймає точно ті самі аргументи), у вас є " +"посилання на повернутий об’єкт." + +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 "" +"Ось приклад того, як можна написати функцію, яка обчислює суму елементів у " +"списку цілих чисел; один раз за допомогою :c:func:`PyList_GetItem` і один " +"раз за допомогою :c:func:`PySequence_GetItem`. ::" + +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 "" + +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 "" + +msgid "Types" +msgstr "Типи" + +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." +msgstr "" + +msgid "" +"A signed integral type such that ``sizeof(Py_ssize_t) == sizeof(size_t)``. " +"C99 doesn't define such a thing directly (size_t is an unsigned integral " +"type). See :pep:`353` for details. ``PY_SSIZE_T_MAX`` is the largest " +"positive value of type :c:type:`Py_ssize_t`." +msgstr "" +"Інтегральний тип зі знаком, такий що ``sizeof(Py_ssize_t) == " +"sizeof(size_t)``. C99 не визначає таку річ безпосередньо (size_t є " +"беззнаковим інтегральним типом). Подробиці див. :pep:`353`. " +"``PY_SSIZE_T_MAX`` є найбільшим додатним значенням типу :c:type:`Py_ssize_t`." + +msgid "Exceptions" +msgstr "Винятки" + +msgid "" +"The Python programmer only needs to deal with exceptions if specific error " +"handling is required; unhandled exceptions are automatically propagated to " +"the caller, then to the caller's caller, and so on, until they reach the top-" +"level interpreter, where they are reported to the user accompanied by a " +"stack traceback." +msgstr "" +"Програміст на Python має мати справу лише з винятками, якщо потрібна " +"спеціальна обробка помилок; необроблені винятки автоматично поширюються до " +"абонента, потім до абонента, що викликає, і так далі, доки вони не досягнуть " +"інтерпретатора верхнього рівня, де про них повідомляється користувачеві в " +"супроводі стека." + +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 " +"is made otherwise in a function's documentation. In general, when a " +"function encounters an error, it sets an exception, discards any object " +"references that it owns, and returns an error indicator. If not documented " +"otherwise, this indicator is either ``NULL`` or ``-1``, depending on the " +"function's return type. A few functions return a Boolean true/false result, " +"with false indicating an error. Very few functions return no explicit error " +"indicator or have an ambiguous return value, and require explicit testing " +"for errors with :c:func:`PyErr_Occurred`. These exceptions are always " +"explicitly documented." +msgstr "" +"Однак для програмістів на C перевірка помилок завжди має бути явною. Усі " +"функції в Python/C API можуть викликати винятки, якщо в документації до " +"функції не вказано інше. Загалом, коли функція стикається з помилкою, вона " +"встановлює виняток, відкидає будь-які посилання на об’єкти, якими вона " +"володіє, і повертає індикатор помилки. Якщо не задокументовано інше, цей " +"індикатор має значення ``NULL`` або ``-1``, залежно від типу повернення " +"функції. Кілька функцій повертають логічний результат true/false, де false " +"вказує на помилку. Дуже небагато функцій не повертають явного індикатора " +"помилки або мають неоднозначне значення, що повертається, і вимагають явного " +"тестування помилок за допомогою :c:func:`PyErr_Occurred`. Ці винятки завжди " +"чітко задокументовані." + +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." +msgstr "" +"Винятковий стан підтримується в потоковому сховищі (це еквівалентно " +"використанню глобального сховища в непотоковій програмі). Потік може " +"перебувати в одному з двох станів: сталася виняток чи ні. Для перевірки " +"цього можна використати функцію :c:func:`PyErr_Occurred`: вона повертає " +"запозичене посилання на об’єкт типу винятку, коли виняток стався, і ``NULL`` " +"в іншому випадку. Існує кілька функцій для встановлення виняткового стану: :" +"c:func:`PyErr_SetString` є найпоширенішою (хоча і не найзагальнішою) " +"функцією для встановлення виняткового стану, а :c:func:`PyErr_Clear` очищає " +"виняток стан." + +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." +msgstr "" +"Повний винятковий стан складається з трьох об’єктів (усі з яких можуть бути " +"``NULL``): типу винятку, відповідного значення винятку та зворотного " +"відстеження. Вони мають ті самі значення, що й результат Python для ``sys." +"exc_info()``; однак вони не однакові: об’єкти Python представляють останній " +"виняток, який обробляється оператором Python :keyword:`try` ... :keyword:" +"`except`, тоді як винятковий стан рівня C існує лише під час виключення " +"передається між функціями C, доки він не досягне головного циклу " +"інтерпретатора байт-коду Python, який піклується про його передачу до ``sys." +"exc_info()`` та друзів." + +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." +msgstr "" +"Зауважте, що, починаючи з Python 1.5, бажаним, потоково-безпечним способом " +"доступу до виняткового стану з коду Python є виклик функції :func:`sys." +"exc_info`, яка повертає винятковий стан для кожного потоку для коду Python. " +"Крім того, семантика обох способів доступу до виняткового стану була змінена " +"таким чином, що функція, яка перехоплює виняток, збереже та відновить " +"винятковий стан свого потоку, щоб зберегти винятковий стан свого " +"викликаючого. Це запобігає поширеним помилкам у коді обробки виключень, " +"спричинених невинною функцією, яка перезаписує виняток, що обробляється; це " +"також зменшує часто небажане подовження тривалості життя для об’єктів, на " +"які посилаються фрейми стека в трасуванні." + +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 " +"if so, pass the exception state on to its caller. It should discard any " +"object references that it owns, and return an error indicator, but it " +"should *not* set another exception --- that would overwrite the exception " +"that was just raised, and lose important information about the exact cause " +"of the error." +msgstr "" +"Як загальний принцип, функція, яка викликає іншу функцію для виконання " +"певного завдання, повинна перевіряти, чи викликана функція викликала " +"виняток, і якщо так, передати стан винятку її викликаючому. Він має " +"відкидати будь-які посилання на об’єкти, якими він володіє, і повертати " +"індикатор помилки, але *не* встановлювати інший виняток --- який би " +"перезаписував щойно викликаний виняток і втрачав важливу інформацію про " +"точну причину помилки." + +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 " +"doesn't need to clean up any owned references when it detects an error. The " +"following example function shows some error cleanup. First, to remind you " +"why you like Python, we show the equivalent Python code::" +msgstr "" + +msgid "" +"def incr_item(dict, key):\n" +" try:\n" +" item = dict[key]\n" +" except KeyError:\n" +" item = 0\n" +" dict[key] = item + 1" +msgstr "" + +msgid "Here is the corresponding C code, in all its glory::" +msgstr "Ось відповідний код C у всій його красі:" + +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 "" + +msgid "" +"This example represents an endorsed use of the ``goto`` statement in C! It " +"illustrates the use of :c:func:`PyErr_ExceptionMatches` and :c:func:" +"`PyErr_Clear` to handle specific exceptions, and the use of :c:func:" +"`Py_XDECREF` to dispose of owned references that may be ``NULL`` (note the " +"``'X'`` in the name; :c:func:`Py_DECREF` would crash when confronted with a " +"``NULL`` reference). It is important that the variables used to hold owned " +"references are initialized to ``NULL`` for this to work; likewise, the " +"proposed return value is initialized to ``-1`` (failure) and only set to " +"success after the final call made is successful." +msgstr "" +"Цей приклад представляє схвалене використання оператора ``goto`` у C! Він " +"ілюструє використання :c:func:`PyErr_ExceptionMatches` і :c:func:" +"`PyErr_Clear` для обробки конкретних винятків, а також використання :c:func:" +"`Py_XDECREF` для утилізації власних посилань, які можуть бути ``NULL`` " +"(зверніть увагу на ``'X'`` в назві; :c:func:`Py_DECREF` аварійно завершував " +"би роботу, якщо зіткнутися з посиланням ``NULL``). Щоб це працювало, " +"важливо, щоб змінні, які використовуються для зберігання належних посилань, " +"були ініціалізовані як ``NULL``; аналогічно запропоноване значення, що " +"повертається, ініціалізується як ``-1`` (помилка) і встановлюється як " +"успішне лише після успішного останнього виклику." + +msgid "Embedding Python" +msgstr "Вбудовування Python" + +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 " +"possibly the finalization, of the Python interpreter. Most functionality of " +"the interpreter can only be used after the interpreter has been initialized." +msgstr "" +"Єдине важливе завдання, про яке мають турбуватися лише вбудовувачі (на " +"відміну від авторів розширень) інтерпретатора Python, це ініціалізація та, " +"можливо, фіналізація інтерпретатора Python. Більшість функцій інтерпретатора " +"можна використовувати лише після ініціалізації інтерпретатора." + +msgid "" +"The basic initialization function is :c:func:`Py_Initialize`. This " +"initializes the table of loaded modules, and creates the fundamental " +"modules :mod:`builtins`, :mod:`__main__`, and :mod:`sys`. It also " +"initializes the module search path (``sys.path``)." +msgstr "" +"Основною функцією ініціалізації є :c:func:`Py_Initialize`. Це ініціалізує " +"таблицю завантажених модулів і створює фундаментальні модулі :mod:" +"`builtins`, :mod:`__main__` і :mod:`sys`. Він також ініціалізує шлях пошуку " +"модуля (``sys.path``)." + +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 `." +msgstr "" + +msgid "" +"On most systems (in particular, on Unix and Windows, although the details " +"are slightly different), :c:func:`Py_Initialize` calculates the module " +"search path based upon its best guess for the location of the standard " +"Python interpreter executable, assuming that the Python library is found in " +"a fixed location relative to the Python interpreter executable. In " +"particular, it looks for a directory named :file:`lib/python{X.Y}` relative " +"to the parent directory where the executable named :file:`python` is found " +"on the shell command search path (the environment variable :envvar:`PATH`)." +msgstr "" +"У більшості систем (зокрема, в Unix і Windows, хоча деталі дещо " +"відрізняються), :c:func:`Py_Initialize` обчислює шлях пошуку модуля на " +"основі свого найкращого припущення щодо розташування стандартного " +"виконуваного файлу інтерпретатора Python, припускаючи, що бібліотека Python " +"знаходиться у фіксованому місці відносно виконуваного файлу інтерпретатора " +"Python. Зокрема, він шукає каталог під назвою :file:`lib/python{X.Y}` " +"відносно батьківського каталогу, де виконуваний файл під назвою :file:" +"`python` знайдено на шляху пошуку команд оболонки (змінна середовища :envvar:" +"`PATH`)." + +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 " +"environment variable :envvar:`PYTHONHOME`, or insert additional directories " +"in front of the standard path by setting :envvar:`PYTHONPATH`." +msgstr "" +"Наприклад, якщо виконуваний файл Python знайдено в :file:`/usr/local/bin/" +"python`, буде вважатися, що бібліотеки знаходяться в :file:`/usr/local/lib/" +"python{X.Y}`. (Насправді цей конкретний шлях також є \"резервним\" " +"розташуванням, яке використовується, коли вздовж :envvar:`PATH` не знайдено " +"виконуваного файлу з назвою :file:`python`.) Користувач може змінити цю " +"поведінку, встановивши змінну середовища :envvar:`PYTHONHOME`, або вставте " +"додаткові каталоги перед стандартним шляхом, встановивши :envvar:" +"`PYTHONPATH`." + +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 "" + +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." +msgstr "" +"Іноді бажано \"деініціалізувати\" Python. Наприклад, програма може захотіти " +"почати спочатку (здійснити ще один виклик :c:func:`Py_Initialize`) або " +"програма просто завершила роботу з Python і хоче звільнити пам’ять, виділену " +"Python. Це можна зробити, викликавши :c:func:`Py_FinalizeEx`. Функція :c:" +"func:`Py_IsInitialized` повертає істину, якщо Python зараз перебуває в " +"ініціалізованому стані. Більше інформації про ці функції наведено в " +"наступному розділі. Зауважте, що :c:func:`Py_FinalizeEx` *не* звільняє всю " +"пам’ять, виділену інтерпретатором Python, напр. Пам'ять, виділена модулями " +"розширення, наразі не може бути звільнена." + +msgid "Debugging Builds" +msgstr "Налагодження збірок" + +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 " +"of overhead to the runtime so they are not enabled by default." +msgstr "" +"Python можна створити з кількома макросами, щоб увімкнути додаткові " +"перевірки інтерпретатора та модулів розширення. Ці перевірки, як правило, " +"додають велику кількість накладних витрат до середовища виконання, тому їх " +"не ввімкнено за замовчуванням." + +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 " +"section." +msgstr "" + +msgid "" +"Compiling the interpreter with the :c:macro:`!Py_DEBUG` macro defined " +"produces what is generally meant by :ref:`a debug build of Python `. :c:macro:`!Py_DEBUG` is enabled in the Unix build by adding :option:" +"`--with-pydebug` to the :file:`./configure` command. It is also implied by " +"the presence of the not-Python-specific :c:macro:`!_DEBUG` macro. When :c:" +"macro:`!Py_DEBUG` is enabled in the Unix build, compiler optimization is " +"disabled." +msgstr "" + +msgid "" +"In addition to the reference count debugging described below, extra checks " +"are performed, see :ref:`Python Debug Build `." +msgstr "" +"На додаток до налагодження кількості посилань, описаного нижче, виконуються " +"додаткові перевірки, див. :ref:`Python Debug Build `." + +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.)" +msgstr "" +"Визначення :c:macro:`Py_TRACE_REFS` увімкне трасування посилань (див. опцію :" +"option:`configure --with-trace-refs <--with-trace-refs>`). Коли визначено, " +"круговий подвійний зв’язаний список активних об’єктів підтримується шляхом " +"додавання двох додаткових полів до кожного :c:type:`PyObject`. Також " +"відстежуються загальні асигнування. Після виходу друкуються всі наявні " +"посилання. (В інтерактивному режимі це відбувається після кожного оператора, " +"виконаного інтерпретатором.)" + +msgid "" +"Please refer to :file:`Misc/SpecialBuilds.txt` in the Python source " +"distribution for more detailed information." +msgstr "" +"Будь ласка, зверніться до :file:`Misc/SpecialBuilds.txt` у дистрибутиві " +"вихідних кодів Python для отримання більш детальної інформації." + +msgid "object" +msgstr "об'єкт" + +msgid "type" +msgstr "тип" + +msgid "Py_INCREF (C function)" +msgstr "" + +msgid "Py_DECREF (C function)" +msgstr "" + +msgid "PyList_SetItem (C function)" +msgstr "" + +msgid "PyTuple_SetItem (C function)" +msgstr "" + +msgid "set_all()" +msgstr "" + +msgid "PyList_GetItem (C function)" +msgstr "" + +msgid "PySequence_GetItem (C function)" +msgstr "" + +msgid "sum_list()" +msgstr "" + +msgid "sum_sequence()" +msgstr "" + +msgid "PyErr_Occurred (C function)" +msgstr "" + +msgid "PyErr_SetString (C function)" +msgstr "" + +msgid "PyErr_Clear (C function)" +msgstr "" + +msgid "exc_info (in module sys)" +msgstr "" + +msgid "incr_item()" +msgstr "" + +msgid "PyErr_ExceptionMatches (C function)" +msgstr "" + +msgid "Py_XDECREF (C function)" +msgstr "" + +msgid "Py_Initialize (C function)" +msgstr "" + +msgid "module" +msgstr "модуль" + +msgid "builtins" +msgstr "вбудовані елементи" + +msgid "__main__" +msgstr "" + +msgid "sys" +msgstr "система" + +msgid "search" +msgstr "" + +msgid "path" +msgstr "" + +msgid "path (in module sys)" +msgstr "" + +msgid "Py_GetPath (C function)" +msgstr "" + +msgid "Py_GetPrefix (C function)" +msgstr "" + +msgid "Py_GetExecPrefix (C function)" +msgstr "" + +msgid "Py_GetProgramFullPath (C function)" +msgstr "" + +msgid "Py_IsInitialized (C function)" +msgstr "" diff --git a/c-api/iter.po b/c-api/iter.po new file mode 100644 index 000000000..8530969b8 --- /dev/null +++ b/c-api/iter.po @@ -0,0 +1,118 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:49+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Iterator Protocol" +msgstr "Протокол ітератора" + +msgid "There are two functions specifically for working with iterators." +msgstr "Є дві функції спеціально для роботи з ітераторами." + +msgid "" +"Return non-zero if the object *o* can be safely passed to :c:func:" +"`PyIter_Next`, and ``0`` otherwise. This function always succeeds." +msgstr "" +"Повертає ненульове значення, якщо об’єкт *o* можна безпечно передати в :c:" +"func:`PyIter_Next`, і ``0`` інакше. Ця функція завжди успішна." + +msgid "" +"Return non-zero if the object *o* provides the :class:`AsyncIterator` " +"protocol, and ``0`` otherwise. This function always succeeds." +msgstr "" +"Повертає відмінне від нуля значення, якщо об’єкт *o* забезпечує протокол :" +"class:`AsyncIterator`, і ``0`` інакше. Ця функція завжди успішна." + +msgid "" +"Return the next value from the iterator *o*. The object must be an iterator " +"according to :c:func:`PyIter_Check` (it is up to the caller to check this). " +"If there are no remaining values, returns ``NULL`` with no exception set. If " +"an error occurs while retrieving the item, returns ``NULL`` and passes along " +"the exception." +msgstr "" +"Повертає наступне значення з ітератора *o*. Об’єкт має бути ітератором " +"відповідно до :c:func:`PyIter_Check` (це залежить від того, хто викликає). " +"Якщо не залишилося значень, повертає ``NULL`` без винятку. Якщо під час " +"отримання елемента виникає помилка, повертається ``NULL`` і передається " +"виняток." + +msgid "" +"To write a loop which iterates over an iterator, the C code should look " +"something like this::" +msgstr "" +"Щоб написати цикл, який повторює ітератор, код C має виглядати приблизно так:" + +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 "" + +msgid "" +"The enum value used to represent different results of :c:func:`PyIter_Send`." +msgstr "" +"Значення enum, яке використовується для представлення різних результатів :c:" +"func:`PyIter_Send`." + +msgid "Sends the *arg* value into the iterator *iter*. Returns:" +msgstr "Надсилає значення *arg* в ітератор *iter*. Повернення:" + +msgid "" +"``PYGEN_RETURN`` if iterator returns. Return value is returned via *presult*." +msgstr "" +"``PYGEN_RETURN``, якщо повертає ітератор. Повернене значення повертається " +"через *presult*." + +msgid "" +"``PYGEN_NEXT`` if iterator yields. Yielded value is returned via *presult*." +msgstr "" +"``PYGEN_NEXT``, якщо ітератор дає результат. Отримане значення повертається " +"через *presult*." + +msgid "" +"``PYGEN_ERROR`` if iterator has raised and exception. *presult* is set to " +"``NULL``." +msgstr "" +"``PYGEN_ERROR``, якщо ітератор підняв і виняток. *presult* має значення " +"``NULL``." diff --git a/c-api/iterator.po b/c-api/iterator.po new file mode 100644 index 000000000..74220080d --- /dev/null +++ b/c-api/iterator.po @@ -0,0 +1,94 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# Yuliia Shevchenko, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:49+0000\n" +"Last-Translator: Yuliia Shevchenko, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Iterator Objects" +msgstr "Ітератор об'єктів" + +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." +msgstr "" +"Python надає два об'єкти-ітератори загального призначення. Перший, ітератор " +"послідовності, працює з довільною послідовністю, що підтримує метод :meth:" +"`~object.__getitem__`. Другий працює з викликаним об'єктом і контрольним " +"значенням, викликаючи викликаний об'єкт для кожного елемента в послідовності " +"та закінчуючи ітерацію, коли повертається контрольне значення." + +msgid "" +"Type object for iterator objects returned by :c:func:`PySeqIter_New` and the " +"one-argument form of the :func:`iter` built-in function for built-in " +"sequence types." +msgstr "" +"Об’єкт типу для об’єктів-ітераторів, які повертає :c:func:`PySeqIter_New`, і " +"форма з одним аргументом вбудованої функції :func:`iter` для вбудованих " +"типів послідовностей." + +msgid "" +"Return true if the type of *op* is :c:data:`PySeqIter_Type`. This function " +"always succeeds." +msgstr "" +"Повертає true, якщо *op* має тип :c:data:`PySeqIter_Type`. Ця функція завжди " +"успішна." + +msgid "" +"Return an iterator that works with a general sequence object, *seq*. The " +"iteration ends when the sequence raises :exc:`IndexError` for the " +"subscripting operation." +msgstr "" +"Повертає ітератор, який працює з об’єктом загальної послідовності *seq*. " +"Ітерація завершується, коли послідовність викликає :exc:`IndexError` для " +"операції підписання." + +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 "" +"Об’єкт типу для об’єктів-ітераторів, що повертаються :c:func:" +"`PyCallIter_New` і формою з двома аргументами вбудованої функції :func:" +"`iter`." + +msgid "" +"Return true if the type of *op* is :c:data:`PyCallIter_Type`. This function " +"always succeeds." +msgstr "" +"Повертає true, якщо тип *op* :c:data:`PyCallIter_Type`. Ця функція завжди " +"успішна." + +msgid "" +"Return a new iterator. The first parameter, *callable*, can be any Python " +"callable object that can be called with no parameters; each call to it " +"should return the next item in the iteration. When *callable* returns a " +"value equal to *sentinel*, the iteration will be terminated." +msgstr "" +"Повернути новий ітератор. Перший параметр, *callable*, може бути будь-яким " +"викликаним об’єктом Python, який можна викликати без параметрів; кожен " +"виклик має повертати наступний елемент ітерації. Коли *callable* повертає " +"значення, рівне *sentinel*, ітерація буде припинена." diff --git a/c-api/list.po b/c-api/list.po new file mode 100644 index 000000000..70df11156 --- /dev/null +++ b/c-api/list.po @@ -0,0 +1,231 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2023 +# Yuliia Shevchenko, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:49+0000\n" +"Last-Translator: Yuliia Shevchenko, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "List Objects" +msgstr "Список об’єктів" + +msgid "This subtype of :c:type:`PyObject` represents a Python list object." +msgstr "Цей підтип :c:type:`PyObject` представляє об’єкт списку Python." + +msgid "" +"This instance of :c:type:`PyTypeObject` represents the Python list type. " +"This is the same object as :class:`list` in the Python layer." +msgstr "" +"Цей екземпляр :c:type:`PyTypeObject` представляє тип списку Python. Це той " +"самий об’єкт, що й :class:`list` на рівні Python." + +msgid "" +"Return true if *p* is a list object or an instance of a subtype of the list " +"type. This function always succeeds." +msgstr "" +"Повертає true, якщо *p* є об’єктом списку або екземпляром підтипу типу " +"списку. Ця функція завжди успішна." + +msgid "" +"Return true if *p* is a list object, but not an instance of a subtype of the " +"list type. This function always succeeds." +msgstr "" +"Повертає true, якщо *p* є об’єктом списку, але не екземпляром підтипу типу " +"списку. Ця функція завжди успішна." + +msgid "Return a new list of length *len* on success, or ``NULL`` on failure." +msgstr "" +"Повертає новий список довжиною *len* у разі успіху або ``NULL`` у разі " +"помилки." + +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()`." +msgstr "" + +msgid "" +"Return the length of the list object in *list*; this is equivalent to " +"``len(list)`` on a list object." +msgstr "" +"Повертає довжину об’єкта списку в *list*; це еквівалентно ``len(list)`` для " +"об'єкта списку." + +msgid "Similar to :c:func:`PyList_Size`, but without error checking." +msgstr "" + +msgid "" +"Return the object at position *index* in the list pointed to by *list*. The " +"position must be non-negative; indexing from the end of the list is not " +"supported. If *index* is out of bounds (:code:`<0 or >=len(list)`), return " +"``NULL`` and set an :exc:`IndexError` exception." +msgstr "" + +msgid "" +"Like :c:func:`PyList_GetItemRef`, but returns a :term:`borrowed reference` " +"instead of a :term:`strong reference`." +msgstr "" + +msgid "Similar to :c:func:`PyList_GetItem`, but without error checking." +msgstr "" + +msgid "" +"Set the item at index *index* in list to *item*. Return ``0`` on success. " +"If *index* is out of bounds, return ``-1`` and set an :exc:`IndexError` " +"exception." +msgstr "" +"Установіть для елемента з індексом *index* у списку значення *item*. У разі " +"успіху повертає ``0``. Якщо *index* виходить за межі, поверніть ``-1`` і " +"встановіть виняток :exc:`IndexError`." + +msgid "" +"This function \"steals\" a reference to *item* and discards a reference to " +"an item already in the list at the affected position." +msgstr "" +"Ця функція \"викрадає\" посилання на *елемент* і відкидає посилання на " +"елемент, який уже є у списку в ураженій позиції." + +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." +msgstr "" +"Макроформа :c:func:`PyList_SetItem` без перевірки помилок. Зазвичай це " +"використовується лише для заповнення нових списків, де немає попереднього " +"вмісту." + +msgid "" +"Bounds checking is performed as an assertion if Python is built in :ref:" +"`debug mode ` or :option:`with assertions <--with-assertions>`." +msgstr "" + +msgid "" +"This macro \"steals\" a reference to *item*, and, unlike :c:func:" +"`PyList_SetItem`, does *not* discard a reference to any item that is being " +"replaced; any reference in *list* at position *i* will be leaked." +msgstr "" +"Цей макрос \"викрадає\" посилання на *item* і, на відміну від :c:func:" +"`PyList_SetItem`, *не* відкидає посилання на будь-який елемент, який " +"замінюється; будь-яке посилання в *списку* в позиції *i* буде витік." + +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. " +"Analogous to ``list.insert(index, item)``." +msgstr "" +"Вставте елемент *item* у список *list* перед індексом *index*. Повернути " +"``0`` у разі успіху; повертає ``-1`` і встановлює виняток у разі невдачі. " +"Аналогічно ``list.insert(index, item)``." + +msgid "" +"Append the object *item* at the end of list *list*. Return ``0`` if " +"successful; return ``-1`` and set an exception if unsuccessful. Analogous " +"to ``list.append(item)``." +msgstr "" +"Додайте об’єкт *item* у кінець списку *list*. Повернути ``0`` у разі успіху; " +"повертає ``-1`` і встановлює виняток у разі невдачі. Аналогічно ``list." +"append(item)``." + +msgid "" +"Return a list of the objects in *list* containing the objects *between* " +"*low* and *high*. Return ``NULL`` and set an exception if unsuccessful. " +"Analogous to ``list[low:high]``. Indexing from the end of the list is not " +"supported." +msgstr "" +"Повертає список об’єктів у *списку*, що містить об’єкти *між* *низьким* і " +"*високим*. Повертає ``NULL`` і встановлює виняток у разі невдачі. Аналогічно " +"``list[low:high]``. Індексація з кінця списку не підтримується." + +msgid "" +"Set the slice of *list* between *low* and *high* to the contents of " +"*itemlist*. Analogous to ``list[low:high] = itemlist``. The *itemlist* may " +"be ``NULL``, indicating the assignment of an empty list (slice deletion). " +"Return ``0`` on success, ``-1`` on failure. Indexing from the end of the " +"list is not supported." +msgstr "" +"Встановіть фрагмент *списку* між *низьким* і *високим* вмістом *itemlist*. " +"Аналогічно ``list[low:high] = itemlist``. *itemlist* може бути ``NULL``, що " +"вказує на призначення порожнього списку (видалення фрагмента). Повертає " +"``0`` в разі успіху, ``-1`` у випадку невдачі. Індексація з кінця списку не " +"підтримується." + +msgid "" +"Extend *list* with the contents of *iterable*. This is the same as " +"``PyList_SetSlice(list, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, iterable)`` and " +"analogous to ``list.extend(iterable)`` or ``list += iterable``." +msgstr "" + +msgid "" +"Raise an exception and return ``-1`` if *list* is not a :class:`list` " +"object. Return 0 on success." +msgstr "" + +msgid "" +"Remove all items from *list*. This is the same as ``PyList_SetSlice(list, " +"0, PY_SSIZE_T_MAX, NULL)`` and analogous to ``list.clear()`` or ``del " +"list[:]``." +msgstr "" + +msgid "" +"Raise an exception and return ``-1`` if *list* is not a :class:`list` " +"object. Return 0 on success." +msgstr "" + +msgid "" +"Sort the items of *list* in place. Return ``0`` on success, ``-1`` on " +"failure. This is equivalent to ``list.sort()``." +msgstr "" +"Розсортуйте елементи *списку* за місцем. Повертає ``0`` в разі успіху, " +"``-1`` у випадку невдачі. Це еквівалентно ``list.sort()``." + +msgid "" +"Reverse the items of *list* in place. Return ``0`` on success, ``-1`` on " +"failure. This is the equivalent of ``list.reverse()``." +msgstr "" +"Переверніть елементи *списку* на місця. Повертає ``0`` в разі успіху, ``-1`` " +"у випадку невдачі. Це еквівалент ``list.reverse()``." + +msgid "" +"Return a new tuple object containing the contents of *list*; equivalent to " +"``tuple(list)``." +msgstr "" +"Повертає новий об’єкт кортежу, що містить вміст *list*; еквівалент " +"``tuple(list)``." + +msgid "object" +msgstr "об'єкт" + +msgid "list" +msgstr "список" + +msgid "built-in function" +msgstr "вбудована функція" + +msgid "len" +msgstr "" + +msgid "tuple" +msgstr "кортеж" diff --git a/c-api/long.po b/c-api/long.po new file mode 100644 index 000000000..ab7862c70 --- /dev/null +++ b/c-api/long.po @@ -0,0 +1,617 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:49+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Integer Objects" +msgstr "Цілі об'єкти" + +msgid "" +"All integers are implemented as \"long\" integer objects of arbitrary size." +msgstr "" +"Усі цілі числа реалізуються як \"довгі\" цілі об’єкти довільного розміру." + +msgid "" +"On error, most ``PyLong_As*`` APIs return ``(return type)-1`` which cannot " +"be distinguished from a number. Use :c:func:`PyErr_Occurred` to " +"disambiguate." +msgstr "" +"У разі помилки більшість API ``PyLong_As*`` повертають ``(тип " +"повернення)-1``, який неможливо відрізнити від числа. Використовуйте :c:func:" +"`PyErr_Occurred` для усунення неоднозначності." + +msgid "This subtype of :c:type:`PyObject` represents a Python integer object." +msgstr "Цей підтип :c:type:`PyObject` представляє цілочисельний об’єкт Python." + +msgid "" +"This instance of :c:type:`PyTypeObject` represents the Python integer type. " +"This is the same object as :class:`int` in the Python layer." +msgstr "" +"Цей екземпляр :c:type:`PyTypeObject` представляє цілочисельний тип Python. " +"Це той самий об’єкт, що й :class:`int` на рівні Python." + +msgid "" +"Return true if its argument is a :c:type:`PyLongObject` or a subtype of :c:" +"type:`PyLongObject`. This function always succeeds." +msgstr "" +"Повертає true, якщо його аргумент є :c:type:`PyLongObject` або підтипом :c:" +"type:`PyLongObject`. Ця функція завжди успішна." + +msgid "" +"Return true if its argument is a :c:type:`PyLongObject`, but not a subtype " +"of :c:type:`PyLongObject`. This function always succeeds." +msgstr "" +"Повертає true, якщо його аргумент є :c:type:`PyLongObject`, але не підтипом :" +"c:type:`PyLongObject`. Ця функція завжди успішна." + +msgid "" +"Return a new :c:type:`PyLongObject` object from *v*, or ``NULL`` on failure." +msgstr "" +"Повертає новий об’єкт :c:type:`PyLongObject` з *v* або ``NULL`` у разі " +"помилки." + +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." +msgstr "" +"Поточна реалізація зберігає масив цілих об’єктів для всіх цілих чисел від " +"``-5`` до ``256``. Коли ви створюєте int у цьому діапазоні, ви фактично " +"повертаєте посилання на існуючий об’єкт." + +msgid "" +"Return a new :c:type:`PyLongObject` object from a C :c:expr:`unsigned long`, " +"or ``NULL`` on failure." +msgstr "" + +msgid "" +"Return a new :c:type:`PyLongObject` object from a C :c:type:`Py_ssize_t`, or " +"``NULL`` on failure." +msgstr "" +"Повертає новий об’єкт :c:type:`PyLongObject` із C :c:type:`Py_ssize_t` або " +"``NULL`` у разі помилки." + +msgid "" +"Return a new :c:type:`PyLongObject` object from a C :c:type:`size_t`, or " +"``NULL`` on failure." +msgstr "" +"Повертає новий об’єкт :c:type:`PyLongObject` із C :c:type:`size_t` або " +"``NULL`` у разі помилки." + +msgid "" +"Return a new :c:type:`PyLongObject` object from a C :c:expr:`long long`, or " +"``NULL`` on failure." +msgstr "" + +msgid "" +"Return a new :c:type:`PyLongObject` object from a C :c:expr:`unsigned long " +"long`, or ``NULL`` on failure." +msgstr "" + +msgid "" +"Return a new :c:type:`PyLongObject` object from the integer part of *v*, or " +"``NULL`` on failure." +msgstr "" +"Повертає новий об’єкт :c:type:`PyLongObject` із цілої частини *v* або " +"``NULL`` у разі помилки." + +msgid "" +"Return a new :c:type:`PyLongObject` based on the string value in *str*, " +"which is interpreted according to the radix in *base*, or ``NULL`` on " +"failure. If *pend* is non-``NULL``, *\\*pend* will point to the end of " +"*str* on success or to the first character that could not be processed on " +"error. If *base* is ``0``, *str* is interpreted using the :ref:`integers` " +"definition; in this case, leading zeros in a non-zero decimal number raises " +"a :exc:`ValueError`. If *base* is not ``0``, it must be between ``2`` and " +"``36``, inclusive. Leading and trailing whitespace and single underscores " +"after a base specifier and between digits are ignored. If there are no " +"digits or *str* is not NULL-terminated following the digits and trailing " +"whitespace, :exc:`ValueError` will be raised." +msgstr "" + +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 "" + +msgid "" +"Convert a sequence of Unicode digits in the string *u* to a Python integer " +"value." +msgstr "" +"Перетворіть послідовність цифр Unicode у рядку *u* на ціле число Python." + +msgid "" +"Create a Python integer from the pointer *p*. The pointer value can be " +"retrieved from the resulting value using :c:func:`PyLong_AsVoidPtr`." +msgstr "" +"Створіть ціле число Python із покажчика *p*. Значення вказівника можна " +"отримати з результуючого значення за допомогою :c:func:`PyLong_AsVoidPtr`." + +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 "" + +msgid "" +"*flags* are as for :c:func:`PyLong_AsNativeBytes`. Passing ``-1`` will " +"select the native endian that CPython was compiled with and assume that the " +"most-significant bit is a sign bit. Passing " +"``Py_ASNATIVEBYTES_UNSIGNED_BUFFER`` will produce the same result as " +"calling :c:func:`PyLong_FromUnsignedNativeBytes`. Other flags are ignored." +msgstr "" + +msgid "" +"Create a Python integer from the value contained in the first *n_bytes* of " +"*buffer*, interpreted as an unsigned number." +msgstr "" + +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 "" + +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 "" + +msgid "" +"Raise :exc:`OverflowError` if the value of *obj* is out of range for a :c:" +"expr:`long`." +msgstr "" + +msgid "Returns ``-1`` on error. Use :c:func:`PyErr_Occurred` to disambiguate." +msgstr "" +"Повертає ``-1`` у разі помилки. Використовуйте :c:func:`PyErr_Occurred` для " +"усунення неоднозначності." + +msgid "Use :meth:`~object.__index__` if available." +msgstr "" + +msgid "This function will no longer use :meth:`~object.__int__`." +msgstr "" + +msgid "" +"A :term:`soft deprecated` alias. Exactly equivalent to the preferred " +"``PyLong_AsLong``. In particular, it can fail with :exc:`OverflowError` or " +"another exception." +msgstr "" + +msgid "The function is soft deprecated." +msgstr "" + +msgid "" +"Similar to :c:func:`PyLong_AsLong`, but store the result in a C :c:expr:" +"`int` instead of a C :c:expr:`long`." +msgstr "" + +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 "" + +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 "" + +msgid "" +"Raise :exc:`OverflowError` if the value of *obj* is out of range for a :c:" +"expr:`long long`." +msgstr "" + +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." +msgstr "" + +msgid "" +"Return a C :c:type:`Py_ssize_t` representation of *pylong*. *pylong* must " +"be an instance of :c:type:`PyLongObject`." +msgstr "" +"Повертає C :c:type:`Py_ssize_t` представлення *pylong*. *pylong* має бути " +"екземпляром :c:type:`PyLongObject`." + +msgid "" +"Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:" +"type:`Py_ssize_t`." +msgstr "" +"Викликайте :exc:`OverflowError`, якщо значення *pylong* виходить за межі " +"діапазону для :c:type:`Py_ssize_t`." + +msgid "" +"Return a C :c:expr:`unsigned long` representation of *pylong*. *pylong* " +"must be an instance of :c:type:`PyLongObject`." +msgstr "" + +msgid "" +"Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:" +"expr:`unsigned long`." +msgstr "" + +msgid "" +"Returns ``(unsigned long)-1`` on error. Use :c:func:`PyErr_Occurred` to " +"disambiguate." +msgstr "" +"У разі помилки повертає ``(unsigned long)-1``. Використовуйте :c:func:" +"`PyErr_Occurred` для усунення неоднозначності." + +msgid "" +"Return a C :c:type:`size_t` representation of *pylong*. *pylong* must be an " +"instance of :c:type:`PyLongObject`." +msgstr "" +"Повертає C :c:type:`size_t` представлення *pylong*. *pylong* має бути " +"екземпляром :c:type:`PyLongObject`." + +msgid "" +"Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:" +"type:`size_t`." +msgstr "" +"Викликайте :exc:`OverflowError`, якщо значення *pylong* виходить за межі " +"діапазону для :c:type:`size_t`." + +msgid "" +"Returns ``(size_t)-1`` on error. Use :c:func:`PyErr_Occurred` to " +"disambiguate." +msgstr "" +"Повертає ``(size_t)-1`` у разі помилки. Використовуйте :c:func:" +"`PyErr_Occurred` для усунення неоднозначності." + +msgid "" +"Return a C :c:expr:`unsigned long long` representation of *pylong*. " +"*pylong* must be an instance of :c:type:`PyLongObject`." +msgstr "" + +msgid "" +"Raise :exc:`OverflowError` if the value of *pylong* is out of range for an :" +"c:expr:`unsigned long long`." +msgstr "" + +msgid "" +"Returns ``(unsigned long long)-1`` on error. Use :c:func:`PyErr_Occurred` to " +"disambiguate." +msgstr "" +"У разі помилки повертає ``(unsigned long long)-1``. Використовуйте :c:func:" +"`PyErr_Occurred` для усунення неоднозначності." + +msgid "" +"A negative *pylong* now raises :exc:`OverflowError`, not :exc:`TypeError`." +msgstr "" +"Негативний *pylong* тепер викликає :exc:`OverflowError`, а не :exc:" +"`TypeError`." + +msgid "" +"Return a C :c:expr:`unsigned long` representation of *obj*. If *obj* is not " +"an instance of :c:type:`PyLongObject`, first call its :meth:`~object." +"__index__` method (if present) to convert it to a :c:type:`PyLongObject`." +msgstr "" + +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 "" + +msgid "" +"Returns ``(unsigned long)-1`` on error. Use :c:func:`PyErr_Occurred` to " +"disambiguate." +msgstr "" +"У разі помилки повертає ``(unsigned long)-1``. Використовуйте :c:func:" +"`PyErr_Occurred` для усунення неоднозначності." + +msgid "" +"Return a C :c:expr:`unsigned long long` representation of *obj*. If *obj* " +"is not an instance of :c:type:`PyLongObject`, first call its :meth:`~object." +"__index__` method (if present) to convert it to a :c:type:`PyLongObject`." +msgstr "" + +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 "" + +msgid "" +"Returns ``(unsigned long long)-1`` on error. Use :c:func:`PyErr_Occurred` " +"to disambiguate." +msgstr "" +"У разі помилки повертає ``(unsigned long long)-1``. Використовуйте :c:func:" +"`PyErr_Occurred` для усунення неоднозначності." + +msgid "" +"Return a C :c:expr:`double` representation of *pylong*. *pylong* must be an " +"instance of :c:type:`PyLongObject`." +msgstr "" + +msgid "" +"Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:" +"expr:`double`." +msgstr "" + +msgid "" +"Returns ``-1.0`` on error. Use :c:func:`PyErr_Occurred` to disambiguate." +msgstr "" +"Повертає ``-1.0`` у разі помилки. Використовуйте :c:func:`PyErr_Occurred` " +"для усунення неоднозначності." + +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`." +msgstr "" + +msgid "" +"Returns ``NULL`` on error. Use :c:func:`PyErr_Occurred` to disambiguate." +msgstr "" +"Повертає ``NULL`` у разі помилки. Використовуйте :c:func:`PyErr_Occurred` " +"для усунення неоднозначності." + +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 "" + +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 "" + +msgid "" +"Otherwise, returns the number of bytes required to store the value. If this " +"is equal to or less than *n_bytes*, the entire value was copied. All " +"*n_bytes* of the buffer are written: large buffers are padded with zeroes." +msgstr "" + +msgid "" +"If the returned value is greater than than *n_bytes*, the value was " +"truncated: as many of the lowest bits of the value as could fit are written, " +"and the higher bits are ignored. This matches the typical behavior of a C-" +"style downcast." +msgstr "" + +msgid "" +"Overflow is not considered an error. If the returned value is larger than " +"*n_bytes*, most significant bits were discarded." +msgstr "" + +msgid "``0`` will never be returned." +msgstr "" + +msgid "Values are always copied as two's-complement." +msgstr "" + +msgid "Usage example::" +msgstr "" + +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 "" + +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 "" + +msgid "" +"Passing *n_bytes=0* to this function is not an accurate way to determine the " +"bit length of the value." +msgstr "" + +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 "" + +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 "" + +msgid "" +"*flags* is either ``-1`` (``Py_ASNATIVEBYTES_DEFAULTS``) to select defaults " +"that behave most like a C cast, or a combination of the other flags in the " +"table below. Note that ``-1`` cannot be combined with other flags." +msgstr "" + +msgid "" +"Currently, ``-1`` corresponds to ``Py_ASNATIVEBYTES_NATIVE_ENDIAN | " +"Py_ASNATIVEBYTES_UNSIGNED_BUFFER``." +msgstr "" + +msgid "Flag" +msgstr "Прапор" + +msgid "Value" +msgstr "Значення" + +msgid "``-1``" +msgstr "" + +msgid "``0``" +msgstr "``0``" + +msgid "``1``" +msgstr "``1``" + +msgid "``3``" +msgstr "``3``" + +msgid "``4``" +msgstr "``4``" + +msgid "``8``" +msgstr "``8``" + +msgid "``16``" +msgstr "" + +msgid "" +"Specifying ``Py_ASNATIVEBYTES_NATIVE_ENDIAN`` will override any other endian " +"flags. Passing ``2`` is reserved." +msgstr "" + +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 "" + +msgid "" +"If ``Py_ASNATIVEBYTES_UNSIGNED_BUFFER`` is specified, a zero sign bit will " +"be omitted from size calculations. This allows, for example, 128 to fit in a " +"single-byte buffer. If the destination buffer is later treated as signed, a " +"positive input value may become negative. Note that the flag does not affect " +"handling of negative values: for those, space for a sign bit is always " +"requested." +msgstr "" + +msgid "" +"Specifying ``Py_ASNATIVEBYTES_REJECT_NEGATIVE`` causes an exception to be " +"set if *pylong* is negative. Without this flag, negative values will be " +"copied provided there is enough space for at least one sign bit, regardless " +"of whether ``Py_ASNATIVEBYTES_UNSIGNED_BUFFER`` was specified." +msgstr "" + +msgid "" +"If ``Py_ASNATIVEBYTES_ALLOW_INDEX`` is specified and a non-integer value is " +"passed, its :meth:`~object.__index__` method will be called first. This may " +"result in Python code executing and other threads being allowed to run, " +"which could cause changes to other objects or values in use. When *flags* is " +"``-1``, this option is not set, and non-integer values will raise :exc:" +"`TypeError`." +msgstr "" + +msgid "" +"With the default *flags* (``-1``, or *UNSIGNED_BUFFER* without " +"*REJECT_NEGATIVE*), multiple Python integers can map to a single value " +"without overflow. For example, both ``255`` and ``-1`` fit a single-byte " +"buffer and set all its bits. This matches typical C cast behavior." +msgstr "" + +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 "" + +msgid "On failure, return ``NULL`` with an exception set." +msgstr "" + +msgid "Return 1 if *op* is compact, 0 otherwise." +msgstr "" + +msgid "" +"This function makes it possible for performance-critical code to implement a " +"“fast path” for small integers. For compact values use :c:func:" +"`PyUnstable_Long_CompactValue`; for others fall back to a :c:func:" +"`PyLong_As* ` function or :c:func:`PyLong_AsNativeBytes`." +msgstr "" + +msgid "The speedup is expected to be negligible for most users." +msgstr "" + +msgid "" +"Exactly what values are considered compact is an implementation detail and " +"is subject to change." +msgstr "" + +msgid "" +"If *op* is compact, as determined by :c:func:`PyUnstable_Long_IsCompact`, " +"return its value." +msgstr "" + +msgid "Otherwise, the return value is undefined." +msgstr "" + +msgid "object" +msgstr "об'єкт" + +msgid "long integer" +msgstr "" + +msgid "integer" +msgstr "ціле число" + +msgid "LONG_MAX (C macro)" +msgstr "" + +msgid "OverflowError (built-in exception)" +msgstr "" + +msgid "PY_SSIZE_T_MAX (C macro)" +msgstr "" + +msgid "ULONG_MAX (C macro)" +msgstr "" + +msgid "SIZE_MAX (C macro)" +msgstr "" diff --git a/c-api/mapping.po b/c-api/mapping.po new file mode 100644 index 000000000..075f95844 --- /dev/null +++ b/c-api/mapping.po @@ -0,0 +1,163 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# Yuliia Shevchenko, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:49+0000\n" +"Last-Translator: Yuliia Shevchenko, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Mapping Protocol" +msgstr "Протокол відображення" + +msgid "" +"See also :c:func:`PyObject_GetItem`, :c:func:`PyObject_SetItem` and :c:func:" +"`PyObject_DelItem`." +msgstr "" +"Дивіться також :c:func:`PyObject_GetItem`, :c:func:`PyObject_SetItem` і :c:" +"func:`PyObject_DelItem`." + +msgid "" +"Return ``1`` if the object provides the mapping protocol or supports " +"slicing, and ``0`` otherwise. Note that it returns ``1`` for Python classes " +"with a :meth:`~object.__getitem__` method, since in general it is impossible " +"to determine what type of keys the class supports. This function always " +"succeeds." +msgstr "" + +msgid "" +"Returns the number of keys in object *o* on success, and ``-1`` on failure. " +"This is equivalent to the Python expression ``len(o)``." +msgstr "" +"Повертає кількість ключів в об’єкті *o* в разі успіху та ``-1`` у разі " +"невдачі. Це еквівалентно виразу Python ``len(o)``." + +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*`." +msgstr "" + +msgid "" +"Variant of :c:func:`PyObject_GetItem` which doesn't raise :exc:`KeyError` if " +"the key is not found." +msgstr "" + +msgid "" +"If the key is found, return ``1`` and set *\\*result* to a new :term:`strong " +"reference` to the corresponding value. If the key is not found, return ``0`` " +"and set *\\*result* to ``NULL``; the :exc:`KeyError` is silenced. If an " +"error other than :exc:`KeyError` is raised, return ``-1`` and set " +"*\\*result* to ``NULL``." +msgstr "" + +msgid "" +"This is the same as :c:func:`PyMapping_GetOptionalItem`, but *key* is " +"specified as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than " +"a :c:expr:`PyObject*`." +msgstr "" + +msgid "" +"This is the same as :c:func:`PyObject_SetItem`, but *key* is specified as a :" +"c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" +"`PyObject*`." +msgstr "" + +msgid "This is an alias of :c:func:`PyObject_DelItem`." +msgstr "" + +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 "" + +msgid "" +"Return ``1`` if the mapping object has the key *key* and ``0`` otherwise. " +"This is equivalent to the Python expression ``key in o``. On failure, return " +"``-1``." +msgstr "" + +msgid "" +"This is the same as :c:func:`PyMapping_HasKeyWithError`, but *key* is " +"specified as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than " +"a :c:expr:`PyObject*`." +msgstr "" + +msgid "" +"Return ``1`` if the mapping object has the key *key* and ``0`` otherwise. " +"This is equivalent to the Python expression ``key in o``. This function " +"always succeeds." +msgstr "" +"Повертає ``1``, якщо об’єкт зіставлення має ключ *key*, і ``0`` інакше. Це " +"еквівалентно виразу Python ``key in o``. Ця функція завжди успішна." + +msgid "" +"Exceptions which occur when this calls :meth:`~object.__getitem__` method " +"are silently ignored. For proper error handling, use :c:func:" +"`PyMapping_HasKeyWithError`, :c:func:`PyMapping_GetOptionalItem` or :c:func:" +"`PyObject_GetItem()` instead." +msgstr "" + +msgid "" +"This is the same as :c:func:`PyMapping_HasKey`, but *key* is specified as a :" +"c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" +"`PyObject*`." +msgstr "" + +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 "" + +msgid "" +"On success, return a list of the keys in object *o*. On failure, return " +"``NULL``." +msgstr "" +"У разі успіху повертає список ключів в об’єкті *o*. У разі помилки поверніть " +"``NULL``." + +msgid "Previously, the function returned a list or a tuple." +msgstr "Раніше функція повертала список або кортеж." + +msgid "" +"On success, return a list of the values in object *o*. On failure, return " +"``NULL``." +msgstr "" +"У разі успіху повертає список значень в об’єкті *o*. У разі помилки " +"поверніть ``NULL``." + +msgid "" +"On success, return a list of the items in object *o*, where each item is a " +"tuple containing a key-value pair. On failure, return ``NULL``." +msgstr "" +"У разі успіху повертає список елементів в об’єкті *o*, де кожен елемент є " +"кортежем, що містить пару ключ-значення. У разі помилки поверніть ``NULL``." + +msgid "built-in function" +msgstr "вбудована функція" + +msgid "len" +msgstr "" diff --git a/c-api/marshal.po b/c-api/marshal.po new file mode 100644 index 000000000..ed43d828f --- /dev/null +++ b/c-api/marshal.po @@ -0,0 +1,129 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:49+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Data marshalling support" +msgstr "Підтримка маршалінгу даних" + +msgid "" +"These routines allow C code to work with serialized objects using the same " +"data format as the :mod:`marshal` module. There are functions to write data " +"into the serialization format, and additional functions that can be used to " +"read the data back. Files used to store marshalled data must be opened in " +"binary mode." +msgstr "" +"Ці процедури дозволяють коду C працювати з серіалізованими об’єктами, " +"використовуючи той самий формат даних, що й модуль :mod:`marshal`. Існують " +"функції для запису даних у формат серіалізації та додаткові функції, які " +"можна використовувати для зворотного читання даних. Файли, які " +"використовуються для зберігання маршалованих даних, необхідно відкривати в " +"двійковому режимі." + +msgid "Numeric values are stored with the least significant byte first." +msgstr "Числові значення зберігаються з молодшим байтом першим." + +msgid "" +"The module supports two versions of the data format: version 0 is the " +"historical version, version 1 shares interned strings in the file, and upon " +"unmarshalling. Version 2 uses a binary format for floating-point numbers. " +"``Py_MARSHAL_VERSION`` indicates the current file format (currently 2)." +msgstr "" + +msgid "" +"Marshal a :c:expr:`long` integer, *value*, to *file*. This will only write " +"the least-significant 32 bits of *value*; regardless of the size of the " +"native :c:expr:`long` type. *version* indicates the file format." +msgstr "" + +msgid "" +"This function can fail, in which case it sets the error indicator. Use :c:" +"func:`PyErr_Occurred` to check for that." +msgstr "" + +msgid "" +"Marshal a Python object, *value*, to *file*. *version* indicates the file " +"format." +msgstr "" +"Маршал об’єкта Python, *значення*, до *файлу*. *версія* вказує на формат " +"файлу." + +msgid "" +"Return a bytes object containing the marshalled representation of *value*. " +"*version* indicates the file format." +msgstr "" +"Повертає об’єкт bytes, що містить упорядковане представлення *value*. " +"*версія* вказує на формат файлу." + +msgid "The following functions allow marshalled values to be read back in." +msgstr "Наступні функції дозволяють зчитувати упорядковані значення." + +msgid "" +"Return a C :c:expr:`long` from the data stream in a :c:expr:`FILE*` opened " +"for reading. Only a 32-bit value can be read in using this function, " +"regardless of the native size of :c:expr:`long`." +msgstr "" + +msgid "" +"On error, sets the appropriate exception (:exc:`EOFError`) and returns " +"``-1``." +msgstr "" +"У разі помилки встановлює відповідний виняток (:exc:`EOFError`) і повертає " +"``-1``." + +msgid "" +"Return a C :c:expr:`short` from the data stream in a :c:expr:`FILE*` opened " +"for reading. Only a 16-bit value can be read in using this function, " +"regardless of the native size of :c:expr:`short`." +msgstr "" + +msgid "" +"Return a Python object from the data stream in a :c:expr:`FILE*` opened for " +"reading." +msgstr "" + +msgid "" +"On error, sets the appropriate exception (:exc:`EOFError`, :exc:`ValueError` " +"or :exc:`TypeError`) and returns ``NULL``." +msgstr "" +"У разі помилки встановлює відповідний виняток (:exc:`EOFError`, :exc:" +"`ValueError` або :exc:`TypeError`) і повертає ``NULL``." + +msgid "" +"Return a Python object from the data stream in a :c:expr:`FILE*` opened for " +"reading. Unlike :c:func:`PyMarshal_ReadObjectFromFile`, this function " +"assumes that no further objects will be read from the file, allowing it to " +"aggressively load file data into memory so that the de-serialization can " +"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 " +"anything else from the file." +msgstr "" + +msgid "" +"Return a Python object from the data stream in a byte buffer containing " +"*len* bytes pointed to by *data*." +msgstr "" +"Повертає об’єкт Python із потоку даних у байтовий буфер, що містить *len* " +"байти, на які вказує *data*." diff --git a/c-api/memory.po b/c-api/memory.po new file mode 100644 index 000000000..55f8f68e7 --- /dev/null +++ b/c-api/memory.po @@ -0,0 +1,1185 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:49+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Memory Management" +msgstr "Управління пам'яттю" + +msgid "Overview" +msgstr "Огляд" + +msgid "" +"Memory management in Python involves a private heap containing all Python " +"objects and data structures. The management of this private heap is ensured " +"internally by the *Python memory manager*. The Python memory manager has " +"different components which deal with various dynamic storage management " +"aspects, like sharing, segmentation, preallocation or caching." +msgstr "" +"Керування пам’яттю в Python включає приватну купу, що містить усі об’єкти та " +"структури даних Python. Управління цією приватною купою забезпечується " +"внутрішньо за допомогою *Менеджера пам’яті Python*. Менеджер пам’яті Python " +"має різні компоненти, які стосуються різноманітних аспектів керування " +"динамічним сховищем, наприклад спільного використання, сегментації, " +"попереднього розподілу чи кешування." + +msgid "" +"At the lowest level, a raw memory allocator ensures that there is enough " +"room in the private heap for storing all Python-related data by interacting " +"with the memory manager of the operating system. On top of the raw memory " +"allocator, several object-specific allocators operate on the same heap and " +"implement distinct memory management policies adapted to the peculiarities " +"of every object type. For example, integer objects are managed differently " +"within the heap than strings, tuples or dictionaries because integers imply " +"different storage requirements and speed/space tradeoffs. The Python memory " +"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 "" +"На найнижчому рівні розподільник необробленої пам’яті забезпечує наявність " +"достатнього місця в приватній купі для зберігання всіх пов’язаних із Python " +"даних шляхом взаємодії з диспетчером пам’яті операційної системи. Окрім " +"необробленого розподільника пам’яті, кілька об’єктно-специфічних " +"розподільників працюють на одній купі та реалізують різні політики керування " +"пам’яттю, адаптовані до особливостей кожного типу об’єкта. Наприклад, цілими " +"об’єктами в купі керують інакше, ніж рядками, кортежами чи словниками, " +"оскільки цілі числа передбачають різні вимоги до сховища та компроміси між " +"швидкістю та простором. Таким чином, менеджер пам’яті Python делегує частину " +"роботи об’єктно-специфічним розподільникам, але гарантує, що останні " +"працюють у межах приватної купи." + +msgid "" +"It is important to understand that the management of the Python heap is " +"performed by the interpreter itself and that the user has no control over " +"it, even if they regularly manipulate object pointers to memory blocks " +"inside that heap. The allocation of heap space for Python objects and other " +"internal buffers is performed on demand by the Python memory manager through " +"the Python/C API functions listed in this document." +msgstr "" +"Важливо розуміти, що керування купою Python виконується самим " +"інтерпретатором і що користувач не має контролю над нею, навіть якщо вони " +"регулярно маніпулюють покажчиками об’єктів на блоки пам’яті всередині цієї " +"купи. Виділення простору купи для об’єктів Python та інших внутрішніх " +"буферів виконується на вимогу менеджером пам’яті Python за допомогою функцій " +"API Python/C, перелічених у цьому документі." + +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::" +msgstr "" +"Щоб уникнути пошкодження пам’яті, автори розширень ніколи не повинні " +"намагатися працювати з об’єктами Python за допомогою функцій, експортованих " +"бібліотекою C: :c:func:`malloc`, :c:func:`calloc`, :c:func:`realloc` і :c:" +"func:`free`. Це призведе до змішаних викликів між розподільником C і " +"диспетчером пам’яті Python із фатальними наслідками, оскільки вони " +"реалізують різні алгоритми та працюють із різними купами. Однак можна " +"безпечно виділяти та звільняти блоки пам’яті за допомогою розподільника " +"бібліотеки C для окремих цілей, як показано в наступному прикладі:" + +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 "" + +msgid "" +"In this example, the memory request for the I/O buffer is handled by the C " +"library allocator. The Python memory manager is involved only in the " +"allocation of the bytes object returned as a result." +msgstr "" +"У цьому прикладі запит пам’яті для буфера введення/виведення обробляється " +"розподільником бібліотеки C. Менеджер пам’яті Python бере участь лише у " +"розподілі об’єкта bytes, який повертається в результаті." + +msgid "" +"In most situations, however, it is recommended to allocate memory from the " +"Python heap specifically because the latter is under control of the Python " +"memory manager. For example, this is required when the interpreter is " +"extended with new object types written in C. Another reason for using the " +"Python heap is the desire to *inform* the Python memory manager about the " +"memory needs of the extension module. Even when the requested memory is used " +"exclusively for internal, highly specific purposes, delegating all memory " +"requests to the Python memory manager causes the interpreter to have a more " +"accurate image of its memory footprint as a whole. Consequently, under " +"certain circumstances, the Python memory manager may or may not trigger " +"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." +msgstr "" + +msgid "" +"The :envvar:`PYTHONMALLOC` environment variable can be used to configure the " +"memory allocators used by Python." +msgstr "" +"Змінну середовища :envvar:`PYTHONMALLOC` можна використовувати для " +"налаштування розподільників пам’яті, які використовує Python." + +msgid "" +"The :envvar:`PYTHONMALLOCSTATS` environment variable can be used to print " +"statistics of the :ref:`pymalloc memory allocator ` every time a " +"new pymalloc object arena is created, and on shutdown." +msgstr "" +"Змінну середовища :envvar:`PYTHONMALLOCSTATS` можна використовувати для " +"виведення статистики :ref:`розподільника пам’яті pymalloc ` " +"кожного разу, коли створюється нова арена об’єкта pymalloc, і після " +"завершення роботи." + +msgid "Allocator Domains" +msgstr "Розподільник доменів" + +msgid "" +"All allocating functions belong to one of three different \"domains\" (see " +"also :c:type:`PyMemAllocatorDomain`). These domains represent different " +"allocation strategies and are optimized for different purposes. The specific " +"details on how every domain allocates memory or what internal functions each " +"domain calls is considered an implementation detail, but for debugging " +"purposes a simplified table can be found at :ref:`here `. The APIs used to allocate and free a block of memory must be " +"from the same domain. For example, :c:func:`PyMem_Free` must be used to free " +"memory allocated using :c:func:`PyMem_Malloc`." +msgstr "" + +msgid "The three allocation domains are:" +msgstr "Три домени розподілу:" + +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 from the system. See :ref:`Raw Memory Interface `." +msgstr "" + +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. See :" +"ref:`Memory Interface `." +msgstr "" + +msgid "" +"Object domain: intended for allocating memory for Python objects. The memory " +"is taken from the Python private heap. See :ref:`Object allocators " +"`." +msgstr "" + +msgid "" +"The :term:`free-threaded ` build requires that only Python " +"objects are allocated using the \"object\" domain and that all Python " +"objects are allocated using that domain. This differs from the prior Python " +"versions, where this was only a best practice and not a hard requirement." +msgstr "" + +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 "" + +msgid "See :ref:`Memory Allocation APIs `." +msgstr "" + +msgid "Raw Memory Interface" +msgstr "Інтерфейс необробленої пам'яті" + +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 "" +"Наступні набори функцій є оболонками для системного розподілювача. Ці " +"функції є потокобезпечними, :term:`GIL ` не " +"потрібно зберігати." + +msgid "" +"The :ref:`default raw memory allocator ` uses the " +"following functions: :c:func:`malloc`, :c:func:`calloc`, :c:func:`realloc` " +"and :c:func:`!free`; call ``malloc(1)`` (or ``calloc(1, 1)``) when " +"requesting zero bytes." +msgstr "" + +msgid "" +"Allocates *n* bytes and returns a pointer of type :c:expr:`void*` to the " +"allocated memory, or ``NULL`` if the request fails." +msgstr "" + +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 "" +"Запит нульових байтів повертає окремий вказівник, відмінний від ``NULL``, " +"якщо це можливо, ніби замість цього було викликано ``PyMem_RawMalloc(1)``. " +"Пам'ять жодним чином не буде ініціалізовано." + +msgid "" +"Allocates *nelem* elements each whose size in bytes is *elsize* and returns " +"a pointer of type :c:expr:`void*` to the allocated memory, or ``NULL`` if " +"the request fails. The memory is initialized to zeros." +msgstr "" + +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 "" +"Запит нульових елементів або елементів розміром нуль байтів повертає окремий " +"вказівник, відмінний від ``NULL``, якщо це можливо, ніби замість цього було " +"викликано ``PyMem_RawCalloc(1, 1)``." + +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 "" +"Змінює розмір блоку пам'яті, на який вказує *p*, до *n* байтів. Вміст буде " +"незмінним до мінімуму старого та нового розмірів." + +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 "" +"Якщо *p* має значення ``NULL``, виклик еквівалентний ``PyMem_RawMalloc(n)``; " +"інакше, якщо *n* дорівнює нулю, розмір блоку пам’яті змінюється, але не " +"звільняється, а повернутий вказівник не є ``NULL``." + +msgid "" +"Unless *p* is ``NULL``, it must have been returned by a previous call to :c:" +"func:`PyMem_RawMalloc`, :c:func:`PyMem_RawRealloc` or :c:func:" +"`PyMem_RawCalloc`." +msgstr "" +"Якщо *p* не має значення ``NULL``, воно має бути повернуто попереднім " +"викликом :c:func:`PyMem_RawMalloc`, :c:func:`PyMem_RawRealloc` або :c:func:" +"`PyMem_RawCalloc`." + +msgid "" +"If the request fails, :c:func:`PyMem_RawRealloc` returns ``NULL`` and *p* " +"remains a valid pointer to the previous memory area." +msgstr "" +"Якщо запит завершується невдало, :c:func:`PyMem_RawRealloc` повертає " +"``NULL``, а *p* залишається дійсним покажчиком на попередню область пам’яті." + +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." +msgstr "" +"Звільняє блок пам’яті, на який вказує *p*, який мав бути повернутий " +"попереднім викликом :c:func:`PyMem_RawMalloc`, :c:func:`PyMem_RawRealloc` " +"або :c:func:`PyMem_RawCalloc`. В іншому випадку, або якщо " +"``PyMem_RawFree(p)`` був викликаний раніше, виникає невизначена поведінка." + +msgid "If *p* is ``NULL``, no operation is performed." +msgstr "Якщо *p* має значення ``NULL``, жодна операція не виконується." + +msgid "Memory Interface" +msgstr "Інтерфейс пам'яті" + +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 "" +"Наступні набори функцій, створені за стандартом ANSI C, але вказуючи " +"поведінку під час запиту нульових байтів, доступні для виділення та " +"звільнення пам’яті з купи Python." + +msgid "" +"The :ref:`default memory allocator ` uses the :" +"ref:`pymalloc memory allocator `." +msgstr "" +":ref:`розподільник пам’яті за замовчуванням ` " +"використовує :ref:`розподільник пам’яті pymalloc `." + +msgid "" +"The :term:`GIL ` must be held when using these " +"functions." +msgstr "" +":term:`GIL ` має зберігатися під час використання " +"цих функцій." + +msgid "" +"The default allocator is now pymalloc instead of system :c:func:`malloc`." +msgstr "" +"Типовим розподільником тепер є pymalloc замість system :c:func:`malloc`." + +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 "" +"Запит нульових байтів повертає окремий вказівник, відмінний від ``NULL``, " +"якщо це можливо, ніби замість цього було викликано ``PyMem_Malloc(1)``. " +"Пам'ять жодним чином не буде ініціалізовано." + +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 "" +"Запит нульових елементів або елементів розміром нуль байтів повертає окремий " +"вказівник, відмінний від ``NULL``, якщо це можливо, як якщо б замість цього " +"було викликано ``PyMem_Calloc(1, 1)``." + +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 "" +"Якщо *p* має значення ``NULL``, виклик еквівалентний ``PyMem_Malloc(n)``; " +"інакше, якщо *n* дорівнює нулю, розмір блоку пам’яті змінюється, але не " +"звільняється, а повернутий вказівник не є ``NULL``." + +msgid "" +"Unless *p* is ``NULL``, it must have been returned by a previous call to :c:" +"func:`PyMem_Malloc`, :c:func:`PyMem_Realloc` or :c:func:`PyMem_Calloc`." +msgstr "" +"Якщо *p* не має значення ``NULL``, воно має бути повернуто попереднім " +"викликом :c:func:`PyMem_Malloc`, :c:func:`PyMem_Realloc` або :c:func:" +"`PyMem_Calloc`." + +msgid "" +"If the request fails, :c:func:`PyMem_Realloc` returns ``NULL`` and *p* " +"remains a valid pointer to the previous memory area." +msgstr "" +"Якщо запит не вдається, :c:func:`PyMem_Realloc` повертає ``NULL``, а *p* " +"залишається дійсним покажчиком на попередню область пам’яті." + +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." +msgstr "" +"Звільняє блок пам’яті, на який вказує *p*, який мав бути повернутий " +"попереднім викликом :c:func:`PyMem_Malloc`, :c:func:`PyMem_Realloc` або :c:" +"func:`PyMem_Calloc`. В іншому випадку, або якщо ``PyMem_Free(p)`` був " +"викликаний раніше, виникає невизначена поведінка." + +msgid "" +"The following type-oriented macros are provided for convenience. Note that " +"*TYPE* refers to any C type." +msgstr "" +"Для зручності надано наступні типоорієнтовані макроси. Зауважте, що *TYPE* " +"відноситься до будь-якого типу C." + +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 "" + +msgid "" +"Same as :c:func:`PyMem_Realloc`, but the memory block is resized to ``(n * " +"sizeof(TYPE))`` bytes. Returns a pointer cast to ``TYPE*``. On return, *p* " +"will be a pointer to the new memory area, or ``NULL`` in the event of " +"failure." +msgstr "" + +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; *p* завжди перепризначається. Збережіть початкове " +"значення *p*, щоб уникнути втрати пам’яті під час обробки помилок." + +msgid "Same as :c:func:`PyMem_Free`." +msgstr "Те саме, що :c:func:`PyMem_Free`." + +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." +msgstr "" +"Крім того, наведені нижче набори макросів надаються для безпосереднього " +"виклику розподільника пам’яті Python без залучення функцій C API, " +"перелічених вище. Однак зауважте, що їх використання не зберігає двійкову " +"сумісність між версіями Python і тому не підтримується в модулях розширення." + +msgid "``PyMem_MALLOC(size)``" +msgstr "``PyMem_MALLOC(розмір)``" + +msgid "``PyMem_NEW(type, size)``" +msgstr "``PyMem_NEW(тип, розмір)``" + +msgid "``PyMem_REALLOC(ptr, size)``" +msgstr "``PyMem_REALLOC(ptr, size)``" + +msgid "``PyMem_RESIZE(ptr, type, size)``" +msgstr "``PyMem_RESIZE(ptr, тип, розмір)``" + +msgid "``PyMem_FREE(ptr)``" +msgstr "``PyMem_FREE(ptr)``" + +msgid "``PyMem_DEL(ptr)``" +msgstr "``PyMem_DEL(ptr)``" + +msgid "Object allocators" +msgstr "Розподільники об'єктів" + +msgid "" +"There is no guarantee that the memory returned by these allocators can be " +"successfully cast to a Python object when intercepting the allocating " +"functions in this domain by the methods described in the :ref:`Customize " +"Memory Allocators ` section." +msgstr "" +"Немає жодної гарантії, що пам’ять, повернута цими розподільниками, може бути " +"успішно передана об’єкту Python під час перехоплення функцій виділення в " +"цьому домені за допомогою методів, описаних у розділі :ref:`Налаштування " +"розподільників пам’яті `." + +msgid "" +"The :ref:`default object allocator ` uses the :" +"ref:`pymalloc memory allocator `." +msgstr "" +":ref:`розподільник об’єктів за замовчуванням ` " +"використовує :ref:`розподільник пам’яті pymalloc `." + +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 "" +"Запит нульових байтів повертає окремий покажчик, відмінний від ``NULL``, " +"якщо це можливо, ніби замість цього було викликано ``PyObject_Malloc(1)``. " +"Пам'ять жодним чином не буде ініціалізовано." + +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 "" +"Запит нульових елементів або елементів розміром нуль байтів повертає окремий " +"вказівник, відмінний від ``NULL``, якщо це можливо, як якщо б замість цього " +"було викликано ``PyObject_Calloc(1, 1)``." + +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 "" +"Якщо *p* має значення ``NULL``, виклик еквівалентний ``PyObject_Malloc(n)``; " +"інакше, якщо *n* дорівнює нулю, розмір блоку пам’яті змінюється, але не " +"звільняється, а повернутий вказівник не є ``NULL``." + +msgid "" +"Unless *p* is ``NULL``, it must have been returned by a previous call to :c:" +"func:`PyObject_Malloc`, :c:func:`PyObject_Realloc` or :c:func:" +"`PyObject_Calloc`." +msgstr "" +"Якщо *p* не має значення ``NULL``, воно має бути повернуто попереднім " +"викликом :c:func:`PyObject_Malloc`, :c:func:`PyObject_Realloc` або :c:func:" +"`PyObject_Calloc`." + +msgid "" +"If the request fails, :c:func:`PyObject_Realloc` returns ``NULL`` and *p* " +"remains a valid pointer to the previous memory area." +msgstr "" +"Якщо запит не вдається, :c:func:`PyObject_Realloc` повертає ``NULL``, а *p* " +"залишається дійсним покажчиком на попередню область пам’яті." + +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." +msgstr "" +"Звільняє блок пам’яті, на який вказує *p*, який мав бути повернутий " +"попереднім викликом :c:func:`PyObject_Malloc`, :c:func:`PyObject_Realloc` " +"або :c:func:`PyObject_Calloc`. В іншому випадку, або якщо " +"``PyObject_Free(p)`` був викликаний раніше, виникає невизначена поведінка." + +msgid "Default Memory Allocators" +msgstr "Типові розподілювачі пам'яті" + +msgid "Default memory allocators:" +msgstr "Розподільники пам'яті за замовчуванням:" + +msgid "Configuration" +msgstr "Конфігурація" + +msgid "Name" +msgstr "Ім'я" + +msgid "PyMem_RawMalloc" +msgstr "PyMem_RawMalloc" + +msgid "PyMem_Malloc" +msgstr "PyMem_Malloc" + +msgid "PyObject_Malloc" +msgstr "PyObject_Malloc" + +msgid "Release build" +msgstr "Реліз збірки" + +msgid "``\"pymalloc\"``" +msgstr "``\"pymalloc\"``" + +msgid "``malloc``" +msgstr "``malloc``" + +msgid "``pymalloc``" +msgstr "``pymalloc``" + +msgid "Debug build" +msgstr "Налагодити збірку" + +msgid "``\"pymalloc_debug\"``" +msgstr "``\"pymalloc_debug\"``" + +msgid "``malloc`` + debug" +msgstr "``malloc`` + налагодження" + +msgid "``pymalloc`` + debug" +msgstr "``pymalloc`` + налагодження" + +msgid "Release build, without pymalloc" +msgstr "Випуск збірки без pymalloc" + +msgid "``\"malloc\"``" +msgstr "``\"malloc\"``" + +msgid "Debug build, without pymalloc" +msgstr "Збірка налагодження без pymalloc" + +msgid "``\"malloc_debug\"``" +msgstr "``\"malloc_debug\"``" + +msgid "Legend:" +msgstr "Легенда:" + +msgid "Name: value for :envvar:`PYTHONMALLOC` environment variable." +msgstr "Ім’я: значення для змінної середовища :envvar:`PYTHONMALLOC`." + +msgid "" +"``malloc``: system allocators from the standard C library, C functions: :c:" +"func:`malloc`, :c:func:`calloc`, :c:func:`realloc` and :c:func:`free`." +msgstr "" +"``malloc``: системні розподільники зі стандартної бібліотеки C, функції C: :" +"c:func:`malloc`, :c:func:`calloc`, :c:func:`realloc` і :c:func:`free`." + +msgid "``pymalloc``: :ref:`pymalloc memory allocator `." +msgstr "``pymalloc``: :ref:`розподіл пам'яті pymalloc `." + +msgid "" +"``mimalloc``: :ref:`mimalloc memory allocator `. The pymalloc " +"allocator will be used if mimalloc support isn't available." +msgstr "" + +msgid "" +"\"+ debug\": with :ref:`debug hooks on the Python memory allocators `." +msgstr "" +"\"+ debug\": з :ref:`debug хуками розподільників пам’яті Python `." + +msgid "\"Debug build\": :ref:`Python build in debug mode `." +msgstr "" +"\"Налагоджувальна збірка\": :ref:`Збірка Python у режимі налагодження `." + +msgid "Customize Memory Allocators" +msgstr "Налаштувати розподільники пам'яті" + +msgid "" +"Structure used to describe a memory block allocator. The structure has the " +"following fields:" +msgstr "" +"Структура, яка використовується для опису розподілювача блоків пам'яті. " +"Структура має такі поля:" + +msgid "Field" +msgstr "Поле" + +msgid "Meaning" +msgstr "Значення" + +msgid "``void *ctx``" +msgstr "``недійсний *ctx``" + +msgid "user context passed as first argument" +msgstr "контекст користувача, переданий як перший аргумент" + +msgid "``void* malloc(void *ctx, size_t size)``" +msgstr "``void* malloc(void *ctx, size_t size)``" + +msgid "allocate a memory block" +msgstr "виділити блок пам'яті" + +msgid "``void* calloc(void *ctx, size_t nelem, size_t elsize)``" +msgstr "``void* calloc(void *ctx, size_t nelem, size_t elsize)``" + +msgid "allocate a memory block initialized with zeros" +msgstr "виділити блок пам'яті, ініціалізований нулями" + +msgid "``void* realloc(void *ctx, void *ptr, size_t new_size)``" +msgstr "``void* realloc(void *ctx, void *ptr, size_t new_size)``" + +msgid "allocate or resize a memory block" +msgstr "виділити або змінити розмір блоку пам'яті" + +msgid "``void free(void *ctx, void *ptr)``" +msgstr "``void free(void *ctx, void *ptr)``" + +msgid "free a memory block" +msgstr "звільнити блок пам'яті" + +msgid "" +"The :c:type:`!PyMemAllocator` structure was renamed to :c:type:" +"`PyMemAllocatorEx` and a new ``calloc`` field was added." +msgstr "" + +msgid "Enum used to identify an allocator domain. Domains:" +msgstr "Enum використовується для визначення домену розподілювача. Домени:" + +msgid "Functions:" +msgstr "функції:" + +msgid ":c:func:`PyMem_RawMalloc`" +msgstr ":c:func:`PyMem_RawMalloc`" + +msgid ":c:func:`PyMem_RawRealloc`" +msgstr ":c:func:`PyMem_RawRealloc`" + +msgid ":c:func:`PyMem_RawCalloc`" +msgstr ":c:func:`PyMem_RawCalloc`" + +msgid ":c:func:`PyMem_RawFree`" +msgstr ":c:func:`PyMem_RawFree`" + +msgid ":c:func:`PyMem_Malloc`," +msgstr ":c:func:`PyMem_Malloc`," + +msgid ":c:func:`PyMem_Realloc`" +msgstr ":c:func:`PyMem_Realloc`" + +msgid ":c:func:`PyMem_Calloc`" +msgstr ":c:func:`PyMem_Calloc`" + +msgid ":c:func:`PyMem_Free`" +msgstr ":c:func:`PyMem_Free`" + +msgid ":c:func:`PyObject_Malloc`" +msgstr ":c:func:`PyObject_Malloc`" + +msgid ":c:func:`PyObject_Realloc`" +msgstr ":c:func:`PyObject_Realloc`" + +msgid ":c:func:`PyObject_Calloc`" +msgstr ":c:func:`PyObject_Calloc`" + +msgid ":c:func:`PyObject_Free`" +msgstr ":c:func:`PyObject_Free`" + +msgid "Get the memory block allocator of the specified domain." +msgstr "Отримати розподільник блоків пам’яті вказаного домену." + +msgid "Set the memory block allocator of the specified domain." +msgstr "Установіть розподільник блоків пам'яті для вказаного домену." + +msgid "" +"The new allocator must return a distinct non-``NULL`` pointer when " +"requesting zero bytes." +msgstr "" +"Новий розподільник має повертати окремий покажчик, відмінний від ``NULL``, " +"коли запитує нульові байти." + +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 "" + +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 "" + +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:func:`PyMem_SetupDebugHooks`, щоб " +"перевстановити налагоджувальні хуки поверх нового розподільника." + +msgid "" +"See also :c:member:`PyPreConfig.allocator` and :ref:`Preinitialize Python " +"with PyPreConfig `." +msgstr "" + +msgid ":c:func:`PyMem_SetAllocator` does have the following contract:" +msgstr "" + +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." +msgstr "" + +msgid "" +"If called after Python has finish initializing (after :c:func:" +"`Py_InitializeFromConfig` has been called) the allocator **must** wrap the " +"existing allocator. Substituting the current allocator for some other " +"arbitrary one is **not supported**." +msgstr "" + +msgid "All allocators must be thread-safe." +msgstr "" + +msgid "" +"Setup :ref:`debug hooks in the Python memory allocators ` " +"to detect memory errors." +msgstr "" +"Налаштування :ref:`налагоджувальних хуків у розподільниках пам’яті Python " +"` для виявлення помилок пам’яті." + +msgid "Debug hooks on the Python memory allocators" +msgstr "Налагодження перехоплювачів розподілювачів пам’яті Python" + +msgid "" +"When :ref:`Python is built in debug mode `, the :c:func:" +"`PyMem_SetupDebugHooks` function is called at the :ref:`Python " +"preinitialization ` to setup debug hooks on Python memory " +"allocators to detect memory errors." +msgstr "" +"Коли :ref:`Python зібрано в режимі налагодження `, функція :c:" +"func:`PyMem_SetupDebugHooks` викликається під час :ref:`попередньої " +"ініціалізації Python `, щоб налаштувати перехоплення налагодження " +"на розподільниках пам’яті Python для виявлення помилок пам’яті." + +msgid "" +"The :envvar:`PYTHONMALLOC` environment variable can be used to install debug " +"hooks on a Python compiled in release mode (ex: ``PYTHONMALLOC=debug``)." +msgstr "" +"Змінну оточення :envvar:`PYTHONMALLOC` можна використовувати для " +"встановлення хуків налагодження на Python, скомпільованому в режимі випуску " +"(наприклад: ``PYTHONMALLOC=debug``)." + +msgid "" +"The :c:func:`PyMem_SetupDebugHooks` function can be used to set debug hooks " +"after calling :c:func:`PyMem_SetAllocator`." +msgstr "" +"Функцію :c:func:`PyMem_SetupDebugHooks` можна використати для встановлення " +"хуків налагодження після виклику :c:func:`PyMem_SetAllocator`." + +msgid "" +"These debug hooks fill dynamically allocated memory blocks with special, " +"recognizable bit patterns. Newly allocated memory is filled with the byte " +"``0xCD`` (``PYMEM_CLEANBYTE``), freed memory is filled with the byte " +"``0xDD`` (``PYMEM_DEADBYTE``). Memory blocks are surrounded by \"forbidden " +"bytes\" filled with the byte ``0xFD`` (``PYMEM_FORBIDDENBYTE``). Strings of " +"these bytes are unlikely to be valid addresses, floats, or ASCII strings." +msgstr "" +"Ці хуки налагодження заповнюють динамічно виділені блоки пам’яті " +"спеціальними розпізнаваними бітовими шаблонами. Щойно виділена пам'ять " +"заповнюється байтом ``0xCD`` (``PYMEM_CLEANBYTE``), звільнена пам'ять " +"заповнюється байтом ``0xDD`` (``PYMEM_DEADBYTE``). Блоки пам'яті оточені " +"\"забороненими байтами\", заповненими байтом ``0xFD`` " +"(``PYMEM_FORBIDDENBYTE``). Рядки цих байтів навряд чи будуть дійсними " +"адресами, числами з плаваючою точкою або рядками ASCII." + +msgid "Runtime checks:" +msgstr "Перевірки виконання:" + +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 "" +"Виявлення порушень API. Наприклад, виявити, чи викликається :c:func:" +"`PyObject_Free` для блоку пам’яті, виділеного :c:func:`PyMem_Malloc`." + +msgid "Detect write before the start of the buffer (buffer underflow)." +msgstr "Виявлення запису до початку буфера (переповнення буфера)." + +msgid "Detect write after the end of the buffer (buffer overflow)." +msgstr "Виявлення запису після закінчення буфера (переповнення буфера)." + +msgid "" +"Check that the :term:`GIL ` is held when allocator " +"functions of :c:macro:`PYMEM_DOMAIN_OBJ` (ex: :c:func:`PyObject_Malloc`) " +"and :c:macro:`PYMEM_DOMAIN_MEM` (ex: :c:func:`PyMem_Malloc`) domains are " +"called." +msgstr "" + +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 " +"displayed if :mod:`tracemalloc` is tracing Python memory allocations and the " +"memory block was traced." +msgstr "" +"У разі помилки хуки налагодження використовують модуль :mod:`tracemalloc`, " +"щоб отримати зворотне відстеження, де було виділено блок пам’яті. Зворотне " +"відстеження відображається, лише якщо :mod:`tracemalloc` відстежує виділення " +"пам’яті Python і блок пам’яті відстежується." + +msgid "" +"Let *S* = ``sizeof(size_t)``. ``2*S`` bytes are added at each end of each " +"block of *N* bytes requested. The memory layout is like so, where p " +"represents the address returned by a malloc-like or realloc-like function " +"(``p[i:j]`` means the slice of bytes from ``*(p+i)`` inclusive up to " +"``*(p+j)`` exclusive; note that the treatment of negative indices differs " +"from a Python slice):" +msgstr "" +"Нехай *S* = ``sizeof(size_t)``. ``2*S`` байти додаються на кожному кінці " +"кожного запитуваного блоку *N* байтів. Схема пам’яті така, де p представляє " +"адресу, повернуту функцією, подібною до malloc або realloc (``p[i:j]`` " +"означає зріз байтів з ``*(p+i)`` включно до ``*(p+j)`` винятково; зауважте, " +"що обробка від’ємних індексів відрізняється від фрагмента Python):" + +msgid "``p[-2*S:-S]``" +msgstr "``p[-2*S:-S]``" + +msgid "" +"Number of bytes originally asked for. This is a size_t, big-endian (easier " +"to read in a memory dump)." +msgstr "" +"Первісно запитана кількість байтів. Це size_t, big-endian (легше читати в " +"дампі пам’яті)." + +msgid "``p[-S]``" +msgstr "``p[-S]``" + +msgid "API identifier (ASCII character):" +msgstr "Ідентифікатор API (символ ASCII):" + +msgid "``'r'`` for :c:macro:`PYMEM_DOMAIN_RAW`." +msgstr "" + +msgid "``'m'`` for :c:macro:`PYMEM_DOMAIN_MEM`." +msgstr "" + +msgid "``'o'`` for :c:macro:`PYMEM_DOMAIN_OBJ`." +msgstr "" + +msgid "``p[-S+1:0]``" +msgstr "``p[-S+1:0]``" + +msgid "Copies of PYMEM_FORBIDDENBYTE. Used to catch under- writes and reads." +msgstr "" +"Копії PYMEM_FORBIDDENBYTE. Використовується для перехоплення недописів і " +"читань." + +msgid "``p[0:N]``" +msgstr "``p[0:N]``" + +msgid "" +"The requested memory, filled with copies of PYMEM_CLEANBYTE, used to catch " +"reference to uninitialized memory. When a realloc-like function is called " +"requesting a larger memory block, the new excess bytes are also filled with " +"PYMEM_CLEANBYTE. When a free-like function is called, these are overwritten " +"with PYMEM_DEADBYTE, to catch reference to freed memory. When a realloc- " +"like function is called requesting a smaller memory block, the excess old " +"bytes are also filled with PYMEM_DEADBYTE." +msgstr "" +"Запитана пам'ять, заповнена копіями PYMEM_CLEANBYTE, використовувалася для " +"перехоплення посилань на неініціалізовану пам'ять. Коли функція, подібна до " +"realloc, викликається із запитом більшого блоку пам’яті, нові надлишкові " +"байти також заповнюються PYMEM_CLEANBYTE. Коли викликається функція, подібна " +"до вільної, вони перезаписуються на PYMEM_DEADBYTE, щоб перехопити посилання " +"на звільнену пам’ять. Коли функція, подібна до realloc, викликається із " +"запитом на менший блок пам’яті, зайві старі байти також заповнюються " +"PYMEM_DEADBYTE." + +msgid "``p[N:N+S]``" +msgstr "``p[N:N+S]``" + +msgid "Copies of PYMEM_FORBIDDENBYTE. Used to catch over- writes and reads." +msgstr "" +"Копії PYMEM_FORBIDDENBYTE. Використовується для перехоплення перезапису та " +"читання." + +msgid "``p[N+S:N+2*S]``" +msgstr "``p[N+S:N+2*S]``" + +msgid "" +"Only used if the ``PYMEM_DEBUG_SERIALNO`` macro is defined (not defined by " +"default)." +msgstr "" +"Використовується, лише якщо визначено макрос ``PYMEM_DEBUG_SERIALNO`` (не " +"визначено за замовчуванням)." + +msgid "" +"A serial number, incremented by 1 on each call to a malloc-like or realloc-" +"like function. Big-endian :c:type:`size_t`. If \"bad memory\" is detected " +"later, the serial number gives an excellent way to set a breakpoint on the " +"next run, to capture the instant at which this block was passed out. The " +"static function bumpserialno() in obmalloc.c is the only place the serial " +"number is incremented, and exists so you can set such a breakpoint easily." +msgstr "" + +msgid "" +"A realloc-like or free-like function first checks that the " +"PYMEM_FORBIDDENBYTE bytes at each end are intact. If they've been altered, " +"diagnostic output is written to stderr, and the program is aborted via " +"Py_FatalError(). The other main failure mode is provoking a memory error " +"when a program reads up one of the special bit patterns and tries to use it " +"as an address. If you get in a debugger then and look at the object, you're " +"likely to see that it's entirely filled with PYMEM_DEADBYTE (meaning freed " +"memory is getting used) or PYMEM_CLEANBYTE (meaning uninitialized memory is " +"getting used)." +msgstr "" +"Функція, подібна до realloc або free, спочатку перевіряє, чи не пошкоджені " +"байти PYMEM_FORBIDDENBYTE на кожному кінці. Якщо їх було змінено, " +"діагностичний вихід записується в stderr, а програма переривається через " +"Py_FatalError(). Інший основний тип помилки - це провокація помилки пам'яті, " +"коли програма зчитує один із спеціальних бітових шаблонів і намагається " +"використати його як адресу. Якщо ви зайдете в налагоджувач і подивіться на " +"об’єкт, ви, ймовірно, побачите, що він повністю заповнений PYMEM_DEADBYTE " +"(це означає, що звільнена пам’ять використовується) або PYMEM_CLEANBYTE (це " +"означає, що неініціалізована пам’ять використовується)." + +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." +msgstr "" + +msgid "" +"Byte patterns ``0xCB`` (``PYMEM_CLEANBYTE``), ``0xDB`` (``PYMEM_DEADBYTE``) " +"and ``0xFB`` (``PYMEM_FORBIDDENBYTE``) have been replaced with ``0xCD``, " +"``0xDD`` and ``0xFD`` to use the same values than Windows CRT debug " +"``malloc()`` and ``free()``." +msgstr "" +"Шаблони байтів ``0xCB`` (``PYMEM_CLEANBYTE``), ``0xDB`` (``PYMEM_DEADBYTE``) " +"і ``0xFB`` (``PYMEM_FORBIDDENBYTE``) були замінені на ``0xCD``, ``0xDD`` і " +"``0xFD``, щоб використовувати ті самі значення, що й ``malloc()`` і " +"``free()`` для налагодження Windows CRT." + +msgid "The pymalloc allocator" +msgstr "Розподільник pymalloc" + +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." +msgstr "" + +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." +msgstr "" + +msgid "The arena allocator uses the following functions:" +msgstr "Розподільник арени використовує такі функції:" + +msgid ":c:func:`!VirtualAlloc` and :c:func:`!VirtualFree` on Windows," +msgstr "" + +msgid ":c:func:`!mmap` and :c:func:`!munmap` if available," +msgstr "" + +msgid ":c:func:`malloc` and :c:func:`free` otherwise." +msgstr ":c:func:`malloc` і :c:func:`free` інакше." + +msgid "" +"This allocator is disabled if Python is configured with the :option:`--" +"without-pymalloc` option. It can also be disabled at runtime using the :" +"envvar:`PYTHONMALLOC` environment variable (ex: ``PYTHONMALLOC=malloc``)." +msgstr "" +"Цей розподільник вимкнено, якщо Python налаштовано з параметром :option:`--" +"without-pymalloc`. Його також можна вимкнути під час виконання за допомогою " +"змінної середовища :envvar:`PYTHONMALLOC` (наприклад: " +"``PYTHONMALLOC=malloc``)." + +msgid "Customize pymalloc Arena Allocator" +msgstr "Налаштувати pymalloc Arena Allocator" + +msgid "" +"Structure used to describe an arena allocator. The structure has three " +"fields:" +msgstr "" +"Структура, яка використовується для опису розподільника арен. Структура має " +"три поля:" + +msgid "``void* alloc(void *ctx, size_t size)``" +msgstr "``void* alloc(void *ctx, size_t size)``" + +msgid "allocate an arena of size bytes" +msgstr "виділити арену розміром байт" + +msgid "``void free(void *ctx, void *ptr, size_t size)``" +msgstr "``void free(void *ctx, void *ptr, size_t size)``" + +msgid "free an arena" +msgstr "звільнити арену" + +msgid "Get the arena allocator." +msgstr "Отримайте розподільник арен." + +msgid "Set the arena allocator." +msgstr "Встановіть розподільник арен." + +msgid "The mimalloc allocator" +msgstr "" + +msgid "" +"Python supports the mimalloc allocator when the underlying platform support " +"is available. mimalloc \"is a general purpose allocator with excellent " +"performance characteristics. Initially developed by Daan Leijen for the " +"runtime systems of the Koka and Lean languages.\"" +msgstr "" + +msgid "tracemalloc C API" +msgstr "tracemalloc C API" + +msgid "Track an allocated memory block in the :mod:`tracemalloc` module." +msgstr "Відстежуйте виділений блок пам’яті в модулі :mod:`tracemalloc`." + +msgid "" +"Return ``0`` on success, return ``-1`` on error (failed to allocate memory " +"to store the trace). Return ``-2`` if tracemalloc is disabled." +msgstr "" +"Повертає ``0`` у разі успіху, повертає ``-1`` у разі помилки (не вдалося " +"виділити пам’ять для збереження трасування). Повертає ``-2``, якщо " +"tracemalloc вимкнено." + +msgid "If memory block is already tracked, update the existing trace." +msgstr "Якщо блок пам’яті вже відстежується, оновіть наявне трасування." + +msgid "" +"Untrack an allocated memory block in the :mod:`tracemalloc` module. Do " +"nothing if the block was not tracked." +msgstr "" +"Скасувати відстеження виділеного блоку пам’яті в модулі :mod:`tracemalloc`. " +"Нічого не робити, якщо блок не відстежується." + +msgid "Return ``-2`` if tracemalloc is disabled, otherwise return ``0``." +msgstr "Повертає ``-2``, якщо tracemalloc вимкнено, інакше повертає ``0``." + +msgid "Examples" +msgstr "Приклади" + +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 "" +"Ось приклад із розділу :ref:`memoryoverview`, переписаний таким чином, що " +"буфер введення/виведення виділяється з купи Python за допомогою першого " +"набору функцій::" + +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 "" + +msgid "The same code using the type-oriented function set::" +msgstr "Той самий код із використанням типу орієнтованого набору функцій::" + +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 "" + +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 " +"memory API family for a given memory block, so that the risk of mixing " +"different allocators is reduced to a minimum. The following code sequence " +"contains two errors, one of which is labeled as *fatal* because it mixes two " +"different allocators operating on different heaps. ::" +msgstr "" +"Зауважте, що у двох наведених вище прикладах буфером завжди керують функції, " +"що належать одному набору. Дійсно, для певного блоку пам’яті потрібно " +"використовувати одне й те саме сімейство API пам’яті, щоб ризик змішування " +"різних розподільників був зведений до мінімуму. Наступна кодова " +"послідовність містить дві помилки, одна з яких позначена як *фатальна*, " +"оскільки вона змішує два різних розподільника, що працюють на різних " +"купах. ::" + +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 "" + +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`." +msgstr "" + +msgid "" +"These will be explained in the next chapter on defining and implementing new " +"object types in C." +msgstr "" +"Це буде пояснено в наступному розділі про визначення та реалізацію нових " +"типів об’єктів у C." + +msgid "malloc (C function)" +msgstr "" + +msgid "calloc (C function)" +msgstr "" + +msgid "realloc (C function)" +msgstr "" + +msgid "free (C function)" +msgstr "" diff --git a/c-api/memoryview.po b/c-api/memoryview.po new file mode 100644 index 000000000..cfb229da6 --- /dev/null +++ b/c-api/memoryview.po @@ -0,0 +1,121 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2023 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:49+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2023\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "MemoryView objects" +msgstr "Об'єкти MemoryView" + +msgid "" +"A :class:`memoryview` object exposes the C level :ref:`buffer interface " +"` as a Python object which can then be passed around like any " +"other object." +msgstr "" +"Об’єкт :class:`memoryview` розкриває :ref:`інтерфейс буфера рівня C " +"` як об’єкт Python, який потім можна передавати, як будь-який " +"інший об’єкт." + +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 " +"the discretion of the exporter." +msgstr "" +"Створіть об’єкт memoryview з об’єкта, який забезпечує інтерфейс буфера. Якщо " +"*obj* підтримує експорт буфера для запису, об’єкт memoryview буде читати/" +"записувати, інакше він може бути або лише для читання, або для читання/" +"запису на розсуд експортера." + +msgid "Flag to request a readonly buffer." +msgstr "" + +msgid "Flag to request a writable buffer." +msgstr "" + +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`." +msgstr "" +"Створіть об’єкт memoryview, використовуючи *mem* як базовий буфер. *flags* " +"може бути одним із :c:macro:`PyBUF_READ` або :c:macro:`PyBUF_WRITE`." + +msgid "" +"Create a memoryview object wrapping the given buffer structure *view*. For " +"simple byte buffers, :c:func:`PyMemoryView_FromMemory` is the preferred " +"function." +msgstr "" +"Створіть об’єкт memoryview, що обгортає задану структуру буфера *view*. Для " +"простих байтових буферів перевагою є функція :c:func:" +"`PyMemoryView_FromMemory`." + +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 " +"interface. If memory is contiguous, the memoryview object points to the " +"original memory. Otherwise, a copy is made and the memoryview points to a " +"new bytes object." +msgstr "" +"Створіть об’єкт memoryview для :term:`contiguous` фрагмента пам’яті (у " +"*порядку* \"C\" або \"F'ortran) з об’єкта, який визначає інтерфейс буфера. " +"Якщо пам’ять є суміжною, об’єкт memoryview вказує на вихідну пам’ять. В " +"іншому випадку буде зроблено копію, і memoryview вкаже на новий об’єкт bytes." + +msgid "" +"*buffertype* can be one of :c:macro:`PyBUF_READ` or :c:macro:`PyBUF_WRITE`." +msgstr "" + +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 " +"succeeds." +msgstr "" +"Повертає true, якщо об’єкт *obj* є об’єктом memoryview. Наразі не можна " +"створювати підкласи :class:`memoryview`. Ця функція завжди успішна." + +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 " +"type, you must do it yourself or you will risk crashes." +msgstr "" +"Повертає вказівник на приватну копію буфера експортера для memoryview. " +"*mview* **має** бути екземпляром memoryview; цей макрос не перевіряє свій " +"тип, ви повинні зробити це самостійно, інакше ви ризикуєте збої." + +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." +msgstr "" +"Повертає вказівник на об’єкт експорту, на якому базується memoryview, або " +"``NULL``, якщо memoryview було створено однією з функцій :c:func:" +"`PyMemoryView_FromMemory` або :c:func:`PyMemoryView_FromBuffer`. *mview* " +"**має** бути екземпляром memoryview." + +msgid "object" +msgstr "об'єкт" + +msgid "memoryview" +msgstr "" diff --git a/c-api/method.po b/c-api/method.po new file mode 100644 index 000000000..3ed2d0994 --- /dev/null +++ b/c-api/method.po @@ -0,0 +1,131 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2023 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:49+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2023\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Instance Method Objects" +msgstr "Об’єкти методу екземпляра" + +msgid "" +"An instance method is a wrapper for a :c:type:`PyCFunction` and the new way " +"to bind a :c:type:`PyCFunction` to a class object. It replaces the former " +"call ``PyMethod_New(func, NULL, class)``." +msgstr "" + +msgid "" +"This instance of :c:type:`PyTypeObject` represents the Python instance " +"method type. It is not exposed to Python programs." +msgstr "" +"Цей екземпляр :c:type:`PyTypeObject` представляє тип методу екземпляра " +"Python. Він не піддається програмам Python." + +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." +msgstr "" +"Повертає true, якщо *o* є об’єктом методу екземпляра (має тип :c:data:" +"`PyInstanceMethod_Type`). Параметр не має бути ``NULL``. Ця функція завжди " +"успішна." + +msgid "" +"Return a new instance method object, with *func* being any callable object. " +"*func* is the function that will be called when the instance method is " +"called." +msgstr "" +"Повертає новий об’єкт методу примірника, де *func* є будь-яким викликаним " +"об’єктом. *func* — це функція, яка буде викликана під час виклику методу " +"екземпляра." + +msgid "Return the function object associated with the instance method *im*." +msgstr "Повертає об’єкт функції, пов’язаний із методом екземпляра *im*." + +msgid "" +"Macro version of :c:func:`PyInstanceMethod_Function` which avoids error " +"checking." +msgstr "" +"Макроверсія :c:func:`PyInstanceMethod_Function`, яка уникає перевірки " +"помилок." + +msgid "Method Objects" +msgstr "Об’єкти методу" + +msgid "" +"Methods are bound function objects. Methods are always bound to an instance " +"of a user-defined class. Unbound methods (methods bound to a class object) " +"are no longer available." +msgstr "" +"Методи є пов’язаними функціональними об’єктами. Методи завжди прив’язані до " +"екземпляра визначеного користувачем класу. Незв’язані методи (методи, " +"прив’язані до об’єкта класу) більше недоступні." + +msgid "" +"This instance of :c:type:`PyTypeObject` represents the Python method type. " +"This is exposed to Python programs as ``types.MethodType``." +msgstr "" +"Цей екземпляр :c:type:`PyTypeObject` представляє тип методу Python. Це " +"доступно для програм Python як ``types.MethodType``." + +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 "" +"Повертає true, якщо *o* є об’єктом методу (має тип :c:data:`PyMethod_Type`). " +"Параметр не має бути ``NULL``. Ця функція завжди успішна." + +msgid "" +"Return a new method object, with *func* being any callable object and *self* " +"the instance the method should be bound. *func* is the function that will be " +"called when the method is called. *self* must not be ``NULL``." +msgstr "" +"Повертає новий об’єкт методу, де *func* є будь-яким викликаним об’єктом, а " +"*self* — екземпляром, до якого метод має бути прив’язаний. *func* — це " +"функція, яка буде викликана під час виклику методу. *self* не має бути " +"``NULL``." + +msgid "Return the function object associated with the method *meth*." +msgstr "Повертає об’єкт функції, пов’язаний із методом *meth*." + +msgid "" +"Macro version of :c:func:`PyMethod_Function` which avoids error checking." +msgstr "Макроверсія :c:func:`PyMethod_Function`, яка уникає перевірки помилок." + +msgid "Return the instance associated with the method *meth*." +msgstr "Повертає екземпляр, пов’язаний з методом *meth*." + +msgid "Macro version of :c:func:`PyMethod_Self` which avoids error checking." +msgstr "Версія макросу :c:func:`PyMethod_Self`, яка уникає перевірки помилок." + +msgid "object" +msgstr "об'єкт" + +msgid "instancemethod" +msgstr "" + +msgid "method" +msgstr "метод" + +msgid "MethodType (in module types)" +msgstr "" diff --git a/c-api/module.po b/c-api/module.po new file mode 100644 index 000000000..313b1fb22 --- /dev/null +++ b/c-api/module.po @@ -0,0 +1,901 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2023 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-04 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:49+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2023\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Module Objects" +msgstr "Об’єкти модуля" + +msgid "" +"This instance of :c:type:`PyTypeObject` represents the Python module type. " +"This is exposed to Python programs as ``types.ModuleType``." +msgstr "" +"Цей екземпляр :c:type:`PyTypeObject` представляє тип модуля Python. Це " +"доступно для програм Python як ``types.ModuleType``." + +msgid "" +"Return true if *p* is a module object, or a subtype of a module object. This " +"function always succeeds." +msgstr "" +"Повертає true, якщо *p* є об’єктом модуля або підтипом об’єкта модуля. Ця " +"функція завжди успішна." + +msgid "" +"Return true if *p* is a module object, but not a subtype of :c:data:" +"`PyModule_Type`. This function always succeeds." +msgstr "" +"Повертає true, якщо *p* є об’єктом модуля, але не підтипом :c:data:" +"`PyModule_Type`. Ця функція завжди успішна." + +msgid "" +"Return a new module object with :attr:`module.__name__` set to *name*. The " +"module's :attr:`!__name__`, :attr:`~module.__doc__`, :attr:`~module." +"__package__` and :attr:`~module.__loader__` attributes are filled in (all " +"but :attr:`!__name__` are set to ``None``). The caller is responsible for " +"setting a :attr:`~module.__file__` attribute." +msgstr "" + +msgid "Return ``NULL`` with an exception set on error." +msgstr "" + +msgid "" +":attr:`~module.__package__` and :attr:`~module.__loader__` are now set to " +"``None``." +msgstr "" + +msgid "" +"Similar to :c:func:`PyModule_NewObject`, but the name is a UTF-8 encoded " +"string instead of a Unicode object." +msgstr "" +"Подібно до :c:func:`PyModule_NewObject`, але ім’я — це рядок у кодуванні " +"UTF-8, а не об’єкт Unicode." + +msgid "" +"Return the dictionary object that implements *module*'s namespace; this " +"object is the same as the :attr:`~object.__dict__` attribute of the module " +"object. If *module* is not a module object (or a subtype of a module " +"object), :exc:`SystemError` is raised and ``NULL`` is returned." +msgstr "" +"Повертає об’єкт словника, який реалізує простір імен *module*; цей об’єкт " +"збігається з атрибутом :attr:`~object.__dict__` об’єкта модуля. Якщо " +"*module* не є об’єктом модуля (або підтипом об’єкта модуля), виникає :exc:" +"`SystemError` і повертається ``NULL``." + +msgid "" +"It is recommended extensions use other ``PyModule_*`` and ``PyObject_*`` " +"functions rather than directly manipulate a module's :attr:`~object." +"__dict__`." +msgstr "" + +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 "" + +msgid "" +"Similar to :c:func:`PyModule_GetNameObject` but return the name encoded to " +"``'utf-8'``." +msgstr "" +"Подібно до :c:func:`PyModule_GetNameObject`, але повертає назву, закодовану " +"в ``'utf-8'``." + +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`." +msgstr "" +"Повертає \"стан\" модуля, тобто вказівник на блок пам’яті, виділений під час " +"створення модуля, або ``NULL``. Перегляньте :c:member:`PyModuleDef.m_size`." + +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." +msgstr "" +"Повертає вказівник на структуру :c:type:`PyModuleDef`, з якої було створено " +"модуль, або ``NULL``, якщо модуль не було створено з визначення." + +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 "" + +msgid "" +"Similar to :c:func:`PyModule_GetFilenameObject` but return the filename " +"encoded to 'utf-8'." +msgstr "" +"Подібно до :c:func:`PyModule_GetFilenameObject`, але повертає назву файлу, " +"закодовану як 'utf-8'." + +msgid "" +":c:func:`PyModule_GetFilename` raises :exc:`UnicodeEncodeError` on " +"unencodable filenames, use :c:func:`PyModule_GetFilenameObject` instead." +msgstr "" + +msgid "Initializing C modules" +msgstr "Ініціалізація модулів C" + +msgid "" +"Modules objects are usually created from extension modules (shared libraries " +"which export an initialization function), or compiled-in modules (where the " +"initialization function is added using :c:func:`PyImport_AppendInittab`). " +"See :ref:`building` or :ref:`extending-with-embedding` for details." +msgstr "" +"Об’єкти Modules зазвичай створюються з модулів розширення (спільних " +"бібліотек, які експортують функцію ініціалізації) або скомпільованих модулів " +"(куди функція ініціалізації додається за допомогою :c:func:" +"`PyImport_AppendInittab`). Дивіться :ref:`building` або :ref:`extending-with-" +"embedding` для деталей." + +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." +msgstr "" +"Функція ініціалізації може або передати екземпляр визначення модуля до :c:" +"func:`PyModule_Create` і повернути результуючий об’єкт модуля, або запросити " +"\"багатофазову ініціалізацію\", повернувши саму структуру визначення." + +msgid "" +"The module definition struct, which holds all information needed to create a " +"module object. There is usually only one statically initialized variable of " +"this type for each module." +msgstr "" +"Структура визначення модуля, яка містить всю інформацію, необхідну для " +"створення об’єкта модуля. Зазвичай існує лише одна статично ініціалізована " +"змінна цього типу для кожного модуля." + +msgid "Always initialize this member to :c:macro:`PyModuleDef_HEAD_INIT`." +msgstr "" + +msgid "Name for the new module." +msgstr "Назва для нового модуля." + +msgid "" +"Docstring for the module; usually a docstring variable created with :c:macro:" +"`PyDoc_STRVAR` is used." +msgstr "" +"Рядок документації для модуля; зазвичай використовується змінна docstring, " +"створена за допомогою :c:macro:`PyDoc_STRVAR`." + +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 " +"modules safe for use in multiple sub-interpreters." +msgstr "" +"Стан модуля може зберігатися в області пам’яті для кожного модуля, яку можна " +"отримати за допомогою :c:func:`PyModule_GetState`, а не в статичних " +"глобалах. Це робить модулі безпечними для використання в кількох " +"субінтерпретаторах." + +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." +msgstr "" + +msgid "" +"Setting ``m_size`` to ``-1`` means that the module does not support sub-" +"interpreters, because it has global state." +msgstr "" +"Встановлення ``m_size`` на ``-1`` означає, що модуль не підтримує суб-" +"інтерпретатори, оскільки він має глобальний стан." + +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 " +"its state. Non-negative ``m_size`` is required for multi-phase " +"initialization." +msgstr "" +"Встановлення невід’ємного значення означає, що модуль можна повторно " +"ініціалізувати, і вказує додатковий обсяг пам’яті, який йому потрібен для " +"його стану. Для багатофазної ініціалізації необхідний невід’ємний ``m_size``." + +msgid "See :PEP:`3121` for more details." +msgstr "Додаткову інформацію див. :PEP:`3121`." + +msgid "" +"A pointer to a table of module-level functions, described by :c:type:" +"`PyMethodDef` values. Can be ``NULL`` if no functions are present." +msgstr "" +"Покажчик на таблицю функцій рівня модуля, описану значеннями :c:type:" +"`PyMethodDef`. Може бути ``NULL``, якщо функції відсутні." + +msgid "" +"An array of slot definitions for multi-phase initialization, terminated by a " +"``{0, NULL}`` entry. When using single-phase initialization, *m_slots* must " +"be ``NULL``." +msgstr "" +"Масив визначень слотів для багатофазної ініціалізації, що завершується " +"записом ``{0, NULL}``. У разі використання однофазної ініціалізації " +"*m_slots* має бути ``NULL``." + +msgid "" +"Prior to version 3.5, this member was always set to ``NULL``, and was " +"defined as:" +msgstr "До версії 3.5 цей член завжди мав значення ``NULL`` і визначався як:" + +msgid "" +"A traversal function to call during GC traversal of the module object, or " +"``NULL`` if not needed." +msgstr "" +"Функція обходу, яка викликається під час обходу GC об’єкта модуля, або " +"``NULL``, якщо не потрібна." + +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``." +msgstr "" + +msgid "No longer called before the module state is allocated." +msgstr "Більше не викликається до виділення стану модуля." + +msgid "" +"A clear function to call during GC clearing of the module object, or " +"``NULL`` if not needed." +msgstr "" +"Очистити функцію для виклику під час очищення GC об’єкта модуля або " +"``NULL``, якщо не потрібно." + +msgid "" +"Like :c:member:`PyTypeObject.tp_clear`, this function is not *always* called " +"before a module is deallocated. For example, when reference counting is " +"enough to determine that an object is no longer used, the cyclic garbage " +"collector is not involved and :c:member:`~PyModuleDef.m_free` is called " +"directly." +msgstr "" +"Як і :c:member:`PyTypeObject.tp_clear`, ця функція не *завжди* викликається " +"до того, як модуль буде звільнено. Наприклад, коли підрахунку посилань " +"достатньо, щоб визначити, що об’єкт більше не використовується, циклічний " +"збирач сміття не задіяний і :c:member:`~PyModuleDef.m_free` викликається " +"безпосередньо." + +msgid "" +"A function to call during deallocation of the module object, or ``NULL`` if " +"not needed." +msgstr "" +"Функція для виклику під час звільнення об’єкта модуля або ``NULL``, якщо " +"вона не потрібна." + +msgid "Single-phase initialization" +msgstr "Однофазна ініціалізація" + +msgid "" +"The module initialization function may create and return the module object " +"directly. This is referred to as \"single-phase initialization\", and uses " +"one of the following two module creation functions:" +msgstr "" +"Функція ініціалізації модуля може створювати та повертати об’єкт модуля " +"безпосередньо. Це називається \"однофазною ініціалізацією\" та використовує " +"одну з наступних двох функцій створення модуля:" + +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`." +msgstr "" + +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 "" +"Створіть новий об’єкт модуля, враховуючи визначення в *def*, припускаючи " +"версію API *module_api_version*. Якщо ця версія не збігається з версією " +"запущеного інтерпретатора, видається :exc:`RuntimeWarning`." + +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 "" +"Більшість випадків використання цієї функції має використовувати замість " +"неї :c:func:`PyModule_Create`; використовуйте це, лише якщо ви впевнені, що " +"це вам потрібно." + +msgid "" +"Before it is returned from in the initialization function, the resulting " +"module object is typically populated using functions like :c:func:" +"`PyModule_AddObjectRef`." +msgstr "" +"Перед поверненням у функції ініціалізації результуючий об’єкт модуля " +"зазвичай заповнюється за допомогою таких функцій, як :c:func:" +"`PyModule_AddObjectRef`." + +msgid "Multi-phase initialization" +msgstr "Багатофазова ініціалізація" + +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." +msgstr "" + +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`)." +msgstr "" + +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." +msgstr "" +"Очікується, що всі модулі, створені за допомогою багатофазної ініціалізації, " +"підтримуватимуть :ref:`sub-інтерпретатори `. " +"Переконавшись, що декілька модулів є незалежними, як правило, достатньо, щоб " +"досягти цього." + +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:" +msgstr "" +"Для запиту багатофазної ініціалізації функція ініціалізації " +"(PyInit_modulename) повертає екземпляр :c:type:`PyModuleDef` з непорожнім :c:" +"member:`~PyModuleDef.m_slots`. Перш ніж його буде повернуто, примірник " +"``PyModuleDef`` має бути ініціалізований такою функцією:" + +msgid "" +"Ensures a module definition is a properly initialized Python object that " +"correctly reports its type and reference count." +msgstr "" +"Гарантує, що визначення модуля є правильно ініціалізованим об’єктом Python, " +"який правильно повідомляє про свій тип і кількість посилань." + +msgid "Returns *def* cast to ``PyObject*``, or ``NULL`` if an error occurred." +msgstr "" +"Повертає *def* приведення до ``PyObject*`` або ``NULL``, якщо сталася " +"помилка." + +msgid "" +"The *m_slots* member of the module definition must point to an array of " +"``PyModuleDef_Slot`` structures:" +msgstr "" +"Член *m_slots* у визначенні модуля має вказувати на масив структур " +"``PyModuleDef_Slot``:" + +msgid "A slot ID, chosen from the available values explained below." +msgstr "Ідентифікатор слота, вибраний із доступних значень, пояснених нижче." + +msgid "Value of the slot, whose meaning depends on the slot ID." +msgstr "Значення слота, значення якого залежить від ідентифікатора слота." + +msgid "The *m_slots* array must be terminated by a slot with id 0." +msgstr "Масив *m_slots* повинен закінчуватися слотом з ідентифікатором 0." + +msgid "The available slot types are:" +msgstr "Доступні типи слотів:" + +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 "" +"Визначає функцію, яка викликається для створення самого об’єкта модуля. " +"Покажчик *значення* цього слота має вказувати на функцію підпису:" + +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 "" +"Функція отримує екземпляр :py:class:`~importlib.machinery.ModuleSpec`, як " +"визначено в :PEP:`451`, і визначення модуля. Він має повернути новий об’єкт " +"модуля або встановити помилку та повернути ``NULL``." + +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 "" +"Ця функція повинна бути мінімальною. Зокрема, він не повинен викликати " +"довільний код Python, оскільки повторна спроба імпортувати той самий модуль " +"може призвести до нескінченного циклу." + +msgid "" +"Multiple ``Py_mod_create`` slots may not be specified in one module " +"definition." +msgstr "" +"Кілька слотів ``Py_mod_create`` не можуть бути вказані в одному визначенні " +"модуля." + +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 " +"*spec*, not the definition, to allow extension modules to dynamically adjust " +"to their place in the module hierarchy and be imported under different names " +"through symlinks, all while sharing a single module definition." +msgstr "" +"Якщо ``Py_mod_create`` не вказано, механізм імпорту створить звичайний " +"об’єкт модуля за допомогою :c:func:`PyModule_New`. Ім’я взято з *spec*, а не " +"з визначення, щоб дозволити модулям розширення динамічно адаптуватися до " +"свого місця в ієрархії модулів і імпортуватися під різними іменами за " +"допомогою символічних посилань, водночас користуючись єдиним визначенням " +"модуля." + +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``." +msgstr "" +"Немає вимоги, щоб повернутий об’єкт був екземпляром :c:type:`PyModule_Type`. " +"Можна використовувати будь-який тип, якщо він підтримує встановлення та " +"отримання пов’язаних з імпортом атрибутів. Однак лише екземпляри " +"``PyModule_Type`` можуть повертатися, якщо ``PyModuleDef`` має не-``NULL`` " +"``m_traverse``, ``m_clear``, ``m_free``; ненульовий ``m_size``; або слоти, " +"відмінні від ``Py_mod_create``." + +msgid "" +"Specifies a function that is called to *execute* the module. This is " +"equivalent to executing the code of a Python module: typically, this " +"function adds classes and constants to the module. The signature of the " +"function is:" +msgstr "" +"Визначає функцію, яка викликається для *виконання* модуля. Це еквівалентно " +"виконанню коду модуля Python: зазвичай ця функція додає класи та константи " +"до модуля. Сигнатура функції:" + +msgid "" +"If multiple ``Py_mod_exec`` slots are specified, they are processed in the " +"order they appear in the *m_slots* array." +msgstr "" +"Якщо вказано кілька слотів ``Py_mod_exec``, вони обробляються в тому " +"порядку, в якому вони з’являються в масиві *m_slots*." + +msgid "Specifies one of the following values:" +msgstr "" + +msgid "The module does not support being imported in subinterpreters." +msgstr "" + +msgid "" +"The module supports being imported in subinterpreters, but only when they " +"share the main interpreter's GIL. (See :ref:`isolating-extensions-howto`.)" +msgstr "" + +msgid "" +"The module supports being imported in subinterpreters, even when they have " +"their own GIL. (See :ref:`isolating-extensions-howto`.)" +msgstr "" + +msgid "" +"This slot determines whether or not importing this module in a " +"subinterpreter will fail." +msgstr "" + +msgid "" +"Multiple ``Py_mod_multiple_interpreters`` slots may not be specified in one " +"module definition." +msgstr "" + +msgid "" +"If ``Py_mod_multiple_interpreters`` is not specified, the import machinery " +"defaults to ``Py_MOD_MULTIPLE_INTERPRETERS_SUPPORTED``." +msgstr "" + +msgid "" +"The module depends on the presence of the global interpreter lock (GIL), and " +"may access global state without synchronization." +msgstr "" + +msgid "The module is safe to run without an active GIL." +msgstr "" + +msgid "" +"This slot is ignored by Python builds not configured with :option:`--disable-" +"gil`. Otherwise, it determines whether or not importing this module will " +"cause the GIL to be automatically enabled. See :ref:`whatsnew313-free-" +"threaded-cpython` for more detail." +msgstr "" + +msgid "" +"Multiple ``Py_mod_gil`` slots may not be specified in one module definition." +msgstr "" + +msgid "" +"If ``Py_mod_gil`` is not specified, the import machinery defaults to " +"``Py_MOD_GIL_USED``." +msgstr "" + +msgid "See :PEP:`489` for more details on multi-phase initialization." +msgstr "" +"Перегляньте :PEP:`489` для отримання додаткової інформації про багатофазову " +"ініціалізацію." + +msgid "Low-level module creation functions" +msgstr "Функції створення модулів низького рівня" + +msgid "" +"The following functions are called under the hood when using multi-phase " +"initialization. They can be used directly, for example when creating module " +"objects dynamically. Note that both ``PyModule_FromDefAndSpec`` and " +"``PyModule_ExecDef`` must be called to fully initialize a module." +msgstr "" +"Наступні функції викликаються під капотом під час використання багатофазної " +"ініціалізації. Їх можна використовувати безпосередньо, наприклад, при " +"динамічному створенні об’єктів модуля. Зауважте, що для повної ініціалізації " +"модуля необхідно викликати як ``PyModule_FromDefAndSpec``, так і " +"``PyModule_ExecDef``." + +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 "" + +msgid "" +"Create a new module object, given the definition in *def* and the ModuleSpec " +"*spec*, assuming the API version *module_api_version*. If that version does " +"not match the version of the running interpreter, a :exc:`RuntimeWarning` is " +"emitted." +msgstr "" + +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:func:" +"`PyModule_FromDefAndSpec`; використовуйте це, лише якщо ви впевнені, що це " +"вам потрібно." + +msgid "Process any execution slots (:c:data:`Py_mod_exec`) given in *def*." +msgstr "" +"Обробити будь-які слоти виконання (:c:data:`Py_mod_exec`), указані в *def*." + +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 "" +"Встановіть рядок документації для *module* на *string*. Ця функція " +"викликається автоматично під час створення модуля з ``PyModuleDef`` за " +"допомогою ``PyModule_Create`` або ``PyModule_FromDefAndSpec``." + +msgid "" +"Add the functions from the ``NULL`` terminated *functions* array to " +"*module*. Refer to the :c:type:`PyMethodDef` documentation for details on " +"individual entries (due to the lack of a shared module namespace, module " +"level \"functions\" implemented in C typically receive the module as their " +"first parameter, making them similar to instance methods on Python classes). " +"This function is called automatically when creating a module from " +"``PyModuleDef``, using either ``PyModule_Create`` or " +"``PyModule_FromDefAndSpec``." +msgstr "" +"Додайте функції з масиву *functions* із закінченням ``NULL`` до *module*. " +"Зверніться до документації :c:type:`PyMethodDef`, щоб дізнатися більше про " +"окремі записи (через відсутність спільного простору імен модуля \"функції\" " +"рівня модуля, реалізовані в C, зазвичай отримують модуль як свій перший " +"параметр, що робить їх схожими на екземпляр методи на класах Python). Ця " +"функція викликається автоматично під час створення модуля з ``PyModuleDef`` " +"за допомогою ``PyModule_Create`` або ``PyModule_FromDefAndSpec``." + +msgid "Support functions" +msgstr "Допоміжні функції" + +msgid "" +"The module initialization function (if using single phase initialization) or " +"a function called from a module execution slot (if using multi-phase " +"initialization), can use the following functions to help initialize the " +"module state:" +msgstr "" +"Функція ініціалізації модуля (якщо використовується однофазна ініціалізація) " +"або функція, що викликається зі слота виконання модуля (якщо " +"використовується багатофазова ініціалізація), може використовувати такі " +"функції, щоб допомогти ініціалізувати стан модуля:" + +msgid "" +"Add an object to *module* as *name*. This is a convenience function which " +"can be used from the module's initialization function." +msgstr "" +"Додайте об’єкт до *модуля* як *ім’я*. Це зручна функція, яку можна " +"використовувати з функції ініціалізації модуля." + +msgid "" +"On success, return ``0``. On error, raise an exception and return ``-1``." +msgstr "" +"У разі успіху поверніть ``0``. У разі помилки викликає виняток і повертає " +"``-1``." + +msgid "Example usage::" +msgstr "Приклад використання::" + +msgid "" +"static int\n" +"add_spam(PyObject *module, int value)\n" +"{\n" +" PyObject *obj = PyLong_FromLong(value);\n" +" if (obj == NULL) {\n" +" return -1;\n" +" }\n" +" int res = PyModule_AddObjectRef(module, \"spam\", obj);\n" +" Py_DECREF(obj);\n" +" return res;\n" +" }" +msgstr "" + +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 "" + +msgid "" +"The example can also be written without checking explicitly if *obj* is " +"``NULL``::" +msgstr "" +"Приклад також можна написати без явної перевірки, якщо *obj* має значення " +"``NULL``::" + +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 "" + +msgid "" +"Note that ``Py_XDECREF()`` should be used instead of ``Py_DECREF()`` in this " +"case, since *obj* can be ``NULL``." +msgstr "" +"Зверніть увагу, що в цьому випадку слід використовувати ``Py_XDECREF()`` " +"замість ``Py_DECREF()``, оскільки *obj* може бути ``NULL``." + +msgid "" +"The number of different *name* strings passed to this function should be " +"kept small, usually by only using statically allocated strings as *name*. " +"For names that aren't known at compile time, prefer calling :c:func:" +"`PyUnicode_FromString` and :c:func:`PyObject_SetAttr` directly. For more " +"details, see :c:func:`PyUnicode_InternFromString`, which may be used " +"internally to create a key object." +msgstr "" + +msgid "" +"Similar to :c:func:`PyModule_AddObjectRef`, but \"steals\" a reference to " +"*value*. It can be called with a result of function that returns a new " +"reference without bothering to check its result or even saving it to a " +"variable." +msgstr "" + +msgid "" +"if (PyModule_Add(module, \"spam\", PyBytes_FromString(value)) < 0) {\n" +" goto error;\n" +"}" +msgstr "" + +msgid "" +"Similar to :c:func:`PyModule_AddObjectRef`, but steals a reference to " +"*value* on success (if it returns ``0``)." +msgstr "" +"Подібно до :c:func:`PyModule_AddObjectRef`, але в разі успіху викрадає " +"посилання на *value* (якщо повертає ``0``)." + +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 "" + +msgid "" +"Unlike other functions that steal references, ``PyModule_AddObject()`` only " +"releases the reference to *value* **on success**." +msgstr "" + +msgid "" +"This means that its return value must be checked, and calling code must :c:" +"func:`Py_XDECREF` *value* manually on error." +msgstr "" + +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 "" + +msgid ":c:func:`PyModule_AddObject` is :term:`soft deprecated`." +msgstr "" + +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 "" + +msgid "" +"This is a convenience function that calls :c:func:`PyLong_FromLong` and :c:" +"func:`PyModule_AddObjectRef`; see their documentation for details." +msgstr "" + +msgid "" +"Add a string constant to *module* as *name*. This convenience function can " +"be used from the module's initialization function. The string *value* must " +"be ``NULL``-terminated. Return ``-1`` with an exception set on error, ``0`` " +"on success." +msgstr "" + +msgid "" +"This is a convenience function that calls :c:func:" +"`PyUnicode_InternFromString` and :c:func:`PyModule_AddObjectRef`; see their " +"documentation for details." +msgstr "" + +msgid "" +"Add an int constant to *module*. The name and the value are taken from " +"*macro*. For example ``PyModule_AddIntMacro(module, AF_INET)`` adds the int " +"constant *AF_INET* with the value of *AF_INET* to *module*. Return ``-1`` " +"with an exception set on error, ``0`` on success." +msgstr "" + +msgid "Add a string constant to *module*." +msgstr "Додайте рядкову константу до *module*." + +msgid "" +"Add a type object to *module*. The type object is finalized by calling " +"internally :c:func:`PyType_Ready`. The name of the type object is taken from " +"the last component of :c:member:`~PyTypeObject.tp_name` after dot. Return " +"``-1`` with an exception set on error, ``0`` on success." +msgstr "" + +msgid "" +"Indicate that *module* does or does not support running without the global " +"interpreter lock (GIL), using one of the values from :c:macro:`Py_mod_gil`. " +"It must be called during *module*'s initialization function. If this " +"function is not called during module initialization, the import machinery " +"assumes the module does not support running without the GIL. This function " +"is only available in Python builds configured with :option:`--disable-gil`. " +"Return ``-1`` with an exception set on error, ``0`` on success." +msgstr "" + +msgid "Module lookup" +msgstr "Пошук модуля" + +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 "" +"Однофазова ініціалізація створює однотонні модулі, які можна шукати в " +"контексті поточного інтерпретатора. Це дозволяє пізніше отримати об’єкт " +"модуля лише з посиланням на визначення модуля." + +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 "" +"Ці функції не працюватимуть на модулях, створених за допомогою багатофазної " +"ініціалізації, оскільки кілька таких модулів можна створити з одного " +"визначення." + +msgid "" +"Returns the module object that was created from *def* for the current " +"interpreter. This method requires that the module object has been attached " +"to the interpreter state with :c:func:`PyState_AddModule` beforehand. In " +"case the corresponding module object is not found or has not been attached " +"to the interpreter state yet, it returns ``NULL``." +msgstr "" +"Повертає об’єкт модуля, який було створено з *def* для поточного " +"інтерпретатора. Цей метод вимагає, щоб об’єкт модуля був прикріплений до " +"стану інтерпретатора за допомогою :c:func:`PyState_AddModule` заздалегідь. " +"Якщо відповідний об’єкт модуля не знайдено або ще не приєднано до стану " +"інтерпретатора, він повертає ``NULL``." + +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`." +msgstr "" +"Приєднує об’єкт модуля, переданий у функцію, до стану інтерпретатора. Це " +"дозволяє об’єкту модуля бути доступним через :c:func:`PyState_FindModule`." + +msgid "Only effective on modules created using single-phase initialization." +msgstr "Діє лише для модулів, створених за допомогою однофазної ініціалізації." + +msgid "" +"Python calls ``PyState_AddModule`` automatically after importing a module, " +"so it is unnecessary (but harmless) to call it from module initialization " +"code. An explicit call is needed only if the module's own init code " +"subsequently calls ``PyState_FindModule``. The function is mainly intended " +"for implementing alternative import mechanisms (either by calling it " +"directly, or by referring to its implementation for details of the required " +"state updates)." +msgstr "" +"Python автоматично викликає ``PyState_AddModule`` після імпортування модуля, " +"тому непотрібно (але нешкідливо) викликати його з коду ініціалізації модуля. " +"Явний виклик потрібен, лише якщо власний код ініціалізації модуля згодом " +"викликає ``PyState_FindModule``. Ця функція в основному призначена для " +"впровадження альтернативних механізмів імпорту (або через її прямий виклик, " +"або шляхом посилання на її реалізацію для отримання деталей необхідних " +"оновлень стану)." + +msgid "The caller must hold the GIL." +msgstr "Абонент повинен тримати GIL." + +msgid "Return ``-1`` with an exception set on error, ``0`` on success." +msgstr "" + +msgid "" +"Removes the module object created from *def* from the interpreter state. " +"Return ``-1`` with an exception set on error, ``0`` on success." +msgstr "" + +msgid "object" +msgstr "об'єкт" + +msgid "module" +msgstr "модуль" + +msgid "ModuleType (in module types)" +msgstr "" + +msgid "__name__ (module attribute)" +msgstr "" + +msgid "__doc__ (module attribute)" +msgstr "" + +msgid "__file__ (module attribute)" +msgstr "" + +msgid "__package__ (module attribute)" +msgstr "" + +msgid "__loader__ (module attribute)" +msgstr "" + +msgid "__dict__ (module attribute)" +msgstr "" + +msgid "SystemError (built-in exception)" +msgstr "" diff --git a/c-api/monitoring.po b/c-api/monitoring.po new file mode 100644 index 000000000..7c2ce416c --- /dev/null +++ b/c-api/monitoring.po @@ -0,0 +1,249 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-04 14:18+0000\n" +"PO-Revision-Date: 2024-05-11 01:07+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Monitoring C API" +msgstr "" + +msgid "Added in version 3.13." +msgstr "" + +msgid "" +"An extension may need to interact with the event monitoring system. " +"Subscribing to events and registering callbacks can be done via the Python " +"API exposed in :mod:`sys.monitoring`." +msgstr "" + +msgid "Generating Execution Events" +msgstr "" + +msgid "" +"The functions below make it possible for an extension to fire monitoring " +"events as it emulates the execution of Python code. Each of these functions " +"accepts a ``PyMonitoringState`` struct which contains concise information " +"about the activation state of events, as well as the event arguments, which " +"include a ``PyObject*`` representing the code object, the instruction offset " +"and sometimes additional, event-specific arguments (see :mod:`sys." +"monitoring` for details about the signatures of the different event " +"callbacks). The ``codelike`` argument should be an instance of :class:`types." +"CodeType` or of a type that emulates it." +msgstr "" + +msgid "" +"The VM disables tracing when firing an event, so there is no need for user " +"code to do that." +msgstr "" + +msgid "" +"Monitoring functions should not be called with an exception set, except " +"those listed below as working with the current exception." +msgstr "" + +msgid "" +"Representation of the state of an event type. It is allocated by the user " +"while its contents are maintained by the monitoring API functions described " +"below." +msgstr "" + +msgid "" +"All of the functions below return 0 on success and -1 (with an exception " +"set) on error." +msgstr "" + +msgid "See :mod:`sys.monitoring` for descriptions of the events." +msgstr "" + +msgid "Fire a ``PY_START`` event." +msgstr "" + +msgid "Fire a ``PY_RESUME`` event." +msgstr "" + +msgid "Fire a ``PY_RETURN`` event." +msgstr "" + +msgid "Fire a ``PY_YIELD`` event." +msgstr "" + +msgid "Fire a ``CALL`` event." +msgstr "" + +msgid "Fire a ``LINE`` event." +msgstr "" + +msgid "Fire a ``JUMP`` event." +msgstr "" + +msgid "Fire a ``BRANCH`` event." +msgstr "" + +msgid "Fire a ``C_RETURN`` event." +msgstr "" + +msgid "" +"Fire a ``PY_THROW`` event with the current exception (as returned by :c:func:" +"`PyErr_GetRaisedException`)." +msgstr "" + +msgid "" +"Fire a ``RAISE`` event with the current exception (as returned by :c:func:" +"`PyErr_GetRaisedException`)." +msgstr "" + +msgid "" +"Fire a ``C_RAISE`` event with the current exception (as returned by :c:func:" +"`PyErr_GetRaisedException`)." +msgstr "" + +msgid "" +"Fire a ``RERAISE`` event with the current exception (as returned by :c:func:" +"`PyErr_GetRaisedException`)." +msgstr "" + +msgid "" +"Fire an ``EXCEPTION_HANDLED`` event with the current exception (as returned " +"by :c:func:`PyErr_GetRaisedException`)." +msgstr "" + +msgid "" +"Fire a ``PY_UNWIND`` event with the current exception (as returned by :c:" +"func:`PyErr_GetRaisedException`)." +msgstr "" + +msgid "" +"Fire a ``STOP_ITERATION`` event. If ``value`` is an instance of :exc:" +"`StopIteration`, it is used. Otherwise, a new :exc:`StopIteration` instance " +"is created with ``value`` as its argument." +msgstr "" + +msgid "Managing the Monitoring State" +msgstr "" + +msgid "" +"Monitoring states can be managed with the help of monitoring scopes. A scope " +"would typically correspond to a python function." +msgstr "" + +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 "" + +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 "" + +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 "" + +msgid "The macros for *event_types* are:" +msgstr "" + +msgid "Macro" +msgstr "" + +msgid "Event" +msgstr "Подія" + +msgid ":monitoring-event:`BRANCH`" +msgstr "" + +msgid ":monitoring-event:`CALL`" +msgstr "" + +msgid ":monitoring-event:`C_RAISE`" +msgstr "" + +msgid ":monitoring-event:`C_RETURN`" +msgstr "" + +msgid ":monitoring-event:`EXCEPTION_HANDLED`" +msgstr "" + +msgid ":monitoring-event:`INSTRUCTION`" +msgstr "" + +msgid ":monitoring-event:`JUMP`" +msgstr "" + +msgid ":monitoring-event:`LINE`" +msgstr "" + +msgid ":monitoring-event:`PY_RESUME`" +msgstr "" + +msgid ":monitoring-event:`PY_RETURN`" +msgstr "" + +msgid ":monitoring-event:`PY_START`" +msgstr "" + +msgid ":monitoring-event:`PY_THROW`" +msgstr "" + +msgid ":monitoring-event:`PY_UNWIND`" +msgstr "" + +msgid ":monitoring-event:`PY_YIELD`" +msgstr "" + +msgid ":monitoring-event:`RAISE`" +msgstr "" + +msgid ":monitoring-event:`RERAISE`" +msgstr "" + +msgid ":monitoring-event:`STOP_ITERATION`" +msgstr "" + +msgid "" +"Exit the last scope that was entered with :c:func:`!PyMonitoring_EnterScope`." +msgstr "" + +msgid "" +"Return true if the event corresponding to the event ID *ev* is a :ref:`local " +"event `." +msgstr "" + +msgid "This function is :term:`soft deprecated`." +msgstr "" diff --git a/c-api/none.po b/c-api/none.po new file mode 100644 index 000000000..93cd00598 --- /dev/null +++ b/c-api/none.po @@ -0,0 +1,53 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2023 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:49+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2023\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "The ``None`` Object" +msgstr "Об'єкт ``None``" + +msgid "" +"Note that the :c:type:`PyTypeObject` for ``None`` is not directly exposed in " +"the Python/C API. Since ``None`` is a singleton, testing for object " +"identity (using ``==`` in C) is sufficient. There is no :c:func:`!" +"PyNone_Check` function for the same reason." +msgstr "" + +msgid "" +"The Python ``None`` object, denoting lack of value. This object has no " +"methods and is :term:`immortal`." +msgstr "" + +msgid ":c:data:`Py_None` is :term:`immortal`." +msgstr "" + +msgid "Return :c:data:`Py_None` from a function." +msgstr "" + +msgid "object" +msgstr "об'єкт" + +msgid "None" +msgstr "Жодного" diff --git a/c-api/number.po b/c-api/number.po new file mode 100644 index 000000000..767230ecf --- /dev/null +++ b/c-api/number.po @@ -0,0 +1,388 @@ +# SOME DESCRIPTIVE TITLE. +# 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 +# Dmytro Kazanzhy, 2024 +# Yuliia Shevchenko, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:49+0000\n" +"Last-Translator: Yuliia Shevchenko, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Number Protocol" +msgstr "Номер протоколу" + +msgid "" +"Returns ``1`` if the object *o* provides numeric protocols, and false " +"otherwise. This function always succeeds." +msgstr "" +"Повертає ``1``, якщо об’єкт *o* надає числові протоколи, і false в іншому " +"випадку. Ця функція завжди успішна." + +msgid "Returns ``1`` if *o* is an index integer." +msgstr "Повертає ``1``, якщо *o* є цілим індексом." + +msgid "" +"Returns the result of adding *o1* and *o2*, or ``NULL`` on failure. This is " +"the equivalent of the Python expression ``o1 + o2``." +msgstr "" +"Повертає результат додавання *o1* і *o2* або ``NULL`` у разі помилки. Це " +"еквівалент виразу Python ``o1 + o2``." + +msgid "" +"Returns the result of subtracting *o2* from *o1*, or ``NULL`` on failure. " +"This is the equivalent of the Python expression ``o1 - o2``." +msgstr "" +"Повертає результат віднімання *o2* від *o1* або ``NULL`` у разі помилки. Це " +"еквівалент виразу Python ``o1 - o2``." + +msgid "" +"Returns the result of multiplying *o1* and *o2*, or ``NULL`` on failure. " +"This is the equivalent of the Python expression ``o1 * o2``." +msgstr "" +"Повертає результат множення *o1* і *o2* або ``NULL`` у разі помилки. Це " +"еквівалент виразу Python ``o1 * o2``." + +msgid "" +"Returns the result of matrix multiplication on *o1* and *o2*, or ``NULL`` on " +"failure. This is the equivalent of the Python expression ``o1 @ o2``." +msgstr "" +"Повертає результат множення матриці на *o1* та *o2* або ``NULL`` у разі " +"помилки. Це еквівалент виразу Python ``o1 @ o2``." + +msgid "" +"Return the floor of *o1* divided by *o2*, or ``NULL`` on failure. This is " +"the equivalent of the Python expression ``o1 // o2``." +msgstr "" +"Повертає нижню частину *o1*, поділену на *o2*, або ``NULL`` у разі помилки. " +"Це еквівалент виразу Python ``o1 // o2``." + +msgid "" +"Return a reasonable approximation for the mathematical value of *o1* divided " +"by *o2*, or ``NULL`` on failure. The return value is \"approximate\" " +"because binary floating-point numbers are approximate; it is not possible to " +"represent all real numbers in base two. This function can return a floating-" +"point value when passed two integers. This is the equivalent of the Python " +"expression ``o1 / o2``." +msgstr "" + +msgid "" +"Returns the remainder of dividing *o1* by *o2*, or ``NULL`` on failure. " +"This is the equivalent of the Python expression ``o1 % o2``." +msgstr "" +"Повертає залишок від ділення *o1* на *o2* або ``NULL`` у разі помилки. Це " +"еквівалент виразу Python ``o1 % o2``." + +msgid "" +"See the built-in function :func:`divmod`. Returns ``NULL`` on failure. This " +"is the equivalent of the Python expression ``divmod(o1, o2)``." +msgstr "" +"Перегляньте вбудовану функцію :func:`divmod`. Повертає ``NULL`` у разі " +"помилки. Це еквівалент виразу Python ``divmod(o1, o2)``." + +msgid "" +"See the built-in function :func:`pow`. Returns ``NULL`` on failure. This is " +"the equivalent of the Python expression ``pow(o1, o2, o3)``, where *o3* is " +"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 "" +"Перегляньте вбудовану функцію :func:`pow`. Повертає ``NULL`` у разі помилки. " +"Це еквівалент виразу Python ``pow(o1, o2, o3)``, де *o3* є необов’язковим. " +"Якщо *o3* потрібно ігнорувати, передайте замість нього :c:data:`Py_None` " +"(передача ``NULL`` для *o3* призведе до незаконного доступу до пам’яті)." + +msgid "" +"Returns the negation of *o* on success, or ``NULL`` on failure. This is the " +"equivalent of the Python expression ``-o``." +msgstr "" +"Повертає заперечення *o* у разі успіху або ``NULL`` у разі невдачі. Це " +"еквівалент виразу Python ``-o``." + +msgid "" +"Returns *o* on success, or ``NULL`` on failure. This is the equivalent of " +"the Python expression ``+o``." +msgstr "" +"Повертає *o* у разі успіху або ``NULL`` у разі невдачі. Це еквівалент виразу " +"Python ``+o``." + +msgid "" +"Returns the absolute value of *o*, or ``NULL`` on failure. This is the " +"equivalent of the Python expression ``abs(o)``." +msgstr "" +"Повертає абсолютне значення *o* або ``NULL`` у разі помилки. Це еквівалент " +"виразу Python ``abs(o)``." + +msgid "" +"Returns the bitwise negation of *o* on success, or ``NULL`` on failure. " +"This is the equivalent of the Python expression ``~o``." +msgstr "" +"Повертає порозрядне заперечення *o* у разі успіху або ``NULL`` у разі " +"невдачі. Це еквівалент виразу Python ``~o``." + +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 "" +"Повертає результат зсуву вліво *o1* на *o2* у разі успіху або ``NULL`` у " +"разі помилки. Це еквівалент виразу Python ``o1 << o2``." + +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 "" +"Повертає результат зсуву праворуч *o1* на *o2* у разі успіху або ``NULL`` у " +"разі помилки. Це еквівалент виразу Python ``o1 >> o2``." + +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 "" +"Повертає \"порозрядне та\" *o1* і *o2* у разі успіху та ``NULL`` у разі " +"помилки. Це еквівалент виразу Python ``o1 & o2``." + +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 "" +"Повертає \"порозрядне виняткове або\" *o1* на *o2* у разі успіху або " +"``NULL`` у разі помилки. Це еквівалент виразу Python ``o1 ^ o2``." + +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 "" +"Повертає \"порозрядне або\" *o1* і *o2* у разі успіху або ``NULL`` у разі " +"помилки. Це еквівалент виразу Python ``o1 | o2``." + +msgid "" +"Returns the result of adding *o1* and *o2*, or ``NULL`` on failure. The " +"operation is done *in-place* when *o1* supports it. This is the equivalent " +"of the Python statement ``o1 += o2``." +msgstr "" +"Повертає результат додавання *o1* і *o2* або ``NULL`` у разі помилки. " +"Операція виконується *на місці*, якщо *o1* її підтримує. Це еквівалент " +"оператора Python ``o1 += o2``." + +msgid "" +"Returns the result of subtracting *o2* from *o1*, or ``NULL`` on failure. " +"The operation is done *in-place* when *o1* supports it. This is the " +"equivalent of the Python statement ``o1 -= o2``." +msgstr "" +"Повертає результат віднімання *o2* від *o1* або ``NULL`` у разі помилки. " +"Операція виконується *на місці*, якщо *o1* її підтримує. Це еквівалент " +"оператора Python ``o1 -= o2``." + +msgid "" +"Returns the result of multiplying *o1* and *o2*, or ``NULL`` on failure. " +"The operation is done *in-place* when *o1* supports it. This is the " +"equivalent of the Python statement ``o1 *= o2``." +msgstr "" +"Повертає результат множення *o1* і *o2* або ``NULL`` у разі помилки. " +"Операція виконується *на місці*, якщо *o1* її підтримує. Це еквівалент " +"оператора Python ``o1 *= o2``." + +msgid "" +"Returns the result of matrix multiplication on *o1* and *o2*, or ``NULL`` on " +"failure. The operation is done *in-place* when *o1* supports it. This is " +"the equivalent of the Python statement ``o1 @= o2``." +msgstr "" +"Повертає результат множення матриці на *o1* і *o2* або ``NULL`` у разі " +"помилки. Операція виконується *на місці*, якщо *o1* її підтримує. Це " +"еквівалент оператора Python ``o1 @= o2``." + +msgid "" +"Returns the mathematical floor of dividing *o1* by *o2*, or ``NULL`` on " +"failure. The operation is done *in-place* when *o1* supports it. This is " +"the equivalent of the Python statement ``o1 //= o2``." +msgstr "" +"Повертає математичний рівень ділення *o1* на *o2* або ``NULL`` у разі " +"помилки. Операція виконується *на місці*, якщо *o1* її підтримує. Це " +"еквівалент оператора Python ``o1 //= o2``." + +msgid "" +"Return a reasonable approximation for the mathematical value of *o1* divided " +"by *o2*, or ``NULL`` on failure. The return value is \"approximate\" " +"because binary floating-point numbers are approximate; it is not possible to " +"represent all real numbers in base two. This function can return a floating-" +"point value when passed two integers. The operation is done *in-place* when " +"*o1* supports it. This is the equivalent of the Python statement ``o1 /= " +"o2``." +msgstr "" + +msgid "" +"Returns the remainder of dividing *o1* by *o2*, or ``NULL`` on failure. The " +"operation is done *in-place* when *o1* supports it. This is the equivalent " +"of the Python statement ``o1 %= o2``." +msgstr "" +"Повертає залишок від ділення *o1* на *o2* або ``NULL`` у разі помилки. " +"Операція виконується *на місці*, якщо *o1* її підтримує. Це еквівалент " +"оператора Python ``o1 %= o2``." + +msgid "" +"See the built-in function :func:`pow`. Returns ``NULL`` on failure. The " +"operation is done *in-place* when *o1* supports it. This is the equivalent " +"of the Python statement ``o1 **= o2`` when o3 is :c:data:`Py_None`, or an in-" +"place variant of ``pow(o1, o2, o3)`` otherwise. 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 "" +"Перегляньте вбудовану функцію :func:`pow`. Повертає ``NULL`` у разі помилки. " +"Операція виконується *на місці*, якщо *o1* її підтримує. Це еквівалент " +"оператора Python ``o1 **= o2``, коли o3 дорівнює :c:data:`Py_None`, або " +"альтернативного варіанту ``pow(o1, o2, o3)`` інакше. Якщо *o3* потрібно " +"ігнорувати, передайте замість нього :c:data:`Py_None` (передача ``NULL`` для " +"*o3* призведе до незаконного доступу до пам’яті)." + +msgid "" +"Returns the result of left shifting *o1* by *o2* on success, or ``NULL`` on " +"failure. The operation is done *in-place* when *o1* supports it. This is " +"the equivalent of the Python statement ``o1 <<= o2``." +msgstr "" +"Повертає результат зсуву ліворуч *o1* на *o2* у разі успіху або ``NULL`` у " +"разі помилки. Операція виконується *на місці*, якщо *o1* її підтримує. Це " +"еквівалент оператора Python ``o1 <<= o2``." + +msgid "" +"Returns the result of right shifting *o1* by *o2* on success, or ``NULL`` on " +"failure. The operation is done *in-place* when *o1* supports it. This is " +"the equivalent of the Python statement ``o1 >>= o2``." +msgstr "" +"Повертає результат зсуву праворуч *o1* на *o2* у разі успіху або ``NULL`` у " +"разі помилки. Операція виконується *на місці*, якщо *o1* її підтримує. Це " +"еквівалент оператора Python ``o1 >>= o2``." + +msgid "" +"Returns the \"bitwise and\" of *o1* and *o2* on success and ``NULL`` on " +"failure. The operation is done *in-place* when *o1* supports it. This is " +"the equivalent of the Python statement ``o1 &= o2``." +msgstr "" +"Повертає \"порозрядне та\" *o1* і *o2* у разі успіху та ``NULL`` у разі " +"помилки. Операція виконується *на місці*, якщо *o1* її підтримує. Це " +"еквівалент оператора Python ``o1 &= o2``." + +msgid "" +"Returns the \"bitwise exclusive or\" of *o1* by *o2* on success, or ``NULL`` " +"on failure. The operation is done *in-place* when *o1* supports it. This " +"is the equivalent of the Python statement ``o1 ^= o2``." +msgstr "" +"Повертає \"порозрядне виняткове або\" *o1* на *o2* у разі успіху або " +"``NULL`` у разі помилки. Операція виконується *на місці*, якщо *o1* її " +"підтримує. Це еквівалент оператора Python ``o1 ^= o2``." + +msgid "" +"Returns the \"bitwise or\" of *o1* and *o2* on success, or ``NULL`` on " +"failure. The operation is done *in-place* when *o1* supports it. This is " +"the equivalent of the Python statement ``o1 |= o2``." +msgstr "" +"Повертає \"порозрядне або\" *o1* і *o2* у разі успіху або ``NULL`` у разі " +"помилки. Операція виконується *на місці*, якщо *o1* її підтримує. Це " +"еквівалент оператора Python ``o1 |= o2``." + +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 "" +"Повертає *o*, перетворений на цілий об’єкт у разі успіху, або ``NULL`` у " +"разі помилки. Це еквівалент виразу Python ``int(o)``." + +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 "" +"Повертає *o*, перетворений на об’єкт float у разі успіху, або ``NULL`` у " +"разі помилки. Це еквівалент виразу Python ``float(o)``." + +msgid "" +"Returns the *o* converted to a Python int on success or ``NULL`` with a :exc:" +"`TypeError` exception raised on failure." +msgstr "" +"Повертає *o*, перетворений на Python int у разі успіху або ``NULL`` з " +"виключенням :exc:`TypeError`, яке виникає в разі помилки." + +msgid "" +"The result always has exact type :class:`int`. Previously, the result could " +"have been an instance of a subclass of ``int``." +msgstr "" +"Результат завжди має точний тип :class:`int`. Раніше результат міг бути " +"екземпляром підкласу ``int``." + +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." +msgstr "" +"Повертає ціле число *n*, перетворене на базу *base* як рядок. Аргумент " +"*base* має бути одним із 2, 8, 10 або 16. Для base 2, 8 або 16 повернутий " +"рядок має префікс базового маркера ``'0b'``, ``'0o'`` або ``'0x''`` " +"відповідно. Якщо *n* не є int Python, воно спочатку перетворюється за " +"допомогою :c:func:`PyNumber_Index`." + +msgid "" +"Returns *o* converted to a :c:type:`Py_ssize_t` value if *o* can be " +"interpreted as an integer. If the call fails, an exception is raised and " +"``-1`` is returned." +msgstr "" +"Повертає *o*, перетворене на значення :c:type:`Py_ssize_t`, якщо *o* можна " +"інтерпретувати як ціле число. Якщо виклик не вдається, виникає виняток і " +"повертається ``-1``." + +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 "" +"Якщо *o* можна перетворити на Python int, але спроба перетворити на " +"значення :c:type:`Py_ssize_t` призведе до появи :exc:`OverflowError`, тоді " +"аргумент *exc* є типом винятку, який викличе бути викликано (зазвичай :exc:" +"`IndexError` або :exc:`OverflowError`). Якщо *exc* дорівнює ``NULL``, тоді " +"виняток очищається, а значення обрізається до ``PY_SSIZE_T_MIN`` для " +"від’ємного цілого числа або ``PY_SSIZE_T_MAX`` для додатного цілого числа." + +msgid "" +"Returns ``1`` if *o* is an index integer (has the ``nb_index`` slot of the " +"``tp_as_number`` structure filled in), and ``0`` otherwise. This function " +"always succeeds." +msgstr "" +"Повертає ``1``, якщо *o* є цілим індексом (має заповнений слот ``nb_index`` " +"структури ``tp_as_number``), і ``0`` інакше. Ця функція завжди успішна." + +msgid "built-in function" +msgstr "вбудована функція" + +msgid "divmod" +msgstr "" + +msgid "pow" +msgstr "" + +msgid "abs" +msgstr "" + +msgid "int" +msgstr "int" + +msgid "float" +msgstr "плавати" diff --git a/c-api/object.po b/c-api/object.po new file mode 100644 index 000000000..53bfbd208 --- /dev/null +++ b/c-api/object.po @@ -0,0 +1,733 @@ +# SOME DESCRIPTIVE TITLE. +# 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 +# Dmytro Kazanzhy, 2024 +# Yuliia Shevchenko, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:49+0000\n" +"Last-Translator: Yuliia Shevchenko, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Object Protocol" +msgstr "Об'єктний протокол" + +msgid "Get a :term:`strong reference` to a constant." +msgstr "" + +msgid "Set an exception and return ``NULL`` if *constant_id* is invalid." +msgstr "" + +msgid "*constant_id* must be one of these constant identifiers:" +msgstr "" + +msgid "Constant Identifier" +msgstr "" + +msgid "Value" +msgstr "Значення" + +msgid "Returned object" +msgstr "" + +msgid "``0``" +msgstr "``0``" + +msgid ":py:data:`None`" +msgstr "" + +msgid "``1``" +msgstr "``1``" + +msgid ":py:data:`False`" +msgstr "" + +msgid "``2``" +msgstr "``2``" + +msgid ":py:data:`True`" +msgstr "" + +msgid "``3``" +msgstr "``3``" + +msgid ":py:data:`Ellipsis`" +msgstr "" + +msgid "``4``" +msgstr "``4``" + +msgid ":py:data:`NotImplemented`" +msgstr "" + +msgid "``5``" +msgstr "``5``" + +msgid "``6``" +msgstr "``6``" + +msgid "``7``" +msgstr "``7``" + +msgid "``''``" +msgstr "" + +msgid "``8``" +msgstr "``8``" + +msgid "``b''``" +msgstr "" + +msgid "``9``" +msgstr "``9``" + +msgid "``()``" +msgstr "" + +msgid "" +"Numeric values are only given for projects which cannot use the constant " +"identifiers." +msgstr "" + +msgid "In CPython, all of these constants are :term:`immortal`." +msgstr "" + +msgid "" +"Similar to :c:func:`Py_GetConstant`, but return a :term:`borrowed reference`." +msgstr "" + +msgid "" +"This function is primarily intended for backwards compatibility: using :c:" +"func:`Py_GetConstant` is recommended for new code." +msgstr "" + +msgid "" +"The reference is borrowed from the interpreter, and is valid until the " +"interpreter finalization." +msgstr "" + +msgid "" +"The ``NotImplemented`` singleton, used to signal that an operation is not " +"implemented for the given type combination." +msgstr "" +"Синглтон ``NotImplemented``, який використовується для сигналу про те, що " +"операція не реалізована для даної комбінації типів." + +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)." +msgstr "" + +msgid "" +"Flag to be used with multiple functions that print the object (like :c:func:" +"`PyObject_Print` and :c:func:`PyFile_WriteObject`). If passed, these " +"function would use the :func:`str` of the object instead of the :func:`repr`." +msgstr "" + +msgid "" +"Print an object *o*, on file *fp*. Returns ``-1`` on error. The flags " +"argument is used to enable certain printing options. The only option " +"currently supported is :c:macro:`Py_PRINT_RAW`; if given, the :func:`str` of " +"the object is written instead of the :func:`repr`." +msgstr "" + +msgid "" +"Returns ``1`` if *o* has the attribute *attr_name*, and ``0`` otherwise. " +"This is equivalent to the Python expression ``hasattr(o, attr_name)``. On " +"failure, return ``-1``." +msgstr "" + +msgid "" +"This is the same as :c:func:`PyObject_HasAttrWithError`, but *attr_name* is " +"specified as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than " +"a :c:expr:`PyObject*`." +msgstr "" + +msgid "" +"Returns ``1`` if *o* has the attribute *attr_name*, and ``0`` otherwise. " +"This function always succeeds." +msgstr "" + +msgid "" +"Exceptions that occur when this calls :meth:`~object.__getattr__` and :meth:" +"`~object.__getattribute__` methods aren't propagated, but instead given to :" +"func:`sys.unraisablehook`. For proper error handling, use :c:func:" +"`PyObject_HasAttrWithError`, :c:func:`PyObject_GetOptionalAttr` or :c:func:" +"`PyObject_GetAttr` instead." +msgstr "" + +msgid "" +"This is the same as :c:func:`PyObject_HasAttr`, but *attr_name* is specified " +"as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" +"`PyObject*`." +msgstr "" + +msgid "" +"Exceptions that occur when this calls :meth:`~object.__getattr__` and :meth:" +"`~object.__getattribute__` methods or while creating the temporary :class:" +"`str` object are silently ignored. For proper error handling, use :c:func:" +"`PyObject_HasAttrStringWithError`, :c:func:`PyObject_GetOptionalAttrString` " +"or :c:func:`PyObject_GetAttrString` instead." +msgstr "" + +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 "" +"Отримати атрибут з назвою *attr_name* з об’єкта *o*. Повертає значення " +"атрибута в разі успіху або ``NULL`` у разі невдачі. Це еквівалент виразу " +"Python ``o.attr_name``." + +msgid "" +"If the missing attribute should not be treated as a failure, you can use :c:" +"func:`PyObject_GetOptionalAttr` instead." +msgstr "" + +msgid "" +"This is the same as :c:func:`PyObject_GetAttr`, but *attr_name* is specified " +"as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" +"`PyObject*`." +msgstr "" + +msgid "" +"If the missing attribute should not be treated as a failure, you can use :c:" +"func:`PyObject_GetOptionalAttrString` instead." +msgstr "" + +msgid "" +"Variant of :c:func:`PyObject_GetAttr` which doesn't raise :exc:" +"`AttributeError` if the attribute is not found." +msgstr "" + +msgid "" +"If the attribute is found, return ``1`` and set *\\*result* to a new :term:" +"`strong reference` to the attribute. If the attribute is not found, return " +"``0`` and set *\\*result* to ``NULL``; the :exc:`AttributeError` is " +"silenced. If an error other than :exc:`AttributeError` is raised, return " +"``-1`` and set *\\*result* to ``NULL``." +msgstr "" + +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 "" + +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." +msgstr "" +"Загальна функція отримання атрибутів, яка призначена для розміщення в слоті " +"``tp_getattro`` об’єкта типу. Він шукає дескриптор у словнику класів у MRO " +"об’єкта, а також атрибут у :attr:`~object.__dict__` об’єкта (якщо є). Як " +"зазначено в :ref:`descriptors`, дескриптори даних мають перевагу над " +"атрибутами екземплярів, тоді як дескриптори, що не є даними, ні. В іншому " +"випадку виникає помилка :exc:`AttributeError`." + +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 "" +"Установіть значення атрибута *attr_name* для об’єкта *o* на значення *v*. " +"Викликати виняток і повертати ``-1`` у разі помилки; повернути ``0`` в разі " +"успіху. Це еквівалент оператора Python ``o.attr_name = v``." + +msgid "" +"If *v* is ``NULL``, the attribute is deleted. This behaviour is deprecated " +"in favour of using :c:func:`PyObject_DelAttr`, but there are currently no " +"plans to remove it." +msgstr "" +"Якщо *v* має значення ``NULL``, атрибут видаляється. Ця поведінка застаріла " +"на користь використання :c:func:`PyObject_DelAttr`, але наразі немає планів " +"її видалення." + +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*`." +msgstr "" + +msgid "" +"If *v* is ``NULL``, the attribute is deleted, but this feature is deprecated " +"in favour of using :c:func:`PyObject_DelAttrString`." +msgstr "" +"Якщо *v* має значення ``NULL``, атрибут видаляється, але ця функція " +"застаріла на користь використання :c:func:`PyObject_DelAttrString`." + +msgid "" +"The number of different attribute names passed to this function should be " +"kept small, usually by using a statically allocated string as *attr_name*. " +"For attribute names that aren't known at compile time, prefer calling :c:" +"func:`PyUnicode_FromString` and :c:func:`PyObject_SetAttr` directly. For " +"more details, see :c:func:`PyUnicode_InternFromString`, which may be used " +"internally to create a key object." +msgstr "" + +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 " +"data descriptor in the dictionary of classes in the object's MRO, and if " +"found it takes preference over setting or deleting the attribute in the " +"instance dictionary. Otherwise, the attribute is set or deleted in the " +"object's :attr:`~object.__dict__` (if present). On success, ``0`` is " +"returned, otherwise an :exc:`AttributeError` is raised and ``-1`` is " +"returned." +msgstr "" +"Загальна функція встановлення та видалення атрибутів, яка призначена для " +"розміщення в слоті :c:member:`~PyTypeObject.tp_setattro` об’єкта типу. Він " +"шукає дескриптор даних у словнику класів у MRO об’єкта, і якщо його " +"знайдено, він надає перевагу над налаштуванням або видаленням атрибута в " +"словнику екземпляра. В іншому випадку атрибут встановлюється або видаляється " +"в об’єкті :attr:`~object.__dict__` (якщо є). У разі успіху повертається " +"``0``, інакше виникає :exc:`AttributeError` і повертається ``-1``." + +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 "" +"Видалити атрибут з назвою *attr_name* для об’єкта *o*. Повертає ``-1`` у " +"разі помилки. Це еквівалент оператора Python ``del o.attr_name``." + +msgid "" +"This is the same as :c:func:`PyObject_DelAttr`, but *attr_name* is specified " +"as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" +"`PyObject*`." +msgstr "" + +msgid "" +"The number of different attribute names passed to this function should be " +"kept small, usually by using a statically allocated string as *attr_name*. " +"For attribute names that aren't known at compile time, prefer calling :c:" +"func:`PyUnicode_FromString` and :c:func:`PyObject_DelAttr` directly. For " +"more details, see :c:func:`PyUnicode_InternFromString`, which may be used " +"internally to create a key object for lookup." +msgstr "" + +msgid "" +"A generic implementation for the getter of a ``__dict__`` descriptor. It " +"creates the dictionary if necessary." +msgstr "" +"Загальна реалізація засобу отримання дескриптора ``__dict__``. Він створює " +"словник, якщо це необхідно." + +msgid "" +"This function may also be called to get the :py:attr:`~object.__dict__` of " +"the object *o*. Pass ``NULL`` for *context* when calling it. Since this " +"function may need to allocate memory for the dictionary, it may be more " +"efficient to call :c:func:`PyObject_GetAttr` when accessing an attribute on " +"the object." +msgstr "" + +msgid "On failure, returns ``NULL`` with an exception set." +msgstr "" + +msgid "" +"A generic implementation for the setter of a ``__dict__`` descriptor. This " +"implementation does not allow the dictionary to be deleted." +msgstr "" +"Загальна реалізація засобу налаштування дескриптора ``__dict__``. Ця " +"реалізація не дозволяє видаляти словник." + +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 "" + +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 "" + +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." +msgstr "" + +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 "" + +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 "" + +msgid "" +"Format *obj* using *format_spec*. This is equivalent to the Python " +"expression ``format(obj, format_spec)``." +msgstr "" + +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 "" + +msgid "" +"Compute a string representation of object *o*. Returns the string " +"representation on success, ``NULL`` on failure. This is the equivalent of " +"the Python expression ``repr(o)``. Called by the :func:`repr` built-in " +"function." +msgstr "" +"Обчислити рядкове представлення об’єкта *o*. Повертає рядкове представлення " +"в разі успіху, ``NULL`` у разі невдачі. Це еквівалент виразу Python " +"``repr(o)``. Викликається вбудованою функцією :func:`repr`." + +msgid "" +"This function now includes a debug assertion to help ensure that it does not " +"silently discard an active exception." +msgstr "" +"Ця функція тепер включає твердження налагодження, щоб гарантувати, що вона " +"не відкидає мовчки активний виняток." + +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." +msgstr "" +"Як :c:func:`PyObject_Repr`, обчислити рядкове представлення об’єкта *o*, але " +"екранувати символи, відмінні від ASCII, у рядку, який повертає :c:func:" +"`PyObject_Repr`, за допомогою ``\\x``, ``\\u`` або ``\\U`` екранується. Це " +"створює рядок, подібний до того, який повертає :c:func:`PyObject_Repr` у " +"Python 2. Викликається вбудованою функцією :func:`ascii`." + +msgid "" +"Compute a string representation of object *o*. Returns the string " +"representation on success, ``NULL`` on failure. This is the equivalent of " +"the Python expression ``str(o)``. Called by the :func:`str` built-in " +"function and, therefore, by the :func:`print` function." +msgstr "" +"Обчислити рядкове представлення об’єкта *o*. Повертає рядкове представлення " +"в разі успіху, ``NULL`` у разі невдачі. Це еквівалент виразу Python " +"``str(o)``. Викликається вбудованою функцією :func:`str` і, отже, функцією :" +"func:`print`." + +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 " +"expression ``bytes(o)``, when *o* is not an integer. Unlike ``bytes(o)``, a " +"TypeError is raised when *o* is an integer instead of a zero-initialized " +"bytes object." +msgstr "" +"Обчисліть байтове представлення об'єкта *o*. У разі помилки повертається " +"``NULL``, а в разі успіху — об’єкт bytes. Це еквівалентно виразу Python " +"``bytes(o)``, коли *o* не є цілим числом. На відміну від ``bytes(o)``, " +"помилка TypeError виникає, коли *o* є цілим числом замість об’єкта bytes, " +"ініціалізованого нулем." + +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 "" +"Повертає ``1``, якщо клас *derived* ідентичний або походить від класу *cls*, " +"інакше повертає ``0``. У разі помилки поверніть ``-1``." + +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 "" +"Якщо *cls* є кортежем, перевірятиметься кожен запис у *cls*. Результатом " +"буде ``1``, якщо хоча б одна з перевірок повертає ``1``, інакше він буде " +"``0``." + +msgid "" +"If *cls* has a :meth:`~type.__subclasscheck__` method, it will be called to " +"determine the subclass status as described in :pep:`3119`. Otherwise, " +"*derived* is a subclass of *cls* if it is a direct or indirect subclass, i." +"e. contained in :attr:`cls.__mro__ `." +msgstr "" + +msgid "" +"Normally only class objects, i.e. instances of :class:`type` or a derived " +"class, are considered classes. However, objects can override this by having " +"a :attr:`~type.__bases__` attribute (which must be a tuple of base classes)." +msgstr "" + +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 "" +"Повертає ``1``, якщо *inst* є екземпляром класу *cls* або підкласом *cls*, " +"або ``0``, якщо ні. У разі помилки повертає ``-1`` і встановлює виняток." + +msgid "" +"If *cls* has a :meth:`~type.__instancecheck__` method, it will be called to " +"determine the subclass status as described in :pep:`3119`. Otherwise, " +"*inst* is an instance of *cls* if its class is a subclass of *cls*." +msgstr "" + +msgid "" +"An instance *inst* can override what is considered its class by having a :" +"attr:`~object.__class__` attribute." +msgstr "" + +msgid "" +"An object *cls* can override if it is considered a class, and what its base " +"classes are, by having a :attr:`~type.__bases__` attribute (which must be a " +"tuple of base classes)." +msgstr "" + +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 "" +"Обчислити та повернути хеш-значення об’єкта *o*. У разі помилки поверніть " +"``-1``. Це еквівалент виразу Python ``hash(o)``." + +msgid "" +"The return type is now Py_hash_t. This is a signed integer the same size " +"as :c:type:`Py_ssize_t`." +msgstr "" +"Тип повернення тепер Py_hash_t. Це ціле число зі знаком такого ж розміру, " +"як :c:type:`Py_ssize_t`." + +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 " +"``tp_hash`` slot, allowing a type to explicitly indicate to the interpreter " +"that it is not hashable." +msgstr "" + +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 "" +"Повертає ``1``, якщо об’єкт *o* вважається істинним, і ``0`` в іншому " +"випадку. Це еквівалентно виразу Python ``not not o``. У разі помилки " +"поверніть ``-1``." + +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 "" +"Повертає ``0``, якщо об’єкт *o* вважається істинним, і ``1`` інакше. Це " +"еквівалентно виразу Python ``not o``. У разі помилки поверніть ``-1``." + +msgid "" +"When *o* is non-``NULL``, returns a type object corresponding to the object " +"type of object *o*. On failure, raises :exc:`SystemError` and returns " +"``NULL``. This is equivalent to the Python expression ``type(o)``. This " +"function creates a new :term:`strong reference` to the return value. There's " +"really no reason to use this function instead of the :c:func:`Py_TYPE()` " +"function, which returns a pointer of type :c:expr:`PyTypeObject*`, except " +"when a new :term:`strong reference` is needed." +msgstr "" + +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 "" +"Повертає відмінне від нуля значення, якщо об’єкт *o* має тип *type* або " +"підтип *type*, і ``0`` інакше. Обидва параметри не мають бути ``NULL``." + +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, " +"``-1`` is returned. This is the equivalent to the Python expression " +"``len(o)``." +msgstr "" +"Повертає довжину об'єкта *o*. Якщо об’єкт *o* надає протоколи послідовності " +"та відображення, повертається довжина послідовності. У разі помилки " +"повертається ``-1``. Це еквівалент виразу Python ``len(o)``." + +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 " +"finally return the default value. On error return ``-1``. This is the " +"equivalent to the Python expression ``operator.length_hint(o, " +"defaultvalue)``." +msgstr "" +"Повертає приблизну довжину об’єкта *o*. Спочатку спробуйте повернути його " +"фактичну довжину, потім оцінку за допомогою :meth:`~object.__length_hint__` " +"і, нарешті, поверніть значення за замовчуванням. У разі помилки повертає " +"``-1``. Це еквівалент виразу Python ``operator.length_hint(o, " +"defaultvalue)``." + +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 "" +"Повертає елемент *o*, що відповідає об’єкту *key* або ``NULL`` у разі " +"помилки. Це еквівалент виразу Python ``o[key]``." + +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 "" +"Зіставте об’єкт *key* на значення *v*. Викликати виняток і повертати ``-1`` " +"у разі помилки; повернути ``0`` в разі успіху. Це еквівалент оператора " +"Python ``o[key] = v``. Ця функція *не* викрадає посилання на *v*." + +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 "" +"Видаліть зіставлення для об’єкта *key* з об’єкта *o*. Повернути ``-1`` у " +"разі помилки. Це еквівалентно оператору Python ``del o[key]``." + +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 "" + +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." +msgstr "" +"Це еквівалентно виразу Python ``dir(o)``, який повертає (можливо, порожній) " +"список рядків, відповідних для аргументу об’єкта, або ``NULL``, якщо була " +"помилка. Якщо аргумент ``NULL``, це схоже на ``dir()`` Python, що повертає " +"імена поточних локальних систем; у цьому випадку, якщо жоден кадр виконання " +"не активний, повертається ``NULL``, але :c:func:`PyErr_Occurred` повертатиме " +"false." + +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 " +"already an iterator. Raises :exc:`TypeError` and returns ``NULL`` if the " +"object cannot be iterated." +msgstr "" +"Це еквівалентно виразу Python ``iter(o)``. Він повертає новий ітератор для " +"аргументу об’єкта або сам об’єкт, якщо об’єкт уже є ітератором. Викликає :" +"exc:`TypeError` і повертає ``NULL``, якщо об’єкт не можна повторити." + +msgid "" +"This is equivalent to the Python ``__iter__(self): return self`` method. It " +"is intended for :term:`iterator` types, to be used in the :c:member:" +"`PyTypeObject.tp_iter` slot." +msgstr "" + +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 "" +"Це еквівалент виразу Python ``aiter(o)``. Бере об’єкт :class:`AsyncIterable` " +"і повертає для нього :class:`AsyncIterator`. Зазвичай це новий ітератор, але " +"якщо аргументом є :class:`AsyncIterator`, він повертає сам себе. Викликає :" +"exc:`TypeError` і повертає ``NULL``, якщо об’єкт не можна повторити." + +msgid "Get a pointer to subclass-specific data reserved for *cls*." +msgstr "" + +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 "" + +msgid "On error, set an exception and return ``NULL``." +msgstr "" + +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 "" + +msgid "" +"This may be larger than requested using :c:member:`-PyType_Spec.basicsize " +"`; it is safe to use this larger size (e.g. with :c:" +"func:`!memset`)." +msgstr "" + +msgid "" +"The type *cls* **must** have been created using negative :c:member:" +"`PyType_Spec.basicsize`. Python does not check this." +msgstr "" + +msgid "On error, set an exception and return a negative value." +msgstr "" + +msgid "" +"Get a pointer to per-item data for a class with :c:macro:" +"`Py_TPFLAGS_ITEMS_AT_END`." +msgstr "" + +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 "" + +msgid "Visit the managed dictionary of *obj*." +msgstr "" + +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 "" + +msgid "Clear the managed dictionary of *obj*." +msgstr "" + +msgid "built-in function" +msgstr "вбудована функція" + +msgid "repr" +msgstr "репр" + +msgid "ascii" +msgstr "ascii" + +msgid "string" +msgstr "рядок" + +msgid "PyObject_Str (C function)" +msgstr "" + +msgid "bytes" +msgstr "байтів" + +msgid "hash" +msgstr "" + +msgid "type" +msgstr "тип" + +msgid "len" +msgstr "" diff --git a/c-api/objimpl.po b/c-api/objimpl.po new file mode 100644 index 000000000..cbfd5f700 --- /dev/null +++ b/c-api/objimpl.po @@ -0,0 +1,36 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:49+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Object Implementation Support" +msgstr "Підтримка реалізації об'єктів" + +msgid "" +"This chapter describes the functions, types, and macros used when defining " +"new object types." +msgstr "" +"У цьому розділі описано функції, типи та макроси, які використовуються під " +"час визначення нових типів об’єктів." diff --git a/c-api/perfmaps.po b/c-api/perfmaps.po new file mode 100644 index 000000000..4db39ab82 --- /dev/null +++ b/c-api/perfmaps.po @@ -0,0 +1,84 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2023-05-24 13:07+0000\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Support for Perf Maps" +msgstr "" + +msgid "" +"On supported platforms (as of this writing, only Linux), the runtime can " +"take advantage of *perf map files* to make Python functions visible to an " +"external profiling tool (such as `perf `_). A running process may create a file in the ``/tmp`` " +"directory, which contains entries that can map a section of executable code " +"to a name. This interface is described in the `documentation of the Linux " +"Perf tool `_." +msgstr "" + +msgid "" +"In Python, these helper APIs can be used by libraries and features that rely " +"on generating machine code on the fly." +msgstr "" + +msgid "" +"Note that holding the Global Interpreter Lock (GIL) is not required for " +"these APIs." +msgstr "" + +msgid "" +"Open the ``/tmp/perf-$pid.map`` file, unless it's already opened, and create " +"a lock to ensure thread-safe writes to the file (provided the writes are " +"done through :c:func:`PyUnstable_WritePerfMapEntry`). Normally, there's no " +"need to call this explicitly; just use :c:func:" +"`PyUnstable_WritePerfMapEntry` and it will initialize the state on first " +"call." +msgstr "" + +msgid "" +"Returns ``0`` on success, ``-1`` on failure to create/open the perf map " +"file, or ``-2`` on failure to create a lock. Check ``errno`` for more " +"information about the cause of a failure." +msgstr "" + +msgid "" +"Write one single entry to the ``/tmp/perf-$pid.map`` file. This function is " +"thread safe. Here is what an example entry looks like::" +msgstr "" + +msgid "" +"# address size name\n" +"7f3529fcf759 b py::bar:/run/t.py" +msgstr "" + +msgid "" +"Will call :c:func:`PyUnstable_PerfMapState_Init` before writing the entry, " +"if the perf map file is not already opened. Returns ``0`` on success, or the " +"same error codes as :c:func:`PyUnstable_PerfMapState_Init` on failure." +msgstr "" + +msgid "" +"Close the perf map file opened by :c:func:`PyUnstable_PerfMapState_Init`. " +"This is called by the runtime itself during interpreter shut-down. In " +"general, there shouldn't be a reason to explicitly call this, except to " +"handle specific scenarios such as forking." +msgstr "" diff --git a/c-api/refcounting.po b/c-api/refcounting.po new file mode 100644 index 000000000..01a46eca5 --- /dev/null +++ b/c-api/refcounting.po @@ -0,0 +1,261 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2023 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:50+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2023\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Reference Counting" +msgstr "Підрахунок посилань" + +msgid "" +"The functions and macros in this section are used for managing reference " +"counts of Python objects." +msgstr "" + +msgid "Get the reference count of the Python object *o*." +msgstr "Отримати кількість посилань на об’єкт Python *o*." + +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." +msgstr "" + +msgid "" +"Use the :c:func:`Py_SET_REFCNT()` function to set an object reference count." +msgstr "" + +msgid ":c:func:`Py_REFCNT()` is changed to the inline static function." +msgstr "" + +msgid "The parameter type is no longer :c:expr:`const PyObject*`." +msgstr "" + +msgid "Set the object *o* reference counter to *refcnt*." +msgstr "Встановіть лічильник посилань *o* на *refcnt*." + +msgid "" +"On :ref:`Python build with Free Threading `, if " +"*refcnt* is larger than ``UINT32_MAX``, the object is made :term:`immortal`." +msgstr "" + +msgid "This function has no effect on :term:`immortal` objects." +msgstr "" + +msgid "Immortal objects are not modified." +msgstr "" + +msgid "" +"Indicate taking a new :term:`strong reference` to object *o*, indicating it " +"is in use and should not be destroyed." +msgstr "" + +msgid "" +"This function is usually used to convert a :term:`borrowed reference` to a :" +"term:`strong reference` in-place. The :c:func:`Py_NewRef` function can be " +"used to create a new :term:`strong reference`." +msgstr "" +"Ця функція зазвичай використовується для перетворення :term:`borrowed " +"reference` на :term:`strong reference` на місці. Функцію :c:func:`Py_NewRef` " +"можна використати для створення нового :term:`strong reference`." + +msgid "When done using the object, release is by calling :c:func:`Py_DECREF`." +msgstr "" + +msgid "" +"The object must not be ``NULL``; if you aren't sure that it isn't ``NULL``, " +"use :c:func:`Py_XINCREF`." +msgstr "" +"Об’єкт не має бути ``NULL``; якщо ви не впевнені, що це не ``NULL``, " +"використовуйте :c:func:`Py_XINCREF`." + +msgid "" +"Do not expect this function to actually modify *o* in any way. For at least :" +"pep:`some objects <0683>`, this function has no effect." +msgstr "" + +msgid "" +"Similar to :c:func:`Py_INCREF`, but the object *o* can be ``NULL``, in which " +"case this has no effect." +msgstr "" + +msgid "See also :c:func:`Py_XNewRef`." +msgstr "Дивіться також :c:func:`Py_XNewRef`." + +msgid "" +"Create a new :term:`strong reference` to an object: call :c:func:`Py_INCREF` " +"on *o* and return the object *o*." +msgstr "" + +msgid "" +"When the :term:`strong reference` is no longer needed, :c:func:`Py_DECREF` " +"should be called on it to release the reference." +msgstr "" + +msgid "" +"The object *o* must not be ``NULL``; use :c:func:`Py_XNewRef` if *o* can be " +"``NULL``." +msgstr "" +"Об’єкт *o* не має бути ``NULL``; використовуйте :c:func:`Py_XNewRef`, якщо " +"*o* може бути ``NULL``." + +msgid "For example::" +msgstr "Наприклад::" + +msgid "" +"Py_INCREF(obj);\n" +"self->attr = obj;" +msgstr "" + +msgid "can be written as::" +msgstr "можна записати як::" + +msgid "self->attr = Py_NewRef(obj);" +msgstr "" + +msgid "See also :c:func:`Py_INCREF`." +msgstr "Дивіться також :c:func:`Py_INCREF`." + +msgid "Similar to :c:func:`Py_NewRef`, but the object *o* can be NULL." +msgstr "" +"Подібно до :c:func:`Py_NewRef`, але об’єкт *o* може мати значення NULL." + +msgid "If the object *o* is ``NULL``, the function just returns ``NULL``." +msgstr "" +"Якщо об’єкт *o* має значення ``NULL``, функція просто повертає ``NULL``." + +msgid "" +"Release a :term:`strong reference` to object *o*, indicating the reference " +"is no longer used." +msgstr "" + +msgid "" +"Once the last :term:`strong reference` is released (i.e. the object's " +"reference count reaches 0), the object's type's deallocation function (which " +"must not be ``NULL``) is invoked." +msgstr "" + +msgid "" +"This function is usually used to delete a :term:`strong reference` before " +"exiting its scope." +msgstr "" +"Ця функція зазвичай використовується для видалення :term:`strong reference` " +"перед виходом з його області." + +msgid "" +"The object must not be ``NULL``; if you aren't sure that it isn't ``NULL``, " +"use :c:func:`Py_XDECREF`." +msgstr "" +"Об’єкт не має бути ``NULL``; якщо ви не впевнені, що це не ``NULL``, " +"використовуйте :c:func:`Py_XDECREF`." + +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 "" + +msgid "" +"The deallocation function can cause arbitrary Python code to be invoked (e." +"g. when a class instance with a :meth:`~object.__del__` method is " +"deallocated). While exceptions in such code are not propagated, the " +"executed code has free access to all Python global variables. This means " +"that any object that is reachable from a global variable should be in a " +"consistent state before :c:func:`Py_DECREF` is invoked. For example, code " +"to delete an object from a list should copy a reference to the deleted " +"object in a temporary variable, update the list data structure, and then " +"call :c:func:`Py_DECREF` for the temporary variable." +msgstr "" + +msgid "" +"Similar to :c:func:`Py_DECREF`, but the object *o* can be ``NULL``, in which " +"case this has no effect. The same warning from :c:func:`Py_DECREF` applies " +"here as well." +msgstr "" + +msgid "" +"Release a :term:`strong reference` for object *o*. The object may be " +"``NULL``, in which case the macro has no effect; otherwise the effect is the " +"same as for :c:func:`Py_DECREF`, except that the argument is also set to " +"``NULL``. The warning for :c:func:`Py_DECREF` does not apply with respect " +"to the object passed because the macro carefully uses a temporary variable " +"and sets the argument to ``NULL`` before releasing the reference." +msgstr "" + +msgid "" +"It is a good idea to use this macro whenever releasing a reference to an " +"object that might be traversed during garbage collection." +msgstr "" + +msgid "" +"The macro argument is now only evaluated once. If the argument has side " +"effects, these are no longer duplicated." +msgstr "" + +msgid "" +"Indicate taking a new :term:`strong reference` to object *o*. A function " +"version of :c:func:`Py_XINCREF`. It can be used for runtime dynamic " +"embedding of Python." +msgstr "" + +msgid "" +"Release a :term:`strong reference` to object *o*. A function version of :c:" +"func:`Py_XDECREF`. It can be used for runtime dynamic embedding of Python." +msgstr "" + +msgid "" +"Macro safely releasing a :term:`strong reference` to object *dst* and " +"setting *dst* to *src*." +msgstr "" + +msgid "As in case of :c:func:`Py_CLEAR`, \"the obvious\" code can be deadly::" +msgstr "" + +msgid "" +"Py_DECREF(dst);\n" +"dst = src;" +msgstr "" + +msgid "The safe way is::" +msgstr "" + +msgid "Py_SETREF(dst, src);" +msgstr "" + +msgid "" +"That arranges to set *dst* to *src* _before_ releasing the reference to the " +"old value of *dst*, so that any code triggered as a side-effect of *dst* " +"getting torn down no longer believes *dst* points to a valid object." +msgstr "" + +msgid "" +"The macro arguments are now only evaluated once. If an argument has side " +"effects, these are no longer duplicated." +msgstr "" + +msgid "" +"Variant of :c:macro:`Py_SETREF` macro that uses :c:func:`Py_XDECREF` instead " +"of :c:func:`Py_DECREF`." +msgstr "" diff --git a/c-api/reflection.po b/c-api/reflection.po new file mode 100644 index 000000000..7da837e4d --- /dev/null +++ b/c-api/reflection.po @@ -0,0 +1,129 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:50+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Reflection" +msgstr "Рефлексія" + +msgid "Use :c:func:`PyEval_GetFrameBuiltins` instead." +msgstr "" + +msgid "" +"Return a dictionary of the builtins in the current execution frame, or the " +"interpreter of the thread state if no frame is currently executing." +msgstr "" +"Повертає словник вбудованих модулів у поточному кадрі виконання або " +"інтерпретатор стану потоку, якщо наразі жоден кадр не виконується." + +msgid "" +"Use either :c:func:`PyEval_GetFrameLocals` to obtain the same behaviour as " +"calling :func:`locals` in Python code, or else call :c:func:" +"`PyFrame_GetLocals` on the result of :c:func:`PyEval_GetFrame` to access " +"the :attr:`~frame.f_locals` attribute of the currently executing frame." +msgstr "" + +msgid "" +"Return a mapping providing access to the local variables in the current " +"execution frame, or ``NULL`` if no frame is currently executing." +msgstr "" + +msgid "" +"Refer to :func:`locals` for details of the mapping returned at different " +"scopes." +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." +msgstr "" + +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." +msgstr "" + +msgid "Use :c:func:`PyEval_GetFrameGlobals` instead." +msgstr "" + +msgid "" +"Return a dictionary of the global variables in the current execution frame, " +"or ``NULL`` if no frame is currently executing." +msgstr "" +"Повертає словник глобальних змінних у поточному кадрі виконання або " +"``NULL``, якщо наразі жоден кадр не виконується." + +msgid "" +"Return the current thread state's frame, which is ``NULL`` if no frame is " +"currently executing." +msgstr "" +"Повертає фрейм поточного стану потоку, який є ``NULL``, якщо жоден фрейм " +"наразі не виконується." + +msgid "See also :c:func:`PyThreadState_GetFrame`." +msgstr "Дивіться також :c:func:`PyThreadState_GetFrame`." + +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." +msgstr "" + +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`." +msgstr "" + +msgid "" +"Return a dictionary of the global variables in the current execution frame, " +"or ``NULL`` if no frame is currently executing. Equivalent to calling :func:" +"`globals` in Python code." +msgstr "" + +msgid "" +"Return the name of *func* if it is a function, class or instance object, " +"else the name of *func*\\s type." +msgstr "" +"Повертає ім’я *func*, якщо це функція, клас або об’єкт примірника, інакше " +"ім’я типу *func*\\s." + +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*." +msgstr "" +"Повертає рядок опису залежно від типу *func*. Повернуті значення включають " +"\"()\" для функцій і методів, \"конструктор\", \"примірник\" і \"об'єкт\". " +"Поєднаний із результатом :c:func:`PyEval_GetFuncName`, результат буде описом " +"*func*." diff --git a/c-api/sequence.po b/c-api/sequence.po new file mode 100644 index 000000000..d61e9900b --- /dev/null +++ b/c-api/sequence.po @@ -0,0 +1,257 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2023 +# Yuliia Shevchenko, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:50+0000\n" +"Last-Translator: Yuliia Shevchenko, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Sequence Protocol" +msgstr "Протокол послідовності" + +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." +msgstr "" + +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 "" +"Повертає кількість об’єктів у послідовності *o* в разі успіху та ``-1`` в " +"разі невдачі. Це еквівалентно виразу Python ``len(o)``." + +msgid "" +"Return the concatenation of *o1* and *o2* on success, and ``NULL`` on " +"failure. This is the equivalent of the Python expression ``o1 + o2``." +msgstr "" +"Повертає конкатенацію *o1* і *o2* у разі успіху та ``NULL`` у разі невдачі. " +"Це еквівалент виразу Python ``o1 + o2``." + +msgid "" +"Return the result of repeating sequence object *o* *count* times, or " +"``NULL`` on failure. This is the equivalent of the Python expression ``o * " +"count``." +msgstr "" +"Повертає результат повторення об’єкта послідовності *o* *count* разів або " +"``NULL`` у разі помилки. Це еквівалент виразу Python ``o * count``." + +msgid "" +"Return the concatenation of *o1* and *o2* on success, and ``NULL`` on " +"failure. The operation is done *in-place* when *o1* supports it. This is " +"the equivalent of the Python expression ``o1 += o2``." +msgstr "" +"Повертає конкатенацію *o1* і *o2* у разі успіху та ``NULL`` у разі невдачі. " +"Операція виконується *на місці*, якщо *o1* її підтримує. Це еквівалент " +"виразу Python ``o1 += o2``." + +msgid "" +"Return the result of repeating sequence object *o* *count* times, or " +"``NULL`` on failure. The operation is done *in-place* when *o* supports " +"it. This is the equivalent of the Python expression ``o *= count``." +msgstr "" +"Повертає результат повторення об’єкта послідовності *o* *count* разів або " +"``NULL`` у разі помилки. Операція виконується *на місці*, якщо *o* її " +"підтримує. Це еквівалент виразу Python ``o *= count``." + +msgid "" +"Return the *i*\\ th element of *o*, or ``NULL`` on failure. This is the " +"equivalent of the Python expression ``o[i]``." +msgstr "" +"Повертає *i*\\-й елемент *o* або ``NULL`` у разі помилки. Це еквівалент " +"виразу Python ``o[i]``." + +msgid "" +"Return the slice of sequence object *o* between *i1* and *i2*, or ``NULL`` " +"on failure. This is the equivalent of the Python expression ``o[i1:i2]``." +msgstr "" +"Повертає зріз об’єкта послідовності *o* між *i1* і *i2* або ``NULL`` у разі " +"помилки. Це еквівалент виразу Python ``o[i1:i2]``." + +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*." +msgstr "" +"Призначте об’єкт *v* до *i*\\ го елемента *o*. Викликати виняток і повертати " +"``-1`` у разі помилки; повернути ``0`` в разі успіху. Це еквівалент " +"оператора Python ``o[i] = v``. Ця функція *не* викрадає посилання на *v*." + +msgid "" +"If *v* is ``NULL``, the element is deleted, but this feature is deprecated " +"in favour of using :c:func:`PySequence_DelItem`." +msgstr "" +"Якщо *v* має значення ``NULL``, елемент видаляється, але ця функція " +"застаріла на користь використання :c:func:`PySequence_DelItem`." + +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 "" +"Видалити *i*\\ th елемент об'єкта *o*. Повертає ``-1`` у разі помилки. Це " +"еквівалент оператора Python ``del o[i]``." + +msgid "" +"Assign the sequence object *v* to the slice in sequence object *o* from *i1* " +"to *i2*. This is the equivalent of the Python statement ``o[i1:i2] = v``." +msgstr "" +"Призначте об’єкт послідовності *v* фрагменту в об’єкті послідовності *o* від " +"*i1* до *i2*. Це еквівалент оператора Python ``o[i1:i2] = v``." + +msgid "" +"Delete the slice in sequence object *o* from *i1* to *i2*. Returns ``-1`` " +"on failure. This is the equivalent of the Python statement ``del o[i1:i2]``." +msgstr "" +"Видалити фрагмент у послідовному об’єкті *o* від *i1* до *i2*. Повертає " +"``-1`` у разі помилки. Це еквівалент оператора Python ``del o[i1:i2]``." + +msgid "" +"Return the number of occurrences of *value* in *o*, that is, return the " +"number of keys for which ``o[key] == value``. On failure, return ``-1``. " +"This is equivalent to the Python expression ``o.count(value)``." +msgstr "" +"Повертає кількість входжень *value* у *o*, тобто повертає кількість ключів, " +"для яких ``o[key] == value``. У разі помилки поверніть ``-1``. Це " +"еквівалентно виразу Python ``o.count(value)``." + +msgid "" +"Determine if *o* contains *value*. If an item in *o* is equal to *value*, " +"return ``1``, otherwise return ``0``. On error, return ``-1``. This is " +"equivalent to the Python expression ``value in o``." +msgstr "" +"Визначте, чи *o* містить *value*. Якщо елемент у *o* дорівнює *value*, " +"поверніть ``1``, інакше поверніть ``0``. У разі помилки повертає ``-1``. Це " +"еквівалентно виразу Python ``значення в o``." + +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 "" +"Повертає перший індекс *i*, для якого ``o[i] == значення``. У разі помилки " +"повертає ``-1``. Це еквівалентно виразу Python ``o.index(value)``." + +msgid "" +"Return a list object with the same contents as the sequence or iterable *o*, " +"or ``NULL`` on failure. The returned list is guaranteed to be new. This is " +"equivalent to the Python expression ``list(o)``." +msgstr "" +"Повертає об’єкт списку з тим же вмістом, що й послідовність або ітерація " +"*o*, або ``NULL`` у разі помилки. Повернений список гарантовано буде новим. " +"Це еквівалентно виразу Python ``list(o)``." + +msgid "" +"Return a tuple object with the same contents as the sequence or iterable " +"*o*, or ``NULL`` on failure. If *o* is a tuple, a new reference will be " +"returned, otherwise a tuple will be constructed with the appropriate " +"contents. This is equivalent to the Python expression ``tuple(o)``." +msgstr "" +"Повертає об’єкт кортежу з тим самим вмістом, що й послідовність або " +"повторюваний *o*, або ``NULL`` у разі помилки. Якщо *o* є кортежем, буде " +"повернуто нове посилання, інакше буде створено кортеж із відповідним " +"вмістом. Це еквівалентно виразу Python ``tuple(o)``." + +msgid "" +"Return the sequence or iterable *o* as an object usable by the other " +"``PySequence_Fast*`` family of functions. If the object is not a sequence or " +"iterable, raises :exc:`TypeError` with *m* as the message text. Returns " +"``NULL`` on failure." +msgstr "" +"Повертає послідовність або ітерацію *o* як об’єкт, який можна " +"використовувати іншою сім’єю функцій ``PySequence_Fast*``. Якщо об’єкт не є " +"послідовністю або ітерацією, викликає :exc:`TypeError` з *m* як текст " +"повідомлення. Повертає ``NULL`` у разі помилки." + +msgid "" +"The ``PySequence_Fast*`` functions are thus named because they assume *o* is " +"a :c:type:`PyTupleObject` or a :c:type:`PyListObject` and access the data " +"fields of *o* directly." +msgstr "" +"Функції ``PySequence_Fast*`` названо так, оскільки вони припускають, що *o* " +"є :c:type:`PyTupleObject` або :c:type:`PyListObject` і мають прямий доступ " +"до полів даних *o*." + +msgid "" +"As a CPython implementation detail, if *o* is already a sequence or list, it " +"will be returned." +msgstr "" +"Як деталь реалізації CPython, якщо *o* вже є послідовністю або списком, він " +"буде повернутий." + +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." +msgstr "" +"Повертає довжину *o*, припускаючи, що *o* було повернуто :c:func:" +"`PySequence_Fast` і що *o* не є ``NULL``. Розмір також можна отримати, " +"викликавши :c:func:`PySequence_Size` на *o*, але :c:func:" +"`PySequence_Fast_GET_SIZE` швидше, тому що він може припускати, що *o* є " +"списком або кортежем." + +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." +msgstr "" +"Повертає *i*\\-й елемент *o*, припускаючи, що *o* було повернуто :c:func:" +"`PySequence_Fast`, *o* не є ``NULL`` і що *i* знаходиться в межах." + +msgid "" +"Return the underlying array of PyObject pointers. Assumes that *o* was " +"returned by :c:func:`PySequence_Fast` and *o* is not ``NULL``." +msgstr "" +"Повертає базовий масив покажчиків PyObject. Припускає, що *o* було " +"повернуто :c:func:`PySequence_Fast` і *o* не є ``NULL``." + +msgid "" +"Note, if a list gets resized, the reallocation may relocate the items array. " +"So, only use the underlying array pointer in contexts where the sequence " +"cannot change." +msgstr "" +"Зверніть увагу: якщо розмір списку змінено, перерозподіл може перемістити " +"масив елементів. Отже, використовуйте покажчик базового масиву лише в " +"контекстах, де послідовність не може змінитися." + +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." +msgstr "" +"Повертає *i*\\-й елемент *o* або ``NULL`` у разі помилки. Швидша форма :c:" +"func:`PySequence_GetItem`, але без перевірки того, що :c:func:" +"`PySequence_Check` на *o* є істинним, і без коригування негативних індексів." + +msgid "built-in function" +msgstr "вбудована функція" + +msgid "len" +msgstr "" + +msgid "tuple" +msgstr "кортеж" diff --git a/c-api/set.po b/c-api/set.po new file mode 100644 index 000000000..f475a2c40 --- /dev/null +++ b/c-api/set.po @@ -0,0 +1,251 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Olga Tomakhina, 2022 +# Dmytro Kazanzhy, 2023 +# Yuliia Shevchenko, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:50+0000\n" +"Last-Translator: Yuliia Shevchenko, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Set Objects" +msgstr "Набір об'єктів" + +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`)." +msgstr "" +"У цьому розділі детально описано публічний API для об’єктів :class:`set` і :" +"class:`frozenset`. Будь-які функції, не перелічені нижче, найкраще отримати " +"доступ за допомогою протоколу абстрактних об’єктів (включно з :c:func:" +"`PyObject_CallMethod`, :c:func:`PyObject_RichCompareBool`, :c:func:" +"`PyObject_Hash`, :c:func:`PyObject_Repr`, :c:func:`PyObject_IsTrue`, :c:func:" +"`PyObject_Print` і :c:func:`PyObject_GetIter`) або протокол абстрактних " +"чисел (включно з :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`, і :c:func:" +"`PyNumber_InPlaceXor`)." + +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 " +"manipulating the values in the structure." +msgstr "" +"Цей підтип :c:type:`PyObject` використовується для зберігання внутрішніх " +"даних для об’єктів :class:`set` і :class:`frozenset`. Це схоже на :c:type:" +"`PyDictObject` тим, що він має фіксований розмір для невеликих наборів " +"(подібно до сховища кортежів) і вказуватиме на окремий блок пам’яті змінного " +"розміру для середніх і великих наборів (подібно списку зберігання). Жодне з " +"полів цієї структури не можна вважати відкритим, і всі можуть бути змінені. " +"Весь доступ має здійснюватися через задокументований API, а не шляхом " +"маніпулювання значеннями в структурі." + +msgid "" +"This is an instance of :c:type:`PyTypeObject` representing the Python :class:" +"`set` type." +msgstr "" +"Це екземпляр :c:type:`PyTypeObject`, що представляє тип :class:`set` Python." + +msgid "" +"This is an instance of :c:type:`PyTypeObject` representing the Python :class:" +"`frozenset` type." +msgstr "" +"Це екземпляр :c:type:`PyTypeObject`, що представляє тип :class:`frozenset` " +"Python." + +msgid "" +"The following type check macros work on pointers to any Python object. " +"Likewise, the constructor functions work with any iterable Python object." +msgstr "" +"Наступні макроси перевірки типу працюють з покажчиками на будь-який об’єкт " +"Python. Подібним чином функції конструктора працюють з будь-яким ітерованим " +"об’єктом Python." + +msgid "" +"Return true if *p* is a :class:`set` object or an instance of a subtype. " +"This function always succeeds." +msgstr "" +"Повертає true, якщо *p* є об’єктом :class:`set` або екземпляром підтипу. Ця " +"функція завжди успішна." + +msgid "" +"Return true if *p* is a :class:`frozenset` object or an instance of a " +"subtype. This function always succeeds." +msgstr "" +"Повертає true, якщо *p* є об’єктом :class:`frozenset` або екземпляром " +"підтипу. Ця функція завжди успішна." + +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 "" +"Повертає true, якщо *p* є об’єктом :class:`set`, об’єктом :class:`frozenset` " +"або екземпляром підтипу. Ця функція завжди успішна." + +msgid "" +"Return true if *p* is a :class:`set` object but not an instance of a " +"subtype. This function always succeeds." +msgstr "" +"Повертає true, якщо *p* є об’єктом :class:`set`, але не екземпляром підтипу. " +"Ця функція завжди успішна." + +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 "" +"Повертає true, якщо *p* є об’єктом :class:`set` або об’єктом :class:" +"`frozenset`, але не екземпляром підтипу. Ця функція завжди успішна." + +msgid "" +"Return true if *p* is a :class:`frozenset` object but not an instance of a " +"subtype. This function always succeeds." +msgstr "" +"Повертає true, якщо *p* є об’єктом :class:`frozenset`, але не є екземпляром " +"підтипу. Ця функція завжди успішна." + +msgid "" +"Return a new :class:`set` containing objects returned by the *iterable*. " +"The *iterable* may be ``NULL`` to create a new empty set. Return the new " +"set on success or ``NULL`` on failure. Raise :exc:`TypeError` if *iterable* " +"is not actually iterable. The constructor is also useful for copying a set " +"(``c=set(s)``)." +msgstr "" +"Повертає новий :class:`set`, що містить об’єкти, повернуті *iterable*. " +"*Iterable* може бути ``NULL`` для створення нового порожнього набору. " +"Повертає новий набір у разі успіху або ``NULL`` у разі невдачі. Викликати :" +"exc:`TypeError`, якщо *iterable* насправді не можна ітерувати. Конструктор " +"також корисний для копіювання набору (``c=set(s)``)." + +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." +msgstr "" +"Повертає новий :class:`frozenset`, що містить об’єкти, повернуті *iterable*. " +"*Iterable* може бути ``NULL`` для створення нового порожнього замороженого " +"набору. Повертає новий набір у разі успіху або ``NULL`` у разі невдачі. " +"Викликати :exc:`TypeError`, якщо *iterable* насправді не можна ітерувати." + +msgid "" +"The following functions and macros are available for instances of :class:" +"`set` or :class:`frozenset` or instances of their subtypes." +msgstr "" +"Наступні функції та макроси доступні для екземплярів :class:`set` або :class:" +"`frozenset` або екземплярів їхніх підтипів." + +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." +msgstr "" + +msgid "Macro form of :c:func:`PySet_Size` without error checking." +msgstr "Макроформа :c:func:`PySet_Size` без перевірки помилок." + +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." +msgstr "" + +msgid "" +"Add *key* to a :class:`set` instance. Also works with :class:`frozenset` " +"instances (like :c:func:`PyTuple_SetItem` it can be used to fill in the " +"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." +msgstr "" +"Додайте *key* до екземпляра :class:`set`. Також працює з екземплярами :class:" +"`frozenset` (наприклад, :c:func:`PyTuple_SetItem`, його можна " +"використовувати для заповнення значень абсолютно нових заморожених наборів " +"перед тим, як вони будуть представлені в іншому коді). Повертає ``0`` у разі " +"успіху або ``-1`` у разі невдачі. Викликати :exc:`TypeError`, якщо *ключ* не " +"хешується. Викликайте :exc:`MemoryError`, якщо немає місця для зростання. " +"Викликати :exc:`SystemError`, якщо *set* не є екземпляром :class:`set` або " +"його підтипу." + +msgid "" +"The following functions are available for instances of :class:`set` or its " +"subtypes but not for instances of :class:`frozenset` or its subtypes." +msgstr "" +"Наступні функції доступні для екземплярів :class:`set` або його підтипів, " +"але не для екземплярів :class:`frozenset` або його підтипів." + +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." +msgstr "" + +msgid "" +"Return a new reference to an arbitrary object in the *set*, and removes the " +"object from the *set*. Return ``NULL`` on failure. Raise :exc:`KeyError` " +"if the set is empty. Raise a :exc:`SystemError` if *set* is not an instance " +"of :class:`set` or its subtype." +msgstr "" +"Повертає нове посилання на довільний об’єкт у *set* та видаляє об’єкт із " +"*set*. Повертає ``NULL`` у разі помилки. Викликати :exc:`KeyError`, якщо " +"набір порожній. Викликати :exc:`SystemError`, якщо *set* не є екземпляром :" +"class:`set` або його підтипу." + +msgid "" +"Empty an existing set of all elements. Return ``0`` on success. Return " +"``-1`` and raise :exc:`SystemError` if *set* is not an instance of :class:" +"`set` or its subtype." +msgstr "" + +msgid "object" +msgstr "об'єкт" + +msgid "set" +msgstr "встановити" + +msgid "frozenset" +msgstr "" + +msgid "built-in function" +msgstr "вбудована функція" + +msgid "len" +msgstr "" diff --git a/c-api/slice.po b/c-api/slice.po new file mode 100644 index 000000000..118cfb16e --- /dev/null +++ b/c-api/slice.po @@ -0,0 +1,186 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:50+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Slice Objects" +msgstr "Об'єкти фрагментів" + +msgid "" +"The type object for slice objects. This is the same as :class:`slice` in " +"the Python layer." +msgstr "" +"Об’єкт типу для об’єктів фрагмента. Це те саме, що :class:`slice` на рівні " +"Python." + +msgid "" +"Return true if *ob* is a slice object; *ob* must not be ``NULL``. This " +"function always succeeds." +msgstr "" +"Повертає true, якщо *ob* є об’єктом фрагмента; *ob* не має бути ``NULL``. Ця " +"функція завжди успішна." + +msgid "" +"Return a new slice object with the given values. The *start*, *stop*, and " +"*step* parameters are used as the values of the slice object attributes of " +"the same names. Any of the values may be ``NULL``, in which case the " +"``None`` will be used for the corresponding attribute." +msgstr "" + +msgid "" +"Return ``NULL`` with an exception set if the new object could not be " +"allocated." +msgstr "" + +msgid "" +"Retrieve the start, stop and step indices from the slice object *slice*, " +"assuming a sequence of length *length*. Treats indices greater than *length* " +"as errors." +msgstr "" +"Отримати індекси початку, зупинки та кроку з об’єкта фрагмента *slice*, " +"припускаючи послідовність довжини *length*. Розглядає індекси, більші за " +"*length*, як помилки." + +msgid "" +"Returns ``0`` on success and ``-1`` on error with no exception set (unless " +"one of the indices was not ``None`` and failed to be converted to an " +"integer, in which case ``-1`` is returned with an exception set)." +msgstr "" + +msgid "You probably do not want to use this function." +msgstr "Ймовірно, ви не хочете використовувати цю функцію." + +msgid "" +"The parameter type for the *slice* parameter was ``PySliceObject*`` before." +msgstr "Раніше тип параметра для параметра *slice* був ``PySliceObject*``." + +msgid "" +"Usable replacement for :c:func:`PySlice_GetIndices`. Retrieve the start, " +"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." +msgstr "" +"Корисна заміна для :c:func:`PySlice_GetIndices`. Отримати індекси початку, " +"зупинки та кроку з об’єкта фрагмента *slice*, припускаючи послідовність " +"довжини *length*, і зберегти довжину фрагмента в *slicelength*. Індекси поза " +"межами обрізаються таким чином, що відповідає обробці звичайних фрагментів." + +msgid "Return ``0`` on success and ``-1`` on error with an exception set." +msgstr "" + +msgid "" +"This function is considered not safe for resizable sequences. Its invocation " +"should be replaced by a combination of :c:func:`PySlice_Unpack` and :c:func:" +"`PySlice_AdjustIndices` where ::" +msgstr "" +"Ця функція вважається небезпечною для послідовностей змінного розміру. Його " +"виклик слід замінити комбінацією :c:func:`PySlice_Unpack` і :c:func:" +"`PySlice_AdjustIndices`, де:" + +msgid "" +"if (PySlice_GetIndicesEx(slice, length, &start, &stop, &step, &slicelength) " +"< 0) {\n" +" // return error\n" +"}" +msgstr "" + +msgid "is replaced by ::" +msgstr "замінюється на ::" + +msgid "" +"if (PySlice_Unpack(slice, &start, &stop, &step) < 0) {\n" +" // return error\n" +"}\n" +"slicelength = PySlice_AdjustIndices(length, &start, &stop, step);" +msgstr "" + +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:`!" +"PySlice_GetIndicesEx` is implemented as a macro using :c:func:`!" +"PySlice_Unpack` and :c:func:`!PySlice_AdjustIndices`. Arguments *start*, " +"*stop* and *step* are evaluated more than once." +msgstr "" +"Якщо ``Py_LIMITED_API`` не встановлено або встановлено значення між " +"``0x03050400`` і ``0x03060000`` (не включаючи) або ``0x03060100`` або вище :" +"c:func:`!PySlice_GetIndicesEx` реалізовано як макрос із використанням :c:" +"func:`!PySlice_Unpack` і :c:func:`!PySlice_AdjustIndices`. Аргументи " +"*start*, *stop* і *step* обчислюються більше одного разу." + +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 "" +"Якщо для ``Py_LIMITED_API`` встановлено значення, менше ніж ``0x03050400`` " +"або між ``0x03060000`` і ``0x03060100`` (не включаючи) :c:func:`!" +"PySlice_GetIndicesEx` є застарілою функцією." + +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 " +"``PY_SSIZE_T_MAX``, silently boost the start and stop values less than " +"``PY_SSIZE_T_MIN`` to ``PY_SSIZE_T_MIN``, and silently boost the step values " +"less than ``-PY_SSIZE_T_MAX`` to ``-PY_SSIZE_T_MAX``." +msgstr "" +"Витягти елементи даних початку, зупинки та кроку з об’єкта зрізу як цілі " +"числа C. Безшумне зменшення значень, що перевищують ``PY_SSIZE_T_MAX``, до " +"``PY_SSIZE_T_MAX``, миттєве підвищення початкових і кінцевих значень, менших " +"за ``PY_SSIZE_T_MIN``, до ``PY_SSIZE_T_MIN``, і миттєве збільшення значень " +"кроку, менших за ``-PY_SSIZE_T_MAX`` до ``-PY_SSIZE_T_MAX``." + +msgid "Return ``-1`` with an exception set on error, ``0`` on success." +msgstr "" + +msgid "" +"Adjust start/end slice indices assuming a sequence of the specified length. " +"Out of bounds indices are clipped in a manner consistent with the handling " +"of normal slices." +msgstr "" +"Налаштуйте початкові/кінцеві індекси фрагментів, припускаючи послідовність " +"зазначеної довжини. Індекси поза межами обрізаються таким чином, що " +"відповідає обробці звичайних фрагментів." + +msgid "" +"Return the length of the slice. Always successful. Doesn't call Python " +"code." +msgstr "Повернути довжину зрізу. Завжди успішний. Не викликає код Python." + +msgid "Ellipsis Object" +msgstr "Еліпсис" + +msgid "" +"The type of Python :const:`Ellipsis` object. Same as :class:`types." +"EllipsisType` in the Python layer." +msgstr "" + +msgid "" +"The Python ``Ellipsis`` object. This object has no methods. Like :c:data:" +"`Py_None`, it is an :term:`immortal` singleton object." +msgstr "" + +msgid ":c:data:`Py_Ellipsis` is immortal." +msgstr "" diff --git a/c-api/stable.po b/c-api/stable.po new file mode 100644 index 000000000..950ee14c0 --- /dev/null +++ b/c-api/stable.po @@ -0,0 +1,334 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:50+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "C API Stability" +msgstr "Стабільність C API" + +msgid "" +"Unless documented otherwise, Python's C API is covered by the Backwards " +"Compatibility Policy, :pep:`387`. Most changes to it are source-compatible " +"(typically by only adding new API). Changing existing API or removing API is " +"only done after a deprecation period or to fix serious issues." +msgstr "" + +msgid "" +"CPython's Application Binary Interface (ABI) is forward- and backwards-" +"compatible across a minor release (if these are compiled the same way; see :" +"ref:`stable-abi-platform` below). So, code compiled for Python 3.10.0 will " +"work on 3.10.8 and vice versa, but will need to be compiled separately for " +"3.9.x and 3.11.x." +msgstr "" + +msgid "There are two tiers of C API with different stability expectations:" +msgstr "" + +msgid "" +":ref:`Unstable API `, may change in minor versions without a " +"deprecation period. It is marked by the ``PyUnstable`` prefix in names." +msgstr "" + +msgid "" +":ref:`Limited API `, is compatible across several minor " +"releases. When :c:macro:`Py_LIMITED_API` is defined, only this subset is " +"exposed from ``Python.h``." +msgstr "" + +msgid "These are discussed in more detail below." +msgstr "" + +msgid "" +"Names prefixed by an underscore, such as ``_Py_InternalState``, are private " +"API that can change without notice even in patch releases. If you need to " +"use this API, consider reaching out to `CPython developers `_ to discuss adding public API for your use " +"case." +msgstr "" + +msgid "Unstable C API" +msgstr "" + +msgid "" +"Any API named with the ``PyUnstable`` prefix exposes CPython implementation " +"details, and may change in every minor release (e.g. from 3.9 to 3.10) " +"without any deprecation warnings. However, it will not change in a bugfix " +"release (e.g. from 3.10.0 to 3.10.1)." +msgstr "" + +msgid "" +"It is generally intended for specialized, low-level tools like debuggers." +msgstr "" + +msgid "" +"Projects that use this API are expected to follow CPython development and " +"spend extra effort adjusting to changes." +msgstr "" + +msgid "Stable Application Binary Interface" +msgstr "Стабільний бінарний інтерфейс програми" + +msgid "" +"For simplicity, this document talks about *extensions*, but the Limited API " +"and Stable ABI work the same way for all uses of the API – for example, " +"embedding Python." +msgstr "" + +msgid "Limited C API" +msgstr "" + +msgid "" +"Python 3.2 introduced the *Limited API*, a subset of Python's C API. " +"Extensions that only use the Limited API can be compiled once and be loaded " +"on multiple versions of Python. Contents of the Limited API are :ref:`listed " +"below `." +msgstr "" + +msgid "" +"Define this macro before including ``Python.h`` to opt in to only use the " +"Limited API, and to select the Limited API version." +msgstr "" +"Визначте цей макрос, перш ніж включати ``Python.h``, щоб увімкнути " +"використання лише обмеженого API та вибрати обмежену версію API." + +msgid "" +"Define ``Py_LIMITED_API`` to the value of :c:macro:`PY_VERSION_HEX` " +"corresponding to the lowest Python version your extension supports. The " +"extension will be ABI-compatible with all Python 3 releases from the " +"specified one onward, and can use Limited API introduced up to that version." +msgstr "" + +msgid "" +"Rather than using the ``PY_VERSION_HEX`` macro directly, hardcode a minimum " +"minor version (e.g. ``0x030A0000`` for Python 3.10) for stability when " +"compiling with future Python versions." +msgstr "" +"Замість безпосереднього використання макросу ``PY_VERSION_HEX`` жорстко " +"закодуйте мінімальну проміжну версію (наприклад, ``0x030A0000`` для Python " +"3.10) для стабільності під час компіляції з майбутніми версіями Python." + +msgid "" +"You can also define ``Py_LIMITED_API`` to ``3``. This works the same as " +"``0x03020000`` (Python 3.2, the version that introduced Limited API)." +msgstr "" +"Ви також можете визначити ``Py_LIMITED_API`` як ``3``. Це працює так само, " +"як ``0x03020000`` (Python 3.2, версія, яка представила Limited API)." + +msgid "Stable ABI" +msgstr "" + +msgid "" +"To enable this, Python provides a *Stable ABI*: a set of symbols that will " +"remain ABI-compatible across Python 3.x versions." +msgstr "" + +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 "" + +msgid "" +"The Stable ABI contains symbols exposed in the :ref:`Limited API `, but also other ones – for example, functions necessary to support " +"older versions of the Limited API." +msgstr "" + +msgid "" +"On Windows, extensions that use the Stable ABI should be linked against " +"``python3.dll`` rather than a version-specific library such as ``python39." +"dll``." +msgstr "" +"У Windows розширення, які використовують стабільний ABI, слід пов’язувати з " +"``python3.dll``, а не з бібліотекою для певної версії, такою як ``python39." +"dll``." + +msgid "" +"On some platforms, Python will look for and load shared library files named " +"with the ``abi3`` tag (e.g. ``mymodule.abi3.so``). It does not check if such " +"extensions conform to a Stable ABI. The user (or their packaging tools) need " +"to ensure that, for example, extensions built with the 3.10+ Limited API are " +"not installed for lower versions of Python." +msgstr "" +"На деяких платформах Python шукатиме та завантажуватиме спільні бібліотечні " +"файли, названі тегом ``abi3`` (наприклад, ``mymodule.abi3.so``). Він не " +"перевіряє, чи такі розширення відповідають стабільному ABI. Користувач (або " +"його інструменти пакування) повинні переконатися, що, наприклад, розширення, " +"створені за допомогою обмеженого API 3.10+, не встановлено для нижчих версій " +"Python." + +msgid "" +"All functions in the Stable ABI are present as functions in Python's shared " +"library, not solely as macros. This makes them usable from languages that " +"don't use the C preprocessor." +msgstr "" +"Усі функції в Stable ABI присутні як функції в спільній бібліотеці Python, а " +"не лише як макроси. Це робить їх придатними для використання з мов, які не " +"використовують препроцесор C." + +msgid "Limited API Scope and Performance" +msgstr "Обмежений обсяг і продуктивність API" + +msgid "" +"The goal for the Limited API is to allow everything that is possible with " +"the full C API, but possibly with a performance penalty." +msgstr "" +"Мета обмеженого API полягає в тому, щоб дозволити все, що можливо з повним " +"API C, але, можливо, зі зниженням продуктивності." + +msgid "" +"For example, while :c:func:`PyList_GetItem` is available, its “unsafe” macro " +"variant :c:func:`PyList_GET_ITEM` is not. The macro can be faster because it " +"can rely on version-specific implementation details of the list object." +msgstr "" +"Наприклад, хоча :c:func:`PyList_GetItem` доступний, його \"небезпечний\" " +"варіант макросу :c:func:`PyList_GET_ITEM` ні. Макрос може бути швидшим, " +"оскільки він може покладатися на специфічні для версії деталі реалізації " +"об’єкта списку." + +msgid "" +"Without ``Py_LIMITED_API`` defined, some C API functions are inlined or " +"replaced by macros. Defining ``Py_LIMITED_API`` disables this inlining, " +"allowing stability as Python's data structures are improved, but possibly " +"reducing performance." +msgstr "" +"Без визначення ``Py_LIMITED_API`` деякі функції C API вбудовані або замінені " +"макросами. Визначення ``Py_LIMITED_API`` вимикає це вбудовування, " +"забезпечуючи стабільність у міру вдосконалення структур даних Python, але, " +"можливо, знижуючи продуктивність." + +msgid "" +"By leaving out the ``Py_LIMITED_API`` definition, it is possible to compile " +"a Limited API extension with a version-specific ABI. This can improve " +"performance for that Python version, but will limit compatibility. Compiling " +"with ``Py_LIMITED_API`` will then yield an extension that can be distributed " +"where a version-specific one is not available – for example, for prereleases " +"of an upcoming Python version." +msgstr "" +"Виключивши визначення ``Py_LIMITED_API``, можна скомпілювати обмежене " +"розширення API із спеціальним ABI для версії. Це може покращити " +"продуктивність цієї версії Python, але обмежить сумісність. Компіляція за " +"допомогою ``Py_LIMITED_API`` дасть розширення, яке можна розповсюджувати " +"там, де недоступне розширення для конкретної версії – наприклад, для " +"попередніх версій майбутньої версії Python." + +msgid "Limited API Caveats" +msgstr "Обмежені застереження щодо API" + +msgid "" +"Note that compiling with ``Py_LIMITED_API`` is *not* a complete guarantee " +"that code conforms to the :ref:`Limited API ` or the :ref:" +"`Stable ABI `. ``Py_LIMITED_API`` only covers definitions, but " +"an API also includes other issues, such as expected semantics." +msgstr "" + +msgid "" +"One issue that ``Py_LIMITED_API`` does not guard against is calling a " +"function with arguments that are invalid in a lower Python version. For " +"example, consider a function that starts accepting ``NULL`` for an argument. " +"In Python 3.9, ``NULL`` now selects a default behavior, but in Python 3.8, " +"the argument will be used directly, causing a ``NULL`` dereference and " +"crash. A similar argument works for fields of structs." +msgstr "" +"Одна проблема, від якої ``Py_LIMITED_API`` не захищає, це виклик функції з " +"аргументами, які недійсні в старішій версії Python. Наприклад, розглянемо " +"функцію, яка починає приймати ``NULL`` для аргументу. У Python 3.9 ``NULL`` " +"тепер вибирає поведінку за замовчуванням, але в Python 3.8 аргумент " +"використовуватиметься безпосередньо, спричиняючи розіменування ``NULL`` і " +"збій. Подібний аргумент працює для полів структур." + +msgid "" +"Another issue is that some struct fields are currently not hidden when " +"``Py_LIMITED_API`` is defined, even though they're part of the Limited API." +msgstr "" +"Інша проблема полягає в тому, що деякі поля структури наразі не приховані, " +"коли визначено ``Py_LIMITED_API``, навіть якщо вони є частиною обмеженого " +"API." + +msgid "" +"For these reasons, we recommend testing an extension with *all* minor Python " +"versions it supports, and preferably to build with the *lowest* such version." +msgstr "" +"З цих причин ми рекомендуємо тестувати розширення з *усіма* проміжними " +"версіями Python, які воно підтримує, і бажано створювати з *найнижчою* такою " +"версією." + +msgid "" +"We also recommend reviewing documentation of all used API to check if it is " +"explicitly part of the Limited API. Even with ``Py_LIMITED_API`` defined, a " +"few private declarations are exposed for technical reasons (or even " +"unintentionally, as bugs)." +msgstr "" +"Ми також рекомендуємо переглянути документацію щодо всіх використовуваних " +"API, щоб перевірити, чи вони є частиною обмеженого API. Навіть якщо " +"визначено ``Py_LIMITED_API``, кілька приватних заяв виявляються з технічних " +"причин (або навіть ненавмисно, як помилки)." + +msgid "" +"Also note that the Limited API is not necessarily stable: compiling with " +"``Py_LIMITED_API`` with Python 3.8 means that the extension will run with " +"Python 3.12, but it will not necessarily *compile* with Python 3.12. In " +"particular, parts of the Limited API may be deprecated and removed, provided " +"that the Stable ABI stays stable." +msgstr "" +"Також зауважте, що обмежений API не обов’язково є стабільним: компіляція за " +"допомогою ``Py_LIMITED_API`` з Python 3.8 означає, що розширення працюватиме " +"з Python 3.12, але воно не обов’язково *компілюється* з Python 3.12. " +"Зокрема, частини обмеженого API можуть бути застарілими та видалені за " +"умови, що стабільний ABI залишається стабільним." + +msgid "Platform Considerations" +msgstr "Розгляд платформи" + +msgid "" +"ABI stability depends not only on Python, but also on the compiler used, " +"lower-level libraries and compiler options. For the purposes of the :ref:" +"`Stable ABI `, these details define a “platform”. They usually " +"depend on the OS type and processor architecture" +msgstr "" + +msgid "" +"It is the responsibility of each particular distributor of Python to ensure " +"that all Python versions on a particular platform are built in a way that " +"does not break the Stable ABI. This is the case with Windows and macOS " +"releases from ``python.org`` and many third-party distributors." +msgstr "" +"Кожен окремий розповсюджувач Python несе відповідальність за те, щоб усі " +"версії Python на певній платформі створювалися таким чином, щоб не " +"порушувати стабільний ABI. Це стосується випусків Windows і macOS від " +"``python.org`` і багатьох сторонніх розповсюджувачів." + +msgid "Contents of Limited API" +msgstr "Вміст обмеженого API" + +msgid "" +"Currently, the :ref:`Limited API ` includes the following " +"items:" +msgstr "" + +msgid "PyUnstable" +msgstr "" diff --git a/c-api/structures.po b/c-api/structures.po new file mode 100644 index 000000000..7af8f97bc --- /dev/null +++ b/c-api/structures.po @@ -0,0 +1,892 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2023 +# Yuliia Shevchenko, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:50+0000\n" +"Last-Translator: Yuliia Shevchenko, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Common Object Structures" +msgstr "Загальні структури об'єктів" + +msgid "" +"There are a large number of structures which are used in the definition of " +"object types for Python. This section describes these structures and how " +"they are used." +msgstr "" +"Існує велика кількість структур, які використовуються для визначення типів " +"об’єктів для Python. У цьому розділі описано ці структури та як вони " +"використовуються." + +msgid "Base object types and macros" +msgstr "Базові типи об'єктів і макроси" + +msgid "" +"All Python objects ultimately share a small number of fields at the " +"beginning of the object's representation in memory. These are represented " +"by the :c:type:`PyObject` and :c:type:`PyVarObject` types, which are " +"defined, in turn, by the expansions of some macros also used, whether " +"directly or indirectly, in the definition of all other Python objects. " +"Additional macros can be found under :ref:`reference counting " +"`." +msgstr "" + +msgid "" +"All object types are extensions of this type. This is a type which contains " +"the information Python needs to treat a pointer to an object as an object. " +"In a normal \"release\" build, it contains only the object's reference count " +"and a pointer to the corresponding type object. Nothing is actually declared " +"to be a :c:type:`PyObject`, but every pointer to a Python object can be cast " +"to a :c:expr:`PyObject*`. Access to the members must be done by using the " +"macros :c:macro:`Py_REFCNT` and :c:macro:`Py_TYPE`." +msgstr "" + +msgid "" +"This is an extension of :c:type:`PyObject` that adds the :c:member:" +"`~PyVarObject.ob_size` field. This is only used for objects that have some " +"notion of *length*. This type does not often appear in the Python/C API. " +"Access to the members must be done by using the macros :c:macro:" +"`Py_REFCNT`, :c:macro:`Py_TYPE`, and :c:macro:`Py_SIZE`." +msgstr "" + +msgid "" +"This is a macro used when declaring new types which represent objects " +"without a varying length. The PyObject_HEAD macro expands to::" +msgstr "" +"Це макрос, який використовується під час оголошення нових типів, які " +"представляють об’єкти без змінної довжини. Макрос PyObject_HEAD розширюється " +"до:" + +msgid "PyObject ob_base;" +msgstr "" + +msgid "See documentation of :c:type:`PyObject` above." +msgstr "Перегляньте документацію :c:type:`PyObject` вище." + +msgid "" +"This is a macro used when declaring new types which represent objects with a " +"length that varies from instance to instance. The PyObject_VAR_HEAD macro " +"expands to::" +msgstr "" +"Це макрос, який використовується під час оголошення нових типів, які " +"представляють об’єкти з довжиною, що змінюється від екземпляра до " +"екземпляра. Макрос PyObject_VAR_HEAD розширюється до:" + +msgid "PyVarObject ob_base;" +msgstr "" + +msgid "See documentation of :c:type:`PyVarObject` above." +msgstr "Перегляньте документацію :c:type:`PyVarObject` вище." + +msgid "" +"The base class of all other objects, the same as :class:`object` in Python." +msgstr "" + +msgid "" +"Test if the *x* object is the *y* object, the same as ``x is y`` in Python." +msgstr "" +"Перевірте, чи є об’єкт *x* об’єктом *y*, так само як \"x є y\" в Python." + +msgid "" +"Test if an object is the ``None`` singleton, the same as ``x is None`` in " +"Python." +msgstr "" +"Перевірте, чи є об’єкт єдиним елементом ``None``, так само як ``x is None`` " +"у Python." + +msgid "" +"Test if an object is the ``True`` singleton, the same as ``x is True`` in " +"Python." +msgstr "" +"Перевірте, чи є об’єкт єдиним елементом ``True``, так само, як ``x is True`` " +"у Python." + +msgid "" +"Test if an object is the ``False`` singleton, the same as ``x is False`` in " +"Python." +msgstr "" +"Перевірте, чи є об’єкт синглетом ``False``, так само, як ``x is False`` у " +"Python." + +msgid "Get the type of the Python object *o*." +msgstr "Отримайте тип об'єкта Python *o*." + +msgid "Return a :term:`borrowed reference`." +msgstr "Повертає :term:`borrowed reference`." + +msgid "Use the :c:func:`Py_SET_TYPE` function to set an object type." +msgstr "" + +msgid "" +":c:func:`Py_TYPE()` is changed to an inline static function. The parameter " +"type is no longer :c:expr:`const PyObject*`." +msgstr "" + +msgid "" +"Return non-zero if the object *o* type is *type*. Return zero otherwise. " +"Equivalent to: ``Py_TYPE(o) == type``." +msgstr "" +"Повертає ненульове значення, якщо тип об’єкта *o* є *type*. Інакше поверніть " +"нуль. Еквівалент: ``Py_TYPE(o) == type``." + +msgid "Set the object *o* type to *type*." +msgstr "Встановіть тип об’єкта *o* на *type*." + +msgid "Get the size of the Python object *o*." +msgstr "Отримайте розмір об'єкта Python *o*." + +msgid "Use the :c:func:`Py_SET_SIZE` function to set an object size." +msgstr "" + +msgid "" +":c:func:`Py_SIZE()` is changed to an inline static function. The parameter " +"type is no longer :c:expr:`const PyVarObject*`." +msgstr "" + +msgid "Set the object *o* size to *size*." +msgstr "Встановіть розмір об’єкта *o* на *size*." + +msgid "" +"This is a macro which expands to initialization values for a new :c:type:" +"`PyObject` type. This macro expands to::" +msgstr "" +"Це макрос, який розширюється до значень ініціалізації для нового типу :c:" +"type:`PyObject`. Цей макрос розширюється до:" + +msgid "" +"_PyObject_EXTRA_INIT\n" +"1, type," +msgstr "" + +msgid "" +"This is a macro which expands to initialization values for a new :c:type:" +"`PyVarObject` type, including the :c:member:`~PyVarObject.ob_size` field. " +"This macro expands to::" +msgstr "" + +msgid "" +"_PyObject_EXTRA_INIT\n" +"1, type, size," +msgstr "" + +msgid "Implementing functions and methods" +msgstr "Реалізація функцій і методів" + +msgid "" +"Type of the functions used to implement most Python callables in C. " +"Functions of this type take two :c:expr:`PyObject*` parameters and return " +"one such value. If the return value is ``NULL``, an exception shall have " +"been set. If not ``NULL``, the return value is interpreted as the return " +"value of the function as exposed in Python. The function must return a new " +"reference." +msgstr "" + +msgid "The function signature is::" +msgstr "Сигнатура функції:" + +msgid "" +"PyObject *PyCFunction(PyObject *self,\n" +" PyObject *args);" +msgstr "" + +msgid "" +"Type of the functions used to implement Python callables in C with " +"signature :ref:`METH_VARARGS | METH_KEYWORDS `. " +"The function signature is::" +msgstr "" + +msgid "" +"PyObject *PyCFunctionWithKeywords(PyObject *self,\n" +" PyObject *args,\n" +" PyObject *kwargs);" +msgstr "" + +msgid "" +"Type of the functions used to implement Python callables in C with " +"signature :c:macro:`METH_FASTCALL`. The function signature is::" +msgstr "" + +msgid "" +"PyObject *PyCFunctionFast(PyObject *self,\n" +" PyObject *const *args,\n" +" Py_ssize_t nargs);" +msgstr "" + +msgid "" +"Type of the functions used to implement Python callables in C with " +"signature :ref:`METH_FASTCALL | METH_KEYWORDS `. The function signature is::" +msgstr "" + +msgid "" +"PyObject *PyCFunctionFastWithKeywords(PyObject *self,\n" +" PyObject *const *args,\n" +" Py_ssize_t nargs,\n" +" PyObject *kwnames);" +msgstr "" + +msgid "" +"Type of the functions used to implement Python callables in C with " +"signature :ref:`METH_METHOD | METH_FASTCALL | METH_KEYWORDS `. The function signature is::" +msgstr "" + +msgid "" +"PyObject *PyCMethod(PyObject *self,\n" +" PyTypeObject *defining_class,\n" +" PyObject *const *args,\n" +" Py_ssize_t nargs,\n" +" PyObject *kwnames)" +msgstr "" + +msgid "" +"Structure used to describe a method of an extension type. This structure " +"has four fields:" +msgstr "" +"Структура, що використовується для опису методу типу розширення. Ця " +"структура має чотири поля:" + +msgid "Name of the method." +msgstr "" + +msgid "Pointer to the C implementation." +msgstr "" + +msgid "Flags bits indicating how the call should be constructed." +msgstr "" + +msgid "Points to the contents of the docstring." +msgstr "" + +msgid "" +"The :c:member:`~PyMethodDef.ml_meth` is a C function pointer. The functions " +"may be of different types, but they always return :c:expr:`PyObject*`. If " +"the function is not of the :c:type:`PyCFunction`, the compiler will require " +"a cast in the method table. Even though :c:type:`PyCFunction` defines the " +"first parameter as :c:expr:`PyObject*`, it is common that the method " +"implementation uses the specific C type of the *self* object." +msgstr "" + +msgid "" +"The :c:member:`~PyMethodDef.ml_flags` field is a bitfield which can include " +"the following flags. The individual flags indicate either a calling " +"convention or a binding convention." +msgstr "" + +msgid "There are these calling conventions:" +msgstr "Існують такі умови виклику:" + +msgid "" +"This is the typical calling convention, where the methods have the type :c:" +"type:`PyCFunction`. The function expects two :c:expr:`PyObject*` values. The " +"first one is the *self* object for methods; for module functions, it is the " +"module object. The second parameter (often called *args*) is a tuple object " +"representing all arguments. This parameter is typically processed using :c:" +"func:`PyArg_ParseTuple` or :c:func:`PyArg_UnpackTuple`." +msgstr "" + +msgid "" +"Can only be used in certain combinations with other flags: :ref:" +"`METH_VARARGS | METH_KEYWORDS `, :ref:" +"`METH_FASTCALL | METH_KEYWORDS ` and :ref:" +"`METH_METHOD | METH_FASTCALL | METH_KEYWORDS `." +msgstr "" + +msgid ":c:expr:`METH_VARARGS | METH_KEYWORDS`" +msgstr "" + +msgid "" +"Methods with these flags must be of type :c:type:`PyCFunctionWithKeywords`. " +"The function expects three parameters: *self*, *args*, *kwargs* where " +"*kwargs* is a dictionary of all the keyword arguments or possibly ``NULL`` " +"if there are no keyword arguments. The parameters are typically processed " +"using :c:func:`PyArg_ParseTupleAndKeywords`." +msgstr "" +"Методи з цими прапорцями мають бути типу :c:type:`PyCFunctionWithKeywords`. " +"Функція очікує три параметри: *self*, *args*, *kwargs*, де *kwargs* є " +"словником усіх аргументів ключового слова або, можливо, ``NULL``, якщо " +"аргументів ключового слова немає. Параметри зазвичай обробляються за " +"допомогою :c:func:`PyArg_ParseTupleAndKeywords`." + +msgid "" +"Fast calling convention supporting only positional arguments. The methods " +"have the type :c:type:`PyCFunctionFast`. The first parameter is *self*, the " +"second parameter is a C array of :c:expr:`PyObject*` values indicating the " +"arguments and the third parameter is the number of arguments (the length of " +"the array)." +msgstr "" + +msgid "``METH_FASTCALL`` is now part of the :ref:`stable ABI `." +msgstr "" + +msgid ":c:expr:`METH_FASTCALL | METH_KEYWORDS`" +msgstr "" + +msgid "" +"Extension of :c:macro:`METH_FASTCALL` supporting also keyword arguments, " +"with methods of type :c:type:`PyCFunctionFastWithKeywords`. Keyword " +"arguments are passed the same way as in the :ref:`vectorcall protocol " +"`: there is an additional fourth :c:expr:`PyObject*` parameter " +"which is a tuple representing the names of the keyword arguments (which are " +"guaranteed to be strings) or possibly ``NULL`` if there are no keywords. " +"The values of the keyword arguments are stored in the *args* array, after " +"the positional arguments." +msgstr "" + +msgid "" +"Can only be used in the combination with other flags: :ref:`METH_METHOD | " +"METH_FASTCALL | METH_KEYWORDS `." +msgstr "" + +msgid ":c:expr:`METH_METHOD | METH_FASTCALL | METH_KEYWORDS`" +msgstr "" + +msgid "" +"Extension of :ref:`METH_FASTCALL | METH_KEYWORDS ` supporting the *defining class*, that is, the class that " +"contains the method in question. The defining class might be a superclass of " +"``Py_TYPE(self)``." +msgstr "" + +msgid "" +"The method needs to be of type :c:type:`PyCMethod`, the same as for " +"``METH_FASTCALL | METH_KEYWORDS`` with ``defining_class`` argument added " +"after ``self``." +msgstr "" +"Метод має мати тип :c:type:`PyCMethod`, такий самий, як і для " +"``METH_FASTCALL | METH_KEYWORDS`` з аргументом ``defining_class``, доданим " +"після ``self``." + +msgid "" +"Methods without parameters don't need to check whether arguments are given " +"if they are listed with the :c:macro:`METH_NOARGS` flag. They need to be of " +"type :c:type:`PyCFunction`. The first parameter is typically named *self* " +"and will hold a reference to the module or object instance. In all cases " +"the second parameter will be ``NULL``." +msgstr "" + +msgid "" +"The function must have 2 parameters. Since the second parameter is unused, :" +"c:macro:`Py_UNUSED` can be used to prevent a compiler warning." +msgstr "" + +msgid "" +"Methods with a single object argument can be listed with the :c:macro:" +"`METH_O` flag, instead of invoking :c:func:`PyArg_ParseTuple` with a " +"``\"O\"`` argument. They have the type :c:type:`PyCFunction`, with the " +"*self* parameter, and a :c:expr:`PyObject*` parameter representing the " +"single argument." +msgstr "" + +msgid "" +"These two constants are not used to indicate the calling convention but the " +"binding when use with methods of classes. These may not be used for " +"functions defined for modules. At most one of these flags may be set for " +"any given method." +msgstr "" +"Ці дві константи не використовуються для вказівки умов виклику, а для " +"прив’язки під час використання з методами класів. Їх не можна " +"використовувати для функцій, визначених для модулів. Щонайбільше один із цих " +"прапорів може бути встановлений для будь-якого методу." + +msgid "" +"The method will be passed the type object as the first parameter rather than " +"an instance of the type. This is used to create *class methods*, similar to " +"what is created when using the :func:`classmethod` built-in function." +msgstr "" +"Методу буде передано об’єкт типу як перший параметр, а не екземпляр типу. Це " +"використовується для створення *методів класу*, подібних до того, що " +"створюється під час використання вбудованої функції :func:`classmethod`." + +msgid "" +"The method will be passed ``NULL`` as the first parameter rather than an " +"instance of the type. This is used to create *static methods*, similar to " +"what is created when using the :func:`staticmethod` built-in function." +msgstr "" +"Методу буде передано ``NULL`` як перший параметр, а не екземпляр типу. Це " +"використовується для створення *статичних методів*, подібних до того, що " +"створюється під час використання вбудованої функції :func:`staticmethod`." + +msgid "" +"One other constant controls whether a method is loaded in place of another " +"definition with the same method name." +msgstr "" +"Ще одна константа контролює, чи завантажується метод замість іншого " +"визначення з таким же ім’ям методу." + +msgid "" +"The method will be loaded in place of existing definitions. Without " +"*METH_COEXIST*, the default is to skip repeated definitions. Since slot " +"wrappers are loaded before the method table, the existence of a " +"*sq_contains* slot, for example, would generate a wrapped method named :meth:" +"`~object.__contains__` and preclude the loading of a corresponding " +"PyCFunction with the same name. With the flag defined, the PyCFunction will " +"be loaded in place of the wrapper object and will co-exist with the slot. " +"This is helpful because calls to PyCFunctions are optimized more than " +"wrapper object calls." +msgstr "" + +msgid "" +"Turn *ml* into a Python :term:`callable` object. The caller must ensure that " +"*ml* outlives the :term:`callable`. Typically, *ml* is defined as a static " +"variable." +msgstr "" + +msgid "" +"The *self* parameter will be passed as the *self* argument to the C function " +"in ``ml->ml_meth`` when invoked. *self* can be ``NULL``." +msgstr "" + +msgid "" +"The :term:`callable` object's ``__module__`` attribute can be set from the " +"given *module* argument. *module* should be a Python string, which will be " +"used as name of the module the function is defined in. If unavailable, it " +"can be set to :const:`None` or ``NULL``." +msgstr "" + +msgid ":attr:`function.__module__`" +msgstr "" + +msgid "" +"The *cls* parameter will be passed as the *defining_class* argument to the C " +"function. Must be set if :c:macro:`METH_METHOD` is set on ``ml->ml_flags``." +msgstr "" + +msgid "Equivalent to ``PyCMethod_New(ml, self, module, NULL)``." +msgstr "" + +msgid "Equivalent to ``PyCMethod_New(ml, self, NULL, NULL)``." +msgstr "" + +msgid "Accessing attributes of extension types" +msgstr "Доступ до атрибутів типів розширень" + +msgid "" +"Structure which describes an attribute of a type which corresponds to a C " +"struct member. When defining a class, put a NULL-terminated array of these " +"structures in the :c:member:`~PyTypeObject.tp_members` slot." +msgstr "" + +msgid "Its fields are, in order:" +msgstr "" + +msgid "" +"Name of the member. A NULL value marks the end of a ``PyMemberDef[]`` array." +msgstr "" + +msgid "The string should be static, no copy is made of it." +msgstr "" + +msgid "" +"The type of the member in the C struct. See :ref:`PyMemberDef-types` for the " +"possible values." +msgstr "" + +msgid "" +"The offset in bytes that the member is located on the type’s object struct." +msgstr "" + +msgid "" +"Zero or more of the :ref:`PyMemberDef-flags`, combined using bitwise OR." +msgstr "" + +msgid "" +"The docstring, or NULL. The string should be static, no copy is made of it. " +"Typically, it is defined using :c:macro:`PyDoc_STR`." +msgstr "" + +msgid "" +"By default (when :c:member:`~PyMemberDef.flags` is ``0``), members allow " +"both read and write access. Use the :c:macro:`Py_READONLY` flag for read-" +"only access. Certain types, like :c:macro:`Py_T_STRING`, imply :c:macro:" +"`Py_READONLY`. Only :c:macro:`Py_T_OBJECT_EX` (and legacy :c:macro:" +"`T_OBJECT`) members can be deleted." +msgstr "" + +msgid "" +"For heap-allocated types (created using :c:func:`PyType_FromSpec` or " +"similar), ``PyMemberDef`` may contain a definition for the special member " +"``\"__vectorcalloffset__\"``, corresponding to :c:member:`~PyTypeObject." +"tp_vectorcall_offset` in type objects. These must be defined with " +"``Py_T_PYSSIZET`` and ``Py_READONLY``, for example::" +msgstr "" + +msgid "" +"static PyMemberDef spam_type_members[] = {\n" +" {\"__vectorcalloffset__\", Py_T_PYSSIZET,\n" +" offsetof(Spam_object, vectorcall), Py_READONLY},\n" +" {NULL} /* Sentinel */\n" +"};" +msgstr "" + +msgid "(You may need to ``#include `` for :c:func:`!offsetof`.)" +msgstr "" + +msgid "" +"The legacy offsets :c:member:`~PyTypeObject.tp_dictoffset` and :c:member:" +"`~PyTypeObject.tp_weaklistoffset` can be defined similarly using " +"``\"__dictoffset__\"`` and ``\"__weaklistoffset__\"`` members, but " +"extensions are strongly encouraged to use :c:macro:`Py_TPFLAGS_MANAGED_DICT` " +"and :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` instead." +msgstr "" + +msgid "" +"``PyMemberDef`` is always available. Previously, it required including " +"``\"structmember.h\"``." +msgstr "" + +msgid "" +"Get an attribute belonging to the object at address *obj_addr*. The " +"attribute is described by ``PyMemberDef`` *m*. Returns ``NULL`` on error." +msgstr "" +"Отримати атрибут, що належить об’єкту за адресою *obj_addr*. Атрибут " +"описується ``PyMemberDef`` *m*. Повертає ``NULL`` у разі помилки." + +msgid "" +"``PyMember_GetOne`` is always available. Previously, it required including " +"``\"structmember.h\"``." +msgstr "" + +msgid "" +"Set an attribute belonging to the object at address *obj_addr* to object " +"*o*. The attribute to set is described by ``PyMemberDef`` *m*. Returns " +"``0`` if successful and a negative value on failure." +msgstr "" +"Установіть атрибут, що належить об’єкту за адресою *obj_addr*, на об’єкт " +"*o*. Атрибут, який потрібно встановити, описується ``PyMemberDef`` *m*. " +"Повертає ``0`` у разі успіху та від'ємне значення у випадку невдачі." + +msgid "" +"``PyMember_SetOne`` is always available. Previously, it required including " +"``\"structmember.h\"``." +msgstr "" + +msgid "Member flags" +msgstr "" + +msgid "The following flags can be used with :c:member:`PyMemberDef.flags`:" +msgstr "" + +msgid "Not writable." +msgstr "" + +msgid "" +"Emit an ``object.__getattr__`` :ref:`audit event ` before " +"reading." +msgstr "" + +msgid "" +"Indicates that the :c:member:`~PyMemberDef.offset` of this ``PyMemberDef`` " +"entry indicates an offset from the subclass-specific data, rather than from " +"``PyObject``." +msgstr "" + +msgid "" +"Can only be used as part of :c:member:`Py_tp_members ` :c:type:`slot ` when creating a class using " +"negative :c:member:`~PyType_Spec.basicsize`. It is mandatory in that case." +msgstr "" + +msgid "" +"This flag is only used in :c:type:`PyType_Slot`. When setting :c:member:" +"`~PyTypeObject.tp_members` during class creation, Python clears it and sets :" +"c:member:`PyMemberDef.offset` to the offset from the ``PyObject`` struct." +msgstr "" + +msgid "" +"The :c:macro:`!RESTRICTED`, :c:macro:`!READ_RESTRICTED` and :c:macro:`!" +"WRITE_RESTRICTED` macros available with ``#include \"structmember.h\"`` are " +"deprecated. :c:macro:`!READ_RESTRICTED` and :c:macro:`!RESTRICTED` are " +"equivalent to :c:macro:`Py_AUDIT_READ`; :c:macro:`!WRITE_RESTRICTED` does " +"nothing." +msgstr "" + +msgid "" +"The :c:macro:`!READONLY` macro was renamed to :c:macro:`Py_READONLY`. The :c:" +"macro:`!PY_AUDIT_READ` macro was renamed with the ``Py_`` prefix. The new " +"names are now always available. Previously, these required ``#include " +"\"structmember.h\"``. The header is still available and it provides the old " +"names." +msgstr "" + +msgid "Member types" +msgstr "" + +msgid "" +":c:member:`PyMemberDef.type` can be one of the following macros " +"corresponding to various C types. When the member is accessed in Python, it " +"will be converted to the equivalent Python type. When it is set from Python, " +"it will be converted back to the C type. If that is not possible, an " +"exception such as :exc:`TypeError` or :exc:`ValueError` is raised." +msgstr "" + +msgid "" +"Unless marked (D), attributes defined this way cannot be deleted using e.g. :" +"keyword:`del` or :py:func:`delattr`." +msgstr "" + +msgid "Macro name" +msgstr "Назва макросу" + +msgid "C type" +msgstr "тип С" + +msgid "Python type" +msgstr "Тип Python" + +msgid ":c:expr:`char`" +msgstr "" + +msgid ":py:class:`int`" +msgstr "" + +msgid ":c:expr:`short`" +msgstr "" + +msgid ":c:expr:`int`" +msgstr "" + +msgid ":c:expr:`long`" +msgstr "" + +msgid ":c:expr:`long long`" +msgstr "" + +msgid ":c:expr:`unsigned char`" +msgstr "" + +msgid ":c:expr:`unsigned int`" +msgstr "" + +msgid ":c:expr:`unsigned short`" +msgstr "" + +msgid ":c:expr:`unsigned long`" +msgstr "" + +msgid ":c:expr:`unsigned long long`" +msgstr "" + +msgid ":c:expr:`Py_ssize_t`" +msgstr "" + +msgid ":c:expr:`float`" +msgstr "" + +msgid ":py:class:`float`" +msgstr "" + +msgid ":c:expr:`double`" +msgstr "" + +msgid ":c:expr:`char` (written as 0 or 1)" +msgstr "" + +msgid ":py:class:`bool`" +msgstr "" + +msgid ":c:expr:`const char *` (*)" +msgstr "" + +msgid ":py:class:`str` (RO)" +msgstr "" + +msgid ":c:expr:`const char[]` (*)" +msgstr "" + +msgid ":c:expr:`char` (0-127)" +msgstr "" + +msgid ":py:class:`str` (**)" +msgstr "" + +msgid ":c:expr:`PyObject *`" +msgstr "" + +msgid ":py:class:`object` (D)" +msgstr "" + +msgid "" +"(*): Zero-terminated, UTF8-encoded C string. With :c:macro:`!Py_T_STRING` " +"the C representation is a pointer; with :c:macro:`!Py_T_STRING_INPLACE` the " +"string is stored directly in the structure." +msgstr "" + +msgid "(**): String of length 1. Only ASCII is accepted." +msgstr "" + +msgid "(RO): Implies :c:macro:`Py_READONLY`." +msgstr "" + +msgid "" +"(D): Can be deleted, in which case the pointer is set to ``NULL``. Reading a " +"``NULL`` pointer raises :py:exc:`AttributeError`." +msgstr "" + +msgid "" +"In previous versions, the macros were only available with ``#include " +"\"structmember.h\"`` and were named without the ``Py_`` prefix (e.g. as " +"``T_INT``). The header is still available and contains the old names, along " +"with the following deprecated types:" +msgstr "" + +msgid "" +"Like ``Py_T_OBJECT_EX``, but ``NULL`` is converted to ``None``. This results " +"in surprising behavior in Python: deleting the attribute effectively sets it " +"to ``None``." +msgstr "" + +msgid "Always ``None``. Must be used with :c:macro:`Py_READONLY`." +msgstr "" + +msgid "Defining Getters and Setters" +msgstr "" + +msgid "" +"Structure to define property-like access for a type. See also description of " +"the :c:member:`PyTypeObject.tp_getset` slot." +msgstr "" +"Структура для визначення доступу типу властивості. Дивіться також опис " +"слота :c:member:`PyTypeObject.tp_getset`." + +msgid "attribute name" +msgstr "назва атрибута" + +msgid "C function to get the attribute." +msgstr "" + +msgid "" +"Optional C function to set or delete the attribute. If ``NULL``, the " +"attribute is read-only." +msgstr "" + +msgid "optional docstring" +msgstr "додатковий рядок документації" + +msgid "" +"Optional user data pointer, providing additional data for getter and setter." +msgstr "" + +msgid "" +"The ``get`` function takes one :c:expr:`PyObject*` parameter (the instance) " +"and a user data pointer (the associated ``closure``):" +msgstr "" + +msgid "" +"It should return a new reference on success or ``NULL`` with a set exception " +"on failure." +msgstr "" +"Він повинен повертати нове посилання в разі успіху або ``NULL`` із " +"встановленим винятком у випадку невдачі." + +msgid "" +"``set`` functions take two :c:expr:`PyObject*` parameters (the instance and " +"the value to be set) and a user data pointer (the associated ``closure``):" +msgstr "" + +msgid "" +"In case the attribute should be deleted the second parameter is ``NULL``. " +"Should return ``0`` on success or ``-1`` with a set exception on failure." +msgstr "" +"У випадку, якщо атрибут потрібно видалити, другим параметром є ``NULL``. Має " +"повертати ``0`` у разі успіху або ``-1`` із встановленим винятком у випадку " +"невдачі." + +msgid "built-in function" +msgstr "вбудована функція" + +msgid "classmethod" +msgstr "метод класу" + +msgid "staticmethod" +msgstr "статичний метод" + +msgid "READ_RESTRICTED (C macro)" +msgstr "" + +msgid "WRITE_RESTRICTED (C macro)" +msgstr "" + +msgid "RESTRICTED (C macro)" +msgstr "" + +msgid "READONLY (C macro)" +msgstr "" + +msgid "T_BYTE (C macro)" +msgstr "" + +msgid "T_SHORT (C macro)" +msgstr "" + +msgid "T_INT (C macro)" +msgstr "" + +msgid "T_LONG (C macro)" +msgstr "" + +msgid "T_LONGLONG (C macro)" +msgstr "" + +msgid "T_UBYTE (C macro)" +msgstr "" + +msgid "T_USHORT (C macro)" +msgstr "" + +msgid "T_UINT (C macro)" +msgstr "" + +msgid "T_ULONG (C macro)" +msgstr "" + +msgid "T_ULONGULONG (C macro)" +msgstr "" + +msgid "T_PYSSIZET (C macro)" +msgstr "" + +msgid "T_FLOAT (C macro)" +msgstr "" + +msgid "T_DOUBLE (C macro)" +msgstr "" + +msgid "T_BOOL (C macro)" +msgstr "" + +msgid "T_CHAR (C macro)" +msgstr "" + +msgid "T_STRING (C macro)" +msgstr "" + +msgid "T_STRING_INPLACE (C macro)" +msgstr "" + +msgid "T_OBJECT_EX (C macro)" +msgstr "" + +msgid "structmember.h" +msgstr "" diff --git a/c-api/sys.po b/c-api/sys.po new file mode 100644 index 000000000..471cf67a3 --- /dev/null +++ b/c-api/sys.po @@ -0,0 +1,580 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:50+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Operating System Utilities" +msgstr "Утиліти операційної системи" + +msgid "" +"Return the file system representation for *path*. If the object is a :class:" +"`str` or :class:`bytes` object, then a new :term:`strong reference` is " +"returned. If the object implements the :class:`os.PathLike` interface, then :" +"meth:`~os.PathLike.__fspath__` is returned as long as it is a :class:`str` " +"or :class:`bytes` object. Otherwise :exc:`TypeError` is raised and ``NULL`` " +"is returned." +msgstr "" + +msgid "" +"Return true (nonzero) if the standard I/O file *fp* with name *filename* is " +"deemed interactive. This is the case for files for which " +"``isatty(fileno(fp))`` is true. If the :c:member:`PyConfig.interactive` is " +"non-zero, this function also returns true if the *filename* pointer is " +"``NULL`` or if the name is equal to one of the strings ``''`` or " +"``'???'``." +msgstr "" + +msgid "This function must not be called before Python is initialized." +msgstr "" + +msgid "" +"Function to prepare some internal state before a process fork. This should " +"be called before calling :c:func:`fork` or any similar function that clones " +"the current process. Only available on systems where :c:func:`fork` is " +"defined." +msgstr "" +"Функція для підготовки деякого внутрішнього стану перед розгалуженням " +"процесу. Це слід викликати перед викликом :c:func:`fork` або будь-якої " +"подібної функції, яка клонує поточний процес. Доступно лише в системах, де " +"визначено :c:func:`fork`." + +msgid "" +"The C :c:func:`fork` call should only be made from the :ref:`\"main\" thread " +"` (of the :ref:`\"main\" interpreter `). The same is true for ``PyOS_BeforeFork()``." +msgstr "" +"Виклик C :c:func:`fork` має здійснюватися лише з :ref:`\"main\" потоку ` (з :ref:`\"main\" інтерпретатора `). " +"Те саме стосується ``PyOS_BeforeFork()``." + +msgid "" +"Function to update some internal state after a process fork. This should be " +"called from the parent process after calling :c:func:`fork` or any similar " +"function that clones the current process, regardless of whether process " +"cloning was successful. Only available on systems where :c:func:`fork` is " +"defined." +msgstr "" +"Функція для оновлення деякого внутрішнього стану після розгалуження процесу. " +"Це слід викликати з батьківського процесу після виклику :c:func:`fork` або " +"будь-якої подібної функції, яка клонує поточний процес, незалежно від того, " +"чи клонування процесу було успішним. Доступно лише в системах, де визначено :" +"c:func:`fork`." + +msgid "" +"The C :c:func:`fork` call should only be made from the :ref:`\"main\" thread " +"` (of the :ref:`\"main\" interpreter `). The same is true for ``PyOS_AfterFork_Parent()``." +msgstr "" +"Виклик C :c:func:`fork` має здійснюватися лише з :ref:`\"main\" потоку ` (з :ref:`\"main\" інтерпретатора `). " +"Те саме стосується ``PyOS_AfterFork_Parent()``." + +msgid "" +"Function to update internal interpreter state after a process fork. This " +"must be called from the child process after calling :c:func:`fork`, or any " +"similar function that clones the current process, if there is any chance the " +"process will call back into the Python interpreter. Only available on " +"systems where :c:func:`fork` is defined." +msgstr "" +"Функція для оновлення стану внутрішнього інтерпретатора після розгалуження " +"процесу. Це має бути викликано з дочірнього процесу після виклику :c:func:" +"`fork` або будь-якої подібної функції, яка клонує поточний процес, якщо є " +"шанс, що процес знову викличе інтерпретатор Python. Доступно лише в " +"системах, де визначено :c:func:`fork`." + +msgid "" +"The C :c:func:`fork` call should only be made from the :ref:`\"main\" thread " +"` (of the :ref:`\"main\" interpreter `). The same is true for ``PyOS_AfterFork_Child()``." +msgstr "" +"Виклик C :c:func:`fork` має здійснюватися лише з :ref:`\"main\" потоку ` (з :ref:`\"main\" інтерпретатора `). " +"Те саме стосується ``PyOS_AfterFork_Child()``." + +msgid "" +":func:`os.register_at_fork` allows registering custom Python functions to be " +"called by :c:func:`PyOS_BeforeFork()`, :c:func:`PyOS_AfterFork_Parent` and :" +"c:func:`PyOS_AfterFork_Child`." +msgstr "" +":func:`os.register_at_fork` дозволяє реєструвати користувацькі функції " +"Python для виклику :c:func:`PyOS_BeforeFork()`, :c:func:" +"`PyOS_AfterFork_Parent` і :c:func:`PyOS_AfterFork_Child`." + +msgid "" +"Function to update some internal state after a process fork; this should be " +"called in the new process if the Python interpreter will continue to be " +"used. If a new executable is loaded into the new process, this function does " +"not need to be called." +msgstr "" +"Функція для оновлення деякого внутрішнього стану після розгалуження процесу; " +"це слід викликати в новому процесі, якщо інтерпретатор Python продовжуватиме " +"використовуватися. Якщо новий виконуваний файл завантажується в новий " +"процес, цю функцію не потрібно викликати." + +msgid "This function is superseded by :c:func:`PyOS_AfterFork_Child()`." +msgstr "Цю функцію замінює :c:func:`PyOS_AfterFork_Child()`." + +msgid "" +"Return true when the interpreter runs out of stack space. This is a " +"reliable check, but is only available when :c:macro:`!USE_STACKCHECK` is " +"defined (currently on certain versions of Windows using the Microsoft Visual " +"C++ compiler). :c:macro:`!USE_STACKCHECK` will be defined automatically; you " +"should never change the definition in your own code." +msgstr "" + +msgid "" +"Return the current signal handler for signal *i*. This is a thin wrapper " +"around either :c:func:`!sigaction` or :c:func:`!signal`. Do not call those " +"functions directly!" +msgstr "" + +msgid "" +"Set the signal handler for signal *i* to be *h*; return the old signal " +"handler. This is a thin wrapper around either :c:func:`!sigaction` or :c:" +"func:`!signal`. Do not call those functions directly!" +msgstr "" + +msgid "" +"This function should not be called directly: use the :c:type:`PyConfig` API " +"with the :c:func:`PyConfig_SetBytesString` function which ensures that :ref:" +"`Python is preinitialized `." +msgstr "" +"Цю функцію не слід викликати безпосередньо: використовуйте :c:type:" +"`PyConfig` API з функцією :c:func:`PyConfig_SetBytesString`, яка гарантує, " +"що :ref:`Python попередньо ініціалізовано `." + +msgid "" +"This function must not be called before :ref:`Python is preinitialized ` and so that the LC_CTYPE locale is properly configured: see the :c:" +"func:`Py_PreInitialize` function." +msgstr "" +"Цю функцію не можна викликати до :ref:`Python попередньо ініціалізовано ` і щоб локаль LC_CTYPE була правильно налаштована: див. функцію :c:" +"func:`Py_PreInitialize`." + +msgid "" +"Decode a byte string from the :term:`filesystem encoding and error handler`. " +"If the error handler is :ref:`surrogateescape error handler " +"`, undecodable bytes are decoded as characters in range " +"U+DC80..U+DCFF; and if a byte sequence can be decoded as a surrogate " +"character, the bytes are escaped using the surrogateescape error handler " +"instead of decoding them." +msgstr "" +"Декодуйте рядок байтів із :term:`filesystem encoding and error handler`. " +"Якщо обробником помилок є :ref:`surrogateescape error handler " +"`, недекодовані байти декодуються як символи в діапазоні " +"U+DC80..U+DCFF; і якщо послідовність байтів може бути декодована як " +"сурогатний символ, байти екрануються за допомогою обробника помилок " +"surrogateescape замість їх декодування." + +msgid "" +"Return a pointer to a newly allocated wide character string, use :c:func:" +"`PyMem_RawFree` to free the memory. If size is not ``NULL``, write the " +"number of wide characters excluding the null character into ``*size``" +msgstr "" +"Поверніть вказівник на щойно виділений широкий рядок символів, " +"використовуйте :c:func:`PyMem_RawFree`, щоб звільнити пам’ять. Якщо розмір " +"не дорівнює ``NULL``, запишіть кількість широких символів, за винятком " +"нульового символу, у ``*size``" + +msgid "" +"Return ``NULL`` on decoding error or memory allocation error. If *size* is " +"not ``NULL``, ``*size`` is set to ``(size_t)-1`` on memory error or set to " +"``(size_t)-2`` on decoding error." +msgstr "" +"Повертає ``NULL`` у разі помилки декодування або помилки виділення пам'яті. " +"Якщо *size* не дорівнює ``NULL``, ``*size`` встановлюється на ``(size_t)-1`` " +"у разі помилки пам’яті або встановлюється на ``(size_t)-2`` у разі помилки " +"декодування." + +msgid "" +"The :term:`filesystem encoding and error handler` are selected by :c:func:" +"`PyConfig_Read`: see :c:member:`~PyConfig.filesystem_encoding` and :c:member:" +"`~PyConfig.filesystem_errors` members of :c:type:`PyConfig`." +msgstr "" +":term:`filesystem encoding and error handler` вибираються :c:func:" +"`PyConfig_Read`: див. члени :c:member:`~PyConfig.filesystem_encoding` і :c:" +"member:`~PyConfig.filesystem_errors` :c:type:`PyConfig`." + +msgid "" +"Decoding errors should never happen, unless there is a bug in the C library." +msgstr "" +"Помилки декодування ніколи не повинні траплятися, якщо немає помилки в " +"бібліотеці C." + +msgid "" +"Use the :c:func:`Py_EncodeLocale` function to encode the character string " +"back to a byte string." +msgstr "" +"Використовуйте функцію :c:func:`Py_EncodeLocale`, щоб закодувати рядок " +"символів назад у рядок байтів." + +msgid "" +"The :c:func:`PyUnicode_DecodeFSDefaultAndSize` and :c:func:" +"`PyUnicode_DecodeLocaleAndSize` functions." +msgstr "" +"Функції :c:func:`PyUnicode_DecodeFSDefaultAndSize` і :c:func:" +"`PyUnicode_DecodeLocaleAndSize`." + +msgid "" +"The function now uses the UTF-8 encoding in the :ref:`Python UTF-8 Mode " +"`." +msgstr "" +"Тепер функція використовує кодування UTF-8 у режимі :ref:`Python UTF-8 Mode " +"`." + +msgid "" +"The function now uses the UTF-8 encoding on Windows if :c:member:" +"`PyPreConfig.legacy_windows_fs_encoding` is zero;" +msgstr "" + +msgid "" +"Encode a wide character string to the :term:`filesystem encoding and error " +"handler`. If the error handler is :ref:`surrogateescape error handler " +"`, surrogate characters in the range U+DC80..U+DCFF are " +"converted to bytes 0x80..0xFF." +msgstr "" +"Закодуйте широкий рядок символів у :term:`filesystem encoding and error " +"handler`. Якщо обробником помилок є :ref:`surrogateescape error handler " +"`, сурогатні символи в діапазоні U+DC80..U+DCFF " +"перетворюються на байти 0x80..0xFF." + +msgid "" +"Return a pointer to a newly allocated byte string, use :c:func:`PyMem_Free` " +"to free the memory. Return ``NULL`` on encoding error or memory allocation " +"error." +msgstr "" +"Поверніть вказівник на щойно виділений рядок байтів, використовуйте :c:func:" +"`PyMem_Free`, щоб звільнити пам’ять. Повертає ``NULL`` у разі помилки " +"кодування або помилки виділення пам'яті." + +msgid "" +"If error_pos is not ``NULL``, ``*error_pos`` is set to ``(size_t)-1`` on " +"success, or set to the index of the invalid character on encoding error." +msgstr "" +"Якщо error_pos не дорівнює ``NULL``, ``*error_pos`` встановлюється на " +"``(size_t)-1`` у разі успіху або встановлюється на індекс недійсного символу " +"в разі помилки кодування." + +msgid "" +"Use the :c:func:`Py_DecodeLocale` function to decode the bytes string back " +"to a wide character string." +msgstr "" +"Використовуйте функцію :c:func:`Py_DecodeLocale`, щоб декодувати рядок " +"байтів назад до широкого рядка символів." + +msgid "" +"The :c:func:`PyUnicode_EncodeFSDefault` and :c:func:`PyUnicode_EncodeLocale` " +"functions." +msgstr "" +"Функції :c:func:`PyUnicode_EncodeFSDefault` і :c:func:" +"`PyUnicode_EncodeLocale`." + +msgid "" +"The function now uses the UTF-8 encoding on Windows if :c:member:" +"`PyPreConfig.legacy_windows_fs_encoding` is zero." +msgstr "" + +msgid "System Functions" +msgstr "Системні функції" + +msgid "" +"These are utility functions that make functionality from the :mod:`sys` " +"module accessible to C code. They all work with the current interpreter " +"thread's :mod:`sys` module's dict, which is contained in the internal thread " +"state structure." +msgstr "" +"Це службові функції, які роблять функціональні можливості модуля :mod:`sys` " +"доступними для коду C. Усі вони працюють із dict модуля :mod:`sys` поточного " +"потоку інтерпретатора, який міститься у внутрішній структурі стану потоку." + +msgid "" +"Return the object *name* from the :mod:`sys` module or ``NULL`` if it does " +"not exist, without setting an exception." +msgstr "" +"Повертає *ім’я* об’єкта з модуля :mod:`sys` або ``NULL``, якщо він не існує, " +"без встановлення винятку." + +msgid "" +"Set *name* in the :mod:`sys` module to *v* unless *v* is ``NULL``, in which " +"case *name* is deleted from the sys module. Returns ``0`` on success, ``-1`` " +"on error." +msgstr "" +"Встановіть *name* у модулі :mod:`sys` на *v*, якщо *v* не має значення " +"``NULL``, у цьому випадку *name* буде видалено з модуля sys. Повертає ``0`` " +"у разі успіху, ``-1`` у разі помилки." + +msgid "" +"Reset :data:`sys.warnoptions` to an empty list. This function may be called " +"prior to :c:func:`Py_Initialize`." +msgstr "" +"Скинути :data:`sys.warnoptions` до порожнього списку. Цю функцію можна " +"викликати перед :c:func:`Py_Initialize`." + +msgid "Clear :data:`sys.warnoptions` and :data:`!warnings.filters` instead." +msgstr "" + +msgid "" +"Write the output string described by *format* to :data:`sys.stdout`. No " +"exceptions are raised, even if truncation occurs (see below)." +msgstr "" +"Запишіть вихідний рядок, описаний *format*, у :data:`sys.stdout`. Ніяких " +"винятків не викликається, навіть якщо відбувається скорочення (див. нижче)." + +msgid "" +"*format* should limit the total size of the formatted output string to 1000 " +"bytes or less -- after 1000 bytes, the output string is truncated. In " +"particular, this means that no unrestricted \"%s\" formats should occur; " +"these should be limited using \"%.s\" where is a decimal number " +"calculated so that plus the maximum size of other formatted text does " +"not exceed 1000 bytes. Also watch out for \"%f\", which can print hundreds " +"of digits for very large numbers." +msgstr "" +"*format* має обмежувати загальний розмір відформатованого вихідного рядка до " +"1000 байтів або менше -- після 1000 байтів вихідний рядок скорочується. " +"Зокрема, це означає, що необмежені формати \"%s\" не повинні відбуватися; їх " +"слід обмежити за допомогою \"%. s\", де — це десяткове число, " +"обчислене таким чином, що плюс максимальний розмір іншого " +"відформатованого тексту не перевищує 1000 байт. Також слідкуйте за \"%f\", " +"який може друкувати сотні цифр для дуже великих чисел." + +msgid "" +"If a problem occurs, or :data:`sys.stdout` is unset, the formatted message " +"is written to the real (C level) *stdout*." +msgstr "" +"Якщо виникає проблема або :data:`sys.stdout` не налаштовано, форматоване " +"повідомлення записується в реальний (рівень C) *stdout*." + +msgid "" +"As :c:func:`PySys_WriteStdout`, but write to :data:`sys.stderr` or *stderr* " +"instead." +msgstr "" +"Як :c:func:`PySys_WriteStdout`, але натомість записуйте в :data:`sys.stderr` " +"або *stderr*." + +msgid "" +"Function similar to PySys_WriteStdout() but format the message using :c:func:" +"`PyUnicode_FromFormatV` and don't truncate the message to an arbitrary " +"length." +msgstr "" +"Функція схожа на PySys_WriteStdout(), але форматує повідомлення за " +"допомогою :c:func:`PyUnicode_FromFormatV` і не скорочує повідомлення до " +"довільної довжини." + +msgid "" +"As :c:func:`PySys_FormatStdout`, but write to :data:`sys.stderr` or *stderr* " +"instead." +msgstr "" +"Як :c:func:`PySys_FormatStdout`, але замість цього записуйте в :data:`sys." +"stderr` або *stderr*." + +msgid "" +"Return the current dictionary of :option:`-X` options, similarly to :data:" +"`sys._xoptions`. On error, ``NULL`` is returned and an exception is set." +msgstr "" +"Повертає поточний словник параметрів :option:`-X`, подібно до :data:`sys." +"_xoptions`. У разі помилки повертається ``NULL`` і встановлюється виняток." + +msgid "" +"Raise an auditing event with any active hooks. Return zero for success and " +"non-zero with an exception set on failure." +msgstr "" +"Викликати подію аудиту з будь-якими активними хуками. Повертає нуль у разі " +"успіху та відмінний від нуля з винятком, встановленим у випадку невдачі." + +msgid "The *event* string argument must not be *NULL*." +msgstr "" + +msgid "" +"If any hooks have been added, *format* and other arguments will be used to " +"construct a tuple to pass. Apart from ``N``, the same format characters as " +"used in :c:func:`Py_BuildValue` are available. If the built value is not a " +"tuple, it will be added into a single-element tuple." +msgstr "" + +msgid "" +"The ``N`` format option must not be used. It consumes a reference, but since " +"there is no way to know whether arguments to this function will be consumed, " +"using it may cause reference leaks." +msgstr "" + +msgid "" +"Note that ``#`` format characters should always be treated as :c:type:" +"`Py_ssize_t`, regardless of whether ``PY_SSIZE_T_CLEAN`` was defined." +msgstr "" +"Зауважте, що символи формату ``#`` завжди слід розглядати як :c:type:" +"`Py_ssize_t`, незалежно від того, чи було визначено ``PY_SSIZE_T_CLEAN``." + +msgid ":func:`sys.audit` performs the same function from Python code." +msgstr ":func:`sys.audit` виконує ту саму функцію з коду Python." + +msgid "See also :c:func:`PySys_AuditTuple`." +msgstr "" + +msgid "" +"Require :c:type:`Py_ssize_t` for ``#`` format characters. Previously, an " +"unavoidable deprecation warning was raised." +msgstr "" +"Вимагати :c:type:`Py_ssize_t` для символів формату ``#``. Раніше виникало " +"неминуче попередження про застарілу версію." + +msgid "" +"Similar to :c:func:`PySys_Audit`, but pass arguments as a Python object. " +"*args* must be a :class:`tuple`. To pass no arguments, *args* can be *NULL*." +msgstr "" + +msgid "" +"Append the callable *hook* to the list of active auditing hooks. Return zero " +"on success and non-zero on failure. If the runtime has been initialized, " +"also set an error on failure. Hooks added through this API are called for " +"all interpreters created by the runtime." +msgstr "" +"Додайте *хук*, який можна викликати, до списку активних хуків аудиту. " +"Повертає нуль у разі успіху та ненуль у разі невдачі. Якщо середовище " +"виконання було ініціалізовано, також установіть помилку в разі помилки. " +"Хуки, додані через цей API, викликаються для всіх інтерпретаторів, створених " +"середовищем виконання." + +msgid "" +"The *userData* pointer is passed into the hook function. Since hook " +"functions may be called from different runtimes, this pointer should not " +"refer directly to Python state." +msgstr "" +"Покажчик *userData* передається в функцію-перехоплювач. Оскільки функції " +"підключення можуть викликатися з різних середовищ виконання, цей вказівник " +"не повинен посилатися безпосередньо на стан Python." + +msgid "" +"This function is safe to call before :c:func:`Py_Initialize`. When called " +"after runtime initialization, existing audit hooks are notified and may " +"silently abort the operation by raising an error subclassed from :class:" +"`Exception` (other errors will not be silenced)." +msgstr "" +"Цю функцію безпечно викликати перед :c:func:`Py_Initialize`. Під час виклику " +"після ініціалізації середовища виконання наявні перехоплювачі аудиту " +"отримують сповіщення та можуть мовчки перервати операцію, викликавши помилку " +"підкласу з :class:`Exception` (інші помилки не будуть заглушені)." + +msgid "" +"The hook function is always called with the GIL held by the Python " +"interpreter that raised the event." +msgstr "" + +msgid "" +"See :pep:`578` for a detailed description of auditing. Functions in the " +"runtime and standard library that raise events are listed in the :ref:`audit " +"events table `. Details are in each function's documentation." +msgstr "" +"Дивіться :pep:`578` для детального опису аудиту. Функції середовища " +"виконання та стандартної бібліотеки, які викликають події, перераховані в :" +"ref:`таблиці подій аудиту `. Подробиці наведено в документації " +"кожної функції." + +msgid "" +"If the interpreter is initialized, this function raises an auditing event " +"``sys.addaudithook`` with no arguments. If any existing hooks raise an " +"exception derived from :class:`Exception`, the new hook will not be added " +"and the exception is cleared. As a result, callers cannot assume that their " +"hook has been added unless they control all existing hooks." +msgstr "" + +msgid "" +"The type of the hook function. *event* is the C string event argument passed " +"to :c:func:`PySys_Audit` or :c:func:`PySys_AuditTuple`. *args* is guaranteed " +"to be a :c:type:`PyTupleObject`. *userData* is the argument passed to " +"PySys_AddAuditHook()." +msgstr "" + +msgid "Process Control" +msgstr "Контроль процесів" + +msgid "" +"Print a fatal error message and kill the process. No cleanup is performed. " +"This function should only be invoked when a condition is detected that would " +"make it dangerous to continue using the Python interpreter; e.g., when the " +"object administration appears to be corrupted. On Unix, the standard C " +"library function :c:func:`!abort` is called which will attempt to produce a :" +"file:`core` file." +msgstr "" + +msgid "" +"The ``Py_FatalError()`` function is replaced with a macro which logs " +"automatically the name of the current function, unless the " +"``Py_LIMITED_API`` macro is defined." +msgstr "" +"Функцію ``Py_FatalError()`` замінено макросом, який автоматично реєструє " +"назву поточної функції, якщо не визначено макрос ``Py_LIMITED_API``." + +msgid "Log the function name automatically." +msgstr "Автоматично реєструйте назву функції." + +msgid "" +"Exit the current process. This calls :c:func:`Py_FinalizeEx` and then calls " +"the standard C library function ``exit(status)``. If :c:func:" +"`Py_FinalizeEx` indicates an error, the exit status is set to 120." +msgstr "" +"Вийти з поточного процесу. Це викликає :c:func:`Py_FinalizeEx`, а потім " +"викликає стандартну функцію бібліотеки C ``exit(status)``. Якщо :c:func:" +"`Py_FinalizeEx` вказує на помилку, статус виходу встановлюється на 120." + +msgid "Errors from finalization no longer ignored." +msgstr "Помилки під час фіналізації більше не ігноруються." + +msgid "" +"Register a cleanup function to be called by :c:func:`Py_FinalizeEx`. The " +"cleanup function will be called with no arguments and should return no " +"value. At most 32 cleanup functions can be registered. When the " +"registration is successful, :c:func:`Py_AtExit` returns ``0``; on failure, " +"it returns ``-1``. The cleanup function registered last is called first. " +"Each cleanup function will be called at most once. Since Python's internal " +"finalization will have completed before the cleanup function, no Python APIs " +"should be called by *func*." +msgstr "" +"Зареєструйте функцію очищення, яку буде викликати :c:func:`Py_FinalizeEx`. " +"Функція очищення буде викликана без аргументів і не повинна повертати " +"значення. Можна зареєструвати щонайбільше 32 функції очищення. Після " +"успішної реєстрації :c:func:`Py_AtExit` повертає ``0``; у разі помилки " +"повертає ``-1``. Першою викликається функція очищення, зареєстрована " +"останньою. Кожна функція очищення буде викликана щонайбільше один раз. " +"Оскільки внутрішня фіналізація Python буде завершена до виконання функції " +"очищення, жодні API Python не повинні викликатися за допомогою *func*." + +msgid ":c:func:`PyUnstable_AtExit` for passing a ``void *data`` argument." +msgstr "" + +msgid "USE_STACKCHECK (C macro)" +msgstr "" + +msgid "abort (C function)" +msgstr "" + +msgid "Py_FinalizeEx (C function)" +msgstr "" + +msgid "exit (C function)" +msgstr "" + +msgid "cleanup functions" +msgstr "" diff --git a/c-api/time.po b/c-api/time.po new file mode 100644 index 000000000..d96c32bde --- /dev/null +++ b/c-api/time.po @@ -0,0 +1,148 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2024-05-11 01:07+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "PyTime C API" +msgstr "" + +msgid "" +"The clock C API provides access to system clocks. It is similar to the " +"Python :mod:`time` module." +msgstr "" + +msgid "" +"For C API related to the :mod:`datetime` module, see :ref:`datetimeobjects`." +msgstr "" + +msgid "Types" +msgstr "Типи" + +msgid "" +"A timestamp or duration in nanoseconds, represented as a signed 64-bit " +"integer." +msgstr "" + +msgid "" +"The reference point for timestamps depends on the clock used. For example, :" +"c:func:`PyTime_Time` returns timestamps relative to the UNIX epoch." +msgstr "" + +msgid "" +"The supported range is around [-292.3 years; +292.3 years]. Using the Unix " +"epoch (January 1st, 1970) as reference, the supported date range is around " +"[1677-09-21; 2262-04-11]. The exact limits are exposed as constants:" +msgstr "" + +msgid "Minimum value of :c:type:`PyTime_t`." +msgstr "" + +msgid "Maximum value of :c:type:`PyTime_t`." +msgstr "" + +msgid "Clock Functions" +msgstr "" + +msgid "" +"The following functions take a pointer to a :c:expr:`PyTime_t` that they set " +"to the value of a particular clock. Details of each clock are given in the " +"documentation of the corresponding Python function." +msgstr "" + +msgid "" +"The functions return ``0`` on success, or ``-1`` (with an exception set) on " +"failure." +msgstr "" + +msgid "" +"On integer overflow, they set the :c:data:`PyExc_OverflowError` exception " +"and set ``*result`` to the value clamped to the ``[PyTime_MIN; PyTime_MAX]`` " +"range. (On current systems, integer overflows are likely caused by " +"misconfigured system time.)" +msgstr "" + +msgid "" +"As any other C API (unless otherwise specified), the functions must be " +"called with the :term:`GIL` held." +msgstr "" + +msgid "" +"Read the monotonic clock. See :func:`time.monotonic` for important details " +"on this clock." +msgstr "" + +msgid "" +"Read the performance counter. See :func:`time.perf_counter` for important " +"details on this clock." +msgstr "" + +msgid "" +"Read the “wall clock” time. See :func:`time.time` for details important on " +"this clock." +msgstr "" + +msgid "Raw Clock Functions" +msgstr "" + +msgid "" +"Similar to clock functions, but don't set an exception on error and don't " +"require the caller to hold the GIL." +msgstr "" + +msgid "On success, the functions return ``0``." +msgstr "" + +msgid "" +"On failure, they set ``*result`` to ``0`` and return ``-1``, *without* " +"setting an exception. To get the cause of the error, acquire the GIL and " +"call the regular (non-``Raw``) function. Note that the regular function may " +"succeed after the ``Raw`` one failed." +msgstr "" + +msgid "" +"Similar to :c:func:`PyTime_Monotonic`, but don't set an exception on error " +"and don't require holding the GIL." +msgstr "" + +msgid "" +"Similar to :c:func:`PyTime_PerfCounter`, but don't set an exception on error " +"and don't require holding the GIL." +msgstr "" + +msgid "" +"Similar to :c:func:`PyTime_Time`, but don't set an exception on error and " +"don't require holding the GIL." +msgstr "" + +msgid "Conversion functions" +msgstr "" + +msgid "Convert a timestamp to a number of seconds as a C :c:expr:`double`." +msgstr "" + +msgid "" +"The function cannot fail, but note that :c:expr:`double` has limited " +"accuracy for large values." +msgstr "" diff --git a/c-api/tuple.po b/c-api/tuple.po new file mode 100644 index 000000000..7bb4646c7 --- /dev/null +++ b/c-api/tuple.po @@ -0,0 +1,276 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2023 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:50+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2023\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Tuple Objects" +msgstr "Кортежні об'єкти" + +msgid "This subtype of :c:type:`PyObject` represents a Python tuple object." +msgstr "Цей підтип :c:type:`PyObject` представляє об’єкт кортежу Python." + +msgid "" +"This instance of :c:type:`PyTypeObject` represents the Python tuple type; it " +"is the same object as :class:`tuple` in the Python layer." +msgstr "" +"Цей екземпляр :c:type:`PyTypeObject` представляє тип кортежу Python; це той " +"самий об’єкт, що й :class:`tuple` на рівні Python." + +msgid "" +"Return true if *p* is a tuple object or an instance of a subtype of the " +"tuple type. This function always succeeds." +msgstr "" +"Повертає true, якщо *p* є об’єктом кортежу або екземпляром підтипу типу " +"кортежу. Ця функція завжди успішна." + +msgid "" +"Return true if *p* is a tuple object, but not an instance of a subtype of " +"the tuple type. This function always succeeds." +msgstr "" +"Повертає true, якщо *p* є об’єктом кортежу, але не екземпляром підтипу типу " +"кортежу. Ця функція завжди успішна." + +msgid "" +"Return a new tuple object of size *len*, or ``NULL`` with an exception set " +"on failure." +msgstr "" + +msgid "" +"Return a new tuple object of size *n*, or ``NULL`` with an exception set on " +"failure. The tuple values are initialized to the subsequent *n* C arguments " +"pointing to Python objects. ``PyTuple_Pack(2, a, b)`` is equivalent to " +"``Py_BuildValue(\"(OO)\", a, b)``." +msgstr "" + +msgid "" +"Take a pointer to a tuple object, and return the size of that tuple. On " +"error, return ``-1`` and with an exception set." +msgstr "" + +msgid "Like :c:func:`PyTuple_Size`, but without error checking." +msgstr "" + +msgid "" +"Return the object at position *pos* in the tuple pointed to by *p*. If " +"*pos* is negative or out of bounds, return ``NULL`` and set an :exc:" +"`IndexError` exception." +msgstr "" +"Повертає об’єкт у позицію *pos* у кортежі, на який вказує *p*. Якщо *pos* є " +"негативним або виходить за межі, поверніть ``NULL`` і встановіть виняток :" +"exc:`IndexError`." + +msgid "" +"The returned reference is borrowed from the tuple *p* (that is: it is only " +"valid as long as you hold a reference to *p*). To get a :term:`strong " +"reference`, use :c:func:`Py_NewRef(PyTuple_GetItem(...)) ` or :c:" +"func:`PySequence_GetItem`." +msgstr "" + +msgid "Like :c:func:`PyTuple_GetItem`, but does no checking of its arguments." +msgstr "Як :c:func:`PyTuple_GetItem`, але не перевіряє його аргументи." + +msgid "" +"Return the slice of the tuple pointed to by *p* between *low* and *high*, or " +"``NULL`` with an exception set on failure." +msgstr "" + +msgid "" +"This is the equivalent of the Python expression ``p[low:high]``. Indexing " +"from the end of the tuple is not supported." +msgstr "" + +msgid "" +"Insert a reference to object *o* at position *pos* of the tuple pointed to " +"by *p*. Return ``0`` on success. If *pos* is out of bounds, return ``-1`` " +"and set an :exc:`IndexError` exception." +msgstr "" +"Вставте посилання на об’єкт *o* у позиції *pos* кортежу, на який вказує *p*. " +"У разі успіху повертає ``0``. Якщо *pos* виходить за межі, поверніть ``-1`` " +"і встановіть виняток :exc:`IndexError`." + +msgid "" +"This function \"steals\" a reference to *o* and discards a reference to an " +"item already in the tuple at the affected position." +msgstr "" +"Ця функція \"викрадає\" посилання на *o* та відкидає посилання на елемент, " +"який уже міститься в кортежі в ураженій позиції." + +msgid "" +"Like :c:func:`PyTuple_SetItem`, but does no error checking, and should " +"*only* be used to fill in brand new tuples." +msgstr "" +"Подібно до :c:func:`PyTuple_SetItem`, але не перевіряє помилки, і його слід " +"використовувати *лише* для заповнення абсолютно нових кортежів." + +msgid "" +"Bounds checking is performed as an assertion if Python is built in :ref:" +"`debug mode ` or :option:`with assertions <--with-assertions>`." +msgstr "" + +msgid "" +"This function \"steals\" a reference to *o*, and, unlike :c:func:" +"`PyTuple_SetItem`, does *not* discard a reference to any item that is being " +"replaced; any reference in the tuple at position *pos* will be leaked." +msgstr "" + +msgid "" +"Can be used to resize a tuple. *newsize* will be the new length of the " +"tuple. Because tuples are *supposed* to be immutable, this should only be " +"used if there is only one reference to the object. Do *not* use this if the " +"tuple may already be known to some other part of the code. The tuple will " +"always grow or shrink at the end. Think of this as destroying the old tuple " +"and creating a new one, only more efficiently. Returns ``0`` on success. " +"Client code should never assume that the resulting value of ``*p`` will be " +"the same as before calling this function. If the object referenced by ``*p`` " +"is replaced, the original ``*p`` is destroyed. On failure, returns ``-1`` " +"and sets ``*p`` to ``NULL``, and raises :exc:`MemoryError` or :exc:" +"`SystemError`." +msgstr "" +"Можна використовувати для зміни розміру кортежу. *newsize* буде новою " +"довжиною кортежу. Оскільки кортежі *вважаються* незмінними, це слід " +"використовувати, лише якщо є лише одне посилання на об’єкт. *Не* " +"використовуйте це, якщо кортеж може бути вже відомий іншій частині коду. " +"Кортеж завжди зростатиме або зменшуватиметься в кінці. Думайте про це як про " +"знищення старого кортежу та створення нового, але більш ефективного. У разі " +"успіху повертає ``0``. Клієнтський код ніколи не повинен вважати, що " +"результуюче значення ``*p`` буде таким самим, як і до виклику цієї функції. " +"Якщо об’єкт, на який посилається ``*p``, замінюється, оригінальний ``*p`` " +"знищується. У разі помилки повертає ``-1`` і встановлює ``*p`` значення " +"``NULL`` і викликає :exc:`MemoryError` або :exc:`SystemError`." + +msgid "Struct Sequence Objects" +msgstr "Структуруйте об’єкти послідовності" + +msgid "" +"Struct sequence objects are the C equivalent of :func:`~collections." +"namedtuple` objects, i.e. a sequence whose items can also be accessed " +"through attributes. To create a struct sequence, you first have to create a " +"specific struct sequence type." +msgstr "" +"Об’єкти послідовності структур є еквівалентом C об’єктів :func:`~collections." +"namedtuple`, тобто послідовності, до елементів якої також можна отримати " +"доступ через атрибути. Щоб створити послідовність структур, спочатку " +"потрібно створити певний тип послідовності структур." + +msgid "" +"Create a new struct sequence type from the data in *desc*, described below. " +"Instances of the resulting type can be created with :c:func:" +"`PyStructSequence_New`." +msgstr "" +"Створіть новий тип послідовності структур із даних у *desc*, як описано " +"нижче. Екземпляри отриманого типу можна створити за допомогою :c:func:" +"`PyStructSequence_New`." + +msgid "Return ``NULL`` with an exception set on failure." +msgstr "" + +msgid "Initializes a struct sequence type *type* from *desc* in place." +msgstr "Ініціалізує структурну послідовність типу *type* з *desc* на місці." + +msgid "" +"Like :c:func:`PyStructSequence_InitType`, but returns ``0`` on success and " +"``-1`` with an exception set on failure." +msgstr "" + +msgid "Contains the meta information of a struct sequence type to create." +msgstr "" +"Містить метаінформацію типу послідовності структур, яку потрібно створити." + +msgid "" +"Fully qualified name of the type; null-terminated UTF-8 encoded. The name " +"must contain the module name." +msgstr "" + +msgid "Pointer to docstring for the type or ``NULL`` to omit." +msgstr "" + +msgid "Pointer to ``NULL``-terminated array with field names of the new type." +msgstr "" + +msgid "Number of fields visible to the Python side (if used as tuple)." +msgstr "" + +msgid "" +"Describes a field of a struct sequence. As a struct sequence is modeled as a " +"tuple, all fields are typed as :c:expr:`PyObject*`. The index in the :c:" +"member:`~PyStructSequence_Desc.fields` array of the :c:type:" +"`PyStructSequence_Desc` determines which field of the struct sequence is " +"described." +msgstr "" + +msgid "" +"Name for the field or ``NULL`` to end the list of named fields, set to :c:" +"data:`PyStructSequence_UnnamedField` to leave unnamed." +msgstr "" + +msgid "Field docstring or ``NULL`` to omit." +msgstr "" + +msgid "Special value for a field name to leave it unnamed." +msgstr "Спеціальне значення для імені поля, щоб залишити його без імені." + +msgid "The type was changed from ``char *``." +msgstr "Тип змінено з ``char *``." + +msgid "" +"Creates an instance of *type*, which must have been created with :c:func:" +"`PyStructSequence_NewType`." +msgstr "" +"Створює екземпляр *type*, який має бути створено за допомогою :c:func:" +"`PyStructSequence_NewType`." + +msgid "" +"Return the object at position *pos* in the struct sequence pointed to by *p*." +msgstr "" + +msgid "Alias to :c:func:`PyStructSequence_GetItem`." +msgstr "" + +msgid "Now implemented as an alias to :c:func:`PyStructSequence_GetItem`." +msgstr "" + +msgid "" +"Sets the field at index *pos* of the struct sequence *p* to value *o*. " +"Like :c:func:`PyTuple_SET_ITEM`, this should only be used to fill in brand " +"new instances." +msgstr "" +"Встановлює поле за індексом *pos* послідовності структур *p* на значення " +"*o*. Як і :c:func:`PyTuple_SET_ITEM`, це слід використовувати лише для " +"заповнення абсолютно нових екземплярів." + +msgid "This function \"steals\" a reference to *o*." +msgstr "Ця функція \"краде\" посилання на *o*." + +msgid "Alias to :c:func:`PyStructSequence_SetItem`." +msgstr "" + +msgid "Now implemented as an alias to :c:func:`PyStructSequence_SetItem`." +msgstr "" + +msgid "object" +msgstr "об'єкт" + +msgid "tuple" +msgstr "кортеж" diff --git a/c-api/type.po b/c-api/type.po new file mode 100644 index 000000000..bac6d6606 --- /dev/null +++ b/c-api/type.po @@ -0,0 +1,612 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Taras Kuzyo , 2023 +# Dmytro Kazanzhy, 2023 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:50+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2023\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Type Objects" +msgstr "Об'єкти типу" + +msgid "The C structure of the objects used to describe built-in types." +msgstr "Структура C об’єктів, що використовуються для опису вбудованих типів." + +msgid "" +"This is the type object for type objects; it is the same object as :class:" +"`type` in the Python layer." +msgstr "" +"Це об’єкт типу для об’єктів типу; це той самий об’єкт, що й :class:`type` на " +"рівні Python." + +msgid "" +"Return non-zero if the object *o* is a type object, including instances of " +"types derived from the standard type object. Return 0 in all other cases. " +"This function always succeeds." +msgstr "" +"Повертає ненульове значення, якщо об’єкт *o* є об’єктом типу, включаючи " +"екземпляри типів, похідних від об’єкта стандартного типу. Повертає 0 у всіх " +"інших випадках. Ця функція завжди успішна." + +msgid "" +"Return non-zero if the object *o* is a type object, but not a subtype of the " +"standard type object. Return 0 in all other cases. This function always " +"succeeds." +msgstr "" +"Повертає відмінне від нуля значення, якщо об’єкт *o* є об’єктом типу, але не " +"підтипом об’єкта стандартного типу. Повертає 0 у всіх інших випадках. Ця " +"функція завжди успішна." + +msgid "Clear the internal lookup cache. Return the current version tag." +msgstr "Очистіть внутрішній кеш пошуку. Повернути тег поточної версії." + +msgid "" +"Return the :c:member:`~PyTypeObject.tp_flags` member of *type*. This " +"function is primarily meant for use with ``Py_LIMITED_API``; the individual " +"flag bits are guaranteed to be stable across Python releases, but access to :" +"c:member:`~PyTypeObject.tp_flags` itself is not part of the :ref:`limited " +"API `." +msgstr "" + +msgid "The return type is now ``unsigned long`` rather than ``long``." +msgstr "Тип повернення тепер ``unsigned long``, а не ``long``." + +msgid "" +"Return the type object's internal namespace, which is otherwise only exposed " +"via a read-only proxy (:attr:`cls.__dict__ `). This is a " +"replacement for accessing :c:member:`~PyTypeObject.tp_dict` directly. The " +"returned dictionary must be treated as read-only." +msgstr "" + +msgid "" +"This function is meant for specific embedding and language-binding cases, " +"where direct access to the dict is necessary and indirect access (e.g. via " +"the proxy or :c:func:`PyObject_GetAttr`) isn't adequate." +msgstr "" + +msgid "" +"Extension modules should continue to use ``tp_dict``, directly or " +"indirectly, when setting up their own types." +msgstr "" + +msgid "" +"Invalidate the internal lookup cache for the type and all of its subtypes. " +"This function must be called after any manual modification of the attributes " +"or base classes of the type." +msgstr "" +"Визнати недійсним внутрішній кеш пошуку для типу та всіх його підтипів. Цю " +"функцію необхідно викликати після будь-якої ручної зміни атрибутів або " +"базових класів типу." + +msgid "" +"Register *callback* as a type watcher. Return a non-negative integer ID " +"which must be passed to future calls to :c:func:`PyType_Watch`. In case of " +"error (e.g. no more watcher IDs available), return ``-1`` and set an " +"exception." +msgstr "" + +msgid "" +"In free-threaded builds, :c:func:`PyType_AddWatcher` is not thread-safe, so " +"it must be called at start up (before spawning the first thread)." +msgstr "" + +msgid "" +"Clear watcher identified by *watcher_id* (previously returned from :c:func:" +"`PyType_AddWatcher`). Return ``0`` on success, ``-1`` on error (e.g. if " +"*watcher_id* was never registered.)" +msgstr "" + +msgid "" +"An extension should never call ``PyType_ClearWatcher`` with a *watcher_id* " +"that was not returned to it by a previous call to :c:func:" +"`PyType_AddWatcher`." +msgstr "" + +msgid "" +"Mark *type* as watched. The callback granted *watcher_id* by :c:func:" +"`PyType_AddWatcher` will be called whenever :c:func:`PyType_Modified` " +"reports a change to *type*. (The callback may be called only once for a " +"series of consecutive modifications to *type*, if :c:func:`!_PyType_Lookup` " +"is not called on *type* between the modifications; this is an implementation " +"detail and subject to change.)" +msgstr "" + +msgid "" +"An extension should never call ``PyType_Watch`` with a *watcher_id* that was " +"not returned to it by a previous call to :c:func:`PyType_AddWatcher`." +msgstr "" + +msgid "Type of a type-watcher callback function." +msgstr "" + +msgid "" +"The callback must not modify *type* or cause :c:func:`PyType_Modified` to be " +"called on *type* or any type in its MRO; violating this rule could cause " +"infinite recursion." +msgstr "" + +msgid "" +"Return non-zero if the type object *o* sets the feature *feature*. Type " +"features are denoted by single bit flags." +msgstr "" +"Повертає ненульове значення, якщо об’єкт типу *o* встановлює функцію " +"*feature*. Функції типу позначаються однобітовими прапорцями." + +msgid "" +"Return true if the type object includes support for the cycle detector; this " +"tests the type flag :c:macro:`Py_TPFLAGS_HAVE_GC`." +msgstr "" + +msgid "Return true if *a* is a subtype of *b*." +msgstr "Повертає true, якщо *a* є підтипом *b*." + +msgid "" +"This function only checks for actual subtypes, which means that :meth:`~type." +"__subclasscheck__` is not called on *b*. Call :c:func:`PyObject_IsSubclass` " +"to do the same check that :func:`issubclass` would do." +msgstr "" + +msgid "" +"Generic handler for the :c:member:`~PyTypeObject.tp_alloc` slot of a type " +"object. Use Python's default memory allocation mechanism to allocate a new " +"instance and initialize all its contents to ``NULL``." +msgstr "" +"Загальний обробник для слота :c:member:`~PyTypeObject.tp_alloc` об’єкта " +"типу. Використовуйте стандартний механізм виділення пам’яті Python, щоб " +"виділити новий екземпляр та ініціалізувати весь його вміст як ``NULL``." + +msgid "" +"Generic handler for the :c:member:`~PyTypeObject.tp_new` slot of a type " +"object. Create a new instance using the type's :c:member:`~PyTypeObject." +"tp_alloc` slot." +msgstr "" +"Загальний обробник для слота :c:member:`~PyTypeObject.tp_new` об’єкта типу. " +"Створіть новий екземпляр, використовуючи слот типу :c:member:`~PyTypeObject." +"tp_alloc`." + +msgid "" +"Finalize a type object. This should be called on all type objects to finish " +"their initialization. This function is responsible for adding inherited " +"slots from a type's base class. Return ``0`` on success, or return ``-1`` " +"and sets an exception on error." +msgstr "" +"Завершення об’єкта типу. Це слід викликати для всіх об’єктів типу, щоб " +"завершити їх ініціалізацію. Ця функція відповідає за додавання успадкованих " +"слотів від базового класу типу. Повертає ``0`` у разі успіху або ``-1`` і " +"встановлює виняток у випадку помилки." + +msgid "" +"If some of the base classes implements the GC protocol and the provided type " +"does not include the :c:macro:`Py_TPFLAGS_HAVE_GC` in its flags, then the GC " +"protocol will be automatically implemented from its parents. On the " +"contrary, if the type being created does include :c:macro:" +"`Py_TPFLAGS_HAVE_GC` in its flags then it **must** implement the GC protocol " +"itself by at least implementing the :c:member:`~PyTypeObject.tp_traverse` " +"handle." +msgstr "" + +msgid "" +"Return the type's name. Equivalent to getting the type's :attr:`~type." +"__name__` attribute." +msgstr "" + +msgid "" +"Return the type's qualified name. Equivalent to getting the type's :attr:" +"`~type.__qualname__` attribute." +msgstr "" + +msgid "" +"Return the type's fully qualified name. Equivalent to ``f\"{type.__module__}." +"{type.__qualname__}\"``, or :attr:`type.__qualname__` if :attr:`type." +"__module__` is not a string or is equal to ``\"builtins\"``." +msgstr "" + +msgid "" +"Return the type's module name. Equivalent to getting the :attr:`type." +"__module__` attribute." +msgstr "" + +msgid "" +"Return the function pointer stored in the given slot. If the result is " +"``NULL``, this indicates that either the slot is ``NULL``, or that the " +"function was called with invalid parameters. Callers will typically cast the " +"result pointer into the appropriate function type." +msgstr "" +"Повертає вказівник функції, що зберігається у вказаному слоті. Якщо " +"результат ``NULL``, це означає, що або слот має ``NULL``, або що функцію " +"було викликано з недійсними параметрами. Викликачі зазвичай перетворюють " +"покажчик результату на відповідний тип функції." + +msgid "" +"See :c:member:`PyType_Slot.slot` for possible values of the *slot* argument." +msgstr "" +"Перегляньте :c:member:`PyType_Slot.slot`, щоб дізнатися про можливі значення " +"аргументу *slot*." + +msgid "" +":c:func:`PyType_GetSlot` can now accept all types. Previously, it was " +"limited to :ref:`heap types `." +msgstr "" +":c:func:`PyType_GetSlot` тепер може приймати всі типи. Раніше це було " +"обмежено :ref:`типами купи `." + +msgid "" +"Return the module object associated with the given type when the type was " +"created using :c:func:`PyType_FromModuleAndSpec`." +msgstr "" +"Повертає об’єкт модуля, пов’язаний із заданим типом, коли тип було створено " +"за допомогою :c:func:`PyType_FromModuleAndSpec`." + +msgid "" +"If no module is associated with the given type, sets :py:class:`TypeError` " +"and returns ``NULL``." +msgstr "" +"Якщо жоден модуль не пов’язаний із заданим типом, встановлюється :py:class:" +"`TypeError` і повертається ``NULL``." + +msgid "" +"This function is usually used to get the module in which a method is " +"defined. Note that in such a method, ``PyType_GetModule(Py_TYPE(self))`` may " +"not return the intended result. ``Py_TYPE(self)`` may be a *subclass* of the " +"intended class, and subclasses are not necessarily defined in the same " +"module as their superclass. See :c:type:`PyCMethod` to get the class that " +"defines the method. See :c:func:`PyType_GetModuleByDef` for cases when :c:" +"type:`!PyCMethod` cannot be used." +msgstr "" + +msgid "" +"Return the state of the module object associated with the given type. This " +"is a shortcut for calling :c:func:`PyModule_GetState()` on the result of :c:" +"func:`PyType_GetModule`." +msgstr "" +"Повертає стан об’єкта модуля, пов’язаного з заданим типом. Це ярлик для " +"виклику :c:func:`PyModule_GetState()` за результатом :c:func:" +"`PyType_GetModule`." + +msgid "" +"If the *type* has an associated module but its state is ``NULL``, returns " +"``NULL`` without setting an exception." +msgstr "" +"Якщо *тип* має пов’язаний модуль, але його стан ``NULL``, повертає ``NULL`` " +"без встановлення винятку." + +msgid "" +"Find the first superclass whose module was created from the given :c:type:" +"`PyModuleDef` *def*, and return that module." +msgstr "" + +msgid "" +"If no module is found, raises a :py:class:`TypeError` and returns ``NULL``." +msgstr "" + +msgid "" +"This function is intended to be used together with :c:func:" +"`PyModule_GetState()` to get module state from slot methods (such as :c:" +"member:`~PyTypeObject.tp_init` or :c:member:`~PyNumberMethods.nb_add`) and " +"other places where a method's defining class cannot be passed using the :c:" +"type:`PyCMethod` calling convention." +msgstr "" + +msgid "Attempt to assign a version tag to the given type." +msgstr "" + +msgid "" +"Returns 1 if the type already had a valid version tag or a new one was " +"assigned, or 0 if a new tag could not be assigned." +msgstr "" + +msgid "Creating Heap-Allocated Types" +msgstr "Створення типів, виділених у купі" + +msgid "" +"The following functions and structs are used to create :ref:`heap types " +"`." +msgstr "" +"Наступні функції та структури використовуються для створення :ref:`типів " +"купи `." + +msgid "" +"Create and return a :ref:`heap type ` from the *spec* (see :c:" +"macro:`Py_TPFLAGS_HEAPTYPE`)." +msgstr "" + +msgid "" +"The metaclass *metaclass* is used to construct the resulting type object. " +"When *metaclass* is ``NULL``, the metaclass is derived from *bases* (or " +"*Py_tp_base[s]* slots if *bases* is ``NULL``, see below)." +msgstr "" + +msgid "" +"Metaclasses that override :c:member:`~PyTypeObject.tp_new` are not " +"supported, except if ``tp_new`` is ``NULL``. (For backwards compatibility, " +"other ``PyType_From*`` functions allow such metaclasses. They ignore " +"``tp_new``, which may result in incomplete initialization. This is " +"deprecated and in Python 3.14+ such metaclasses will not be supported.)" +msgstr "" + +msgid "" +"The *bases* argument can be used to specify base classes; it can either be " +"only one class or a tuple of classes. If *bases* is ``NULL``, the " +"*Py_tp_bases* slot is used instead. If that also is ``NULL``, the " +"*Py_tp_base* slot is used instead. If that also is ``NULL``, the new type " +"derives from :class:`object`." +msgstr "" +"Аргумент *bases* можна використовувати для визначення базових класів; це " +"може бути лише один клас або кортеж класів. Якщо *bases* має значення " +"``NULL``, замість нього використовується слот *Py_tp_bases*. Якщо це також " +"``NULL``, замість нього використовується слот *Py_tp_base*. Якщо це також " +"``NULL``, новий тип походить від :class:`object`." + +msgid "" +"The *module* argument can be used to record the module in which the new " +"class is defined. It must be a module object or ``NULL``. If not ``NULL``, " +"the module is associated with the new type and can later be retrieved with :" +"c:func:`PyType_GetModule`. The associated module is not inherited by " +"subclasses; it must be specified for each class individually." +msgstr "" +"Аргумент *module* можна використовувати для запису модуля, в якому визначено " +"новий клас. Це має бути об’єкт модуля або ``NULL``. Якщо не ``NULL``, модуль " +"асоціюється з новим типом і може бути пізніше отриманий за допомогою :c:func:" +"`PyType_GetModule`. Асоційований модуль не успадковується підкласами; її " +"необхідно вказувати для кожного класу окремо." + +msgid "This function calls :c:func:`PyType_Ready` on the new type." +msgstr "Ця функція викликає :c:func:`PyType_Ready` для нового типу." + +msgid "" +"Note that this function does *not* fully match the behavior of calling :py:" +"class:`type() ` or using the :keyword:`class` statement. With user-" +"provided base types or metaclasses, prefer :ref:`calling ` :py:" +"class:`type` (or the metaclass) over ``PyType_From*`` functions. " +"Specifically:" +msgstr "" + +msgid "" +":py:meth:`~object.__new__` is not called on the new class (and it must be " +"set to ``type.__new__``)." +msgstr "" + +msgid ":py:meth:`~object.__init__` is not called on the new class." +msgstr "" + +msgid ":py:meth:`~object.__init_subclass__` is not called on any bases." +msgstr "" + +msgid ":py:meth:`~object.__set_name__` is not called on new descriptors." +msgstr "" + +msgid "Equivalent to ``PyType_FromMetaclass(NULL, module, spec, bases)``." +msgstr "" + +msgid "" +"The function now accepts a single class as the *bases* argument and ``NULL`` " +"as the ``tp_doc`` slot." +msgstr "" +"Тепер функція приймає один клас як аргумент *bases* і ``NULL`` як слот " +"``tp_doc``." + +msgid "" +"The function now finds and uses a metaclass corresponding to the provided " +"base classes. Previously, only :class:`type` instances were returned." +msgstr "" + +msgid "" +"The :c:member:`~PyTypeObject.tp_new` of the metaclass is *ignored*. which " +"may result in incomplete initialization. Creating classes whose metaclass " +"overrides :c:member:`~PyTypeObject.tp_new` is deprecated and in Python 3.14+ " +"it will be no longer allowed." +msgstr "" + +msgid "Equivalent to ``PyType_FromMetaclass(NULL, NULL, spec, bases)``." +msgstr "" + +msgid "Equivalent to ``PyType_FromMetaclass(NULL, NULL, spec, NULL)``." +msgstr "" + +msgid "" +"The function now finds and uses a metaclass corresponding to the base " +"classes provided in *Py_tp_base[s]* slots. Previously, only :class:`type` " +"instances were returned." +msgstr "" + +msgid "Structure defining a type's behavior." +msgstr "Структура, що визначає поведінку типу." + +msgid "Name of the type, used to set :c:member:`PyTypeObject.tp_name`." +msgstr "" +"Назва типу, що використовується для встановлення :c:member:`PyTypeObject." +"tp_name`." + +msgid "" +"If positive, specifies the size of the instance in bytes. It is used to set :" +"c:member:`PyTypeObject.tp_basicsize`." +msgstr "" + +msgid "" +"If zero, specifies that :c:member:`~PyTypeObject.tp_basicsize` should be " +"inherited." +msgstr "" + +msgid "" +"If negative, the absolute value specifies how much space instances of the " +"class need *in addition* to the superclass. Use :c:func:" +"`PyObject_GetTypeData` to get a pointer to subclass-specific memory reserved " +"this way. For negative :c:member:`!basicsize`, Python will insert padding " +"when needed to meet :c:member:`~PyTypeObject.tp_basicsize`'s alignment " +"requirements." +msgstr "" + +msgid "Previously, this field could not be negative." +msgstr "" + +msgid "" +"Size of one element of a variable-size type, in bytes. Used to set :c:member:" +"`PyTypeObject.tp_itemsize`. See ``tp_itemsize`` documentation for caveats." +msgstr "" + +msgid "" +"If zero, :c:member:`~PyTypeObject.tp_itemsize` is inherited. Extending " +"arbitrary variable-sized classes is dangerous, since some types use a fixed " +"offset for variable-sized memory, which can then overlap fixed-sized memory " +"used by a subclass. To help prevent mistakes, inheriting ``itemsize`` is " +"only possible in the following situations:" +msgstr "" + +msgid "" +"The base is not variable-sized (its :c:member:`~PyTypeObject.tp_itemsize`)." +msgstr "" + +msgid "" +"The requested :c:member:`PyType_Spec.basicsize` is positive, suggesting that " +"the memory layout of the base class is known." +msgstr "" + +msgid "" +"The requested :c:member:`PyType_Spec.basicsize` is zero, suggesting that the " +"subclass does not access the instance's memory directly." +msgstr "" + +msgid "With the :c:macro:`Py_TPFLAGS_ITEMS_AT_END` flag." +msgstr "" + +msgid "Type flags, used to set :c:member:`PyTypeObject.tp_flags`." +msgstr "" +"Прапорці типу, які використовуються для встановлення :c:member:`PyTypeObject." +"tp_flags`." + +msgid "" +"If the ``Py_TPFLAGS_HEAPTYPE`` flag is not set, :c:func:" +"`PyType_FromSpecWithBases` sets it automatically." +msgstr "" +"Якщо прапор ``Py_TPFLAGS_HEAPTYPE`` не встановлено, :c:func:" +"`PyType_FromSpecWithBases` встановлює його автоматично." + +msgid "" +"Array of :c:type:`PyType_Slot` structures. Terminated by the special slot " +"value ``{0, NULL}``." +msgstr "" +"Масив структур :c:type:`PyType_Slot`. Закінчується спеціальним значенням " +"слота ``{0, NULL}``." + +msgid "Each slot ID should be specified at most once." +msgstr "" + +msgid "" +"Structure defining optional functionality of a type, containing a slot ID " +"and a value pointer." +msgstr "" +"Структура, що визначає необов’язкову функціональність типу, що містить " +"ідентифікатор слота та покажчик значення." + +msgid "A slot ID." +msgstr "Ідентифікатор слота." + +msgid "" +"Slot IDs are named like the field names of the structures :c:type:" +"`PyTypeObject`, :c:type:`PyNumberMethods`, :c:type:`PySequenceMethods`, :c:" +"type:`PyMappingMethods` and :c:type:`PyAsyncMethods` with an added ``Py_`` " +"prefix. For example, use:" +msgstr "" +"Ідентифікатори слотів називаються як імена полів структур :c:type:" +"`PyTypeObject`, :c:type:`PyNumberMethods`, :c:type:`PySequenceMethods`, :c:" +"type:`PyMappingMethods` і :c:type:`PyAsyncMethods` з доданим префіксом " +"``Py_``. Наприклад, використовуйте:" + +msgid "``Py_tp_dealloc`` to set :c:member:`PyTypeObject.tp_dealloc`" +msgstr "``Py_tp_dealloc`` для встановлення :c:member:`PyTypeObject.tp_dealloc`" + +msgid "``Py_nb_add`` to set :c:member:`PyNumberMethods.nb_add`" +msgstr "``Py_nb_add`` для встановлення :c:member:`PyNumberMethods.nb_add`" + +msgid "``Py_sq_length`` to set :c:member:`PySequenceMethods.sq_length`" +msgstr "" +"``Py_sq_length`` для встановлення :c:member:`PySequenceMethods.sq_length`" + +msgid "" +"The following “offset” fields cannot be set using :c:type:`PyType_Slot`:" +msgstr "" + +msgid "" +":c:member:`~PyTypeObject.tp_weaklistoffset` (use :c:macro:" +"`Py_TPFLAGS_MANAGED_WEAKREF` instead if possible)" +msgstr "" + +msgid "" +":c:member:`~PyTypeObject.tp_dictoffset` (use :c:macro:" +"`Py_TPFLAGS_MANAGED_DICT` instead if possible)" +msgstr "" + +msgid "" +":c:member:`~PyTypeObject.tp_vectorcall_offset` (use " +"``\"__vectorcalloffset__\"`` in :ref:`PyMemberDef `)" +msgstr "" + +msgid "" +"If it is not possible to switch to a ``MANAGED`` flag (for example, for " +"vectorcall or to support Python older than 3.12), specify the offset in :c:" +"member:`Py_tp_members `. See :ref:`PyMemberDef " +"documentation ` for details." +msgstr "" + +msgid "The following fields cannot be set at all when creating a heap type:" +msgstr "" + +msgid "" +":c:member:`~PyTypeObject.tp_vectorcall` (use :c:member:`~PyTypeObject." +"tp_new` and/or :c:member:`~PyTypeObject.tp_init`)" +msgstr "" + +msgid "" +"Internal fields: :c:member:`~PyTypeObject.tp_dict`, :c:member:`~PyTypeObject." +"tp_mro`, :c:member:`~PyTypeObject.tp_cache`, :c:member:`~PyTypeObject." +"tp_subclasses`, and :c:member:`~PyTypeObject.tp_weaklist`." +msgstr "" + +msgid "" +"Setting :c:data:`Py_tp_bases` or :c:data:`Py_tp_base` may be problematic on " +"some platforms. To avoid issues, use the *bases* argument of :c:func:" +"`PyType_FromSpecWithBases` instead." +msgstr "" + +msgid "Slots in :c:type:`PyBufferProcs` may be set in the unlimited API." +msgstr "Слоти в :c:type:`PyBufferProcs` можна встановити в необмеженому API." + +msgid "" +":c:member:`~PyBufferProcs.bf_getbuffer` and :c:member:`~PyBufferProcs." +"bf_releasebuffer` are now available under the :ref:`limited API `." +msgstr "" + +msgid "" +"The desired value of the slot. In most cases, this is a pointer to a " +"function." +msgstr "Бажане значення слота. У більшості випадків це вказівник на функцію." + +msgid "Slots other than ``Py_tp_doc`` may not be ``NULL``." +msgstr "Слоти, окрім ``Py_tp_doc``, не можуть бути ``NULL``." + +msgid "object" +msgstr "об'єкт" + +msgid "type" +msgstr "тип" diff --git a/c-api/typehints.po b/c-api/typehints.po new file mode 100644 index 000000000..8f8673a3d --- /dev/null +++ b/c-api/typehints.po @@ -0,0 +1,76 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:50+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Objects for Type Hinting" +msgstr "Об'єкти для підказки типу" + +msgid "" +"Various built-in types for type hinting are provided. Currently, two types " +"exist -- :ref:`GenericAlias ` and :ref:`Union `. Only ``GenericAlias`` is exposed to C." +msgstr "" +"Надаються різні вбудовані типи для підказки типу. Наразі існує два типи -- :" +"ref:`GenericAlias ` та :ref:`Union `. " +"Тільки ``GenericAlias`` доступний для C." + +msgid "" +"Create a :ref:`GenericAlias ` object. Equivalent to " +"calling the Python class :class:`types.GenericAlias`. The *origin* and " +"*args* arguments set the ``GenericAlias``\\ 's ``__origin__`` and " +"``__args__`` attributes respectively. *origin* should be a :c:expr:" +"`PyTypeObject*`, and *args* can be a :c:expr:`PyTupleObject*` or any " +"``PyObject*``. If *args* passed is not a tuple, a 1-tuple is automatically " +"constructed and ``__args__`` is set to ``(args,)``. Minimal checking is done " +"for the arguments, so the function will succeed even if *origin* is not a " +"type. The ``GenericAlias``\\ 's ``__parameters__`` attribute is constructed " +"lazily from ``__args__``. On failure, an exception is raised and ``NULL`` " +"is returned." +msgstr "" + +msgid "Here's an example of how to make an extension type generic::" +msgstr "Ось приклад того, як зробити тип розширення загальним::" + +msgid "" +"...\n" +"static PyMethodDef my_obj_methods[] = {\n" +" // Other methods.\n" +" ...\n" +" {\"__class_getitem__\", Py_GenericAlias, METH_O|METH_CLASS, \"See PEP " +"585\"}\n" +" ...\n" +"}" +msgstr "" + +msgid "The data model method :meth:`~object.__class_getitem__`." +msgstr "" + +msgid "" +"The C type of the object returned by :c:func:`Py_GenericAlias`. Equivalent " +"to :class:`types.GenericAlias` in Python." +msgstr "" +"Тип C об’єкта, який повертає :c:func:`Py_GenericAlias`. Еквівалент :class:" +"`types.GenericAlias` у Python." diff --git a/c-api/typeobj.po b/c-api/typeobj.po new file mode 100644 index 000000000..ebe601a72 --- /dev/null +++ b/c-api/typeobj.po @@ -0,0 +1,3845 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2023 +# Yuliia Shevchenko, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:50+0000\n" +"Last-Translator: Yuliia Shevchenko, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Type Object Structures" +msgstr "" + +msgid "" +"Perhaps one of the most important structures of the Python object system is " +"the structure that defines a new type: the :c:type:`PyTypeObject` " +"structure. Type objects can be handled using any of the ``PyObject_*`` or " +"``PyType_*`` functions, but do not offer much that's interesting to most " +"Python applications. These objects are fundamental to how objects behave, so " +"they are very important to the interpreter itself and to any extension " +"module that implements new types." +msgstr "" + +msgid "" +"Type objects are fairly large compared to most of the standard types. The " +"reason for the size is that each type object stores a large number of " +"values, mostly C function pointers, each of which implements a small part of " +"the type's functionality. The fields of the type object are examined in " +"detail in this section. The fields will be described in the order in which " +"they occur in the structure." +msgstr "" +"Об’єкти типу досить великі порівняно з більшістю стандартних типів. Причина " +"такого розміру полягає в тому, що кожен об’єкт типу зберігає велику " +"кількість значень, переважно покажчиків на функції C, кожен з яких реалізує " +"невелику частину функціональності типу. У цьому розділі детально " +"розглядаються поля об’єкта типу. Поля будуть описані в тому порядку, в якому " +"вони розташовані в структурі." + +msgid "" +"In addition to the following quick reference, the :ref:`typedef-examples` " +"section provides at-a-glance insight into the meaning and use of :c:type:" +"`PyTypeObject`." +msgstr "" +"На додаток до наведеної нижче короткої довідки, розділ :ref:`typedef-" +"examples` надає швидке розуміння значення та використання :c:type:" +"`PyTypeObject`." + +msgid "Quick Reference" +msgstr "Короткий довідник" + +msgid "\"tp slots\"" +msgstr "\"tp слоти\"" + +msgid "PyTypeObject Slot [#slots]_" +msgstr "Слот PyTypeObject [#slots]_" + +msgid ":ref:`Type `" +msgstr ":ref:`Введіть `" + +msgid "special methods/attrs" +msgstr "спеціальні методи/атр" + +msgid "Info [#cols]_" +msgstr "Інформація [#cols]_" + +msgid "O" +msgstr "О" + +msgid "T" +msgstr "T" + +msgid "D" +msgstr "D" + +msgid "I" +msgstr "I" + +msgid " :c:member:`~PyTypeObject.tp_name`" +msgstr " :c:member:`~PyTypeObject.tp_name`" + +msgid "const char *" +msgstr "const char *" + +msgid "__name__" +msgstr "__name__" + +msgid "X" +msgstr "X" + +msgid ":c:member:`~PyTypeObject.tp_basicsize`" +msgstr ":c:member:`~PyTypeObject.tp_basicsize`" + +msgid ":c:type:`Py_ssize_t`" +msgstr ":c:type:`Py_ssize_t`" + +msgid ":c:member:`~PyTypeObject.tp_itemsize`" +msgstr ":c:member:`~PyTypeObject.tp_itemsize`" + +msgid ":c:member:`~PyTypeObject.tp_dealloc`" +msgstr ":c:member:`~PyTypeObject.tp_dealloc`" + +msgid ":c:type:`destructor`" +msgstr ":c:type:`destructor`" + +msgid ":c:member:`~PyTypeObject.tp_vectorcall_offset`" +msgstr ":c:member:`~PyTypeObject.tp_vectorcall_offset`" + +msgid "(:c:member:`~PyTypeObject.tp_getattr`)" +msgstr "(:c:member:`~PyTypeObject.tp_getattr`)" + +msgid ":c:type:`getattrfunc`" +msgstr ":c:type:`getattrfunc`" + +msgid "__getattribute__, __getattr__" +msgstr "__getattribute__, __getattr__" + +msgid "G" +msgstr "Г" + +msgid "(:c:member:`~PyTypeObject.tp_setattr`)" +msgstr "(:c:member:`~PyTypeObject.tp_setattr`)" + +msgid ":c:type:`setattrfunc`" +msgstr ":c:type:`setattrfunc`" + +msgid "__setattr__, __delattr__" +msgstr "__setattr__, __delattr__" + +msgid ":c:member:`~PyTypeObject.tp_as_async`" +msgstr ":c:member:`~PyTypeObject.tp_as_async`" + +msgid ":c:type:`PyAsyncMethods` *" +msgstr ":c:type:`PyAsyncMethods` *" + +msgid ":ref:`sub-slots`" +msgstr ":ref:`sub-slots`" + +msgid "%" +msgstr "%" + +msgid ":c:member:`~PyTypeObject.tp_repr`" +msgstr ":c:member:`~PyTypeObject.tp_repr`" + +msgid ":c:type:`reprfunc`" +msgstr ":c:type:`reprfunc`" + +msgid "__repr__" +msgstr "__repr__" + +msgid ":c:member:`~PyTypeObject.tp_as_number`" +msgstr ":c:member:`~PyTypeObject.tp_as_number`" + +msgid ":c:type:`PyNumberMethods` *" +msgstr ":c:type:`PyNumberMethods` *" + +msgid ":c:member:`~PyTypeObject.tp_as_sequence`" +msgstr ":c:member:`~PyTypeObject.tp_as_sequence`" + +msgid ":c:type:`PySequenceMethods` *" +msgstr ":c:type:`PySequenceMethods` *" + +msgid ":c:member:`~PyTypeObject.tp_as_mapping`" +msgstr ":c:member:`~PyTypeObject.tp_as_mapping`" + +msgid ":c:type:`PyMappingMethods` *" +msgstr ":c:type:`PyMappingMethods` *" + +msgid ":c:member:`~PyTypeObject.tp_hash`" +msgstr ":c:member:`~PyTypeObject.tp_hash`" + +msgid ":c:type:`hashfunc`" +msgstr ":c:type:`hashfunc`" + +msgid "__hash__" +msgstr "__hash__" + +msgid ":c:member:`~PyTypeObject.tp_call`" +msgstr ":c:member:`~PyTypeObject.tp_call`" + +msgid ":c:type:`ternaryfunc`" +msgstr ":c:type:`ternaryfunc`" + +msgid "__call__" +msgstr "__call__" + +msgid ":c:member:`~PyTypeObject.tp_str`" +msgstr ":c:member:`~PyTypeObject.tp_str`" + +msgid "__str__" +msgstr "__str__" + +msgid ":c:member:`~PyTypeObject.tp_getattro`" +msgstr ":c:member:`~PyTypeObject.tp_getattro`" + +msgid ":c:type:`getattrofunc`" +msgstr ":c:type:`getattrofunc`" + +msgid ":c:member:`~PyTypeObject.tp_setattro`" +msgstr ":c:member:`~PyTypeObject.tp_setattro`" + +msgid ":c:type:`setattrofunc`" +msgstr ":c:type:`setattrofunc`" + +msgid ":c:member:`~PyTypeObject.tp_as_buffer`" +msgstr ":c:member:`~PyTypeObject.tp_as_buffer`" + +msgid ":c:type:`PyBufferProcs` *" +msgstr ":c:type:`PyBufferProcs` *" + +msgid ":c:member:`~PyTypeObject.tp_flags`" +msgstr ":c:member:`~PyTypeObject.tp_flags`" + +msgid "unsigned long" +msgstr "беззнаковий long" + +msgid "?" +msgstr "?" + +msgid ":c:member:`~PyTypeObject.tp_doc`" +msgstr ":c:member:`~PyTypeObject.tp_doc`" + +msgid "__doc__" +msgstr "__doc__" + +msgid ":c:member:`~PyTypeObject.tp_traverse`" +msgstr ":c:member:`~PyTypeObject.tp_traverse`" + +msgid ":c:type:`traverseproc`" +msgstr ":c:type:`traverseproc`" + +msgid ":c:member:`~PyTypeObject.tp_clear`" +msgstr ":c:member:`~PyTypeObject.tp_clear`" + +msgid ":c:type:`inquiry`" +msgstr ":c:type:`inquiry`" + +msgid ":c:member:`~PyTypeObject.tp_richcompare`" +msgstr ":c:member:`~PyTypeObject.tp_richcompare`" + +msgid ":c:type:`richcmpfunc`" +msgstr ":c:type:`richcmpfunc`" + +msgid "__lt__, __le__, __eq__, __ne__, __gt__, __ge__" +msgstr "__lt__, __le__, __eq__, __ne__, __gt__, __ge__" + +msgid "(:c:member:`~PyTypeObject.tp_weaklistoffset`)" +msgstr "" + +msgid ":c:member:`~PyTypeObject.tp_iter`" +msgstr ":c:member:`~PyTypeObject.tp_iter`" + +msgid ":c:type:`getiterfunc`" +msgstr ":c:type:`getiterfunc`" + +msgid "__iter__" +msgstr "__iter__" + +msgid ":c:member:`~PyTypeObject.tp_iternext`" +msgstr ":c:member:`~PyTypeObject.tp_iternext`" + +msgid ":c:type:`iternextfunc`" +msgstr ":c:type:`iternextfunc`" + +msgid "__next__" +msgstr "__next__" + +msgid ":c:member:`~PyTypeObject.tp_methods`" +msgstr ":c:member:`~PyTypeObject.tp_methods`" + +msgid ":c:type:`PyMethodDef` []" +msgstr ":c:type:`PyMethodDef` []" + +msgid ":c:member:`~PyTypeObject.tp_members`" +msgstr ":c:member:`~PyTypeObject.tp_members`" + +msgid ":c:type:`PyMemberDef` []" +msgstr ":c:type:`PyMemberDef` []" + +msgid ":c:member:`~PyTypeObject.tp_getset`" +msgstr ":c:member:`~PyTypeObject.tp_getset`" + +msgid ":c:type:`PyGetSetDef` []" +msgstr ":c:type:`PyGetSetDef` []" + +msgid ":c:member:`~PyTypeObject.tp_base`" +msgstr ":c:member:`~PyTypeObject.tp_base`" + +msgid ":c:type:`PyTypeObject` *" +msgstr ":c:type:`PyTypeObject` *" + +msgid "__base__" +msgstr "__base__" + +msgid ":c:member:`~PyTypeObject.tp_dict`" +msgstr ":c:member:`~PyTypeObject.tp_dict`" + +msgid ":c:type:`PyObject` *" +msgstr ":c:type:`PyObject` *" + +msgid "__dict__" +msgstr "__dict__" + +msgid ":c:member:`~PyTypeObject.tp_descr_get`" +msgstr ":c:member:`~PyTypeObject.tp_descr_get`" + +msgid ":c:type:`descrgetfunc`" +msgstr ":c:type:`descrgetfunc`" + +msgid "__get__" +msgstr "__get__" + +msgid ":c:member:`~PyTypeObject.tp_descr_set`" +msgstr ":c:member:`~PyTypeObject.tp_descr_set`" + +msgid ":c:type:`descrsetfunc`" +msgstr ":c:type:`descrsetfunc`" + +msgid "__set__, __delete__" +msgstr "__set__, __delete__" + +msgid "(:c:member:`~PyTypeObject.tp_dictoffset`)" +msgstr "" + +msgid ":c:member:`~PyTypeObject.tp_init`" +msgstr ":c:member:`~PyTypeObject.tp_init`" + +msgid ":c:type:`initproc`" +msgstr ":c:type:`initproc`" + +msgid "__init__" +msgstr "__init__" + +msgid ":c:member:`~PyTypeObject.tp_alloc`" +msgstr ":c:member:`~PyTypeObject.tp_alloc`" + +msgid ":c:type:`allocfunc`" +msgstr ":c:type:`allocfunc`" + +msgid ":c:member:`~PyTypeObject.tp_new`" +msgstr ":c:member:`~PyTypeObject.tp_new`" + +msgid ":c:type:`newfunc`" +msgstr ":c:type:`newfunc`" + +msgid "__new__" +msgstr "__new__" + +msgid ":c:member:`~PyTypeObject.tp_free`" +msgstr ":c:member:`~PyTypeObject.tp_free`" + +msgid ":c:type:`freefunc`" +msgstr ":c:type:`freefunc`" + +msgid ":c:member:`~PyTypeObject.tp_is_gc`" +msgstr ":c:member:`~PyTypeObject.tp_is_gc`" + +msgid "<:c:member:`~PyTypeObject.tp_bases`>" +msgstr " <:c:member:`~PyTypeObject.tp_bases`>" + +msgid "__bases__" +msgstr "__bases__" + +msgid "~" +msgstr "~" + +msgid "<:c:member:`~PyTypeObject.tp_mro`>" +msgstr " <:c:member:`~PyTypeObject.tp_mro`>" + +msgid "__mro__" +msgstr "__mro__" + +msgid "[:c:member:`~PyTypeObject.tp_cache`]" +msgstr "[:c:member:`~PyTypeObject.tp_cache`]" + +msgid "[:c:member:`~PyTypeObject.tp_subclasses`]" +msgstr "[:c:member:`~PyTypeObject.tp_subclasses`]" + +msgid "void *" +msgstr "порожній *" + +msgid "__subclasses__" +msgstr "__subclasses__" + +msgid "[:c:member:`~PyTypeObject.tp_weaklist`]" +msgstr "[:c:member:`~PyTypeObject.tp_weaklist`]" + +msgid "(:c:member:`~PyTypeObject.tp_del`)" +msgstr "(:c:member:`~PyTypeObject.tp_del`)" + +msgid "[:c:member:`~PyTypeObject.tp_version_tag`]" +msgstr "[:c:member:`~PyTypeObject.tp_version_tag`]" + +msgid "unsigned int" +msgstr "беззнаковий int" + +msgid ":c:member:`~PyTypeObject.tp_finalize`" +msgstr ":c:member:`~PyTypeObject.tp_finalize`" + +msgid "__del__" +msgstr "__del__" + +msgid ":c:member:`~PyTypeObject.tp_vectorcall`" +msgstr ":c:member:`~PyTypeObject.tp_vectorcall`" + +msgid ":c:type:`vectorcallfunc`" +msgstr ":c:type:`vectorcallfunc`" + +msgid "[:c:member:`~PyTypeObject.tp_watched`]" +msgstr "" + +msgid "unsigned char" +msgstr "беззнаковий символ" + +msgid "" +"**()**: A slot name in parentheses indicates it is (effectively) deprecated." +msgstr "" + +msgid "" +"**<>**: Names in angle brackets should be initially set to ``NULL`` and " +"treated as read-only." +msgstr "" + +msgid "**[]**: Names in square brackets are for internal use only." +msgstr "" + +msgid "" +"**** (as a prefix) means the field is required (must be non-``NULL``)." +msgstr "" + +msgid "Columns:" +msgstr "Стовпці:" + +msgid "**\"O\"**: set on :c:data:`PyBaseObject_Type`" +msgstr "" + +msgid "**\"T\"**: set on :c:data:`PyType_Type`" +msgstr "" + +msgid "**\"D\"**: default (if slot is set to ``NULL``)" +msgstr "" +"**\"D\"**: за умовчанням (якщо для слота встановлено значення ``NULL``)" + +msgid "" +"X - PyType_Ready sets this value if it is NULL\n" +"~ - PyType_Ready always sets this value (it should be NULL)\n" +"? - PyType_Ready may set this value depending on other slots\n" +"\n" +"Also see the inheritance column (\"I\")." +msgstr "" + +msgid "**\"I\"**: inheritance" +msgstr "**\"I\"**: наслідування" + +msgid "" +"X - type slot is inherited via *PyType_Ready* if defined with a *NULL* " +"value\n" +"% - the slots of the sub-struct are inherited individually\n" +"G - inherited, but only in combination with other slots; see the slot's " +"description\n" +"? - it's complicated; see the slot's description" +msgstr "" + +msgid "" +"Note that some slots are effectively inherited through the normal attribute " +"lookup chain." +msgstr "" +"Зверніть увагу, що деякі слоти фактично успадковуються через звичайний " +"ланцюжок пошуку атрибутів." + +msgid "sub-slots" +msgstr "підслоти" + +msgid "Slot" +msgstr "Слот" + +msgid "special methods" +msgstr "спеціальні методи" + +msgid ":c:member:`~PyAsyncMethods.am_await`" +msgstr ":c:member:`~PyAsyncMethods.am_await`" + +msgid ":c:type:`unaryfunc`" +msgstr ":c:type:`unaryfunc`" + +msgid "__await__" +msgstr "__await__" + +msgid ":c:member:`~PyAsyncMethods.am_aiter`" +msgstr ":c:member:`~PyAsyncMethods.am_aiter`" + +msgid "__aiter__" +msgstr "__aiter__" + +msgid ":c:member:`~PyAsyncMethods.am_anext`" +msgstr ":c:member:`~PyAsyncMethods.am_anext`" + +msgid "__anext__" +msgstr "__anext__" + +msgid ":c:member:`~PyAsyncMethods.am_send`" +msgstr ":c:member:`~PyAsyncMethods.am_send`" + +msgid ":c:type:`sendfunc`" +msgstr ":c:type:`sendfunc`" + +msgid ":c:member:`~PyNumberMethods.nb_add`" +msgstr ":c:member:`~PyNumberMethods.nb_add`" + +msgid ":c:type:`binaryfunc`" +msgstr ":c:type:`binaryfunc`" + +msgid "__add__ __radd__" +msgstr "__add__ __radd__" + +msgid ":c:member:`~PyNumberMethods.nb_inplace_add`" +msgstr ":c:member:`~PyNumberMethods.nb_inplace_add`" + +msgid "__iadd__" +msgstr "__iadd__" + +msgid ":c:member:`~PyNumberMethods.nb_subtract`" +msgstr ":c:member:`~PyNumberMethods.nb_subtract`" + +msgid "__sub__ __rsub__" +msgstr "__sub__ __rsub__" + +msgid ":c:member:`~PyNumberMethods.nb_inplace_subtract`" +msgstr ":c:member:`~PyNumberMethods.nb_inplace_subtract`" + +msgid "__isub__" +msgstr "__isub__" + +msgid ":c:member:`~PyNumberMethods.nb_multiply`" +msgstr ":c:member:`~PyNumberMethods.nb_multiply`" + +msgid "__mul__ __rmul__" +msgstr "__mul__ __rmul__" + +msgid ":c:member:`~PyNumberMethods.nb_inplace_multiply`" +msgstr ":c:member:`~PyNumberMethods.nb_inplace_multiply`" + +msgid "__imul__" +msgstr "__imul__" + +msgid ":c:member:`~PyNumberMethods.nb_remainder`" +msgstr ":c:member:`~PyNumberMethods.nb_remainder`" + +msgid "__mod__ __rmod__" +msgstr "__mod__ __rmod__" + +msgid ":c:member:`~PyNumberMethods.nb_inplace_remainder`" +msgstr ":c:member:`~PyNumberMethods.nb_inplace_remainder`" + +msgid "__imod__" +msgstr "__imod__" + +msgid ":c:member:`~PyNumberMethods.nb_divmod`" +msgstr ":c:member:`~PyNumberMethods.nb_divmod`" + +msgid "__divmod__ __rdivmod__" +msgstr "__divmod__ __rdivmod__" + +msgid ":c:member:`~PyNumberMethods.nb_power`" +msgstr ":c:member:`~PyNumberMethods.nb_power`" + +msgid "__pow__ __rpow__" +msgstr "__pow__ __rpow__" + +msgid ":c:member:`~PyNumberMethods.nb_inplace_power`" +msgstr ":c:member:`~PyNumberMethods.nb_inplace_power`" + +msgid "__ipow__" +msgstr "__ipow__" + +msgid ":c:member:`~PyNumberMethods.nb_negative`" +msgstr ":c:member:`~PyNumberMethods.nb_negative`" + +msgid "__neg__" +msgstr "__neg__" + +msgid ":c:member:`~PyNumberMethods.nb_positive`" +msgstr ":c:member:`~PyNumberMethods.nb_positive`" + +msgid "__pos__" +msgstr "__pos__" + +msgid ":c:member:`~PyNumberMethods.nb_absolute`" +msgstr ":c:member:`~PyNumberMethods.nb_absolute`" + +msgid "__abs__" +msgstr "__abs__" + +msgid ":c:member:`~PyNumberMethods.nb_bool`" +msgstr ":c:member:`~PyNumberMethods.nb_bool`" + +msgid "__bool__" +msgstr "__bool__" + +msgid ":c:member:`~PyNumberMethods.nb_invert`" +msgstr ":c:member:`~PyNumberMethods.nb_invert`" + +msgid "__invert__" +msgstr "__invert__" + +msgid ":c:member:`~PyNumberMethods.nb_lshift`" +msgstr ":c:member:`~PyNumberMethods.nb_lshift`" + +msgid "__lshift__ __rlshift__" +msgstr "__lshift__ __rlshift__" + +msgid ":c:member:`~PyNumberMethods.nb_inplace_lshift`" +msgstr ":c:member:`~PyNumberMethods.nb_inplace_lshift`" + +msgid "__ilshift__" +msgstr "__ilshift__" + +msgid ":c:member:`~PyNumberMethods.nb_rshift`" +msgstr ":c:member:`~PyNumberMethods.nb_rshift`" + +msgid "__rshift__ __rrshift__" +msgstr "__rshift__ __rrshift__" + +msgid ":c:member:`~PyNumberMethods.nb_inplace_rshift`" +msgstr ":c:member:`~PyNumberMethods.nb_inplace_rshift`" + +msgid "__irshift__" +msgstr "__irshift__" + +msgid ":c:member:`~PyNumberMethods.nb_and`" +msgstr ":c:member:`~PyNumberMethods.nb_and`" + +msgid "__and__ __rand__" +msgstr "__and__ __rand__" + +msgid ":c:member:`~PyNumberMethods.nb_inplace_and`" +msgstr ":c:member:`~PyNumberMethods.nb_inplace_and`" + +msgid "__iand__" +msgstr "__iand__" + +msgid ":c:member:`~PyNumberMethods.nb_xor`" +msgstr ":c:member:`~PyNumberMethods.nb_xor`" + +msgid "__xor__ __rxor__" +msgstr "__xor__ __rxor__" + +msgid ":c:member:`~PyNumberMethods.nb_inplace_xor`" +msgstr ":c:member:`~PyNumberMethods.nb_inplace_xor`" + +msgid "__ixor__" +msgstr "__ixor__" + +msgid ":c:member:`~PyNumberMethods.nb_or`" +msgstr ":c:member:`~PyNumberMethods.nb_or`" + +msgid "__or__ __ror__" +msgstr "__or__ __ror__" + +msgid ":c:member:`~PyNumberMethods.nb_inplace_or`" +msgstr ":c:member:`~PyNumberMethods.nb_inplace_or`" + +msgid "__ior__" +msgstr "__ior__" + +msgid ":c:member:`~PyNumberMethods.nb_int`" +msgstr ":c:member:`~PyNumberMethods.nb_int`" + +msgid "__int__" +msgstr "__int__" + +msgid ":c:member:`~PyNumberMethods.nb_reserved`" +msgstr ":c:member:`~PyNumberMethods.nb_reserved`" + +msgid ":c:member:`~PyNumberMethods.nb_float`" +msgstr ":c:member:`~PyNumberMethods.nb_float`" + +msgid "__float__" +msgstr "__float__" + +msgid ":c:member:`~PyNumberMethods.nb_floor_divide`" +msgstr ":c:member:`~PyNumberMethods.nb_floor_divide`" + +msgid "__floordiv__" +msgstr "__floordiv__" + +msgid ":c:member:`~PyNumberMethods.nb_inplace_floor_divide`" +msgstr ":c:member:`~PyNumberMethods.nb_inplace_floor_divide`" + +msgid "__ifloordiv__" +msgstr "__ifloordiv__" + +msgid ":c:member:`~PyNumberMethods.nb_true_divide`" +msgstr ":c:member:`~PyNumberMethods.nb_true_divide`" + +msgid "__truediv__" +msgstr "__truediv__" + +msgid ":c:member:`~PyNumberMethods.nb_inplace_true_divide`" +msgstr ":c:member:`~PyNumberMethods.nb_inplace_true_divide`" + +msgid "__itruediv__" +msgstr "__itruediv__" + +msgid ":c:member:`~PyNumberMethods.nb_index`" +msgstr ":c:member:`~PyNumberMethods.nb_index`" + +msgid "__index__" +msgstr "__index__" + +msgid ":c:member:`~PyNumberMethods.nb_matrix_multiply`" +msgstr ":c:member:`~PyNumberMethods.nb_matrix_multiply`" + +msgid "__matmul__ __rmatmul__" +msgstr "__matmul__ __rmatmul__" + +msgid ":c:member:`~PyNumberMethods.nb_inplace_matrix_multiply`" +msgstr ":c:member:`~PyNumberMethods.nb_inplace_matrix_multiply`" + +msgid "__imatmul__" +msgstr "__imatmul__" + +msgid ":c:member:`~PyMappingMethods.mp_length`" +msgstr ":c:member:`~PyMappingMethods.mp_length`" + +msgid ":c:type:`lenfunc`" +msgstr ":c:type:`lenfunc`" + +msgid "__len__" +msgstr "__len__" + +msgid ":c:member:`~PyMappingMethods.mp_subscript`" +msgstr ":c:member:`~PyMappingMethods.mp_subscript`" + +msgid "__getitem__" +msgstr "__getitem__" + +msgid ":c:member:`~PyMappingMethods.mp_ass_subscript`" +msgstr ":c:member:`~PyMappingMethods.mp_ass_subscript`" + +msgid ":c:type:`objobjargproc`" +msgstr ":c:type:`objobjargproc`" + +msgid "__setitem__, __delitem__" +msgstr "__setitem__, __delitem__" + +msgid ":c:member:`~PySequenceMethods.sq_length`" +msgstr ":c:member:`~PySequenceMethods.sq_length`" + +msgid ":c:member:`~PySequenceMethods.sq_concat`" +msgstr ":c:member:`~PySequenceMethods.sq_concat`" + +msgid "__add__" +msgstr "__add__" + +msgid ":c:member:`~PySequenceMethods.sq_repeat`" +msgstr ":c:member:`~PySequenceMethods.sq_repeat`" + +msgid ":c:type:`ssizeargfunc`" +msgstr ":c:type:`ssizeargfunc`" + +msgid "__mul__" +msgstr "__mul__" + +msgid ":c:member:`~PySequenceMethods.sq_item`" +msgstr ":c:member:`~PySequenceMethods.sq_item`" + +msgid ":c:member:`~PySequenceMethods.sq_ass_item`" +msgstr ":c:member:`~PySequenceMethods.sq_ass_item`" + +msgid ":c:type:`ssizeobjargproc`" +msgstr ":c:type:`ssizeobjargproc`" + +msgid "__setitem__ __delitem__" +msgstr "__setitem__ __delitem__" + +msgid ":c:member:`~PySequenceMethods.sq_contains`" +msgstr ":c:member:`~PySequenceMethods.sq_contains`" + +msgid ":c:type:`objobjproc`" +msgstr ":c:type:`objobjproc`" + +msgid "__contains__" +msgstr "__contains__" + +msgid ":c:member:`~PySequenceMethods.sq_inplace_concat`" +msgstr ":c:member:`~PySequenceMethods.sq_inplace_concat`" + +msgid ":c:member:`~PySequenceMethods.sq_inplace_repeat`" +msgstr ":c:member:`~PySequenceMethods.sq_inplace_repeat`" + +msgid ":c:member:`~PyBufferProcs.bf_getbuffer`" +msgstr ":c:member:`~PyBufferProcs.bf_getbuffer`" + +msgid ":c:func:`getbufferproc`" +msgstr ":c:func:`getbufferproc`" + +msgid ":c:member:`~PyBufferProcs.bf_releasebuffer`" +msgstr ":c:member:`~PyBufferProcs.bf_releasebuffer`" + +msgid ":c:func:`releasebufferproc`" +msgstr ":c:func:`releasebufferproc`" + +msgid "slot typedefs" +msgstr "типи слотів" + +msgid "typedef" +msgstr "typedef" + +msgid "Parameter Types" +msgstr "Типи параметрів" + +msgid "Return Type" +msgstr "Тип повернення" + +msgid "void" +msgstr "пустий" + +msgid ":c:type:`visitproc`" +msgstr ":c:type:`visitproc`" + +msgid "int" +msgstr "int" + +msgid "Py_hash_t" +msgstr "Py_hash_t" + +msgid ":c:type:`getbufferproc`" +msgstr ":c:type:`getbufferproc`" + +msgid ":c:type:`Py_buffer` *" +msgstr ":c:type:`Py_buffer` *" + +msgid ":c:type:`releasebufferproc`" +msgstr ":c:type:`releasebufferproc`" + +msgid "See :ref:`slot-typedefs` below for more detail." +msgstr "Дивіться :ref:`slot-typedefs` нижче, щоб дізнатися більше." + +msgid "PyTypeObject Definition" +msgstr "Визначення PyTypeObject" + +msgid "" +"The structure definition for :c:type:`PyTypeObject` can be found in :file:" +"`Include/cpython/object.h`. For convenience of reference, this repeats the " +"definition found there:" +msgstr "" + +msgid "" +"typedef struct _typeobject {\n" +" PyObject_VAR_HEAD\n" +" const char *tp_name; /* For printing, in format \".\" */\n" +" Py_ssize_t tp_basicsize, tp_itemsize; /* For allocation */\n" +"\n" +" /* Methods to implement standard operations */\n" +"\n" +" destructor tp_dealloc;\n" +" Py_ssize_t tp_vectorcall_offset;\n" +" getattrfunc tp_getattr;\n" +" setattrfunc tp_setattr;\n" +" PyAsyncMethods *tp_as_async; /* formerly known as tp_compare (Python 2)\n" +" or tp_reserved (Python 3) */\n" +" reprfunc tp_repr;\n" +"\n" +" /* Method suites for standard classes */\n" +"\n" +" PyNumberMethods *tp_as_number;\n" +" PySequenceMethods *tp_as_sequence;\n" +" PyMappingMethods *tp_as_mapping;\n" +"\n" +" /* More standard operations (here for binary compatibility) */\n" +"\n" +" hashfunc tp_hash;\n" +" ternaryfunc tp_call;\n" +" reprfunc tp_str;\n" +" getattrofunc tp_getattro;\n" +" setattrofunc tp_setattro;\n" +"\n" +" /* Functions to access object as input/output buffer */\n" +" PyBufferProcs *tp_as_buffer;\n" +"\n" +" /* Flags to define presence of optional/expanded features */\n" +" unsigned long tp_flags;\n" +"\n" +" const char *tp_doc; /* Documentation string */\n" +"\n" +" /* Assigned meaning in release 2.0 */\n" +" /* call function for all accessible objects */\n" +" traverseproc tp_traverse;\n" +"\n" +" /* delete references to contained objects */\n" +" inquiry tp_clear;\n" +"\n" +" /* Assigned meaning in release 2.1 */\n" +" /* rich comparisons */\n" +" richcmpfunc tp_richcompare;\n" +"\n" +" /* weak reference enabler */\n" +" Py_ssize_t tp_weaklistoffset;\n" +"\n" +" /* Iterators */\n" +" getiterfunc tp_iter;\n" +" iternextfunc tp_iternext;\n" +"\n" +" /* Attribute descriptor and subclassing stuff */\n" +" struct PyMethodDef *tp_methods;\n" +" struct PyMemberDef *tp_members;\n" +" struct PyGetSetDef *tp_getset;\n" +" // Strong reference on a heap type, borrowed reference on a static type\n" +" struct _typeobject *tp_base;\n" +" PyObject *tp_dict;\n" +" descrgetfunc tp_descr_get;\n" +" descrsetfunc tp_descr_set;\n" +" Py_ssize_t tp_dictoffset;\n" +" initproc tp_init;\n" +" allocfunc tp_alloc;\n" +" newfunc tp_new;\n" +" freefunc tp_free; /* Low-level free-memory routine */\n" +" inquiry tp_is_gc; /* For PyObject_IS_GC */\n" +" PyObject *tp_bases;\n" +" PyObject *tp_mro; /* method resolution order */\n" +" PyObject *tp_cache;\n" +" PyObject *tp_subclasses;\n" +" PyObject *tp_weaklist;\n" +" destructor tp_del;\n" +"\n" +" /* Type attribute cache version tag. Added in version 2.6 */\n" +" unsigned int tp_version_tag;\n" +"\n" +" destructor tp_finalize;\n" +" vectorcallfunc tp_vectorcall;\n" +"\n" +" /* bitset of which type-watchers care about this type */\n" +" unsigned char tp_watched;\n" +"} PyTypeObject;\n" +msgstr "" + +msgid "PyObject Slots" +msgstr "Слоти PyObject" + +msgid "" +"The type object structure extends the :c:type:`PyVarObject` structure. The :" +"c:member:`~PyVarObject.ob_size` field is used for dynamic types (created by :" +"c:func:`!type_new`, usually called from a class statement). Note that :c:" +"data:`PyType_Type` (the metatype) initializes :c:member:`~PyTypeObject." +"tp_itemsize`, which means that its instances (i.e. type objects) *must* have " +"the :c:member:`~PyVarObject.ob_size` field." +msgstr "" + +msgid "" +"This is the type object's reference count, initialized to ``1`` by the " +"``PyObject_HEAD_INIT`` macro. Note that for :ref:`statically allocated type " +"objects `, the type's instances (objects whose :c:member:" +"`~PyObject.ob_type` points back to the type) do *not* count as references. " +"But for :ref:`dynamically allocated type objects `, the " +"instances *do* count as references." +msgstr "" + +msgid "**Inheritance:**" +msgstr "**Наслідування:**" + +msgid "This field is not inherited by subtypes." +msgstr "Це поле не успадковується підтипами." + +msgid "" +"This is the type's type, in other words its metatype. It is initialized by " +"the argument to the ``PyObject_HEAD_INIT`` macro, and its value should " +"normally be ``&PyType_Type``. However, for dynamically loadable extension " +"modules that must be usable on Windows (at least), the compiler complains " +"that this is not a valid initializer. Therefore, the convention is to pass " +"``NULL`` to the ``PyObject_HEAD_INIT`` macro and to initialize this field " +"explicitly at the start of the module's initialization function, before " +"doing anything else. This is typically done like this::" +msgstr "" +"Це тип типу, іншими словами його метатип. Він ініціалізується аргументом " +"макросу ``PyObject_HEAD_INIT``, і його значення зазвичай має бути " +"``&PyType_Type``. Однак для динамічно завантажуваних модулів розширення, які " +"повинні використовуватися в Windows (принаймні), компілятор скаржиться, що " +"це недійсний ініціалізатор. Таким чином, прийнято передавати ``NULL`` в " +"макрос ``PyObject_HEAD_INIT`` і ініціалізувати це поле явно на початку " +"функції ініціалізації модуля, перш ніж робити будь-що інше. Зазвичай це " +"робиться так:" + +msgid "Foo_Type.ob_type = &PyType_Type;" +msgstr "" + +msgid "" +"This should be done before any instances of the type are created. :c:func:" +"`PyType_Ready` checks if :c:member:`~PyObject.ob_type` is ``NULL``, and if " +"so, initializes it to the :c:member:`~PyObject.ob_type` field of the base " +"class. :c:func:`PyType_Ready` will not change this field if it is non-zero." +msgstr "" + +msgid "This field is inherited by subtypes." +msgstr "Це поле успадковується підтипами." + +msgid "PyVarObject Slots" +msgstr "Слоти PyVarObject" + +msgid "" +"For :ref:`statically allocated type objects `, this should be " +"initialized to zero. For :ref:`dynamically allocated type objects `, this field has a special internal meaning." +msgstr "" +"Для :ref:`статично виділених об’єктів типу `, це має бути " +"ініціалізовано нулем. Для :ref:`динамічно виділених об’єктів типу ` це поле має особливе внутрішнє значення." + +msgid "" +"This field should be accessed using the :c:func:`Py_SIZE()` and :c:func:" +"`Py_SET_SIZE()` macros." +msgstr "" + +msgid "PyTypeObject Slots" +msgstr "Слоти PyTypeObject" + +msgid "" +"Each slot has a section describing inheritance. If :c:func:`PyType_Ready` " +"may set a value when the field is set to ``NULL`` then there will also be a " +"\"Default\" section. (Note that many fields set on :c:data:" +"`PyBaseObject_Type` and :c:data:`PyType_Type` effectively act as defaults.)" +msgstr "" + +msgid "" +"Pointer to a NUL-terminated string containing the name of the type. For " +"types that are accessible as module globals, the string should be the full " +"module name, followed by a dot, followed by the type name; for built-in " +"types, it should be just the type name. If the module is a submodule of a " +"package, the full package name is part of the full module name. For " +"example, a type named :class:`!T` defined in module :mod:`!M` in subpackage :" +"mod:`!Q` in package :mod:`!P` should have the :c:member:`~PyTypeObject." +"tp_name` initializer ``\"P.Q.M.T\"``." +msgstr "" + +msgid "" +"For :ref:`dynamically allocated type objects `, this should just " +"be the type name, and the module name explicitly stored in the type dict as " +"the value for key ``'__module__'``." +msgstr "" +"Для :ref:`динамічно виділених об’єктів типу `, це має бути лише " +"ім’я типу, а ім’я модуля явно зберігається в dict типу як значення для ключа " +"``'__module__'``." + +msgid "" +"For :ref:`statically allocated type objects `, the *tp_name* " +"field should contain a dot. Everything before the last dot is made " +"accessible as the :attr:`~type.__module__` attribute, and everything after " +"the last dot is made accessible as the :attr:`~type.__name__` attribute." +msgstr "" + +msgid "" +"If no dot is present, the entire :c:member:`~PyTypeObject.tp_name` field is " +"made accessible as the :attr:`~type.__name__` attribute, and the :attr:" +"`~type.__module__` attribute is undefined (unless explicitly set in the " +"dictionary, as explained above). This means your type will be impossible to " +"pickle. Additionally, it will not be listed in module documentations " +"created with pydoc." +msgstr "" + +msgid "" +"This field must not be ``NULL``. It is the only required field in :c:func:" +"`PyTypeObject` (other than potentially :c:member:`~PyTypeObject." +"tp_itemsize`)." +msgstr "" +"Це поле не має бути ``NULL``. Це єдине обов’язкове поле в :c:func:" +"`PyTypeObject` (окрім потенційно :c:member:`~PyTypeObject.tp_itemsize`)." + +msgid "" +"These fields allow calculating the size in bytes of instances of the type." +msgstr "Ці поля дозволяють обчислити розмір екземплярів типу в байтах." + +msgid "" +"There are two kinds of types: types with fixed-length instances have a zero :" +"c:member:`!tp_itemsize` field, types with variable-length instances have a " +"non-zero :c:member:`!tp_itemsize` field. For a type with fixed-length " +"instances, all instances have the same size, given in :c:member:`!" +"tp_basicsize`. (Exceptions to this rule can be made using :c:func:" +"`PyUnstable_Object_GC_NewWithExtraData`.)" +msgstr "" + +msgid "" +"For a type with variable-length instances, the instances must have an :c:" +"member:`~PyVarObject.ob_size` field, and the instance size is :c:member:`!" +"tp_basicsize` plus N times :c:member:`!tp_itemsize`, where N is the " +"\"length\" of the object." +msgstr "" + +msgid "" +"Functions like :c:func:`PyObject_NewVar` will take the value of N as an " +"argument, and store in the instance's :c:member:`~PyVarObject.ob_size` " +"field. Note that the :c:member:`~PyVarObject.ob_size` field may later be " +"used for other purposes. For example, :py:type:`int` instances use the bits " +"of :c:member:`~PyVarObject.ob_size` in an implementation-defined way; the " +"underlying storage and its size should be accessed using :c:func:" +"`PyLong_Export`." +msgstr "" + +msgid "" +"The :c:member:`~PyVarObject.ob_size` field should be accessed using the :c:" +"func:`Py_SIZE()` and :c:func:`Py_SET_SIZE()` macros." +msgstr "" + +msgid "" +"Also, the presence of an :c:member:`~PyVarObject.ob_size` field in the " +"instance layout doesn't mean that the instance structure is variable-length. " +"For example, the :py:type:`list` type has fixed-length instances, yet those " +"instances have a :c:member:`~PyVarObject.ob_size` field. (As with :py:type:" +"`int`, avoid reading lists' :c:member:`!ob_size` directly. Call :c:func:" +"`PyList_Size` instead.)" +msgstr "" + +msgid "" +"The :c:member:`!tp_basicsize` includes size needed for data of the type's :c:" +"member:`~PyTypeObject.tp_base`, plus any extra data needed by each instance." +msgstr "" + +msgid "" +"The correct way to set :c:member:`!tp_basicsize` is to use the ``sizeof`` " +"operator on the struct used to declare the instance layout. This struct must " +"include the struct used to declare the base type. In other words, :c:member:" +"`!tp_basicsize` must be greater than or equal to the base's :c:member:`!" +"tp_basicsize`." +msgstr "" + +msgid "" +"Since every type is a subtype of :py:type:`object`, this struct must " +"include :c:type:`PyObject` or :c:type:`PyVarObject` (depending on whether :c:" +"member:`~PyVarObject.ob_size` should be included). These are usually defined " +"by the macro :c:macro:`PyObject_HEAD` or :c:macro:`PyObject_VAR_HEAD`, " +"respectively." +msgstr "" + +msgid "" +"The basic size does not include the GC header size, as that header is not " +"part of :c:macro:`PyObject_HEAD`." +msgstr "" + +msgid "" +"For cases where struct used to declare the base type is unknown, see :c:" +"member:`PyType_Spec.basicsize` and :c:func:`PyType_FromMetaclass`." +msgstr "" + +msgid "Notes about alignment:" +msgstr "" + +msgid "" +":c:member:`!tp_basicsize` must be a multiple of ``_Alignof(PyObject)``. When " +"using ``sizeof`` on a ``struct`` that includes :c:macro:`PyObject_HEAD`, as " +"recommended, the compiler ensures this. When not using a C ``struct``, or " +"when using compiler extensions like ``__attribute__((packed))``, it is up to " +"you." +msgstr "" + +msgid "" +"If the variable items require a particular alignment, :c:member:`!" +"tp_basicsize` and :c:member:`!tp_itemsize` must each be a multiple of that " +"alignment. For example, if a type's variable part stores a ``double``, it is " +"your responsibility that both fields are a multiple of ``_Alignof(double)``." +msgstr "" + +msgid "" +"These fields are inherited separately by subtypes. (That is, if the field is " +"set to zero, :c:func:`PyType_Ready` will copy the value from the base type, " +"indicating that the instances do not need additional storage.)" +msgstr "" + +msgid "" +"If the base type has a non-zero :c:member:`~PyTypeObject.tp_itemsize`, it is " +"generally not safe to set :c:member:`~PyTypeObject.tp_itemsize` to a " +"different non-zero value in a subtype (though this depends on the " +"implementation of the base type)." +msgstr "" + +msgid "" +"A pointer to the instance destructor function. This function must be " +"defined unless the type guarantees that its instances will never be " +"deallocated (as is the case for the singletons ``None`` and ``Ellipsis``). " +"The function signature is::" +msgstr "" +"Покажчик на функцію деструктора екземпляра. Ця функція має бути визначена, " +"якщо тип не гарантує, що її екземпляри ніколи не будуть звільнені (як у " +"випадку сінгтонів ``None`` і ``Ellipsis``). Сигнатура функції:" + +msgid "void tp_dealloc(PyObject *self);" +msgstr "" + +msgid "" +"The destructor function is called by the :c:func:`Py_DECREF` and :c:func:" +"`Py_XDECREF` macros when the new reference count is zero. At this point, " +"the instance is still in existence, but there are no references to it. The " +"destructor function should free all references which the instance owns, free " +"all memory buffers owned by the instance (using the freeing function " +"corresponding to the allocation function used to allocate the buffer), and " +"call the type's :c:member:`~PyTypeObject.tp_free` function. If the type is " +"not subtypable (doesn't have the :c:macro:`Py_TPFLAGS_BASETYPE` flag bit " +"set), it is permissible to call the object deallocator directly instead of " +"via :c:member:`~PyTypeObject.tp_free`. The object deallocator should be the " +"one used to allocate the instance; this is normally :c:func:`PyObject_Del` " +"if the instance was allocated using :c:macro:`PyObject_New` or :c:macro:" +"`PyObject_NewVar`, or :c:func:`PyObject_GC_Del` if the instance was " +"allocated using :c:macro:`PyObject_GC_New` or :c:macro:`PyObject_GC_NewVar`." +msgstr "" + +msgid "" +"If the type supports garbage collection (has the :c:macro:" +"`Py_TPFLAGS_HAVE_GC` flag bit set), the destructor should call :c:func:" +"`PyObject_GC_UnTrack` before clearing any member fields." +msgstr "" + +msgid "" +"static void foo_dealloc(foo_object *self) {\n" +" PyObject_GC_UnTrack(self);\n" +" Py_CLEAR(self->ref);\n" +" Py_TYPE(self)->tp_free((PyObject *)self);\n" +"}" +msgstr "" + +msgid "" +"Finally, if the type is heap allocated (:c:macro:`Py_TPFLAGS_HEAPTYPE`), the " +"deallocator should release the owned reference to its type object (via :c:" +"func:`Py_DECREF`) after calling the type deallocator. In order to avoid " +"dangling pointers, the recommended way to achieve this is:" +msgstr "" + +msgid "" +"static void foo_dealloc(foo_object *self) {\n" +" PyTypeObject *tp = Py_TYPE(self);\n" +" // free references and buffers here\n" +" tp->tp_free(self);\n" +" Py_DECREF(tp);\n" +"}" +msgstr "" + +msgid "" +"In a garbage collected Python, :c:member:`!tp_dealloc` may be called from " +"any Python thread, not just the thread which created the object (if the " +"object becomes part of a refcount cycle, that cycle might be collected by a " +"garbage collection on any thread). This is not a problem for Python API " +"calls, since the thread on which :c:member:`!tp_dealloc` is called will own " +"the Global Interpreter Lock (GIL). However, if the object being destroyed " +"in turn destroys objects from some other C or C++ library, care should be " +"taken to ensure that destroying those objects on the thread which called :c:" +"member:`!tp_dealloc` will not violate any assumptions of the library." +msgstr "" + +msgid "" +"An optional offset to a per-instance function that implements calling the " +"object using the :ref:`vectorcall protocol `, a more efficient " +"alternative of the simpler :c:member:`~PyTypeObject.tp_call`." +msgstr "" +"Необов’язкове зміщення функції для кожного екземпляра, яка реалізує виклик " +"об’єкта за допомогою :ref:`vectorcall протоколу `, більш " +"ефективної альтернативи простішого :c:member:`~PyTypeObject.tp_call`." + +msgid "" +"This field is only used if the flag :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` is " +"set. If so, this must be a positive integer containing the offset in the " +"instance of a :c:type:`vectorcallfunc` pointer." +msgstr "" + +msgid "" +"The *vectorcallfunc* pointer may be ``NULL``, in which case the instance " +"behaves as if :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` was not set: calling the " +"instance falls back to :c:member:`~PyTypeObject.tp_call`." +msgstr "" + +msgid "" +"Any class that sets ``Py_TPFLAGS_HAVE_VECTORCALL`` must also set :c:member:" +"`~PyTypeObject.tp_call` and make sure its behaviour is consistent with the " +"*vectorcallfunc* function. This can be done by setting *tp_call* to :c:func:" +"`PyVectorcall_Call`." +msgstr "" +"Будь-який клас, який встановлює ``Py_TPFLAGS_HAVE_VECTORCALL``, також " +"повинен встановити :c:member:`~PyTypeObject.tp_call` і переконатися, що його " +"поведінка узгоджується з функцією *vectorcallfunc*. Це можна зробити, " +"встановивши *tp_call* на :c:func:`PyVectorcall_Call`." + +msgid "" +"Before version 3.8, this slot was named ``tp_print``. In Python 2.x, it was " +"used for printing to a file. In Python 3.0 to 3.7, it was unused." +msgstr "" +"До версії 3.8 цей слот мав назву ``tp_print``. У Python 2.x він " +"використовувався для друку у файл. У Python від 3.0 до 3.7 він не " +"використовувався." + +msgid "" +"Before version 3.12, it was not recommended for :ref:`mutable heap types " +"` to implement the vectorcall protocol. When a user sets :attr:" +"`~object.__call__` in Python code, only *tp_call* is updated, likely making " +"it inconsistent with the vectorcall function. Since 3.12, setting " +"``__call__`` will disable vectorcall optimization by clearing the :c:macro:" +"`Py_TPFLAGS_HAVE_VECTORCALL` flag." +msgstr "" + +msgid "" +"This field is always inherited. However, the :c:macro:" +"`Py_TPFLAGS_HAVE_VECTORCALL` flag is not always inherited. If it's not set, " +"then the subclass won't use :ref:`vectorcall `, except when :c:" +"func:`PyVectorcall_Call` is explicitly called." +msgstr "" + +msgid "An optional pointer to the get-attribute-string function." +msgstr "Додатковий покажчик на функцію get-attribute-string." + +msgid "" +"This field is deprecated. When it is defined, it should point to a function " +"that acts the same as the :c:member:`~PyTypeObject.tp_getattro` function, " +"but taking a C string instead of a Python string object to give the " +"attribute name." +msgstr "" +"Це поле застаріло. Коли його визначено, він має вказувати на функцію, яка " +"діє так само, як функція :c:member:`~PyTypeObject.tp_getattro`, але " +"використовує рядок C замість рядкового об’єкта Python, щоб надати назву " +"атрибуту." + +msgid "" +"Group: :c:member:`~PyTypeObject.tp_getattr`, :c:member:`~PyTypeObject." +"tp_getattro`" +msgstr "" + +msgid "" +"This field is inherited by subtypes together with :c:member:`~PyTypeObject." +"tp_getattro`: a subtype inherits both :c:member:`~PyTypeObject.tp_getattr` " +"and :c:member:`~PyTypeObject.tp_getattro` from its base type when the " +"subtype's :c:member:`~PyTypeObject.tp_getattr` and :c:member:`~PyTypeObject." +"tp_getattro` are both ``NULL``." +msgstr "" +"Це поле успадковується підтипами разом із :c:member:`~PyTypeObject." +"tp_getattro`: підтип успадковує і :c:member:`~PyTypeObject.tp_getattr`, і :c:" +"member:`~PyTypeObject.tp_getattro` від своєї основи типу, коли підтипи :c:" +"member:`~PyTypeObject.tp_getattr` і :c:member:`~PyTypeObject.tp_getattro` " +"мають значення ``NULL``." + +msgid "" +"An optional pointer to the function for setting and deleting attributes." +msgstr "" +"Додатковий вказівник на функцію для налаштування та видалення атрибутів." + +msgid "" +"This field is deprecated. When it is defined, it should point to a function " +"that acts the same as the :c:member:`~PyTypeObject.tp_setattro` function, " +"but taking a C string instead of a Python string object to give the " +"attribute name." +msgstr "" +"Це поле застаріло. Коли його визначено, він має вказувати на функцію, яка " +"діє так само, як функція :c:member:`~PyTypeObject.tp_setattro`, але " +"використовує рядок C замість рядкового об’єкта Python, щоб надати назву " +"атрибуту." + +msgid "" +"Group: :c:member:`~PyTypeObject.tp_setattr`, :c:member:`~PyTypeObject." +"tp_setattro`" +msgstr "" + +msgid "" +"This field is inherited by subtypes together with :c:member:`~PyTypeObject." +"tp_setattro`: a subtype inherits both :c:member:`~PyTypeObject.tp_setattr` " +"and :c:member:`~PyTypeObject.tp_setattro` from its base type when the " +"subtype's :c:member:`~PyTypeObject.tp_setattr` and :c:member:`~PyTypeObject." +"tp_setattro` are both ``NULL``." +msgstr "" +"Це поле успадковується підтипами разом із :c:member:`~PyTypeObject." +"tp_setattro`: підтип успадковує і :c:member:`~PyTypeObject.tp_setattr`, і :c:" +"member:`~PyTypeObject.tp_setattro` від своєї основи типу, коли підтипи :c:" +"member:`~PyTypeObject.tp_setattr` і :c:member:`~PyTypeObject.tp_setattro` " +"мають значення ``NULL``." + +msgid "" +"Pointer to an additional structure that contains fields relevant only to " +"objects which implement :term:`awaitable` and :term:`asynchronous iterator` " +"protocols at the C-level. See :ref:`async-structs` for details." +msgstr "" +"Покажчик на додаткову структуру, яка містить поля, що стосуються лише " +"об’єктів, які реалізують протоколи :term:`awaitable` і :term:`asynchronous " +"iterator` на рівні C. Дивіться :ref:`async-structs` для деталей." + +msgid "Formerly known as ``tp_compare`` and ``tp_reserved``." +msgstr "Раніше відомий як ``tp_compare`` і ``tp_reserved``." + +msgid "" +"The :c:member:`~PyTypeObject.tp_as_async` field is not inherited, but the " +"contained fields are inherited individually." +msgstr "" +"Поле :c:member:`~PyTypeObject.tp_as_async` не успадковується, але поля, що " +"містяться, успадковуються окремо." + +msgid "" +"An optional pointer to a function that implements the built-in function :" +"func:`repr`." +msgstr "" +"Додатковий покажчик на функцію, яка реалізує вбудовану функцію :func:`repr`." + +msgid "The signature is the same as for :c:func:`PyObject_Repr`::" +msgstr "Підпис такий самий, як і для :c:func:`PyObject_Repr`::" + +msgid "PyObject *tp_repr(PyObject *self);" +msgstr "" + +msgid "" +"The function must return a string or a Unicode object. Ideally, this " +"function should return a string that, when passed to :func:`eval`, given a " +"suitable environment, returns an object with the same value. If this is not " +"feasible, it should return a string starting with ``'<'`` and ending with " +"``'>'`` from which both the type and the value of the object can be deduced." +msgstr "" +"Функція має повертати рядок або об’єкт Unicode. В ідеалі ця функція має " +"повертати рядок, який, переданий до :func:`eval`, за відповідного середовища " +"повертає об’єкт із тим самим значенням. Якщо це неможливо, він повинен " +"повертати рядок, що починається з ``'<'`` та закінчується на ``'>'``, з " +"якого можна вивести як тип, так і значення об’єкта." + +msgid "**Default:**" +msgstr "**За замовчуванням:**" + +msgid "" +"When this field is not set, a string of the form ``<%s object at %p>`` is " +"returned, where ``%s`` is replaced by the type name, and ``%p`` by the " +"object's memory address." +msgstr "" +"Якщо це поле не встановлено, повертається рядок у формі ``<%s object at " +"%p>``, де ``%s`` замінюється назвою типу, а ``%p`` адресою пам'яті об'єкта." + +msgid "" +"Pointer to an additional structure that contains fields relevant only to " +"objects which implement the number protocol. These fields are documented " +"in :ref:`number-structs`." +msgstr "" +"Покажчик на додаткову структуру, яка містить поля, що стосуються лише " +"об’єктів, які реалізують протокол номерів. Ці поля задокументовані в :ref:" +"`number-structs`." + +msgid "" +"The :c:member:`~PyTypeObject.tp_as_number` field is not inherited, but the " +"contained fields are inherited individually." +msgstr "" +"Поле :c:member:`~PyTypeObject.tp_as_number` не успадковується, але поля, що " +"містяться, успадковуються окремо." + +msgid "" +"Pointer to an additional structure that contains fields relevant only to " +"objects which implement the sequence protocol. These fields are documented " +"in :ref:`sequence-structs`." +msgstr "" +"Покажчик на додаткову структуру, яка містить поля, що стосуються лише " +"об’єктів, які реалізують протокол послідовності. Ці поля задокументовані в :" +"ref:`sequence-structs`." + +msgid "" +"The :c:member:`~PyTypeObject.tp_as_sequence` field is not inherited, but the " +"contained fields are inherited individually." +msgstr "" +"Поле :c:member:`~PyTypeObject.tp_as_sequence` не успадковується, але поля, " +"що містяться, успадковуються окремо." + +msgid "" +"Pointer to an additional structure that contains fields relevant only to " +"objects which implement the mapping protocol. These fields are documented " +"in :ref:`mapping-structs`." +msgstr "" +"Покажчик на додаткову структуру, яка містить поля, що стосуються лише " +"об’єктів, які реалізують протокол відображення. Ці поля задокументовані в :" +"ref:`mapping-structs`." + +msgid "" +"The :c:member:`~PyTypeObject.tp_as_mapping` field is not inherited, but the " +"contained fields are inherited individually." +msgstr "" +"Поле :c:member:`~PyTypeObject.tp_as_mapping` не успадковується, але поля, що " +"містяться, успадковуються окремо." + +msgid "" +"An optional pointer to a function that implements the built-in function :" +"func:`hash`." +msgstr "" +"Додатковий покажчик на функцію, яка реалізує вбудовану функцію :func:`hash`." + +msgid "The signature is the same as for :c:func:`PyObject_Hash`::" +msgstr "Підпис такий самий, як і для :c:func:`PyObject_Hash`::" + +msgid "Py_hash_t tp_hash(PyObject *);" +msgstr "" + +msgid "" +"The value ``-1`` should not be returned as a normal return value; when an " +"error occurs during the computation of the hash value, the function should " +"set an exception and return ``-1``." +msgstr "" +"Значення ``-1`` не повинно повертатися як звичайне значення, що " +"повертається; якщо під час обчислення хеш-значення виникає помилка, функція " +"повинна встановити виняток і повернути ``-1``." + +msgid "" +"When this field is not set (*and* :c:member:`~PyTypeObject.tp_richcompare` " +"is not set), an attempt to take the hash of the object raises :exc:" +"`TypeError`. This is the same as setting it to :c:func:" +"`PyObject_HashNotImplemented`." +msgstr "" + +msgid "" +"This field can be set explicitly to :c:func:`PyObject_HashNotImplemented` to " +"block inheritance of the hash method from a parent type. This is interpreted " +"as the equivalent of ``__hash__ = None`` at the Python level, causing " +"``isinstance(o, collections.Hashable)`` to correctly return ``False``. Note " +"that the converse is also true - setting ``__hash__ = None`` on a class at " +"the Python level will result in the ``tp_hash`` slot being set to :c:func:" +"`PyObject_HashNotImplemented`." +msgstr "" +"У цьому полі можна явно встановити значення :c:func:" +"`PyObject_HashNotImplemented`, щоб заблокувати успадкування геш-методу від " +"батьківського типу. Це інтерпретується як еквівалент ``__hash__ = None`` на " +"рівні Python, змушуючи ``isinstance(o, collections.Hashable)`` правильно " +"повертати ``False``. Зауважте, що зворотне також вірно – встановлення " +"``__hash__ = None`` для класу на рівні Python призведе до того, що слот " +"``tp_hash`` буде встановлено на :c:func:`PyObject_HashNotImplemented`." + +msgid "" +"Group: :c:member:`~PyTypeObject.tp_hash`, :c:member:`~PyTypeObject." +"tp_richcompare`" +msgstr "" + +msgid "" +"This field is inherited by subtypes together with :c:member:`~PyTypeObject." +"tp_richcompare`: a subtype inherits both of :c:member:`~PyTypeObject." +"tp_richcompare` and :c:member:`~PyTypeObject.tp_hash`, when the subtype's :c:" +"member:`~PyTypeObject.tp_richcompare` and :c:member:`~PyTypeObject.tp_hash` " +"are both ``NULL``." +msgstr "" +"Це поле успадковується підтипами разом із :c:member:`~PyTypeObject." +"tp_richcompare`: підтип успадковує як :c:member:`~PyTypeObject." +"tp_richcompare`, так і :c:member:`~PyTypeObject.tp_hash`, коли підтипи :c:" +"member:`~PyTypeObject.tp_richcompare` і :c:member:`~PyTypeObject.tp_hash` " +"мають значення ``NULL``." + +msgid ":c:data:`PyBaseObject_Type` uses :c:func:`PyObject_GenericHash`." +msgstr "" + +msgid "" +"An optional pointer to a function that implements calling the object. This " +"should be ``NULL`` if the object is not callable. The signature is the same " +"as for :c:func:`PyObject_Call`::" +msgstr "" +"Додатковий покажчик на функцію, яка реалізує виклик об’єкта. Це має бути " +"``NULL``, якщо об’єкт не можна викликати. Підпис такий самий, як і для :c:" +"func:`PyObject_Call`::" + +msgid "PyObject *tp_call(PyObject *self, PyObject *args, PyObject *kwargs);" +msgstr "" + +msgid "" +"An optional pointer to a function that implements the built-in operation :" +"func:`str`. (Note that :class:`str` is a type now, and :func:`str` calls " +"the constructor for that type. This constructor calls :c:func:" +"`PyObject_Str` to do the actual work, and :c:func:`PyObject_Str` will call " +"this handler.)" +msgstr "" +"Додатковий покажчик на функцію, яка реалізує вбудовану операцію :func:`str`. " +"(Зауважте, що :class:`str` тепер є типом, а :func:`str` викликає конструктор " +"для цього типу. Цей конструктор викликає :c:func:`PyObject_Str` для " +"виконання фактичної роботи, а :c:func:`PyObject_Str` викличе цей обробник.)" + +msgid "The signature is the same as for :c:func:`PyObject_Str`::" +msgstr "Підпис такий самий, як і для :c:func:`PyObject_Str`::" + +msgid "PyObject *tp_str(PyObject *self);" +msgstr "" + +msgid "" +"The function must return a string or a Unicode object. It should be a " +"\"friendly\" string representation of the object, as this is the " +"representation that will be used, among other things, by the :func:`print` " +"function." +msgstr "" +"Функція має повертати рядок або об’єкт Unicode. Це має бути \"дружнє\" " +"рядкове представлення об’єкта, оскільки це представлення буде " +"використовуватися, серед іншого, функцією :func:`print`." + +msgid "" +"When this field is not set, :c:func:`PyObject_Repr` is called to return a " +"string representation." +msgstr "" +"Якщо це поле не встановлено, :c:func:`PyObject_Repr` викликається для " +"повернення рядкового представлення." + +msgid "An optional pointer to the get-attribute function." +msgstr "Додатковий покажчик на функцію get-attribute." + +msgid "The signature is the same as for :c:func:`PyObject_GetAttr`::" +msgstr "Підпис такий самий, як і для :c:func:`PyObject_GetAttr`::" + +msgid "PyObject *tp_getattro(PyObject *self, PyObject *attr);" +msgstr "" + +msgid "" +"It is usually convenient to set this field to :c:func:" +"`PyObject_GenericGetAttr`, which implements the normal way of looking for " +"object attributes." +msgstr "" +"Зазвичай зручно встановити для цього поля значення :c:func:" +"`PyObject_GenericGetAttr`, що реалізує звичайний спосіб пошуку атрибутів " +"об’єкта." + +msgid "" +"This field is inherited by subtypes together with :c:member:`~PyTypeObject." +"tp_getattr`: a subtype inherits both :c:member:`~PyTypeObject.tp_getattr` " +"and :c:member:`~PyTypeObject.tp_getattro` from its base type when the " +"subtype's :c:member:`~PyTypeObject.tp_getattr` and :c:member:`~PyTypeObject." +"tp_getattro` are both ``NULL``." +msgstr "" +"Це поле успадковується підтипами разом із :c:member:`~PyTypeObject." +"tp_getattr`: підтип успадковує і :c:member:`~PyTypeObject.tp_getattr`, і :c:" +"member:`~PyTypeObject.tp_getattro` від своєї основи типу, коли підтипи :c:" +"member:`~PyTypeObject.tp_getattr` і :c:member:`~PyTypeObject.tp_getattro` " +"мають значення ``NULL``." + +msgid ":c:data:`PyBaseObject_Type` uses :c:func:`PyObject_GenericGetAttr`." +msgstr "" + +msgid "The signature is the same as for :c:func:`PyObject_SetAttr`::" +msgstr "Підпис такий самий, як і для :c:func:`PyObject_SetAttr`::" + +msgid "int tp_setattro(PyObject *self, PyObject *attr, PyObject *value);" +msgstr "" + +msgid "" +"In addition, setting *value* to ``NULL`` to delete an attribute must be " +"supported. It is usually convenient to set this field to :c:func:" +"`PyObject_GenericSetAttr`, which implements the normal way of setting object " +"attributes." +msgstr "" +"Крім того, для видалення атрибута має підтримуватися встановлення *значення* " +"на ``NULL``. Зазвичай зручно встановити для цього поля значення :c:func:" +"`PyObject_GenericSetAttr`, що реалізує звичайний спосіб встановлення " +"атрибутів об’єкта." + +msgid "" +"This field is inherited by subtypes together with :c:member:`~PyTypeObject." +"tp_setattr`: a subtype inherits both :c:member:`~PyTypeObject.tp_setattr` " +"and :c:member:`~PyTypeObject.tp_setattro` from its base type when the " +"subtype's :c:member:`~PyTypeObject.tp_setattr` and :c:member:`~PyTypeObject." +"tp_setattro` are both ``NULL``." +msgstr "" +"Це поле успадковується підтипами разом із :c:member:`~PyTypeObject." +"tp_setattr`: підтип успадковує і :c:member:`~PyTypeObject.tp_setattr`, і :c:" +"member:`~PyTypeObject.tp_setattro` від своєї основи типу, коли підтипи :c:" +"member:`~PyTypeObject.tp_setattr` і :c:member:`~PyTypeObject.tp_setattro` " +"мають значення ``NULL``." + +msgid ":c:data:`PyBaseObject_Type` uses :c:func:`PyObject_GenericSetAttr`." +msgstr "" + +msgid "" +"Pointer to an additional structure that contains fields relevant only to " +"objects which implement the buffer interface. These fields are documented " +"in :ref:`buffer-structs`." +msgstr "" +"Покажчик на додаткову структуру, яка містить поля, що стосуються лише " +"об’єктів, які реалізують інтерфейс буфера. Ці поля задокументовані в :ref:" +"`buffer-structs`." + +msgid "" +"The :c:member:`~PyTypeObject.tp_as_buffer` field is not inherited, but the " +"contained fields are inherited individually." +msgstr "" +"Поле :c:member:`~PyTypeObject.tp_as_buffer` не успадковується, але поля, що " +"містяться, успадковуються окремо." + +msgid "" +"This field is a bit mask of various flags. Some flags indicate variant " +"semantics for certain situations; others are used to indicate that certain " +"fields in the type object (or in the extension structures referenced via :c:" +"member:`~PyTypeObject.tp_as_number`, :c:member:`~PyTypeObject." +"tp_as_sequence`, :c:member:`~PyTypeObject.tp_as_mapping`, and :c:member:" +"`~PyTypeObject.tp_as_buffer`) that were historically not always present are " +"valid; if such a flag bit is clear, the type fields it guards must not be " +"accessed and must be considered to have a zero or ``NULL`` value instead." +msgstr "" +"Це поле є бітовою маскою різних прапорів. Деякі прапорці вказують на " +"варіантну семантику для певних ситуацій; інші використовуються для вказівки, " +"що певні поля в об’єкті типу (або в структурах розширення, на які " +"посилаються через :c:member:`~PyTypeObject.tp_as_number`, :c:member:" +"`~PyTypeObject.tp_as_sequence`, :c:member:`~PyTypeObject.tp_as_mapping` і :c:" +"member:`~PyTypeObject.tp_as_buffer`), які історично не завжди були присутні, " +"є дійсними; якщо такий біт прапора очищений, до полів типу, які він " +"охороняє, не можна звертатися, і вони повинні вважатися такими, що мають " +"нульове або ``NULL`` значення." + +msgid "" +"Inheritance of this field is complicated. Most flag bits are inherited " +"individually, i.e. if the base type has a flag bit set, the subtype inherits " +"this flag bit. The flag bits that pertain to extension structures are " +"strictly inherited if the extension structure is inherited, i.e. the base " +"type's value of the flag bit is copied into the subtype together with a " +"pointer to the extension structure. The :c:macro:`Py_TPFLAGS_HAVE_GC` flag " +"bit is inherited together with the :c:member:`~PyTypeObject.tp_traverse` " +"and :c:member:`~PyTypeObject.tp_clear` fields, i.e. if the :c:macro:" +"`Py_TPFLAGS_HAVE_GC` flag bit is clear in the subtype and the :c:member:" +"`~PyTypeObject.tp_traverse` and :c:member:`~PyTypeObject.tp_clear` fields in " +"the subtype exist and have ``NULL`` values. .. XXX are most flag bits " +"*really* inherited individually?" +msgstr "" + +msgid "" +":c:data:`PyBaseObject_Type` uses ``Py_TPFLAGS_DEFAULT | " +"Py_TPFLAGS_BASETYPE``." +msgstr "" + +msgid "**Bit Masks:**" +msgstr "**Бітові маски:**" + +msgid "" +"The following bit masks are currently defined; these can be ORed together " +"using the ``|`` operator to form the value of the :c:member:`~PyTypeObject." +"tp_flags` field. The macro :c:func:`PyType_HasFeature` takes a type and a " +"flags value, *tp* and *f*, and checks whether ``tp->tp_flags & f`` is non-" +"zero." +msgstr "" +"Наразі визначено такі бітові маски; їх можна об’єднати АБО за допомогою " +"оператора ``|``, щоб сформувати значення поля :c:member:`~PyTypeObject." +"tp_flags`. Макрос :c:func:`PyType_HasFeature` приймає тип і значення " +"прапорців, *tp* і *f*, і перевіряє, чи ``tp->tp_flags & f`` є відмінним від " +"нуля." + +msgid "" +"This bit is set when the type object itself is allocated on the heap, for " +"example, types created dynamically using :c:func:`PyType_FromSpec`. In this " +"case, the :c:member:`~PyObject.ob_type` field of its instances is considered " +"a reference to the type, and the type object is INCREF'ed when a new " +"instance is created, and DECREF'ed when an instance is destroyed (this does " +"not apply to instances of subtypes; only the type referenced by the " +"instance's ob_type gets INCREF'ed or DECREF'ed). Heap types should also :ref:" +"`support garbage collection ` as they can form a " +"reference cycle with their own module object." +msgstr "" + +msgid "???" +msgstr "???" + +msgid "" +"This bit is set when the type can be used as the base type of another type. " +"If this bit is clear, the type cannot be subtyped (similar to a \"final\" " +"class in Java)." +msgstr "" +"Цей біт встановлюється, коли тип можна використовувати як базовий тип іншого " +"типу. Якщо цей біт ясний, тип не може бути підтиповим (подібно до " +"\"фінального\" класу в Java)." + +msgid "" +"This bit is set when the type object has been fully initialized by :c:func:" +"`PyType_Ready`." +msgstr "" +"Цей біт встановлюється, коли об’єкт типу повністю ініціалізовано :c:func:" +"`PyType_Ready`." + +msgid "" +"This bit is set while :c:func:`PyType_Ready` is in the process of " +"initializing the type object." +msgstr "" +"Цей біт встановлюється, коли :c:func:`PyType_Ready` знаходиться в процесі " +"ініціалізації об’єкта типу." + +msgid "" +"This bit is set when the object supports garbage collection. If this bit is " +"set, instances must be created using :c:macro:`PyObject_GC_New` and " +"destroyed using :c:func:`PyObject_GC_Del`. More information in section :ref:" +"`supporting-cycle-detection`. This bit also implies that the GC-related " +"fields :c:member:`~PyTypeObject.tp_traverse` and :c:member:`~PyTypeObject." +"tp_clear` are present in the type object." +msgstr "" + +msgid "" +"Group: :c:macro:`Py_TPFLAGS_HAVE_GC`, :c:member:`~PyTypeObject." +"tp_traverse`, :c:member:`~PyTypeObject.tp_clear`" +msgstr "" + +msgid "" +"The :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit is inherited together with the :c:" +"member:`~PyTypeObject.tp_traverse` and :c:member:`~PyTypeObject.tp_clear` " +"fields, i.e. if the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit is clear in the " +"subtype and the :c:member:`~PyTypeObject.tp_traverse` and :c:member:" +"`~PyTypeObject.tp_clear` fields in the subtype exist and have ``NULL`` " +"values." +msgstr "" + +msgid "" +"This is a bitmask of all the bits that pertain to the existence of certain " +"fields in the type object and its extension structures. Currently, it " +"includes the following bits: :c:macro:`Py_TPFLAGS_HAVE_STACKLESS_EXTENSION`." +msgstr "" + +msgid "This bit indicates that objects behave like unbound methods." +msgstr "Цей біт вказує, що об’єкти поводяться як незв’язані методи." + +msgid "If this flag is set for ``type(meth)``, then:" +msgstr "Якщо цей прапор встановлено для ``type(meth)``, тоді:" + +msgid "" +"``meth.__get__(obj, cls)(*args, **kwds)`` (with ``obj`` not None) must be " +"equivalent to ``meth(obj, *args, **kwds)``." +msgstr "" +"``meth.__get__(obj, cls)(*args, **kwds)`` (з ``obj`` не None) має бути " +"еквівалентним ``meth(obj, *args, **kwds)``." + +msgid "" +"``meth.__get__(None, cls)(*args, **kwds)`` must be equivalent to " +"``meth(*args, **kwds)``." +msgstr "" +"``meth.__get__(None, cls)(*args, **kwds)`` має бути еквівалентним " +"``meth(*args, **kwds)``." + +msgid "" +"This flag enables an optimization for typical method calls like ``obj." +"meth()``: it avoids creating a temporary \"bound method\" object for ``obj." +"meth``." +msgstr "" +"Цей прапорець дає змогу оптимізувати типові виклики методів, як-от ``obj." +"meth()``: він уникає створення тимчасового об’єкта \"зв’язаного методу\" для " +"``obj.meth``." + +msgid "" +"This flag is never inherited by types without the :c:macro:" +"`Py_TPFLAGS_IMMUTABLETYPE` flag set. For extension types, it is inherited " +"whenever :c:member:`~PyTypeObject.tp_descr_get` is inherited." +msgstr "" + +msgid "" +"This bit indicates that instances of the class have a `~object.__dict__` " +"attribute, and that the space for the dictionary is managed by the VM." +msgstr "" + +msgid "If this flag is set, :c:macro:`Py_TPFLAGS_HAVE_GC` should also be set." +msgstr "" + +msgid "" +"The type traverse function must call :c:func:`PyObject_VisitManagedDict` and " +"its clear function must call :c:func:`PyObject_ClearManagedDict`." +msgstr "" + +msgid "" +"This flag is inherited unless the :c:member:`~PyTypeObject.tp_dictoffset` " +"field is set in a superclass." +msgstr "" + +msgid "" +"This bit indicates that instances of the class should be weakly " +"referenceable." +msgstr "" + +msgid "" +"This flag is inherited unless the :c:member:`~PyTypeObject." +"tp_weaklistoffset` field is set in a superclass." +msgstr "" + +msgid "" +"Only usable with variable-size types, i.e. ones with non-zero :c:member:" +"`~PyTypeObject.tp_itemsize`." +msgstr "" + +msgid "" +"Indicates that the variable-sized portion of an instance of this type is at " +"the end of the instance's memory area, at an offset of ``Py_TYPE(obj)-" +">tp_basicsize`` (which may be different in each subclass)." +msgstr "" + +msgid "" +"When setting this flag, be sure that all superclasses either use this memory " +"layout, or are not variable-sized. Python does not check this." +msgstr "" + +msgid "This flag is inherited." +msgstr "" + +msgid "" +"These flags are used by functions such as :c:func:`PyLong_Check` to quickly " +"determine if a type is a subclass of a built-in type; such specific checks " +"are faster than a generic check, like :c:func:`PyObject_IsInstance`. Custom " +"types that inherit from built-ins should have their :c:member:`~PyTypeObject." +"tp_flags` set appropriately, or the code that interacts with such types will " +"behave differently depending on what kind of check is used." +msgstr "" +"Ці позначки використовуються такими функціями, як :c:func:`PyLong_Check`, " +"щоб швидко визначити, чи є тип підкласом вбудованого типу; такі спеціальні " +"перевірки є швидшими, ніж загальні перевірки, наприклад :c:func:" +"`PyObject_IsInstance`. Користувальницькі типи, які успадковуються від " +"вбудованих, повинні мати належним чином встановлені :c:member:`~PyTypeObject." +"tp_flags`, інакше код, який взаємодіє з такими типами, поводитиметься по-" +"різному залежно від типу перевірки, що використовується." + +msgid "" +"This bit is set when the :c:member:`~PyTypeObject.tp_finalize` slot is " +"present in the type structure." +msgstr "" +"Цей біт встановлюється, коли слот :c:member:`~PyTypeObject.tp_finalize` " +"присутній у структурі типу." + +msgid "" +"This flag isn't necessary anymore, as the interpreter assumes the :c:member:" +"`~PyTypeObject.tp_finalize` slot is always present in the type structure." +msgstr "" +"Цей прапорець більше не потрібен, оскільки інтерпретатор припускає, що слот :" +"c:member:`~PyTypeObject.tp_finalize` завжди присутній у структурі типу." + +msgid "" +"This bit is set when the class implements the :ref:`vectorcall protocol " +"`. See :c:member:`~PyTypeObject.tp_vectorcall_offset` for " +"details." +msgstr "" +"Цей біт встановлюється, коли клас реалізує :ref:`vectorcall протокол " +"`. Перегляньте :c:member:`~PyTypeObject.tp_vectorcall_offset` " +"для деталей." + +msgid "" +"This bit is inherited if :c:member:`~PyTypeObject.tp_call` is also inherited." +msgstr "" + +msgid "" +"This flag is now removed from a class when the class's :py:meth:`~object." +"__call__` method is reassigned." +msgstr "" + +msgid "This flag can now be inherited by mutable classes." +msgstr "" + +msgid "" +"This bit is set for type objects that are immutable: type attributes cannot " +"be set nor deleted." +msgstr "" +"Цей біт встановлено для об’єктів типу, які є незмінними: атрибути типу не " +"можна ні встановити, ні видалити." + +msgid "" +":c:func:`PyType_Ready` automatically applies this flag to :ref:`static types " +"`." +msgstr "" +":c:func:`PyType_Ready` автоматично застосовує цей прапорець до :ref:" +"`статичних типів `." + +msgid "This flag is not inherited." +msgstr "Цей прапорець не успадковується." + +msgid "" +"Disallow creating instances of the type: set :c:member:`~PyTypeObject." +"tp_new` to NULL and don't create the ``__new__`` key in the type dictionary." +msgstr "" +"Заборонити створення екземплярів типу: установіть для :c:member:" +"`~PyTypeObject.tp_new` значення NULL і не створюйте ключ ``__new__`` у " +"словнику типу." + +msgid "" +"The flag must be set before creating the type, not after. For example, it " +"must be set before :c:func:`PyType_Ready` is called on the type." +msgstr "" +"Прапор має бути встановлений до створення типу, а не після. Наприклад, його " +"потрібно встановити перед викликом :c:func:`PyType_Ready` для типу." + +msgid "" +"The flag is set automatically on :ref:`static types ` if :c:" +"member:`~PyTypeObject.tp_base` is NULL or ``&PyBaseObject_Type`` and :c:" +"member:`~PyTypeObject.tp_new` is NULL." +msgstr "" +"Прапорець автоматично встановлюється для :ref:`статичних типів `, якщо :c:member:`~PyTypeObject.tp_base` має значення NULL або " +"``&PyBaseObject_Type`` і :c:member:`~PyTypeObject.tp_new` має значення NULL." + +msgid "" +"This flag is not inherited. However, subclasses will not be instantiable " +"unless they provide a non-NULL :c:member:`~PyTypeObject.tp_new` (which is " +"only possible via the C API)." +msgstr "" + +msgid "" +"To disallow instantiating a class directly but allow instantiating its " +"subclasses (e.g. for an :term:`abstract base class`), do not use this flag. " +"Instead, make :c:member:`~PyTypeObject.tp_new` only succeed for subclasses." +msgstr "" + +msgid "" +"This bit indicates that instances of the class may match mapping patterns " +"when used as the subject of a :keyword:`match` block. It is automatically " +"set when registering or subclassing :class:`collections.abc.Mapping`, and " +"unset when registering :class:`collections.abc.Sequence`." +msgstr "" +"Цей біт вказує на те, що екземпляри класу можуть відповідати шаблонам " +"відображення, якщо використовуються як суб’єкт блоку :keyword:`match`. Він " +"автоматично встановлюється під час реєстрації або підкласу :class:" +"`collections.abc.Mapping` і скасовується під час реєстрації :class:" +"`collections.abc.Sequence`." + +msgid "" +":c:macro:`Py_TPFLAGS_MAPPING` and :c:macro:`Py_TPFLAGS_SEQUENCE` are " +"mutually exclusive; it is an error to enable both flags simultaneously." +msgstr "" + +msgid "" +"This flag is inherited by types that do not already set :c:macro:" +"`Py_TPFLAGS_SEQUENCE`." +msgstr "" + +msgid ":pep:`634` -- Structural Pattern Matching: Specification" +msgstr ":pep:`634` -- Структурне зіставлення шаблонів: Специфікація" + +msgid "" +"This bit indicates that instances of the class may match sequence patterns " +"when used as the subject of a :keyword:`match` block. It is automatically " +"set when registering or subclassing :class:`collections.abc.Sequence`, and " +"unset when registering :class:`collections.abc.Mapping`." +msgstr "" +"Цей біт вказує на те, що екземпляри класу можуть відповідати шаблонам " +"послідовності, коли використовуються як суб’єкт блоку :keyword:`match`. Він " +"автоматично встановлюється під час реєстрації або підкласу :class:" +"`collections.abc.Sequence` і скасовується під час реєстрації :class:" +"`collections.abc.Mapping`." + +msgid "" +"This flag is inherited by types that do not already set :c:macro:" +"`Py_TPFLAGS_MAPPING`." +msgstr "" + +msgid "" +"Internal. Do not set or unset this flag. To indicate that a class has " +"changed call :c:func:`PyType_Modified`" +msgstr "" + +msgid "" +"This flag is present in header files, but is not be used. It will be removed " +"in a future version of CPython" +msgstr "" + +msgid "" +"An optional pointer to a NUL-terminated C string giving the docstring for " +"this type object. This is exposed as the :attr:`~type.__doc__` attribute on " +"the type and instances of the type." +msgstr "" + +msgid "This field is *not* inherited by subtypes." +msgstr "Це поле *не* успадковується підтипами." + +msgid "" +"An optional pointer to a traversal function for the garbage collector. This " +"is only used if the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit is set. The " +"signature is::" +msgstr "" + +msgid "int tp_traverse(PyObject *self, visitproc visit, void *arg);" +msgstr "" + +msgid "" +"More information about Python's garbage collection scheme can be found in " +"section :ref:`supporting-cycle-detection`." +msgstr "" +"Більше інформації про схему збирання сміття Python можна знайти в розділі :" +"ref:`supporting-cycle-detection`." + +msgid "" +"The :c:member:`~PyTypeObject.tp_traverse` pointer is used by the garbage " +"collector to detect reference cycles. A typical implementation of a :c:" +"member:`~PyTypeObject.tp_traverse` function simply calls :c:func:`Py_VISIT` " +"on each of the instance's members that are Python objects that the instance " +"owns. For example, this is function :c:func:`!local_traverse` from the :mod:" +"`!_thread` extension module::" +msgstr "" + +msgid "" +"static int\n" +"local_traverse(localobject *self, visitproc visit, void *arg)\n" +"{\n" +" Py_VISIT(self->args);\n" +" Py_VISIT(self->kw);\n" +" Py_VISIT(self->dict);\n" +" return 0;\n" +"}" +msgstr "" + +msgid "" +"Note that :c:func:`Py_VISIT` is called only on those members that can " +"participate in reference cycles. Although there is also a ``self->key`` " +"member, it can only be ``NULL`` or a Python string and therefore cannot be " +"part of a reference cycle." +msgstr "" +"Зауважте, що :c:func:`Py_VISIT` викликається лише для тих членів, які можуть " +"брати участь у еталонних циклах. Хоча також є член ``self->key``, він може " +"бути лише ``NULL`` або рядком Python і тому не може бути частиною еталонного " +"циклу." + +msgid "" +"On the other hand, even if you know a member can never be part of a cycle, " +"as a debugging aid you may want to visit it anyway just so the :mod:`gc` " +"module's :func:`~gc.get_referents` function will include it." +msgstr "" +"З іншого боку, навіть якщо ви знаєте, що член ніколи не може бути частиною " +"циклу, як допомога в налагодженні, ви можете все одно відвідати його, щоб " +"скористатися функцією :func:`~gc.get_referents` модуля :mod:`gc` буде " +"включати його." + +msgid "" +"Heap types (:c:macro:`Py_TPFLAGS_HEAPTYPE`) must visit their type with::" +msgstr "" + +msgid "Py_VISIT(Py_TYPE(self));" +msgstr "" + +msgid "" +"It is only needed since Python 3.9. To support Python 3.8 and older, this " +"line must be conditional::" +msgstr "" + +msgid "" +"#if PY_VERSION_HEX >= 0x03090000\n" +" Py_VISIT(Py_TYPE(self));\n" +"#endif" +msgstr "" + +msgid "" +"If the :c:macro:`Py_TPFLAGS_MANAGED_DICT` bit is set in the :c:member:" +"`~PyTypeObject.tp_flags` field, the traverse function must call :c:func:" +"`PyObject_VisitManagedDict` like this::" +msgstr "" + +msgid "PyObject_VisitManagedDict((PyObject*)self, visit, arg);" +msgstr "" + +msgid "" +"When implementing :c:member:`~PyTypeObject.tp_traverse`, only the members " +"that the instance *owns* (by having :term:`strong references ` to them) must be visited. For instance, if an object supports " +"weak references via the :c:member:`~PyTypeObject.tp_weaklist` slot, the " +"pointer supporting the linked list (what *tp_weaklist* points to) must " +"**not** be visited as the instance does not directly own the weak references " +"to itself (the weakreference list is there to support the weak reference " +"machinery, but the instance has no strong reference to the elements inside " +"it, as they are allowed to be removed even if the instance is still alive)." +msgstr "" +"Під час реалізації :c:member:`~PyTypeObject.tp_traverse` необхідно відвідати " +"лише члени, якими *володіє* примірник (через наявність :term:`сильних " +"посилань ` на них). Наприклад, якщо об’єкт підтримує " +"слабкі посилання через слот :c:member:`~PyTypeObject.tp_weaklist`, " +"вказівник, що підтримує зв’язаний список (на що вказує *tp_weaklist*), " +"**не** має відвідуватися, як це робить екземпляр не володіє безпосередньо " +"слабкими посиланнями на себе (список слабких посилань існує для підтримки " +"механізму слабких посилань, але екземпляр не має сильного посилання на " +"елементи всередині нього, оскільки їх можна видалити, навіть якщо екземпляр " +"все ще живий)." + +msgid "" +"Note that :c:func:`Py_VISIT` requires the *visit* and *arg* parameters to :c:" +"func:`!local_traverse` to have these specific names; don't name them just " +"anything." +msgstr "" + +msgid "" +"Instances of :ref:`heap-allocated types ` hold a reference to " +"their type. Their traversal function must therefore either visit :c:func:" +"`Py_TYPE(self) `, or delegate this responsibility by calling " +"``tp_traverse`` of another heap-allocated type (such as a heap-allocated " +"superclass). If they do not, the type object may not be garbage-collected." +msgstr "" +"Екземпляри :ref:`виділених у купі типів ` містять посилання на " +"свій тип. Таким чином, їх функція обходу повинна або відвідати :c:func:" +"`Py_TYPE(self) `, або делегувати цю відповідальність, викликавши " +"``tp_traverse`` іншого типу, виділеного купою (наприклад, суперкласу, " +"виділеного купою). Якщо вони цього не роблять, об’єкт типу може не збиратися " +"сміттям." + +msgid "" +"Heap-allocated types are expected to visit ``Py_TYPE(self)`` in " +"``tp_traverse``. In earlier versions of Python, due to `bug 40217 `_, doing this may lead to crashes in subclasses." +msgstr "" +"Очікується, що типи, виділені в купі, відвідуватимуть ``Py_TYPE(self)`` у " +"``tp_traverse``. У попередніх версіях Python, через `помилку 40217 `_, це може призвести до збоїв у підкласах." + +msgid "" +"This field is inherited by subtypes together with :c:member:`~PyTypeObject." +"tp_clear` and the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit: the flag bit, :c:" +"member:`~PyTypeObject.tp_traverse`, and :c:member:`~PyTypeObject.tp_clear` " +"are all inherited from the base type if they are all zero in the subtype." +msgstr "" + +msgid "" +"An optional pointer to a clear function for the garbage collector. This is " +"only used if the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit is set. The " +"signature is::" +msgstr "" + +msgid "int tp_clear(PyObject *);" +msgstr "" + +msgid "" +"The :c:member:`~PyTypeObject.tp_clear` member function is used to break " +"reference cycles in cyclic garbage detected by the garbage collector. Taken " +"together, all :c:member:`~PyTypeObject.tp_clear` functions in the system " +"must combine to break all reference cycles. This is subtle, and if in any " +"doubt supply a :c:member:`~PyTypeObject.tp_clear` function. For example, " +"the tuple type does not implement a :c:member:`~PyTypeObject.tp_clear` " +"function, because it's possible to prove that no reference cycle can be " +"composed entirely of tuples. Therefore the :c:member:`~PyTypeObject." +"tp_clear` functions of other types must be sufficient to break any cycle " +"containing a tuple. This isn't immediately obvious, and there's rarely a " +"good reason to avoid implementing :c:member:`~PyTypeObject.tp_clear`." +msgstr "" +"Функція-член :c:member:`~PyTypeObject.tp_clear` використовується для розриву " +"еталонних циклів у циклічному смітті, виявленому збирачем сміття. Взяті " +"разом, усі функції :c:member:`~PyTypeObject.tp_clear` у системі мають " +"поєднуватися, щоб розірвати всі цикли посилань. Це непомітно, і якщо є " +"сумніви, додайте функцію :c:member:`~PyTypeObject.tp_clear`. Наприклад, тип " +"кортежу не реалізує функцію :c:member:`~PyTypeObject.tp_clear`, тому що " +"можна довести, що жоден еталонний цикл не може повністю складатися з " +"кортежів. Тому функції :c:member:`~PyTypeObject.tp_clear` інших типів мають " +"бути достатніми, щоб розірвати будь-який цикл, що містить кортеж. Це не " +"відразу очевидно, і рідко є вагомі причини уникати реалізації :c:member:" +"`~PyTypeObject.tp_clear`." + +msgid "" +"Implementations of :c:member:`~PyTypeObject.tp_clear` should drop the " +"instance's references to those of its members that may be Python objects, " +"and set its pointers to those members to ``NULL``, as in the following " +"example::" +msgstr "" +"Реалізації :c:member:`~PyTypeObject.tp_clear` мають видаляти посилання " +"екземпляра на ті з його членів, які можуть бути об’єктами Python, і " +"встановлювати його покажчики на ці члени на ``NULL``, як у наступному " +"прикладі::" + +msgid "" +"static int\n" +"local_clear(localobject *self)\n" +"{\n" +" Py_CLEAR(self->key);\n" +" Py_CLEAR(self->args);\n" +" Py_CLEAR(self->kw);\n" +" Py_CLEAR(self->dict);\n" +" return 0;\n" +"}" +msgstr "" + +msgid "" +"The :c:func:`Py_CLEAR` macro should be used, because clearing references is " +"delicate: the reference to the contained object must not be released (via :" +"c:func:`Py_DECREF`) until after the pointer to the contained object is set " +"to ``NULL``. This is because releasing the reference may cause the " +"contained object to become trash, triggering a chain of reclamation activity " +"that may include invoking arbitrary Python code (due to finalizers, or " +"weakref callbacks, associated with the contained object). If it's possible " +"for such code to reference *self* again, it's important that the pointer to " +"the contained object be ``NULL`` at that time, so that *self* knows the " +"contained object can no longer be used. The :c:func:`Py_CLEAR` macro " +"performs the operations in a safe order." +msgstr "" + +msgid "" +"If the :c:macro:`Py_TPFLAGS_MANAGED_DICT` bit is set in the :c:member:" +"`~PyTypeObject.tp_flags` field, the traverse function must call :c:func:" +"`PyObject_ClearManagedDict` like this::" +msgstr "" + +msgid "PyObject_ClearManagedDict((PyObject*)self);" +msgstr "" + +msgid "" +"Note that :c:member:`~PyTypeObject.tp_clear` is not *always* called before " +"an instance is deallocated. For example, when reference counting is enough " +"to determine that an object is no longer used, the cyclic garbage collector " +"is not involved and :c:member:`~PyTypeObject.tp_dealloc` is called directly." +msgstr "" +"Зауважте, що :c:member:`~PyTypeObject.tp_clear` не *завжди* викликається до " +"того, як екземпляр буде звільнено. Наприклад, коли підрахунку посилань " +"достатньо, щоб визначити, що об’єкт більше не використовується, циклічний " +"збирач сміття не залучається, і безпосередньо викликається :c:member:" +"`~PyTypeObject.tp_dealloc`." + +msgid "" +"Because the goal of :c:member:`~PyTypeObject.tp_clear` functions is to break " +"reference cycles, it's not necessary to clear contained objects like Python " +"strings or Python integers, which can't participate in reference cycles. On " +"the other hand, it may be convenient to clear all contained Python objects, " +"and write the type's :c:member:`~PyTypeObject.tp_dealloc` function to " +"invoke :c:member:`~PyTypeObject.tp_clear`." +msgstr "" +"Оскільки мета функцій :c:member:`~PyTypeObject.tp_clear` — розірвати цикли " +"посилань, немає необхідності очищати об’єкти, що містяться, як-от рядки " +"Python або цілі числа Python, які не можуть брати участь у циклах посилань. " +"З іншого боку, може бути зручно очистити всі об’єкти Python і написати " +"функцію типу :c:member:`~PyTypeObject.tp_dealloc` для виклику :c:member:" +"`~PyTypeObject.tp_clear`." + +msgid "" +"This field is inherited by subtypes together with :c:member:`~PyTypeObject." +"tp_traverse` and the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit: the flag bit, :" +"c:member:`~PyTypeObject.tp_traverse`, and :c:member:`~PyTypeObject.tp_clear` " +"are all inherited from the base type if they are all zero in the subtype." +msgstr "" + +msgid "" +"An optional pointer to the rich comparison function, whose signature is::" +msgstr "" +"Додатковий вказівник на функцію розширеного порівняння, сигнатура якої::" + +msgid "PyObject *tp_richcompare(PyObject *self, PyObject *other, int op);" +msgstr "" + +msgid "" +"The first parameter is guaranteed to be an instance of the type that is " +"defined by :c:type:`PyTypeObject`." +msgstr "" +"Перший параметр гарантовано є екземпляром типу, визначеного :c:type:" +"`PyTypeObject`." + +msgid "" +"The function should return the result of the comparison (usually ``Py_True`` " +"or ``Py_False``). If the comparison is undefined, it must return " +"``Py_NotImplemented``, if another error occurred it must return ``NULL`` and " +"set an exception condition." +msgstr "" +"Функція має повертати результат порівняння (зазвичай ``Py_True`` або " +"``Py_False``). Якщо порівняння не визначено, воно має повернути " +"``Py_NotImplemented``, якщо сталася інша помилка, воно має повернути " +"``NULL`` і встановити умову винятку." + +msgid "" +"The following constants are defined to be used as the third argument for :c:" +"member:`~PyTypeObject.tp_richcompare` and for :c:func:`PyObject_RichCompare`:" +msgstr "" +"Наступні константи визначено для використання як третій аргумент для :c:" +"member:`~PyTypeObject.tp_richcompare` і для :c:func:`PyObject_RichCompare`:" + +msgid "Constant" +msgstr "Постійний" + +msgid "Comparison" +msgstr "Порівняння" + +msgid "``<``" +msgstr "``<``" + +msgid "``<=``" +msgstr "``<=``" + +msgid "``==``" +msgstr "``==``" + +msgid "``!=``" +msgstr "``!=``" + +msgid "``>``" +msgstr "``>``" + +msgid "``>=``" +msgstr "``>=``" + +msgid "" +"The following macro is defined to ease writing rich comparison functions:" +msgstr "" +"Наступний макрос визначено для полегшення написання розширених функцій " +"порівняння:" + +msgid "" +"Return ``Py_True`` or ``Py_False`` from the function, depending on the " +"result of a comparison. VAL_A and VAL_B must be orderable by C comparison " +"operators (for example, they may be C ints or floats). The third argument " +"specifies the requested operation, as for :c:func:`PyObject_RichCompare`." +msgstr "" +"Повертає з функції ``Py_True`` або ``Py_False``, залежно від результату " +"порівняння. VAL_A і VAL_B повинні бути впорядковані операторами порівняння C " +"(наприклад, вони можуть бути C int або float). Третій аргумент визначає " +"необхідну операцію, як для :c:func:`PyObject_RichCompare`." + +msgid "The returned value is a new :term:`strong reference`." +msgstr "" + +msgid "On error, sets an exception and returns ``NULL`` from the function." +msgstr "У разі помилки встановлює виняток і повертає ``NULL`` із функції." + +msgid "" +"This field is inherited by subtypes together with :c:member:`~PyTypeObject." +"tp_hash`: a subtype inherits :c:member:`~PyTypeObject.tp_richcompare` and :c:" +"member:`~PyTypeObject.tp_hash` when the subtype's :c:member:`~PyTypeObject." +"tp_richcompare` and :c:member:`~PyTypeObject.tp_hash` are both ``NULL``." +msgstr "" +"Це поле успадковується підтипами разом із :c:member:`~PyTypeObject.tp_hash`: " +"підтип успадковує :c:member:`~PyTypeObject.tp_richcompare` і :c:member:" +"`~PyTypeObject.tp_hash`, коли підтип :c:member:`~PyTypeObject." +"tp_richcompare` і :c:member:`~PyTypeObject.tp_hash` мають значення ``NULL``." + +msgid "" +":c:data:`PyBaseObject_Type` provides a :c:member:`~PyTypeObject." +"tp_richcompare` implementation, which may be inherited. However, if only :c:" +"member:`~PyTypeObject.tp_hash` is defined, not even the inherited function " +"is used and instances of the type will not be able to participate in any " +"comparisons." +msgstr "" + +msgid "" +"While this field is still supported, :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` " +"should be used instead, if at all possible." +msgstr "" + +msgid "" +"If the instances of this type are weakly referenceable, this field is " +"greater than zero and contains the offset in the instance structure of the " +"weak reference list head (ignoring the GC header, if present); this offset " +"is used by :c:func:`PyObject_ClearWeakRefs` and the ``PyWeakref_*`` " +"functions. The instance structure needs to include a field of type :c:expr:" +"`PyObject*` which is initialized to ``NULL``." +msgstr "" + +msgid "" +"Do not confuse this field with :c:member:`~PyTypeObject.tp_weaklist`; that " +"is the list head for weak references to the type object itself." +msgstr "" +"Не плутайте це поле з :c:member:`~PyTypeObject.tp_weaklist`; це заголовок " +"списку для слабких посилань на сам об’єкт типу." + +msgid "" +"It is an error to set both the :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` bit " +"and :c:member:`~PyTypeObject.tp_weaklistoffset`." +msgstr "" + +msgid "" +"This field is inherited by subtypes, but see the rules listed below. A " +"subtype may override this offset; this means that the subtype uses a " +"different weak reference list head than the base type. Since the list head " +"is always found via :c:member:`~PyTypeObject.tp_weaklistoffset`, this should " +"not be a problem." +msgstr "" +"Це поле успадковується підтипами, але перегляньте наведені нижче правила. " +"Підтип може замінити це зміщення; це означає, що підтип використовує інший " +"слабкий заголовок списку посилань, ніж базовий тип. Оскільки заголовок " +"списку завжди можна знайти через :c:member:`~PyTypeObject." +"tp_weaklistoffset`, це не повинно бути проблемою." + +msgid "" +"If the :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` bit is set in the :c:member:" +"`~PyTypeObject.tp_flags` field, then :c:member:`~PyTypeObject." +"tp_weaklistoffset` will be set to a negative value, to indicate that it is " +"unsafe to use this field." +msgstr "" + +msgid "" +"An optional pointer to a function that returns an :term:`iterator` for the " +"object. Its presence normally signals that the instances of this type are :" +"term:`iterable` (although sequences may be iterable without this function)." +msgstr "" +"Додатковий покажчик на функцію, яка повертає :term:`iterator` для об’єкта. " +"Його наявність зазвичай сигналізує про те, що екземпляри цього типу :term:" +"`iterable` (хоча послідовності можуть бути ітерованими без цієї функції)." + +msgid "This function has the same signature as :c:func:`PyObject_GetIter`::" +msgstr "Ця функція має той самий підпис, що й :c:func:`PyObject_GetIter`::" + +msgid "PyObject *tp_iter(PyObject *self);" +msgstr "" + +msgid "" +"An optional pointer to a function that returns the next item in an :term:" +"`iterator`. The signature is::" +msgstr "" +"Додатковий покажчик на функцію, яка повертає наступний елемент у :term:" +"`iterator`. Підпис::" + +msgid "PyObject *tp_iternext(PyObject *self);" +msgstr "" + +msgid "" +"When the iterator is exhausted, it must return ``NULL``; a :exc:" +"`StopIteration` exception may or may not be set. When another error occurs, " +"it must return ``NULL`` too. Its presence signals that the instances of " +"this type are iterators." +msgstr "" +"Коли ітератор вичерпано, він повинен повернути ``NULL``; Виняток :exc:" +"`StopIteration` може бути встановлений або не встановлений. Коли виникає " +"інша помилка, вона також має повернути ``NULL``. Його наявність сигналізує " +"про те, що екземпляри цього типу є ітераторами." + +msgid "" +"Iterator types should also define the :c:member:`~PyTypeObject.tp_iter` " +"function, and that function should return the iterator instance itself (not " +"a new iterator instance)." +msgstr "" +"Типи ітераторів також повинні визначати функцію :c:member:`~PyTypeObject." +"tp_iter`, і ця функція має повертати сам екземпляр ітератора (а не новий " +"екземпляр ітератора)." + +msgid "This function has the same signature as :c:func:`PyIter_Next`." +msgstr "Ця функція має той самий підпис, що й :c:func:`PyIter_Next`." + +msgid "" +"An optional pointer to a static ``NULL``-terminated array of :c:type:" +"`PyMethodDef` structures, declaring regular methods of this type." +msgstr "" +"Необов’язковий вказівник на статичний масив структур :c:type:`PyMethodDef` " +"із закінченням ``NULL``, що оголошує регулярні методи цього типу." + +msgid "" +"For each entry in the array, an entry is added to the type's dictionary " +"(see :c:member:`~PyTypeObject.tp_dict` below) containing a method descriptor." +msgstr "" +"Для кожного запису в масиві до словника типу (див. :c:member:`~PyTypeObject." +"tp_dict` нижче) додається запис, що містить дескриптор методу." + +msgid "" +"This field is not inherited by subtypes (methods are inherited through a " +"different mechanism)." +msgstr "" +"Це поле не успадковується підтипами (методи успадковуються через інший " +"механізм)." + +msgid "" +"An optional pointer to a static ``NULL``-terminated array of :c:type:" +"`PyMemberDef` structures, declaring regular data members (fields or slots) " +"of instances of this type." +msgstr "" +"Необов’язковий вказівник на статичний масив структур :c:type:`PyMemberDef` " +"із закінченням ``NULL``, що оголошує регулярні члени даних (поля або слоти) " +"екземплярів цього типу." + +msgid "" +"For each entry in the array, an entry is added to the type's dictionary " +"(see :c:member:`~PyTypeObject.tp_dict` below) containing a member descriptor." +msgstr "" +"Для кожного запису в масиві до словника типу (див. :c:member:`~PyTypeObject." +"tp_dict` нижче) додається запис, що містить дескриптор члена." + +msgid "" +"This field is not inherited by subtypes (members are inherited through a " +"different mechanism)." +msgstr "" +"Це поле не успадковується підтипами (члени успадковуються через інший " +"механізм)." + +msgid "" +"An optional pointer to a static ``NULL``-terminated array of :c:type:" +"`PyGetSetDef` structures, declaring computed attributes of instances of this " +"type." +msgstr "" +"Додатковий вказівник на статичний масив структур :c:type:`PyGetSetDef` із " +"закінченням ``NULL``, що оголошує обчислені атрибути екземплярів цього типу." + +msgid "" +"For each entry in the array, an entry is added to the type's dictionary " +"(see :c:member:`~PyTypeObject.tp_dict` below) containing a getset descriptor." +msgstr "" +"Для кожного запису в масиві до словника типу (див. :c:member:`~PyTypeObject." +"tp_dict` нижче) додається запис, що містить дескриптор getset." + +msgid "" +"This field is not inherited by subtypes (computed attributes are inherited " +"through a different mechanism)." +msgstr "" +"Це поле не успадковується підтипами (обчислені атрибути успадковуються за " +"допомогою іншого механізму)." + +msgid "" +"An optional pointer to a base type from which type properties are " +"inherited. At this level, only single inheritance is supported; multiple " +"inheritance require dynamically creating a type object by calling the " +"metatype." +msgstr "" +"Додатковий покажчик на базовий тип, властивості якого успадковуються. На " +"цьому рівні підтримується лише одиночне успадкування; множинне успадкування " +"вимагає динамічного створення об’єкта типу шляхом виклику метатипу." + +msgid "" +"Slot initialization is subject to the rules of initializing globals. C99 " +"requires the initializers to be \"address constants\". Function designators " +"like :c:func:`PyType_GenericNew`, with implicit conversion to a pointer, are " +"valid C99 address constants." +msgstr "" +"Ініціалізація слота підпорядковується правилам ініціалізації глобалів. C99 " +"вимагає, щоб ініціалізатори були \"константами адреси\". Позначення функцій, " +"такі як :c:func:`PyType_GenericNew`, з неявним перетворенням на вказівник, є " +"дійсними константами адрес C99." + +msgid "" +"However, the unary '&' operator applied to a non-static variable like :c:" +"data:`PyBaseObject_Type` is not required to produce an address constant. " +"Compilers may support this (gcc does), MSVC does not. Both compilers are " +"strictly standard conforming in this particular behavior." +msgstr "" + +msgid "" +"Consequently, :c:member:`~PyTypeObject.tp_base` should be set in the " +"extension module's init function." +msgstr "" +"Отже, :c:member:`~PyTypeObject.tp_base` має бути встановлено у функції " +"ініціалізації модуля розширення." + +msgid "This field is not inherited by subtypes (obviously)." +msgstr "Це поле не успадковується підтипами (очевидно)." + +msgid "" +"This field defaults to ``&PyBaseObject_Type`` (which to Python programmers " +"is known as the type :class:`object`)." +msgstr "" +"У цьому полі за замовчуванням встановлено ``&PyBaseObject_Type`` (що " +"програмістам на Python відоме як тип :class:`object`)." + +msgid "The type's dictionary is stored here by :c:func:`PyType_Ready`." +msgstr "Словник типу зберігається тут у :c:func:`PyType_Ready`." + +msgid "" +"This field should normally be initialized to ``NULL`` before PyType_Ready is " +"called; it may also be initialized to a dictionary containing initial " +"attributes for the type. Once :c:func:`PyType_Ready` has initialized the " +"type, extra attributes for the type may be added to this dictionary only if " +"they don't correspond to overloaded operations (like :meth:`~object." +"__add__`). Once initialization for the type has finished, this field should " +"be treated as read-only." +msgstr "" + +msgid "" +"Some types may not store their dictionary in this slot. Use :c:func:" +"`PyType_GetDict` to retrieve the dictionary for an arbitrary type." +msgstr "" + +msgid "" +"Internals detail: For static builtin types, this is always ``NULL``. " +"Instead, the dict for such types is stored on ``PyInterpreterState``. Use :c:" +"func:`PyType_GetDict` to get the dict for an arbitrary type." +msgstr "" + +msgid "" +"This field is not inherited by subtypes (though the attributes defined in " +"here are inherited through a different mechanism)." +msgstr "" +"Це поле не успадковується підтипами (хоча атрибути, визначені тут, " +"успадковуються за допомогою іншого механізму)." + +msgid "" +"If this field is ``NULL``, :c:func:`PyType_Ready` will assign a new " +"dictionary to it." +msgstr "" +"Якщо це поле має значення ``NULL``, :c:func:`PyType_Ready` призначить йому " +"новий словник." + +msgid "" +"It is not safe to use :c:func:`PyDict_SetItem` on or otherwise modify :c:" +"member:`~PyTypeObject.tp_dict` with the dictionary C-API." +msgstr "" +"Небезпечно використовувати :c:func:`PyDict_SetItem` або іншим чином " +"змінювати :c:member:`~PyTypeObject.tp_dict` за допомогою словника C-API." + +msgid "An optional pointer to a \"descriptor get\" function." +msgstr "Додатковий вказівник на функцію \"отримання дескриптора\"." + +msgid "The function signature is::" +msgstr "Сигнатура функції:" + +msgid "PyObject * tp_descr_get(PyObject *self, PyObject *obj, PyObject *type);" +msgstr "" + +msgid "" +"An optional pointer to a function for setting and deleting a descriptor's " +"value." +msgstr "" +"Додатковий покажчик на функцію для встановлення та видалення значення " +"дескриптора." + +msgid "int tp_descr_set(PyObject *self, PyObject *obj, PyObject *value);" +msgstr "" + +msgid "The *value* argument is set to ``NULL`` to delete the value." +msgstr "Аргумент *value* має значення ``NULL``, щоб видалити значення." + +msgid "" +"While this field is still supported, :c:macro:`Py_TPFLAGS_MANAGED_DICT` " +"should be used instead, if at all possible." +msgstr "" + +msgid "" +"If the instances of this type have a dictionary containing instance " +"variables, this field is non-zero and contains the offset in the instances " +"of the type of the instance variable dictionary; this offset is used by :c:" +"func:`PyObject_GenericGetAttr`." +msgstr "" +"Якщо екземпляри цього типу мають словник, що містить змінні екземпляра, це " +"поле ненульове та містить зміщення в екземплярах типу словника змінних " +"екземплярів; це зміщення використовується :c:func:`PyObject_GenericGetAttr`." + +msgid "" +"Do not confuse this field with :c:member:`~PyTypeObject.tp_dict`; that is " +"the dictionary for attributes of the type object itself." +msgstr "" +"Не плутайте це поле з :c:member:`~PyTypeObject.tp_dict`; це словник для " +"атрибутів самого об’єкта типу." + +msgid "" +"The value specifies the offset of the dictionary from the start of the " +"instance structure." +msgstr "" + +msgid "" +"The :c:member:`~PyTypeObject.tp_dictoffset` should be regarded as write-" +"only. To get the pointer to the dictionary call :c:func:" +"`PyObject_GenericGetDict`. Calling :c:func:`PyObject_GenericGetDict` may " +"need to allocate memory for the dictionary, so it is may be more efficient " +"to call :c:func:`PyObject_GetAttr` when accessing an attribute on the object." +msgstr "" + +msgid "" +"It is an error to set both the :c:macro:`Py_TPFLAGS_MANAGED_DICT` bit and :c:" +"member:`~PyTypeObject.tp_dictoffset`." +msgstr "" + +msgid "" +"This field is inherited by subtypes. A subtype should not override this " +"offset; doing so could be unsafe, if C code tries to access the dictionary " +"at the previous offset. To properly support inheritance, use :c:macro:" +"`Py_TPFLAGS_MANAGED_DICT`." +msgstr "" + +msgid "" +"This slot has no default. For :ref:`static types `, if the " +"field is ``NULL`` then no :attr:`~object.__dict__` gets created for " +"instances." +msgstr "" + +msgid "" +"If the :c:macro:`Py_TPFLAGS_MANAGED_DICT` bit is set in the :c:member:" +"`~PyTypeObject.tp_flags` field, then :c:member:`~PyTypeObject.tp_dictoffset` " +"will be set to ``-1``, to indicate that it is unsafe to use this field." +msgstr "" + +msgid "An optional pointer to an instance initialization function." +msgstr "Додатковий покажчик на функцію ініціалізації екземпляра." + +msgid "" +"This function corresponds to the :meth:`~object.__init__` method of " +"classes. Like :meth:`!__init__`, it is possible to create an instance " +"without calling :meth:`!__init__`, and it is possible to reinitialize an " +"instance by calling its :meth:`!__init__` method again." +msgstr "" + +msgid "int tp_init(PyObject *self, PyObject *args, PyObject *kwds);" +msgstr "" + +msgid "" +"The self argument is the instance to be initialized; the *args* and *kwds* " +"arguments represent positional and keyword arguments of the call to :meth:" +"`~object.__init__`." +msgstr "" + +msgid "" +"The :c:member:`~PyTypeObject.tp_init` function, if not ``NULL``, is called " +"when an instance is created normally by calling its type, after the type's :" +"c:member:`~PyTypeObject.tp_new` function has returned an instance of the " +"type. If the :c:member:`~PyTypeObject.tp_new` function returns an instance " +"of some other type that is not a subtype of the original type, no :c:member:" +"`~PyTypeObject.tp_init` function is called; if :c:member:`~PyTypeObject." +"tp_new` returns an instance of a subtype of the original type, the " +"subtype's :c:member:`~PyTypeObject.tp_init` is called." +msgstr "" +"Функція :c:member:`~PyTypeObject.tp_init`, якщо вона не ``NULL``, " +"викликається, коли екземпляр створюється звичайним викликом його типу, після " +"функції :c:member:`~PyTypeObject.tp_new` типу. повернув екземпляр типу. Якщо " +"функція :c:member:`~PyTypeObject.tp_new` повертає екземпляр якогось іншого " +"типу, який не є підтипом вихідного типу, функція :c:member:`~PyTypeObject." +"tp_init` не викликається; якщо :c:member:`~PyTypeObject.tp_new` повертає " +"екземпляр підтипу вихідного типу, викликається :c:member:`~PyTypeObject." +"tp_init` підтипу." + +msgid "Returns ``0`` on success, ``-1`` and sets an exception on error." +msgstr "" +"У разі успіху повертає ``0``, ``-1`` і встановлює виняток у випадку помилки." + +msgid "" +"For :ref:`static types ` this field does not have a default." +msgstr "" +"Для :ref:`статичних типів ` це поле не має значення за " +"замовчуванням." + +msgid "An optional pointer to an instance allocation function." +msgstr "Додатковий покажчик на функцію виділення екземпляра." + +msgid "PyObject *tp_alloc(PyTypeObject *self, Py_ssize_t nitems);" +msgstr "" + +msgid "" +"This field is inherited by static subtypes, but not by dynamic subtypes " +"(subtypes created by a class statement)." +msgstr "" +"Це поле успадковується статичними підтипами, але не динамічними підтипами " +"(підтипами, створеними оператором класу)." + +msgid "" +"For dynamic subtypes, this field is always set to :c:func:" +"`PyType_GenericAlloc`, to force a standard heap allocation strategy." +msgstr "" +"Для динамічних підтипів це поле завжди має значення :c:func:" +"`PyType_GenericAlloc`, щоб примусово використовувати стандартну стратегію " +"розподілу купи." + +msgid "" +"For static subtypes, :c:data:`PyBaseObject_Type` uses :c:func:" +"`PyType_GenericAlloc`. That is the recommended value for all statically " +"defined types." +msgstr "" + +msgid "An optional pointer to an instance creation function." +msgstr "Додатковий покажчик на функцію створення екземпляра." + +msgid "" +"PyObject *tp_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds);" +msgstr "" + +msgid "" +"The *subtype* argument is the type of the object being created; the *args* " +"and *kwds* arguments represent positional and keyword arguments of the call " +"to the type. Note that *subtype* doesn't have to equal the type whose :c:" +"member:`~PyTypeObject.tp_new` function is called; it may be a subtype of " +"that type (but not an unrelated type)." +msgstr "" +"Аргумент *subtype* — це тип об’єкта, що створюється; аргументи *args* і " +"*kwds* представляють позиційні та ключові аргументи виклику типу. Зауважте, " +"що *subtype* не обов’язково дорівнює типу, чия функція :c:member:" +"`~PyTypeObject.tp_new` викликається; це може бути підтип цього типу (але не " +"непов’язаний тип)." + +msgid "" +"The :c:member:`~PyTypeObject.tp_new` function should call ``subtype-" +">tp_alloc(subtype, nitems)`` to allocate space for the object, and then do " +"only as much further initialization as is absolutely necessary. " +"Initialization that can safely be ignored or repeated should be placed in " +"the :c:member:`~PyTypeObject.tp_init` handler. A good rule of thumb is that " +"for immutable types, all initialization should take place in :c:member:" +"`~PyTypeObject.tp_new`, while for mutable types, most initialization should " +"be deferred to :c:member:`~PyTypeObject.tp_init`." +msgstr "" +"Функція :c:member:`~PyTypeObject.tp_new` має викликати ``subtype-" +">tp_alloc(subtype, nitems)``, щоб виділити простір для об’єкта, а потім " +"виконувати подальшу ініціалізацію лише стільки, скільки це абсолютно " +"необхідно. Ініціалізацію, яку можна безпечно проігнорувати або повторити, " +"слід розмістити в обробнику :c:member:`~PyTypeObject.tp_init`. Хорошим " +"емпіричним правилом є те, що для незмінних типів уся ініціалізація має " +"відбуватися в :c:member:`~PyTypeObject.tp_new`, тоді як для змінних типів " +"більшість ініціалізацій має бути відкладено до :c:member:`~PyTypeObject." +"tp_init`." + +msgid "" +"Set the :c:macro:`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag to disallow " +"creating instances of the type in Python." +msgstr "" + +msgid "" +"This field is inherited by subtypes, except it is not inherited by :ref:" +"`static types ` whose :c:member:`~PyTypeObject.tp_base` is " +"``NULL`` or ``&PyBaseObject_Type``." +msgstr "" +"Це поле успадковується підтипами, за винятком :ref:`статичних типів `, у яких :c:member:`~PyTypeObject.tp_base` має значення ``NULL`` або " +"``&PyBaseObject_Type``." + +msgid "" +"For :ref:`static types ` this field has no default. This means " +"if the slot is defined as ``NULL``, the type cannot be called to create new " +"instances; presumably there is some other way to create instances, like a " +"factory function." +msgstr "" +"Для :ref:`статичних типів ` це поле не має типового значення. " +"Це означає, що якщо слот визначено як ``NULL``, тип не можна викликати для " +"створення нових екземплярів; мабуть, існує якийсь інший спосіб створення " +"екземплярів, як-от фабрична функція." + +msgid "" +"An optional pointer to an instance deallocation function. Its signature is::" +msgstr "Додатковий покажчик на функцію звільнення екземпляра. Його підпис::" + +msgid "void tp_free(void *self);" +msgstr "" + +msgid "" +"An initializer that is compatible with this signature is :c:func:" +"`PyObject_Free`." +msgstr "Ініціалізатор, сумісний із цим підписом, це :c:func:`PyObject_Free`." + +msgid "" +"This field is inherited by static subtypes, but not by dynamic subtypes " +"(subtypes created by a class statement)" +msgstr "" +"Це поле успадковується статичними підтипами, але не динамічними підтипами " +"(підтипами, створеними оператором класу)" + +msgid "" +"In dynamic subtypes, this field is set to a deallocator suitable to match :c:" +"func:`PyType_GenericAlloc` and the value of the :c:macro:" +"`Py_TPFLAGS_HAVE_GC` flag bit." +msgstr "" + +msgid "" +"For static subtypes, :c:data:`PyBaseObject_Type` uses :c:func:`PyObject_Del`." +msgstr "" + +msgid "An optional pointer to a function called by the garbage collector." +msgstr "Додатковий покажчик на функцію, яка викликається збирачем сміття." + +msgid "" +"The garbage collector needs to know whether a particular object is " +"collectible or not. Normally, it is sufficient to look at the object's " +"type's :c:member:`~PyTypeObject.tp_flags` field, and check the :c:macro:" +"`Py_TPFLAGS_HAVE_GC` flag bit. But some types have a mixture of statically " +"and dynamically allocated instances, and the statically allocated instances " +"are not collectible. Such types should define this function; it should " +"return ``1`` for a collectible instance, and ``0`` for a non-collectible " +"instance. The signature is::" +msgstr "" + +msgid "int tp_is_gc(PyObject *self);" +msgstr "" + +msgid "" +"(The only example of this are types themselves. The metatype, :c:data:" +"`PyType_Type`, defines this function to distinguish between statically and :" +"ref:`dynamically allocated types `.)" +msgstr "" +"(Єдиним прикладом цього є самі типи. Метатип :c:data:`PyType_Type` визначає " +"цю функцію, щоб розрізняти статично та :ref:`динамічно виділені типи `.)" + +msgid "" +"This slot has no default. If this field is ``NULL``, :c:macro:" +"`Py_TPFLAGS_HAVE_GC` is used as the functional equivalent." +msgstr "" + +msgid "Tuple of base types." +msgstr "Кортеж базових типів." + +msgid "" +"This field should be set to ``NULL`` and treated as read-only. Python will " +"fill it in when the type is :c:func:`initialized `." +msgstr "" + +msgid "" +"For dynamically created classes, the ``Py_tp_bases`` :c:type:`slot " +"` can be used instead of the *bases* argument of :c:func:" +"`PyType_FromSpecWithBases`. The argument form is preferred." +msgstr "" + +msgid "" +"Multiple inheritance does not work well for statically defined types. If you " +"set ``tp_bases`` to a tuple, Python will not raise an error, but some slots " +"will only be inherited from the first base." +msgstr "" + +msgid "This field is not inherited." +msgstr "Це поле не успадковується." + +msgid "" +"Tuple containing the expanded set of base types, starting with the type " +"itself and ending with :class:`object`, in Method Resolution Order." +msgstr "" +"Кортеж, що містить розширений набір базових типів, починаючи з самого типу " +"та закінчуючи :class:`object`, у порядку вирішення методів." + +msgid "" +"This field is not inherited; it is calculated fresh by :c:func:" +"`PyType_Ready`." +msgstr "" +"Це поле не успадковується; він обчислюється за допомогою :c:func:" +"`PyType_Ready`." + +msgid "Unused. Internal use only." +msgstr "Невикористаний. Тільки для внутрішнього використання." + +msgid "" +"A collection of subclasses. Internal use only. May be an invalid pointer." +msgstr "" + +msgid "" +"To get a list of subclasses, call the Python method :py:meth:`~type." +"__subclasses__`." +msgstr "" + +msgid "" +"For some types, this field does not hold a valid :c:expr:`PyObject*`. The " +"type was changed to :c:expr:`void*` to indicate this." +msgstr "" + +msgid "" +"Weak reference list head, for weak references to this type object. Not " +"inherited. Internal use only." +msgstr "" +"Голова списку слабких посилань для слабких посилань на об’єкт цього типу. Не " +"передається у спадок. Тільки для внутрішнього використання." + +msgid "" +"Internals detail: For the static builtin types this is always ``NULL``, even " +"if weakrefs are added. Instead, the weakrefs for each are stored on " +"``PyInterpreterState``. Use the public C-API or the internal " +"``_PyObject_GET_WEAKREFS_LISTPTR()`` macro to avoid the distinction." +msgstr "" + +msgid "" +"This field is deprecated. Use :c:member:`~PyTypeObject.tp_finalize` instead." +msgstr "" +"Це поле застаріло. Натомість використовуйте :c:member:`~PyTypeObject." +"tp_finalize`." + +msgid "Used to index into the method cache. Internal use only." +msgstr "" +"Використовується для індексування в кеш методів. Тільки для внутрішнього " +"використання." + +msgid "" +"An optional pointer to an instance finalization function. Its signature is::" +msgstr "Додатковий покажчик на функцію завершення екземпляра. Його підпис::" + +msgid "void tp_finalize(PyObject *self);" +msgstr "" + +msgid "" +"If :c:member:`~PyTypeObject.tp_finalize` is set, the interpreter calls it " +"once when finalizing an instance. It is called either from the garbage " +"collector (if the instance is part of an isolated reference cycle) or just " +"before the object is deallocated. Either way, it is guaranteed to be called " +"before attempting to break reference cycles, ensuring that it finds the " +"object in a sane state." +msgstr "" +"Якщо встановлено :c:member:`~PyTypeObject.tp_finalize`, інтерпретатор " +"викликає його один раз під час завершення екземпляра. Він викликається або " +"зі збирача сміття (якщо екземпляр є частиною ізольованого еталонного циклу), " +"або безпосередньо перед звільненням об’єкта. У будь-якому випадку, він " +"гарантовано буде викликаний перед спробою розірвати еталонні цикли, " +"гарантуючи, що він знайде об’єкт у нормальному стані." + +msgid "" +":c:member:`~PyTypeObject.tp_finalize` should not mutate the current " +"exception status; therefore, a recommended way to write a non-trivial " +"finalizer is::" +msgstr "" +":c:member:`~PyTypeObject.tp_finalize` не повинен змінювати поточний статус " +"винятку; отже, рекомендований спосіб написання нетривіального фіналізатора:" + +msgid "" +"static void\n" +"local_finalize(PyObject *self)\n" +"{\n" +" /* Save the current exception, if any. */\n" +" PyObject *exc = PyErr_GetRaisedException();\n" +"\n" +" /* ... */\n" +"\n" +" /* Restore the saved exception. */\n" +" PyErr_SetRaisedException(exc);\n" +"}" +msgstr "" + +msgid "" +"Before version 3.8 it was necessary to set the :c:macro:" +"`Py_TPFLAGS_HAVE_FINALIZE` flags bit in order for this field to be used. " +"This is no longer required." +msgstr "" + +msgid "\"Safe object finalization\" (:pep:`442`)" +msgstr "\"Безпечна фіналізація об'єкта\" (:pep:`442`)" + +msgid "" +"Vectorcall function to use for calls of this type object. In other words, it " +"is used to implement :ref:`vectorcall ` for ``type.__call__``. " +"If ``tp_vectorcall`` is ``NULL``, the default call implementation using :" +"meth:`~object.__new__` and :meth:`~object.__init__` is used." +msgstr "" + +msgid "This field is never inherited." +msgstr "Це поле ніколи не успадковується." + +msgid "(the field exists since 3.8 but it's only used since 3.9)" +msgstr "(поле існує з 3.8, але використовується лише з 3.9)" + +msgid "Internal. Do not use." +msgstr "" + +msgid "Static Types" +msgstr "Статичні типи" + +msgid "" +"Traditionally, types defined in C code are *static*, that is, a static :c:" +"type:`PyTypeObject` structure is defined directly in code and initialized " +"using :c:func:`PyType_Ready`." +msgstr "" +"Традиційно типи, визначені в коді C, є *статичними*, тобто статична " +"структура :c:type:`PyTypeObject` визначається безпосередньо в коді та " +"ініціалізується за допомогою :c:func:`PyType_Ready`." + +msgid "" +"This results in types that are limited relative to types defined in Python:" +msgstr "" +"Це призводить до типів, які обмежені відносно типів, визначених у Python:" + +msgid "" +"Static types are limited to one base, i.e. they cannot use multiple " +"inheritance." +msgstr "" +"Статичні типи обмежені однією базою, тобто вони не можуть використовувати " +"множинне успадкування." + +msgid "" +"Static type objects (but not necessarily their instances) are immutable. It " +"is not possible to add or modify the type object's attributes from Python." +msgstr "" +"Об’єкти статичного типу (але не обов’язково їх екземпляри) незмінні. " +"Неможливо додати або змінити атрибути об’єкта типу з Python." + +msgid "" +"Static type objects are shared across :ref:`sub-interpreters `, so they should not include any subinterpreter-" +"specific state." +msgstr "" +"Об’єкти статичного типу є спільними для :ref:`суб-інтерпретаторів `, тому вони не повинні включати будь-який стан, " +"специфічний для субінтерпретатора." + +msgid "" +"Also, since :c:type:`PyTypeObject` is only part of the :ref:`Limited API " +"` as an opaque struct, any extension modules using static " +"types must be compiled for a specific Python minor version." +msgstr "" + +msgid "Heap Types" +msgstr "Типи купи" + +msgid "" +"An alternative to :ref:`static types ` is *heap-allocated " +"types*, or *heap types* for short, which correspond closely to classes " +"created by Python's ``class`` statement. Heap types have the :c:macro:" +"`Py_TPFLAGS_HEAPTYPE` flag set." +msgstr "" + +msgid "" +"This is done by filling a :c:type:`PyType_Spec` structure and calling :c:" +"func:`PyType_FromSpec`, :c:func:`PyType_FromSpecWithBases`, :c:func:" +"`PyType_FromModuleAndSpec`, or :c:func:`PyType_FromMetaclass`." +msgstr "" + +msgid "Number Object Structures" +msgstr "Числові об’єктні структури" + +msgid "" +"This structure holds pointers to the functions which an object uses to " +"implement the number protocol. Each function is used by the function of " +"similar name documented in the :ref:`number` section." +msgstr "" +"Ця структура містить покажчики на функції, які об’єкт використовує для " +"реалізації протоколу чисел. Кожна функція використовується функцією з " +"подібною назвою, задокументованою в розділі :ref:`number`." + +msgid "Here is the structure definition::" +msgstr "Ось визначення структури::" + +msgid "" +"typedef struct {\n" +" binaryfunc nb_add;\n" +" binaryfunc nb_subtract;\n" +" binaryfunc nb_multiply;\n" +" binaryfunc nb_remainder;\n" +" binaryfunc nb_divmod;\n" +" ternaryfunc nb_power;\n" +" unaryfunc nb_negative;\n" +" unaryfunc nb_positive;\n" +" unaryfunc nb_absolute;\n" +" inquiry nb_bool;\n" +" unaryfunc nb_invert;\n" +" binaryfunc nb_lshift;\n" +" binaryfunc nb_rshift;\n" +" binaryfunc nb_and;\n" +" binaryfunc nb_xor;\n" +" binaryfunc nb_or;\n" +" unaryfunc nb_int;\n" +" void *nb_reserved;\n" +" unaryfunc nb_float;\n" +"\n" +" binaryfunc nb_inplace_add;\n" +" binaryfunc nb_inplace_subtract;\n" +" binaryfunc nb_inplace_multiply;\n" +" binaryfunc nb_inplace_remainder;\n" +" ternaryfunc nb_inplace_power;\n" +" binaryfunc nb_inplace_lshift;\n" +" binaryfunc nb_inplace_rshift;\n" +" binaryfunc nb_inplace_and;\n" +" binaryfunc nb_inplace_xor;\n" +" binaryfunc nb_inplace_or;\n" +"\n" +" binaryfunc nb_floor_divide;\n" +" binaryfunc nb_true_divide;\n" +" binaryfunc nb_inplace_floor_divide;\n" +" binaryfunc nb_inplace_true_divide;\n" +"\n" +" unaryfunc nb_index;\n" +"\n" +" binaryfunc nb_matrix_multiply;\n" +" binaryfunc nb_inplace_matrix_multiply;\n" +"} PyNumberMethods;" +msgstr "" + +msgid "" +"Binary and ternary functions must check the type of all their operands, and " +"implement the necessary conversions (at least one of the operands is an " +"instance of the defined type). If the operation is not defined for the " +"given operands, binary and ternary functions must return " +"``Py_NotImplemented``, if another error occurred they must return ``NULL`` " +"and set an exception." +msgstr "" +"Двійкові та потрійні функції повинні перевіряти тип усіх своїх операндів і " +"здійснювати необхідні перетворення (принаймні один із операндів є " +"екземпляром визначеного типу). Якщо операція не визначена для заданих " +"операндів, двійкові та тернарні функції повинні повернути " +"``Py_NotImplemented``, якщо сталася інша помилка, вони повинні повернути " +"``NULL`` і встановити виняток." + +msgid "" +"The :c:member:`~PyNumberMethods.nb_reserved` field should always be " +"``NULL``. It was previously called :c:member:`!nb_long`, and was renamed in " +"Python 3.0.1." +msgstr "" + +msgid "Mapping Object Structures" +msgstr "Відображення структур об’єктів" + +msgid "" +"This structure holds pointers to the functions which an object uses to " +"implement the mapping protocol. It has three members:" +msgstr "" +"Ця структура містить покажчики на функції, які об’єкт використовує для " +"реалізації протоколу відображення. Він складається з трьох членів:" + +msgid "" +"This function is used by :c:func:`PyMapping_Size` and :c:func:" +"`PyObject_Size`, and has the same signature. This slot may be set to " +"``NULL`` if the object has no defined length." +msgstr "" +"Ця функція використовується :c:func:`PyMapping_Size` і :c:func:" +"`PyObject_Size` і має однакову сигнатуру. Цей слот може бути встановлений на " +"``NULL``, якщо об’єкт не має визначеної довжини." + +msgid "" +"This function is used by :c:func:`PyObject_GetItem` and :c:func:" +"`PySequence_GetSlice`, and has the same signature as :c:func:`!" +"PyObject_GetItem`. This slot must be filled for the :c:func:" +"`PyMapping_Check` function to return ``1``, it can be ``NULL`` otherwise." +msgstr "" +"Ця функція використовується :c:func:`PyObject_GetItem` і :c:func:" +"`PySequence_GetSlice`, і має такий же підпис, як :c:func:`!" +"PyObject_GetItem`. Цей слот має бути заповнений, щоб функція :c:func:" +"`PyMapping_Check` повернула ``1``, інакше вона може бути ``NULL``." + +msgid "" +"This function is used by :c:func:`PyObject_SetItem`, :c:func:" +"`PyObject_DelItem`, :c:func:`PySequence_SetSlice` and :c:func:" +"`PySequence_DelSlice`. It has the same signature as :c:func:`!" +"PyObject_SetItem`, but *v* can also be set to ``NULL`` to delete an item. " +"If this slot is ``NULL``, the object does not support item assignment and " +"deletion." +msgstr "" + +msgid "Sequence Object Structures" +msgstr "Структури об’єктів послідовності" + +msgid "" +"This structure holds pointers to the functions which an object uses to " +"implement the sequence protocol." +msgstr "" +"Ця структура містить покажчики на функції, які об’єкт використовує для " +"реалізації протоколу послідовності." + +msgid "" +"This function is used by :c:func:`PySequence_Size` and :c:func:" +"`PyObject_Size`, and has the same signature. It is also used for handling " +"negative indices via the :c:member:`~PySequenceMethods.sq_item` and the :c:" +"member:`~PySequenceMethods.sq_ass_item` slots." +msgstr "" +"Ця функція використовується :c:func:`PySequence_Size` і :c:func:" +"`PyObject_Size` і має однакову сигнатуру. Він також використовується для " +"обробки негативних індексів через слоти :c:member:`~PySequenceMethods." +"sq_item` і :c:member:`~PySequenceMethods.sq_ass_item`." + +msgid "" +"This function is used by :c:func:`PySequence_Concat` and has the same " +"signature. It is also used by the ``+`` operator, after trying the numeric " +"addition via the :c:member:`~PyNumberMethods.nb_add` slot." +msgstr "" +"Ця функція використовується :c:func:`PySequence_Concat` і має такий самий " +"підпис. Він також використовується оператором ``+`` після спроби додавання " +"чисел через слот :c:member:`~PyNumberMethods.nb_add`." + +msgid "" +"This function is used by :c:func:`PySequence_Repeat` and has the same " +"signature. It is also used by the ``*`` operator, after trying numeric " +"multiplication via the :c:member:`~PyNumberMethods.nb_multiply` slot." +msgstr "" +"Ця функція використовується :c:func:`PySequence_Repeat` і має такий самий " +"підпис. Він також використовується оператором ``*`` після спроби числового " +"множення через слот :c:member:`~PyNumberMethods.nb_multiply`." + +msgid "" +"This function is used by :c:func:`PySequence_GetItem` and has the same " +"signature. It is also used by :c:func:`PyObject_GetItem`, after trying the " +"subscription via the :c:member:`~PyMappingMethods.mp_subscript` slot. This " +"slot must be filled for the :c:func:`PySequence_Check` function to return " +"``1``, it can be ``NULL`` otherwise." +msgstr "" +"Ця функція використовується :c:func:`PySequence_GetItem` і має такий самий " +"підпис. Він також використовується :c:func:`PyObject_GetItem` після спроби " +"підписки через слот :c:member:`~PyMappingMethods.mp_subscript`. Цей слот має " +"бути заповнений, щоб функція :c:func:`PySequence_Check` повертала ``1``, " +"інакше вона може бути ``NULL``." + +msgid "" +"Negative indexes are handled as follows: if the :c:member:" +"`~PySequenceMethods.sq_length` slot is filled, it is called and the sequence " +"length is used to compute a positive index which is passed to :c:member:" +"`~PySequenceMethods.sq_item`. If :c:member:`!sq_length` is ``NULL``, the " +"index is passed as is to the function." +msgstr "" + +msgid "" +"This function is used by :c:func:`PySequence_SetItem` and has the same " +"signature. It is also used by :c:func:`PyObject_SetItem` and :c:func:" +"`PyObject_DelItem`, after trying the item assignment and deletion via the :c:" +"member:`~PyMappingMethods.mp_ass_subscript` slot. This slot may be left to " +"``NULL`` if the object does not support item assignment and deletion." +msgstr "" +"Ця функція використовується :c:func:`PySequence_SetItem` і має такий самий " +"підпис. Він також використовується :c:func:`PyObject_SetItem` і :c:func:" +"`PyObject_DelItem` після спроби призначення та видалення елемента через " +"слот :c:member:`~PyMappingMethods.mp_ass_subscript`. Цей слот можна залишити " +"``NULL``, якщо об’єкт не підтримує призначення та видалення елементів." + +msgid "" +"This function may be used by :c:func:`PySequence_Contains` and has the same " +"signature. This slot may be left to ``NULL``, in this case :c:func:`!" +"PySequence_Contains` simply traverses the sequence until it finds a match." +msgstr "" +"Ця функція може використовуватися :c:func:`PySequence_Contains` і має такий " +"самий підпис. Цей слот можна залишити ``NULL``, у цьому випадку :c:func:`!" +"PySequence_Contains` просто обходить послідовність, поки не знайде збіг." + +msgid "" +"This function is used by :c:func:`PySequence_InPlaceConcat` and has the same " +"signature. It should modify its first operand, and return it. This slot " +"may be left to ``NULL``, in this case :c:func:`!PySequence_InPlaceConcat` " +"will fall back to :c:func:`PySequence_Concat`. It is also used by the " +"augmented assignment ``+=``, after trying numeric in-place addition via the :" +"c:member:`~PyNumberMethods.nb_inplace_add` slot." +msgstr "" +"Ця функція використовується :c:func:`PySequence_InPlaceConcat` і має такий " +"самий підпис. Він повинен змінити свій перший операнд і повернути його. Цей " +"слот можна залишити ``NULL``, у цьому випадку :c:func:`!" +"PySequence_InPlaceConcat` повернеться до :c:func:`PySequence_Concat`. Він " +"також використовується розширеним призначенням ``+=`` після спроби додавання " +"чисел на місці через слот :c:member:`~PyNumberMethods.nb_inplace_add`." + +msgid "" +"This function is used by :c:func:`PySequence_InPlaceRepeat` and has the same " +"signature. It should modify its first operand, and return it. This slot " +"may be left to ``NULL``, in this case :c:func:`!PySequence_InPlaceRepeat` " +"will fall back to :c:func:`PySequence_Repeat`. It is also used by the " +"augmented assignment ``*=``, after trying numeric in-place multiplication " +"via the :c:member:`~PyNumberMethods.nb_inplace_multiply` slot." +msgstr "" +"Ця функція використовується :c:func:`PySequence_InPlaceRepeat` і має такий " +"самий підпис. Він повинен змінити свій перший операнд і повернути його. Цей " +"слот можна залишити ``NULL``, у цьому випадку :c:func:`!" +"PySequence_InPlaceRepeat` повернеться до :c:func:`PySequence_Repeat`. Він " +"також використовується розширеним призначенням ``*=`` після спроби числового " +"множення на місці через слот :c:member:`~PyNumberMethods." +"nb_inplace_multiply`." + +msgid "Buffer Object Structures" +msgstr "Буферні об'єктні структури" + +msgid "" +"This structure holds pointers to the functions required by the :ref:`Buffer " +"protocol `. The protocol defines how an exporter object can " +"expose its internal data to consumer objects." +msgstr "" +"Ця структура містить покажчики на функції, необхідні для :ref:`протоколу " +"буфера `. Протокол визначає, як об’єкт-експортер може " +"надавати свої внутрішні дані об’єктам-споживачам." + +msgid "The signature of this function is::" +msgstr "Сигнатура цієї функції:" + +msgid "int (PyObject *exporter, Py_buffer *view, int flags);" +msgstr "" + +msgid "" +"Handle a request to *exporter* to fill in *view* as specified by *flags*. " +"Except for point (3), an implementation of this function MUST take these " +"steps:" +msgstr "" +"Обробляти запит до *exporter* для заповнення *view*, як зазначено *flags*. " +"За винятком пункту (3), реалізація цієї функції ПОВИННА виконувати такі дії:" + +msgid "" +"Check if the request can be met. If not, raise :exc:`BufferError`, set :c:" +"expr:`view->obj` to ``NULL`` and return ``-1``." +msgstr "" + +msgid "Fill in the requested fields." +msgstr "Заповніть необхідні поля." + +msgid "Increment an internal counter for the number of exports." +msgstr "Збільшити внутрішній лічильник для кількості експортів." + +msgid "" +"Set :c:expr:`view->obj` to *exporter* and increment :c:expr:`view->obj`." +msgstr "" + +msgid "Return ``0``." +msgstr "Повернути ``0``." + +msgid "" +"If *exporter* is part of a chain or tree of buffer providers, two main " +"schemes can be used:" +msgstr "" +"Якщо *експортер* є частиною ланцюжка або дерева постачальників буферів, " +"можна використовувати дві основні схеми:" + +msgid "" +"Re-export: Each member of the tree acts as the exporting object and sets :c:" +"expr:`view->obj` to a new reference to itself." +msgstr "" + +msgid "" +"Redirect: The buffer request is redirected to the root object of the tree. " +"Here, :c:expr:`view->obj` will be a new reference to the root object." +msgstr "" + +msgid "" +"The individual fields of *view* are described in section :ref:`Buffer " +"structure `, the rules how an exporter must react to " +"specific requests are in section :ref:`Buffer request types `." +msgstr "" +"Окремі поля *view* описані в розділі :ref:`Структура буфера `, правила, як експортер повинен реагувати на конкретні запити, " +"знаходяться в розділі :ref:`Типи запитів буфера `." + +msgid "" +"All memory pointed to in the :c:type:`Py_buffer` structure belongs to the " +"exporter and must remain valid until there are no consumers left. :c:member:" +"`~Py_buffer.format`, :c:member:`~Py_buffer.shape`, :c:member:`~Py_buffer." +"strides`, :c:member:`~Py_buffer.suboffsets` and :c:member:`~Py_buffer." +"internal` are read-only for the consumer." +msgstr "" +"Уся пам’ять, на яку вказує структура :c:type:`Py_buffer`, належить " +"експортеру та має залишатися чинною, доки не залишиться споживачів. :c:" +"member:`~Py_buffer.format`, :c:member:`~Py_buffer.shape`, :c:member:" +"`~Py_buffer.strides`, :c:member:`~Py_buffer.suboffsets` та :c:member:" +"`~Py_buffer.internal` доступні лише для читання для споживача." + +msgid "" +":c:func:`PyBuffer_FillInfo` provides an easy way of exposing a simple bytes " +"buffer while dealing correctly with all request types." +msgstr "" +":c:func:`PyBuffer_FillInfo` забезпечує простий спосіб відкрити простий буфер " +"байтів, правильно обробляючи всі типи запитів." + +msgid "" +":c:func:`PyObject_GetBuffer` is the interface for the consumer that wraps " +"this function." +msgstr "" +":c:func:`PyObject_GetBuffer` — це інтерфейс для споживача, який обертає цю " +"функцію." + +msgid "void (PyObject *exporter, Py_buffer *view);" +msgstr "" + +msgid "" +"Handle a request to release the resources of the buffer. If no resources " +"need to be released, :c:member:`PyBufferProcs.bf_releasebuffer` may be " +"``NULL``. Otherwise, a standard implementation of this function will take " +"these optional steps:" +msgstr "" +"Обробляти запит на звільнення ресурсів буфера. Якщо не потрібно звільняти " +"ресурси, :c:member:`PyBufferProcs.bf_releasebuffer` може мати значення " +"``NULL``. В іншому випадку стандартна реалізація цієї функції виконає " +"наступні додаткові дії:" + +msgid "Decrement an internal counter for the number of exports." +msgstr "Зменшити внутрішній лічильник для кількості експортів." + +msgid "If the counter is ``0``, free all memory associated with *view*." +msgstr "Якщо лічильник ``0``, звільнити всю пам'ять, пов'язану з *view*." + +msgid "" +"The exporter MUST use the :c:member:`~Py_buffer.internal` field to keep " +"track of buffer-specific resources. This field is guaranteed to remain " +"constant, while a consumer MAY pass a copy of the original buffer as the " +"*view* argument." +msgstr "" +"Експортер ПОВИНЕН використовувати поле :c:member:`~Py_buffer.internal`, щоб " +"відстежувати ресурси, пов’язані з буфером. Це поле гарантовано залишається " +"постійним, тоді як споживач МОЖЕ передати копію вихідного буфера як аргумент " +"*view*." + +msgid "" +"This function MUST NOT decrement :c:expr:`view->obj`, since that is done " +"automatically in :c:func:`PyBuffer_Release` (this scheme is useful for " +"breaking reference cycles)." +msgstr "" + +msgid "" +":c:func:`PyBuffer_Release` is the interface for the consumer that wraps this " +"function." +msgstr "" +":c:func:`PyBuffer_Release` — це інтерфейс для споживача, який обертає цю " +"функцію." + +msgid "Async Object Structures" +msgstr "Асинхронні об'єктні структури" + +msgid "" +"This structure holds pointers to the functions required to implement :term:" +"`awaitable` and :term:`asynchronous iterator` objects." +msgstr "" +"Ця структура містить покажчики на функції, необхідні для реалізації " +"об’єктів :term:`awaitable` і :term:`asynchronous iterator`." + +msgid "" +"typedef struct {\n" +" unaryfunc am_await;\n" +" unaryfunc am_aiter;\n" +" unaryfunc am_anext;\n" +" sendfunc am_send;\n" +"} PyAsyncMethods;" +msgstr "" + +msgid "PyObject *am_await(PyObject *self);" +msgstr "" + +msgid "" +"The returned object must be an :term:`iterator`, i.e. :c:func:`PyIter_Check` " +"must return ``1`` for it." +msgstr "" +"Повернений об’єкт має бути :term:`iterator`, тобто :c:func:`PyIter_Check` " +"має повернути для нього ``1``." + +msgid "" +"This slot may be set to ``NULL`` if an object is not an :term:`awaitable`." +msgstr "" +"Цей слот може мати значення ``NULL``, якщо об’єкт не є :term:`awaitable`." + +msgid "PyObject *am_aiter(PyObject *self);" +msgstr "" + +msgid "" +"Must return an :term:`asynchronous iterator` object. See :meth:`~object." +"__anext__` for details." +msgstr "" + +msgid "" +"This slot may be set to ``NULL`` if an object does not implement " +"asynchronous iteration protocol." +msgstr "" +"Цей слот може мати значення ``NULL``, якщо об’єкт не реалізує протокол " +"асинхронної ітерації." + +msgid "PyObject *am_anext(PyObject *self);" +msgstr "" + +msgid "" +"Must return an :term:`awaitable` object. See :meth:`~object.__anext__` for " +"details. This slot may be set to ``NULL``." +msgstr "" + +msgid "PySendResult am_send(PyObject *self, PyObject *arg, PyObject **result);" +msgstr "" + +msgid "" +"See :c:func:`PyIter_Send` for details. This slot may be set to ``NULL``." +msgstr "" +"Дивіться :c:func:`PyIter_Send` для деталей. Цей слот може мати значення " +"``NULL``." + +msgid "Slot Type typedefs" +msgstr "Типи слотів" + +msgid "" +"The purpose of this function is to separate memory allocation from memory " +"initialization. It should return a pointer to a block of memory of adequate " +"length for the instance, suitably aligned, and initialized to zeros, but " +"with :c:member:`~PyObject.ob_refcnt` set to ``1`` and :c:member:`~PyObject." +"ob_type` set to the type argument. If the type's :c:member:`~PyTypeObject." +"tp_itemsize` is non-zero, the object's :c:member:`~PyVarObject.ob_size` " +"field should be initialized to *nitems* and the length of the allocated " +"memory block should be ``tp_basicsize + nitems*tp_itemsize``, rounded up to " +"a multiple of ``sizeof(void*)``; otherwise, *nitems* is not used and the " +"length of the block should be :c:member:`~PyTypeObject.tp_basicsize`." +msgstr "" + +msgid "" +"This function should not do any other instance initialization, not even to " +"allocate additional memory; that should be done by :c:member:`~PyTypeObject." +"tp_new`." +msgstr "" +"Ця функція не повинна виконувати будь-яку іншу ініціалізацію екземпляра, " +"навіть не для виділення додаткової пам’яті; це має зробити :c:member:" +"`~PyTypeObject.tp_new`." + +msgid "See :c:member:`~PyTypeObject.tp_free`." +msgstr "Перегляньте :c:member:`~PyTypeObject.tp_free`." + +msgid "See :c:member:`~PyTypeObject.tp_new`." +msgstr "Перегляньте :c:member:`~PyTypeObject.tp_new`." + +msgid "See :c:member:`~PyTypeObject.tp_init`." +msgstr "Перегляньте :c:member:`~PyTypeObject.tp_init`." + +msgid "See :c:member:`~PyTypeObject.tp_repr`." +msgstr "Перегляньте :c:member:`~PyTypeObject.tp_repr`." + +msgid "Return the value of the named attribute for the object." +msgstr "Повертає значення названого атрибута для об’єкта." + +msgid "" +"Set the value of the named attribute for the object. The value argument is " +"set to ``NULL`` to delete the attribute." +msgstr "" +"Установіть для об’єкта значення іменованого атрибута. Аргумент значення має " +"значення ``NULL``, щоб видалити атрибут." + +msgid "See :c:member:`~PyTypeObject.tp_getattro`." +msgstr "Перегляньте :c:member:`~PyTypeObject.tp_getattro`." + +msgid "See :c:member:`~PyTypeObject.tp_setattro`." +msgstr "Перегляньте :c:member:`~PyTypeObject.tp_setattro`." + +msgid "See :c:member:`~PyTypeObject.tp_descr_get`." +msgstr "" + +msgid "See :c:member:`~PyTypeObject.tp_descr_set`." +msgstr "" + +msgid "See :c:member:`~PyTypeObject.tp_hash`." +msgstr "Перегляньте :c:member:`~PyTypeObject.tp_hash`." + +msgid "See :c:member:`~PyTypeObject.tp_richcompare`." +msgstr "Перегляньте :c:member:`~PyTypeObject.tp_richcompare`." + +msgid "See :c:member:`~PyTypeObject.tp_iter`." +msgstr "Перегляньте :c:member:`~PyTypeObject.tp_iter`." + +msgid "See :c:member:`~PyTypeObject.tp_iternext`." +msgstr "Перегляньте :c:member:`~PyTypeObject.tp_iternext`." + +msgid "See :c:member:`~PyAsyncMethods.am_send`." +msgstr "Перегляньте :c:member:`~PyAsyncMethods.am_send`." + +msgid "Examples" +msgstr "Приклади" + +msgid "" +"The following are simple examples of Python type definitions. They include " +"common usage you may encounter. Some demonstrate tricky corner cases. For " +"more examples, practical info, and a tutorial, see :ref:`defining-new-types` " +"and :ref:`new-types-topics`." +msgstr "" +"Нижче наведено прості приклади визначень типів Python. Вони включають " +"загальне використання, з яким ви можете зіткнутися. Деякі демонструють хитрі " +"кутові випадки. Більше прикладів, практичної інформації та підручника див. :" +"ref:`defining-new-types` і :ref:`new-types-topics`." + +msgid "A basic :ref:`static type `::" +msgstr "Базовий :ref:`статичний тип `::" + +msgid "" +"typedef struct {\n" +" PyObject_HEAD\n" +" const char *data;\n" +"} MyObject;\n" +"\n" +"static PyTypeObject MyObject_Type = {\n" +" PyVarObject_HEAD_INIT(NULL, 0)\n" +" .tp_name = \"mymod.MyObject\",\n" +" .tp_basicsize = sizeof(MyObject),\n" +" .tp_doc = PyDoc_STR(\"My objects\"),\n" +" .tp_new = myobj_new,\n" +" .tp_dealloc = (destructor)myobj_dealloc,\n" +" .tp_repr = (reprfunc)myobj_repr,\n" +"};" +msgstr "" + +msgid "" +"You may also find older code (especially in the CPython code base) with a " +"more verbose initializer::" +msgstr "" +"Ви також можете знайти старіший код (особливо в кодовій базі CPython) із " +"більш детальним ініціалізатором:" + +msgid "" +"static PyTypeObject MyObject_Type = {\n" +" PyVarObject_HEAD_INIT(NULL, 0)\n" +" \"mymod.MyObject\", /* tp_name */\n" +" sizeof(MyObject), /* tp_basicsize */\n" +" 0, /* tp_itemsize */\n" +" (destructor)myobj_dealloc, /* tp_dealloc */\n" +" 0, /* tp_vectorcall_offset */\n" +" 0, /* tp_getattr */\n" +" 0, /* tp_setattr */\n" +" 0, /* tp_as_async */\n" +" (reprfunc)myobj_repr, /* tp_repr */\n" +" 0, /* tp_as_number */\n" +" 0, /* tp_as_sequence */\n" +" 0, /* tp_as_mapping */\n" +" 0, /* tp_hash */\n" +" 0, /* tp_call */\n" +" 0, /* tp_str */\n" +" 0, /* tp_getattro */\n" +" 0, /* tp_setattro */\n" +" 0, /* tp_as_buffer */\n" +" 0, /* tp_flags */\n" +" PyDoc_STR(\"My objects\"), /* tp_doc */\n" +" 0, /* tp_traverse */\n" +" 0, /* tp_clear */\n" +" 0, /* tp_richcompare */\n" +" 0, /* tp_weaklistoffset */\n" +" 0, /* tp_iter */\n" +" 0, /* tp_iternext */\n" +" 0, /* tp_methods */\n" +" 0, /* tp_members */\n" +" 0, /* tp_getset */\n" +" 0, /* tp_base */\n" +" 0, /* tp_dict */\n" +" 0, /* tp_descr_get */\n" +" 0, /* tp_descr_set */\n" +" 0, /* tp_dictoffset */\n" +" 0, /* tp_init */\n" +" 0, /* tp_alloc */\n" +" myobj_new, /* tp_new */\n" +"};" +msgstr "" + +msgid "A type that supports weakrefs, instance dicts, and hashing::" +msgstr "Тип, який підтримує слабкі посилання, екземпляри dicts і хешування::" + +msgid "" +"typedef struct {\n" +" PyObject_HEAD\n" +" const char *data;\n" +"} MyObject;\n" +"\n" +"static PyTypeObject MyObject_Type = {\n" +" PyVarObject_HEAD_INIT(NULL, 0)\n" +" .tp_name = \"mymod.MyObject\",\n" +" .tp_basicsize = sizeof(MyObject),\n" +" .tp_doc = PyDoc_STR(\"My objects\"),\n" +" .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE |\n" +" Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_MANAGED_DICT |\n" +" Py_TPFLAGS_MANAGED_WEAKREF,\n" +" .tp_new = myobj_new,\n" +" .tp_traverse = (traverseproc)myobj_traverse,\n" +" .tp_clear = (inquiry)myobj_clear,\n" +" .tp_alloc = PyType_GenericNew,\n" +" .tp_dealloc = (destructor)myobj_dealloc,\n" +" .tp_repr = (reprfunc)myobj_repr,\n" +" .tp_hash = (hashfunc)myobj_hash,\n" +" .tp_richcompare = PyBaseObject_Type.tp_richcompare,\n" +"};" +msgstr "" + +msgid "" +"A str subclass that cannot be subclassed and cannot be called to create " +"instances (e.g. uses a separate factory func) using :c:macro:" +"`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag::" +msgstr "" + +msgid "" +"typedef struct {\n" +" PyUnicodeObject raw;\n" +" char *extra;\n" +"} MyStr;\n" +"\n" +"static PyTypeObject MyStr_Type = {\n" +" PyVarObject_HEAD_INIT(NULL, 0)\n" +" .tp_name = \"mymod.MyStr\",\n" +" .tp_basicsize = sizeof(MyStr),\n" +" .tp_base = NULL, // set to &PyUnicode_Type in module init\n" +" .tp_doc = PyDoc_STR(\"my custom str\"),\n" +" .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DISALLOW_INSTANTIATION,\n" +" .tp_repr = (reprfunc)myobj_repr,\n" +"};" +msgstr "" + +msgid "" +"The simplest :ref:`static type ` with fixed-length instances::" +msgstr "" +"Найпростіший :ref:`статичний тип ` з екземплярами фіксованої " +"довжини::" + +msgid "" +"typedef struct {\n" +" PyObject_HEAD\n" +"} MyObject;\n" +"\n" +"static PyTypeObject MyObject_Type = {\n" +" PyVarObject_HEAD_INIT(NULL, 0)\n" +" .tp_name = \"mymod.MyObject\",\n" +"};" +msgstr "" + +msgid "" +"The simplest :ref:`static type ` with variable-length " +"instances::" +msgstr "" +"Найпростіший :ref:`статичний тип ` з екземплярами змінної " +"довжини::" + +msgid "" +"typedef struct {\n" +" PyObject_VAR_HEAD\n" +" const char *data[1];\n" +"} MyObject;\n" +"\n" +"static PyTypeObject MyObject_Type = {\n" +" PyVarObject_HEAD_INIT(NULL, 0)\n" +" .tp_name = \"mymod.MyObject\",\n" +" .tp_basicsize = sizeof(MyObject) - sizeof(char *),\n" +" .tp_itemsize = sizeof(char *),\n" +"};" +msgstr "" + +msgid "built-in function" +msgstr "вбудована функція" + +msgid "repr" +msgstr "репр" + +msgid "hash" +msgstr "" diff --git a/c-api/unicode.po b/c-api/unicode.po new file mode 100644 index 000000000..02427680b --- /dev/null +++ b/c-api/unicode.po @@ -0,0 +1,1882 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:50+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Unicode Objects and Codecs" +msgstr "Об’єкти та кодеки Unicode" + +msgid "Unicode Objects" +msgstr "Об'єкти Unicode" + +msgid "" +"Since the implementation of :pep:`393` in Python 3.3, Unicode objects " +"internally use a variety of representations, in order to allow handling the " +"complete range of Unicode characters while staying memory efficient. There " +"are special cases for strings where all code points are below 128, 256, or " +"65536; otherwise, code points must be below 1114112 (which is the full " +"Unicode range)." +msgstr "" +"З моменту впровадження :pep:`393` у Python 3.3 об’єкти Unicode внутрішньо " +"використовують різноманітні представлення, щоб дозволити обробку повного " +"діапазону символів Unicode, залишаючись ефективним для пам’яті. Існують " +"особливі випадки для рядків, де всі кодові точки нижчі за 128, 256 або " +"65536; інакше кодові точки повинні бути нижче 1114112 (що є повним " +"діапазоном Unicode)." + +msgid "" +"UTF-8 representation is created on demand and cached in the Unicode object." +msgstr "" + +msgid "" +"The :c:type:`Py_UNICODE` representation has been removed since Python 3.12 " +"with deprecated APIs. See :pep:`623` for more information." +msgstr "" + +msgid "Unicode Type" +msgstr "Тип Unicode" + +msgid "" +"These are the basic Unicode object types used for the Unicode implementation " +"in Python:" +msgstr "" +"Ось основні типи об’єктів Unicode, які використовуються для реалізації " +"Unicode в Python:" + +msgid "" +"These types are typedefs for unsigned integer types wide enough to contain " +"characters of 32 bits, 16 bits and 8 bits, respectively. When dealing with " +"single Unicode characters, use :c:type:`Py_UCS4`." +msgstr "" +"Ці типи є визначеннями типів для беззнакових цілих типів, достатньо широких, " +"щоб містити символи 32 біти, 16 бітів і 8 бітів відповідно. При роботі з " +"окремими символами Unicode використовуйте :c:type:`Py_UCS4`." + +msgid "" +"This is a typedef of :c:type:`wchar_t`, which is a 16-bit type or 32-bit " +"type depending on the platform." +msgstr "" +"Це визначення типу :c:type:`wchar_t`, який є 16-бітним або 32-бітним типом " +"залежно від платформи." + +msgid "" +"In previous versions, this was a 16-bit type or a 32-bit type depending on " +"whether you selected a \"narrow\" or \"wide\" Unicode version of Python at " +"build time." +msgstr "" +"У попередніх версіях це був 16-розрядний або 32-розрядний тип залежно від " +"того, чи ви вибрали \"вузьку\" чи \"широку\" версію Unicode Python під час " +"збирання." + +msgid "" +"These subtypes of :c:type:`PyObject` represent a Python Unicode object. In " +"almost all cases, they shouldn't be used directly, since all API functions " +"that deal with Unicode objects take and return :c:type:`PyObject` pointers." +msgstr "" +"Ці підтипи :c:type:`PyObject` представляють об’єкт Python Unicode. Майже у " +"всіх випадках їх не слід використовувати напряму, оскільки всі функції API, " +"які працюють з об’єктами Unicode, приймають і повертають покажчики :c:type:" +"`PyObject`." + +msgid "" +"This instance of :c:type:`PyTypeObject` represents the Python Unicode type. " +"It is exposed to Python code as ``str``." +msgstr "" +"Цей екземпляр :c:type:`PyTypeObject` представляє тип Python Unicode. Він " +"доступний коду Python як ``str``." + +msgid "" +"The following APIs are C macros and static inlined functions for fast checks " +"and access to internal read-only data of Unicode objects:" +msgstr "" + +msgid "" +"Return true if the object *obj* is a Unicode object or an instance of a " +"Unicode subtype. This function always succeeds." +msgstr "" + +msgid "" +"Return true if the object *obj* is a Unicode object, but not an instance of " +"a subtype. This function always succeeds." +msgstr "" + +msgid "Returns ``0``. This API is kept only for backward compatibility." +msgstr "" + +msgid "This API does nothing since Python 3.12." +msgstr "" + +msgid "" +"Return the length of the Unicode string, in code points. *unicode* has to " +"be a Unicode object in the \"canonical\" representation (not checked)." +msgstr "" + +msgid "" +"Return a pointer to the canonical representation cast to UCS1, UCS2 or UCS4 " +"integer types for direct character access. No checks are performed if the " +"canonical representation has the correct character size; use :c:func:" +"`PyUnicode_KIND` to select the right function." +msgstr "" + +msgid "Return values of the :c:func:`PyUnicode_KIND` macro." +msgstr "Повертає значення макросу :c:func:`PyUnicode_KIND`." + +msgid "``PyUnicode_WCHAR_KIND`` has been removed." +msgstr "" + +msgid "" +"Return one of the PyUnicode kind constants (see above) that indicate how " +"many bytes per character this Unicode object uses to store its data. " +"*unicode* has to be a Unicode object in the \"canonical\" representation " +"(not checked)." +msgstr "" + +msgid "" +"Return a void pointer to the raw Unicode buffer. *unicode* has to be a " +"Unicode object in the \"canonical\" representation (not checked)." +msgstr "" + +msgid "" +"Write into a canonical representation *data* (as obtained with :c:func:" +"`PyUnicode_DATA`). This function performs no sanity checks, and is intended " +"for usage in loops. The caller should cache the *kind* value and *data* " +"pointer as obtained from other calls. *index* is the index in the string " +"(starts at 0) and *value* is the new code point value which should be " +"written to that location." +msgstr "" + +msgid "" +"Read a code point from a canonical representation *data* (as obtained with :" +"c:func:`PyUnicode_DATA`). No checks or ready calls are performed." +msgstr "" +"Прочитайте кодову точку з канонічного представлення *data* (отриманого за " +"допомогою :c:func:`PyUnicode_DATA`). Перевірки чи готові виклики не " +"виконуються." + +msgid "" +"Read a character from a Unicode object *unicode*, which must be in the " +"\"canonical\" representation. This is less efficient than :c:func:" +"`PyUnicode_READ` if you do multiple consecutive reads." +msgstr "" + +msgid "" +"Return the maximum code point that is suitable for creating another string " +"based on *unicode*, which must be in the \"canonical\" representation. This " +"is always an approximation but more efficient than iterating over the string." +msgstr "" + +msgid "" +"Return ``1`` if the string is a valid identifier according to the language " +"definition, section :ref:`identifiers`. Return ``0`` otherwise." +msgstr "" +"Повертає ``1``, якщо рядок є дійсним ідентифікатором відповідно до " +"визначення мови, розділ :ref:`identifiers`. Інакше поверніть ``0``." + +msgid "" +"The function does not call :c:func:`Py_FatalError` anymore if the string is " +"not ready." +msgstr "" +"Функція більше не викликає :c:func:`Py_FatalError`, якщо рядок не готовий." + +msgid "Unicode Character Properties" +msgstr "Властивості символів Unicode" + +msgid "" +"Unicode provides many different character properties. The most often needed " +"ones are available through these macros which are mapped to C functions " +"depending on the Python configuration." +msgstr "" +"Unicode надає багато різних властивостей символів. Найпотрібніші з них " +"доступні через ці макроси, які зіставляються з функціями C залежно від " +"конфігурації Python." + +msgid "" +"Return ``1`` or ``0`` depending on whether *ch* is a whitespace character." +msgstr "Повертає \"1\" або \"0\" залежно від того, чи *ch* є пробілом." + +msgid "" +"Return ``1`` or ``0`` depending on whether *ch* is a lowercase character." +msgstr "" +"Повертає \"1\" або \"0\" залежно від того, чи *ch* є символом нижнього " +"регістру." + +msgid "" +"Return ``1`` or ``0`` depending on whether *ch* is an uppercase character." +msgstr "" +"Повертає ``1`` або ``0`` залежно від того, чи *ch* є символом у верхньому " +"регістрі." + +msgid "" +"Return ``1`` or ``0`` depending on whether *ch* is a titlecase character." +msgstr "" +"Повертає ``1`` або ``0`` залежно від того, чи *ch* є символом заголовка." + +msgid "" +"Return ``1`` or ``0`` depending on whether *ch* is a linebreak character." +msgstr "" +"Повертає \"1\" або \"0\" залежно від того, чи є *ch* символом розриву рядка." + +msgid "Return ``1`` or ``0`` depending on whether *ch* is a decimal character." +msgstr "" +"Повертає \"1\" або \"0\" залежно від того, чи є *ch* десятковим символом." + +msgid "Return ``1`` or ``0`` depending on whether *ch* is a digit character." +msgstr "Повертає \"1\" або \"0\" залежно від того, чи є *ch* символом цифри." + +msgid "Return ``1`` or ``0`` depending on whether *ch* is a numeric character." +msgstr "" +"Повертає \"1\" або \"0\" залежно від того, чи є *ch* цифровим символом." + +msgid "" +"Return ``1`` or ``0`` depending on whether *ch* is an alphabetic character." +msgstr "Повертає \"1\" або \"0\" залежно від того, чи *ch* є буквою." + +msgid "" +"Return ``1`` or ``0`` depending on whether *ch* is an alphanumeric character." +msgstr "" +"Повертає \"1\" або \"0\" залежно від того, чи є *ch* буквено-цифровим " +"символом." + +msgid "" +"Return ``1`` or ``0`` depending on whether *ch* is a printable character, in " +"the sense of :meth:`str.isprintable`." +msgstr "" + +msgid "These APIs can be used for fast direct character conversions:" +msgstr "" +"Ці API можна використовувати для швидкого прямого перетворення символів:" + +msgid "Return the character *ch* converted to lower case." +msgstr "Повертає символ *ch*, перетворений на нижній регістр." + +msgid "Return the character *ch* converted to upper case." +msgstr "Повертає символ *ch*, перетворений у верхній регістр." + +msgid "Return the character *ch* converted to title case." +msgstr "Повертає символ *ch*, перетворений на регістр заголовка." + +msgid "" +"Return the character *ch* converted to a decimal positive integer. Return " +"``-1`` if this is not possible. This function does not raise exceptions." +msgstr "" + +msgid "" +"Return the character *ch* converted to a single digit integer. Return ``-1`` " +"if this is not possible. This function does not raise exceptions." +msgstr "" + +msgid "" +"Return the character *ch* converted to a double. Return ``-1.0`` if this is " +"not possible. This function does not raise exceptions." +msgstr "" + +msgid "These APIs can be used to work with surrogates:" +msgstr "Ці API можна використовувати для роботи із сурогатами:" + +msgid "Check if *ch* is a surrogate (``0xD800 <= ch <= 0xDFFF``)." +msgstr "Перевірте, чи *ch* є сурогатом (``0xD800 <= ch <= 0xDFFF``)." + +msgid "Check if *ch* is a high surrogate (``0xD800 <= ch <= 0xDBFF``)." +msgstr "Перевірте, чи *ch* є високим сурогатом (``0xD800 <= ch <= 0xDBFF``)." + +msgid "Check if *ch* is a low surrogate (``0xDC00 <= ch <= 0xDFFF``)." +msgstr "Перевірте, чи *ch* є низьким сурогатом (``0xDC00 <= ch <= 0xDFFF``)." + +msgid "" +"Join two surrogate code points and return a single :c:type:`Py_UCS4` value. " +"*high* and *low* are respectively the leading and trailing surrogates in a " +"surrogate pair. *high* must be in the range [0xD800; 0xDBFF] and *low* must " +"be in the range [0xDC00; 0xDFFF]." +msgstr "" + +msgid "Creating and accessing Unicode strings" +msgstr "Створення та доступ до рядків Unicode" + +msgid "" +"To create Unicode objects and access their basic sequence properties, use " +"these APIs:" +msgstr "" +"Щоб створити об’єкти Unicode та отримати доступ до їхніх основних " +"властивостей послідовності, використовуйте ці API:" + +msgid "" +"Create a new Unicode object. *maxchar* should be the true maximum code " +"point to be placed in the string. As an approximation, it can be rounded up " +"to the nearest value in the sequence 127, 255, 65535, 1114111." +msgstr "" +"Створіть новий об’єкт Unicode. *maxchar* має бути справжньою максимальною " +"кодовою точкою, яка буде розміщена в рядку. Приблизно його можна округлити " +"до найближчого значення в послідовності 127, 255, 65535, 1114111." + +msgid "" +"This is the recommended way to allocate a new Unicode object. Objects " +"created using this function are not resizable." +msgstr "" +"Це рекомендований спосіб виділення нового об’єкта Unicode. Розмір об’єктів, " +"створених за допомогою цієї функції, неможливо змінити." + +msgid "On error, set an exception and return ``NULL``." +msgstr "" + +msgid "" +"Create a new Unicode object with the given *kind* (possible values are :c:" +"macro:`PyUnicode_1BYTE_KIND` etc., as returned by :c:func:" +"`PyUnicode_KIND`). The *buffer* must point to an array of *size* units of " +"1, 2 or 4 bytes per character, as given by the kind." +msgstr "" +"Створіть новий об’єкт Unicode із заданим *kind* (можливі значення: :c:macro:" +"`PyUnicode_1BYTE_KIND` тощо, як повертає :c:func:`PyUnicode_KIND`). *Буфер* " +"має вказувати на масив одиниць *розміру* по 1, 2 або 4 байти на символ, як " +"задано типом." + +msgid "" +"If necessary, the input *buffer* is copied and transformed into the " +"canonical representation. For example, if the *buffer* is a UCS4 string (:c:" +"macro:`PyUnicode_4BYTE_KIND`) and it consists only of codepoints in the UCS1 " +"range, it will be transformed into UCS1 (:c:macro:`PyUnicode_1BYTE_KIND`)." +msgstr "" + +msgid "" +"Create a Unicode object from the char buffer *str*. The bytes will be " +"interpreted as being UTF-8 encoded. The buffer is copied into the new " +"object. The return value might be a shared object, i.e. modification of the " +"data is not allowed." +msgstr "" + +msgid "This function raises :exc:`SystemError` when:" +msgstr "" + +msgid "*size* < 0," +msgstr "" + +msgid "*str* is ``NULL`` and *size* > 0" +msgstr "" + +msgid "*str* == ``NULL`` with *size* > 0 is not allowed anymore." +msgstr "" + +msgid "" +"Create a Unicode object from a UTF-8 encoded null-terminated char buffer " +"*str*." +msgstr "" + +msgid "" +"Take a C :c:func:`printf`\\ -style *format* string and a variable number of " +"arguments, calculate the size of the resulting Python Unicode string and " +"return a string with the values formatted into it. The variable arguments " +"must be C types and must correspond exactly to the format characters in the " +"*format* ASCII-encoded string." +msgstr "" + +msgid "" +"A conversion specifier contains two or more characters and has the following " +"components, which must occur in this order:" +msgstr "" +"Специфікатор перетворення містить два або більше символів і має наступні " +"компоненти, які мають відображатися в такому порядку:" + +msgid "The ``'%'`` character, which marks the start of the specifier." +msgstr "Символ ``'%'``, який позначає початок специфікатора." + +msgid "" +"Conversion flags (optional), which affect the result of some conversion " +"types." +msgstr "" +"Прапорці перетворення (опціонально), які впливають на результат деяких типів " +"перетворення." + +msgid "" +"Minimum field width (optional). If specified as an ``'*'`` (asterisk), the " +"actual width is given in the next argument, which must be of type :c:expr:" +"`int`, and the object to convert comes after the minimum field width and " +"optional precision." +msgstr "" + +msgid "" +"Precision (optional), given as a ``'.'`` (dot) followed by the precision. If " +"specified as ``'*'`` (an asterisk), the actual precision is given in the " +"next argument, which must be of type :c:expr:`int`, and the value to convert " +"comes after the precision." +msgstr "" + +msgid "Length modifier (optional)." +msgstr "Модифікатор довжини (необов'язково)." + +msgid "Conversion type." +msgstr "Тип перетворення." + +msgid "The conversion flag characters are:" +msgstr "Символи прапора перетворення:" + +msgid "Flag" +msgstr "Прапор" + +msgid "Meaning" +msgstr "Значення" + +msgid "``0``" +msgstr "``0``" + +msgid "The conversion will be zero padded for numeric values." +msgstr "Перетворення буде доповнено нулем для числових значень." + +msgid "``-``" +msgstr "" + +msgid "" +"The converted value is left adjusted (overrides the ``0`` flag if both are " +"given)." +msgstr "" + +msgid "" +"The length modifiers for following integer conversions (``d``, ``i``, ``o``, " +"``u``, ``x``, or ``X``) specify the type of the argument (:c:expr:`int` by " +"default):" +msgstr "" + +msgid "Modifier" +msgstr "" + +msgid "Types" +msgstr "Типи" + +msgid "``l``" +msgstr "``l``" + +msgid ":c:expr:`long` or :c:expr:`unsigned long`" +msgstr "" + +msgid "``ll``" +msgstr "" + +msgid ":c:expr:`long long` or :c:expr:`unsigned long long`" +msgstr "" + +msgid "``j``" +msgstr "" + +msgid ":c:type:`intmax_t` or :c:type:`uintmax_t`" +msgstr "" + +msgid "``z``" +msgstr "" + +msgid ":c:type:`size_t` or :c:type:`ssize_t`" +msgstr "" + +msgid "``t``" +msgstr "" + +msgid ":c:type:`ptrdiff_t`" +msgstr "" + +msgid "" +"The length modifier ``l`` for following conversions ``s`` or ``V`` specify " +"that the type of the argument is :c:expr:`const wchar_t*`." +msgstr "" + +msgid "The conversion specifiers are:" +msgstr "" + +msgid "Conversion Specifier" +msgstr "" + +msgid "Type" +msgstr "Тип" + +msgid "Comment" +msgstr "коментар" + +msgid "``%``" +msgstr "``%``" + +msgid "*n/a*" +msgstr "*немає*" + +msgid "The literal ``%`` character." +msgstr "" + +msgid "``d``, ``i``" +msgstr "" + +msgid "Specified by the length modifier" +msgstr "" + +msgid "The decimal representation of a signed C integer." +msgstr "" + +msgid "``u``" +msgstr "" + +msgid "The decimal representation of an unsigned C integer." +msgstr "" + +msgid "``o``" +msgstr "``о``" + +msgid "The octal representation of an unsigned C integer." +msgstr "" + +msgid "``x``" +msgstr "``x``" + +msgid "The hexadecimal representation of an unsigned C integer (lowercase)." +msgstr "" + +msgid "``X``" +msgstr "" + +msgid "The hexadecimal representation of an unsigned C integer (uppercase)." +msgstr "" + +msgid "``c``" +msgstr "``c``" + +msgid ":c:expr:`int`" +msgstr "" + +msgid "A single character." +msgstr "" + +msgid "``s``" +msgstr "``s``" + +msgid ":c:expr:`const char*` or :c:expr:`const wchar_t*`" +msgstr "" + +msgid "A null-terminated C character array." +msgstr "Масив символів C із закінченням нулем." + +msgid "``p``" +msgstr "``p``" + +msgid ":c:expr:`const void*`" +msgstr "" + +msgid "" +"The hex representation of a C pointer. Mostly equivalent to " +"``printf(\"%p\")`` except that it is guaranteed to start with the literal " +"``0x`` regardless of what the platform's ``printf`` yields." +msgstr "" + +msgid "``A``" +msgstr "" + +msgid ":c:expr:`PyObject*`" +msgstr "" + +msgid "The result of calling :func:`ascii`." +msgstr "Результат виклику :func:`ascii`." + +msgid "``U``" +msgstr "" + +msgid "A Unicode object." +msgstr "Об'єкт Unicode." + +msgid "``V``" +msgstr "" + +msgid ":c:expr:`PyObject*`, :c:expr:`const char*` or :c:expr:`const wchar_t*`" +msgstr "" + +msgid "" +"A Unicode object (which may be ``NULL``) and a null-terminated C character " +"array as a second parameter (which will be used, if the first parameter is " +"``NULL``)." +msgstr "" +"Об’єкт Unicode (який може бути ``NULL``) і масив символів C із нульовим " +"закінченням як другий параметр (який використовуватиметься, якщо перший " +"параметр ``NULL``)." + +msgid "``S``" +msgstr "" + +msgid "The result of calling :c:func:`PyObject_Str`." +msgstr "Результат виклику :c:func:`PyObject_Str`." + +msgid "``R``" +msgstr "" + +msgid "The result of calling :c:func:`PyObject_Repr`." +msgstr "Результат виклику :c:func:`PyObject_Repr`." + +msgid "``T``" +msgstr "" + +msgid "" +"Get the fully qualified name of an object type; call :c:func:" +"`PyType_GetFullyQualifiedName`." +msgstr "" + +msgid "``#T``" +msgstr "" + +msgid "" +"Similar to ``T`` format, but use a colon (``:``) as separator between the " +"module name and the qualified name." +msgstr "" + +msgid "``N``" +msgstr "``N``" + +msgid ":c:expr:`PyTypeObject*`" +msgstr "" + +msgid "" +"Get the fully qualified name of a type; call :c:func:" +"`PyType_GetFullyQualifiedName`." +msgstr "" + +msgid "``#N``" +msgstr "" + +msgid "" +"Similar to ``N`` format, but use a colon (``:``) as separator between the " +"module name and the qualified name." +msgstr "" + +msgid "" +"The width formatter unit is number of characters rather than bytes. The " +"precision formatter unit is number of bytes or :c:type:`wchar_t` items (if " +"the length modifier ``l`` is used) for ``\"%s\"`` and ``\"%V\"`` (if the " +"``PyObject*`` argument is ``NULL``), and a number of characters for " +"``\"%A\"``, ``\"%U\"``, ``\"%S\"``, ``\"%R\"`` and ``\"%V\"`` (if the " +"``PyObject*`` argument is not ``NULL``)." +msgstr "" + +msgid "" +"Unlike to C :c:func:`printf` the ``0`` flag has effect even when a precision " +"is given for integer conversions (``d``, ``i``, ``u``, ``o``, ``x``, or " +"``X``)." +msgstr "" + +msgid "Support for ``\"%lld\"`` and ``\"%llu\"`` added." +msgstr "Додано підтримку ``\"%lld\"`` і ``\"%llu\"``." + +msgid "Support for ``\"%li\"``, ``\"%lli\"`` and ``\"%zi\"`` added." +msgstr "Додано підтримку ``\"%li\"``, ``\"%lli\"`` і ``\"%zi\"``." + +msgid "" +"Support width and precision formatter for ``\"%s\"``, ``\"%A\"``, " +"``\"%U\"``, ``\"%V\"``, ``\"%S\"``, ``\"%R\"`` added." +msgstr "" +"Підтримка ширини та точного форматування для ``\"%s\"``, ``\"%A\"``, " +"``\"%U\"``, ``\"%V\"``, ``\"%S\"``, ``\"%R\"`` додано." + +msgid "" +"Support for conversion specifiers ``o`` and ``X``. Support for length " +"modifiers ``j`` and ``t``. Length modifiers are now applied to all integer " +"conversions. Length modifier ``l`` is now applied to conversion specifiers " +"``s`` and ``V``. Support for variable width and precision ``*``. Support for " +"flag ``-``." +msgstr "" + +msgid "" +"An unrecognized format character now sets a :exc:`SystemError`. In previous " +"versions it caused all the rest of the format string to be copied as-is to " +"the result string, and any extra arguments discarded." +msgstr "" + +msgid "Support for ``%T``, ``%#T``, ``%N`` and ``%#N`` formats added." +msgstr "" + +msgid "" +"Identical to :c:func:`PyUnicode_FromFormat` except that it takes exactly two " +"arguments." +msgstr "" +"Ідентичний :c:func:`PyUnicode_FromFormat` за винятком того, що він приймає " +"рівно два аргументи." + +msgid "" +"Copy an instance of a Unicode subtype to a new true Unicode object if " +"necessary. If *obj* is already a true Unicode object (not a subtype), return " +"a new :term:`strong reference` to the object." +msgstr "" + +msgid "" +"Objects other than Unicode or its subtypes will cause a :exc:`TypeError`." +msgstr "" +"Об’єкти, відмінні від Unicode або його підтипів, викличуть :exc:`TypeError`." + +msgid "Create a Unicode Object from the given Unicode code point *ordinal*." +msgstr "" + +msgid "" +"The ordinal must be in ``range(0x110000)``. A :exc:`ValueError` is raised in " +"the case it is not." +msgstr "" + +msgid "Decode an encoded object *obj* to a Unicode object." +msgstr "Декодуйте закодований об’єкт *obj* в об’єкт Unicode." + +msgid "" +":class:`bytes`, :class:`bytearray` and other :term:`bytes-like objects " +"` are decoded according to the given *encoding* and using " +"the error handling defined by *errors*. Both can be ``NULL`` to have the " +"interface use the default values (see :ref:`builtincodecs` for details)." +msgstr "" +":class:`bytes`, :class:`bytearray` та інші :term:`bytes-подібні об’єкти " +"` декодуються відповідно до заданого *кодування* та з " +"використанням обробки помилок, визначеної *errors*. Обидва можуть бути " +"``NULL``, щоб інтерфейс використовував значення за замовчуванням (дивіться :" +"ref:`builtincodecs` для деталей)." + +msgid "" +"All other objects, including Unicode objects, cause a :exc:`TypeError` to be " +"set." +msgstr "" +"Усі інші об’єкти, включно з об’єктами Unicode, викликають встановлення :exc:" +"`TypeError`." + +msgid "" +"The API returns ``NULL`` if there was an error. The caller is responsible " +"for decref'ing the returned objects." +msgstr "" +"API повертає ``NULL``, якщо сталася помилка. Виклик відповідає за " +"декодування повернутих об'єктів." + +msgid "" +"Return the name of the default string encoding, ``\"utf-8\"``. See :func:" +"`sys.getdefaultencoding`." +msgstr "" + +msgid "" +"The returned string does not need to be freed, and is valid until " +"interpreter shutdown." +msgstr "" + +msgid "Return the length of the Unicode object, in code points." +msgstr "Повертає довжину об’єкта Юнікод у кодових точках." + +msgid "On error, set an exception and return ``-1``." +msgstr "" + +msgid "" +"Copy characters from one Unicode object into another. This function " +"performs character conversion when necessary and falls back to :c:func:`!" +"memcpy` if possible. Returns ``-1`` and sets an exception on error, " +"otherwise returns the number of copied characters." +msgstr "" + +msgid "" +"Fill a string with a character: write *fill_char* into ``unicode[start:" +"start+length]``." +msgstr "" +"Заповніть рядок символом: напишіть *fill_char* у ``unicode[start:" +"start+length]``." + +msgid "" +"Fail if *fill_char* is bigger than the string maximum character, or if the " +"string has more than 1 reference." +msgstr "" +"Помилка, якщо *fill_char* перевищує максимальний символ рядка або якщо рядок " +"має більше ніж 1 посилання." + +msgid "" +"Return the number of written character, or return ``-1`` and raise an " +"exception on error." +msgstr "" +"Повертає номер написаного символу або повертає ``-1`` і викликає виняток у " +"разі помилки." + +msgid "" +"Write a character to a string. The string must have been created through :c:" +"func:`PyUnicode_New`. Since Unicode strings are supposed to be immutable, " +"the string must not be shared, or have been hashed yet." +msgstr "" +"Записати символ у рядок. Рядок має бути створено через :c:func:" +"`PyUnicode_New`. Оскільки рядки Юнікоду мають бути незмінними, рядок не " +"можна надавати спільно або хешувати." + +msgid "" +"This function checks that *unicode* is a Unicode object, that the index is " +"not out of bounds, and that the object can be modified safely (i.e. that it " +"its reference count is one)." +msgstr "" +"Ця функція перевіряє, що *unicode* є об’єктом Unicode, що індекс не виходить " +"за межі та чи можна безпечно змінювати об’єкт (тобто чи кількість посилань " +"дорівнює одиниці)." + +msgid "Return ``0`` on success, ``-1`` on error with an exception set." +msgstr "" + +msgid "" +"Read a character from a string. This function checks that *unicode* is a " +"Unicode object and the index is not out of bounds, in contrast to :c:func:" +"`PyUnicode_READ_CHAR`, which performs no error checking." +msgstr "" + +msgid "Return character on success, ``-1`` on error with an exception set." +msgstr "" + +msgid "" +"Return a substring of *unicode*, from character index *start* (included) to " +"character index *end* (excluded). Negative indices are not supported. On " +"error, set an exception and return ``NULL``." +msgstr "" + +msgid "" +"Copy the string *unicode* into a UCS4 buffer, including a null character, if " +"*copy_null* is set. Returns ``NULL`` and sets an exception on error (in " +"particular, a :exc:`SystemError` if *buflen* is smaller than the length of " +"*unicode*). *buffer* is returned on success." +msgstr "" + +msgid "" +"Copy the string *unicode* into a new UCS4 buffer that is allocated using :c:" +"func:`PyMem_Malloc`. If this fails, ``NULL`` is returned with a :exc:" +"`MemoryError` set. The returned buffer always has an extra null code point " +"appended." +msgstr "" + +msgid "Locale Encoding" +msgstr "Кодування мови" + +msgid "" +"The current locale encoding can be used to decode text from the operating " +"system." +msgstr "" +"Поточне кодування мови можна використовувати для декодування тексту з " +"операційної системи." + +msgid "" +"Decode a string from UTF-8 on Android and VxWorks, or from the current " +"locale encoding on other platforms. The supported error handlers are " +"``\"strict\"`` and ``\"surrogateescape\"`` (:pep:`383`). The decoder uses " +"``\"strict\"`` error handler if *errors* is ``NULL``. *str* must end with a " +"null character but cannot contain embedded null characters." +msgstr "" +"Декодуйте рядок з UTF-8 на Android і VxWorks або з поточного кодування мови " +"на інших платформах. Підтримуваними обробниками помилок є ``\"strict\"`` і " +"``\"surrogateescape\"`` (:pep:`383`). Декодер використовує ``\"strict\"`` " +"обробник помилок, якщо *errors* має значення ``NULL``. *str* має " +"закінчуватися нульовим символом, але не може містити вбудовані нульові " +"символи." + +msgid "" +"Use :c:func:`PyUnicode_DecodeFSDefaultAndSize` to decode a string from the :" +"term:`filesystem encoding and error handler`." +msgstr "" + +msgid "This function ignores the :ref:`Python UTF-8 Mode `." +msgstr "Ця функція ігнорує :ref:`Режим Python UTF-8 `." + +msgid "The :c:func:`Py_DecodeLocale` function." +msgstr "Функція :c:func:`Py_DecodeLocale`." + +msgid "" +"The function now also uses the current locale encoding for the " +"``surrogateescape`` error handler, except on Android. Previously, :c:func:" +"`Py_DecodeLocale` was used for the ``surrogateescape``, and the current " +"locale encoding was used for ``strict``." +msgstr "" +"Функція тепер також використовує поточне кодування мови для обробника " +"помилок ``surrogateescape``, за винятком Android. Раніше :c:func:" +"`Py_DecodeLocale` використовувався для ``surrogateescape``, а поточне " +"кодування мови використовувалося для ``strict``." + +msgid "" +"Similar to :c:func:`PyUnicode_DecodeLocaleAndSize`, but compute the string " +"length using :c:func:`!strlen`." +msgstr "" + +msgid "" +"Encode a Unicode object to UTF-8 on Android and VxWorks, or to the current " +"locale encoding on other platforms. The supported error handlers are " +"``\"strict\"`` and ``\"surrogateescape\"`` (:pep:`383`). The encoder uses " +"``\"strict\"`` error handler if *errors* is ``NULL``. Return a :class:" +"`bytes` object. *unicode* cannot contain embedded null characters." +msgstr "" +"Закодуйте об’єкт Unicode до UTF-8 на Android і VxWorks або до поточного " +"кодування мови на інших платформах. Підтримуваними обробниками помилок є " +"``\"strict\"`` і ``\"surrogateescape\"`` (:pep:`383`). Кодер використовує " +"``\"strict\"`` обробник помилок, якщо *errors* має значення ``NULL``. " +"Повертає об’єкт :class:`bytes`. *unicode* не може містити вбудовані нульові " +"символи." + +msgid "" +"Use :c:func:`PyUnicode_EncodeFSDefault` to encode a string to the :term:" +"`filesystem encoding and error handler`." +msgstr "" + +msgid "The :c:func:`Py_EncodeLocale` function." +msgstr "Функція :c:func:`Py_EncodeLocale`." + +msgid "" +"The function now also uses the current locale encoding for the " +"``surrogateescape`` error handler, except on Android. Previously, :c:func:" +"`Py_EncodeLocale` was used for the ``surrogateescape``, and the current " +"locale encoding was used for ``strict``." +msgstr "" +"Функція тепер також використовує поточне кодування мови для обробника " +"помилок ``surrogateescape``, за винятком Android. Раніше :c:func:" +"`Py_EncodeLocale` використовувався для ``surrogateescape``, а поточне " +"кодування мови використовувалося для ``strict``." + +msgid "File System Encoding" +msgstr "Кодування файлової системи" + +msgid "" +"Functions encoding to and decoding from the :term:`filesystem encoding and " +"error handler` (:pep:`383` and :pep:`529`)." +msgstr "" + +msgid "" +"To encode file names to :class:`bytes` during argument parsing, the " +"``\"O&\"`` converter should be used, passing :c:func:`!" +"PyUnicode_FSConverter` as the conversion function:" +msgstr "" + +msgid "" +":ref:`PyArg_Parse\\* converter `: encode :class:`str` objects " +"-- obtained directly or through the :class:`os.PathLike` interface -- to :" +"class:`bytes` using :c:func:`PyUnicode_EncodeFSDefault`; :class:`bytes` " +"objects are output as-is. *result* must be an address of a C variable of " +"type :c:expr:`PyObject*` (or :c:expr:`PyBytesObject*`). On success, set the " +"variable to a new :term:`strong reference` to a :ref:`bytes object " +"` which must be released when it is no longer used and return " +"a non-zero value (:c:macro:`Py_CLEANUP_SUPPORTED`). Embedded null bytes are " +"not allowed in the result. On failure, return ``0`` with an exception set." +msgstr "" + +msgid "" +"If *obj* is ``NULL``, the function releases a strong reference stored in the " +"variable referred by *result* and returns ``1``." +msgstr "" + +msgid "Accepts a :term:`path-like object`." +msgstr "Приймає :term:`path-like object`." + +msgid "" +"To decode file names to :class:`str` during argument parsing, the ``\"O&\"`` " +"converter should be used, passing :c:func:`!PyUnicode_FSDecoder` as the " +"conversion function:" +msgstr "" + +msgid "" +":ref:`PyArg_Parse\\* converter `: decode :class:`bytes` objects " +"-- obtained either directly or indirectly through the :class:`os.PathLike` " +"interface -- to :class:`str` using :c:func:" +"`PyUnicode_DecodeFSDefaultAndSize`; :class:`str` objects are output as-is. " +"*result* must be an address of a C variable of type :c:expr:`PyObject*` (or :" +"c:expr:`PyUnicodeObject*`). On success, set the variable to a new :term:" +"`strong reference` to a :ref:`Unicode object ` which must be " +"released when it is no longer used and return a non-zero value (:c:macro:" +"`Py_CLEANUP_SUPPORTED`). Embedded null characters are not allowed in the " +"result. On failure, return ``0`` with an exception set." +msgstr "" + +msgid "" +"If *obj* is ``NULL``, release the strong reference to the object referred to " +"by *result* and return ``1``." +msgstr "" + +msgid "Decode a string from the :term:`filesystem encoding and error handler`." +msgstr "Декодуйте рядок із :term:`filesystem encoding and error handler`." + +msgid "" +"If you need to decode a string from the current locale encoding, use :c:func:" +"`PyUnicode_DecodeLocaleAndSize`." +msgstr "" + +msgid "" +"The :term:`filesystem error handler ` " +"is now used." +msgstr "" + +msgid "" +"Decode a null-terminated string from the :term:`filesystem encoding and " +"error handler`." +msgstr "" +"Декодуйте рядок із нульовим закінченням із :term:`filesystem encoding and " +"error handler`." + +msgid "" +"If the string length is known, use :c:func:" +"`PyUnicode_DecodeFSDefaultAndSize`." +msgstr "" + +msgid "" +"Encode a Unicode object to the :term:`filesystem encoding and error " +"handler`, and return :class:`bytes`. Note that the resulting :class:`bytes` " +"object can contain null bytes." +msgstr "" + +msgid "" +"If you need to encode a string to the current locale encoding, use :c:func:" +"`PyUnicode_EncodeLocale`." +msgstr "" + +msgid "wchar_t Support" +msgstr "Підтримка wchar_t" + +msgid ":c:type:`wchar_t` support for platforms which support it:" +msgstr ":c:type:`wchar_t` підтримка платформ, які її підтримують:" + +msgid "" +"Create a Unicode object from the :c:type:`wchar_t` buffer *wstr* of the " +"given *size*. Passing ``-1`` as the *size* indicates that the function must " +"itself compute the length, using :c:func:`!wcslen`. Return ``NULL`` on " +"failure." +msgstr "" + +msgid "" +"Copy the Unicode object contents into the :c:type:`wchar_t` buffer *wstr*. " +"At most *size* :c:type:`wchar_t` characters are copied (excluding a possibly " +"trailing null termination character). Return the number of :c:type:" +"`wchar_t` characters copied or ``-1`` in case of an error." +msgstr "" + +msgid "" +"When *wstr* is ``NULL``, instead return the *size* that would be required to " +"store all of *unicode* including a terminating null." +msgstr "" + +msgid "" +"Note that the resulting :c:expr:`wchar_t*` string may or may not be null-" +"terminated. It is the responsibility of the caller to make sure that the :c:" +"expr:`wchar_t*` string is null-terminated in case this is required by the " +"application. Also, note that the :c:expr:`wchar_t*` string might contain " +"null characters, which would cause the string to be truncated when used with " +"most C functions." +msgstr "" + +msgid "" +"Convert the Unicode object to a wide character string. The output string " +"always ends with a null character. If *size* is not ``NULL``, write the " +"number of wide characters (excluding the trailing null termination " +"character) into *\\*size*. Note that the resulting :c:type:`wchar_t` string " +"might contain null characters, which would cause the string to be truncated " +"when used with most C functions. If *size* is ``NULL`` and the :c:expr:" +"`wchar_t*` string contains null characters a :exc:`ValueError` is raised." +msgstr "" + +msgid "" +"Returns a buffer allocated by :c:macro:`PyMem_New` (use :c:func:`PyMem_Free` " +"to free it) on success. On error, returns ``NULL`` and *\\*size* is " +"undefined. Raises a :exc:`MemoryError` if memory allocation is failed." +msgstr "" + +msgid "" +"Raises a :exc:`ValueError` if *size* is ``NULL`` and the :c:expr:`wchar_t*` " +"string contains null characters." +msgstr "" + +msgid "Built-in Codecs" +msgstr "Вбудовані кодеки" + +msgid "" +"Python provides a set of built-in codecs which are written in C for speed. " +"All of these codecs are directly usable via the following functions." +msgstr "" +"Python надає набір вбудованих кодеків, написаних на C для швидкості. Усі ці " +"кодеки можна безпосередньо використовувати за допомогою наведених нижче " +"функцій." + +msgid "" +"Many of the following APIs take two arguments encoding and errors, and they " +"have the same semantics as the ones of the built-in :func:`str` string " +"object constructor." +msgstr "" +"Багато з наведених нижче API приймають кодування двох аргументів і помилки, " +"і вони мають таку саму семантику, як і вбудовані конструктори рядкових " +"об’єктів :func:`str`." + +msgid "" +"Setting encoding to ``NULL`` causes the default encoding to be used which is " +"UTF-8. The file system calls should use :c:func:`PyUnicode_FSConverter` for " +"encoding file names. This uses the :term:`filesystem encoding and error " +"handler` internally." +msgstr "" + +msgid "" +"Error handling is set by errors which may also be set to ``NULL`` meaning to " +"use the default handling defined for the codec. Default error handling for " +"all built-in codecs is \"strict\" (:exc:`ValueError` is raised)." +msgstr "" +"Обробка помилок встановлюється помилками, які також можуть мати значення " +"``NULL``, що означає використання обробки за замовчуванням, визначеної для " +"кодека. Обробка помилок за замовчуванням для всіх вбудованих кодеків є " +"\"суворою\" (:exc:`ValueError` викликається)." + +msgid "" +"The codecs all use a similar interface. Only deviations from the following " +"generic ones are documented for simplicity." +msgstr "" +"Усі кодеки використовують подібний інтерфейс. Для простоти документуються " +"лише відхилення від наступних загальних." + +msgid "Generic Codecs" +msgstr "Загальні кодеки" + +msgid "These are the generic codec APIs:" +msgstr "Це загальні кодеки API:" + +msgid "" +"Create a Unicode object by decoding *size* bytes of the encoded string " +"*str*. *encoding* and *errors* have the same meaning as the parameters of " +"the same name in the :func:`str` built-in function. The codec to be used is " +"looked up using the Python codec registry. Return ``NULL`` if an exception " +"was raised by the codec." +msgstr "" + +msgid "" +"Encode a Unicode object and return the result as Python bytes object. " +"*encoding* and *errors* have the same meaning as the parameters of the same " +"name in the Unicode :meth:`~str.encode` method. The codec to be used is " +"looked up using the Python codec registry. Return ``NULL`` if an exception " +"was raised by the codec." +msgstr "" +"Закодуйте об’єкт Unicode та поверніть результат як об’єкт Python bytes. " +"*encoding* і *errors* мають те саме значення, що й однойменні параметри в " +"методі Unicode :meth:`~str.encode`. Кодек, який буде використовуватися, " +"шукається за допомогою реєстру кодеків Python. Повертає ``NULL``, якщо кодек " +"викликав виняткову ситуацію." + +msgid "UTF-8 Codecs" +msgstr "Кодеки UTF-8" + +msgid "These are the UTF-8 codec APIs:" +msgstr "Це API кодека UTF-8:" + +msgid "" +"Create a Unicode object by decoding *size* bytes of the UTF-8 encoded string " +"*str*. Return ``NULL`` if an exception was raised by the codec." +msgstr "" + +msgid "" +"If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF8`. If " +"*consumed* is not ``NULL``, trailing incomplete UTF-8 byte sequences will " +"not be treated as an error. Those bytes will not be decoded and the number " +"of bytes that have been decoded will be stored in *consumed*." +msgstr "" +"Якщо *consumed* дорівнює ``NULL``, поводьтеся як :c:func:" +"`PyUnicode_DecodeUTF8`. Якщо *consumed* не має значення ``NULL``, кінцеві " +"неповні послідовності байтів UTF-8 не розглядатимуться як помилка. Ці байти " +"не будуть декодовані, а кількість декодованих байтів зберігатиметься в " +"*спожитих*." + +msgid "" +"Encode a Unicode object using UTF-8 and return the result as Python bytes " +"object. Error handling is \"strict\". Return ``NULL`` if an exception was " +"raised by the codec." +msgstr "" +"Закодуйте об’єкт Unicode за допомогою UTF-8 і поверніть результат як об’єкт " +"Python bytes. Обробка помилок \"строга\". Повертає ``NULL``, якщо кодек " +"викликав виняткову ситуацію." + +msgid "" +"The function fails if the string contains surrogate code points (``U+D800`` " +"- ``U+DFFF``)." +msgstr "" + +msgid "" +"Return a pointer to the UTF-8 encoding of the Unicode object, and store the " +"size of the encoded representation (in bytes) in *size*. The *size* " +"argument can be ``NULL``; in this case no size will be stored. The returned " +"buffer always has an extra null byte appended (not included in *size*), " +"regardless of whether there are any other null code points." +msgstr "" +"Поверніть вказівник на кодування UTF-8 об’єкта Unicode та збережіть розмір " +"закодованого представлення (у байтах) у *size*. Аргумент *size* може бути " +"``NULL``; у цьому випадку розмір не буде збережено. До поверненого буфера " +"завжди додається додатковий нульовий байт (не включений у *size*), незалежно " +"від того, чи є інші нульові кодові точки." + +msgid "" +"On error, set an exception, set *size* to ``-1`` (if it's not NULL) and " +"return ``NULL``." +msgstr "" + +msgid "" +"This caches the UTF-8 representation of the string in the Unicode object, " +"and subsequent calls will return a pointer to the same buffer. The caller " +"is not responsible for deallocating the buffer. The buffer is deallocated " +"and pointers to it become invalid when the Unicode object is garbage " +"collected." +msgstr "" +"Це кешує представлення UTF-8 рядка в об’єкті Unicode, а наступні виклики " +"повертатимуть вказівник на той самий буфер. Абонент не несе відповідальності " +"за звільнення буфера. Буфер звільняється, і покажчики на нього стають " +"недійсними, коли об’єкт Unicode збирається як сміття." + +msgid "The return type is now ``const char *`` rather of ``char *``." +msgstr "Тип повернення тепер ``const char *``, а не ``char *``." + +msgid "This function is a part of the :ref:`limited API `." +msgstr "" + +msgid "As :c:func:`PyUnicode_AsUTF8AndSize`, but does not store the size." +msgstr "Як :c:func:`PyUnicode_AsUTF8AndSize`, але не зберігає розмір." + +msgid "" +"This function does not have any special behavior for `null characters " +"`_ embedded within *unicode*. " +"As a result, strings containing null characters will remain in the returned " +"string, which some C functions might interpret as the end of the string, " +"leading to truncation. If truncation is an issue, it is recommended to use :" +"c:func:`PyUnicode_AsUTF8AndSize` instead." +msgstr "" + +msgid "UTF-32 Codecs" +msgstr "Кодеки UTF-32" + +msgid "These are the UTF-32 codec APIs:" +msgstr "Це API кодеків UTF-32:" + +msgid "" +"Decode *size* bytes from a UTF-32 encoded buffer string and return the " +"corresponding Unicode object. *errors* (if non-``NULL``) defines the error " +"handling. It defaults to \"strict\"." +msgstr "" +"Декодуйте байти *size* із рядка буфера, закодованого в UTF-32, і повертайте " +"відповідний об’єкт Unicode. *errors* (якщо не ``NULL``) визначає обробку " +"помилок. За замовчуванням встановлено \"суворий\"." + +msgid "" +"If *byteorder* is non-``NULL``, the decoder starts decoding using the given " +"byte order::" +msgstr "" +"Якщо *byteorder* не ``NULL``, декодер починає декодування, використовуючи " +"вказаний порядок байтів::" + +msgid "" +"*byteorder == -1: little endian\n" +"*byteorder == 0: native order\n" +"*byteorder == 1: big endian" +msgstr "" + +msgid "" +"If ``*byteorder`` is zero, and the first four bytes of the input data are a " +"byte order mark (BOM), the decoder switches to this byte order and the BOM " +"is not copied into the resulting Unicode string. If ``*byteorder`` is " +"``-1`` or ``1``, any byte order mark is copied to the output." +msgstr "" +"Якщо ``*byteorder`` дорівнює нулю, а перші чотири байти вхідних даних є " +"міткою порядку байтів (BOM), декодер перемикається на цей порядок байтів і " +"BOM не копіюється в результуючий рядок Unicode. Якщо ``*byteorder`` дорівнює " +"``-1`` або ``1``, будь-яка позначка порядку байтів копіюється до виводу." + +msgid "" +"After completion, *\\*byteorder* is set to the current byte order at the end " +"of input data." +msgstr "" +"Після завершення *\\*byteorder* встановлюється на поточний порядок байтів у " +"кінці вхідних даних." + +msgid "If *byteorder* is ``NULL``, the codec starts in native order mode." +msgstr "" +"Якщо *byteorder* дорівнює ``NULL``, кодек запускається в режимі власного " +"порядку." + +msgid "Return ``NULL`` if an exception was raised by the codec." +msgstr "Повертає ``NULL``, якщо кодек викликав виняткову ситуацію." + +msgid "" +"If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF32`. If " +"*consumed* is not ``NULL``, :c:func:`PyUnicode_DecodeUTF32Stateful` will not " +"treat trailing incomplete UTF-32 byte sequences (such as a number of bytes " +"not divisible by four) as an error. Those bytes will not be decoded and the " +"number of bytes that have been decoded will be stored in *consumed*." +msgstr "" +"Якщо *consumed* дорівнює ``NULL``, поводьтеся як :c:func:" +"`PyUnicode_DecodeUTF32`. Якщо *consumed* не дорівнює ``NULL``, :c:func:" +"`PyUnicode_DecodeUTF32Stateful` не розглядатиме кінцеві неповні " +"послідовності байтів UTF-32 (наприклад, кількість байтів, що не ділиться на " +"чотири) як помилку. Ці байти не будуть декодовані, а кількість декодованих " +"байтів зберігатиметься в *спожитих*." + +msgid "" +"Return a Python byte string using the UTF-32 encoding in native byte order. " +"The string always starts with a BOM mark. Error handling is \"strict\". " +"Return ``NULL`` if an exception was raised by the codec." +msgstr "" +"Повертає байтовий рядок Python, використовуючи кодування UTF-32 у рідному " +"порядку байтів. Рядок завжди починається з позначки BOM. Обробка помилок " +"\"строга\". Повертає ``NULL``, якщо кодек викликав виняткову ситуацію." + +msgid "UTF-16 Codecs" +msgstr "Кодеки UTF-16" + +msgid "These are the UTF-16 codec APIs:" +msgstr "Це API кодека UTF-16:" + +msgid "" +"Decode *size* bytes from a UTF-16 encoded buffer string and return the " +"corresponding Unicode object. *errors* (if non-``NULL``) defines the error " +"handling. It defaults to \"strict\"." +msgstr "" +"Декодуйте байти *size* із рядка буфера, закодованого в UTF-16, і повертайте " +"відповідний об’єкт Unicode. *errors* (якщо не ``NULL``) визначає обробку " +"помилок. За замовчуванням встановлено \"суворий\"." + +msgid "" +"If ``*byteorder`` is zero, and the first two bytes of the input data are a " +"byte order mark (BOM), the decoder switches to this byte order and the BOM " +"is not copied into the resulting Unicode string. If ``*byteorder`` is " +"``-1`` or ``1``, any byte order mark is copied to the output (where it will " +"result in either a ``\\ufeff`` or a ``\\ufffe`` character)." +msgstr "" +"Якщо ``*byteorder`` дорівнює нулю, а перші два байти вхідних даних є міткою " +"порядку байтів (BOM), декодер перемикається на цей порядок байтів і BOM не " +"копіюється в результуючий рядок Unicode. Якщо ``*byteorder`` дорівнює ``-1`` " +"або ``1``, будь-яка позначка порядку байтів копіюється до виводу (де це " +"призведе до ``\\ufeff`` або ``\\ufffe`` символ)." + +msgid "" +"After completion, ``*byteorder`` is set to the current byte order at the end " +"of input data." +msgstr "" +"Після завершення ``*byteorder`` встановлюється на поточний порядок байтів у " +"кінці вхідних даних." + +msgid "" +"If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF16`. If " +"*consumed* is not ``NULL``, :c:func:`PyUnicode_DecodeUTF16Stateful` will not " +"treat trailing incomplete UTF-16 byte sequences (such as an odd number of " +"bytes or a split surrogate pair) as an error. Those bytes will not be " +"decoded and the number of bytes that have been decoded will be stored in " +"*consumed*." +msgstr "" +"Якщо *consumed* дорівнює ``NULL``, поводьтеся як :c:func:" +"`PyUnicode_DecodeUTF16`. Якщо *consumed* не дорівнює ``NULL``, :c:func:" +"`PyUnicode_DecodeUTF16Stateful` не розглядатиме кінцеві неповні " +"послідовності байтів UTF-16 (наприклад, непарну кількість байтів або " +"розділену сурогатну пару) як помилку. Ці байти не будуть декодовані, а " +"кількість декодованих байтів зберігатиметься в *спожитих*." + +msgid "" +"Return a Python byte string using the UTF-16 encoding in native byte order. " +"The string always starts with a BOM mark. Error handling is \"strict\". " +"Return ``NULL`` if an exception was raised by the codec." +msgstr "" +"Повертає байтовий рядок Python, використовуючи кодування UTF-16 у рідному " +"порядку байтів. Рядок завжди починається з позначки BOM. Обробка помилок " +"\"строга\". Повертає ``NULL``, якщо кодек викликав виняткову ситуацію." + +msgid "UTF-7 Codecs" +msgstr "Кодеки UTF-7" + +msgid "These are the UTF-7 codec APIs:" +msgstr "Це API кодека UTF-7:" + +msgid "" +"Create a Unicode object by decoding *size* bytes of the UTF-7 encoded string " +"*str*. Return ``NULL`` if an exception was raised by the codec." +msgstr "" + +msgid "" +"If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF7`. If " +"*consumed* is not ``NULL``, trailing incomplete UTF-7 base-64 sections will " +"not be treated as an error. Those bytes will not be decoded and the number " +"of bytes that have been decoded will be stored in *consumed*." +msgstr "" +"Якщо *consumed* дорівнює ``NULL``, поводьтеся як :c:func:" +"`PyUnicode_DecodeUTF7`. Якщо *consumed* не дорівнює ``NULL``, кінцеві " +"неповні розділи UTF-7 base-64 не розглядатимуться як помилка. Ці байти не " +"будуть декодовані, а кількість декодованих байтів зберігатиметься в " +"*спожитих*." + +msgid "Unicode-Escape Codecs" +msgstr "Кодеки Unicode-Escape" + +msgid "These are the \"Unicode Escape\" codec APIs:" +msgstr "Це API кодека \"Unicode Escape\":" + +msgid "" +"Create a Unicode object by decoding *size* bytes of the Unicode-Escape " +"encoded string *str*. Return ``NULL`` if an exception was raised by the " +"codec." +msgstr "" + +msgid "" +"Encode a Unicode object using Unicode-Escape and return the result as a " +"bytes object. Error handling is \"strict\". Return ``NULL`` if an " +"exception was raised by the codec." +msgstr "" +"Закодуйте об’єкт Unicode за допомогою Unicode-Escape та поверніть результат " +"як об’єкт bytes. Обробка помилок \"строга\". Повертає ``NULL``, якщо кодек " +"викликав виняткову ситуацію." + +msgid "Raw-Unicode-Escape Codecs" +msgstr "Кодеки Raw-Unicode-Escape" + +msgid "These are the \"Raw Unicode Escape\" codec APIs:" +msgstr "Це API кодека \"Raw Unicode Escape\":" + +msgid "" +"Create a Unicode object by decoding *size* bytes of the Raw-Unicode-Escape " +"encoded string *str*. Return ``NULL`` if an exception was raised by the " +"codec." +msgstr "" + +msgid "" +"Encode a Unicode object using Raw-Unicode-Escape and return the result as a " +"bytes object. Error handling is \"strict\". Return ``NULL`` if an " +"exception was raised by the codec." +msgstr "" +"Закодуйте об’єкт Unicode за допомогою Raw-Unicode-Escape та поверніть " +"результат як об’єкт bytes. Обробка помилок \"строга\". Повертає ``NULL``, " +"якщо кодек викликав виняткову ситуацію." + +msgid "Latin-1 Codecs" +msgstr "Кодеки Latin-1" + +msgid "" +"These are the Latin-1 codec APIs: Latin-1 corresponds to the first 256 " +"Unicode ordinals and only these are accepted by the codecs during encoding." +msgstr "" +"Це API кодека Latin-1: Latin-1 відповідає першим 256 порядковим номерам " +"Unicode, і лише вони приймаються кодеками під час кодування." + +msgid "" +"Create a Unicode object by decoding *size* bytes of the Latin-1 encoded " +"string *str*. Return ``NULL`` if an exception was raised by the codec." +msgstr "" + +msgid "" +"Encode a Unicode object using Latin-1 and return the result as Python bytes " +"object. Error handling is \"strict\". Return ``NULL`` if an exception was " +"raised by the codec." +msgstr "" +"Закодуйте об’єкт Unicode за допомогою Latin-1 і поверніть результат як " +"об’єкт Python bytes. Обробка помилок \"строга\". Повертає ``NULL``, якщо " +"кодек викликав виняткову ситуацію." + +msgid "ASCII Codecs" +msgstr "Кодеки ASCII" + +msgid "" +"These are the ASCII codec APIs. Only 7-bit ASCII data is accepted. All " +"other codes generate errors." +msgstr "" +"Це API кодеків ASCII. Приймаються лише 7-бітні дані ASCII. Усі інші коди " +"генерують помилки." + +msgid "" +"Create a Unicode object by decoding *size* bytes of the ASCII encoded string " +"*str*. Return ``NULL`` if an exception was raised by the codec." +msgstr "" + +msgid "" +"Encode a Unicode object using ASCII and return the result as Python bytes " +"object. Error handling is \"strict\". Return ``NULL`` if an exception was " +"raised by the codec." +msgstr "" +"Закодуйте об’єкт Unicode за допомогою ASCII і поверніть результат як об’єкт " +"Python bytes. Обробка помилок \"строга\". Повертає ``NULL``, якщо кодек " +"викликав виняткову ситуацію." + +msgid "Character Map Codecs" +msgstr "Кодеки карти символів" + +msgid "" +"This codec is special in that it can be used to implement many different " +"codecs (and this is in fact what was done to obtain most of the standard " +"codecs included in the :mod:`!encodings` package). The codec uses mappings " +"to encode and decode characters. The mapping objects provided must support " +"the :meth:`~object.__getitem__` mapping interface; dictionaries and " +"sequences work well." +msgstr "" + +msgid "These are the mapping codec APIs:" +msgstr "Це API кодека відображення:" + +msgid "" +"Create a Unicode object by decoding *size* bytes of the encoded string *str* " +"using the given *mapping* object. Return ``NULL`` if an exception was " +"raised by the codec." +msgstr "" + +msgid "" +"If *mapping* is ``NULL``, Latin-1 decoding will be applied. Else *mapping* " +"must map bytes ordinals (integers in the range from 0 to 255) to Unicode " +"strings, integers (which are then interpreted as Unicode ordinals) or " +"``None``. Unmapped data bytes -- ones which cause a :exc:`LookupError`, as " +"well as ones which get mapped to ``None``, ``0xFFFE`` or ``'\\ufffe'``, are " +"treated as undefined mappings and cause an error." +msgstr "" +"Якщо *mapping* має значення ``NULL``, буде застосовано декодування Latin-1. " +"Інакше *відображення* має зіставляти порядкові номери байтів (цілі числа в " +"діапазоні від 0 до 255) на рядки Unicode, цілі числа (які потім " +"інтерпретуються як порядкові номери Unicode) або ``None``. Невідображені " +"байти даних – ті, які викликають :exc:`LookupError`, а також ті, які " +"відображаються на ``None``, ``0xFFFE`` або ``'\\ufffe``, розглядаються як " +"невизначені відображення і викликати помилку." + +msgid "" +"Encode a Unicode object using the given *mapping* object and return the " +"result as a bytes object. Error handling is \"strict\". Return ``NULL`` if " +"an exception was raised by the codec." +msgstr "" +"Закодуйте об’єкт Unicode за допомогою даного об’єкта *mapping* і поверніть " +"результат як об’єкт bytes. Обробка помилок \"строга\". Повертає ``NULL``, " +"якщо кодек викликав виняткову ситуацію." + +msgid "" +"The *mapping* object must map Unicode ordinal integers to bytes objects, " +"integers in the range from 0 to 255 or ``None``. Unmapped character " +"ordinals (ones which cause a :exc:`LookupError`) as well as mapped to " +"``None`` are treated as \"undefined mapping\" and cause an error." +msgstr "" +"Об’єкт *mapping* має зіставляти порядкові цілі числа Unicode з об’єктами " +"bytes, цілі числа в діапазоні від 0 до 255 або ``None``. Невідображені " +"порядкові символи (які спричиняють :exc:`LookupError`), а також відображені " +"на ``None`` розглядаються як \"невизначене відображення\" та викликають " +"помилку." + +msgid "The following codec API is special in that maps Unicode to Unicode." +msgstr "" +"Наступний кодек API є особливим у тому, що відображає Unicode на Unicode." + +msgid "" +"Translate a string by applying a character mapping table to it and return " +"the resulting Unicode object. Return ``NULL`` if an exception was raised by " +"the codec." +msgstr "" +"Перекладіть рядок, застосувавши до нього таблицю зіставлення символів і " +"поверніть отриманий об’єкт Unicode. Повертає ``NULL``, якщо кодек викликав " +"виняткову ситуацію." + +msgid "" +"The mapping table must map Unicode ordinal integers to Unicode ordinal " +"integers or ``None`` (causing deletion of the character)." +msgstr "" +"Таблиця відображення має зіставляти порядкові цілі числа Unicode з " +"порядковими цілими числами Unicode або \"Немає\" (спричиняючи видалення " +"символу)." + +msgid "" +"Mapping tables need only provide the :meth:`~object.__getitem__` interface; " +"dictionaries and sequences work well. Unmapped character ordinals (ones " +"which cause a :exc:`LookupError`) are left untouched and are copied as-is." +msgstr "" + +msgid "" +"*errors* has the usual meaning for codecs. It may be ``NULL`` which " +"indicates to use the default error handling." +msgstr "" +"*помилки* має звичайне значення для кодеків. Це може бути ``NULL``, що " +"вказує на використання стандартної обробки помилок." + +msgid "MBCS codecs for Windows" +msgstr "Кодеки MBCS для Windows" + +msgid "" +"These are the MBCS codec APIs. They are currently only available on Windows " +"and use the Win32 MBCS converters to implement the conversions. Note that " +"MBCS (or DBCS) is a class of encodings, not just one. The target encoding " +"is defined by the user settings on the machine running the codec." +msgstr "" +"Це API кодека MBCS. Наразі вони доступні лише у Windows і використовують " +"конвертери Win32 MBCS для реалізації перетворень. Зауважте, що MBCS (або " +"DBCS) — це клас кодувань, а не одне. Цільове кодування визначається " +"налаштуваннями користувача на машині, на якій працює кодек." + +msgid "" +"Create a Unicode object by decoding *size* bytes of the MBCS encoded string " +"*str*. Return ``NULL`` if an exception was raised by the codec." +msgstr "" + +msgid "" +"If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeMBCS`. If " +"*consumed* is not ``NULL``, :c:func:`PyUnicode_DecodeMBCSStateful` will not " +"decode trailing lead byte and the number of bytes that have been decoded " +"will be stored in *consumed*." +msgstr "" +"Якщо *consumed* дорівнює ``NULL``, поводьтеся як :c:func:" +"`PyUnicode_DecodeMBCS`. Якщо *consumed* не дорівнює ``NULL``, :c:func:" +"`PyUnicode_DecodeMBCSStateful` не декодуватиме кінцевий провідний байт, а " +"кількість декодованих байтів зберігатиметься в *consumed*." + +msgid "" +"Similar to :c:func:`PyUnicode_DecodeMBCSStateful`, except uses the code page " +"specified by *code_page*." +msgstr "" + +msgid "" +"Encode a Unicode object using MBCS and return the result as Python bytes " +"object. Error handling is \"strict\". Return ``NULL`` if an exception was " +"raised by the codec." +msgstr "" +"Закодуйте об’єкт Unicode за допомогою MBCS і поверніть результат як об’єкт " +"Python bytes. Обробка помилок \"строга\". Повертає ``NULL``, якщо кодек " +"викликав виняткову ситуацію." + +msgid "" +"Encode the Unicode object using the specified code page and return a Python " +"bytes object. Return ``NULL`` if an exception was raised by the codec. Use :" +"c:macro:`!CP_ACP` code page to get the MBCS encoder." +msgstr "" + +msgid "Methods & Slots" +msgstr "Методи та слоти" + +msgid "Methods and Slot Functions" +msgstr "Методи та функції слота" + +msgid "" +"The following APIs are capable of handling Unicode objects and strings on " +"input (we refer to them as strings in the descriptions) and return Unicode " +"objects or integers as appropriate." +msgstr "" +"Наступні API здатні обробляти об’єкти Unicode та рядки на вхідних даних (ми " +"називаємо їх рядками в описах) і повертати об’єкти Unicode або цілі числа " +"відповідно." + +msgid "They all return ``NULL`` or ``-1`` if an exception occurs." +msgstr "" +"Усі вони повертають ``NULL`` або ``-1``, якщо виникає виняткова ситуація." + +msgid "Concat two strings giving a new Unicode string." +msgstr "Concat два рядки дають новий рядок Unicode." + +msgid "" +"Split a string giving a list of Unicode strings. If *sep* is ``NULL``, " +"splitting will be done at all whitespace substrings. Otherwise, splits " +"occur at the given separator. At most *maxsplit* splits will be done. If " +"negative, no limit is set. Separators are not included in the resulting " +"list." +msgstr "" +"Розділити рядок, що дасть список рядків Unicode. Якщо *sep* дорівнює " +"``NULL``, розділення буде виконано на всіх пробільних підрядках. В іншому " +"випадку на даному сепараторі відбуваються розбивання. Буде виконано не " +"більше ніж *maxsplit*. Якщо значення від’ємне, обмеження не встановлено. " +"Розділювачі не включені в отриманий список." + +msgid "On error, return ``NULL`` with an exception set." +msgstr "" + +msgid "Equivalent to :py:meth:`str.split`." +msgstr "" + +msgid "" +"Similar to :c:func:`PyUnicode_Split`, but splitting will be done beginning " +"at the end of the string." +msgstr "" + +msgid "Equivalent to :py:meth:`str.rsplit`." +msgstr "" + +msgid "" +"Split a Unicode string at line breaks, returning a list of Unicode strings. " +"CRLF is considered to be one line break. If *keepends* is ``0``, the Line " +"break characters are not included in the resulting strings." +msgstr "" + +msgid "" +"Split a Unicode string at the first occurrence of *sep*, and return a 3-" +"tuple containing the part before the separator, the separator itself, and " +"the part after the separator. If the separator is not found, return a 3-" +"tuple containing the string itself, followed by two empty strings." +msgstr "" + +msgid "*sep* must not be empty." +msgstr "" + +msgid "Equivalent to :py:meth:`str.partition`." +msgstr "" + +msgid "" +"Similar to :c:func:`PyUnicode_Partition`, but split a Unicode string at the " +"last occurrence of *sep*. If the separator is not found, return a 3-tuple " +"containing two empty strings, followed by the string itself." +msgstr "" + +msgid "Equivalent to :py:meth:`str.rpartition`." +msgstr "" + +msgid "" +"Join a sequence of strings using the given *separator* and return the " +"resulting Unicode string." +msgstr "" +"З’єднайте послідовність рядків за допомогою заданого *роздільника* та " +"поверніть отриманий рядок Unicode." + +msgid "" +"Return ``1`` if *substr* matches ``unicode[start:end]`` at the given tail " +"end (*direction* == ``-1`` means to do a prefix match, *direction* == ``1`` " +"a suffix match), ``0`` otherwise. Return ``-1`` if an error occurred." +msgstr "" + +msgid "" +"Return the first position of *substr* in ``unicode[start:end]`` using the " +"given *direction* (*direction* == ``1`` means to do a forward search, " +"*direction* == ``-1`` a backward search). The return value is the index of " +"the first match; a value of ``-1`` indicates that no match was found, and " +"``-2`` indicates that an error occurred and an exception has been set." +msgstr "" + +msgid "" +"Return the first position of the character *ch* in ``unicode[start:end]`` " +"using the given *direction* (*direction* == ``1`` means to do a forward " +"search, *direction* == ``-1`` a backward search). The return value is the " +"index of the first match; a value of ``-1`` indicates that no match was " +"found, and ``-2`` indicates that an error occurred and an exception has been " +"set." +msgstr "" + +msgid "" +"*start* and *end* are now adjusted to behave like ``unicode[start:end]``." +msgstr "" + +msgid "" +"Return the number of non-overlapping occurrences of *substr* in " +"``unicode[start:end]``. Return ``-1`` if an error occurred." +msgstr "" + +msgid "" +"Replace at most *maxcount* occurrences of *substr* in *unicode* with " +"*replstr* and return the resulting Unicode object. *maxcount* == ``-1`` " +"means replace all occurrences." +msgstr "" + +msgid "" +"Compare two strings and return ``-1``, ``0``, ``1`` for less than, equal, " +"and greater than, respectively." +msgstr "" +"Порівняйте два рядки та поверніть ``-1``, ``0``, ``1`` для меншого, рівного " +"та більшого відповідно." + +msgid "" +"This function returns ``-1`` upon failure, so one should call :c:func:" +"`PyErr_Occurred` to check for errors." +msgstr "" +"Ця функція повертає ``-1`` у разі помилки, тому слід викликати :c:func:" +"`PyErr_Occurred`, щоб перевірити наявність помилок." + +msgid "" +"Compare a Unicode object with a char buffer which is interpreted as being " +"UTF-8 or ASCII encoded and return true (``1``) if they are equal, or false " +"(``0``) otherwise. If the Unicode object contains surrogate code points " +"(``U+D800`` - ``U+DFFF``) or the C string is not valid UTF-8, false (``0``) " +"is returned." +msgstr "" + +msgid "This function does not raise exceptions." +msgstr "Ця функція не викликає винятків." + +msgid "" +"Similar to :c:func:`PyUnicode_EqualToUTF8AndSize`, but compute *string* " +"length using :c:func:`!strlen`. If the Unicode object contains null " +"characters, false (``0``) is returned." +msgstr "" + +msgid "" +"Compare a Unicode object, *unicode*, with *string* and return ``-1``, ``0``, " +"``1`` for less than, equal, and greater than, respectively. It is best to " +"pass only ASCII-encoded strings, but the function interprets the input " +"string as ISO-8859-1 if it contains non-ASCII characters." +msgstr "" + +msgid "Rich compare two Unicode strings and return one of the following:" +msgstr "Rich порівнює два рядки Unicode та повертає одне з наступного:" + +msgid "``NULL`` in case an exception was raised" +msgstr "``NULL`` у разі виникнення винятку" + +msgid ":c:data:`Py_True` or :c:data:`Py_False` for successful comparisons" +msgstr "" + +msgid ":c:data:`Py_NotImplemented` in case the type combination is unknown" +msgstr "" + +msgid "" +"Possible values for *op* are :c:macro:`Py_GT`, :c:macro:`Py_GE`, :c:macro:" +"`Py_EQ`, :c:macro:`Py_NE`, :c:macro:`Py_LT`, and :c:macro:`Py_LE`." +msgstr "" + +msgid "" +"Return a new string object from *format* and *args*; this is analogous to " +"``format % args``." +msgstr "" +"Повертає новий рядковий об’єкт із *format* і *args*; це аналогічно ``format " +"% args``." + +msgid "" +"Check whether *substr* is contained in *unicode* and return true or false " +"accordingly." +msgstr "" + +msgid "" +"*substr* has to coerce to a one element Unicode string. ``-1`` is returned " +"if there was an error." +msgstr "" + +msgid "" +"Intern the argument :c:expr:`*p_unicode` in place. The argument must be the " +"address of a pointer variable pointing to a Python Unicode string object. " +"If there is an existing interned string that is the same as :c:expr:" +"`*p_unicode`, it sets :c:expr:`*p_unicode` to it (releasing the reference to " +"the old string object and creating a new :term:`strong reference` to the " +"interned string object), otherwise it leaves :c:expr:`*p_unicode` alone and " +"interns it." +msgstr "" + +msgid "" +"(Clarification: even though there is a lot of talk about references, think " +"of this function as reference-neutral. You must own the object you pass in; " +"after the call you no longer own the passed-in reference, but you newly own " +"the result.)" +msgstr "" + +msgid "" +"This function never raises an exception. On error, it leaves its argument " +"unchanged without interning it." +msgstr "" + +msgid "" +"Instances of subclasses of :py:class:`str` may not be interned, that is, :c:" +"expr:`PyUnicode_CheckExact(*p_unicode)` must be true. If it is not, then -- " +"as with any other error -- the argument is left unchanged." +msgstr "" + +msgid "" +"Note that interned strings are not “immortal”. You must keep a reference to " +"the result to benefit from interning." +msgstr "" + +msgid "" +"A combination of :c:func:`PyUnicode_FromString` and :c:func:" +"`PyUnicode_InternInPlace`, meant for statically allocated strings." +msgstr "" + +msgid "" +"Return a new (\"owned\") reference to either a new Unicode string object " +"that has been interned, or an earlier interned string object with the same " +"value." +msgstr "" + +msgid "" +"Python may keep a reference to the result, or make it :term:`immortal`, " +"preventing it from being garbage-collected promptly. For interning an " +"unbounded number of different strings, such as ones coming from user input, " +"prefer calling :c:func:`PyUnicode_FromString` and :c:func:" +"`PyUnicode_InternInPlace` directly." +msgstr "" + +msgid "Strings interned this way are made :term:`immortal`." +msgstr "" diff --git a/c-api/utilities.po b/c-api/utilities.po new file mode 100644 index 000000000..2625cd01c --- /dev/null +++ b/c-api/utilities.po @@ -0,0 +1,40 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:50+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Utilities" +msgstr "Комунальні послуги" + +msgid "" +"The functions in this chapter perform various utility tasks, ranging from " +"helping C code be more portable across platforms, using Python modules from " +"C, and parsing function arguments and constructing Python values from C " +"values." +msgstr "" +"Функції в цьому розділі виконують різноманітні службові завдання, починаючи " +"від сприяння більшій переносимості коду C на різні платформи, використання " +"модулів Python із C, аналізу аргументів функції та побудови значень Python " +"із значень C." diff --git a/c-api/veryhigh.po b/c-api/veryhigh.po new file mode 100644 index 000000000..83759a292 --- /dev/null +++ b/c-api/veryhigh.po @@ -0,0 +1,502 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:50+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "The Very High Level Layer" +msgstr "Рівень дуже високого рівня" + +msgid "" +"The functions in this chapter will let you execute Python source code given " +"in a file or a buffer, but they will not let you interact in a more detailed " +"way with the interpreter." +msgstr "" +"Функції в цій главі дозволять вам виконувати вихідний код Python, поданий у " +"файлі або буфері, але вони не дозволять вам більш детально взаємодіяти з " +"інтерпретатором." + +msgid "" +"Several of these functions accept a start symbol from the grammar as a " +"parameter. The available start symbols are :c:data:`Py_eval_input`, :c:data:" +"`Py_file_input`, and :c:data:`Py_single_input`. These are described " +"following the functions which accept them as parameters." +msgstr "" + +msgid "" +"Note also that several of these functions take :c:expr:`FILE*` parameters. " +"One particular issue which needs to be handled carefully is that the :c:type:" +"`FILE` structure for different C libraries can be different and " +"incompatible. Under Windows (at least), it is possible for dynamically " +"linked extensions to actually use different libraries, so care should be " +"taken that :c:expr:`FILE*` parameters are only passed to these functions if " +"it is certain that they were created by the same library that the Python " +"runtime is using." +msgstr "" + +msgid "" +"This is a simplified interface to :c:func:`PyRun_AnyFileExFlags` below, " +"leaving *closeit* set to ``0`` and *flags* set to ``NULL``." +msgstr "" +"Це спрощений інтерфейс для :c:func:`PyRun_AnyFileExFlags` нижче, залишаючи " +"*closeit* встановленим на ``0`` і *flags* встановленим на ``NULL``." + +msgid "" +"This is a simplified interface to :c:func:`PyRun_AnyFileExFlags` below, " +"leaving the *closeit* argument set to ``0``." +msgstr "" +"Це спрощений інтерфейс для :c:func:`PyRun_AnyFileExFlags` нижче, залишаючи " +"аргумент *closeit* встановленим на ``0``." + +msgid "" +"This is a simplified interface to :c:func:`PyRun_AnyFileExFlags` below, " +"leaving the *flags* argument set to ``NULL``." +msgstr "" +"Це спрощений інтерфейс для :c:func:`PyRun_AnyFileExFlags` нижче, залишаючи " +"для аргументу *flags* значення ``NULL``." + +msgid "" +"If *fp* refers to a file associated with an interactive device (console or " +"terminal input or Unix pseudo-terminal), return the value of :c:func:" +"`PyRun_InteractiveLoop`, otherwise return the result of :c:func:" +"`PyRun_SimpleFile`. *filename* is decoded from the filesystem encoding (:" +"func:`sys.getfilesystemencoding`). If *filename* is ``NULL``, this function " +"uses ``\"???\"`` as the filename. If *closeit* is true, the file is closed " +"before ``PyRun_SimpleFileExFlags()`` returns." +msgstr "" +"Якщо *fp* посилається на файл, пов’язаний з інтерактивним пристроєм (консоль " +"або термінал введення чи псевдотермінал Unix), повертає значення :c:func:" +"`PyRun_InteractiveLoop`, інакше повертає результат :c:func:" +"`PyRun_SimpleFile`.*ім’я файлу* розшифровується з кодування файлової системи " +"(:func:`sys.getfilesystemencoding`). Якщо *ім’я файлу* має значення " +"``NULL``, ця функція використовує ``\"???\"`` як ім’я файлу. Якщо *closeit* " +"має значення true, файл закривається до повернення " +"``PyRun_SimpleFileExFlags()``." + +msgid "" +"This is a simplified interface to :c:func:`PyRun_SimpleStringFlags` below, " +"leaving the :c:struct:`PyCompilerFlags`\\* argument set to ``NULL``." +msgstr "" + +msgid "" +"Executes the Python source code from *command* in the :mod:`__main__` module " +"according to the *flags* argument. If :mod:`__main__` does not already " +"exist, it is created. Returns ``0`` on success or ``-1`` if an exception " +"was raised. If there was an error, there is no way to get the exception " +"information. For the meaning of *flags*, see below." +msgstr "" +"Виконує вихідний код Python з *команди* в модулі :mod:`__main__` відповідно " +"до аргументу *flags*. Якщо :mod:`__main__` ще не існує, він буде створений. " +"Повертає ``0`` у разі успіху або ``-1``, якщо було викликано виключення. " +"Якщо сталася помилка, неможливо отримати інформацію про винятки. Про " +"значення *прапорів* дивіться нижче." + +msgid "" +"Note that if an otherwise unhandled :exc:`SystemExit` is raised, this " +"function will not return ``-1``, but exit the process, as long as :c:member:" +"`PyConfig.inspect` is zero." +msgstr "" + +msgid "" +"This is a simplified interface to :c:func:`PyRun_SimpleFileExFlags` below, " +"leaving *closeit* set to ``0`` and *flags* set to ``NULL``." +msgstr "" +"Це спрощений інтерфейс для :c:func:`PyRun_SimpleFileExFlags` нижче, " +"залишаючи *closeit* встановленим на ``0`` і *flags* встановленим на ``NULL``." + +msgid "" +"This is a simplified interface to :c:func:`PyRun_SimpleFileExFlags` below, " +"leaving *flags* set to ``NULL``." +msgstr "" +"Це спрощений інтерфейс для :c:func:`PyRun_SimpleFileExFlags` нижче, " +"залишаючи *flags* встановленими на ``NULL``." + +msgid "" +"Similar to :c:func:`PyRun_SimpleStringFlags`, but the Python source code is " +"read from *fp* instead of an in-memory string. *filename* should be the name " +"of the file, it is decoded from :term:`filesystem encoding and error " +"handler`. If *closeit* is true, the file is closed before " +"``PyRun_SimpleFileExFlags()`` returns." +msgstr "" +"Подібно до :c:func:`PyRun_SimpleStringFlags`, але вихідний код Python " +"читається з *fp* замість рядка в пам’яті. *filename* має бути назвою файлу, " +"воно розшифровується з :term:`filesystem encoding and error handler`. Якщо " +"*closeit* має значення true, файл закривається до повернення " +"``PyRun_SimpleFileExFlags()``." + +msgid "" +"On Windows, *fp* should be opened as binary mode (e.g. ``fopen(filename, " +"\"rb\")``). Otherwise, Python may not handle script file with LF line ending " +"correctly." +msgstr "" +"У Windows *fp* слід відкривати як бінарний режим (наприклад, " +"``fopen(filename, \"rb\")``). Інакше Python може неправильно обробити файл " +"сценарію з закінченням рядка LF." + +msgid "" +"This is a simplified interface to :c:func:`PyRun_InteractiveOneFlags` below, " +"leaving *flags* set to ``NULL``." +msgstr "" +"Це спрощений інтерфейс для :c:func:`PyRun_InteractiveOneFlags` нижче, " +"залишаючи *flags* встановленими на ``NULL``." + +msgid "" +"Read and execute a single statement from a file associated with an " +"interactive device according to the *flags* argument. The user will be " +"prompted using ``sys.ps1`` and ``sys.ps2``. *filename* is decoded from the :" +"term:`filesystem encoding and error handler`." +msgstr "" +"Читання та виконання окремого оператора з файлу, пов’язаного з інтерактивним " +"пристроєм, відповідно до аргументу *flags*. Користувачеві буде запропоновано " +"використовувати ``sys.ps1`` і ``sys.ps2``. *ім’я файлу* розшифровується з :" +"term:`filesystem encoding and error handler`." + +msgid "" +"Returns ``0`` when the input was executed successfully, ``-1`` if there was " +"an exception, or an error code from the :file:`errcode.h` include file " +"distributed as part of Python if there was a parse error. (Note that :file:" +"`errcode.h` is not included by :file:`Python.h`, so must be included " +"specifically if needed.)" +msgstr "" +"Повертає ``0``, якщо введення було виконано успішно, ``-1``, якщо стався " +"виняток, або код помилки з файлу включення :file:`errcode.h`, який " +"поширюється як частина Python, якщо був помилка аналізу. (Зауважте, що :file:" +"`errcode.h` не включено в :file:`Python.h`, тому його потрібно включити " +"спеціально, якщо це необхідно.)" + +msgid "" +"This is a simplified interface to :c:func:`PyRun_InteractiveLoopFlags` " +"below, leaving *flags* set to ``NULL``." +msgstr "" +"Це спрощений інтерфейс для :c:func:`PyRun_InteractiveLoopFlags` нижче, " +"залишаючи *flags* встановленими на ``NULL``." + +msgid "" +"Read and execute statements from a file associated with an interactive " +"device until EOF is reached. The user will be prompted using ``sys.ps1`` " +"and ``sys.ps2``. *filename* is decoded from the :term:`filesystem encoding " +"and error handler`. Returns ``0`` at EOF or a negative number upon failure." +msgstr "" +"Читати та виконувати оператори з файлу, пов’язаного з інтерактивним " +"пристроєм, доки не буде досягнуто EOF. Користувачеві буде запропоновано " +"використовувати ``sys.ps1`` і ``sys.ps2``. *ім’я файлу* розшифровується з :" +"term:`filesystem encoding and error handler`. Повертає ``0`` на EOF або " +"від'ємне число у разі помилки." + +msgid "" +"Can be set to point to a function with the prototype ``int func(void)``. " +"The function will be called when Python's interpreter prompt is about to " +"become idle and wait for user input from the terminal. The return value is " +"ignored. Overriding this hook can be used to integrate the interpreter's " +"prompt with other event loops, as done in the :file:`Modules/_tkinter.c` in " +"the Python source code." +msgstr "" +"Може вказувати на функцію з прототипом ``int func(void)``. Функція буде " +"викликана, коли підказка інтерпретатора Python збирається перейти в режим " +"очікування та чекати введення користувача з терміналу. Повернене значення " +"ігнорується. Перевизначення цього хука можна використати для інтеграції " +"підказки інтерпретатора з іншими циклами подій, як це зроблено в :file:" +"`Modules/_tkinter.c` у вихідному коді Python." + +msgid "" +"This function is only called from the :ref:`main interpreter `." +msgstr "" + +msgid "" +"Can be set to point to a function with the prototype ``char *func(FILE " +"*stdin, FILE *stdout, char *prompt)``, overriding the default function used " +"to read a single line of input at the interpreter's prompt. The function is " +"expected to output the string *prompt* if it's not ``NULL``, and then read a " +"line of input from the provided standard input file, returning the resulting " +"string. For example, The :mod:`readline` module sets this hook to provide " +"line-editing and tab-completion features." +msgstr "" +"Можна налаштувати так, щоб вказувати на функцію з прототипом ``char " +"*func(FILE *stdin, FILE *stdout, char *prompt)``, замінюючи функцію за " +"замовчуванням, яка використовується для читання одного рядка введення в " +"підказці інтерпретатора. Очікується, що функція виведе рядок *prompt*, якщо " +"він не ``NULL``, а потім прочитає рядок введення з наданого стандартного " +"файлу введення, повертаючи результуючий рядок. Наприклад, модуль :mod:" +"`readline` встановлює цей хук для надання функцій редагування рядка та " +"завершення табуляції." + +msgid "" +"The result must be a string allocated by :c:func:`PyMem_RawMalloc` or :c:" +"func:`PyMem_RawRealloc`, or ``NULL`` if an error occurred." +msgstr "" +"Результат має бути рядком, виділеним :c:func:`PyMem_RawMalloc` або :c:func:" +"`PyMem_RawRealloc`, або ``NULL``, якщо сталася помилка." + +msgid "" +"The result must be allocated by :c:func:`PyMem_RawMalloc` or :c:func:" +"`PyMem_RawRealloc`, instead of being allocated by :c:func:`PyMem_Malloc` or :" +"c:func:`PyMem_Realloc`." +msgstr "" +"Результат має бути виділено за допомогою :c:func:`PyMem_RawMalloc` або :c:" +"func:`PyMem_RawRealloc`, а не за допомогою :c:func:`PyMem_Malloc` або :c:" +"func:`PyMem_Realloc`." + +msgid "" +"This is a simplified interface to :c:func:`PyRun_StringFlags` below, leaving " +"*flags* set to ``NULL``." +msgstr "" +"Це спрощений інтерфейс для :c:func:`PyRun_StringFlags` нижче, залишаючи " +"*flags* встановленими на ``NULL``." + +msgid "" +"Execute Python source code from *str* in the context specified by the " +"objects *globals* and *locals* with the compiler flags specified by " +"*flags*. *globals* must be a dictionary; *locals* can be any object that " +"implements the mapping protocol. The parameter *start* specifies the start " +"token that should be used to parse the source code." +msgstr "" +"Виконайте вихідний код Python із *str* у контексті, визначеному об’єктами " +"*globals* і *locals* з прапорцями компілятора, визначеними *flags*. " +"*globals* має бути словником; *locals* може бути будь-яким об’єктом, який " +"реалізує протокол відображення. Параметр *start* визначає початковий маркер, " +"який слід використовувати для аналізу вихідного коду." + +msgid "" +"Returns the result of executing the code as a Python object, or ``NULL`` if " +"an exception was raised." +msgstr "" +"Повертає результат виконання коду як об’єкт Python або ``NULL``, якщо було " +"викликано виняткову ситуацію." + +msgid "" +"This is a simplified interface to :c:func:`PyRun_FileExFlags` below, leaving " +"*closeit* set to ``0`` and *flags* set to ``NULL``." +msgstr "" +"Це спрощений інтерфейс для :c:func:`PyRun_FileExFlags` нижче, залишаючи " +"*closeit* встановленим на ``0`` і *flags* встановленим на ``NULL``." + +msgid "" +"This is a simplified interface to :c:func:`PyRun_FileExFlags` below, leaving " +"*flags* set to ``NULL``." +msgstr "" +"Це спрощений інтерфейс для :c:func:`PyRun_FileExFlags` нижче, залишаючи " +"*flags* встановленими на ``NULL``." + +msgid "" +"This is a simplified interface to :c:func:`PyRun_FileExFlags` below, leaving " +"*closeit* set to ``0``." +msgstr "" +"Це спрощений інтерфейс для :c:func:`PyRun_FileExFlags` нижче, залишаючи " +"*closeit* встановленим на ``0``." + +msgid "" +"Similar to :c:func:`PyRun_StringFlags`, but the Python source code is read " +"from *fp* instead of an in-memory string. *filename* should be the name of " +"the file, it is decoded from the :term:`filesystem encoding and error " +"handler`. If *closeit* is true, the file is closed before :c:func:" +"`PyRun_FileExFlags` returns." +msgstr "" +"Подібно до :c:func:`PyRun_StringFlags`, але вихідний код Python читається з " +"*fp* замість рядка в пам’яті. *ім’я файлу* має бути ім’ям файлу, воно " +"декодується з :term:`filesystem encoding and error handler`. Якщо *closeit* " +"має значення true, файл закривається до повернення :c:func:" +"`PyRun_FileExFlags`." + +msgid "" +"This is a simplified interface to :c:func:`Py_CompileStringFlags` below, " +"leaving *flags* set to ``NULL``." +msgstr "" +"Це спрощений інтерфейс для :c:func:`Py_CompileStringFlags` нижче, залишаючи " +"*flags* встановленими на ``NULL``." + +msgid "" +"This is a simplified interface to :c:func:`Py_CompileStringExFlags` below, " +"with *optimize* set to ``-1``." +msgstr "" +"Це спрощений інтерфейс для :c:func:`Py_CompileStringExFlags` нижче, з " +"*optimize* встановленим на ``-1``." + +msgid "" +"Parse and compile the Python source code in *str*, returning the resulting " +"code object. The start token is given by *start*; this can be used to " +"constrain the code which can be compiled and should be :c:data:" +"`Py_eval_input`, :c:data:`Py_file_input`, or :c:data:`Py_single_input`. The " +"filename specified by *filename* is used to construct the code object and " +"may appear in tracebacks or :exc:`SyntaxError` exception messages. This " +"returns ``NULL`` if the code cannot be parsed or compiled." +msgstr "" + +msgid "" +"The integer *optimize* specifies the optimization level of the compiler; a " +"value of ``-1`` selects the optimization level of the interpreter as given " +"by :option:`-O` options. Explicit levels are ``0`` (no optimization; " +"``__debug__`` is true), ``1`` (asserts are removed, ``__debug__`` is false) " +"or ``2`` (docstrings are removed too)." +msgstr "" +"Ціле число *optimize* визначає рівень оптимізації компілятора; значення " +"``-1`` вибирає рівень оптимізації інтерпретатора, як задано параметрами :" +"option:`-O`. Явні рівні: ``0`` (немає оптимізації; ``__debug__`` є " +"істинним), ``1`` (затвердження видалено, ``__debug__`` є хибним) або ``2`` " +"(рядки документа також видалено )." + +msgid "" +"Like :c:func:`Py_CompileStringObject`, but *filename* is a byte string " +"decoded from the :term:`filesystem encoding and error handler`." +msgstr "" +"Подібно до :c:func:`Py_CompileStringObject`, але *filename* — це рядок " +"байтів, декодований з :term:`filesystem encoding and error handler`." + +msgid "" +"This is a simplified interface to :c:func:`PyEval_EvalCodeEx`, with just the " +"code object, and global and local variables. The other arguments are set to " +"``NULL``." +msgstr "" +"Це спрощений інтерфейс для :c:func:`PyEval_EvalCodeEx` лише з об’єктом коду " +"та глобальними та локальними змінними. Інші аргументи мають значення " +"``NULL``." + +msgid "" +"Evaluate a precompiled code object, given a particular environment for its " +"evaluation. This environment consists of a dictionary of global variables, " +"a mapping object of local variables, arrays of arguments, keywords and " +"defaults, a dictionary of default values for :ref:`keyword-only ` arguments and a closure tuple of cells." +msgstr "" +"Оцініть попередньо скомпільований об’єкт коду з урахуванням певного " +"середовища для його оцінки. Це середовище складається зі словника глобальних " +"змінних, об’єкта відображення локальних змінних, масивів аргументів, " +"ключових слів і значень за замовчуванням, словника значень за замовчуванням " +"для аргументів :ref:`keyword-only ` і закриваючого " +"кортежу клітинок." + +msgid "" +"Evaluate an execution frame. This is a simplified interface to :c:func:" +"`PyEval_EvalFrameEx`, for backward compatibility." +msgstr "" +"Оцініть кадр виконання. Це спрощений інтерфейс для :c:func:" +"`PyEval_EvalFrameEx` для зворотної сумісності." + +msgid "" +"This is the main, unvarnished function of Python interpretation. The code " +"object associated with the execution frame *f* is executed, interpreting " +"bytecode and executing calls as needed. The additional *throwflag* " +"parameter can mostly be ignored - if true, then it causes an exception to " +"immediately be thrown; this is used for the :meth:`~generator.throw` methods " +"of generator objects." +msgstr "" +"Це основна функція інтерпретації Python без прикрас. Об’єкт коду, пов’язаний " +"із кадром виконання *f*, виконується, інтерпретуючи байт-код і виконуючи " +"виклики за потреби. Додатковий параметр *throwflag* здебільшого можна " +"ігнорувати - якщо воно істинне, то це спричиняє миттєве виключення винятку; " +"це використовується для методів :meth:`~generator.throw` об’єктів генератора." + +msgid "" +"This function now includes a debug assertion to help ensure that it does not " +"silently discard an active exception." +msgstr "" +"Ця функція тепер включає твердження налагодження, щоб гарантувати, що вона " +"не відкидає мовчки активний виняток." + +msgid "" +"This function changes the flags of the current evaluation frame, and returns " +"true on success, false on failure." +msgstr "" +"Ця функція змінює прапори поточного кадру оцінки та повертає true у разі " +"успіху, false у разі невдачі." + +msgid "" +"The start symbol from the Python grammar for isolated expressions; for use " +"with :c:func:`Py_CompileString`." +msgstr "" +"Початковий символ із граматики Python для ізольованих виразів; для " +"використання з :c:func:`Py_CompileString`." + +msgid "" +"The start symbol from the Python grammar for sequences of statements as read " +"from a file or other source; for use with :c:func:`Py_CompileString`. This " +"is the symbol to use when compiling arbitrarily long Python source code." +msgstr "" +"Початковий символ із граматики Python для послідовностей операторів, " +"прочитаних із файлу чи іншого джерела; для використання з :c:func:" +"`Py_CompileString`. Це символ, який слід використовувати під час компіляції " +"будь-якої довжини вихідного коду Python." + +msgid "" +"The start symbol from the Python grammar for a single statement; for use " +"with :c:func:`Py_CompileString`. This is the symbol used for the interactive " +"interpreter loop." +msgstr "" +"Початковий символ із граматики Python для окремого оператора; для " +"використання з :c:func:`Py_CompileString`. Це символ, який використовується " +"для інтерактивного циклу інтерпретатора." + +msgid "" +"This is the structure used to hold compiler flags. In cases where code is " +"only being compiled, it is passed as ``int flags``, and in cases where code " +"is being executed, it is passed as ``PyCompilerFlags *flags``. In this " +"case, ``from __future__ import`` can modify *flags*." +msgstr "" +"Це структура, яка використовується для зберігання прапорів компілятора. У " +"випадках, коли код лише компілюється, він передається як ``прапорці int``, а " +"у випадках, коли код виконується, він передається як ``PyCompilerFlags " +"*flags``. У цьому випадку ``from __future__ import`` може змінювати " +"*прапори*." + +msgid "" +"Whenever ``PyCompilerFlags *flags`` is ``NULL``, :c:member:`~PyCompilerFlags." +"cf_flags` is treated as equal to ``0``, and any modification due to ``from " +"__future__ import`` is discarded." +msgstr "" + +msgid "Compiler flags." +msgstr "Прапори компілятора." + +msgid "" +"*cf_feature_version* is the minor Python version. It should be initialized " +"to ``PY_MINOR_VERSION``." +msgstr "" +"*cf_feature_version* є другорядною версією Python. Його слід ініціалізувати " +"як ``PY_MINOR_VERSION``." + +msgid "" +"The field is ignored by default, it is used if and only if ``PyCF_ONLY_AST`` " +"flag is set in :c:member:`~PyCompilerFlags.cf_flags`." +msgstr "" + +msgid "Added *cf_feature_version* field." +msgstr "Додано поле *cf_feature_version*." + +msgid "The available compiler flags are accessible as macros:" +msgstr "" + +msgid "" +"See :ref:`compiler flags ` in documentation of the :py:" +"mod:`!ast` Python module, which exports these constants under the same names." +msgstr "" + +msgid "" +"This bit can be set in *flags* to cause division operator ``/`` to be " +"interpreted as \"true division\" according to :pep:`238`." +msgstr "" +"Цей біт можна встановити у *flags*, щоб оператор ділення ``/`` " +"інтерпретувався як \"дійсне ділення\" відповідно до :pep:`238`." + +msgid "Py_CompileString (C function)" +msgstr "" diff --git a/c-api/weakref.po b/c-api/weakref.po new file mode 100644 index 000000000..6dd40ec72 --- /dev/null +++ b/c-api/weakref.po @@ -0,0 +1,141 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:50+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Weak Reference Objects" +msgstr "Слабкі довідкові об’єкти" + +msgid "" +"Python supports *weak references* as first-class objects. There are two " +"specific object types which directly implement weak references. The first " +"is a simple reference object, and the second acts as a proxy for the " +"original object as much as it can." +msgstr "" +"Python підтримує *слабкі посилання* як об’єкти першого класу. Існує два типи " +"об’єктів, які безпосередньо реалізують слабкі посилання. Перший є простим " +"довідковим об’єктом, а другий діє як проксі для оригінального об’єкта, " +"наскільки це можливо." + +msgid "" +"Return non-zero if *ob* is either a reference or proxy object. This " +"function always succeeds." +msgstr "" + +msgid "" +"Return non-zero if *ob* is a reference object. This function always " +"succeeds." +msgstr "" + +msgid "" +"Return non-zero if *ob* is a proxy object. This function always succeeds." +msgstr "" + +msgid "" +"Return a weak reference object for the object *ob*. This will always return " +"a new reference, but is not guaranteed to create a new object; an existing " +"reference object may be returned. The second parameter, *callback*, can be " +"a callable object that receives notification when *ob* is garbage collected; " +"it should accept a single parameter, which will be the weak reference object " +"itself. *callback* may also be ``None`` or ``NULL``. If *ob* is not a " +"weakly referenceable object, or if *callback* is not callable, ``None``, or " +"``NULL``, this will return ``NULL`` and raise :exc:`TypeError`." +msgstr "" + +msgid "" +"Return a weak reference proxy object for the object *ob*. This will always " +"return a new reference, but is not guaranteed to create a new object; an " +"existing proxy object may be returned. The second parameter, *callback*, " +"can be a callable object that receives notification when *ob* is garbage " +"collected; it should accept a single parameter, which will be the weak " +"reference object itself. *callback* may also be ``None`` or ``NULL``. If " +"*ob* is not a weakly referenceable object, or if *callback* is not callable, " +"``None``, or ``NULL``, this will return ``NULL`` and raise :exc:`TypeError`." +msgstr "" + +msgid "" +"Get a :term:`strong reference` to the referenced object from a weak " +"reference, *ref*, into *\\*pobj*." +msgstr "" + +msgid "" +"On success, set *\\*pobj* to a new :term:`strong reference` to the " +"referenced object and return 1." +msgstr "" + +msgid "If the reference is dead, set *\\*pobj* to ``NULL`` and return 0." +msgstr "" + +msgid "On error, raise an exception and return -1." +msgstr "" + +msgid "" +"Return a :term:`borrowed reference` to the referenced object from a weak " +"reference, *ref*. If the referent is no longer live, returns ``Py_None``." +msgstr "" + +msgid "" +"This function returns a :term:`borrowed reference` to the referenced object. " +"This means that you should always call :c:func:`Py_INCREF` on the object " +"except when it cannot be destroyed before the last usage of the borrowed " +"reference." +msgstr "" +"Ця функція повертає :term:`borrowed reference` на об’єкт, на який " +"посилається. Це означає, що ви завжди повинні викликати :c:func:`Py_INCREF` " +"для об’єкта, за винятком випадків, коли його не можна знищити перед останнім " +"використанням запозиченого посилання." + +msgid "Use :c:func:`PyWeakref_GetRef` instead." +msgstr "" + +msgid "Similar to :c:func:`PyWeakref_GetObject`, but does no error checking." +msgstr "" + +msgid "" +"This function is called by the :c:member:`~PyTypeObject.tp_dealloc` handler " +"to clear weak references." +msgstr "" + +msgid "" +"This iterates through the weak references for *object* and calls callbacks " +"for those references which have one. It returns when all callbacks have been " +"attempted." +msgstr "" + +msgid "Clears the weakrefs for *object* without calling the callbacks." +msgstr "" + +msgid "" +"This function is called by the :c:member:`~PyTypeObject.tp_dealloc` handler " +"for types with finalizers (i.e., :meth:`~object.__del__`). The handler for " +"those objects first calls :c:func:`PyObject_ClearWeakRefs` to clear weakrefs " +"and call their callbacks, then the finalizer, and finally this function to " +"clear any weakrefs that may have been created by the finalizer." +msgstr "" + +msgid "" +"In most circumstances, it's more appropriate to use :c:func:" +"`PyObject_ClearWeakRefs` to clear weakrefs instead of this function." +msgstr "" diff --git a/contents.po b/contents.po new file mode 100644 index 000000000..55fac3140 --- /dev/null +++ b/contents.po @@ -0,0 +1,29 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:47+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Python Documentation contents" +msgstr "Зміст документації Python" diff --git a/copyright.po b/copyright.po new file mode 100644 index 000000000..7e514325f --- /dev/null +++ b/copyright.po @@ -0,0 +1,58 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# Yuliia Shevchenko, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:47+0000\n" +"Last-Translator: Yuliia Shevchenko, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Copyright" +msgstr "Авторське право" + +msgid "Python and this documentation is:" +msgstr "Python і ця документація має:" + +msgid "Copyright © 2001-2024 Python Software Foundation. All rights reserved." +msgstr "Copyright © 2001-2024 Python Software Foundation. Усі права захищено." + +msgid "Copyright © 2000 BeOpen.com. All rights reserved." +msgstr "Copyright © 2000 BeOpen.com. All rights reserved." + +msgid "" +"Copyright © 1995-2000 Corporation for National Research Initiatives. All " +"rights reserved." +msgstr "" +"Copyright © 1995-2000 Corporation for National Research Initiatives. All " +"rights reserved." + +msgid "" +"Copyright © 1991-1995 Stichting Mathematisch Centrum. All rights reserved." +msgstr "" +"Copyright © 1991-1995 Stichting Mathematisch Centrum. All rights reserved." + +msgid "" +"See :ref:`history-and-license` for complete license and permissions " +"information." +msgstr "" +"Перегляньте :ref:`history-and-license` для повної інформації про ліцензії та " +"дозволи." diff --git a/deprecations/c-api-pending-removal-in-3_14.po b/deprecations/c-api-pending-removal-in-3_14.po new file mode 100644 index 000000000..f1c2d3eb0 --- /dev/null +++ b/deprecations/c-api-pending-removal-in-3_14.po @@ -0,0 +1,151 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2024-08-02 14:17+0000\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Pending Removal in Python 3.14" +msgstr "" + +msgid "" +"The ``ma_version_tag`` field in :c:type:`PyDictObject` for extension modules " +"(:pep:`699`; :gh:`101193`)." +msgstr "" + +msgid "" +"Creating :c:data:`immutable types ` with mutable " +"bases (:gh:`95388`)." +msgstr "" + +msgid "" +"Functions to configure Python's initialization, deprecated in Python 3.11:" +msgstr "" + +msgid ":c:func:`!PySys_SetArgvEx()`: Set :c:member:`PyConfig.argv` instead." +msgstr "" + +msgid ":c:func:`!PySys_SetArgv()`: Set :c:member:`PyConfig.argv` instead." +msgstr "" + +msgid "" +":c:func:`!Py_SetProgramName()`: Set :c:member:`PyConfig.program_name` " +"instead." +msgstr "" + +msgid ":c:func:`!Py_SetPythonHome()`: Set :c:member:`PyConfig.home` instead." +msgstr "" + +msgid "" +"The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" +"`PyConfig` instead." +msgstr "" + +msgid "Global configuration variables:" +msgstr "" + +msgid ":c:var:`Py_DebugFlag`: Use :c:member:`PyConfig.parser_debug` instead." +msgstr "" + +msgid ":c:var:`Py_VerboseFlag`: Use :c:member:`PyConfig.verbose` instead." +msgstr "" + +msgid ":c:var:`Py_QuietFlag`: Use :c:member:`PyConfig.quiet` instead." +msgstr "" + +msgid "" +":c:var:`Py_InteractiveFlag`: Use :c:member:`PyConfig.interactive` instead." +msgstr "" + +msgid ":c:var:`Py_InspectFlag`: Use :c:member:`PyConfig.inspect` instead." +msgstr "" + +msgid "" +":c:var:`Py_OptimizeFlag`: Use :c:member:`PyConfig.optimization_level` " +"instead." +msgstr "" + +msgid ":c:var:`Py_NoSiteFlag`: Use :c:member:`PyConfig.site_import` instead." +msgstr "" + +msgid "" +":c:var:`Py_BytesWarningFlag`: Use :c:member:`PyConfig.bytes_warning` instead." +msgstr "" + +msgid "" +":c:var:`Py_FrozenFlag`: Use :c:member:`PyConfig.pathconfig_warnings` instead." +msgstr "" + +msgid "" +":c:var:`Py_IgnoreEnvironmentFlag`: Use :c:member:`PyConfig.use_environment` " +"instead." +msgstr "" + +msgid "" +":c:var:`Py_DontWriteBytecodeFlag`: Use :c:member:`PyConfig.write_bytecode` " +"instead." +msgstr "" + +msgid "" +":c:var:`Py_NoUserSiteDirectory`: Use :c:member:`PyConfig." +"user_site_directory` instead." +msgstr "" + +msgid "" +":c:var:`Py_UnbufferedStdioFlag`: Use :c:member:`PyConfig.buffered_stdio` " +"instead." +msgstr "" + +msgid "" +":c:var:`Py_HashRandomizationFlag`: Use :c:member:`PyConfig.use_hash_seed` " +"and :c:member:`PyConfig.hash_seed` instead." +msgstr "" + +msgid ":c:var:`Py_IsolatedFlag`: Use :c:member:`PyConfig.isolated` instead." +msgstr "" + +msgid "" +":c:var:`Py_LegacyWindowsFSEncodingFlag`: Use :c:member:`PyPreConfig." +"legacy_windows_fs_encoding` instead." +msgstr "" + +msgid "" +":c:var:`Py_LegacyWindowsStdioFlag`: Use :c:member:`PyConfig." +"legacy_windows_stdio` instead." +msgstr "" + +msgid "" +":c:var:`!Py_FileSystemDefaultEncoding`: Use :c:member:`PyConfig." +"filesystem_encoding` instead." +msgstr "" + +msgid "" +":c:var:`!Py_HasFileSystemDefaultEncoding`: Use :c:member:`PyConfig." +"filesystem_encoding` instead." +msgstr "" + +msgid "" +":c:var:`!Py_FileSystemDefaultEncodeErrors`: Use :c:member:`PyConfig." +"filesystem_errors` instead." +msgstr "" + +msgid "" +":c:var:`!Py_UTF8Mode`: Use :c:member:`PyPreConfig.utf8_mode` instead. (see :" +"c:func:`Py_PreInitialize`)" +msgstr "" diff --git a/deprecations/c-api-pending-removal-in-3_15.po b/deprecations/c-api-pending-removal-in-3_15.po new file mode 100644 index 000000000..96a235db6 --- /dev/null +++ b/deprecations/c-api-pending-removal-in-3_15.po @@ -0,0 +1,75 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2024-08-02 14:17+0000\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Pending Removal in Python 3.15" +msgstr "" + +msgid "The bundled copy of ``libmpdecimal``." +msgstr "" + +msgid "" +"The :c:func:`PyImport_ImportModuleNoBlock`: Use :c:func:" +"`PyImport_ImportModule` instead." +msgstr "" + +msgid "" +":c:func:`PyWeakref_GetObject` and :c:func:`PyWeakref_GET_OBJECT`: Use :c:" +"func:`PyWeakref_GetRef` instead." +msgstr "" + +msgid "" +":c:type:`Py_UNICODE` type and the :c:macro:`!Py_UNICODE_WIDE` macro: Use :c:" +"type:`wchar_t` instead." +msgstr "" + +msgid "Python initialization functions:" +msgstr "" + +msgid "" +":c:func:`PySys_ResetWarnOptions`: Clear :data:`sys.warnoptions` and :data:`!" +"warnings.filters` instead." +msgstr "" + +msgid "" +":c:func:`Py_GetExecPrefix`: Get :data:`sys.base_exec_prefix` and :data:`sys." +"exec_prefix` instead." +msgstr "" + +msgid ":c:func:`Py_GetPath`: Get :data:`sys.path` instead." +msgstr "" + +msgid "" +":c:func:`Py_GetPrefix`: Get :data:`sys.base_prefix` and :data:`sys.prefix` " +"instead." +msgstr "" + +msgid ":c:func:`Py_GetProgramFullPath`: Get :data:`sys.executable` instead." +msgstr "" + +msgid ":c:func:`Py_GetProgramName`: Get :data:`sys.executable` instead." +msgstr "" + +msgid "" +":c:func:`Py_GetPythonHome`: Get :c:member:`PyConfig.home` or the :envvar:" +"`PYTHONHOME` environment variable instead." +msgstr "" diff --git a/deprecations/c-api-pending-removal-in-future.po b/deprecations/c-api-pending-removal-in-future.po new file mode 100644 index 000000000..ccee1719a --- /dev/null +++ b/deprecations/c-api-pending-removal-in-future.po @@ -0,0 +1,119 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2024-08-02 14:17+0000\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Pending Removal in Future Versions" +msgstr "" + +msgid "" +"The following APIs are deprecated and will be removed, although there is " +"currently no date scheduled for their removal." +msgstr "" + +msgid ":c:macro:`Py_TPFLAGS_HAVE_FINALIZE`: Unneeded since Python 3.8." +msgstr "" + +msgid ":c:func:`PyErr_Fetch`: Use :c:func:`PyErr_GetRaisedException` instead." +msgstr "" + +msgid "" +":c:func:`PyErr_NormalizeException`: Use :c:func:`PyErr_GetRaisedException` " +"instead." +msgstr "" + +msgid "" +":c:func:`PyErr_Restore`: Use :c:func:`PyErr_SetRaisedException` instead." +msgstr "" + +msgid "" +":c:func:`PyModule_GetFilename`: Use :c:func:`PyModule_GetFilenameObject` " +"instead." +msgstr "" + +msgid ":c:func:`PyOS_AfterFork`: Use :c:func:`PyOS_AfterFork_Child` instead." +msgstr "" + +msgid "" +":c:func:`PySlice_GetIndicesEx`: Use :c:func:`PySlice_Unpack` and :c:func:" +"`PySlice_AdjustIndices` instead." +msgstr "" + +msgid "" +":c:func:`!PyUnicode_AsDecodedObject`: Use :c:func:`PyCodec_Decode` instead." +msgstr "" + +msgid "" +":c:func:`!PyUnicode_AsDecodedUnicode`: Use :c:func:`PyCodec_Decode` instead." +msgstr "" + +msgid "" +":c:func:`!PyUnicode_AsEncodedObject`: Use :c:func:`PyCodec_Encode` instead." +msgstr "" + +msgid "" +":c:func:`!PyUnicode_AsEncodedUnicode`: Use :c:func:`PyCodec_Encode` instead." +msgstr "" + +msgid ":c:func:`PyUnicode_READY`: Unneeded since Python 3.12" +msgstr "" + +msgid ":c:func:`!PyErr_Display`: Use :c:func:`PyErr_DisplayException` instead." +msgstr "" + +msgid "" +":c:func:`!_PyErr_ChainExceptions`: Use :c:func:`!_PyErr_ChainExceptions1` " +"instead." +msgstr "" + +msgid "" +":c:member:`!PyBytesObject.ob_shash` member: call :c:func:`PyObject_Hash` " +"instead." +msgstr "" + +msgid ":c:member:`!PyDictObject.ma_version_tag` member." +msgstr "" + +msgid "Thread Local Storage (TLS) API:" +msgstr "" + +msgid "" +":c:func:`PyThread_create_key`: Use :c:func:`PyThread_tss_alloc` instead." +msgstr "" + +msgid ":c:func:`PyThread_delete_key`: Use :c:func:`PyThread_tss_free` instead." +msgstr "" + +msgid "" +":c:func:`PyThread_set_key_value`: Use :c:func:`PyThread_tss_set` instead." +msgstr "" + +msgid "" +":c:func:`PyThread_get_key_value`: Use :c:func:`PyThread_tss_get` instead." +msgstr "" + +msgid "" +":c:func:`PyThread_delete_key_value`: Use :c:func:`PyThread_tss_delete` " +"instead." +msgstr "" + +msgid ":c:func:`PyThread_ReInitTLS`: Unneeded since Python 3.7." +msgstr "" diff --git a/deprecations/index.po b/deprecations/index.po new file mode 100644 index 000000000..2b29ac336 --- /dev/null +++ b/deprecations/index.po @@ -0,0 +1,930 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-04 14:18+0000\n" +"PO-Revision-Date: 2024-07-29 04:07+0000\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Deprecations" +msgstr "" + +msgid "Pending Removal in Python 3.14" +msgstr "" + +msgid "" +":mod:`argparse`: The *type*, *choices*, and *metavar* parameters of :class:`!" +"argparse.BooleanOptionalAction` are deprecated and will be removed in 3.14. " +"(Contributed by Nikita Sobolev in :gh:`92248`.)" +msgstr "" + +msgid "" +":mod:`ast`: The following features have been deprecated in documentation " +"since Python 3.8, now cause a :exc:`DeprecationWarning` to be emitted at " +"runtime when they are accessed or used, and will be removed in Python 3.14:" +msgstr "" + +msgid ":class:`!ast.Num`" +msgstr "" + +msgid ":class:`!ast.Str`" +msgstr "" + +msgid ":class:`!ast.Bytes`" +msgstr "" + +msgid ":class:`!ast.NameConstant`" +msgstr "" + +msgid ":class:`!ast.Ellipsis`" +msgstr "" + +msgid "" +"Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka in :gh:" +"`90953`.)" +msgstr "" + +msgid ":mod:`asyncio`:" +msgstr "" + +msgid "" +"The child watcher classes :class:`~asyncio.MultiLoopChildWatcher`, :class:" +"`~asyncio.FastChildWatcher`, :class:`~asyncio.AbstractChildWatcher` and :" +"class:`~asyncio.SafeChildWatcher` are deprecated and will be removed in " +"Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" +msgstr "" + +msgid "" +":func:`asyncio.set_child_watcher`, :func:`asyncio.get_child_watcher`, :meth:" +"`asyncio.AbstractEventLoopPolicy.set_child_watcher` and :meth:`asyncio." +"AbstractEventLoopPolicy.get_child_watcher` are deprecated and will be " +"removed in Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" +msgstr "" + +msgid "" +"The :meth:`~asyncio.get_event_loop` method of the default event loop policy " +"now emits a :exc:`DeprecationWarning` if there is no current event loop set " +"and it decides to create one. (Contributed by Serhiy Storchaka and Guido van " +"Rossum in :gh:`100160`.)" +msgstr "" + +msgid "" +":mod:`collections.abc`: Deprecated :class:`~collections.abc.ByteString`. " +"Prefer :class:`!Sequence` or :class:`~collections.abc.Buffer`. For use in " +"typing, prefer a union, like ``bytes | bytearray``, or :class:`collections." +"abc.Buffer`. (Contributed by Shantanu Jain in :gh:`91896`.)" +msgstr "" + +msgid "" +":mod:`email`: Deprecated the *isdst* parameter in :func:`email.utils." +"localtime`. (Contributed by Alan Williams in :gh:`72346`.)" +msgstr "" + +msgid ":mod:`importlib.abc` deprecated classes:" +msgstr "" + +msgid ":class:`!importlib.abc.ResourceReader`" +msgstr "" + +msgid ":class:`!importlib.abc.Traversable`" +msgstr "" + +msgid ":class:`!importlib.abc.TraversableResources`" +msgstr "" + +msgid "Use :mod:`importlib.resources.abc` classes instead:" +msgstr "" + +msgid ":class:`importlib.resources.abc.Traversable`" +msgstr "" + +msgid ":class:`importlib.resources.abc.TraversableResources`" +msgstr "" + +msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" +msgstr "" + +msgid "" +":mod:`itertools` had undocumented, inefficient, historically buggy, and " +"inconsistent support for copy, deepcopy, and pickle operations. This will be " +"removed in 3.14 for a significant reduction in code volume and maintenance " +"burden. (Contributed by Raymond Hettinger in :gh:`101588`.)" +msgstr "" + +msgid "" +":mod:`multiprocessing`: The default start method will change to a safer one " +"on Linux, BSDs, and other non-macOS POSIX platforms where ``'fork'`` is " +"currently the default (:gh:`84559`). Adding a runtime warning about this was " +"deemed too disruptive as the majority of code is not expected to care. Use " +"the :func:`~multiprocessing.get_context` or :func:`~multiprocessing." +"set_start_method` APIs to explicitly specify when your code *requires* " +"``'fork'``. See :ref:`multiprocessing-start-methods`." +msgstr "" + +msgid "" +":mod:`pathlib`: :meth:`~pathlib.PurePath.is_relative_to` and :meth:`~pathlib." +"PurePath.relative_to`: passing additional arguments is deprecated." +msgstr "" + +msgid "" +":mod:`pkgutil`: :func:`~pkgutil.find_loader` and :func:`~pkgutil.get_loader` " +"now raise :exc:`DeprecationWarning`; use :func:`importlib.util.find_spec` " +"instead. (Contributed by Nikita Sobolev in :gh:`97850`.)" +msgstr "" + +msgid ":mod:`pty`:" +msgstr "" + +msgid "``master_open()``: use :func:`pty.openpty`." +msgstr "" + +msgid "``slave_open()``: use :func:`pty.openpty`." +msgstr "" + +msgid ":mod:`sqlite3`:" +msgstr "" + +msgid ":data:`~sqlite3.version` and :data:`~sqlite3.version_info`." +msgstr "" + +msgid "" +":meth:`~sqlite3.Cursor.execute` and :meth:`~sqlite3.Cursor.executemany` if :" +"ref:`named placeholders ` are used and *parameters* is " +"a sequence instead of a :class:`dict`." +msgstr "" + +msgid "" +":mod:`typing`: :class:`~typing.ByteString`, deprecated since Python 3.9, now " +"causes a :exc:`DeprecationWarning` to be emitted when it is used." +msgstr "" + +msgid "" +":mod:`urllib`: :class:`!urllib.parse.Quoter` is deprecated: it was not " +"intended to be a public API. (Contributed by Gregory P. Smith in :gh:" +"`88168`.)" +msgstr "" + +msgid "Pending Removal in Python 3.15" +msgstr "" + +msgid "The import system:" +msgstr "" + +msgid "" +"Setting :attr:`~module.__cached__` on a module while failing to set :attr:" +"`__spec__.cached ` is deprecated. In " +"Python 3.15, :attr:`!__cached__` will cease to be set or take into " +"consideration by the import system or standard library. (:gh:`97879`)" +msgstr "" + +msgid "" +"Setting :attr:`~module.__package__` on a module while failing to set :attr:" +"`__spec__.parent ` is deprecated. In " +"Python 3.15, :attr:`!__package__` will cease to be set or take into " +"consideration by the import system or standard library. (:gh:`97879`)" +msgstr "" + +msgid ":mod:`ctypes`:" +msgstr "" + +msgid "" +"The undocumented :func:`!ctypes.SetPointerType` function has been deprecated " +"since Python 3.13." +msgstr "" + +msgid ":mod:`http.server`:" +msgstr "" + +msgid "" +"The obsolete and rarely used :class:`~http.server.CGIHTTPRequestHandler` has " +"been deprecated since Python 3.13. No direct replacement exists. *Anything* " +"is better than CGI to interface a web server with a request handler." +msgstr "" + +msgid "" +"The :option:`!--cgi` flag to the :program:`python -m http.server` command-" +"line interface has been deprecated since Python 3.13." +msgstr "" + +msgid ":mod:`importlib`:" +msgstr "" + +msgid "``load_module()`` method: use ``exec_module()`` instead." +msgstr "" + +msgid ":class:`locale`:" +msgstr "" + +msgid "" +"The :func:`~locale.getdefaultlocale` function has been deprecated since " +"Python 3.11. Its removal was originally planned for Python 3.13 (:gh:" +"`90817`), but has been postponed to Python 3.15. Use :func:`~locale." +"getlocale`, :func:`~locale.setlocale`, and :func:`~locale.getencoding` " +"instead. (Contributed by Hugo van Kemenade in :gh:`111187`.)" +msgstr "" + +msgid ":mod:`pathlib`:" +msgstr "" + +msgid "" +":meth:`.PurePath.is_reserved` has been deprecated since Python 3.13. Use :" +"func:`os.path.isreserved` to detect reserved paths on Windows." +msgstr "" + +msgid ":mod:`platform`:" +msgstr "" + +msgid "" +":func:`~platform.java_ver` has been deprecated since Python 3.13. This " +"function is only useful for Jython support, has a confusing API, and is " +"largely untested." +msgstr "" + +msgid ":mod:`sysconfig`:" +msgstr "" + +msgid "" +"The *check_home* argument of :func:`sysconfig.is_python_build` has been " +"deprecated since Python 3.12." +msgstr "" + +msgid ":mod:`threading`:" +msgstr "" + +msgid "" +":func:`~threading.RLock` will take no arguments in Python 3.15. Passing any " +"arguments has been deprecated since Python 3.14, as the Python version does " +"not permit any arguments, but the C version allows any number of positional " +"or keyword arguments, ignoring every argument." +msgstr "" + +msgid ":mod:`types`:" +msgstr "" + +msgid "" +":class:`types.CodeType`: Accessing :attr:`~codeobject.co_lnotab` was " +"deprecated in :pep:`626` since 3.10 and was planned to be removed in 3.12, " +"but it only got a proper :exc:`DeprecationWarning` in 3.12. May be removed " +"in 3.15. (Contributed by Nikita Sobolev in :gh:`101866`.)" +msgstr "" + +msgid ":mod:`typing`:" +msgstr "" + +msgid "" +"The undocumented keyword argument syntax for creating :class:`~typing." +"NamedTuple` classes (e.g. ``Point = NamedTuple(\"Point\", x=int, y=int)``) " +"has been deprecated since Python 3.13. Use the class-based syntax or the " +"functional syntax instead." +msgstr "" + +msgid "" +"The :func:`typing.no_type_check_decorator` decorator function has been " +"deprecated since Python 3.13. After eight years in the :mod:`typing` module, " +"it has yet to be supported by any major type checker." +msgstr "" + +msgid ":mod:`wave`:" +msgstr "" + +msgid "" +"The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:`~wave." +"Wave_read.getmarkers` methods of the :class:`~wave.Wave_read` and :class:" +"`~wave.Wave_write` classes have been deprecated since Python 3.13." +msgstr "" + +msgid "Pending removal in Python 3.16" +msgstr "" + +msgid "" +"Setting :attr:`~module.__loader__` on a module while failing to set :attr:" +"`__spec__.loader ` is deprecated. In " +"Python 3.16, :attr:`!__loader__` will cease to be set or taken into " +"consideration by the import system or the standard library." +msgstr "" + +msgid ":mod:`array`:" +msgstr "" + +msgid "" +"The ``'u'`` format code (:c:type:`wchar_t`) has been deprecated in " +"documentation since Python 3.3 and at runtime since Python 3.13. Use the " +"``'w'`` format code (:c:type:`Py_UCS4`) for Unicode characters instead." +msgstr "" + +msgid "" +":func:`!asyncio.iscoroutinefunction` is deprecated and will be removed in " +"Python 3.16, use :func:`inspect.iscoroutinefunction` instead. (Contributed " +"by Jiahao Li and Kumar Aditya in :gh:`122875`.)" +msgstr "" + +msgid ":mod:`builtins`:" +msgstr "" + +msgid "" +"Bitwise inversion on boolean types, ``~True`` or ``~False`` has been " +"deprecated since Python 3.12, as it produces surprising and unintuitive " +"results (``-2`` and ``-1``). Use ``not x`` instead for the logical negation " +"of a Boolean. In the rare case that you need the bitwise inversion of the " +"underlying integer, convert to ``int`` explicitly (``~int(x)``)." +msgstr "" + +msgid ":mod:`shutil`:" +msgstr "" + +msgid "" +"The :class:`!ExecError` exception has been deprecated since Python 3.14. It " +"has not been used by any function in :mod:`!shutil` since Python 3.4, and is " +"now an alias of :exc:`RuntimeError`." +msgstr "" + +msgid ":mod:`symtable`:" +msgstr "" + +msgid "" +"The :meth:`Class.get_methods ` method has been " +"deprecated since Python 3.14." +msgstr "" + +msgid ":mod:`sys`:" +msgstr "" + +msgid "" +"The :func:`~sys._enablelegacywindowsfsencoding` function has been deprecated " +"since Python 3.13. Use the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " +"environment variable instead." +msgstr "" + +msgid ":mod:`tarfile`:" +msgstr "" + +msgid "" +"The undocumented and unused :attr:`!TarFile.tarfile` attribute has been " +"deprecated since Python 3.13." +msgstr "" + +msgid "Pending Removal in Future Versions" +msgstr "" + +msgid "" +"The following APIs will be removed in the future, although there is " +"currently no date scheduled for their removal." +msgstr "" + +msgid "" +":mod:`argparse`: Nesting argument groups and nesting mutually exclusive " +"groups are deprecated." +msgstr "" + +msgid ":mod:`array`'s ``'u'`` format code (:gh:`57281`)" +msgstr "" + +msgid "``bool(NotImplemented)``." +msgstr "" + +msgid "" +"Generators: ``throw(type, exc, tb)`` and ``athrow(type, exc, tb)`` signature " +"is deprecated: use ``throw(exc)`` and ``athrow(exc)`` instead, the single " +"argument signature." +msgstr "" + +msgid "" +"Currently Python accepts numeric literals immediately followed by keywords, " +"for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and " +"ambiguous expressions like ``[0x1for x in y]`` (which can be interpreted as " +"``[0x1 for x in y]`` or ``[0x1f or x in y]``). A syntax warning is raised " +"if the numeric literal is immediately followed by one of keywords :keyword:" +"`and`, :keyword:`else`, :keyword:`for`, :keyword:`if`, :keyword:`in`, :" +"keyword:`is` and :keyword:`or`. In a future release it will be changed to a " +"syntax error. (:gh:`87999`)" +msgstr "" + +msgid "" +"Support for ``__index__()`` and ``__int__()`` method returning non-int type: " +"these methods will be required to return an instance of a strict subclass " +"of :class:`int`." +msgstr "" + +msgid "" +"Support for ``__float__()`` method returning a strict subclass of :class:" +"`float`: these methods will be required to return an instance of :class:" +"`float`." +msgstr "" + +msgid "" +"Support for ``__complex__()`` method returning a strict subclass of :class:" +"`complex`: these methods will be required to return an instance of :class:" +"`complex`." +msgstr "" + +msgid "Delegation of ``int()`` to ``__trunc__()`` method." +msgstr "" + +msgid "" +"Passing a complex number as the *real* or *imag* argument in the :func:" +"`complex` constructor is now deprecated; it should only be passed as a " +"single positional argument. (Contributed by Serhiy Storchaka in :gh:" +"`109218`.)" +msgstr "" + +msgid "" +":mod:`calendar`: ``calendar.January`` and ``calendar.February`` constants " +"are deprecated and replaced by :data:`calendar.JANUARY` and :data:`calendar." +"FEBRUARY`. (Contributed by Prince Roshan in :gh:`103636`.)" +msgstr "" + +msgid "" +":attr:`codeobject.co_lnotab`: use the :meth:`codeobject.co_lines` method " +"instead." +msgstr "" + +msgid ":mod:`datetime`:" +msgstr "" + +msgid "" +":meth:`~datetime.datetime.utcnow`: use ``datetime.datetime.now(tz=datetime." +"UTC)``." +msgstr "" + +msgid "" +":meth:`~datetime.datetime.utcfromtimestamp`: use ``datetime.datetime." +"fromtimestamp(timestamp, tz=datetime.UTC)``." +msgstr "" + +msgid ":mod:`gettext`: Plural value must be an integer." +msgstr "" + +msgid "" +":func:`~importlib.util.cache_from_source` *debug_override* parameter is " +"deprecated: use the *optimization* parameter instead." +msgstr "" + +msgid ":mod:`importlib.metadata`:" +msgstr "" + +msgid "``EntryPoints`` tuple interface." +msgstr "" + +msgid "Implicit ``None`` on return values." +msgstr "" + +msgid "" +":mod:`logging`: the ``warn()`` method has been deprecated since Python 3.3, " +"use :meth:`~logging.warning` instead." +msgstr "" + +msgid "" +":mod:`mailbox`: Use of StringIO input and text mode is deprecated, use " +"BytesIO and binary mode instead." +msgstr "" + +msgid "" +":mod:`os`: Calling :func:`os.register_at_fork` in multi-threaded process." +msgstr "" + +msgid "" +":class:`!pydoc.ErrorDuringImport`: A tuple value for *exc_info* parameter is " +"deprecated, use an exception instance." +msgstr "" + +msgid "" +":mod:`re`: More strict rules are now applied for numerical group references " +"and group names in regular expressions. Only sequence of ASCII digits is " +"now accepted as a numerical reference. The group name in bytes patterns and " +"replacement strings can now only contain ASCII letters and digits and " +"underscore. (Contributed by Serhiy Storchaka in :gh:`91760`.)" +msgstr "" + +msgid "" +":mod:`!sre_compile`, :mod:`!sre_constants` and :mod:`!sre_parse` modules." +msgstr "" + +msgid "" +":mod:`shutil`: :func:`~shutil.rmtree`'s *onerror* parameter is deprecated in " +"Python 3.12; use the *onexc* parameter instead." +msgstr "" + +msgid ":mod:`ssl` options and protocols:" +msgstr "" + +msgid ":class:`ssl.SSLContext` without protocol argument is deprecated." +msgstr "" + +msgid "" +":class:`ssl.SSLContext`: :meth:`~ssl.SSLContext.set_npn_protocols` and :meth:" +"`!selected_npn_protocol` are deprecated: use ALPN instead." +msgstr "" + +msgid "``ssl.OP_NO_SSL*`` options" +msgstr "" + +msgid "``ssl.OP_NO_TLS*`` options" +msgstr "" + +msgid "``ssl.PROTOCOL_SSLv3``" +msgstr "" + +msgid "``ssl.PROTOCOL_TLS``" +msgstr "" + +msgid "``ssl.PROTOCOL_TLSv1``" +msgstr "" + +msgid "``ssl.PROTOCOL_TLSv1_1``" +msgstr "" + +msgid "``ssl.PROTOCOL_TLSv1_2``" +msgstr "" + +msgid "``ssl.TLSVersion.SSLv3``" +msgstr "" + +msgid "``ssl.TLSVersion.TLSv1``" +msgstr "" + +msgid "``ssl.TLSVersion.TLSv1_1``" +msgstr "" + +msgid ":mod:`threading` methods:" +msgstr "" + +msgid "" +":meth:`!threading.Condition.notifyAll`: use :meth:`~threading.Condition." +"notify_all`." +msgstr "" + +msgid ":meth:`!threading.Event.isSet`: use :meth:`~threading.Event.is_set`." +msgstr "" + +msgid "" +":meth:`!threading.Thread.isDaemon`, :meth:`threading.Thread.setDaemon`: use :" +"attr:`threading.Thread.daemon` attribute." +msgstr "" + +msgid "" +":meth:`!threading.Thread.getName`, :meth:`threading.Thread.setName`: use :" +"attr:`threading.Thread.name` attribute." +msgstr "" + +msgid ":meth:`!threading.currentThread`: use :meth:`threading.current_thread`." +msgstr "" + +msgid ":meth:`!threading.activeCount`: use :meth:`threading.active_count`." +msgstr "" + +msgid ":class:`typing.Text` (:gh:`92332`)." +msgstr "" + +msgid "" +":class:`unittest.IsolatedAsyncioTestCase`: it is deprecated to return a " +"value that is not ``None`` from a test case." +msgstr "" + +msgid "" +":mod:`urllib.parse` deprecated functions: :func:`~urllib.parse.urlparse` " +"instead" +msgstr "" + +msgid "``splitattr()``" +msgstr "" + +msgid "``splithost()``" +msgstr "" + +msgid "``splitnport()``" +msgstr "" + +msgid "``splitpasswd()``" +msgstr "" + +msgid "``splitport()``" +msgstr "" + +msgid "``splitquery()``" +msgstr "" + +msgid "``splittag()``" +msgstr "" + +msgid "``splittype()``" +msgstr "" + +msgid "``splituser()``" +msgstr "" + +msgid "``splitvalue()``" +msgstr "" + +msgid "``to_bytes()``" +msgstr "" + +msgid "" +":mod:`urllib.request`: :class:`~urllib.request.URLopener` and :class:" +"`~urllib.request.FancyURLopener` style of invoking requests is deprecated. " +"Use newer :func:`~urllib.request.urlopen` functions and methods." +msgstr "" + +msgid "" +":mod:`wsgiref`: ``SimpleHandler.stdout.write()`` should not do partial " +"writes." +msgstr "" + +msgid "" +":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`~xml." +"etree.ElementTree.Element` is deprecated. In a future release it will always " +"return ``True``. Prefer explicit ``len(elem)`` or ``elem is not None`` tests " +"instead." +msgstr "" + +msgid "" +":meth:`zipimport.zipimporter.load_module` is deprecated: use :meth:" +"`~zipimport.zipimporter.exec_module` instead." +msgstr "" + +msgid "C API Deprecations" +msgstr "" + +msgid "" +"The ``ma_version_tag`` field in :c:type:`PyDictObject` for extension modules " +"(:pep:`699`; :gh:`101193`)." +msgstr "" + +msgid "" +"Creating :c:data:`immutable types ` with mutable " +"bases (:gh:`95388`)." +msgstr "" + +msgid "" +"Functions to configure Python's initialization, deprecated in Python 3.11:" +msgstr "" + +msgid ":c:func:`!PySys_SetArgvEx()`: Set :c:member:`PyConfig.argv` instead." +msgstr "" + +msgid ":c:func:`!PySys_SetArgv()`: Set :c:member:`PyConfig.argv` instead." +msgstr "" + +msgid "" +":c:func:`!Py_SetProgramName()`: Set :c:member:`PyConfig.program_name` " +"instead." +msgstr "" + +msgid ":c:func:`!Py_SetPythonHome()`: Set :c:member:`PyConfig.home` instead." +msgstr "" + +msgid "" +"The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" +"`PyConfig` instead." +msgstr "" + +msgid "Global configuration variables:" +msgstr "" + +msgid ":c:var:`Py_DebugFlag`: Use :c:member:`PyConfig.parser_debug` instead." +msgstr "" + +msgid ":c:var:`Py_VerboseFlag`: Use :c:member:`PyConfig.verbose` instead." +msgstr "" + +msgid ":c:var:`Py_QuietFlag`: Use :c:member:`PyConfig.quiet` instead." +msgstr "" + +msgid "" +":c:var:`Py_InteractiveFlag`: Use :c:member:`PyConfig.interactive` instead." +msgstr "" + +msgid ":c:var:`Py_InspectFlag`: Use :c:member:`PyConfig.inspect` instead." +msgstr "" + +msgid "" +":c:var:`Py_OptimizeFlag`: Use :c:member:`PyConfig.optimization_level` " +"instead." +msgstr "" + +msgid ":c:var:`Py_NoSiteFlag`: Use :c:member:`PyConfig.site_import` instead." +msgstr "" + +msgid "" +":c:var:`Py_BytesWarningFlag`: Use :c:member:`PyConfig.bytes_warning` instead." +msgstr "" + +msgid "" +":c:var:`Py_FrozenFlag`: Use :c:member:`PyConfig.pathconfig_warnings` instead." +msgstr "" + +msgid "" +":c:var:`Py_IgnoreEnvironmentFlag`: Use :c:member:`PyConfig.use_environment` " +"instead." +msgstr "" + +msgid "" +":c:var:`Py_DontWriteBytecodeFlag`: Use :c:member:`PyConfig.write_bytecode` " +"instead." +msgstr "" + +msgid "" +":c:var:`Py_NoUserSiteDirectory`: Use :c:member:`PyConfig." +"user_site_directory` instead." +msgstr "" + +msgid "" +":c:var:`Py_UnbufferedStdioFlag`: Use :c:member:`PyConfig.buffered_stdio` " +"instead." +msgstr "" + +msgid "" +":c:var:`Py_HashRandomizationFlag`: Use :c:member:`PyConfig.use_hash_seed` " +"and :c:member:`PyConfig.hash_seed` instead." +msgstr "" + +msgid ":c:var:`Py_IsolatedFlag`: Use :c:member:`PyConfig.isolated` instead." +msgstr "" + +msgid "" +":c:var:`Py_LegacyWindowsFSEncodingFlag`: Use :c:member:`PyPreConfig." +"legacy_windows_fs_encoding` instead." +msgstr "" + +msgid "" +":c:var:`Py_LegacyWindowsStdioFlag`: Use :c:member:`PyConfig." +"legacy_windows_stdio` instead." +msgstr "" + +msgid "" +":c:var:`!Py_FileSystemDefaultEncoding`: Use :c:member:`PyConfig." +"filesystem_encoding` instead." +msgstr "" + +msgid "" +":c:var:`!Py_HasFileSystemDefaultEncoding`: Use :c:member:`PyConfig." +"filesystem_encoding` instead." +msgstr "" + +msgid "" +":c:var:`!Py_FileSystemDefaultEncodeErrors`: Use :c:member:`PyConfig." +"filesystem_errors` instead." +msgstr "" + +msgid "" +":c:var:`!Py_UTF8Mode`: Use :c:member:`PyPreConfig.utf8_mode` instead. (see :" +"c:func:`Py_PreInitialize`)" +msgstr "" + +msgid "The bundled copy of ``libmpdecimal``." +msgstr "" + +msgid "" +"The :c:func:`PyImport_ImportModuleNoBlock`: Use :c:func:" +"`PyImport_ImportModule` instead." +msgstr "" + +msgid "" +":c:func:`PyWeakref_GetObject` and :c:func:`PyWeakref_GET_OBJECT`: Use :c:" +"func:`PyWeakref_GetRef` instead." +msgstr "" + +msgid "" +":c:type:`Py_UNICODE` type and the :c:macro:`!Py_UNICODE_WIDE` macro: Use :c:" +"type:`wchar_t` instead." +msgstr "" + +msgid "Python initialization functions:" +msgstr "" + +msgid "" +":c:func:`PySys_ResetWarnOptions`: Clear :data:`sys.warnoptions` and :data:`!" +"warnings.filters` instead." +msgstr "" + +msgid "" +":c:func:`Py_GetExecPrefix`: Get :data:`sys.base_exec_prefix` and :data:`sys." +"exec_prefix` instead." +msgstr "" + +msgid ":c:func:`Py_GetPath`: Get :data:`sys.path` instead." +msgstr "" + +msgid "" +":c:func:`Py_GetPrefix`: Get :data:`sys.base_prefix` and :data:`sys.prefix` " +"instead." +msgstr "" + +msgid ":c:func:`Py_GetProgramFullPath`: Get :data:`sys.executable` instead." +msgstr "" + +msgid ":c:func:`Py_GetProgramName`: Get :data:`sys.executable` instead." +msgstr "" + +msgid "" +":c:func:`Py_GetPythonHome`: Get :c:member:`PyConfig.home` or the :envvar:" +"`PYTHONHOME` environment variable instead." +msgstr "" + +msgid "" +"The following APIs are deprecated and will be removed, although there is " +"currently no date scheduled for their removal." +msgstr "" + +msgid ":c:macro:`Py_TPFLAGS_HAVE_FINALIZE`: Unneeded since Python 3.8." +msgstr "" + +msgid ":c:func:`PyErr_Fetch`: Use :c:func:`PyErr_GetRaisedException` instead." +msgstr "" + +msgid "" +":c:func:`PyErr_NormalizeException`: Use :c:func:`PyErr_GetRaisedException` " +"instead." +msgstr "" + +msgid "" +":c:func:`PyErr_Restore`: Use :c:func:`PyErr_SetRaisedException` instead." +msgstr "" + +msgid "" +":c:func:`PyModule_GetFilename`: Use :c:func:`PyModule_GetFilenameObject` " +"instead." +msgstr "" + +msgid ":c:func:`PyOS_AfterFork`: Use :c:func:`PyOS_AfterFork_Child` instead." +msgstr "" + +msgid "" +":c:func:`PySlice_GetIndicesEx`: Use :c:func:`PySlice_Unpack` and :c:func:" +"`PySlice_AdjustIndices` instead." +msgstr "" + +msgid "" +":c:func:`!PyUnicode_AsDecodedObject`: Use :c:func:`PyCodec_Decode` instead." +msgstr "" + +msgid "" +":c:func:`!PyUnicode_AsDecodedUnicode`: Use :c:func:`PyCodec_Decode` instead." +msgstr "" + +msgid "" +":c:func:`!PyUnicode_AsEncodedObject`: Use :c:func:`PyCodec_Encode` instead." +msgstr "" + +msgid "" +":c:func:`!PyUnicode_AsEncodedUnicode`: Use :c:func:`PyCodec_Encode` instead." +msgstr "" + +msgid ":c:func:`PyUnicode_READY`: Unneeded since Python 3.12" +msgstr "" + +msgid ":c:func:`!PyErr_Display`: Use :c:func:`PyErr_DisplayException` instead." +msgstr "" + +msgid "" +":c:func:`!_PyErr_ChainExceptions`: Use :c:func:`!_PyErr_ChainExceptions1` " +"instead." +msgstr "" + +msgid "" +":c:member:`!PyBytesObject.ob_shash` member: call :c:func:`PyObject_Hash` " +"instead." +msgstr "" + +msgid ":c:member:`!PyDictObject.ma_version_tag` member." +msgstr "" + +msgid "Thread Local Storage (TLS) API:" +msgstr "" + +msgid "" +":c:func:`PyThread_create_key`: Use :c:func:`PyThread_tss_alloc` instead." +msgstr "" + +msgid ":c:func:`PyThread_delete_key`: Use :c:func:`PyThread_tss_free` instead." +msgstr "" + +msgid "" +":c:func:`PyThread_set_key_value`: Use :c:func:`PyThread_tss_set` instead." +msgstr "" + +msgid "" +":c:func:`PyThread_get_key_value`: Use :c:func:`PyThread_tss_get` instead." +msgstr "" + +msgid "" +":c:func:`PyThread_delete_key_value`: Use :c:func:`PyThread_tss_delete` " +"instead." +msgstr "" + +msgid ":c:func:`PyThread_ReInitTLS`: Unneeded since Python 3.7." +msgstr "" diff --git a/deprecations/pending-removal-in-3_13.po b/deprecations/pending-removal-in-3_13.po new file mode 100644 index 000000000..e564bdaef --- /dev/null +++ b/deprecations/pending-removal-in-3_13.po @@ -0,0 +1,151 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2024-07-26 14:16+0000\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Pending Removal in Python 3.13" +msgstr "" + +msgid "Modules (see :pep:`594`):" +msgstr "" + +msgid ":mod:`!aifc`" +msgstr "" + +msgid ":mod:`!audioop`" +msgstr "" + +msgid ":mod:`!cgi`" +msgstr "" + +msgid ":mod:`!cgitb`" +msgstr "" + +msgid ":mod:`!chunk`" +msgstr "" + +msgid ":mod:`!crypt`" +msgstr "" + +msgid ":mod:`!imghdr`" +msgstr "" + +msgid ":mod:`!mailcap`" +msgstr "" + +msgid ":mod:`!msilib`" +msgstr "" + +msgid ":mod:`!nis`" +msgstr "" + +msgid ":mod:`!nntplib`" +msgstr "" + +msgid ":mod:`!ossaudiodev`" +msgstr "" + +msgid ":mod:`!pipes`" +msgstr "" + +msgid ":mod:`!sndhdr`" +msgstr "" + +msgid ":mod:`!spwd`" +msgstr "" + +msgid ":mod:`!sunau`" +msgstr "" + +msgid ":mod:`!telnetlib`" +msgstr "" + +msgid ":mod:`!uu`" +msgstr "" + +msgid ":mod:`!xdrlib`" +msgstr "" + +msgid "Other modules:" +msgstr "" + +msgid ":mod:`!lib2to3`, and the :program:`2to3` program (:gh:`84540`)" +msgstr "" + +msgid "APIs:" +msgstr "" + +msgid ":class:`!configparser.LegacyInterpolation` (:gh:`90765`)" +msgstr "" + +msgid "``locale.resetlocale()`` (:gh:`90817`)" +msgstr "" + +msgid ":meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)" +msgstr "" + +msgid ":func:`!unittest.findTestCases` (:gh:`50096`)" +msgstr "" + +msgid ":func:`!unittest.getTestCaseNames` (:gh:`50096`)" +msgstr "" + +msgid ":func:`!unittest.makeSuite` (:gh:`50096`)" +msgstr "" + +msgid ":meth:`!unittest.TestProgram.usageExit` (:gh:`67048`)" +msgstr "" + +msgid ":class:`!webbrowser.MacOSX` (:gh:`86421`)" +msgstr "" + +msgid ":class:`classmethod` descriptor chaining (:gh:`89519`)" +msgstr "" + +msgid ":mod:`importlib.resources` deprecated methods:" +msgstr "" + +msgid "``contents()``" +msgstr "" + +msgid "``is_resource()``" +msgstr "" + +msgid "``open_binary()``" +msgstr "" + +msgid "``open_text()``" +msgstr "" + +msgid "``path()``" +msgstr "" + +msgid "``read_binary()``" +msgstr "" + +msgid "``read_text()``" +msgstr "" + +msgid "" +"Use :func:`importlib.resources.files` instead. Refer to `importlib-" +"resources: Migrating from Legacy `_ (:gh:`106531`)" +msgstr "" diff --git a/deprecations/pending-removal-in-3_14.po b/deprecations/pending-removal-in-3_14.po new file mode 100644 index 000000000..694f69ad9 --- /dev/null +++ b/deprecations/pending-removal-in-3_14.po @@ -0,0 +1,177 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2024-07-20 00:54+0000\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Pending Removal in Python 3.14" +msgstr "" + +msgid "" +":mod:`argparse`: The *type*, *choices*, and *metavar* parameters of :class:`!" +"argparse.BooleanOptionalAction` are deprecated and will be removed in 3.14. " +"(Contributed by Nikita Sobolev in :gh:`92248`.)" +msgstr "" + +msgid "" +":mod:`ast`: The following features have been deprecated in documentation " +"since Python 3.8, now cause a :exc:`DeprecationWarning` to be emitted at " +"runtime when they are accessed or used, and will be removed in Python 3.14:" +msgstr "" + +msgid ":class:`!ast.Num`" +msgstr "" + +msgid ":class:`!ast.Str`" +msgstr "" + +msgid ":class:`!ast.Bytes`" +msgstr "" + +msgid ":class:`!ast.NameConstant`" +msgstr "" + +msgid ":class:`!ast.Ellipsis`" +msgstr "" + +msgid "" +"Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka in :gh:" +"`90953`.)" +msgstr "" + +msgid ":mod:`asyncio`:" +msgstr "" + +msgid "" +"The child watcher classes :class:`~asyncio.MultiLoopChildWatcher`, :class:" +"`~asyncio.FastChildWatcher`, :class:`~asyncio.AbstractChildWatcher` and :" +"class:`~asyncio.SafeChildWatcher` are deprecated and will be removed in " +"Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" +msgstr "" + +msgid "" +":func:`asyncio.set_child_watcher`, :func:`asyncio.get_child_watcher`, :meth:" +"`asyncio.AbstractEventLoopPolicy.set_child_watcher` and :meth:`asyncio." +"AbstractEventLoopPolicy.get_child_watcher` are deprecated and will be " +"removed in Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" +msgstr "" + +msgid "" +"The :meth:`~asyncio.get_event_loop` method of the default event loop policy " +"now emits a :exc:`DeprecationWarning` if there is no current event loop set " +"and it decides to create one. (Contributed by Serhiy Storchaka and Guido van " +"Rossum in :gh:`100160`.)" +msgstr "" + +msgid "" +":mod:`collections.abc`: Deprecated :class:`~collections.abc.ByteString`. " +"Prefer :class:`!Sequence` or :class:`~collections.abc.Buffer`. For use in " +"typing, prefer a union, like ``bytes | bytearray``, or :class:`collections." +"abc.Buffer`. (Contributed by Shantanu Jain in :gh:`91896`.)" +msgstr "" + +msgid "" +":mod:`email`: Deprecated the *isdst* parameter in :func:`email.utils." +"localtime`. (Contributed by Alan Williams in :gh:`72346`.)" +msgstr "" + +msgid ":mod:`importlib.abc` deprecated classes:" +msgstr "" + +msgid ":class:`!importlib.abc.ResourceReader`" +msgstr "" + +msgid ":class:`!importlib.abc.Traversable`" +msgstr "" + +msgid ":class:`!importlib.abc.TraversableResources`" +msgstr "" + +msgid "Use :mod:`importlib.resources.abc` classes instead:" +msgstr "" + +msgid ":class:`importlib.resources.abc.Traversable`" +msgstr "" + +msgid ":class:`importlib.resources.abc.TraversableResources`" +msgstr "" + +msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" +msgstr "" + +msgid "" +":mod:`itertools` had undocumented, inefficient, historically buggy, and " +"inconsistent support for copy, deepcopy, and pickle operations. This will be " +"removed in 3.14 for a significant reduction in code volume and maintenance " +"burden. (Contributed by Raymond Hettinger in :gh:`101588`.)" +msgstr "" + +msgid "" +":mod:`multiprocessing`: The default start method will change to a safer one " +"on Linux, BSDs, and other non-macOS POSIX platforms where ``'fork'`` is " +"currently the default (:gh:`84559`). Adding a runtime warning about this was " +"deemed too disruptive as the majority of code is not expected to care. Use " +"the :func:`~multiprocessing.get_context` or :func:`~multiprocessing." +"set_start_method` APIs to explicitly specify when your code *requires* " +"``'fork'``. See :ref:`multiprocessing-start-methods`." +msgstr "" + +msgid "" +":mod:`pathlib`: :meth:`~pathlib.PurePath.is_relative_to` and :meth:`~pathlib." +"PurePath.relative_to`: passing additional arguments is deprecated." +msgstr "" + +msgid "" +":mod:`pkgutil`: :func:`~pkgutil.find_loader` and :func:`~pkgutil.get_loader` " +"now raise :exc:`DeprecationWarning`; use :func:`importlib.util.find_spec` " +"instead. (Contributed by Nikita Sobolev in :gh:`97850`.)" +msgstr "" + +msgid ":mod:`pty`:" +msgstr "" + +msgid "``master_open()``: use :func:`pty.openpty`." +msgstr "" + +msgid "``slave_open()``: use :func:`pty.openpty`." +msgstr "" + +msgid ":mod:`sqlite3`:" +msgstr "" + +msgid ":data:`~sqlite3.version` and :data:`~sqlite3.version_info`." +msgstr "" + +msgid "" +":meth:`~sqlite3.Cursor.execute` and :meth:`~sqlite3.Cursor.executemany` if :" +"ref:`named placeholders ` are used and *parameters* is " +"a sequence instead of a :class:`dict`." +msgstr "" + +msgid "" +":mod:`typing`: :class:`~typing.ByteString`, deprecated since Python 3.9, now " +"causes a :exc:`DeprecationWarning` to be emitted when it is used." +msgstr "" + +msgid "" +":mod:`urllib`: :class:`!urllib.parse.Quoter` is deprecated: it was not " +"intended to be a public API. (Contributed by Gregory P. Smith in :gh:" +"`88168`.)" +msgstr "" diff --git a/deprecations/pending-removal-in-3_15.po b/deprecations/pending-removal-in-3_15.po new file mode 100644 index 000000000..14830c3f1 --- /dev/null +++ b/deprecations/pending-removal-in-3_15.po @@ -0,0 +1,151 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-04 14:18+0000\n" +"PO-Revision-Date: 2024-07-20 00:54+0000\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Pending Removal in Python 3.15" +msgstr "" + +msgid "The import system:" +msgstr "" + +msgid "" +"Setting :attr:`~module.__cached__` on a module while failing to set :attr:" +"`__spec__.cached ` is deprecated. In " +"Python 3.15, :attr:`!__cached__` will cease to be set or take into " +"consideration by the import system or standard library. (:gh:`97879`)" +msgstr "" + +msgid "" +"Setting :attr:`~module.__package__` on a module while failing to set :attr:" +"`__spec__.parent ` is deprecated. In " +"Python 3.15, :attr:`!__package__` will cease to be set or take into " +"consideration by the import system or standard library. (:gh:`97879`)" +msgstr "" + +msgid ":mod:`ctypes`:" +msgstr "" + +msgid "" +"The undocumented :func:`!ctypes.SetPointerType` function has been deprecated " +"since Python 3.13." +msgstr "" + +msgid ":mod:`http.server`:" +msgstr "" + +msgid "" +"The obsolete and rarely used :class:`~http.server.CGIHTTPRequestHandler` has " +"been deprecated since Python 3.13. No direct replacement exists. *Anything* " +"is better than CGI to interface a web server with a request handler." +msgstr "" + +msgid "" +"The :option:`!--cgi` flag to the :program:`python -m http.server` command-" +"line interface has been deprecated since Python 3.13." +msgstr "" + +msgid ":mod:`importlib`:" +msgstr "" + +msgid "``load_module()`` method: use ``exec_module()`` instead." +msgstr "" + +msgid ":class:`locale`:" +msgstr "" + +msgid "" +"The :func:`~locale.getdefaultlocale` function has been deprecated since " +"Python 3.11. Its removal was originally planned for Python 3.13 (:gh:" +"`90817`), but has been postponed to Python 3.15. Use :func:`~locale." +"getlocale`, :func:`~locale.setlocale`, and :func:`~locale.getencoding` " +"instead. (Contributed by Hugo van Kemenade in :gh:`111187`.)" +msgstr "" + +msgid ":mod:`pathlib`:" +msgstr "" + +msgid "" +":meth:`.PurePath.is_reserved` has been deprecated since Python 3.13. Use :" +"func:`os.path.isreserved` to detect reserved paths on Windows." +msgstr "" + +msgid ":mod:`platform`:" +msgstr "" + +msgid "" +":func:`~platform.java_ver` has been deprecated since Python 3.13. This " +"function is only useful for Jython support, has a confusing API, and is " +"largely untested." +msgstr "" + +msgid ":mod:`sysconfig`:" +msgstr "" + +msgid "" +"The *check_home* argument of :func:`sysconfig.is_python_build` has been " +"deprecated since Python 3.12." +msgstr "" + +msgid ":mod:`threading`:" +msgstr "" + +msgid "" +":func:`~threading.RLock` will take no arguments in Python 3.15. Passing any " +"arguments has been deprecated since Python 3.14, as the Python version does " +"not permit any arguments, but the C version allows any number of positional " +"or keyword arguments, ignoring every argument." +msgstr "" + +msgid ":mod:`types`:" +msgstr "" + +msgid "" +":class:`types.CodeType`: Accessing :attr:`~codeobject.co_lnotab` was " +"deprecated in :pep:`626` since 3.10 and was planned to be removed in 3.12, " +"but it only got a proper :exc:`DeprecationWarning` in 3.12. May be removed " +"in 3.15. (Contributed by Nikita Sobolev in :gh:`101866`.)" +msgstr "" + +msgid ":mod:`typing`:" +msgstr "" + +msgid "" +"The undocumented keyword argument syntax for creating :class:`~typing." +"NamedTuple` classes (e.g. ``Point = NamedTuple(\"Point\", x=int, y=int)``) " +"has been deprecated since Python 3.13. Use the class-based syntax or the " +"functional syntax instead." +msgstr "" + +msgid "" +"The :func:`typing.no_type_check_decorator` decorator function has been " +"deprecated since Python 3.13. After eight years in the :mod:`typing` module, " +"it has yet to be supported by any major type checker." +msgstr "" + +msgid ":mod:`wave`:" +msgstr "" + +msgid "" +"The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:`~wave." +"Wave_read.getmarkers` methods of the :class:`~wave.Wave_read` and :class:" +"`~wave.Wave_write` classes have been deprecated since Python 3.13." +msgstr "" diff --git a/deprecations/pending-removal-in-3_16.po b/deprecations/pending-removal-in-3_16.po new file mode 100644 index 000000000..14c4ce7a2 --- /dev/null +++ b/deprecations/pending-removal-in-3_16.po @@ -0,0 +1,98 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2024-07-20 00:54+0000\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Pending removal in Python 3.16" +msgstr "" + +msgid "The import system:" +msgstr "" + +msgid "" +"Setting :attr:`~module.__loader__` on a module while failing to set :attr:" +"`__spec__.loader ` is deprecated. In " +"Python 3.16, :attr:`!__loader__` will cease to be set or taken into " +"consideration by the import system or the standard library." +msgstr "" + +msgid ":mod:`array`:" +msgstr "" + +msgid "" +"The ``'u'`` format code (:c:type:`wchar_t`) has been deprecated in " +"documentation since Python 3.3 and at runtime since Python 3.13. Use the " +"``'w'`` format code (:c:type:`Py_UCS4`) for Unicode characters instead." +msgstr "" + +msgid ":mod:`asyncio`:" +msgstr "" + +msgid "" +":func:`!asyncio.iscoroutinefunction` is deprecated and will be removed in " +"Python 3.16, use :func:`inspect.iscoroutinefunction` instead. (Contributed " +"by Jiahao Li and Kumar Aditya in :gh:`122875`.)" +msgstr "" + +msgid ":mod:`builtins`:" +msgstr "" + +msgid "" +"Bitwise inversion on boolean types, ``~True`` or ``~False`` has been " +"deprecated since Python 3.12, as it produces surprising and unintuitive " +"results (``-2`` and ``-1``). Use ``not x`` instead for the logical negation " +"of a Boolean. In the rare case that you need the bitwise inversion of the " +"underlying integer, convert to ``int`` explicitly (``~int(x)``)." +msgstr "" + +msgid ":mod:`shutil`:" +msgstr "" + +msgid "" +"The :class:`!ExecError` exception has been deprecated since Python 3.14. It " +"has not been used by any function in :mod:`!shutil` since Python 3.4, and is " +"now an alias of :exc:`RuntimeError`." +msgstr "" + +msgid ":mod:`symtable`:" +msgstr "" + +msgid "" +"The :meth:`Class.get_methods ` method has been " +"deprecated since Python 3.14." +msgstr "" + +msgid ":mod:`sys`:" +msgstr "" + +msgid "" +"The :func:`~sys._enablelegacywindowsfsencoding` function has been deprecated " +"since Python 3.13. Use the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " +"environment variable instead." +msgstr "" + +msgid ":mod:`tarfile`:" +msgstr "" + +msgid "" +"The undocumented and unused :attr:`!TarFile.tarfile` attribute has been " +"deprecated since Python 3.13." +msgstr "" diff --git a/deprecations/pending-removal-in-future.po b/deprecations/pending-removal-in-future.po new file mode 100644 index 000000000..0cfa14638 --- /dev/null +++ b/deprecations/pending-removal-in-future.po @@ -0,0 +1,306 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-04 14:18+0000\n" +"PO-Revision-Date: 2024-07-20 00:54+0000\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Pending Removal in Future Versions" +msgstr "" + +msgid "" +"The following APIs will be removed in the future, although there is " +"currently no date scheduled for their removal." +msgstr "" + +msgid "" +":mod:`argparse`: Nesting argument groups and nesting mutually exclusive " +"groups are deprecated." +msgstr "" + +msgid ":mod:`array`'s ``'u'`` format code (:gh:`57281`)" +msgstr "" + +msgid ":mod:`builtins`:" +msgstr "" + +msgid "``bool(NotImplemented)``." +msgstr "" + +msgid "" +"Generators: ``throw(type, exc, tb)`` and ``athrow(type, exc, tb)`` signature " +"is deprecated: use ``throw(exc)`` and ``athrow(exc)`` instead, the single " +"argument signature." +msgstr "" + +msgid "" +"Currently Python accepts numeric literals immediately followed by keywords, " +"for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and " +"ambiguous expressions like ``[0x1for x in y]`` (which can be interpreted as " +"``[0x1 for x in y]`` or ``[0x1f or x in y]``). A syntax warning is raised " +"if the numeric literal is immediately followed by one of keywords :keyword:" +"`and`, :keyword:`else`, :keyword:`for`, :keyword:`if`, :keyword:`in`, :" +"keyword:`is` and :keyword:`or`. In a future release it will be changed to a " +"syntax error. (:gh:`87999`)" +msgstr "" + +msgid "" +"Support for ``__index__()`` and ``__int__()`` method returning non-int type: " +"these methods will be required to return an instance of a strict subclass " +"of :class:`int`." +msgstr "" + +msgid "" +"Support for ``__float__()`` method returning a strict subclass of :class:" +"`float`: these methods will be required to return an instance of :class:" +"`float`." +msgstr "" + +msgid "" +"Support for ``__complex__()`` method returning a strict subclass of :class:" +"`complex`: these methods will be required to return an instance of :class:" +"`complex`." +msgstr "" + +msgid "Delegation of ``int()`` to ``__trunc__()`` method." +msgstr "" + +msgid "" +"Passing a complex number as the *real* or *imag* argument in the :func:" +"`complex` constructor is now deprecated; it should only be passed as a " +"single positional argument. (Contributed by Serhiy Storchaka in :gh:" +"`109218`.)" +msgstr "" + +msgid "" +":mod:`calendar`: ``calendar.January`` and ``calendar.February`` constants " +"are deprecated and replaced by :data:`calendar.JANUARY` and :data:`calendar." +"FEBRUARY`. (Contributed by Prince Roshan in :gh:`103636`.)" +msgstr "" + +msgid "" +":attr:`codeobject.co_lnotab`: use the :meth:`codeobject.co_lines` method " +"instead." +msgstr "" + +msgid ":mod:`datetime`:" +msgstr "" + +msgid "" +":meth:`~datetime.datetime.utcnow`: use ``datetime.datetime.now(tz=datetime." +"UTC)``." +msgstr "" + +msgid "" +":meth:`~datetime.datetime.utcfromtimestamp`: use ``datetime.datetime." +"fromtimestamp(timestamp, tz=datetime.UTC)``." +msgstr "" + +msgid ":mod:`gettext`: Plural value must be an integer." +msgstr "" + +msgid ":mod:`importlib`:" +msgstr "" + +msgid "" +":func:`~importlib.util.cache_from_source` *debug_override* parameter is " +"deprecated: use the *optimization* parameter instead." +msgstr "" + +msgid ":mod:`importlib.metadata`:" +msgstr "" + +msgid "``EntryPoints`` tuple interface." +msgstr "" + +msgid "Implicit ``None`` on return values." +msgstr "" + +msgid "" +":mod:`logging`: the ``warn()`` method has been deprecated since Python 3.3, " +"use :meth:`~logging.warning` instead." +msgstr "" + +msgid "" +":mod:`mailbox`: Use of StringIO input and text mode is deprecated, use " +"BytesIO and binary mode instead." +msgstr "" + +msgid "" +":mod:`os`: Calling :func:`os.register_at_fork` in multi-threaded process." +msgstr "" + +msgid "" +":class:`!pydoc.ErrorDuringImport`: A tuple value for *exc_info* parameter is " +"deprecated, use an exception instance." +msgstr "" + +msgid "" +":mod:`re`: More strict rules are now applied for numerical group references " +"and group names in regular expressions. Only sequence of ASCII digits is " +"now accepted as a numerical reference. The group name in bytes patterns and " +"replacement strings can now only contain ASCII letters and digits and " +"underscore. (Contributed by Serhiy Storchaka in :gh:`91760`.)" +msgstr "" + +msgid "" +":mod:`!sre_compile`, :mod:`!sre_constants` and :mod:`!sre_parse` modules." +msgstr "" + +msgid "" +":mod:`shutil`: :func:`~shutil.rmtree`'s *onerror* parameter is deprecated in " +"Python 3.12; use the *onexc* parameter instead." +msgstr "" + +msgid ":mod:`ssl` options and protocols:" +msgstr "" + +msgid ":class:`ssl.SSLContext` without protocol argument is deprecated." +msgstr "" + +msgid "" +":class:`ssl.SSLContext`: :meth:`~ssl.SSLContext.set_npn_protocols` and :meth:" +"`!selected_npn_protocol` are deprecated: use ALPN instead." +msgstr "" + +msgid "``ssl.OP_NO_SSL*`` options" +msgstr "" + +msgid "``ssl.OP_NO_TLS*`` options" +msgstr "" + +msgid "``ssl.PROTOCOL_SSLv3``" +msgstr "" + +msgid "``ssl.PROTOCOL_TLS``" +msgstr "" + +msgid "``ssl.PROTOCOL_TLSv1``" +msgstr "" + +msgid "``ssl.PROTOCOL_TLSv1_1``" +msgstr "" + +msgid "``ssl.PROTOCOL_TLSv1_2``" +msgstr "" + +msgid "``ssl.TLSVersion.SSLv3``" +msgstr "" + +msgid "``ssl.TLSVersion.TLSv1``" +msgstr "" + +msgid "``ssl.TLSVersion.TLSv1_1``" +msgstr "" + +msgid ":mod:`threading` methods:" +msgstr "" + +msgid "" +":meth:`!threading.Condition.notifyAll`: use :meth:`~threading.Condition." +"notify_all`." +msgstr "" + +msgid ":meth:`!threading.Event.isSet`: use :meth:`~threading.Event.is_set`." +msgstr "" + +msgid "" +":meth:`!threading.Thread.isDaemon`, :meth:`threading.Thread.setDaemon`: use :" +"attr:`threading.Thread.daemon` attribute." +msgstr "" + +msgid "" +":meth:`!threading.Thread.getName`, :meth:`threading.Thread.setName`: use :" +"attr:`threading.Thread.name` attribute." +msgstr "" + +msgid ":meth:`!threading.currentThread`: use :meth:`threading.current_thread`." +msgstr "" + +msgid ":meth:`!threading.activeCount`: use :meth:`threading.active_count`." +msgstr "" + +msgid ":class:`typing.Text` (:gh:`92332`)." +msgstr "" + +msgid "" +":class:`unittest.IsolatedAsyncioTestCase`: it is deprecated to return a " +"value that is not ``None`` from a test case." +msgstr "" + +msgid "" +":mod:`urllib.parse` deprecated functions: :func:`~urllib.parse.urlparse` " +"instead" +msgstr "" + +msgid "``splitattr()``" +msgstr "" + +msgid "``splithost()``" +msgstr "" + +msgid "``splitnport()``" +msgstr "" + +msgid "``splitpasswd()``" +msgstr "" + +msgid "``splitport()``" +msgstr "" + +msgid "``splitquery()``" +msgstr "" + +msgid "``splittag()``" +msgstr "" + +msgid "``splittype()``" +msgstr "" + +msgid "``splituser()``" +msgstr "" + +msgid "``splitvalue()``" +msgstr "" + +msgid "``to_bytes()``" +msgstr "" + +msgid "" +":mod:`urllib.request`: :class:`~urllib.request.URLopener` and :class:" +"`~urllib.request.FancyURLopener` style of invoking requests is deprecated. " +"Use newer :func:`~urllib.request.urlopen` functions and methods." +msgstr "" + +msgid "" +":mod:`wsgiref`: ``SimpleHandler.stdout.write()`` should not do partial " +"writes." +msgstr "" + +msgid "" +":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`~xml." +"etree.ElementTree.Element` is deprecated. In a future release it will always " +"return ``True``. Prefer explicit ``len(elem)`` or ``elem is not None`` tests " +"instead." +msgstr "" + +msgid "" +":meth:`zipimport.zipimporter.load_module` is deprecated: use :meth:" +"`~zipimport.zipimporter.exec_module` instead." +msgstr "" diff --git a/distributing/index.po b/distributing/index.po new file mode 100644 index 000000000..5bb646ff8 --- /dev/null +++ b/distributing/index.po @@ -0,0 +1,39 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# Yuliia Shevchenko, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:50+0000\n" +"Last-Translator: Yuliia Shevchenko, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Distributing Python Modules" +msgstr "Розповсюдження модулів Python" + +msgid "" +"Information and guidance on distributing Python modules and packages has " +"been moved to the `Python Packaging User Guide`_, and the tutorial on " +"`packaging Python projects`_." +msgstr "" +"Інформація та вказівки щодо розповсюдження модулів і пакетів Python були " +"переміщені до `Посібника користувача з упаковки Python`_, а також до " +"навчального посібника з `пакування проектів Python`_." diff --git a/extending/building.po b/extending/building.po new file mode 100644 index 000000000..9b9cb8fb5 --- /dev/null +++ b/extending/building.po @@ -0,0 +1,98 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:51+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Building C and C++ Extensions" +msgstr "Створення розширень C і C++" + +msgid "" +"A C extension for CPython is a shared library (e.g. a ``.so`` file on Linux, " +"``.pyd`` on Windows), which exports an *initialization function*." +msgstr "" +"Розширення C для CPython — це спільна бібліотека (наприклад, файл ``.so`` у " +"Linux, ``.pyd`` у Windows), яка експортує *функцію ініціалізації*." + +msgid "" +"To be importable, the shared library must be available on :envvar:" +"`PYTHONPATH`, and must be named after the module name, with an appropriate " +"extension. When using setuptools, the correct filename is generated " +"automatically." +msgstr "" + +msgid "The initialization function has the signature:" +msgstr "Функція ініціалізації має сигнатуру:" + +msgid "" +"It returns either a fully initialized module, or a :c:type:`PyModuleDef` " +"instance. See :ref:`initializing-modules` for details." +msgstr "" + +msgid "" +"For modules with ASCII-only names, the function must be named " +"``PyInit_``, with ```` replaced by the name of the " +"module. When using :ref:`multi-phase-initialization`, non-ASCII module names " +"are allowed. In this case, the initialization function name is " +"``PyInitU_``, with ```` encoded using Python's " +"*punycode* encoding with hyphens replaced by underscores. In Python::" +msgstr "" +"Для модулів із іменами лише у форматі ASCII функція має мати назву ``PyInit_ " +"``, при цьому ```` замінюється назвою модуля. При " +"використанні :ref:`multi-phase-initialization` дозволені назви модулів, " +"відмінні від ASCII. У цьому випадку ім’я функції ініціалізації – ``PyInitU_ " +"``, де ```` закодовано з використанням *punycode* " +"кодування Python із дефісами, заміненими підкресленням. У Python::" + +msgid "" +"def initfunc_name(name):\n" +" try:\n" +" suffix = b'_' + name.encode('ascii')\n" +" except UnicodeEncodeError:\n" +" suffix = b'U_' + name.encode('punycode').replace(b'-', b'_')\n" +" return b'PyInit' + suffix" +msgstr "" + +msgid "" +"It is possible to export multiple modules from a single shared library by " +"defining multiple initialization functions. However, importing them requires " +"using symbolic links or a custom importer, because by default only the " +"function corresponding to the filename is found. See the *\"Multiple modules " +"in one library\"* section in :pep:`489` for details." +msgstr "" +"Можна експортувати кілька модулів з однієї спільної бібліотеки, визначивши " +"кілька функцій ініціалізації. Однак для їх імпортування потрібно " +"використовувати символічні посилання або спеціальний імпортер, оскільки за " +"замовчуванням знайдено лише функцію, яка відповідає назві файлу. Подробиці " +"див. у розділі *\"Кілька модулів в одній бібліотеці\"* у :pep:`489`." + +msgid "Building C and C++ Extensions with setuptools" +msgstr "" + +msgid "" +"Python 3.12 and newer no longer come with distutils. Please refer to the " +"``setuptools`` documentation at https://setuptools.readthedocs.io/en/latest/" +"setuptools.html to learn more about how build and distribute C/C++ " +"extensions with setuptools." +msgstr "" diff --git a/extending/embedding.po b/extending/embedding.po new file mode 100644 index 000000000..070820afa --- /dev/null +++ b/extending/embedding.po @@ -0,0 +1,621 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:51+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Embedding Python in Another Application" +msgstr "Вбудовування Python в іншу програму" + +msgid "" +"The previous chapters discussed how to extend Python, that is, how to extend " +"the functionality of Python by attaching a library of C functions to it. It " +"is also possible to do it the other way around: enrich your C/C++ " +"application by embedding Python in it. Embedding provides your application " +"with the ability to implement some of the functionality of your application " +"in Python rather than C or C++. This can be used for many purposes; one " +"example would be to allow users to tailor the application to their needs by " +"writing some scripts in Python. You can also use it yourself if some of the " +"functionality can be written in Python more easily." +msgstr "" +"У попередніх розділах обговорювалося, як розширити Python, тобто як " +"розширити функціональні можливості Python, приєднавши до нього бібліотеку " +"функцій C. Також можна зробити це навпаки: збагатіть свою програму C/C++, " +"вставивши в неї Python. Вбудовування надає вашій програмі можливість " +"реалізувати деякі функціональні можливості вашої програми на Python, а не на " +"C або C++. Це можна використовувати для багатьох цілей; одним із прикладів " +"може бути надання користувачам можливості адаптувати програму до своїх " +"потреб, написавши деякі сценарії на Python. Ви також можете використовувати " +"його самостійно, якщо деякі функції можна написати на Python легше." + +msgid "" +"Embedding Python is similar to extending it, but not quite. The difference " +"is that when you extend Python, the main program of the application is still " +"the Python interpreter, while if you embed Python, the main program may have " +"nothing to do with Python --- instead, some parts of the application " +"occasionally call the Python interpreter to run some Python code." +msgstr "" +"Вбудовування Python схоже на його розширення, але не зовсім. Різниця полягає " +"в тому, що коли ви розширюєте Python, основною програмою програми " +"залишається інтерпретатор Python, тоді як якщо ви вбудовуєте Python, основна " +"програма може не мати нічого спільного з Python --- натомість деякі частини " +"програми час від часу викликають Інтерпретатор Python для запуску коду " +"Python." + +msgid "" +"So if you are embedding Python, you are providing your own main program. " +"One of the things this main program has to do is initialize the Python " +"interpreter. At the very least, you have to call the function :c:func:" +"`Py_Initialize`. There are optional calls to pass command line arguments to " +"Python. Then later you can call the interpreter from any part of the " +"application." +msgstr "" +"Отже, якщо ви вбудовуєте Python, ви надаєте свою власну основну програму. " +"Одна з речей, яку має зробити ця основна програма, це ініціалізувати " +"інтерпретатор Python. Принаймні, ви повинні викликати функцію :c:func:" +"`Py_Initialize`. Існують додаткові виклики для передачі аргументів " +"командного рядка в Python. Пізніше ви можете викликати перекладача з будь-" +"якої частини програми." + +msgid "" +"There are several different ways to call the interpreter: you can pass a " +"string containing Python statements to :c:func:`PyRun_SimpleString`, or you " +"can pass a stdio file pointer and a file name (for identification in error " +"messages only) to :c:func:`PyRun_SimpleFile`. You can also call the lower-" +"level operations described in the previous chapters to construct and use " +"Python objects." +msgstr "" +"Існує кілька різних способів виклику інтерпретатора: ви можете передати " +"рядок, що містить оператори Python, до :c:func:`PyRun_SimpleString`, або ви " +"можете передати вказівник файлу stdio та ім’я файлу (лише для ідентифікації " +"в повідомленнях про помилки) до :c:func:`PyRun_SimpleFile`. Ви також можете " +"викликати операції нижчого рівня, описані в попередніх розділах, для " +"створення та використання об’єктів Python." + +msgid ":ref:`c-api-index`" +msgstr ":ref:`c-api-index`" + +msgid "" +"The details of Python's C interface are given in this manual. A great deal " +"of necessary information can be found here." +msgstr "" +"Подробиці інтерфейсу C Python наведено в цьому посібнику. Тут можна знайти " +"багато необхідної інформації." + +msgid "Very High Level Embedding" +msgstr "Дуже високий рівень вбудовування" + +msgid "" +"The simplest form of embedding Python is the use of the very high level " +"interface. This interface is intended to execute a Python script without " +"needing to interact with the application directly. This can for example be " +"used to perform some operation on a file. ::" +msgstr "" +"Найпростішою формою вбудовування Python є використання інтерфейсу дуже " +"високого рівня. Цей інтерфейс призначений для виконання сценарію Python без " +"необхідності безпосередньої взаємодії з програмою. Це можна, наприклад, " +"використати для виконання певної операції над файлом. ::" + +msgid "" +"#define PY_SSIZE_T_CLEAN\n" +"#include \n" +"\n" +"int\n" +"main(int argc, char *argv[])\n" +"{\n" +" PyStatus status;\n" +" PyConfig config;\n" +" PyConfig_InitPythonConfig(&config);\n" +"\n" +" /* optional but recommended */\n" +" status = PyConfig_SetBytesString(&config, &config.program_name, " +"argv[0]);\n" +" if (PyStatus_Exception(status)) {\n" +" goto exception;\n" +" }\n" +"\n" +" status = Py_InitializeFromConfig(&config);\n" +" if (PyStatus_Exception(status)) {\n" +" goto exception;\n" +" }\n" +" PyConfig_Clear(&config);\n" +"\n" +" PyRun_SimpleString(\"from time import time,ctime\\n\"\n" +" \"print('Today is', ctime(time()))\\n\");\n" +" if (Py_FinalizeEx() < 0) {\n" +" exit(120);\n" +" }\n" +" return 0;\n" +"\n" +" exception:\n" +" PyConfig_Clear(&config);\n" +" Py_ExitStatusException(status);\n" +"}" +msgstr "" + +msgid "" +"``#define PY_SSIZE_T_CLEAN`` was used to indicate that ``Py_ssize_t`` should " +"be used in some APIs instead of ``int``. It is not necessary since Python " +"3.13, but we keep it here for backward compatibility. See :ref:`arg-parsing-" +"string-and-buffers` for a description of this macro." +msgstr "" + +msgid "" +"Setting :c:member:`PyConfig.program_name` should be called before :c:func:" +"`Py_InitializeFromConfig` to inform the interpreter about paths to Python " +"run-time libraries. Next, the Python interpreter is initialized with :c:" +"func:`Py_Initialize`, followed by the execution of a hard-coded Python " +"script that prints the date and time. Afterwards, the :c:func:" +"`Py_FinalizeEx` call shuts the interpreter down, followed by the end of the " +"program. In a real program, you may want to get the Python script from " +"another source, perhaps a text-editor routine, a file, or a database. " +"Getting the Python code from a file can better be done by using the :c:func:" +"`PyRun_SimpleFile` function, which saves you the trouble of allocating " +"memory space and loading the file contents." +msgstr "" + +msgid "Beyond Very High Level Embedding: An overview" +msgstr "Поза межами вбудовування дуже високого рівня: огляд" + +msgid "" +"The high level interface gives you the ability to execute arbitrary pieces " +"of Python code from your application, but exchanging data values is quite " +"cumbersome to say the least. If you want that, you should use lower level " +"calls. At the cost of having to write more C code, you can achieve almost " +"anything." +msgstr "" +"Інтерфейс високого рівня дає вам можливість виконувати довільні частини коду " +"Python із вашої програми, але обмін значеннями даних, м’яко кажучи, досить " +"громіздкий. Якщо ви цього хочете, вам слід використовувати виклики нижчого " +"рівня. Ціною необхідності писати більше коду на C ви можете досягти майже " +"чого завгодно." + +msgid "" +"It should be noted that extending Python and embedding Python is quite the " +"same activity, despite the different intent. Most topics discussed in the " +"previous chapters are still valid. To show this, consider what the extension " +"code from Python to C really does:" +msgstr "" +"Слід зазначити, що розширення Python і вбудовування Python — це однакова " +"діяльність, незважаючи на різні наміри. Більшість тем, розглянутих у " +"попередніх розділах, все ще актуальні. Щоб показати це, розглянемо, що " +"насправді робить код розширення з Python на C:" + +msgid "Convert data values from Python to C," +msgstr "Перетворення значень даних з Python на C," + +msgid "Perform a function call to a C routine using the converted values, and" +msgstr "" +"Виконайте виклик функції до підпрограми C, використовуючи перетворені " +"значення, і" + +msgid "Convert the data values from the call from C to Python." +msgstr "Перетворіть значення даних виклику з C на Python." + +msgid "When embedding Python, the interface code does:" +msgstr "Під час вбудовування Python код інтерфейсу виконує:" + +msgid "Convert data values from C to Python," +msgstr "Перетворення значень даних із C на Python," + +msgid "" +"Perform a function call to a Python interface routine using the converted " +"values, and" +msgstr "" +"Виконайте виклик функції до процедури інтерфейсу Python, використовуючи " +"перетворені значення, і" + +msgid "Convert the data values from the call from Python to C." +msgstr "Перетворіть значення даних виклику з Python на C." + +msgid "" +"As you can see, the data conversion steps are simply swapped to accommodate " +"the different direction of the cross-language transfer. The only difference " +"is the routine that you call between both data conversions. When extending, " +"you call a C routine, when embedding, you call a Python routine." +msgstr "" +"Як бачите, кроки перетворення даних просто поміняно місцями, щоб відповідати " +"різному напрямку передачі між мовами. Єдина відмінність полягає в процедурі, " +"яку ви викликаєте між двома перетвореннями даних. Під час розширення ви " +"викликаєте підпрограму C, під час вбудовування ви викликаєте підпрограму " +"Python." + +msgid "" +"This chapter will not discuss how to convert data from Python to C and vice " +"versa. Also, proper use of references and dealing with errors is assumed to " +"be understood. Since these aspects do not differ from extending the " +"interpreter, you can refer to earlier chapters for the required information." +msgstr "" +"У цьому розділі не розглядатиметься, як конвертувати дані з Python на C і " +"навпаки. Також передбачається, що належне використання посилань і робота з " +"помилками є зрозумілими. Оскільки ці аспекти не відрізняються від розширення " +"інтерпретатора, ви можете звернутися до попередніх розділів для отримання " +"необхідної інформації." + +msgid "Pure Embedding" +msgstr "Чисте вбудовування" + +msgid "" +"The first program aims to execute a function in a Python script. Like in the " +"section about the very high level interface, the Python interpreter does not " +"directly interact with the application (but that will change in the next " +"section)." +msgstr "" +"Перша програма спрямована на виконання функції в сценарії Python. Як і в " +"розділі про інтерфейс дуже високого рівня, інтерпретатор Python " +"безпосередньо не взаємодіє з програмою (але це зміниться в наступному " +"розділі)." + +msgid "The code to run a function defined in a Python script is:" +msgstr "Код для запуску функції, визначеної в сценарії Python, такий:" + +msgid "" +"#define PY_SSIZE_T_CLEAN\n" +"#include \n" +"\n" +"int\n" +"main(int argc, char *argv[])\n" +"{\n" +" PyObject *pName, *pModule, *pFunc;\n" +" PyObject *pArgs, *pValue;\n" +" int i;\n" +"\n" +" if (argc < 3) {\n" +" fprintf(stderr,\"Usage: call pythonfile funcname [args]\\n\");\n" +" return 1;\n" +" }\n" +"\n" +" Py_Initialize();\n" +" pName = PyUnicode_DecodeFSDefault(argv[1]);\n" +" /* Error checking of pName left out */\n" +"\n" +" pModule = PyImport_Import(pName);\n" +" Py_DECREF(pName);\n" +"\n" +" if (pModule != NULL) {\n" +" pFunc = PyObject_GetAttrString(pModule, argv[2]);\n" +" /* pFunc is a new reference */\n" +"\n" +" if (pFunc && PyCallable_Check(pFunc)) {\n" +" pArgs = PyTuple_New(argc - 3);\n" +" for (i = 0; i < argc - 3; ++i) {\n" +" pValue = PyLong_FromLong(atoi(argv[i + 3]));\n" +" if (!pValue) {\n" +" Py_DECREF(pArgs);\n" +" Py_DECREF(pModule);\n" +" fprintf(stderr, \"Cannot convert argument\\n\");\n" +" return 1;\n" +" }\n" +" /* pValue reference stolen here: */\n" +" PyTuple_SetItem(pArgs, i, pValue);\n" +" }\n" +" pValue = PyObject_CallObject(pFunc, pArgs);\n" +" Py_DECREF(pArgs);\n" +" if (pValue != NULL) {\n" +" printf(\"Result of call: %ld\\n\", PyLong_AsLong(pValue));\n" +" Py_DECREF(pValue);\n" +" }\n" +" else {\n" +" Py_DECREF(pFunc);\n" +" Py_DECREF(pModule);\n" +" PyErr_Print();\n" +" fprintf(stderr,\"Call failed\\n\");\n" +" return 1;\n" +" }\n" +" }\n" +" else {\n" +" if (PyErr_Occurred())\n" +" PyErr_Print();\n" +" fprintf(stderr, \"Cannot find function \\\"%s\\\"\\n\", " +"argv[2]);\n" +" }\n" +" Py_XDECREF(pFunc);\n" +" Py_DECREF(pModule);\n" +" }\n" +" else {\n" +" PyErr_Print();\n" +" fprintf(stderr, \"Failed to load \\\"%s\\\"\\n\", argv[1]);\n" +" return 1;\n" +" }\n" +" if (Py_FinalizeEx() < 0) {\n" +" return 120;\n" +" }\n" +" return 0;\n" +"}\n" +msgstr "" + +msgid "" +"This code loads a Python script using ``argv[1]``, and calls the function " +"named in ``argv[2]``. Its integer arguments are the other values of the " +"``argv`` array. If you :ref:`compile and link ` this program " +"(let's call the finished executable :program:`call`), and use it to execute " +"a Python script, such as:" +msgstr "" +"Цей код завантажує сценарій Python за допомогою ``argv[1]`` і викликає " +"функцію, названу в ``argv[2]``. Його цілі аргументи є іншими значеннями " +"масиву ``argv``. Якщо ви :ref:`скомпілюєте та зв’яжете ` цю " +"програму (давайте назвемо готовий виконуваний файл :program:`call`), і " +"використаємо його для виконання сценарію Python, наприклад:" + +msgid "" +"def multiply(a,b):\n" +" print(\"Will compute\", a, \"times\", b)\n" +" c = 0\n" +" for i in range(0, a):\n" +" c = c + b\n" +" return c" +msgstr "" + +msgid "then the result should be:" +msgstr "тоді результат має бути таким:" + +msgid "" +"$ call multiply multiply 3 2\n" +"Will compute 3 times 2\n" +"Result of call: 6" +msgstr "" + +msgid "" +"Although the program is quite large for its functionality, most of the code " +"is for data conversion between Python and C, and for error reporting. The " +"interesting part with respect to embedding Python starts with ::" +msgstr "" +"Незважаючи на те, що програма досить велика за своїми функціями, більша " +"частина коду призначена для перетворення даних між Python і C, а також для " +"звітування про помилки. Цікава частина щодо вбудовування Python починається " +"з::" + +msgid "" +"Py_Initialize();\n" +"pName = PyUnicode_DecodeFSDefault(argv[1]);\n" +"/* Error checking of pName left out */\n" +"pModule = PyImport_Import(pName);" +msgstr "" + +msgid "" +"After initializing the interpreter, the script is loaded using :c:func:" +"`PyImport_Import`. This routine needs a Python string as its argument, " +"which is constructed using the :c:func:`PyUnicode_DecodeFSDefault` data " +"conversion routine. ::" +msgstr "" + +msgid "" +"pFunc = PyObject_GetAttrString(pModule, argv[2]);\n" +"/* pFunc is a new reference */\n" +"\n" +"if (pFunc && PyCallable_Check(pFunc)) {\n" +" ...\n" +"}\n" +"Py_XDECREF(pFunc);" +msgstr "" + +msgid "" +"Once the script is loaded, the name we're looking for is retrieved using :c:" +"func:`PyObject_GetAttrString`. If the name exists, and the object returned " +"is callable, you can safely assume that it is a function. The program then " +"proceeds by constructing a tuple of arguments as normal. The call to the " +"Python function is then made with::" +msgstr "" +"Після завантаження сценарію ім’я, яке ми шукаємо, отримується за допомогою :" +"c:func:`PyObject_GetAttrString`. Якщо ім'я існує, а повернутий об'єкт можна " +"викликати, ви можете сміливо вважати, що це функція. Потім програма " +"продовжує створення кортежу аргументів у звичайному режимі. Потім виклик " +"функції Python виконується за допомогою::" + +msgid "pValue = PyObject_CallObject(pFunc, pArgs);" +msgstr "" + +msgid "" +"Upon return of the function, ``pValue`` is either ``NULL`` or it contains a " +"reference to the return value of the function. Be sure to release the " +"reference after examining the value." +msgstr "" +"Після повернення функції ``pValue`` є або ``NULL``, або містить посилання на " +"значення, що повертається функцією. Обов’язково опублікуйте посилання після " +"вивчення значення." + +msgid "Extending Embedded Python" +msgstr "Розширення вбудованого Python" + +msgid "" +"Until now, the embedded Python interpreter had no access to functionality " +"from the application itself. The Python API allows this by extending the " +"embedded interpreter. That is, the embedded interpreter gets extended with " +"routines provided by the application. While it sounds complex, it is not so " +"bad. Simply forget for a while that the application starts the Python " +"interpreter. Instead, consider the application to be a set of subroutines, " +"and write some glue code that gives Python access to those routines, just " +"like you would write a normal Python extension. For example::" +msgstr "" +"До цього часу вбудований інтерпретатор Python не мав доступу до " +"функціональних можливостей самої програми. Python API дозволяє це, " +"розширюючи вбудований інтерпретатор. Тобто вбудований інтерпретатор " +"розширюється підпрограмами, наданими програмою. Хоча це звучить складно, це " +"не так вже й погано. Просто забудьте на деякий час, що програма запускає " +"інтерпретатор Python. Замість цього розгляньте програму як набір підпрограм " +"і напишіть якийсь клейовий код, який надає Python доступ до цих підпрограм, " +"так само, як ви б написали звичайне розширення Python. Наприклад::" + +msgid "" +"static int numargs=0;\n" +"\n" +"/* Return the number of arguments of the application command line */\n" +"static PyObject*\n" +"emb_numargs(PyObject *self, PyObject *args)\n" +"{\n" +" if(!PyArg_ParseTuple(args, \":numargs\"))\n" +" return NULL;\n" +" return PyLong_FromLong(numargs);\n" +"}\n" +"\n" +"static PyMethodDef EmbMethods[] = {\n" +" {\"numargs\", emb_numargs, METH_VARARGS,\n" +" \"Return the number of arguments received by the process.\"},\n" +" {NULL, NULL, 0, NULL}\n" +"};\n" +"\n" +"static PyModuleDef EmbModule = {\n" +" PyModuleDef_HEAD_INIT, \"emb\", NULL, -1, EmbMethods,\n" +" NULL, NULL, NULL, NULL\n" +"};\n" +"\n" +"static PyObject*\n" +"PyInit_emb(void)\n" +"{\n" +" return PyModule_Create(&EmbModule);\n" +"}" +msgstr "" + +msgid "" +"Insert the above code just above the :c:func:`main` function. Also, insert " +"the following two statements before the call to :c:func:`Py_Initialize`::" +msgstr "" +"Вставте наведений вище код безпосередньо над функцією :c:func:`main`. Також " +"вставте наступні два оператори перед викликом :c:func:`Py_Initialize`::" + +msgid "" +"numargs = argc;\n" +"PyImport_AppendInittab(\"emb\", &PyInit_emb);" +msgstr "" + +msgid "" +"These two lines initialize the ``numargs`` variable, and make the :func:`!" +"emb.numargs` function accessible to the embedded Python interpreter. With " +"these extensions, the Python script can do things like" +msgstr "" + +msgid "" +"import emb\n" +"print(\"Number of arguments\", emb.numargs())" +msgstr "" + +msgid "" +"In a real application, the methods will expose an API of the application to " +"Python." +msgstr "У реальній програмі методи нададуть API програми Python." + +msgid "Embedding Python in C++" +msgstr "Вбудовування Python у C++" + +msgid "" +"It is also possible to embed Python in a C++ program; precisely how this is " +"done will depend on the details of the C++ system used; in general you will " +"need to write the main program in C++, and use the C++ compiler to compile " +"and link your program. There is no need to recompile Python itself using C+" +"+." +msgstr "" +"Також можна вбудувати Python у програму C++; те, як це буде зроблено, " +"залежатиме від деталей використовуваної системи C++; загалом, вам потрібно " +"буде написати основну програму мовою C++ і використовувати компілятор C++ " +"для компіляції та компонування вашої програми. Немає необхідності " +"перекомпілювати сам Python за допомогою C++." + +msgid "Compiling and Linking under Unix-like systems" +msgstr "Компіляція та компонування в Unix-подібних системах" + +msgid "" +"It is not necessarily trivial to find the right flags to pass to your " +"compiler (and linker) in order to embed the Python interpreter into your " +"application, particularly because Python needs to load library modules " +"implemented as C dynamic extensions (:file:`.so` files) linked against it." +msgstr "" +"Не обов’язково тривіально знайти правильні позначки для передачі вашому " +"компілятору (і компонувальнику), щоб вбудувати інтерпретатор Python у вашу " +"програму, особливо тому, що Python має завантажувати бібліотечні модулі, " +"реалізовані як динамічні розширення C (:file:`.so` файли), пов’язані з ним." + +msgid "" +"To find out the required compiler and linker flags, you can execute the :" +"file:`python{X.Y}-config` script which is generated as part of the " +"installation process (a :file:`python3-config` script may also be " +"available). This script has several options, of which the following will be " +"directly useful to you:" +msgstr "" +"Щоб дізнатися необхідні позначки компілятора та компонувальника, ви можете " +"виконати сценарій :file:`python{X.Y}-config`, який створюється як частина " +"процесу інсталяції (може також бути доступний сценарій :file:`python3-" +"config` ). Цей сценарій має кілька варіантів, з яких наступні будуть вам " +"безпосередньо корисні:" + +msgid "" +"``pythonX.Y-config --cflags`` will give you the recommended flags when " +"compiling:" +msgstr "" +"``pythonX.Y-config --cflags`` надасть вам рекомендовані позначки під час " +"компіляції:" + +msgid "" +"$ /opt/bin/python3.11-config --cflags\n" +"-I/opt/include/python3.11 -I/opt/include/python3.11 -Wsign-compare -DNDEBUG " +"-g -fwrapv -O3 -Wall" +msgstr "" + +msgid "" +"``pythonX.Y-config --ldflags --embed`` will give you the recommended flags " +"when linking:" +msgstr "" + +msgid "" +"$ /opt/bin/python3.11-config --ldflags --embed\n" +"-L/opt/lib/python3.11/config-3.11-x86_64-linux-gnu -L/opt/lib -lpython3.11 -" +"lpthread -ldl -lutil -lm" +msgstr "" + +msgid "" +"To avoid confusion between several Python installations (and especially " +"between the system Python and your own compiled Python), it is recommended " +"that you use the absolute path to :file:`python{X.Y}-config`, as in the " +"above example." +msgstr "" +"Щоб уникнути плутанини між кількома інсталяціями Python (і особливо між " +"системним Python і вашим власно скомпільованим Python), рекомендується " +"використовувати абсолютний шлях до :file:`python{X.Y}-config`, як у прикладі " +"вище." + +msgid "" +"If this procedure doesn't work for you (it is not guaranteed to work for all " +"Unix-like platforms; however, we welcome :ref:`bug reports `) you will have to read your system's documentation about dynamic " +"linking and/or examine Python's :file:`Makefile` (use :func:`sysconfig." +"get_makefile_filename` to find its location) and compilation options. In " +"this case, the :mod:`sysconfig` module is a useful tool to programmatically " +"extract the configuration values that you will want to combine together. " +"For example:" +msgstr "" +"Якщо ця процедура не працює для вас (вона не гарантує роботу для всіх Unix-" +"подібних платформ; однак ми вітаємо :ref:`звіти про помилки `), вам доведеться прочитати документацію вашої системи щодо " +"динамічного зв’язування та/або перевірте :file:`Makefile` Python " +"(використовуйте :func:`sysconfig.get_makefile_filename`, щоб знайти його " +"розташування) і параметри компіляції. У цьому випадку модуль :mod:" +"`sysconfig` є корисним інструментом для програмного вилучення значень " +"конфігурації, які ви хочете об’єднати. Наприклад:" + +msgid "" +">>> import sysconfig\n" +">>> sysconfig.get_config_var('LIBS')\n" +"'-lpthread -ldl -lutil'\n" +">>> sysconfig.get_config_var('LINKFORSHARED')\n" +"'-Xlinker -export-dynamic'" +msgstr "" diff --git a/extending/extending.po b/extending/extending.po new file mode 100644 index 000000000..e417f7673 --- /dev/null +++ b/extending/extending.po @@ -0,0 +1,2203 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:51+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Extending Python with C or C++" +msgstr "Розширення Python за допомогою C або C++" + +msgid "" +"It is quite easy to add new built-in modules to Python, if you know how to " +"program in C. Such :dfn:`extension modules` can do two things that can't be " +"done directly in Python: they can implement new built-in object types, and " +"they can call C library functions and system calls." +msgstr "" +"Доволі легко додати нові вбудовані модулі до Python, якщо ви знаєте, як " +"програмувати на C. Такі :dfn:`extension modules` можуть робити дві речі, які " +"не можна зробити безпосередньо в Python: вони можуть реалізувати нові " +"вбудовані модулі. -in типи об'єктів, і вони можуть викликати функції " +"бібліотеки C і системні виклики." + +msgid "" +"To support extensions, the Python API (Application Programmers Interface) " +"defines a set of functions, macros and variables that provide access to most " +"aspects of the Python run-time system. The Python API is incorporated in a " +"C source file by including the header ``\"Python.h\"``." +msgstr "" +"Для підтримки розширень API Python (інтерфейс прикладного програмування) " +"визначає набір функцій, макросів і змінних, які надають доступ до більшості " +"аспектів системи виконання Python. API Python включено у вихідний файл C " +"шляхом включення заголовка ``\"Python.h\"``." + +msgid "" +"The compilation of an extension module depends on its intended use as well " +"as on your system setup; details are given in later chapters." +msgstr "" +"Компіляція модуля розширення залежить від його цільового використання, а " +"також від налаштування вашої системи; подробиці наведено в наступних " +"розділах." + +msgid "" +"The C extension interface is specific to CPython, and extension modules do " +"not work on other Python implementations. In many cases, it is possible to " +"avoid writing C extensions and preserve portability to other " +"implementations. For example, if your use case is calling C library " +"functions or system calls, you should consider using the :mod:`ctypes` " +"module or the `cffi `_ library rather than " +"writing custom C code. These modules let you write Python code to interface " +"with C code and are more portable between implementations of Python than " +"writing and compiling a C extension module." +msgstr "" +"Інтерфейс розширення C є специфічним для CPython, а модулі розширення не " +"працюють в інших реалізаціях Python. У багатьох випадках можна уникнути " +"написання розширень C і зберегти переносимість на інші реалізації. " +"Наприклад, якщо ви використовуєте виклик функцій бібліотеки C або системних " +"викликів, вам слід розглянути можливість використання модуля :mod:`ctypes` " +"або бібліотеки `cffi `_ замість написання " +"спеціального коду C. Ці модулі дозволяють писати код Python для взаємодії з " +"кодом C і є більш переносимими між реалізаціями Python, ніж написання та " +"компіляція модуля розширення C." + +msgid "A Simple Example" +msgstr "Простий приклад" + +msgid "" +"Let's create an extension module called ``spam`` (the favorite food of Monty " +"Python fans...) and let's say we want to create a Python interface to the C " +"library function :c:func:`system` [#]_. This function takes a null-" +"terminated character string as argument and returns an integer. We want " +"this function to be callable from Python as follows:" +msgstr "" +"Давайте створимо модуль розширення під назвою ``spam`` (улюблена їжа " +"шанувальників Monty Python...) і, скажімо, ми хочемо створити інтерфейс " +"Python для функції бібліотеки C :c:func:`system` [#]_ . Ця функція приймає " +"рядок символів із нулем у кінці як аргумент і повертає ціле число. Ми " +"хочемо, щоб цю функцію можна було викликати з Python наступним чином:" + +msgid "" +">>> import spam\n" +">>> status = spam.system(\"ls -l\")" +msgstr "" + +msgid "" +"Begin by creating a file :file:`spammodule.c`. (Historically, if a module " +"is called ``spam``, the C file containing its implementation is called :file:" +"`spammodule.c`; if the module name is very long, like ``spammify``, the " +"module name can be just :file:`spammify.c`.)" +msgstr "" +"Почніть із створення файлу :file:`spammodule.c`. (Історично склалося так, що " +"якщо модуль називається ``спам``, файл C, що містить його реалізацію, " +"називається :file:`spammodule.c`; якщо назва модуля дуже довга, наприклад " +"``spammify``, назва модуля може бути просто :file:`spammify.c`.)" + +msgid "The first two lines of our file can be::" +msgstr "Перші два рядки нашого файлу можуть бути:" + +msgid "" +"#define PY_SSIZE_T_CLEAN\n" +"#include " +msgstr "" + +msgid "" +"which pulls in the Python API (you can add a comment describing the purpose " +"of the module and a copyright notice if you like)." +msgstr "" +"який залучає API Python (ви можете додати коментар із описом призначення " +"модуля та повідомлення про авторські права, якщо хочете)." + +msgid "" +"Since Python may define some pre-processor definitions which affect the " +"standard headers on some systems, you *must* include :file:`Python.h` before " +"any standard headers are included." +msgstr "" +"Оскільки Python може визначати деякі визначення попереднього процесора, які " +"впливають на стандартні заголовки в деяких системах, ви *мусите* включити :" +"file:`Python.h` перед тим, як включити будь-які стандартні заголовки." + +msgid "" +"``#define PY_SSIZE_T_CLEAN`` was used to indicate that ``Py_ssize_t`` should " +"be used in some APIs instead of ``int``. It is not necessary since Python " +"3.13, but we keep it here for backward compatibility. See :ref:`arg-parsing-" +"string-and-buffers` for a description of this macro." +msgstr "" + +msgid "" +"All user-visible symbols defined by :file:`Python.h` have a prefix of ``Py`` " +"or ``PY``, except those defined in standard header files. For convenience, " +"and since they are used extensively by the Python interpreter, ``\"Python." +"h\"`` includes a few standard header files: ````, ````, " +"````, and ````. If the latter header file does not exist " +"on your system, it declares the functions :c:func:`malloc`, :c:func:`free` " +"and :c:func:`realloc` directly." +msgstr "" +"Усі видимі користувачем символи, визначені :file:`Python.h`, мають префікс " +"``Py`` або ``PY``, за винятком тих, що визначені у стандартних файлах " +"заголовків. Для зручності та оскільки вони широко використовуються " +"інтерпретатором Python, ``\"Python.h\"`` містить кілька стандартних файлів " +"заголовків: ````, ````, ````, і ````. " +"Якщо останнього файлу заголовка не існує у вашій системі, він безпосередньо " +"оголошує функції :c:func:`malloc`, :c:func:`free` і :c:func:`realloc`." + +msgid "" +"The next thing we add to our module file is the C function that will be " +"called when the Python expression ``spam.system(string)`` is evaluated " +"(we'll see shortly how it ends up being called)::" +msgstr "" +"Наступне, що ми додаємо до нашого файлу модуля, це функція C, яка буде " +"викликана, коли буде обчислено вираз Python ``spam.system(string)`` " +"(незабаром ми побачимо, як вона буде викликана):" + +msgid "" +"static PyObject *\n" +"spam_system(PyObject *self, PyObject *args)\n" +"{\n" +" const char *command;\n" +" int sts;\n" +"\n" +" if (!PyArg_ParseTuple(args, \"s\", &command))\n" +" return NULL;\n" +" sts = system(command);\n" +" return PyLong_FromLong(sts);\n" +"}" +msgstr "" + +msgid "" +"There is a straightforward translation from the argument list in Python (for " +"example, the single expression ``\"ls -l\"``) to the arguments passed to the " +"C function. The C function always has two arguments, conventionally named " +"*self* and *args*." +msgstr "" +"Існує прямий переклад зі списку аргументів у Python (наприклад, один вираз " +"``\"ls -l\"``) в аргументи, передані функції C. Функція C завжди має два " +"аргументи, умовно названі *self* і *args*." + +msgid "" +"The *self* argument points to the module object for module-level functions; " +"for a method it would point to the object instance." +msgstr "" +"Аргумент *self* вказує на об’єкт модуля для функцій рівня модуля; для методу " +"він вказував би на екземпляр об’єкта." + +msgid "" +"The *args* argument will be a pointer to a Python tuple object containing " +"the arguments. Each item of the tuple corresponds to an argument in the " +"call's argument list. The arguments are Python objects --- in order to do " +"anything with them in our C function we have to convert them to C values. " +"The function :c:func:`PyArg_ParseTuple` in the Python API checks the " +"argument types and converts them to C values. It uses a template string to " +"determine the required types of the arguments as well as the types of the C " +"variables into which to store the converted values. More about this later." +msgstr "" +"Аргумент *args* буде вказівником на об’єкт кортежу Python, що містить " +"аргументи. Кожен елемент кортежу відповідає аргументу в списку аргументів " +"виклику. Аргументи є об’єктами Python --- щоб щось робити з ними в нашій " +"функції C, ми повинні перетворити їх на значення C. Функція :c:func:" +"`PyArg_ParseTuple` в API Python перевіряє типи аргументів і перетворює їх на " +"значення C. Він використовує рядок шаблону для визначення необхідних типів " +"аргументів, а також типів змінних C, у яких зберігатимуться перетворені " +"значення. Про це пізніше." + +msgid "" +":c:func:`PyArg_ParseTuple` returns true (nonzero) if all arguments have the " +"right type and its components have been stored in the variables whose " +"addresses are passed. It returns false (zero) if an invalid argument list " +"was passed. In the latter case it also raises an appropriate exception so " +"the calling function can return ``NULL`` immediately (as we saw in the " +"example)." +msgstr "" +":c:func:`PyArg_ParseTuple` повертає істину (не нуль), якщо всі аргументи " +"мають правильний тип і його компоненти зберігаються в змінних, адреси яких " +"передано. Він повертає false (нуль), якщо було передано недійсний список " +"аргументів. В останньому випадку він також викликає відповідний виняток, щоб " +"функція, що викликає, могла негайно повернути ``NULL`` (як ми бачили в " +"прикладі)." + +msgid "Intermezzo: Errors and Exceptions" +msgstr "Intermezzo: помилки та винятки" + +msgid "" +"An important convention throughout the Python interpreter is the following: " +"when a function fails, it should set an exception condition and return an " +"error value (usually ``-1`` or a ``NULL`` pointer). Exception information " +"is stored in three members of the interpreter's thread state. These are " +"``NULL`` if there is no exception. Otherwise they are the C equivalents of " +"the members of the Python tuple returned by :meth:`sys.exc_info`. These are " +"the exception type, exception instance, and a traceback object. It is " +"important to know about them to understand how errors are passed around." +msgstr "" +"Важлива конвенція в інтерпретаторі Python полягає в наступному: коли функція " +"виходить з ладу, вона повинна встановити умову винятку та повернути значення " +"помилки (зазвичай ``-1`` або ``NULL`` покажчик). Інформація про винятки " +"зберігається в трьох членах стану потоку інтерпретатора. Це ``NULL``, якщо " +"немає винятку. В іншому випадку вони є еквівалентами C членів кортежу " +"Python, які повертає :meth:`sys.exc_info`. Це тип винятку, екземпляр винятку " +"та об’єкт трасування. Важливо знати про них, щоб зрозуміти, як передаються " +"помилки." + +msgid "" +"The Python API defines a number of functions to set various types of " +"exceptions." +msgstr "" +"API Python визначає низку функцій для встановлення різних типів винятків." + +msgid "" +"The most common one is :c:func:`PyErr_SetString`. Its arguments are an " +"exception object and a C string. The exception object is usually a " +"predefined object like :c:data:`PyExc_ZeroDivisionError`. The C string " +"indicates the cause of the error and is converted to a Python string object " +"and stored as the \"associated value\" of the exception." +msgstr "" +"Найпоширенішим є :c:func:`PyErr_SetString`. Його аргументами є об’єкт " +"винятку та рядок C. Об’єкт винятку зазвичай є попередньо визначеним " +"об’єктом, наприклад :c:data:`PyExc_ZeroDivisionError`. Рядок C вказує на " +"причину помилки, перетворюється на об’єкт рядка Python і зберігається як " +"\"пов’язане значення\" винятку." + +msgid "" +"Another useful function is :c:func:`PyErr_SetFromErrno`, which only takes an " +"exception argument and constructs the associated value by inspection of the " +"global variable :c:data:`errno`. The most general function is :c:func:" +"`PyErr_SetObject`, which takes two object arguments, the exception and its " +"associated value. You don't need to :c:func:`Py_INCREF` the objects passed " +"to any of these functions." +msgstr "" +"Іншою корисною функцією є :c:func:`PyErr_SetFromErrno`, яка приймає лише " +"аргумент винятку та створює пов’язане значення шляхом перевірки глобальної " +"змінної :c:data:`errno`. Найбільш загальною функцією є :c:func:" +"`PyErr_SetObject`, яка приймає два аргументи об’єкта, виняток і пов’язане з " +"ним значення. Вам не потрібно :c:func:`Py_INCREF` об’єкти, передані в будь-" +"яку з цих функцій." + +msgid "" +"You can test non-destructively whether an exception has been set with :c:" +"func:`PyErr_Occurred`. This returns the current exception object, or " +"``NULL`` if no exception has occurred. You normally don't need to call :c:" +"func:`PyErr_Occurred` to see whether an error occurred in a function call, " +"since you should be able to tell from the return value." +msgstr "" +"За допомогою :c:func:`PyErr_Occurred` можна неруйнівним чином перевірити, чи " +"встановлено виняток. Це повертає поточний об’єкт винятку або ``NULL``, якщо " +"винятку не сталося. Зазвичай вам не потрібно викликати :c:func:" +"`PyErr_Occurred`, щоб перевірити, чи сталася помилка під час виклику " +"функції, оскільки ви зможете визначити це за значенням, що повертається." + +msgid "" +"When a function *f* that calls another function *g* detects that the latter " +"fails, *f* should itself return an error value (usually ``NULL`` or " +"``-1``). It should *not* call one of the ``PyErr_*`` functions --- one has " +"already been called by *g*. *f*'s caller is then supposed to also return an " +"error indication to *its* caller, again *without* calling ``PyErr_*``, and " +"so on --- the most detailed cause of the error was already reported by the " +"function that first detected it. Once the error reaches the Python " +"interpreter's main loop, this aborts the currently executing Python code and " +"tries to find an exception handler specified by the Python programmer." +msgstr "" + +msgid "" +"(There are situations where a module can actually give a more detailed error " +"message by calling another ``PyErr_*`` function, and in such cases it is " +"fine to do so. As a general rule, however, this is not necessary, and can " +"cause information about the cause of the error to be lost: most operations " +"can fail for a variety of reasons.)" +msgstr "" + +msgid "" +"To ignore an exception set by a function call that failed, the exception " +"condition must be cleared explicitly by calling :c:func:`PyErr_Clear`. The " +"only time C code should call :c:func:`PyErr_Clear` is if it doesn't want to " +"pass the error on to the interpreter but wants to handle it completely by " +"itself (possibly by trying something else, or pretending nothing went wrong)." +msgstr "" +"Щоб проігнорувати виняток, встановлений невдалим викликом функції, умову " +"виключення потрібно явно очистити, викликавши :c:func:`PyErr_Clear`. Єдиний " +"раз, коли C-код повинен викликати :c:func:`PyErr_Clear`, це якщо він не хоче " +"передавати помилку інтерпретатору, а хоче обробити її повністю сам (можливо, " +"спробувавши щось інше або вдаючи, що нічого не пішло не так). )." + +msgid "" +"Every failing :c:func:`malloc` call must be turned into an exception --- the " +"direct caller of :c:func:`malloc` (or :c:func:`realloc`) must call :c:func:" +"`PyErr_NoMemory` and return a failure indicator itself. All the object-" +"creating functions (for example, :c:func:`PyLong_FromLong`) already do this, " +"so this note is only relevant to those who call :c:func:`malloc` directly." +msgstr "" +"Кожен невдалий виклик :c:func:`malloc` має бути перетворений на виняток --- " +"прямий виклик :c:func:`malloc` (або :c:func:`realloc`) повинен викликати :c:" +"func:`PyErr_NoMemory` і повертає сам індикатор помилки. Усі функції " +"створення об’єктів (наприклад, :c:func:`PyLong_FromLong`) уже це роблять, " +"тому ця примітка актуальна лише для тих, хто викликає :c:func:`malloc` " +"безпосередньо." + +msgid "" +"Also note that, with the important exception of :c:func:`PyArg_ParseTuple` " +"and friends, functions that return an integer status usually return a " +"positive value or zero for success and ``-1`` for failure, like Unix system " +"calls." +msgstr "" +"Також зауважте, що, за винятком :c:func:`PyArg_ParseTuple` та друзів, " +"функції, які повертають цілочисельний статус, зазвичай повертають додатне " +"значення або нуль у разі успіху та ``-1`` у разі невдачі, як системні " +"виклики Unix." + +msgid "" +"Finally, be careful to clean up garbage (by making :c:func:`Py_XDECREF` or :" +"c:func:`Py_DECREF` calls for objects you have already created) when you " +"return an error indicator!" +msgstr "" +"Нарешті, будьте обережні, щоб очистити сміття (за допомогою викликів :c:func:" +"`Py_XDECREF` або :c:func:`Py_DECREF` для об’єктів, які ви вже створили), " +"коли ви повертаєте індикатор помилки!" + +msgid "" +"The choice of which exception to raise is entirely yours. There are " +"predeclared C objects corresponding to all built-in Python exceptions, such " +"as :c:data:`PyExc_ZeroDivisionError`, which you can use directly. Of course, " +"you should choose exceptions wisely --- don't use :c:data:`PyExc_TypeError` " +"to mean that a file couldn't be opened (that should probably be :c:data:" +"`PyExc_OSError`). If something's wrong with the argument list, the :c:func:" +"`PyArg_ParseTuple` function usually raises :c:data:`PyExc_TypeError`. If " +"you have an argument whose value must be in a particular range or must " +"satisfy other conditions, :c:data:`PyExc_ValueError` is appropriate." +msgstr "" + +msgid "" +"You can also define a new exception that is unique to your module. For this, " +"you usually declare a static object variable at the beginning of your file::" +msgstr "" +"Ви також можете визначити новий виняток, унікальний для вашого модуля. Для " +"цього ви зазвичай оголошуєте змінну статичного об’єкта на початку вашого " +"файлу::" + +msgid "static PyObject *SpamError;" +msgstr "" + +msgid "" +"and initialize it in your module's initialization function (:c:func:`!" +"PyInit_spam`) with an exception object::" +msgstr "" + +msgid "" +"PyMODINIT_FUNC\n" +"PyInit_spam(void)\n" +"{\n" +" PyObject *m;\n" +"\n" +" m = PyModule_Create(&spammodule);\n" +" if (m == NULL)\n" +" return NULL;\n" +"\n" +" SpamError = PyErr_NewException(\"spam.error\", NULL, NULL);\n" +" if (PyModule_AddObjectRef(m, \"error\", SpamError) < 0) {\n" +" Py_CLEAR(SpamError);\n" +" Py_DECREF(m);\n" +" return NULL;\n" +" }\n" +"\n" +" return m;\n" +"}" +msgstr "" + +msgid "" +"Note that the Python name for the exception object is :exc:`!spam.error`. " +"The :c:func:`PyErr_NewException` function may create a class with the base " +"class being :exc:`Exception` (unless another class is passed in instead of " +"``NULL``), described in :ref:`bltin-exceptions`." +msgstr "" + +msgid "" +"Note also that the :c:data:`!SpamError` variable retains a reference to the " +"newly created exception class; this is intentional! Since the exception " +"could be removed from the module by external code, an owned reference to the " +"class is needed to ensure that it will not be discarded, causing :c:data:`!" +"SpamError` to become a dangling pointer. Should it become a dangling " +"pointer, C code which raises the exception could cause a core dump or other " +"unintended side effects." +msgstr "" + +msgid "" +"We discuss the use of :c:macro:`PyMODINIT_FUNC` as a function return type " +"later in this sample." +msgstr "" + +msgid "" +"The :exc:`!spam.error` exception can be raised in your extension module " +"using a call to :c:func:`PyErr_SetString` as shown below::" +msgstr "" + +msgid "" +"static PyObject *\n" +"spam_system(PyObject *self, PyObject *args)\n" +"{\n" +" const char *command;\n" +" int sts;\n" +"\n" +" if (!PyArg_ParseTuple(args, \"s\", &command))\n" +" return NULL;\n" +" sts = system(command);\n" +" if (sts < 0) {\n" +" PyErr_SetString(SpamError, \"System command failed\");\n" +" return NULL;\n" +" }\n" +" return PyLong_FromLong(sts);\n" +"}" +msgstr "" + +msgid "Back to the Example" +msgstr "Повернемося до прикладу" + +msgid "" +"Going back to our example function, you should now be able to understand " +"this statement::" +msgstr "" +"Повертаючись до нашого прикладу функції, тепер ви зможете зрозуміти цей " +"оператор:" + +msgid "" +"if (!PyArg_ParseTuple(args, \"s\", &command))\n" +" return NULL;" +msgstr "" + +msgid "" +"It returns ``NULL`` (the error indicator for functions returning object " +"pointers) if an error is detected in the argument list, relying on the " +"exception set by :c:func:`PyArg_ParseTuple`. Otherwise the string value of " +"the argument has been copied to the local variable :c:data:`!command`. This " +"is a pointer assignment and you are not supposed to modify the string to " +"which it points (so in Standard C, the variable :c:data:`!command` should " +"properly be declared as ``const char *command``)." +msgstr "" + +msgid "" +"The next statement is a call to the Unix function :c:func:`system`, passing " +"it the string we just got from :c:func:`PyArg_ParseTuple`::" +msgstr "" +"Наступний оператор — це виклик функції Unix :c:func:`system`, передаючи їй " +"рядок, який ми щойно отримали з :c:func:`PyArg_ParseTuple`::" + +msgid "sts = system(command);" +msgstr "" + +msgid "" +"Our :func:`!spam.system` function must return the value of :c:data:`!sts` as " +"a Python object. This is done using the function :c:func:" +"`PyLong_FromLong`. ::" +msgstr "" + +msgid "return PyLong_FromLong(sts);" +msgstr "" + +msgid "" +"In this case, it will return an integer object. (Yes, even integers are " +"objects on the heap in Python!)" +msgstr "" +"У цьому випадку він поверне цілочисельний об’єкт. (Так, навіть цілі числа є " +"об’єктами в купі в Python!)" + +msgid "" +"If you have a C function that returns no useful argument (a function " +"returning :c:expr:`void`), the corresponding Python function must return " +"``None``. You need this idiom to do so (which is implemented by the :c:" +"macro:`Py_RETURN_NONE` macro)::" +msgstr "" + +msgid "" +"Py_INCREF(Py_None);\n" +"return Py_None;" +msgstr "" + +msgid "" +":c:data:`Py_None` is the C name for the special Python object ``None``. It " +"is a genuine Python object rather than a ``NULL`` pointer, which means " +"\"error\" in most contexts, as we have seen." +msgstr "" +":c:data:`Py_None` — це ім’я C для спеціального об’єкта Python ``None``. Це " +"справжній об’єкт Python, а не покажчик ``NULL``, що означає \"помилку\" в " +"більшості контекстів, як ми бачили." + +msgid "The Module's Method Table and Initialization Function" +msgstr "Таблиця методів модуля та функція ініціалізації" + +msgid "" +"I promised to show how :c:func:`!spam_system` is called from Python " +"programs. First, we need to list its name and address in a \"method table\"::" +msgstr "" + +msgid "" +"static PyMethodDef SpamMethods[] = {\n" +" ...\n" +" {\"system\", spam_system, METH_VARARGS,\n" +" \"Execute a shell command.\"},\n" +" ...\n" +" {NULL, NULL, 0, NULL} /* Sentinel */\n" +"};" +msgstr "" + +msgid "" +"Note the third entry (``METH_VARARGS``). This is a flag telling the " +"interpreter the calling convention to be used for the C function. It should " +"normally always be ``METH_VARARGS`` or ``METH_VARARGS | METH_KEYWORDS``; a " +"value of ``0`` means that an obsolete variant of :c:func:`PyArg_ParseTuple` " +"is used." +msgstr "" +"Зверніть увагу на третій запис (``METH_VARARGS``). Це прапорець, який " +"повідомляє інтерпретатору умову виклику, яка буде використовуватися для " +"функції C. Зазвичай це завжди має бути ``METH_VARARGS`` або ``METH_VARARGS | " +"METH_KEYWORDS``; значення ``0`` означає, що використовується застарілий " +"варіант :c:func:`PyArg_ParseTuple`." + +msgid "" +"When using only ``METH_VARARGS``, the function should expect the Python-" +"level parameters to be passed in as a tuple acceptable for parsing via :c:" +"func:`PyArg_ParseTuple`; more information on this function is provided below." +msgstr "" +"Якщо використовується лише ``METH_VARARGS``, функція повинна очікувати, що " +"параметри рівня Python будуть передані як кортеж, прийнятний для аналізу " +"через :c:func:`PyArg_ParseTuple`; більше інформації про цю функцію наведено " +"нижче." + +msgid "" +"The :c:macro:`METH_KEYWORDS` bit may be set in the third field if keyword " +"arguments should be passed to the function. In this case, the C function " +"should accept a third ``PyObject *`` parameter which will be a dictionary of " +"keywords. Use :c:func:`PyArg_ParseTupleAndKeywords` to parse the arguments " +"to such a function." +msgstr "" + +msgid "" +"The method table must be referenced in the module definition structure::" +msgstr "На таблицю методів має бути посилання в структурі визначення модуля:" + +msgid "" +"static struct PyModuleDef spammodule = {\n" +" PyModuleDef_HEAD_INIT,\n" +" \"spam\", /* name of module */\n" +" spam_doc, /* module documentation, may be NULL */\n" +" -1, /* size of per-interpreter state of the module,\n" +" or -1 if the module keeps state in global variables. */\n" +" SpamMethods\n" +"};" +msgstr "" + +msgid "" +"This structure, in turn, must be passed to the interpreter in the module's " +"initialization function. The initialization function must be named :c:func:" +"`!PyInit_name`, where *name* is the name of the module, and should be the " +"only non-\\ ``static`` item defined in the module file::" +msgstr "" + +msgid "" +"PyMODINIT_FUNC\n" +"PyInit_spam(void)\n" +"{\n" +" return PyModule_Create(&spammodule);\n" +"}" +msgstr "" + +msgid "" +"Note that :c:macro:`PyMODINIT_FUNC` declares the function as ``PyObject *`` " +"return type, declares any special linkage declarations required by the " +"platform, and for C++ declares the function as ``extern \"C\"``." +msgstr "" + +msgid "" +"When the Python program imports module :mod:`!spam` for the first time, :c:" +"func:`!PyInit_spam` is called. (See below for comments about embedding " +"Python.) It calls :c:func:`PyModule_Create`, which returns a module object, " +"and inserts built-in function objects into the newly created module based " +"upon the table (an array of :c:type:`PyMethodDef` structures) found in the " +"module definition. :c:func:`PyModule_Create` returns a pointer to the module " +"object that it creates. It may abort with a fatal error for certain errors, " +"or return ``NULL`` if the module could not be initialized satisfactorily. " +"The init function must return the module object to its caller, so that it " +"then gets inserted into ``sys.modules``." +msgstr "" + +msgid "" +"When embedding Python, the :c:func:`!PyInit_spam` function is not called " +"automatically unless there's an entry in the :c:data:`PyImport_Inittab` " +"table. To add the module to the initialization table, use :c:func:" +"`PyImport_AppendInittab`, optionally followed by an import of the module::" +msgstr "" + +msgid "" +"#define PY_SSIZE_T_CLEAN\n" +"#include \n" +"\n" +"int\n" +"main(int argc, char *argv[])\n" +"{\n" +" PyStatus status;\n" +" PyConfig config;\n" +" PyConfig_InitPythonConfig(&config);\n" +"\n" +" /* Add a built-in module, before Py_Initialize */\n" +" if (PyImport_AppendInittab(\"spam\", PyInit_spam) == -1) {\n" +" fprintf(stderr, \"Error: could not extend in-built modules " +"table\\n\");\n" +" exit(1);\n" +" }\n" +"\n" +" /* Pass argv[0] to the Python interpreter */\n" +" status = PyConfig_SetBytesString(&config, &config.program_name, " +"argv[0]);\n" +" if (PyStatus_Exception(status)) {\n" +" goto exception;\n" +" }\n" +"\n" +" /* Initialize the Python interpreter. Required.\n" +" If this step fails, it will be a fatal error. */\n" +" status = Py_InitializeFromConfig(&config);\n" +" if (PyStatus_Exception(status)) {\n" +" goto exception;\n" +" }\n" +" PyConfig_Clear(&config);\n" +"\n" +" /* Optionally import the module; alternatively,\n" +" import can be deferred until the embedded script\n" +" imports it. */\n" +" PyObject *pmodule = PyImport_ImportModule(\"spam\");\n" +" if (!pmodule) {\n" +" PyErr_Print();\n" +" fprintf(stderr, \"Error: could not import module 'spam'\\n\");\n" +" }\n" +"\n" +" // ... use Python C API here ...\n" +"\n" +" return 0;\n" +"\n" +" exception:\n" +" PyConfig_Clear(&config);\n" +" Py_ExitStatusException(status);\n" +"}" +msgstr "" + +msgid "" +"Removing entries from ``sys.modules`` or importing compiled modules into " +"multiple interpreters within a process (or following a :c:func:`fork` " +"without an intervening :c:func:`exec`) can create problems for some " +"extension modules. Extension module authors should exercise caution when " +"initializing internal data structures." +msgstr "" +"Видалення записів із ``sys.modules`` або імпортування скомпільованих модулів " +"у кілька інтерпретаторів у межах процесу (або виконання :c:func:`fork` без " +"втручання :c:func:`exec`) може створити проблеми для деяких розширень " +"модулі. Авторам модулів розширення слід бути обережними під час " +"ініціалізації внутрішніх структур даних." + +msgid "" +"A more substantial example module is included in the Python source " +"distribution as :file:`Modules/xxmodule.c`. This file may be used as a " +"template or simply read as an example." +msgstr "" +"Більш суттєвий приклад модуля включено в вихідний код Python як :file:" +"`Modules/xxmodule.c`. Цей файл можна використовувати як шаблон або просто " +"прочитати як приклад." + +msgid "" +"Unlike our ``spam`` example, ``xxmodule`` uses *multi-phase initialization* " +"(new in Python 3.5), where a PyModuleDef structure is returned from " +"``PyInit_spam``, and creation of the module is left to the import machinery. " +"For details on multi-phase initialization, see :PEP:`489`." +msgstr "" +"На відміну від нашого прикладу ``спаму``, ``xxmodule`` використовує " +"*багатофазову ініціалізацію* (нове в Python 3.5), де структура PyModuleDef " +"повертається з ``PyInit_spam``, а створення модуля залишається за імпортне " +"обладнання. Докладніше про багатофазову ініціалізацію див. :PEP:`489`." + +msgid "Compilation and Linkage" +msgstr "Компіляція та зв'язування" + +msgid "" +"There are two more things to do before you can use your new extension: " +"compiling and linking it with the Python system. If you use dynamic " +"loading, the details may depend on the style of dynamic loading your system " +"uses; see the chapters about building extension modules (chapter :ref:" +"`building`) and additional information that pertains only to building on " +"Windows (chapter :ref:`building-on-windows`) for more information about this." +msgstr "" +"Перш ніж використовувати нове розширення, потрібно зробити ще дві речі: " +"скомпілювати та зв’язати його з системою Python. Якщо ви використовуєте " +"динамічне завантаження, деталі можуть залежати від стилю динамічного " +"завантаження, який використовує ваша система; дивіться розділи про створення " +"модулів розширення (глава :ref:`building`) та додаткову інформацію, яка " +"стосується лише збірки на Windows (глава :ref:`building-on-windows`), щоб " +"отримати додаткові відомості про це." + +msgid "" +"If you can't use dynamic loading, or if you want to make your module a " +"permanent part of the Python interpreter, you will have to change the " +"configuration setup and rebuild the interpreter. Luckily, this is very " +"simple on Unix: just place your file (:file:`spammodule.c` for example) in " +"the :file:`Modules/` directory of an unpacked source distribution, add a " +"line to the file :file:`Modules/Setup.local` describing your file:" +msgstr "" +"Якщо ви не можете використовувати динамічне завантаження або якщо ви хочете " +"зробити свій модуль постійною частиною інтерпретатора Python, вам доведеться " +"змінити налаштування конфігурації та перебудувати інтерпретатор. На щастя, в " +"Unix це дуже просто: просто розмістіть свій файл (наприклад, :file:" +"`spammodule.c`) у каталозі :file:`Modules/` розпакованого вихідного " +"дистрибутива, додайте рядок до файлу :file:`Modules/Setup.local`, що описує " +"ваш файл:" + +msgid "spam spammodule.o" +msgstr "" + +msgid "" +"and rebuild the interpreter by running :program:`make` in the toplevel " +"directory. You can also run :program:`make` in the :file:`Modules/` " +"subdirectory, but then you must first rebuild :file:`Makefile` there by " +"running ':program:`make` Makefile'. (This is necessary each time you change " +"the :file:`Setup` file.)" +msgstr "" +"і перебудуйте інтерпретатор, запустивши :program:`make` у каталозі верхнього " +"рівня. Ви також можете запустити :program:`make` у підкаталозі :file:" +"`Modules/`, але тоді ви повинні спочатку перебудувати :file:`Makefile` там, " +"запустивши ':program:`make` Makefile'. (Це необхідно щоразу, коли ви " +"змінюєте файл :file:`Setup`.)" + +msgid "" +"If your module requires additional libraries to link with, these can be " +"listed on the line in the configuration file as well, for instance:" +msgstr "" +"Якщо вашому модулю потрібні додаткові бібліотеки для зв’язування, їх також " +"можна вказати в рядку у файлі конфігурації, наприклад:" + +msgid "spam spammodule.o -lX11" +msgstr "" + +msgid "Calling Python Functions from C" +msgstr "Виклик функцій Python із C" + +msgid "" +"So far we have concentrated on making C functions callable from Python. The " +"reverse is also useful: calling Python functions from C. This is especially " +"the case for libraries that support so-called \"callback\" functions. If a " +"C interface makes use of callbacks, the equivalent Python often needs to " +"provide a callback mechanism to the Python programmer; the implementation " +"will require calling the Python callback functions from a C callback. Other " +"uses are also imaginable." +msgstr "" +"Поки що ми зосереджувалися на тому, щоб зробити функції C викликаними з " +"Python. Корисним є і зворотний шлях: виклик функцій Python із C. Особливо це " +"стосується бібліотек, які підтримують так звані функції \"зворотного " +"виклику\". Якщо інтерфейс C використовує зворотні виклики, еквівалентний " +"Python часто потребує надання механізму зворотного виклику для програміста " +"Python; реалізація вимагатиме виклику функцій зворотного виклику Python із " +"зворотного виклику C. Можна уявити й інші способи використання." + +msgid "" +"Fortunately, the Python interpreter is easily called recursively, and there " +"is a standard interface to call a Python function. (I won't dwell on how to " +"call the Python parser with a particular string as input --- if you're " +"interested, have a look at the implementation of the :option:`-c` command " +"line option in :file:`Modules/main.c` from the Python source code.)" +msgstr "" +"На щастя, інтерпретатор Python легко викликати рекурсивно, і існує " +"стандартний інтерфейс для виклику функції Python. (Я не буду зупинятися на " +"тому, як викликати синтаксичний аналізатор Python за допомогою певного рядка " +"як вхідних даних --- якщо вам цікаво, подивіться на реалізацію параметра " +"командного рядка :option:`-c` у :file:`Modules/main.c` з вихідного коду " +"Python.)" + +msgid "" +"Calling a Python function is easy. First, the Python program must somehow " +"pass you the Python function object. You should provide a function (or some " +"other interface) to do this. When this function is called, save a pointer " +"to the Python function object (be careful to :c:func:`Py_INCREF` it!) in a " +"global variable --- or wherever you see fit. For example, the following " +"function might be part of a module definition::" +msgstr "" +"Викликати функцію Python легко. По-перше, програма Python повинна якимось " +"чином передати вам об’єкт функції Python. Ви повинні надати функцію (або " +"інший інтерфейс), щоб це зробити. Під час виклику цієї функції збережіть " +"вказівник на об’єкт функції Python (будьте обережні, щоб :c:func:`Py_INCREF` " +"це!) у глобальній змінній --- або будь-де, де ви вважаєте за потрібне. " +"Наприклад, наступна функція може бути частиною визначення модуля:" + +msgid "" +"static PyObject *my_callback = NULL;\n" +"\n" +"static PyObject *\n" +"my_set_callback(PyObject *dummy, PyObject *args)\n" +"{\n" +" PyObject *result = NULL;\n" +" PyObject *temp;\n" +"\n" +" if (PyArg_ParseTuple(args, \"O:set_callback\", &temp)) {\n" +" if (!PyCallable_Check(temp)) {\n" +" PyErr_SetString(PyExc_TypeError, \"parameter must be " +"callable\");\n" +" return NULL;\n" +" }\n" +" Py_XINCREF(temp); /* Add a reference to new callback */\n" +" Py_XDECREF(my_callback); /* Dispose of previous callback */\n" +" my_callback = temp; /* Remember new callback */\n" +" /* Boilerplate to return \"None\" */\n" +" Py_INCREF(Py_None);\n" +" result = Py_None;\n" +" }\n" +" return result;\n" +"}" +msgstr "" + +msgid "" +"This function must be registered with the interpreter using the :c:macro:" +"`METH_VARARGS` flag; this is described in section :ref:`methodtable`. The :" +"c:func:`PyArg_ParseTuple` function and its arguments are documented in " +"section :ref:`parsetuple`." +msgstr "" + +msgid "" +"The macros :c:func:`Py_XINCREF` and :c:func:`Py_XDECREF` increment/decrement " +"the reference count of an object and are safe in the presence of ``NULL`` " +"pointers (but note that *temp* will not be ``NULL`` in this context). More " +"info on them in section :ref:`refcounts`." +msgstr "" +"Макроси :c:func:`Py_XINCREF` і :c:func:`Py_XDECREF` збільшують/зменшують " +"кількість посилань на об’єкт і безпечні за наявності покажчиків ``NULL`` " +"(але зауважте, що *temp* не буде бути ``NULL`` у цьому контексті). " +"Детальніше про них у розділі :ref:`refcounts`." + +msgid "" +"Later, when it is time to call the function, you call the C function :c:func:" +"`PyObject_CallObject`. This function has two arguments, both pointers to " +"arbitrary Python objects: the Python function, and the argument list. The " +"argument list must always be a tuple object, whose length is the number of " +"arguments. To call the Python function with no arguments, pass in ``NULL``, " +"or an empty tuple; to call it with one argument, pass a singleton tuple. :c:" +"func:`Py_BuildValue` returns a tuple when its format string consists of zero " +"or more format codes between parentheses. For example::" +msgstr "" +"Пізніше, коли прийде час викликати функцію, ви викликаєте функцію C :c:func:" +"`PyObject_CallObject`. Ця функція має два аргументи, обидва вказують на " +"довільні об’єкти Python: функція Python і список аргументів. Список " +"аргументів завжди має бути об’єктом кортежу, довжина якого дорівнює " +"кількості аргументів. Щоб викликати функцію Python без аргументів, передайте " +"``NULL`` або пустий кортеж; щоб викликати його з одним аргументом, передайте " +"одиночний кортеж. :c:func:`Py_BuildValue` повертає кортеж, якщо його рядок " +"формату складається з нуля або більше кодів формату в дужках. Наприклад::" + +msgid "" +"int arg;\n" +"PyObject *arglist;\n" +"PyObject *result;\n" +"...\n" +"arg = 123;\n" +"...\n" +"/* Time to call the callback */\n" +"arglist = Py_BuildValue(\"(i)\", arg);\n" +"result = PyObject_CallObject(my_callback, arglist);\n" +"Py_DECREF(arglist);" +msgstr "" + +msgid "" +":c:func:`PyObject_CallObject` returns a Python object pointer: this is the " +"return value of the Python function. :c:func:`PyObject_CallObject` is " +"\"reference-count-neutral\" with respect to its arguments. In the example a " +"new tuple was created to serve as the argument list, which is :c:func:" +"`Py_DECREF`\\ -ed immediately after the :c:func:`PyObject_CallObject` call." +msgstr "" +":c:func:`PyObject_CallObject` повертає покажчик на об’єкт Python: це " +"значення, яке повертає функція Python. :c:func:`PyObject_CallObject` є " +"\"нейтральним щодо кількості посилань\" щодо своїх аргументів. У прикладі " +"було створено новий кортеж, який слугуватиме списком аргументів, який :c:" +"func:`Py_DECREF`\\ -редагується відразу після виклику :c:func:" +"`PyObject_CallObject`." + +msgid "" +"The return value of :c:func:`PyObject_CallObject` is \"new\": either it is a " +"brand new object, or it is an existing object whose reference count has been " +"incremented. So, unless you want to save it in a global variable, you " +"should somehow :c:func:`Py_DECREF` the result, even (especially!) if you are " +"not interested in its value." +msgstr "" +"Значення, що повертається :c:func:`PyObject_CallObject`, є \"новим\": або це " +"абсолютно новий об’єкт, або це вже існуючий об’єкт, кількість посилань на " +"який було збільшено. Отже, якщо ви не хочете зберегти його в глобальній " +"змінній, ви повинні якимось чином :c:func:`Py_DECREF` результат, навіть " +"(особливо!), якщо вас не цікавить його значення." + +msgid "" +"Before you do this, however, it is important to check that the return value " +"isn't ``NULL``. If it is, the Python function terminated by raising an " +"exception. If the C code that called :c:func:`PyObject_CallObject` is called " +"from Python, it should now return an error indication to its Python caller, " +"so the interpreter can print a stack trace, or the calling Python code can " +"handle the exception. If this is not possible or desirable, the exception " +"should be cleared by calling :c:func:`PyErr_Clear`. For example::" +msgstr "" +"Однак перед тим, як це зробити, важливо переконатися, що значення, що " +"повертається, не ``NULL``. Якщо так, функція Python припиняється, викликаючи " +"виняток. Якщо код C, який викликав :c:func:`PyObject_CallObject`, " +"викликається з Python, тепер він має повернути вказівку про помилку своєму " +"виклику Python, щоб інтерпретатор міг надрукувати трасування стека, або " +"викликаючий код Python міг обробити виняткову ситуацію. Якщо це неможливо чи " +"бажано, виняток слід очистити, викликавши :c:func:`PyErr_Clear`. Наприклад::" + +msgid "" +"if (result == NULL)\n" +" return NULL; /* Pass error back */\n" +"...use result...\n" +"Py_DECREF(result);" +msgstr "" + +msgid "" +"Depending on the desired interface to the Python callback function, you may " +"also have to provide an argument list to :c:func:`PyObject_CallObject`. In " +"some cases the argument list is also provided by the Python program, through " +"the same interface that specified the callback function. It can then be " +"saved and used in the same manner as the function object. In other cases, " +"you may have to construct a new tuple to pass as the argument list. The " +"simplest way to do this is to call :c:func:`Py_BuildValue`. For example, if " +"you want to pass an integral event code, you might use the following code::" +msgstr "" +"Залежно від бажаного інтерфейсу для функції зворотного виклику Python, вам " +"також може знадобитися надати список аргументів для :c:func:" +"`PyObject_CallObject`. У деяких випадках список аргументів також надається " +"програмою Python через той самий інтерфейс, який вказав функцію зворотного " +"виклику. Потім його можна зберегти та використовувати так само, як і об’єкт " +"функції. В інших випадках вам, можливо, доведеться створити новий кортеж для " +"передачі як списку аргументів. Найпростіший спосіб зробити це — викликати :c:" +"func:`Py_BuildValue`. Наприклад, якщо ви хочете передати інтегральний код " +"події, ви можете використати такий код:" + +msgid "" +"PyObject *arglist;\n" +"...\n" +"arglist = Py_BuildValue(\"(l)\", eventcode);\n" +"result = PyObject_CallObject(my_callback, arglist);\n" +"Py_DECREF(arglist);\n" +"if (result == NULL)\n" +" return NULL; /* Pass error back */\n" +"/* Here maybe use the result */\n" +"Py_DECREF(result);" +msgstr "" + +msgid "" +"Note the placement of ``Py_DECREF(arglist)`` immediately after the call, " +"before the error check! Also note that strictly speaking this code is not " +"complete: :c:func:`Py_BuildValue` may run out of memory, and this should be " +"checked." +msgstr "" +"Зверніть увагу на розміщення ``Py_DECREF(arglist)`` одразу після виклику, " +"перед перевіркою помилок! Також зауважте, що строго кажучи, цей код " +"неповний: :c:func:`Py_BuildValue` може не вистачати пам’яті, і це слід " +"перевірити." + +msgid "" +"You may also call a function with keyword arguments by using :c:func:" +"`PyObject_Call`, which supports arguments and keyword arguments. As in the " +"above example, we use :c:func:`Py_BuildValue` to construct the dictionary. ::" +msgstr "" +"Ви також можете викликати функцію з ключовими аргументами за допомогою :c:" +"func:`PyObject_Call`, який підтримує аргументи та ключові аргументи. Як і в " +"наведеному вище прикладі, ми використовуємо :c:func:`Py_BuildValue` для " +"створення словника. ::" + +msgid "" +"PyObject *dict;\n" +"...\n" +"dict = Py_BuildValue(\"{s:i}\", \"name\", val);\n" +"result = PyObject_Call(my_callback, NULL, dict);\n" +"Py_DECREF(dict);\n" +"if (result == NULL)\n" +" return NULL; /* Pass error back */\n" +"/* Here maybe use the result */\n" +"Py_DECREF(result);" +msgstr "" + +msgid "Extracting Parameters in Extension Functions" +msgstr "Вилучення параметрів у функціях розширення" + +msgid "The :c:func:`PyArg_ParseTuple` function is declared as follows::" +msgstr "Функція :c:func:`PyArg_ParseTuple` оголошується таким чином:" + +msgid "int PyArg_ParseTuple(PyObject *arg, const char *format, ...);" +msgstr "" + +msgid "" +"The *arg* argument must be a tuple object containing an argument list passed " +"from Python to a C function. The *format* argument must be a format string, " +"whose syntax is explained in :ref:`arg-parsing` in the Python/C API " +"Reference Manual. The remaining arguments must be addresses of variables " +"whose type is determined by the format string." +msgstr "" +"Аргумент *arg* має бути об’єктом кортежу, що містить список аргументів, " +"переданий з Python до функції C. Аргумент *format* має бути рядком формату, " +"синтаксис якого пояснюється в :ref:`arg-parsing` у довідковому посібнику " +"Python/C API. Решта аргументів мають бути адресами змінних, тип яких " +"визначається рядком формату." + +msgid "" +"Note that while :c:func:`PyArg_ParseTuple` checks that the Python arguments " +"have the required types, it cannot check the validity of the addresses of C " +"variables passed to the call: if you make mistakes there, your code will " +"probably crash or at least overwrite random bits in memory. So be careful!" +msgstr "" +"Зауважте, що хоча :c:func:`PyArg_ParseTuple` перевіряє, чи аргументи Python " +"мають необхідні типи, він не може перевірити дійсність адрес змінних C, " +"переданих до виклику: якщо ви припуститеся там помилки, ваш код, ймовірно, " +"аварійно завершить роботу. найменше перезаписувати випадкові біти в пам'яті. " +"Тому будьте обережні!" + +msgid "" +"Note that any Python object references which are provided to the caller are " +"*borrowed* references; do not decrement their reference count!" +msgstr "" +"Зауважте, що будь-які посилання на об’єкти Python, які надаються абоненту, є " +"*позиченими* посиланнями; не зменшуйте кількість посилань!" + +msgid "Some example calls::" +msgstr "Деякі приклади викликів::" + +msgid "" +"int ok;\n" +"int i, j;\n" +"long k, l;\n" +"const char *s;\n" +"Py_ssize_t size;\n" +"\n" +"ok = PyArg_ParseTuple(args, \"\"); /* No arguments */\n" +" /* Python call: f() */" +msgstr "" + +msgid "" +"ok = PyArg_ParseTuple(args, \"s\", &s); /* A string */\n" +" /* Possible Python call: f('whoops!') */" +msgstr "" + +msgid "" +"ok = PyArg_ParseTuple(args, \"lls\", &k, &l, &s); /* Two longs and a string " +"*/\n" +" /* Possible Python call: f(1, 2, 'three') */" +msgstr "" + +msgid "" +"ok = PyArg_ParseTuple(args, \"(ii)s#\", &i, &j, &s, &size);\n" +" /* A pair of ints and a string, whose size is also returned */\n" +" /* Possible Python call: f((1, 2), 'three') */" +msgstr "" + +msgid "" +"{\n" +" const char *file;\n" +" const char *mode = \"r\";\n" +" int bufsize = 0;\n" +" ok = PyArg_ParseTuple(args, \"s|si\", &file, &mode, &bufsize);\n" +" /* A string, and optionally another string and an integer */\n" +" /* Possible Python calls:\n" +" f('spam')\n" +" f('spam', 'w')\n" +" f('spam', 'wb', 100000) */\n" +"}" +msgstr "" + +msgid "" +"{\n" +" int left, top, right, bottom, h, v;\n" +" ok = PyArg_ParseTuple(args, \"((ii)(ii))(ii)\",\n" +" &left, &top, &right, &bottom, &h, &v);\n" +" /* A rectangle and a point */\n" +" /* Possible Python call:\n" +" f(((0, 0), (400, 300)), (10, 10)) */\n" +"}" +msgstr "" + +msgid "" +"{\n" +" Py_complex c;\n" +" ok = PyArg_ParseTuple(args, \"D:myfunction\", &c);\n" +" /* a complex, also providing a function name for errors */\n" +" /* Possible Python call: myfunction(1+2j) */\n" +"}" +msgstr "" + +msgid "Keyword Parameters for Extension Functions" +msgstr "Параметри ключових слів для функцій розширення" + +msgid "" +"The :c:func:`PyArg_ParseTupleAndKeywords` function is declared as follows::" +msgstr "" +"Функція :c:func:`PyArg_ParseTupleAndKeywords` оголошується таким чином:" + +msgid "" +"int PyArg_ParseTupleAndKeywords(PyObject *arg, PyObject *kwdict,\n" +" const char *format, char * const " +"*kwlist, ...);" +msgstr "" + +msgid "" +"The *arg* and *format* parameters are identical to those of the :c:func:" +"`PyArg_ParseTuple` function. The *kwdict* parameter is the dictionary of " +"keywords received as the third parameter from the Python runtime. The " +"*kwlist* parameter is a ``NULL``-terminated list of strings which identify " +"the parameters; the names are matched with the type information from " +"*format* from left to right. On success, :c:func:" +"`PyArg_ParseTupleAndKeywords` returns true, otherwise it returns false and " +"raises an appropriate exception." +msgstr "" +"Параметри *arg* і *format* ідентичні параметрам функції :c:func:" +"`PyArg_ParseTuple`. Параметр *kwdict* — це словник ключових слів, отриманий " +"як третій параметр із середовища виконання Python. Параметр *kwlist* — це " +"список рядків, що завершуються ``NULL`` і ідентифікують параметри; імена " +"зіставляються з інформацією про тип із *format* зліва направо. У разі " +"успіху :c:func:`PyArg_ParseTupleAndKeywords` повертає true, інакше повертає " +"false і викликає відповідний виняток." + +msgid "" +"Nested tuples cannot be parsed when using keyword arguments! Keyword " +"parameters passed in which are not present in the *kwlist* will cause :exc:" +"`TypeError` to be raised." +msgstr "" +"Вкладені кортежі неможливо проаналізувати за допомогою аргументів ключових " +"слів! Передані параметри ключового слова, яких немає в *kwlist*, призведуть " +"до появи :exc:`TypeError`." + +msgid "" +"Here is an example module which uses keywords, based on an example by Geoff " +"Philbrick (philbrick@hks.com)::" +msgstr "" +"Ось приклад модуля, який використовує ключові слова, на основі прикладу " +"Джеффа Філбріка (philbrick@hks.com):" + +msgid "" +"#define PY_SSIZE_T_CLEAN\n" +"#include \n" +"\n" +"static PyObject *\n" +"keywdarg_parrot(PyObject *self, PyObject *args, PyObject *keywds)\n" +"{\n" +" int voltage;\n" +" const char *state = \"a stiff\";\n" +" const char *action = \"voom\";\n" +" const char *type = \"Norwegian Blue\";\n" +"\n" +" static char *kwlist[] = {\"voltage\", \"state\", \"action\", \"type\", " +"NULL};\n" +"\n" +" if (!PyArg_ParseTupleAndKeywords(args, keywds, \"i|sss\", kwlist,\n" +" &voltage, &state, &action, &type))\n" +" return NULL;\n" +"\n" +" printf(\"-- This parrot wouldn't %s if you put %i Volts through it." +"\\n\",\n" +" action, voltage);\n" +" printf(\"-- Lovely plumage, the %s -- It's %s!\\n\", type, state);\n" +"\n" +" Py_RETURN_NONE;\n" +"}\n" +"\n" +"static PyMethodDef keywdarg_methods[] = {\n" +" /* The cast of the function is necessary since PyCFunction values\n" +" * only take two PyObject* parameters, and keywdarg_parrot() takes\n" +" * three.\n" +" */\n" +" {\"parrot\", (PyCFunction)(void(*)(void))keywdarg_parrot, METH_VARARGS | " +"METH_KEYWORDS,\n" +" \"Print a lovely skit to standard output.\"},\n" +" {NULL, NULL, 0, NULL} /* sentinel */\n" +"};\n" +"\n" +"static struct PyModuleDef keywdargmodule = {\n" +" PyModuleDef_HEAD_INIT,\n" +" \"keywdarg\",\n" +" NULL,\n" +" -1,\n" +" keywdarg_methods\n" +"};\n" +"\n" +"PyMODINIT_FUNC\n" +"PyInit_keywdarg(void)\n" +"{\n" +" return PyModule_Create(&keywdargmodule);\n" +"}" +msgstr "" + +msgid "Building Arbitrary Values" +msgstr "Побудова довільних значень" + +msgid "" +"This function is the counterpart to :c:func:`PyArg_ParseTuple`. It is " +"declared as follows::" +msgstr "" +"Ця функція є аналогом :c:func:`PyArg_ParseTuple`. Це оголошено наступним " +"чином:" + +msgid "PyObject *Py_BuildValue(const char *format, ...);" +msgstr "" + +msgid "" +"It recognizes a set of format units similar to the ones recognized by :c:" +"func:`PyArg_ParseTuple`, but the arguments (which are input to the function, " +"not output) must not be pointers, just values. It returns a new Python " +"object, suitable for returning from a C function called from Python." +msgstr "" +"Він розпізнає набір одиниць формату, подібних до тих, які розпізнає :c:func:" +"`PyArg_ParseTuple`, але аргументи (які є вхідними для функції, а не " +"виведеними) не повинні бути вказівниками, а просто значеннями. Він повертає " +"новий об’єкт Python, придатний для повернення з функції C, викликаної з " +"Python." + +msgid "" +"One difference with :c:func:`PyArg_ParseTuple`: while the latter requires " +"its first argument to be a tuple (since Python argument lists are always " +"represented as tuples internally), :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 string is empty, it returns ``None``; if it " +"contains exactly one format unit, it returns whatever object is described by " +"that format unit. To force it to return a tuple of size 0 or one, " +"parenthesize the format string." +msgstr "" +"Одна відмінність із :c:func:`PyArg_ParseTuple`: у той час як останній " +"вимагає, щоб його перший аргумент був кортежем (оскільки списки аргументів " +"Python завжди представлені у вигляді кортежів), :c:func:`Py_BuildValue` не " +"завжди створює кортеж . Він створює кортеж, лише якщо його рядок формату " +"містить дві або більше одиниць формату. Якщо рядок формату порожній, " +"повертається ``None``; якщо він містить рівно одну одиницю формату, він " +"повертає будь-який об’єкт, описаний цією одиницею формату. Щоб змусити його " +"повертати кортеж розміром 0 або одиницю, візьміть рядок формату в дужки." + +msgid "" +"Examples (to the left the call, to the right the resulting Python value):" +msgstr "Приклади (ліворуч виклик, праворуч результуюче значення Python):" + +msgid "" +"Py_BuildValue(\"\") None\n" +"Py_BuildValue(\"i\", 123) 123\n" +"Py_BuildValue(\"iii\", 123, 456, 789) (123, 456, 789)\n" +"Py_BuildValue(\"s\", \"hello\") 'hello'\n" +"Py_BuildValue(\"y\", \"hello\") b'hello'\n" +"Py_BuildValue(\"ss\", \"hello\", \"world\") ('hello', 'world')\n" +"Py_BuildValue(\"s#\", \"hello\", 4) 'hell'\n" +"Py_BuildValue(\"y#\", \"hello\", 4) b'hell'\n" +"Py_BuildValue(\"()\") ()\n" +"Py_BuildValue(\"(i)\", 123) (123,)\n" +"Py_BuildValue(\"(ii)\", 123, 456) (123, 456)\n" +"Py_BuildValue(\"(i,i)\", 123, 456) (123, 456)\n" +"Py_BuildValue(\"[i,i]\", 123, 456) [123, 456]\n" +"Py_BuildValue(\"{s:i,s:i}\",\n" +" \"abc\", 123, \"def\", 456) {'abc': 123, 'def': 456}\n" +"Py_BuildValue(\"((ii)(ii)) (ii)\",\n" +" 1, 2, 3, 4, 5, 6) (((1, 2), (3, 4)), (5, 6))" +msgstr "" + +msgid "Reference Counts" +msgstr "Довідкова кількість" + +msgid "" +"In languages like C or C++, the programmer is responsible for dynamic " +"allocation and deallocation of memory on the heap. In C, this is done using " +"the functions :c:func:`malloc` and :c:func:`free`. In C++, the operators " +"``new`` and ``delete`` are used with essentially the same meaning and we'll " +"restrict the following discussion to the C case." +msgstr "" +"У таких мовах, як C або C++, програміст відповідає за динамічний розподіл і " +"звільнення пам’яті в купі. У C це робиться за допомогою функцій :c:func:" +"`malloc` і :c:func:`free`. У C++ оператори ``new`` і ``delete`` " +"використовуються, по суті, з однаковим значенням, і ми обмежимо наступне " +"обговорення випадком C." + +msgid "" +"Every block of memory allocated with :c:func:`malloc` should eventually be " +"returned to the pool of available memory by exactly one call to :c:func:" +"`free`. It is important to call :c:func:`free` at the right time. If a " +"block's address is forgotten but :c:func:`free` is not called for it, the " +"memory it occupies cannot be reused until the program terminates. This is " +"called a :dfn:`memory leak`. On the other hand, if a program calls :c:func:" +"`free` for a block and then continues to use the block, it creates a " +"conflict with reuse of the block through another :c:func:`malloc` call. " +"This is called :dfn:`using freed memory`. It has the same bad consequences " +"as referencing uninitialized data --- core dumps, wrong results, mysterious " +"crashes." +msgstr "" + +msgid "" +"Common causes of memory leaks are unusual paths through the code. For " +"instance, a function may allocate a block of memory, do some calculation, " +"and then free the block again. Now a change in the requirements for the " +"function may add a test to the calculation that detects an error condition " +"and can return prematurely from the function. It's easy to forget to free " +"the allocated memory block when taking this premature exit, especially when " +"it is added later to the code. Such leaks, once introduced, often go " +"undetected for a long time: the error exit is taken only in a small fraction " +"of all calls, and most modern machines have plenty of virtual memory, so the " +"leak only becomes apparent in a long-running process that uses the leaking " +"function frequently. Therefore, it's important to prevent leaks from " +"happening by having a coding convention or strategy that minimizes this kind " +"of errors." +msgstr "" +"Поширеними причинами витоку пам'яті є незвичайні шляхи через код. Наприклад, " +"функція може виділити блок пам'яті, виконати деякі обчислення, а потім знову " +"звільнити блок. Тепер зміна вимог до функції може додати перевірку до " +"обчислення, яка виявляє помилку та може передчасно повернутися з функції. " +"Легко забути звільнити виділений блок пам’яті під час цього передчасного " +"виходу, особливо коли він додається пізніше до коду. Такі витоки, щойно " +"виникли, часто залишаються непоміченими протягом тривалого часу: вихід із " +"помилкою відбувається лише в невеликій частині всіх викликів, а більшість " +"сучасних машин мають багато віртуальної пам’яті, тому витік стає очевидним " +"лише під час тривалого процесу який часто використовує функцію витоку. Тому " +"важливо запобігти витокам, маючи угоду або стратегію кодування, яка " +"мінімізує цей тип помилок." + +msgid "" +"Since Python makes heavy use of :c:func:`malloc` and :c:func:`free`, it " +"needs a strategy to avoid memory leaks as well as the use of freed memory. " +"The chosen method is called :dfn:`reference counting`. The principle is " +"simple: every object contains a counter, which is incremented when a " +"reference to the object is stored somewhere, and which is decremented when a " +"reference to it is deleted. When the counter reaches zero, the last " +"reference to the object has been deleted and the object is freed." +msgstr "" +"Оскільки Python активно використовує :c:func:`malloc` і :c:func:`free`, йому " +"потрібна стратегія, щоб уникнути витоку пам’яті, а також використання " +"звільненої пам’яті. Обраний метод називається :dfn:`reference counting`. " +"Принцип простий: кожен об’єкт містить лічильник, який збільшується, коли " +"десь зберігається посилання на об’єкт, і зменшується, коли посилання на " +"нього видаляється. Коли лічильник досягає нуля, останнє посилання на об’єкт " +"було видалено, а об’єкт звільнено." + +msgid "" +"An alternative strategy is called :dfn:`automatic garbage collection`. " +"(Sometimes, reference counting is also referred to as a garbage collection " +"strategy, hence my use of \"automatic\" to distinguish the two.) The big " +"advantage of automatic garbage collection is that the user doesn't need to " +"call :c:func:`free` explicitly. (Another claimed advantage is an " +"improvement in speed or memory usage --- this is no hard fact however.) The " +"disadvantage is that for C, there is no truly portable automatic garbage " +"collector, while reference counting can be implemented portably (as long as " +"the functions :c:func:`malloc` and :c:func:`free` are available --- which " +"the C Standard guarantees). Maybe some day a sufficiently portable automatic " +"garbage collector will be available for C. Until then, we'll have to live " +"with reference counts." +msgstr "" +"Альтернативна стратегія називається :dfn:`автоматична збірка сміття " +"`. (Іноді підрахунок посилань також називають " +"стратегією збирання сміття, тому я використовую \"автоматичний\", щоб " +"відрізнити ці два.) Великою перевагою автоматичного збирання сміття є те, що " +"користувачеві не потрібно викликати :c:func:`free` явно. (Іншою заявленою " +"перевагою є покращення швидкості або використання пам’яті --- однак це " +"непереконливий факт.) Недоліком є те, що для C немає справді портативного " +"автоматичного збирача сміття, тоді як підрахунок посилань можна реалізувати " +"портативно (за умови, що функції :c:func:`malloc` і :c:func:`free` доступні " +"--- що гарантує стандарт C). Можливо, колись достатньо портативний " +"автоматичний збирач сміття буде доступний для C. До того часу нам доведеться " +"жити з кількістю посилань." + +msgid "" +"While Python uses the traditional reference counting implementation, it also " +"offers a cycle detector that works to detect reference cycles. This allows " +"applications to not worry about creating direct or indirect circular " +"references; these are the weakness of garbage collection implemented using " +"only reference counting. Reference cycles consist of objects which contain " +"(possibly indirect) references to themselves, so that each object in the " +"cycle has a reference count which is non-zero. Typical reference counting " +"implementations are not able to reclaim the memory belonging to any objects " +"in a reference cycle, or referenced from the objects in the cycle, even " +"though there are no further references to the cycle itself." +msgstr "" +"Хоча Python використовує традиційну реалізацію підрахунку посилань, він " +"також пропонує детектор циклів, який працює для виявлення опорних циклів. Це " +"дозволяє програмам не турбуватися про створення прямих чи непрямих циклічних " +"посилань; це слабкі місця збирання сміття, реалізованого лише за допомогою " +"підрахунку посилань. Посилальні цикли складаються з об’єктів, які містять " +"(можливо, непрямі) посилання на себе, так що кожен об’єкт у циклі має " +"кількість посилань, відмінну від нуля. Типові реалізації підрахунку посилань " +"не можуть відновити пам’ять, що належить до будь-яких об’єктів у циклі " +"посилань, або на яку посилаються об’єкти в циклі, навіть якщо немає " +"подальших посилань на сам цикл." + +msgid "" +"The cycle detector is able to detect garbage cycles and can reclaim them. " +"The :mod:`gc` module exposes a way to run the detector (the :func:`~gc." +"collect` function), as well as configuration interfaces and the ability to " +"disable the detector at runtime." +msgstr "" +"Детектор циклів здатний виявляти цикли сміття та повертати їх. Модуль :mod:" +"`gc` надає спосіб запуску детектора (функція :func:`~gc.collect`), а також " +"інтерфейси налаштування та можливість вимкнути детектор під час виконання." + +msgid "Reference Counting in Python" +msgstr "Підрахунок посилань у Python" + +msgid "" +"There are two macros, ``Py_INCREF(x)`` and ``Py_DECREF(x)``, which handle " +"the incrementing and decrementing of the reference count. :c:func:" +"`Py_DECREF` also frees the object when the count reaches zero. For " +"flexibility, it doesn't call :c:func:`free` directly --- rather, it makes a " +"call through a function pointer in the object's :dfn:`type object`. For " +"this purpose (and others), every object also contains a pointer to its type " +"object." +msgstr "" +"Є два макроси, ``Py_INCREF(x)`` і ``Py_DECREF(x)``, які обробляють " +"збільшення та зменшення лічильника посилань. :c:func:`Py_DECREF` також " +"звільняє об’єкт, коли кількість досягає нуля. З міркувань гнучкості він не " +"викликає :c:func:`free` напряму --- він робить виклик через вказівник на " +"функцію в об’єкті :dfn:`type object`. Для цієї мети (та інших) кожен об’єкт " +"також містить покажчик на об’єкт свого типу." + +msgid "" +"The big question now remains: when to use ``Py_INCREF(x)`` and " +"``Py_DECREF(x)``? Let's first introduce some terms. Nobody \"owns\" an " +"object; however, you can :dfn:`own a reference` to an object. An object's " +"reference count is now defined as the number of owned references to it. The " +"owner of a reference is responsible for calling :c:func:`Py_DECREF` when the " +"reference is no longer needed. Ownership of a reference can be " +"transferred. There are three ways to dispose of an owned reference: pass it " +"on, store it, or call :c:func:`Py_DECREF`. Forgetting to dispose of an owned " +"reference creates a memory leak." +msgstr "" +"Тепер залишається велике питання: коли використовувати ``Py_INCREF(x)`` і " +"``Py_DECREF(x)``? Давайте спочатку введемо деякі терміни. Ніхто не " +"\"володіє\" об'єктом; проте ви можете :dfn:`володіти посиланням ` на об'єкт. Кількість посилань на об’єкт тепер визначається як " +"кількість належних посилань на нього. Власник посилання відповідає за " +"виклик :c:func:`Py_DECREF`, коли посилання більше не потрібне. Право " +"власності на посилання можна передати. Є три способи позбутися посилання, " +"яке належить: передати, зберегти або викликати :c:func:`Py_DECREF`. Якщо " +"забути позбутися посилання, що належить, це призводить до витоку пам’яті." + +msgid "" +"It is also possible to :dfn:`borrow` [#]_ a reference to an object. The " +"borrower of a reference should not call :c:func:`Py_DECREF`. The borrower " +"must not hold on to the object longer than the owner from which it was " +"borrowed. Using a borrowed reference after the owner has disposed of it " +"risks using freed memory and should be avoided completely [#]_." +msgstr "" +"Також можна :dfn:`borrow` [#]_ посилання на об’єкт. Позичальник посилання не " +"повинен викликати :c:func:`Py_DECREF`. Позичальник не повинен утримувати річ " +"довше, ніж власник, у якого вона була позичена. Використання запозиченого " +"посилання після того, як власник позбувся його, ризикує використати " +"звільнену пам’ять, і його слід повністю уникати [#]_." + +msgid "" +"The advantage of borrowing over owning a reference is that you don't need to " +"take care of disposing of the reference on all possible paths through the " +"code --- in other words, with a borrowed reference you don't run the risk of " +"leaking when a premature exit is taken. The disadvantage of borrowing over " +"owning is that there are some subtle situations where in seemingly correct " +"code a borrowed reference can be used after the owner from which it was " +"borrowed has in fact disposed of it." +msgstr "" +"Перевага запозичення перед володінням посиланням полягає в тому, що вам не " +"потрібно піклуватися про утилізацію посилання на всіх можливих шляхах через " +"код --- іншими словами, з запозиченим посиланням ви не ризикуєте витоком " +"коли зроблено передчасний вихід. Недоліком запозичення перед володінням є " +"те, що існують деякі тонкі ситуації, коли в, здавалося б, правильному коді " +"запозичене посилання може бути використано після того, як власник, у якого " +"воно було запозичено, фактично позбувся його." + +msgid "" +"A borrowed reference can be changed into an owned reference by calling :c:" +"func:`Py_INCREF`. This does not affect the status of the owner from which " +"the reference was borrowed --- it creates a new owned reference, and gives " +"full owner responsibilities (the new owner must dispose of the reference " +"properly, as well as the previous owner)." +msgstr "" +"Позичене посилання можна змінити на власне, викликавши :c:func:`Py_INCREF`. " +"Це не впливає на статус власника, у якого було запозичено посилання --- " +"створюється нове посилання, яке належить, і надається повна відповідальність " +"власника (новий власник повинен правильно розпоряджатися посиланням, як і " +"попередній власник)." + +msgid "Ownership Rules" +msgstr "Правила власності" + +msgid "" +"Whenever an object reference is passed into or out of a function, it is part " +"of the function's interface specification whether ownership is transferred " +"with the reference or not." +msgstr "" +"Кожного разу, коли посилання на об’єкт передається у функцію або з неї, воно " +"є частиною специфікації інтерфейсу функції незалежно від того, передається " +"право власності з посиланням чи ні." + +msgid "" +"Most functions that return a reference to an object pass on ownership with " +"the reference. In particular, all functions whose function it is to create " +"a new object, such as :c:func:`PyLong_FromLong` and :c:func:`Py_BuildValue`, " +"pass ownership to the receiver. Even if the object is not actually new, you " +"still receive ownership of a new reference to that object. For instance, :c:" +"func:`PyLong_FromLong` maintains a cache of popular values and can return a " +"reference to a cached item." +msgstr "" +"Більшість функцій, які повертають посилання на об’єкт, передають право " +"власності разом із посиланням. Зокрема, усі функції, функцією яких є " +"створення нового об’єкта, такі як :c:func:`PyLong_FromLong` і :c:func:" +"`Py_BuildValue`, передають право власності одержувачу. Навіть якщо об’єкт " +"насправді не новий, ви все одно отримуєте право власності на нове посилання " +"на цей об’єкт. Наприклад, :c:func:`PyLong_FromLong` підтримує кеш популярних " +"значень і може повертати посилання на кешований елемент." + +msgid "" +"Many functions that extract objects from other objects also transfer " +"ownership with the reference, for instance :c:func:" +"`PyObject_GetAttrString`. The picture is less clear, here, however, since a " +"few common routines are exceptions: :c:func:`PyTuple_GetItem`, :c:func:" +"`PyList_GetItem`, :c:func:`PyDict_GetItem`, and :c:func:" +"`PyDict_GetItemString` all return references that you borrow from the tuple, " +"list or dictionary." +msgstr "" +"Багато функцій, які витягують об’єкти з інших об’єктів, також передають " +"право власності разом із посиланням, наприклад :c:func:" +"`PyObject_GetAttrString`. Однак тут картина менш зрозуміла, оскільки кілька " +"типових процедур є винятками: :c:func:`PyTuple_GetItem`, :c:func:" +"`PyList_GetItem`, :c:func:`PyDict_GetItem` і :c:func:`PyDict_GetItemString` " +"повертає всі посилання, які ви запозичили з кортежу, списку або словника." + +msgid "" +"The function :c:func:`PyImport_AddModule` also returns a borrowed reference, " +"even though it may actually create the object it returns: this is possible " +"because an owned reference to the object is stored in ``sys.modules``." +msgstr "" +"Функція :c:func:`PyImport_AddModule` також повертає запозичене посилання, " +"навіть якщо вона може фактично створити об’єкт, який повертає: це можливо, " +"оскільки власне посилання на об’єкт зберігається в ``sys.modules``." + +msgid "" +"When you pass an object reference into another function, in general, the " +"function borrows the reference from you --- if it needs to store it, it will " +"use :c:func:`Py_INCREF` to become an independent owner. There are exactly " +"two important exceptions to this rule: :c:func:`PyTuple_SetItem` and :c:func:" +"`PyList_SetItem`. These functions take over ownership of the item passed to " +"them --- even if they fail! (Note that :c:func:`PyDict_SetItem` and friends " +"don't take over ownership --- they are \"normal.\")" +msgstr "" +"Коли ви передаєте посилання на об’єкт в іншу функцію, функція, як правило, " +"запозичує посилання у вас --- якщо їй потрібно її зберегти, вона " +"використовуватиме :c:func:`Py_INCREF`, щоб стати незалежним власником. З " +"цього правила є два важливих винятки: :c:func:`PyTuple_SetItem` і :c:func:" +"`PyList_SetItem`. Ці функції беруть на себе право власності на переданий їм " +"елемент --- навіть якщо вони виходять з ладу! (Зауважте, що :c:func:" +"`PyDict_SetItem` і друзі не беруть на себе право власності --- вони " +"\"нормальні\".)" + +msgid "" +"When a C function is called from Python, it borrows references to its " +"arguments from the caller. The caller owns a reference to the object, so " +"the borrowed reference's lifetime is guaranteed until the function returns. " +"Only when such a borrowed reference must be stored or passed on, it must be " +"turned into an owned reference by calling :c:func:`Py_INCREF`." +msgstr "" +"Коли функція C викликається з Python, вона запозичує посилання на свої " +"аргументи від викликаючого. Виклик володіє посиланням на об’єкт, тому час " +"життя позиченого посилання гарантується до повернення функції. Лише тоді, " +"коли таке запозичене посилання потрібно зберегти або передати, його потрібно " +"перетворити на власне посилання шляхом виклику :c:func:`Py_INCREF`." + +msgid "" +"The object reference returned from a C function that is called from Python " +"must be an owned reference --- ownership is transferred from the function to " +"its caller." +msgstr "" +"Посилання на об’єкт, що повертається функцією C, яка викликається з Python, " +"має бути посиланням у власності --- право власності передається від функції " +"до її викликаючого." + +msgid "Thin Ice" +msgstr "Тонкий лід" + +msgid "" +"There are a few situations where seemingly harmless use of a borrowed " +"reference can lead to problems. These all have to do with implicit " +"invocations of the interpreter, which can cause the owner of a reference to " +"dispose of it." +msgstr "" +"Є кілька ситуацій, коли, здавалося б, нешкідливе використання запозиченого " +"посилання може призвести до проблем. Усе це пов’язано з неявними викликами " +"інтерпретатора, які можуть змусити власника посилання позбутися його." + +msgid "" +"The first and most important case to know about is using :c:func:`Py_DECREF` " +"on an unrelated object while borrowing a reference to a list item. For " +"instance::" +msgstr "" +"Перший і найважливіший випадок, про який варто знати, це використання :c:" +"func:`Py_DECREF` для непов’язаного об’єкта під час запозичення посилання на " +"елемент списку. Наприклад::" + +msgid "" +"void\n" +"bug(PyObject *list)\n" +"{\n" +" PyObject *item = PyList_GetItem(list, 0);\n" +"\n" +" PyList_SetItem(list, 1, PyLong_FromLong(0L));\n" +" PyObject_Print(item, stdout, 0); /* BUG! */\n" +"}" +msgstr "" + +msgid "" +"This function first borrows a reference to ``list[0]``, then replaces " +"``list[1]`` with the value ``0``, and finally prints the borrowed reference. " +"Looks harmless, right? But it's not!" +msgstr "" +"Ця функція спочатку запозичує посилання на ``list[0]``, потім замінює " +"``list[1]`` на значення ``0`` і, нарешті, друкує запозичене посилання. " +"Виглядає нешкідливо, правда? Але це не так!" + +msgid "" +"Let's follow the control flow into :c:func:`PyList_SetItem`. The list owns " +"references to all its items, so when item 1 is replaced, it has to dispose " +"of the original item 1. Now let's suppose the original item 1 was an " +"instance of a user-defined class, and let's further suppose that the class " +"defined a :meth:`!__del__` method. If this class instance has a reference " +"count of 1, disposing of it will call its :meth:`!__del__` method." +msgstr "" + +msgid "" +"Since it is written in Python, the :meth:`!__del__` method can execute " +"arbitrary Python code. Could it perhaps do something to invalidate the " +"reference to ``item`` in :c:func:`!bug`? You bet! Assuming that the list " +"passed into :c:func:`!bug` is accessible to the :meth:`!__del__` method, it " +"could execute a statement to the effect of ``del list[0]``, and assuming " +"this was the last reference to that object, it would free the memory " +"associated with it, thereby invalidating ``item``." +msgstr "" + +msgid "" +"The solution, once you know the source of the problem, is easy: temporarily " +"increment the reference count. The correct version of the function reads::" +msgstr "" +"Якщо ви дізнаєтеся про джерело проблеми, вирішити її легко: тимчасово " +"збільште кількість посилань. Правильна версія функції виглядає так:" + +msgid "" +"void\n" +"no_bug(PyObject *list)\n" +"{\n" +" PyObject *item = PyList_GetItem(list, 0);\n" +"\n" +" Py_INCREF(item);\n" +" PyList_SetItem(list, 1, PyLong_FromLong(0L));\n" +" PyObject_Print(item, stdout, 0);\n" +" Py_DECREF(item);\n" +"}" +msgstr "" + +msgid "" +"This is a true story. An older version of Python contained variants of this " +"bug and someone spent a considerable amount of time in a C debugger to " +"figure out why his :meth:`!__del__` methods would fail..." +msgstr "" + +msgid "" +"The second case of problems with a borrowed reference is a variant involving " +"threads. Normally, multiple threads in the Python interpreter can't get in " +"each other's way, because there is a global lock protecting Python's entire " +"object space. However, it is possible to temporarily release this lock " +"using the macro :c:macro:`Py_BEGIN_ALLOW_THREADS`, and to re-acquire it " +"using :c:macro:`Py_END_ALLOW_THREADS`. This is common around blocking I/O " +"calls, to let other threads use the processor while waiting for the I/O to " +"complete. Obviously, the following function has the same problem as the " +"previous one::" +msgstr "" +"Другий випадок проблем із запозиченим посиланням – це варіант із залученням " +"потоків. Зазвичай кілька потоків в інтерпретаторі Python не можуть " +"перешкоджати один одному, оскільки існує глобальне блокування, яке захищає " +"весь простір об’єктів Python. Однак можна тимчасово зняти це блокування за " +"допомогою макросу :c:macro:`Py_BEGIN_ALLOW_THREADS` і повторно отримати його " +"за допомогою :c:macro:`Py_END_ALLOW_THREADS`. Це часто зустрічається під час " +"блокування викликів введення-виведення, щоб дозволити іншим потокам " +"використовувати процесор під час очікування завершення введення-виведення. " +"Очевидно, що наступна функція має ту саму проблему, що й попередня:" + +msgid "" +"void\n" +"bug(PyObject *list)\n" +"{\n" +" PyObject *item = PyList_GetItem(list, 0);\n" +" Py_BEGIN_ALLOW_THREADS\n" +" ...some blocking I/O call...\n" +" Py_END_ALLOW_THREADS\n" +" PyObject_Print(item, stdout, 0); /* BUG! */\n" +"}" +msgstr "" + +msgid "NULL Pointers" +msgstr "NULL покажчики" + +msgid "" +"In general, functions that take object references as arguments do not expect " +"you to pass them ``NULL`` pointers, and will dump core (or cause later core " +"dumps) if you do so. Functions that return object references generally " +"return ``NULL`` only to indicate that an exception occurred. The reason for " +"not testing for ``NULL`` arguments is that functions often pass the objects " +"they receive on to other function --- if each function were to test for " +"``NULL``, there would be a lot of redundant tests and the code would run " +"more slowly." +msgstr "" +"Загалом, функції, які приймають посилання на об’єкти як аргументи, не " +"очікують, що ви передасте їм покажчики ``NULL``, і, якщо ви це зробите, " +"створять дамп ядра (або викликатимуть дамп ядра пізніше). Функції, які " +"повертають посилання на об’єкт, зазвичай повертають ``NULL`` лише для того, " +"щоб вказати, що стався виняток. Причина не перевіряти аргументи ``NULL`` " +"полягає в тому, що функції часто передають отримані об’єкти іншій функції " +"--- якби кожна функція перевіряла ``NULL``, було б багато зайвих перевірок і " +"код працюватиме повільніше." + +msgid "" +"It is better to test for ``NULL`` only at the \"source:\" when a pointer " +"that may be ``NULL`` is received, for example, from :c:func:`malloc` or from " +"a function that may raise an exception." +msgstr "" +"Краще перевіряти ``NULL`` лише на \"джерело:\", коли вказівник, який може " +"бути ``NULL`` отримано, наприклад, від :c:func:`malloc` або від функції, яка " +"може створити виняток." + +msgid "" +"The macros :c:func:`Py_INCREF` and :c:func:`Py_DECREF` do not check for " +"``NULL`` pointers --- however, their variants :c:func:`Py_XINCREF` and :c:" +"func:`Py_XDECREF` do." +msgstr "" +"Макроси :c:func:`Py_INCREF` і :c:func:`Py_DECREF` не перевіряють покажчики " +"``NULL`` --- однак їх варіанти :c:func:`Py_XINCREF` і :c:func:`Py_XDECREF` " +"робити." + +msgid "" +"The macros for checking for a particular object type (``Pytype_Check()``) " +"don't check for ``NULL`` pointers --- again, there is much code that calls " +"several of these in a row to test an object against various different " +"expected types, and this would generate redundant tests. There are no " +"variants with ``NULL`` checking." +msgstr "" +"Макроси для перевірки певного типу об’єкта (``Pytype_Check()``) не " +"перевіряють покажчики ``NULL`` --- знову ж таки, є багато коду, який " +"викликає кілька з них поспіль для перевірки об’єкта проти різних очікуваних " +"типів, і це створить надлишкові тести. Варіантів із перевіркою ``NULL`` " +"немає." + +msgid "" +"The C function calling mechanism guarantees that the argument list passed to " +"C functions (``args`` in the examples) is never ``NULL`` --- in fact it " +"guarantees that it is always a tuple [#]_." +msgstr "" +"Механізм виклику функції C гарантує, що список аргументів, переданий " +"функціям C (``args`` у прикладах), ніколи не буде ``NULL`` --- фактично він " +"гарантує, що це завжди кортеж [#]_." + +msgid "" +"It is a severe error to ever let a ``NULL`` pointer \"escape\" to the Python " +"user." +msgstr "" +"Дозволити вказівнику ``NULL`` \"вийти\" користувачеві Python є серйозною " +"помилкою." + +msgid "Writing Extensions in C++" +msgstr "Написання розширень на C++" + +msgid "" +"It is possible to write extension modules in C++. Some restrictions apply. " +"If the main program (the Python interpreter) is compiled and linked by the C " +"compiler, global or static objects with constructors cannot be used. This " +"is not a problem if the main program is linked by the C++ compiler. " +"Functions that will be called by the Python interpreter (in particular, " +"module initialization functions) have to be declared using ``extern \"C\"``. " +"It is unnecessary to enclose the Python header files in ``extern \"C\" {...}" +"`` --- they use this form already if the symbol ``__cplusplus`` is defined " +"(all recent C++ compilers define this symbol)." +msgstr "" +"На C++ можна писати модулі розширення. Застосовуються деякі обмеження. Якщо " +"основна програма (інтерпретатор Python) скомпільована та зв’язана " +"компілятором C, глобальні чи статичні об’єкти з конструкторами " +"використовувати не можна. Це не проблема, якщо основна програма зв’язана " +"компілятором C++. Функції, які буде викликатися інтерпретатором Python " +"(зокрема, функції ініціалізації модуля), мають бути оголошені за допомогою " +"``extern \"C\"``. Немає необхідності вкладати файли заголовків Python у " +"``extern \"C\" {...}`` --- вони вже використовують цю форму, якщо визначено " +"символ ``__cplusplus`` (усі останні компілятори C++ визначають цей символ) ." + +msgid "Providing a C API for an Extension Module" +msgstr "Надання C API для модуля розширення" + +msgid "" +"Many extension modules just provide new functions and types to be used from " +"Python, but sometimes the code in an extension module can be useful for " +"other extension modules. For example, an extension module could implement a " +"type \"collection\" which works like lists without order. Just like the " +"standard Python list type has a C API which permits extension modules to " +"create and manipulate lists, this new collection type should have a set of C " +"functions for direct manipulation from other extension modules." +msgstr "" +"Багато модулів розширення просто надають нові функції та типи для " +"використання з Python, але іноді код у модулі розширення може бути корисним " +"для інших модулів розширення. Наприклад, модуль розширення може реалізувати " +"тип \"колекція\", який працює як списки без порядку. Подібно до того, як " +"стандартний тип списку Python має C API, який дозволяє модулям розширення " +"створювати списки та маніпулювати ними, цей новий тип колекції повинен мати " +"набір функцій C для прямого маніпулювання з інших модулів розширення." + +msgid "" +"At first sight this seems easy: just write the functions (without declaring " +"them ``static``, of course), provide an appropriate header file, and " +"document the C API. And in fact this would work if all extension modules " +"were always linked statically with the Python interpreter. When modules are " +"used as shared libraries, however, the symbols defined in one module may not " +"be visible to another module. The details of visibility depend on the " +"operating system; some systems use one global namespace for the Python " +"interpreter and all extension modules (Windows, for example), whereas others " +"require an explicit list of imported symbols at module link time (AIX is one " +"example), or offer a choice of different strategies (most Unices). And even " +"if symbols are globally visible, the module whose functions one wishes to " +"call might not have been loaded yet!" +msgstr "" +"На перший погляд це здається легким: просто напишіть функції (звичайно, не " +"оголошуючи їх \"статичними\"), надайте відповідний файл заголовка та " +"задокументуйте C API. І насправді це працювало б, якби всі модулі розширення " +"завжди були статично пов’язані з інтерпретатором Python. Проте коли модулі " +"використовуються як спільні бібліотеки, символи, визначені в одному модулі, " +"можуть бути невидимими для іншого модуля. Деталі видимості залежать від " +"операційної системи; деякі системи використовують один глобальний простір " +"імен для інтерпретатора Python і всіх модулів розширення (наприклад, " +"Windows), тоді як інші вимагають явного списку імпортованих символів під час " +"зв’язування модуля (прикладом є AIX) або пропонують вибір різних стратегій " +"(більшість Unices). І навіть якщо символи видимі глобально, модуль, функції " +"якого потрібно викликати, можливо, ще не завантажено!" + +msgid "" +"Portability therefore requires not to make any assumptions about symbol " +"visibility. This means that all symbols in extension modules should be " +"declared ``static``, except for the module's initialization function, in " +"order to avoid name clashes with other extension modules (as discussed in " +"section :ref:`methodtable`). And it means that symbols that *should* be " +"accessible from other extension modules must be exported in a different way." +msgstr "" +"Тому портативність вимагає не робити жодних припущень щодо видимості " +"символу. Це означає, що всі символи в модулях розширення мають бути " +"оголошені ``статичними``, за винятком функції ініціалізації модуля, щоб " +"уникнути зіткнення імен з іншими модулями розширення (як описано в розділі :" +"ref:`methodtable`). І це означає, що символи, які *мають* бути доступні з " +"інших модулів розширення, повинні бути експортовані в інший спосіб." + +msgid "" +"Python provides a special mechanism to pass C-level information (pointers) " +"from one extension module to another one: Capsules. A Capsule is a Python " +"data type which stores a pointer (:c:expr:`void \\*`). Capsules can only be " +"created and accessed via their C API, but they can be passed around like any " +"other Python object. In particular, they can be assigned to a name in an " +"extension module's namespace. Other extension modules can then import this " +"module, retrieve the value of this name, and then retrieve the pointer from " +"the Capsule." +msgstr "" + +msgid "" +"There are many ways in which Capsules can be used to export the C API of an " +"extension module. Each function could get its own Capsule, or all C API " +"pointers could be stored in an array whose address is published in a " +"Capsule. And the various tasks of storing and retrieving the pointers can be " +"distributed in different ways between the module providing the code and the " +"client modules." +msgstr "" +"Є багато способів використання Capsules для експорту C API модуля " +"розширення. Кожна функція може отримати власну капсулу, або всі покажчики C " +"API можуть зберігатися в масиві, адреса якого опублікована в капсулі. Різні " +"завдання зі зберігання та отримання покажчиків можуть бути розподілені " +"різними способами між модулем, що надає код, і клієнтськими модулями." + +msgid "" +"Whichever method you choose, it's important to name your Capsules properly. " +"The function :c:func:`PyCapsule_New` takes a name parameter (:c:expr:`const " +"char \\*`); you're permitted to pass in a ``NULL`` name, but we strongly " +"encourage you to specify a name. Properly named Capsules provide a degree " +"of runtime type-safety; there is no feasible way to tell one unnamed Capsule " +"from another." +msgstr "" + +msgid "" +"In particular, Capsules used to expose C APIs should be given a name " +"following this convention::" +msgstr "" +"Зокрема, капсулам, які використовуються для розкриття C API, слід присвоїти " +"назву відповідно до цієї угоди:" + +msgid "modulename.attributename" +msgstr "" + +msgid "" +"The convenience function :c:func:`PyCapsule_Import` makes it easy to load a " +"C API provided via a Capsule, but only if the Capsule's name matches this " +"convention. This behavior gives C API users a high degree of certainty that " +"the Capsule they load contains the correct C API." +msgstr "" +"Зручна функція :c:func:`PyCapsule_Import` спрощує завантаження C API, що " +"надається через Capsule, але лише якщо назва Capsule відповідає цій умові. " +"Така поведінка дає користувачам C API високий ступінь впевненості, що " +"капсула, яку вони завантажують, містить правильний C API." + +msgid "" +"The following example demonstrates an approach that puts most of the burden " +"on the writer of the exporting module, which is appropriate for commonly " +"used library modules. It stores all C API pointers (just one in the " +"example!) in an array of :c:expr:`void` pointers which becomes the value of " +"a Capsule. The header file corresponding to the module provides a macro that " +"takes care of importing the module and retrieving its C API pointers; client " +"modules only have to call this macro before accessing the C API." +msgstr "" + +msgid "" +"The exporting module is a modification of the :mod:`!spam` module from " +"section :ref:`extending-simpleexample`. The function :func:`!spam.system` " +"does not call the C library function :c:func:`system` directly, but a " +"function :c:func:`!PySpam_System`, which would of course do something more " +"complicated in reality (such as adding \"spam\" to every command). This " +"function :c:func:`!PySpam_System` is also exported to other extension " +"modules." +msgstr "" + +msgid "" +"The function :c:func:`!PySpam_System` is a plain C function, declared " +"``static`` like everything else::" +msgstr "" + +msgid "" +"static int\n" +"PySpam_System(const char *command)\n" +"{\n" +" return system(command);\n" +"}" +msgstr "" + +msgid "The function :c:func:`!spam_system` is modified in a trivial way::" +msgstr "" + +msgid "" +"static PyObject *\n" +"spam_system(PyObject *self, PyObject *args)\n" +"{\n" +" const char *command;\n" +" int sts;\n" +"\n" +" if (!PyArg_ParseTuple(args, \"s\", &command))\n" +" return NULL;\n" +" sts = PySpam_System(command);\n" +" return PyLong_FromLong(sts);\n" +"}" +msgstr "" + +msgid "In the beginning of the module, right after the line ::" +msgstr "На початку модуля, відразу після рядка ::" + +msgid "#include " +msgstr "" + +msgid "two more lines must be added::" +msgstr "потрібно додати ще два рядки::" + +msgid "" +"#define SPAM_MODULE\n" +"#include \"spammodule.h\"" +msgstr "" + +msgid "" +"The ``#define`` is used to tell the header file that it is being included in " +"the exporting module, not a client module. Finally, the module's " +"initialization function must take care of initializing the C API pointer " +"array::" +msgstr "" +"``#define`` використовується, щоб повідомити файлу заголовка, що його " +"включено до модуля експорту, а не клієнтського модуля. Нарешті, функція " +"ініціалізації модуля повинна подбати про ініціалізацію масиву покажчиків C " +"API::" + +msgid "" +"PyMODINIT_FUNC\n" +"PyInit_spam(void)\n" +"{\n" +" PyObject *m;\n" +" static void *PySpam_API[PySpam_API_pointers];\n" +" PyObject *c_api_object;\n" +"\n" +" m = PyModule_Create(&spammodule);\n" +" if (m == NULL)\n" +" return NULL;\n" +"\n" +" /* Initialize the C API pointer array */\n" +" PySpam_API[PySpam_System_NUM] = (void *)PySpam_System;\n" +"\n" +" /* Create a Capsule containing the API pointer array's address */\n" +" c_api_object = PyCapsule_New((void *)PySpam_API, \"spam._C_API\", " +"NULL);\n" +"\n" +" if (PyModule_Add(m, \"_C_API\", c_api_object) < 0) {\n" +" Py_DECREF(m);\n" +" return NULL;\n" +" }\n" +"\n" +" return m;\n" +"}" +msgstr "" + +msgid "" +"Note that ``PySpam_API`` is declared ``static``; otherwise the pointer array " +"would disappear when :c:func:`!PyInit_spam` terminates!" +msgstr "" + +msgid "" +"The bulk of the work is in the header file :file:`spammodule.h`, which looks " +"like this::" +msgstr "" +"Основна частина роботи знаходиться у файлі заголовка :file:`spammodule.h`, " +"який виглядає так:" + +msgid "" +"#ifndef Py_SPAMMODULE_H\n" +"#define Py_SPAMMODULE_H\n" +"#ifdef __cplusplus\n" +"extern \"C\" {\n" +"#endif\n" +"\n" +"/* Header file for spammodule */\n" +"\n" +"/* C API functions */\n" +"#define PySpam_System_NUM 0\n" +"#define PySpam_System_RETURN int\n" +"#define PySpam_System_PROTO (const char *command)\n" +"\n" +"/* Total number of C API pointers */\n" +"#define PySpam_API_pointers 1\n" +"\n" +"\n" +"#ifdef SPAM_MODULE\n" +"/* This section is used when compiling spammodule.c */\n" +"\n" +"static PySpam_System_RETURN PySpam_System PySpam_System_PROTO;\n" +"\n" +"#else\n" +"/* This section is used in modules that use spammodule's API */\n" +"\n" +"static void **PySpam_API;\n" +"\n" +"#define PySpam_System \\\n" +" (*(PySpam_System_RETURN (*)PySpam_System_PROTO) " +"PySpam_API[PySpam_System_NUM])\n" +"\n" +"/* Return -1 on error, 0 on success.\n" +" * PyCapsule_Import will set an exception if there's an error.\n" +" */\n" +"static int\n" +"import_spam(void)\n" +"{\n" +" PySpam_API = (void **)PyCapsule_Import(\"spam._C_API\", 0);\n" +" return (PySpam_API != NULL) ? 0 : -1;\n" +"}\n" +"\n" +"#endif\n" +"\n" +"#ifdef __cplusplus\n" +"}\n" +"#endif\n" +"\n" +"#endif /* !defined(Py_SPAMMODULE_H) */" +msgstr "" + +msgid "" +"All that a client module must do in order to have access to the function :c:" +"func:`!PySpam_System` is to call the function (or rather macro) :c:func:`!" +"import_spam` in its initialization function::" +msgstr "" + +msgid "" +"PyMODINIT_FUNC\n" +"PyInit_client(void)\n" +"{\n" +" PyObject *m;\n" +"\n" +" m = PyModule_Create(&clientmodule);\n" +" if (m == NULL)\n" +" return NULL;\n" +" if (import_spam() < 0)\n" +" return NULL;\n" +" /* additional initialization can happen here */\n" +" return m;\n" +"}" +msgstr "" + +msgid "" +"The main disadvantage of this approach is that the file :file:`spammodule.h` " +"is rather complicated. However, the basic structure is the same for each " +"function that is exported, so it has to be learned only once." +msgstr "" +"Основним недоліком цього підходу є те, що файл :file:`spammodule.h` досить " +"складний. Однак базова структура однакова для кожної функції, яка " +"експортується, тому її потрібно вивчати лише один раз." + +msgid "" +"Finally it should be mentioned that Capsules offer additional functionality, " +"which is especially useful for memory allocation and deallocation of the " +"pointer stored in a Capsule. The details are described in the Python/C API " +"Reference Manual in the section :ref:`capsules` and in the implementation of " +"Capsules (files :file:`Include/pycapsule.h` and :file:`Objects/pycapsule.c` " +"in the Python source code distribution)." +msgstr "" +"Насамкінець слід зазначити, що капсули пропонують додаткову " +"функціональність, яка особливо корисна для виділення пам’яті та зняття " +"вказівника, що зберігається в капсулі. Подробиці описано в довідковому " +"посібнику Python/C API у розділі :ref:`capsules` і в реалізації капсул " +"(файли :file:`Include/pycapsule.h` і :file:`Objects/pycapsule.c` у " +"дистрибутиві вихідного коду Python)." + +msgid "Footnotes" +msgstr "Виноски" + +msgid "" +"An interface for this function already exists in the standard module :mod:" +"`os` --- it was chosen as a simple and straightforward example." +msgstr "" +"Інтерфейс для цієї функції вже існує в стандартному модулі :mod:`os` --- він " +"був обраний як простий і зрозумілий приклад." + +msgid "" +"The metaphor of \"borrowing\" a reference is not completely correct: the " +"owner still has a copy of the reference." +msgstr "" +"Метафора \"позичити\" довідку не зовсім коректна: власник досі має копію " +"довідки." + +msgid "" +"Checking that the reference count is at least 1 **does not work** --- the " +"reference count itself could be in freed memory and may thus be reused for " +"another object!" +msgstr "" +"Перевірка того, що кількість посилань дорівнює принаймні 1, **не працює** " +"--- сама кількість посилань може бути у звільненій пам’яті та, таким чином, " +"може бути повторно використана для іншого об’єкта!" + +msgid "" +"These guarantees don't hold when you use the \"old\" style calling " +"convention --- this is still found in much existing code." +msgstr "" +"Ці гарантії не діють, якщо ви використовуєте \"старий\" стиль викликів --- " +"він все ще міститься в більшості існуючих кодів." + +msgid "PyObject_CallObject (C function)" +msgstr "" + +msgid "PyArg_ParseTuple (C function)" +msgstr "" + +msgid "PyArg_ParseTupleAndKeywords (C function)" +msgstr "" + +msgid "Philbrick, Geoff" +msgstr "" diff --git a/extending/index.po b/extending/index.po new file mode 100644 index 000000000..b89bb0695 --- /dev/null +++ b/extending/index.po @@ -0,0 +1,121 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:52+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Extending and Embedding the Python Interpreter" +msgstr "Розширення та вбудовування інтерпретатора Python" + +msgid "" +"This document describes how to write modules in C or C++ to extend the " +"Python interpreter with new modules. Those modules can not only define new " +"functions but also new object types and their methods. The document also " +"describes how to embed the Python interpreter in another application, for " +"use as an extension language. Finally, it shows how to compile and link " +"extension modules so that they can be loaded dynamically (at run time) into " +"the interpreter, if the underlying operating system supports this feature." +msgstr "" +"У цьому документі описано, як писати модулі на C або C++, щоб розширити " +"інтерпретатор Python новими модулями. Ці модулі можуть не лише визначати " +"нові функції, але й нові типи об’єктів та їхні методи. У документі також " +"описано, як вбудувати інтерпретатор Python в іншу програму для використання " +"як мови розширення. Нарешті, показано, як компілювати та зв’язувати модулі " +"розширення, щоб їх можна було динамічно завантажувати (під час виконання) в " +"інтерпретатор, якщо базова операційна система підтримує цю функцію." + +msgid "" +"This document assumes basic knowledge about Python. For an informal " +"introduction to the language, see :ref:`tutorial-index`. :ref:`reference-" +"index` gives a more formal definition of the language. :ref:`library-index` " +"documents the existing object types, functions and modules (both built-in " +"and written in Python) that give the language its wide application range." +msgstr "" +"Цей документ передбачає базові знання про Python. Для неформального " +"ознайомлення з мовою див. :ref:`tutorial-index`. :ref:`reference-index` дає " +"більш формальне визначення мови. :ref:`library-index` документує існуючі " +"типи об’єктів, функції та модулі (як вбудовані, так і написані на Python), " +"які надають мові широкий спектр застосування." + +msgid "" +"For a detailed description of the whole Python/C API, see the separate :ref:" +"`c-api-index`." +msgstr "" +"Для детального опису всього API Python/C перегляньте окремий :ref:`c-api-" +"index`." + +msgid "Recommended third party tools" +msgstr "Рекомендовані сторонні інструменти" + +msgid "" +"This guide only covers the basic tools for creating extensions provided as " +"part of this version of CPython. Third party tools like `Cython `_, `cffi `_, `SWIG `_ and `Numba `_ offer both simpler and " +"more sophisticated approaches to creating C and C++ extensions for Python." +msgstr "" + +msgid "" +"`Python Packaging User Guide: Binary Extensions `_" +msgstr "" +"`Посібник користувача з упаковки Python: двійкові розширення `_" + +msgid "" +"The Python Packaging User Guide not only covers several available tools that " +"simplify the creation of binary extensions, but also discusses the various " +"reasons why creating an extension module may be desirable in the first place." +msgstr "" +"Посібник користувача з упакування Python не лише охоплює кілька доступних " +"інструментів, які спрощують створення бінарних розширень, але й обговорює " +"різні причини, чому створення модуля розширення може бути бажаним у першу " +"чергу." + +msgid "Creating extensions without third party tools" +msgstr "Створення розширень без сторонніх інструментів" + +msgid "" +"This section of the guide covers creating C and C++ extensions without " +"assistance from third party tools. It is intended primarily for creators of " +"those tools, rather than being a recommended way to create your own C " +"extensions." +msgstr "" +"У цьому розділі посібника описано створення розширень C і C++ без допомоги " +"сторонніх інструментів. Він призначений насамперед для розробників цих " +"інструментів, а не як рекомендований спосіб створення власних розширень C." + +msgid "Embedding the CPython runtime in a larger application" +msgstr "Вбудовування середовища виконання CPython у більшу програму" + +msgid "" +"Sometimes, rather than creating an extension that runs inside the Python " +"interpreter as the main application, it is desirable to instead embed the " +"CPython runtime inside a larger application. This section covers some of the " +"details involved in doing that successfully." +msgstr "" +"Іноді замість створення розширення, яке працює в інтерпретаторі Python як " +"основної програми, бажано замість цього вбудувати середовище виконання " +"CPython у більшу програму. У цьому розділі описано деякі деталі, необхідні " +"для успішного виконання цього завдання." diff --git a/extending/newtypes.po b/extending/newtypes.po new file mode 100644 index 000000000..d83304694 --- /dev/null +++ b/extending/newtypes.po @@ -0,0 +1,1055 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2024 +# Yuliia Shevchenko, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:52+0000\n" +"Last-Translator: Yuliia Shevchenko, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Defining Extension Types: Assorted Topics" +msgstr "Визначення типів розширень: різні теми" + +msgid "" +"This section aims to give a quick fly-by on the various type methods you can " +"implement and what they do." +msgstr "" +"Цей розділ має на меті дати швидкий огляд методів різних типів, які ви " +"можете застосувати, і того, що вони роблять." + +msgid "" +"Here is the definition of :c:type:`PyTypeObject`, with some fields only used " +"in :ref:`debug builds ` omitted:" +msgstr "" +"Ось визначення :c:type:`PyTypeObject` з деякими полями, які використовуються " +"лише в :ref:`debug builds ` опущено:" + +msgid "" +"typedef struct _typeobject {\n" +" PyObject_VAR_HEAD\n" +" const char *tp_name; /* For printing, in format \".\" */\n" +" Py_ssize_t tp_basicsize, tp_itemsize; /* For allocation */\n" +"\n" +" /* Methods to implement standard operations */\n" +"\n" +" destructor tp_dealloc;\n" +" Py_ssize_t tp_vectorcall_offset;\n" +" getattrfunc tp_getattr;\n" +" setattrfunc tp_setattr;\n" +" PyAsyncMethods *tp_as_async; /* formerly known as tp_compare (Python 2)\n" +" or tp_reserved (Python 3) */\n" +" reprfunc tp_repr;\n" +"\n" +" /* Method suites for standard classes */\n" +"\n" +" PyNumberMethods *tp_as_number;\n" +" PySequenceMethods *tp_as_sequence;\n" +" PyMappingMethods *tp_as_mapping;\n" +"\n" +" /* More standard operations (here for binary compatibility) */\n" +"\n" +" hashfunc tp_hash;\n" +" ternaryfunc tp_call;\n" +" reprfunc tp_str;\n" +" getattrofunc tp_getattro;\n" +" setattrofunc tp_setattro;\n" +"\n" +" /* Functions to access object as input/output buffer */\n" +" PyBufferProcs *tp_as_buffer;\n" +"\n" +" /* Flags to define presence of optional/expanded features */\n" +" unsigned long tp_flags;\n" +"\n" +" const char *tp_doc; /* Documentation string */\n" +"\n" +" /* Assigned meaning in release 2.0 */\n" +" /* call function for all accessible objects */\n" +" traverseproc tp_traverse;\n" +"\n" +" /* delete references to contained objects */\n" +" inquiry tp_clear;\n" +"\n" +" /* Assigned meaning in release 2.1 */\n" +" /* rich comparisons */\n" +" richcmpfunc tp_richcompare;\n" +"\n" +" /* weak reference enabler */\n" +" Py_ssize_t tp_weaklistoffset;\n" +"\n" +" /* Iterators */\n" +" getiterfunc tp_iter;\n" +" iternextfunc tp_iternext;\n" +"\n" +" /* Attribute descriptor and subclassing stuff */\n" +" struct PyMethodDef *tp_methods;\n" +" struct PyMemberDef *tp_members;\n" +" struct PyGetSetDef *tp_getset;\n" +" // Strong reference on a heap type, borrowed reference on a static type\n" +" struct _typeobject *tp_base;\n" +" PyObject *tp_dict;\n" +" descrgetfunc tp_descr_get;\n" +" descrsetfunc tp_descr_set;\n" +" Py_ssize_t tp_dictoffset;\n" +" initproc tp_init;\n" +" allocfunc tp_alloc;\n" +" newfunc tp_new;\n" +" freefunc tp_free; /* Low-level free-memory routine */\n" +" inquiry tp_is_gc; /* For PyObject_IS_GC */\n" +" PyObject *tp_bases;\n" +" PyObject *tp_mro; /* method resolution order */\n" +" PyObject *tp_cache;\n" +" PyObject *tp_subclasses;\n" +" PyObject *tp_weaklist;\n" +" destructor tp_del;\n" +"\n" +" /* Type attribute cache version tag. Added in version 2.6 */\n" +" unsigned int tp_version_tag;\n" +"\n" +" destructor tp_finalize;\n" +" vectorcallfunc tp_vectorcall;\n" +"\n" +" /* bitset of which type-watchers care about this type */\n" +" unsigned char tp_watched;\n" +"} PyTypeObject;\n" +msgstr "" + +msgid "" +"Now that's a *lot* of methods. Don't worry too much though -- if you have a " +"type you want to define, the chances are very good that you will only " +"implement a handful of these." +msgstr "" +"Тепер це *багато* методів. Однак не надто хвилюйтеся - якщо у вас є тип, " +"який ви хочете визначити, дуже високі шанси, що ви реалізуєте лише кілька з " +"них." + +msgid "" +"As you probably expect by now, we're going to go over this and give more " +"information about the various handlers. We won't go in the order they are " +"defined in the structure, because there is a lot of historical baggage that " +"impacts the ordering of the fields. It's often easiest to find an example " +"that includes the fields you need and then change the values to suit your " +"new type. ::" +msgstr "" +"Як ви, мабуть, очікуєте, ми розглянемо це та надамо більше інформації про " +"різні обробники. Ми не будемо йти в тому порядку, в якому вони визначені в " +"структурі, тому що існує багато історичного багажу, який впливає на порядок " +"розташування полів. Зазвичай найлегше знайти приклад, який містить потрібні " +"вам поля, а потім змінити значення відповідно до нового типу. ::" + +msgid "const char *tp_name; /* For printing */" +msgstr "" + +msgid "" +"The name of the type -- as mentioned in the previous chapter, this will " +"appear in various places, almost entirely for diagnostic purposes. Try to " +"choose something that will be helpful in such a situation! ::" +msgstr "" +"Назва типу — як згадувалося в попередньому розділі, вона з’являтиметься в " +"різних місцях, майже виключно для діагностичних цілей. Спробуйте вибрати те, " +"що допоможе в такій ситуації! ::" + +msgid "Py_ssize_t tp_basicsize, tp_itemsize; /* For allocation */" +msgstr "" + +msgid "" +"These fields tell the runtime how much memory to allocate when new objects " +"of this type are created. Python has some built-in support for variable " +"length structures (think: strings, tuples) which is where the :c:member:" +"`~PyTypeObject.tp_itemsize` field comes in. This will be dealt with " +"later. ::" +msgstr "" +"Ці поля повідомляють середовищі виконання, скільки пам’яті виділяти під час " +"створення нових об’єктів цього типу. У Python є деяка вбудована підтримка " +"структур змінної довжини (наприклад, рядків, кортежів), у яких і з’являється " +"поле :c:member:`~PyTypeObject.tp_itemsize`. Це буде розглянуто пізніше. ::" + +msgid "const char *tp_doc;" +msgstr "" + +msgid "" +"Here you can put a string (or its address) that you want returned when the " +"Python script references ``obj.__doc__`` to retrieve the doc string." +msgstr "" +"Тут ви можете розмістити рядок (або його адресу), який ви хочете повернути, " +"коли сценарій Python посилається на ``obj.__doc__`` для отримання рядка " +"документа." + +msgid "" +"Now we come to the basic type methods -- the ones most extension types will " +"implement." +msgstr "" +"Тепер ми підходимо до методів базового типу — тих, які реалізовуватимуть " +"більшість типів розширень." + +msgid "Finalization and De-allocation" +msgstr "Завершення та де-розподіл" + +msgid "destructor tp_dealloc;" +msgstr "" + +msgid "" +"This function is called when the reference count of the instance of your " +"type is reduced to zero and the Python interpreter wants to reclaim it. If " +"your type has memory to free or other clean-up to perform, you can put it " +"here. The object itself needs to be freed here as well. Here is an example " +"of this function::" +msgstr "" +"Ця функція викликається, коли кількість посилань екземпляра вашого типу " +"зменшується до нуля, і інтерпретатор Python хоче відновити його. Якщо у " +"вашому типі є пам’ять, яку потрібно звільнити або виконати інше очищення, ви " +"можете розмістити це тут. Тут також потрібно звільнити сам об'єкт. Ось " +"приклад цієї функції:" + +msgid "" +"static void\n" +"newdatatype_dealloc(newdatatypeobject *obj)\n" +"{\n" +" free(obj->obj_UnderlyingDatatypePtr);\n" +" Py_TYPE(obj)->tp_free((PyObject *)obj);\n" +"}" +msgstr "" + +msgid "" +"If your type supports garbage collection, the destructor should call :c:func:" +"`PyObject_GC_UnTrack` before clearing any member fields::" +msgstr "" +"Якщо ваш тип підтримує збирання сміття, деструктор має викликати :c:func:" +"`PyObject_GC_UnTrack` перед очищенням будь-яких полів-членів::" + +msgid "" +"static void\n" +"newdatatype_dealloc(newdatatypeobject *obj)\n" +"{\n" +" PyObject_GC_UnTrack(obj);\n" +" Py_CLEAR(obj->other_obj);\n" +" ...\n" +" Py_TYPE(obj)->tp_free((PyObject *)obj);\n" +"}" +msgstr "" + +msgid "" +"One important requirement of the deallocator function is that it leaves any " +"pending exceptions alone. This is important since deallocators are " +"frequently called as the interpreter unwinds the Python stack; when the " +"stack is unwound due to an exception (rather than normal returns), nothing " +"is done to protect the deallocators from seeing that an exception has " +"already been set. Any actions which a deallocator performs which may cause " +"additional Python code to be executed may detect that an exception has been " +"set. This can lead to misleading errors from the interpreter. The proper " +"way to protect against this is to save a pending exception before performing " +"the unsafe action, and restoring it when done. This can be done using the :" +"c:func:`PyErr_Fetch` and :c:func:`PyErr_Restore` functions::" +msgstr "" +"Однією з важливих вимог до функції розповсюджувача є те, що вона залишає " +"будь-які незавершені винятки. Це важливо, оскільки делокатори часто " +"викликаються, коли інтерпретатор розгортає стек Python; коли стек " +"розгортається через виняток (а не звичайні повернення), нічого не робиться " +"для захисту розповсюджувачів від того, що виняток уже встановлено. Будь-які " +"дії, які виконує розповсюджувач, які можуть спричинити виконання додаткового " +"коду Python, можуть виявити, що встановлено виняток. Це може призвести до " +"оманливих помилок перекладача. Правильний спосіб захисту від цього — " +"зберегти очікуваний виняток перед виконанням небезпечної дії та відновити " +"його після завершення. Це можна зробити за допомогою функцій :c:func:" +"`PyErr_Fetch` і :c:func:`PyErr_Restore`:" + +msgid "" +"static void\n" +"my_dealloc(PyObject *obj)\n" +"{\n" +" MyObject *self = (MyObject *) obj;\n" +" PyObject *cbresult;\n" +"\n" +" if (self->my_callback != NULL) {\n" +" PyObject *err_type, *err_value, *err_traceback;\n" +"\n" +" /* This saves the current exception state */\n" +" PyErr_Fetch(&err_type, &err_value, &err_traceback);\n" +"\n" +" cbresult = PyObject_CallNoArgs(self->my_callback);\n" +" if (cbresult == NULL)\n" +" PyErr_WriteUnraisable(self->my_callback);\n" +" else\n" +" Py_DECREF(cbresult);\n" +"\n" +" /* This restores the saved exception state */\n" +" PyErr_Restore(err_type, err_value, err_traceback);\n" +"\n" +" Py_DECREF(self->my_callback);\n" +" }\n" +" Py_TYPE(obj)->tp_free((PyObject*)self);\n" +"}" +msgstr "" + +msgid "" +"There are limitations to what you can safely do in a deallocator function. " +"First, if your type supports garbage collection (using :c:member:" +"`~PyTypeObject.tp_traverse` and/or :c:member:`~PyTypeObject.tp_clear`), some " +"of the object's members can have been cleared or finalized by the time :c:" +"member:`~PyTypeObject.tp_dealloc` is called. Second, in :c:member:" +"`~PyTypeObject.tp_dealloc`, your object is in an unstable state: its " +"reference count is equal to zero. Any call to a non-trivial object or API " +"(as in the example above) might end up calling :c:member:`~PyTypeObject." +"tp_dealloc` again, causing a double free and a crash." +msgstr "" +"Існують обмеження щодо того, що ви можете безпечно робити у функції " +"розповсюджувача. По-перше, якщо ваш тип підтримує збирання сміття (за " +"допомогою :c:member:`~PyTypeObject.tp_traverse` та/або :c:member:" +"`~PyTypeObject.tp_clear`), деякі члени об’єкта можуть бути очищені або " +"завершені за допомогою час виклику :c:member:`~PyTypeObject.tp_dealloc`. По-" +"друге, у :c:member:`~PyTypeObject.tp_dealloc` ваш об’єкт перебуває в " +"нестабільному стані: його кількість посилань дорівнює нулю. Будь-який виклик " +"нетривіального об’єкта або API (як у наведеному вище прикладі) може " +"призвести до повторного виклику :c:member:`~PyTypeObject.tp_dealloc`, " +"викликаючи подвійне звільнення та збій." + +msgid "" +"Starting with Python 3.4, it is recommended not to put any complex " +"finalization code in :c:member:`~PyTypeObject.tp_dealloc`, and instead use " +"the new :c:member:`~PyTypeObject.tp_finalize` type method." +msgstr "" +"Починаючи з Python 3.4, рекомендується не розміщувати будь-який складний код " +"фіналізації в :c:member:`~PyTypeObject.tp_dealloc`, а замість цього " +"використовувати новий метод типу :c:member:`~PyTypeObject.tp_finalize`." + +msgid ":pep:`442` explains the new finalization scheme." +msgstr ":pep:`442` пояснює нову схему завершення." + +msgid "Object Presentation" +msgstr "Презентація об’єкта" + +msgid "" +"In Python, there are two ways to generate a textual representation of an " +"object: the :func:`repr` function, and the :func:`str` function. (The :func:" +"`print` function just calls :func:`str`.) These handlers are both optional." +msgstr "" +"У Python існує два способи створення текстового представлення об’єкта: " +"функція :func:`repr` і функція :func:`str`. (Функція :func:`print` просто " +"викликає :func:`str`.) Ці обробники є необов’язковими." + +msgid "" +"reprfunc tp_repr;\n" +"reprfunc tp_str;" +msgstr "" + +msgid "" +"The :c:member:`~PyTypeObject.tp_repr` handler should return a string object " +"containing a representation of the instance for which it is called. Here is " +"a simple example::" +msgstr "" +"Обробник :c:member:`~PyTypeObject.tp_repr` має повертати рядковий об’єкт, що " +"містить представлення примірника, для якого він викликається. Ось простий " +"приклад::" + +msgid "" +"static PyObject *\n" +"newdatatype_repr(newdatatypeobject *obj)\n" +"{\n" +" return PyUnicode_FromFormat(\"Repr-ified_newdatatype{{size:%d}}\",\n" +" obj->obj_UnderlyingDatatypePtr->size);\n" +"}" +msgstr "" + +msgid "" +"If no :c:member:`~PyTypeObject.tp_repr` handler is specified, the " +"interpreter will supply a representation that uses the type's :c:member:" +"`~PyTypeObject.tp_name` and a uniquely identifying value for the object." +msgstr "" + +msgid "" +"The :c:member:`~PyTypeObject.tp_str` handler is to :func:`str` what the :c:" +"member:`~PyTypeObject.tp_repr` handler described above is to :func:`repr`; " +"that is, it is called when Python code calls :func:`str` on an instance of " +"your object. Its implementation is very similar to the :c:member:" +"`~PyTypeObject.tp_repr` function, but the resulting string is intended for " +"human consumption. If :c:member:`~PyTypeObject.tp_str` is not specified, " +"the :c:member:`~PyTypeObject.tp_repr` handler is used instead." +msgstr "" +"Обробник :c:member:`~PyTypeObject.tp_str` є :func:`str` тим же, що описаний " +"вище обробник :c:member:`~PyTypeObject.tp_repr` :func:`repr`; тобто він " +"викликається, коли код Python викликає :func:`str` для екземпляра вашого " +"об’єкта. Його реалізація дуже схожа на функцію :c:member:`~PyTypeObject." +"tp_repr`, але отриманий рядок призначений для використання людиною. Якщо :c:" +"member:`~PyTypeObject.tp_str` не вказано, замість нього використовується " +"обробник :c:member:`~PyTypeObject.tp_repr`." + +msgid "Here is a simple example::" +msgstr "Ось простий приклад::" + +msgid "" +"static PyObject *\n" +"newdatatype_str(newdatatypeobject *obj)\n" +"{\n" +" return PyUnicode_FromFormat(\"Stringified_newdatatype{{size:%d}}\",\n" +" obj->obj_UnderlyingDatatypePtr->size);\n" +"}" +msgstr "" + +msgid "Attribute Management" +msgstr "Управління атрибутами" + +msgid "" +"For every object which can support attributes, the corresponding type must " +"provide the functions that control how the attributes are resolved. There " +"needs to be a function which can retrieve attributes (if any are defined), " +"and another to set attributes (if setting attributes is allowed). Removing " +"an attribute is a special case, for which the new value passed to the " +"handler is ``NULL``." +msgstr "" +"Для кожного об’єкта, який може підтримувати атрибути, відповідний тип " +"повинен забезпечувати функції, які контролюють, як атрибути вирішуються. " +"Потрібна функція, яка може отримувати атрибути (якщо такі визначені), і інша " +"для встановлення атрибутів (якщо встановлення атрибутів дозволено). " +"Видалення атрибута є особливим випадком, для якого нове значення, передане " +"обробнику, є ``NULL``." + +msgid "" +"Python supports two pairs of attribute handlers; a type that supports " +"attributes only needs to implement the functions for one pair. The " +"difference is that one pair takes the name of the attribute as a :c:expr:" +"`char\\*`, while the other accepts a :c:expr:`PyObject*`. Each type can use " +"whichever pair makes more sense for the implementation's convenience. ::" +msgstr "" + +msgid "" +"getattrfunc tp_getattr; /* char * version */\n" +"setattrfunc tp_setattr;\n" +"/* ... */\n" +"getattrofunc tp_getattro; /* PyObject * version */\n" +"setattrofunc tp_setattro;" +msgstr "" + +msgid "" +"If accessing attributes of an object is always a simple operation (this will " +"be explained shortly), there are generic implementations which can be used " +"to provide the :c:expr:`PyObject*` version of the attribute management " +"functions. The actual need for type-specific attribute handlers almost " +"completely disappeared starting with Python 2.2, though there are many " +"examples which have not been updated to use some of the new generic " +"mechanism that is available." +msgstr "" + +msgid "Generic Attribute Management" +msgstr "Керування загальними атрибутами" + +msgid "" +"Most extension types only use *simple* attributes. So, what makes the " +"attributes simple? There are only a couple of conditions that must be met:" +msgstr "" +"Більшість типів розширень використовують лише *прості* атрибути. Отже, що " +"робить атрибути простими? Необхідно виконати лише кілька умов:" + +msgid "" +"The name of the attributes must be known when :c:func:`PyType_Ready` is " +"called." +msgstr "" +"Під час виклику :c:func:`PyType_Ready` мають бути відомі назви атрибутів." + +msgid "" +"No special processing is needed to record that an attribute was looked up or " +"set, nor do actions need to be taken based on the value." +msgstr "" +"Ніякої спеціальної обробки не потрібно, щоб записати, що атрибут було " +"знайдено або встановлено, а також не потрібно виконувати дії на основі " +"значення." + +msgid "" +"Note that this list does not place any restrictions on the values of the " +"attributes, when the values are computed, or how relevant data is stored." +msgstr "" +"Зауважте, що цей список не накладає жодних обмежень на значення атрибутів, " +"час обчислення значень або спосіб зберігання відповідних даних." + +msgid "" +"When :c:func:`PyType_Ready` is called, it uses three tables referenced by " +"the type object to create :term:`descriptor`\\s which are placed in the " +"dictionary of the type object. Each descriptor controls access to one " +"attribute of the instance object. Each of the tables is optional; if all " +"three are ``NULL``, instances of the type will only have attributes that are " +"inherited from their base type, and should leave the :c:member:" +"`~PyTypeObject.tp_getattro` and :c:member:`~PyTypeObject.tp_setattro` fields " +"``NULL`` as well, allowing the base type to handle attributes." +msgstr "" +"Коли викликається :c:func:`PyType_Ready`, він використовує три таблиці, на " +"які посилається об’єкт типу, щоб створити :term:`descriptor`\\, які " +"розміщуються в словнику об’єкта типу. Кожен дескриптор керує доступом до " +"одного атрибута об'єкта екземпляра. Кожна з таблиць необов'язкова; якщо всі " +"три мають значення ``NULL``, екземпляри типу матимуть лише атрибути, " +"успадковані від їх базового типу, і повинні залишити поля :c:member:" +"`~PyTypeObject.tp_getattro` і :c:member:`~PyTypeObject.tp_setattro` як " +"``NULL``, що дозволяє базовому типу обробляти атрибути." + +msgid "The tables are declared as three fields of the type object::" +msgstr "Таблиці оголошуються як три поля типу object::" + +msgid "" +"struct PyMethodDef *tp_methods;\n" +"struct PyMemberDef *tp_members;\n" +"struct PyGetSetDef *tp_getset;" +msgstr "" + +msgid "" +"If :c:member:`~PyTypeObject.tp_methods` is not ``NULL``, it must refer to an " +"array of :c:type:`PyMethodDef` structures. Each entry in the table is an " +"instance of this structure::" +msgstr "" +"Якщо :c:member:`~PyTypeObject.tp_methods` не є ``NULL``, він має посилатися " +"на масив структур :c:type:`PyMethodDef`. Кожен запис у таблиці є екземпляром " +"цієї структури:" + +msgid "" +"typedef struct PyMethodDef {\n" +" const char *ml_name; /* method name */\n" +" PyCFunction ml_meth; /* implementation function */\n" +" int ml_flags; /* flags */\n" +" const char *ml_doc; /* docstring */\n" +"} PyMethodDef;" +msgstr "" + +msgid "" +"One entry should be defined for each method provided by the type; no entries " +"are needed for methods inherited from a base type. One additional entry is " +"needed at the end; it is a sentinel that marks the end of the array. The :c:" +"member:`~PyMethodDef.ml_name` field of the sentinel must be ``NULL``." +msgstr "" + +msgid "" +"The second table is used to define attributes which map directly to data " +"stored in the instance. A variety of primitive C types are supported, and " +"access may be read-only or read-write. The structures in the table are " +"defined as::" +msgstr "" +"Друга таблиця використовується для визначення атрибутів, які відображаються " +"безпосередньо на дані, що зберігаються в екземплярі. Підтримуються " +"різноманітні примітивні типи C, і доступ може бути лише для читання або " +"читання-запису. Структури в таблиці визначені як:" + +msgid "" +"typedef struct PyMemberDef {\n" +" const char *name;\n" +" int type;\n" +" int offset;\n" +" int flags;\n" +" const char *doc;\n" +"} PyMemberDef;" +msgstr "" + +msgid "" +"For each entry in the table, a :term:`descriptor` will be constructed and " +"added to the type which will be able to extract a value from the instance " +"structure. The :c:member:`~PyMemberDef.type` field should contain a type " +"code like :c:macro:`Py_T_INT` or :c:macro:`Py_T_DOUBLE`; the value will be " +"used to determine how to convert Python values to and from C values. The :c:" +"member:`~PyMemberDef.flags` field is used to store flags which control how " +"the attribute can be accessed: you can set it to :c:macro:`Py_READONLY` to " +"prevent Python code from setting it." +msgstr "" + +msgid "" +"An interesting advantage of using the :c:member:`~PyTypeObject.tp_members` " +"table to build descriptors that are used at runtime is that any attribute " +"defined this way can have an associated doc string simply by providing the " +"text in the table. An application can use the introspection API to retrieve " +"the descriptor from the class object, and get the doc string using its :attr:" +"`~type.__doc__` attribute." +msgstr "" + +msgid "" +"As with the :c:member:`~PyTypeObject.tp_methods` table, a sentinel entry " +"with a :c:member:`~PyMethodDef.ml_name` value of ``NULL`` is required." +msgstr "" + +msgid "Type-specific Attribute Management" +msgstr "Типозалежне керування атрибутами" + +msgid "" +"For simplicity, only the :c:expr:`char\\*` version will be demonstrated " +"here; the type of the name parameter is the only difference between the :c:" +"expr:`char\\*` and :c:expr:`PyObject*` flavors of the interface. This " +"example effectively does the same thing as the generic example above, but " +"does not use the generic support added in Python 2.2. It explains how the " +"handler functions are called, so that if you do need to extend their " +"functionality, you'll understand what needs to be done." +msgstr "" + +msgid "" +"The :c:member:`~PyTypeObject.tp_getattr` handler is called when the object " +"requires an attribute look-up. It is called in the same situations where " +"the :meth:`~object.__getattr__` method of a class would be called." +msgstr "" + +msgid "Here is an example::" +msgstr "Ось приклад::" + +msgid "" +"static PyObject *\n" +"newdatatype_getattr(newdatatypeobject *obj, char *name)\n" +"{\n" +" if (strcmp(name, \"data\") == 0)\n" +" {\n" +" return PyLong_FromLong(obj->data);\n" +" }\n" +"\n" +" PyErr_Format(PyExc_AttributeError,\n" +" \"'%.100s' object has no attribute '%.400s'\",\n" +" Py_TYPE(obj)->tp_name, name);\n" +" return NULL;\n" +"}" +msgstr "" + +msgid "" +"The :c:member:`~PyTypeObject.tp_setattr` handler is called when the :meth:" +"`~object.__setattr__` or :meth:`~object.__delattr__` method of a class " +"instance would be called. When an attribute should be deleted, the third " +"parameter will be ``NULL``. Here is an example that simply raises an " +"exception; if this were really all you wanted, the :c:member:`~PyTypeObject." +"tp_setattr` handler should be set to ``NULL``. ::" +msgstr "" + +msgid "" +"static int\n" +"newdatatype_setattr(newdatatypeobject *obj, char *name, PyObject *v)\n" +"{\n" +" PyErr_Format(PyExc_RuntimeError, \"Read-only attribute: %s\", name);\n" +" return -1;\n" +"}" +msgstr "" + +msgid "Object Comparison" +msgstr "Порівняння об’єктів" + +msgid "richcmpfunc tp_richcompare;" +msgstr "" + +msgid "" +"The :c:member:`~PyTypeObject.tp_richcompare` handler is called when " +"comparisons are needed. It is analogous to the :ref:`rich comparison " +"methods `, like :meth:`!__lt__`, and also called by :c:func:" +"`PyObject_RichCompare` and :c:func:`PyObject_RichCompareBool`." +msgstr "" + +msgid "" +"This function is called with two Python objects and the operator as " +"arguments, where the operator is one of ``Py_EQ``, ``Py_NE``, ``Py_LE``, " +"``Py_GE``, ``Py_LT`` or ``Py_GT``. It should compare the two objects with " +"respect to the specified operator and return ``Py_True`` or ``Py_False`` if " +"the comparison is successful, ``Py_NotImplemented`` to indicate that " +"comparison is not implemented and the other object's comparison method " +"should be tried, or ``NULL`` if an exception was set." +msgstr "" +"Ця функція викликається з двома об’єктами Python і оператором як " +"аргументами, де оператор є одним із ``Py_EQ``, ``Py_NE``, ``Py_LE``, " +"``Py_GE``, ``Py_LT`` або ``Py_GT``. Він має порівняти два об’єкти щодо " +"вказаного оператора та повернути ``Py_True`` або ``Py_False``, якщо " +"порівняння успішне, ``Py_NotImplemented``, щоб вказати, що порівняння не " +"реалізовано, а метод порівняння іншого об’єкта має спробувати, або ``NULL``, " +"якщо встановлено виняток." + +msgid "" +"Here is a sample implementation, for a datatype that is considered equal if " +"the size of an internal pointer is equal::" +msgstr "" +"Ось приклад реалізації для типу даних, який вважається рівним, якщо розмір " +"внутрішнього покажчика дорівнює:" + +msgid "" +"static PyObject *\n" +"newdatatype_richcmp(newdatatypeobject *obj1, newdatatypeobject *obj2, int " +"op)\n" +"{\n" +" PyObject *result;\n" +" int c, size1, size2;\n" +"\n" +" /* code to make sure that both arguments are of type\n" +" newdatatype omitted */\n" +"\n" +" size1 = obj1->obj_UnderlyingDatatypePtr->size;\n" +" size2 = obj2->obj_UnderlyingDatatypePtr->size;\n" +"\n" +" switch (op) {\n" +" case Py_LT: c = size1 < size2; break;\n" +" case Py_LE: c = size1 <= size2; break;\n" +" case Py_EQ: c = size1 == size2; break;\n" +" case Py_NE: c = size1 != size2; break;\n" +" case Py_GT: c = size1 > size2; break;\n" +" case Py_GE: c = size1 >= size2; break;\n" +" }\n" +" result = c ? Py_True : Py_False;\n" +" Py_INCREF(result);\n" +" return result;\n" +" }" +msgstr "" + +msgid "Abstract Protocol Support" +msgstr "Підтримка абстрактного протоколу" + +msgid "" +"Python supports a variety of *abstract* 'protocols;' the specific interfaces " +"provided to use these interfaces are documented in :ref:`abstract`." +msgstr "" +"Python підтримує різноманітні *абстрактні* \"протоколи\"; спеціальні " +"інтерфейси, надані для використання цих інтерфейсів, задокументовані в :ref:" +"`abstract`." + +msgid "" +"A number of these abstract interfaces were defined early in the development " +"of the Python implementation. In particular, the number, mapping, and " +"sequence protocols have been part of Python since the beginning. Other " +"protocols have been added over time. For protocols which depend on several " +"handler routines from the type implementation, the older protocols have been " +"defined as optional blocks of handlers referenced by the type object. For " +"newer protocols there are additional slots in the main type object, with a " +"flag bit being set to indicate that the slots are present and should be " +"checked by the interpreter. (The flag bit does not indicate that the slot " +"values are non-``NULL``. The flag may be set to indicate the presence of a " +"slot, but a slot may still be unfilled.) ::" +msgstr "" +"Деякі з цих абстрактних інтерфейсів були визначені на початку розробки " +"реалізації Python. Зокрема, протоколи чисел, відображення та послідовності " +"були частиною Python з самого початку. З часом були додані інші протоколи. " +"Для протоколів, які залежать від кількох підпрограм обробників із реалізації " +"типу, старіші протоколи були визначені як додаткові блоки обробників, на які " +"посилається об’єкт типу. Для новіших протоколів є додаткові слоти в об’єкті " +"основного типу, із встановленим бітом прапора, який вказує, що слоти " +"присутні та повинні бути перевірені інтерпретатором. (Біт прапора не вказує " +"на те, що значення слота не є ``NULL``. Прапор може бути встановлений для " +"вказівки на наявність слота, але слот все ще може бути незаповненим.) ::" + +msgid "" +"PyNumberMethods *tp_as_number;\n" +"PySequenceMethods *tp_as_sequence;\n" +"PyMappingMethods *tp_as_mapping;" +msgstr "" + +msgid "" +"If you wish your object to be able to act like a number, a sequence, or a " +"mapping object, then you place the address of a structure that implements " +"the C type :c:type:`PyNumberMethods`, :c:type:`PySequenceMethods`, or :c:" +"type:`PyMappingMethods`, respectively. It is up to you to fill in this " +"structure with appropriate values. You can find examples of the use of each " +"of these in the :file:`Objects` directory of the Python source " +"distribution. ::" +msgstr "" +"Якщо ви бажаєте, щоб ваш об’єкт діяв як число, послідовність або об’єкт " +"відображення, тоді ви розміщуєте адресу структури, яка реалізує тип C :c:" +"type:`PyNumberMethods`, :c:type:`PySequenceMethods` або :c:type:" +"`PyMappingMethods` відповідно. Ви повинні заповнити цю структуру " +"відповідними значеннями. Ви можете знайти приклади використання кожного з " +"них у каталозі :file:`Objects` вихідного коду Python. ::" + +msgid "hashfunc tp_hash;" +msgstr "" + +msgid "" +"This function, if you choose to provide it, should return a hash number for " +"an instance of your data type. Here is a simple example::" +msgstr "" +"Ця функція, якщо ви вирішите її надати, має повертати хеш-номер для " +"екземпляра вашого типу даних. Ось простий приклад::" + +msgid "" +"static Py_hash_t\n" +"newdatatype_hash(newdatatypeobject *obj)\n" +"{\n" +" Py_hash_t result;\n" +" result = obj->some_size + 32767 * obj->some_number;\n" +" if (result == -1)\n" +" result = -2;\n" +" return result;\n" +"}" +msgstr "" + +msgid "" +":c:type:`Py_hash_t` is a signed integer type with a platform-varying width. " +"Returning ``-1`` from :c:member:`~PyTypeObject.tp_hash` indicates an error, " +"which is why you should be careful to avoid returning it when hash " +"computation is successful, as seen above." +msgstr "" +":c:type:`Py_hash_t` — це цілочисельний тип зі знаком зі змінною шириною " +"платформи. Повернення ``-1`` із :c:member:`~PyTypeObject.tp_hash` вказує на " +"помилку, тому ви повинні бути обережними, щоб не повертати його, коли " +"обчислення хешу успішне, як показано вище." + +msgid "ternaryfunc tp_call;" +msgstr "" + +msgid "" +"This function is called when an instance of your data type is \"called\", " +"for example, if ``obj1`` is an instance of your data type and the Python " +"script contains ``obj1('hello')``, the :c:member:`~PyTypeObject.tp_call` " +"handler is invoked." +msgstr "" +"Ця функція викликається, коли \"викликається\" екземпляр вашого типу даних, " +"наприклад, якщо ``obj1`` є екземпляром вашого типу даних і сценарій Python " +"містить ``obj1('hello')``, то :c:member:`~PyTypeObject.tp_call` обробник " +"викликається." + +msgid "This function takes three arguments:" +msgstr "Ця функція приймає три аргументи:" + +msgid "" +"*self* is the instance of the data type which is the subject of the call. If " +"the call is ``obj1('hello')``, then *self* is ``obj1``." +msgstr "" +"*self* — це екземпляр типу даних, який є предметом виклику. Якщо виклик " +"``obj1('hello')``, то *self* є ``obj1``." + +msgid "" +"*args* is a tuple containing the arguments to the call. You can use :c:func:" +"`PyArg_ParseTuple` to extract the arguments." +msgstr "" +"*args* — це кортеж, що містить аргументи виклику. Ви можете використовувати :" +"c:func:`PyArg_ParseTuple`, щоб отримати аргументи." + +msgid "" +"*kwds* is a dictionary of keyword arguments that were passed. If this is non-" +"``NULL`` and you support keyword arguments, use :c:func:" +"`PyArg_ParseTupleAndKeywords` to extract the arguments. If you do not want " +"to support keyword arguments and this is non-``NULL``, raise a :exc:" +"`TypeError` with a message saying that keyword arguments are not supported." +msgstr "" +"*kwds* — це словник переданих ключових аргументів. Якщо це не ``NULL`` і ви " +"підтримуєте аргументи ключових слів, використовуйте :c:func:" +"`PyArg_ParseTupleAndKeywords`, щоб отримати аргументи. Якщо ви не хочете " +"підтримувати аргументи ключових слів і це не ``NULL``, викличте :exc:" +"`TypeError` із повідомленням про те, що аргументи ключових слів не " +"підтримуються." + +msgid "Here is a toy ``tp_call`` implementation::" +msgstr "Ось реалізація іграшки ``tp_call``::" + +msgid "" +"static PyObject *\n" +"newdatatype_call(newdatatypeobject *obj, PyObject *args, PyObject *kwds)\n" +"{\n" +" PyObject *result;\n" +" const char *arg1;\n" +" const char *arg2;\n" +" const char *arg3;\n" +"\n" +" if (!PyArg_ParseTuple(args, \"sss:call\", &arg1, &arg2, &arg3)) {\n" +" return NULL;\n" +" }\n" +" result = PyUnicode_FromFormat(\n" +" \"Returning -- value: [%d] arg1: [%s] arg2: [%s] arg3: [%s]\\n\",\n" +" obj->obj_UnderlyingDatatypePtr->size,\n" +" arg1, arg2, arg3);\n" +" return result;\n" +"}" +msgstr "" + +msgid "" +"/* Iterators */\n" +"getiterfunc tp_iter;\n" +"iternextfunc tp_iternext;" +msgstr "" + +msgid "" +"These functions provide support for the iterator protocol. Both handlers " +"take exactly one parameter, the instance for which they are being called, " +"and return a new reference. In the case of an error, they should set an " +"exception and return ``NULL``. :c:member:`~PyTypeObject.tp_iter` " +"corresponds to the Python :meth:`~object.__iter__` method, while :c:member:" +"`~PyTypeObject.tp_iternext` corresponds to the Python :meth:`~iterator." +"__next__` method." +msgstr "" + +msgid "" +"Any :term:`iterable` object must implement the :c:member:`~PyTypeObject." +"tp_iter` handler, which must return an :term:`iterator` object. Here the " +"same guidelines apply as for Python classes:" +msgstr "" +"Будь-який об’єкт :term:`iterable` повинен реалізовувати обробник :c:member:" +"`~PyTypeObject.tp_iter`, який має повертати об’єкт :term:`iterator`. Тут " +"застосовуються ті самі правила, що й для класів Python:" + +msgid "" +"For collections (such as lists and tuples) which can support multiple " +"independent iterators, a new iterator should be created and returned by each " +"call to :c:member:`~PyTypeObject.tp_iter`." +msgstr "" +"Для колекцій (таких як списки та кортежі), які можуть підтримувати кілька " +"незалежних ітераторів, новий ітератор слід створювати та повертати під час " +"кожного виклику :c:member:`~PyTypeObject.tp_iter`." + +msgid "" +"Objects which can only be iterated over once (usually due to side effects of " +"iteration, such as file objects) can implement :c:member:`~PyTypeObject." +"tp_iter` by returning a new reference to themselves -- and should also " +"therefore implement the :c:member:`~PyTypeObject.tp_iternext` handler." +msgstr "" +"Об’єкти, які можна повторити лише один раз (зазвичай через побічні ефекти " +"ітерації, такі як файлові об’єкти), можуть реалізувати :c:member:" +"`~PyTypeObject.tp_iter`, повертаючи нове посилання на себе — і тому також " +"повинні реалізувати :c:member:`~PyTypeObject.tp_iternext` обробник." + +msgid "" +"Any :term:`iterator` object should implement both :c:member:`~PyTypeObject." +"tp_iter` and :c:member:`~PyTypeObject.tp_iternext`. An iterator's :c:member:" +"`~PyTypeObject.tp_iter` handler should return a new reference to the " +"iterator. Its :c:member:`~PyTypeObject.tp_iternext` handler should return a " +"new reference to the next object in the iteration, if there is one. If the " +"iteration has reached the end, :c:member:`~PyTypeObject.tp_iternext` may " +"return ``NULL`` without setting an exception, or it may set :exc:" +"`StopIteration` *in addition* to returning ``NULL``; avoiding the exception " +"can yield slightly better performance. If an actual error occurs, :c:member:" +"`~PyTypeObject.tp_iternext` should always set an exception and return " +"``NULL``." +msgstr "" +"Будь-який об’єкт :term:`iterator` повинен реалізовувати як :c:member:" +"`~PyTypeObject.tp_iter`, так і :c:member:`~PyTypeObject.tp_iternext`. " +"Обробник :c:member:`~PyTypeObject.tp_iter` ітератора має повертати нове " +"посилання на ітератор. Його :c:member:`~PyTypeObject.tp_iternext` обробник " +"має повернути нове посилання на наступний об’єкт у ітерації, якщо він є. " +"Якщо ітерація досягла кінця, :c:member:`~PyTypeObject.tp_iternext` може " +"повернути ``NULL`` без встановлення винятку, або він може встановити :exc:" +"`StopIteration` *на додаток* до повернення ``NULL``; уникнення винятку може " +"дати трохи кращу продуктивність. Якщо сталася фактична помилка, :c:member:" +"`~PyTypeObject.tp_iternext` має завжди встановлювати виняток і повертати " +"``NULL``." + +msgid "Weak Reference Support" +msgstr "Слабка довідкова підтримка" + +msgid "" +"One of the goals of Python's weak reference implementation is to allow any " +"type to participate in the weak reference mechanism without incurring the " +"overhead on performance-critical objects (such as numbers)." +msgstr "" +"Одна з цілей реалізації слабкого посилання Python полягає в тому, щоб " +"дозволити будь-якому типу брати участь у механізмі слабкого посилання без " +"накладних витрат на критичні для продуктивності об’єкти (наприклад, числа)." + +msgid "Documentation for the :mod:`weakref` module." +msgstr "Документація для модуля :mod:`weakref`." + +msgid "" +"For an object to be weakly referenceable, the extension type must set the " +"``Py_TPFLAGS_MANAGED_WEAKREF`` bit of the :c:member:`~PyTypeObject.tp_flags` " +"field. The legacy :c:member:`~PyTypeObject.tp_weaklistoffset` field should " +"be left as zero." +msgstr "" + +msgid "" +"Concretely, here is how the statically declared type object would look::" +msgstr "" + +msgid "" +"static PyTypeObject TrivialType = {\n" +" PyVarObject_HEAD_INIT(NULL, 0)\n" +" /* ... other members omitted for brevity ... */\n" +" .tp_flags = Py_TPFLAGS_MANAGED_WEAKREF | ...,\n" +"};" +msgstr "" + +msgid "" +"The only further addition is that ``tp_dealloc`` needs to clear any weak " +"references (by calling :c:func:`PyObject_ClearWeakRefs`)::" +msgstr "" + +msgid "" +"static void\n" +"Trivial_dealloc(TrivialObject *self)\n" +"{\n" +" /* Clear weakrefs first before calling any destructors */\n" +" PyObject_ClearWeakRefs((PyObject *) self);\n" +" /* ... remainder of destruction code omitted for brevity ... */\n" +" Py_TYPE(self)->tp_free((PyObject *) self);\n" +"}" +msgstr "" + +msgid "More Suggestions" +msgstr "Більше пропозицій" + +msgid "" +"In order to learn how to implement any specific method for your new data " +"type, get the :term:`CPython` source code. Go to the :file:`Objects` " +"directory, then search the C source files for ``tp_`` plus the function you " +"want (for example, ``tp_richcompare``). You will find examples of the " +"function you want to implement." +msgstr "" +"Щоб дізнатися, як реалізувати певний метод для вашого нового типу даних, " +"отримайте вихідний код :term:`CPython`. Перейдіть до каталогу :file:" +"`Objects`, потім знайдіть у вихідних файлах C ``tp_`` і потрібну функцію " +"(наприклад, ``tp_richcompare``). Ви знайдете приклади функцій, які ви хочете " +"реалізувати." + +msgid "" +"When you need to verify that an object is a concrete instance of the type " +"you are implementing, use the :c:func:`PyObject_TypeCheck` function. A " +"sample of its use might be something like the following::" +msgstr "" +"Якщо вам потрібно перевірити, чи об’єкт є конкретним екземпляром типу, який " +"ви реалізуєте, використовуйте функцію :c:func:`PyObject_TypeCheck`. Приклад " +"його використання може бути приблизно таким:" + +msgid "" +"if (!PyObject_TypeCheck(some_object, &MyType)) {\n" +" PyErr_SetString(PyExc_TypeError, \"arg #1 not a mything\");\n" +" return NULL;\n" +"}" +msgstr "" + +msgid "Download CPython source releases." +msgstr "Завантажте вихідні версії CPython." + +msgid "https://www.python.org/downloads/source/" +msgstr "https://www.python.org/downloads/source/" + +msgid "" +"The CPython project on GitHub, where the CPython source code is developed." +msgstr "Проект CPython на GitHub, де розробляється вихідний код CPython." + +msgid "https://github.com/python/cpython" +msgstr "https://github.com/python/cpython" + +msgid "object" +msgstr "об'єкт" + +msgid "deallocation" +msgstr "" + +msgid "deallocation, object" +msgstr "" + +msgid "finalization" +msgstr "" + +msgid "finalization, of objects" +msgstr "" + +msgid "PyErr_Fetch (C function)" +msgstr "" + +msgid "PyErr_Restore (C function)" +msgstr "" + +msgid "string" +msgstr "рядок" + +msgid "object representation" +msgstr "" + +msgid "built-in function" +msgstr "вбудована функція" + +msgid "repr" +msgstr "репр" diff --git a/extending/newtypes_tutorial.po b/extending/newtypes_tutorial.po new file mode 100644 index 000000000..39aa828be --- /dev/null +++ b/extending/newtypes_tutorial.po @@ -0,0 +1,1988 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:52+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Defining Extension Types: Tutorial" +msgstr "Визначення типів розширень: підручник" + +msgid "" +"Python allows the writer of a C extension module to define new types that " +"can be manipulated from Python code, much like the built-in :class:`str` " +"and :class:`list` types. The code for all extension types follows a " +"pattern, but there are some details that you need to understand before you " +"can get started. This document is a gentle introduction to the topic." +msgstr "" +"Python дозволяє автору модуля розширення C визначати нові типи, якими можна " +"керувати з коду Python, подібно до вбудованих типів :class:`str` і :class:" +"`list`. Код для всіх типів розширень відповідає шаблону, але є деякі деталі, " +"які ви повинні зрозуміти, перш ніж почати. Цей документ є легким вступом до " +"теми." + +msgid "The Basics" +msgstr "Основи" + +msgid "" +"The :term:`CPython` runtime sees all Python objects as variables of type :c:" +"expr:`PyObject*`, which serves as a \"base type\" for all Python objects. " +"The :c:type:`PyObject` structure itself only contains the object's :term:" +"`reference count` and a pointer to the object's \"type object\". This is " +"where the action is; the type object determines which (C) functions get " +"called by the interpreter when, for instance, an attribute gets looked up on " +"an object, a method called, or it is multiplied by another object. These C " +"functions are called \"type methods\"." +msgstr "" + +msgid "" +"So, if you want to define a new extension type, you need to create a new " +"type object." +msgstr "" +"Отже, якщо ви хочете визначити новий тип розширення, вам потрібно створити " +"об’єкт нового типу." + +msgid "" +"This sort of thing can only be explained by example, so here's a minimal, " +"but complete, module that defines a new type named :class:`!Custom` inside a " +"C extension module :mod:`!custom`:" +msgstr "" + +msgid "" +"What we're showing here is the traditional way of defining *static* " +"extension types. It should be adequate for most uses. The C API also " +"allows defining heap-allocated extension types using the :c:func:" +"`PyType_FromSpec` function, which isn't covered in this tutorial." +msgstr "" +"Тут ми показуємо традиційний спосіб визначення *статичних* типів розширень. " +"Його має бути достатньо для більшості видів використання. C API також " +"дозволяє визначати типи розширень, виділених у купі, за допомогою функції :c:" +"func:`PyType_FromSpec`, яка не розглядається в цьому посібнику." + +msgid "" +"#define PY_SSIZE_T_CLEAN\n" +"#include \n" +"\n" +"typedef struct {\n" +" PyObject_HEAD\n" +" /* Type-specific fields go here. */\n" +"} CustomObject;\n" +"\n" +"static PyTypeObject CustomType = {\n" +" .ob_base = PyVarObject_HEAD_INIT(NULL, 0)\n" +" .tp_name = \"custom.Custom\",\n" +" .tp_doc = PyDoc_STR(\"Custom objects\"),\n" +" .tp_basicsize = sizeof(CustomObject),\n" +" .tp_itemsize = 0,\n" +" .tp_flags = Py_TPFLAGS_DEFAULT,\n" +" .tp_new = PyType_GenericNew,\n" +"};\n" +"\n" +"static PyModuleDef custommodule = {\n" +" .m_base = PyModuleDef_HEAD_INIT,\n" +" .m_name = \"custom\",\n" +" .m_doc = \"Example module that creates an extension type.\",\n" +" .m_size = -1,\n" +"};\n" +"\n" +"PyMODINIT_FUNC\n" +"PyInit_custom(void)\n" +"{\n" +" PyObject *m;\n" +" if (PyType_Ready(&CustomType) < 0)\n" +" return NULL;\n" +"\n" +" m = PyModule_Create(&custommodule);\n" +" if (m == NULL)\n" +" return NULL;\n" +"\n" +" if (PyModule_AddObjectRef(m, \"Custom\", (PyObject *) &CustomType) < 0) " +"{\n" +" Py_DECREF(m);\n" +" return NULL;\n" +" }\n" +"\n" +" return m;\n" +"}\n" +msgstr "" + +msgid "" +"Now that's quite a bit to take in at once, but hopefully bits will seem " +"familiar from the previous chapter. This file defines three things:" +msgstr "" +"Це досить багато, щоб зрозуміти відразу, але, сподіваюся, деталі здадуться " +"вам знайомими з попереднього розділу. Цей файл визначає три речі:" + +msgid "" +"What a :class:`!Custom` **object** contains: this is the ``CustomObject`` " +"struct, which is allocated once for each :class:`!Custom` instance." +msgstr "" + +msgid "" +"How the :class:`!Custom` **type** behaves: this is the ``CustomType`` " +"struct, which defines a set of flags and function pointers that the " +"interpreter inspects when specific operations are requested." +msgstr "" + +msgid "" +"How to initialize the :mod:`!custom` module: this is the ``PyInit_custom`` " +"function and the associated ``custommodule`` struct." +msgstr "" + +msgid "The first bit is::" +msgstr "Перший біт::" + +msgid "" +"typedef struct {\n" +" PyObject_HEAD\n" +"} CustomObject;" +msgstr "" + +msgid "" +"This is what a Custom object will contain. ``PyObject_HEAD`` is mandatory " +"at the start of each object struct and defines a field called ``ob_base`` of " +"type :c:type:`PyObject`, containing a pointer to a type object and a " +"reference count (these can be accessed using the macros :c:macro:`Py_TYPE` " +"and :c:macro:`Py_REFCNT` respectively). The reason for the macro is to " +"abstract away the layout and to enable additional fields in :ref:`debug " +"builds `." +msgstr "" +"Це те, що міститиме спеціальний об’єкт. ``PyObject_HEAD`` є обов’язковим на " +"початку кожної структури об’єкта та визначає поле під назвою ``ob_base`` " +"типу :c:type:`PyObject`, що містить вказівник на об’єкт типу та кількість " +"посилань (вони можуть бути отримати доступ за допомогою макросів :c:macro:" +"`Py_TYPE` і :c:macro:`Py_REFCNT` відповідно). Причина макросу полягає в " +"тому, щоб абстрагуватися від макета та ввімкнути додаткові поля в :ref:" +"`debug builds `." + +msgid "" +"There is no semicolon above after the :c:macro:`PyObject_HEAD` macro. Be " +"wary of adding one by accident: some compilers will complain." +msgstr "" +"Немає крапки з комою після макросу :c:macro:`PyObject_HEAD`. Будьте " +"обережні, додаючи його випадково: деякі компілятори скаржаться." + +msgid "" +"Of course, objects generally store additional data besides the standard " +"``PyObject_HEAD`` boilerplate; for example, here is the definition for " +"standard Python floats::" +msgstr "" +"Звичайно, об’єкти зазвичай зберігають додаткові дані, окрім стандартного " +"шаблону ``PyObject_HEAD``; наприклад, ось визначення стандартних floats " +"Python::" + +msgid "" +"typedef struct {\n" +" PyObject_HEAD\n" +" double ob_fval;\n" +"} PyFloatObject;" +msgstr "" + +msgid "The second bit is the definition of the type object. ::" +msgstr "Другий біт - це визначення об'єкта типу. ::" + +msgid "" +"static PyTypeObject CustomType = {\n" +" .ob_base = PyVarObject_HEAD_INIT(NULL, 0)\n" +" .tp_name = \"custom.Custom\",\n" +" .tp_doc = PyDoc_STR(\"Custom objects\"),\n" +" .tp_basicsize = sizeof(CustomObject),\n" +" .tp_itemsize = 0,\n" +" .tp_flags = Py_TPFLAGS_DEFAULT,\n" +" .tp_new = PyType_GenericNew,\n" +"};" +msgstr "" + +msgid "" +"We recommend using C99-style designated initializers as above, to avoid " +"listing all the :c:type:`PyTypeObject` fields that you don't care about and " +"also to avoid caring about the fields' declaration order." +msgstr "" +"Ми рекомендуємо використовувати призначені ініціалізатори у стилі C99, як " +"зазначено вище, щоб уникнути переліку всіх полів :c:type:`PyTypeObject`, які " +"вас не цікавлять, а також щоб не піклуватися про порядок оголошення полів." + +msgid "" +"The actual definition of :c:type:`PyTypeObject` in :file:`object.h` has many " +"more :ref:`fields ` than the definition above. The remaining " +"fields will be filled with zeros by the C compiler, and it's common practice " +"to not specify them explicitly unless you need them." +msgstr "" +"Справжнє визначення :c:type:`PyTypeObject` у :file:`object.h` має набагато " +"більше :ref:`полів `, ніж визначення вище. Поля, що " +"залишилися, будуть заповнені нулями компілятором C, і звичайною практикою є " +"не вказувати їх явно, якщо вони вам не потрібні." + +msgid "We're going to pick it apart, one field at a time::" +msgstr "Ми збираємося розібрати його, одне поле за раз::" + +msgid ".ob_base = PyVarObject_HEAD_INIT(NULL, 0)" +msgstr "" + +msgid "" +"This line is mandatory boilerplate to initialize the ``ob_base`` field " +"mentioned above. ::" +msgstr "" +"Цей рядок є обов’язковим шаблоном для ініціалізації поля ``ob_base``, " +"згаданого вище. ::" + +msgid ".tp_name = \"custom.Custom\"," +msgstr "" + +msgid "" +"The name of our type. This will appear in the default textual " +"representation of our objects and in some error messages, for example:" +msgstr "" +"Назва нашого типу. Це відображатиметься в типовому текстовому представленні " +"наших об’єктів і в деяких повідомленнях про помилки, наприклад:" + +msgid "" +">>> \"\" + custom.Custom()\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"TypeError: can only concatenate str (not \"custom.Custom\") to str" +msgstr "" + +msgid "" +"Note that the name is a dotted name that includes both the module name and " +"the name of the type within the module. The module in this case is :mod:`!" +"custom` and the type is :class:`!Custom`, so we set the type name to :class:" +"`!custom.Custom`. Using the real dotted import path is important to make " +"your type compatible with the :mod:`pydoc` and :mod:`pickle` modules. ::" +msgstr "" + +msgid "" +".tp_basicsize = sizeof(CustomObject),\n" +".tp_itemsize = 0," +msgstr "" + +msgid "" +"This is so that Python knows how much memory to allocate when creating new :" +"class:`!Custom` instances. :c:member:`~PyTypeObject.tp_itemsize` is only " +"used for variable-sized objects and should otherwise be zero." +msgstr "" + +msgid "" +"If you want your type to be subclassable from Python, and your type has the " +"same :c:member:`~PyTypeObject.tp_basicsize` as its base type, you may have " +"problems with multiple inheritance. A Python subclass of your type will " +"have to list your type first in its :attr:`~type.__bases__`, or else it will " +"not be able to call your type's :meth:`~object.__new__` method without " +"getting an error. You can avoid this problem by ensuring that your type has " +"a larger value for :c:member:`~PyTypeObject.tp_basicsize` than its base type " +"does. Most of the time, this will be true anyway, because either your base " +"type will be :class:`object`, or else you will be adding data members to " +"your base type, and therefore increasing its size." +msgstr "" + +msgid "We set the class flags to :c:macro:`Py_TPFLAGS_DEFAULT`. ::" +msgstr "" + +msgid ".tp_flags = Py_TPFLAGS_DEFAULT," +msgstr "" + +msgid "" +"All types should include this constant in their flags. It enables all of " +"the members defined until at least Python 3.3. If you need further members, " +"you will need to OR the corresponding flags." +msgstr "" +"Усі типи повинні включати цю константу у свої прапорці. Він увімкне всі " +"члени, визначені принаймні до Python 3.3. Якщо вам потрібні додаткові члени, " +"вам потрібно буде АБО відповідні прапорці." + +msgid "" +"We provide a doc string for the type in :c:member:`~PyTypeObject.tp_doc`. ::" +msgstr "" +"Ми надаємо рядок документа для типу в :c:member:`~PyTypeObject.tp_doc`. ::" + +msgid ".tp_doc = PyDoc_STR(\"Custom objects\")," +msgstr "" + +msgid "" +"To enable object creation, we have to provide a :c:member:`~PyTypeObject." +"tp_new` handler. This is the equivalent of the Python method :meth:`~object." +"__new__`, but has to be specified explicitly. In this case, we can just use " +"the default implementation provided by the API function :c:func:" +"`PyType_GenericNew`. ::" +msgstr "" + +msgid ".tp_new = PyType_GenericNew," +msgstr "" + +msgid "" +"Everything else in the file should be familiar, except for some code in :c:" +"func:`!PyInit_custom`::" +msgstr "" + +msgid "" +"if (PyType_Ready(&CustomType) < 0)\n" +" return;" +msgstr "" + +msgid "" +"This initializes the :class:`!Custom` type, filling in a number of members " +"to the appropriate default values, including :c:member:`~PyObject.ob_type` " +"that we initially set to ``NULL``. ::" +msgstr "" + +msgid "" +"if (PyModule_AddObjectRef(m, \"Custom\", (PyObject *) &CustomType) < 0) {\n" +" Py_DECREF(m);\n" +" return NULL;\n" +"}" +msgstr "" + +msgid "" +"This adds the type to the module dictionary. This allows us to create :" +"class:`!Custom` instances by calling the :class:`!Custom` class:" +msgstr "" + +msgid "" +">>> import custom\n" +">>> mycustom = custom.Custom()" +msgstr "" + +msgid "" +"That's it! All that remains is to build it; put the above code in a file " +"called :file:`custom.c`," +msgstr "" + +msgid "" +"[build-system]\n" +"requires = [\"setuptools\"]\n" +"build-backend = \"setuptools.build_meta\"\n" +"\n" +"[project]\n" +"name = \"custom\"\n" +"version = \"1\"\n" +msgstr "" + +msgid "in a file called :file:`pyproject.toml`, and" +msgstr "" + +msgid "" +"from setuptools import Extension, setup\n" +"setup(ext_modules=[Extension(\"custom\", [\"custom.c\"])])" +msgstr "" + +msgid "in a file called :file:`setup.py`; then typing" +msgstr "у файлі під назвою :file:`setup.py`; потім набравши" + +msgid "$ python -m pip install ." +msgstr "" + +msgid "" +"in a shell should produce a file :file:`custom.so` in a subdirectory and " +"install it; now fire up Python --- you should be able to ``import custom`` " +"and play around with ``Custom`` objects." +msgstr "" + +msgid "That wasn't so hard, was it?" +msgstr "Це було не так важко, чи не так?" + +msgid "" +"Of course, the current Custom type is pretty uninteresting. It has no data " +"and doesn't do anything. It can't even be subclassed." +msgstr "" +"Звичайно, поточний тип Custom є досить нецікавим. Він не має даних і нічого " +"не робить. Це навіть не може бути підкласом." + +msgid "Adding data and methods to the Basic example" +msgstr "Додавання даних і методів до базового прикладу" + +msgid "" +"Let's extend the basic example to add some data and methods. Let's also " +"make the type usable as a base class. We'll create a new module, :mod:`!" +"custom2` that adds these capabilities:" +msgstr "" + +msgid "" +"#define PY_SSIZE_T_CLEAN\n" +"#include \n" +"#include /* for offsetof() */\n" +"\n" +"typedef struct {\n" +" PyObject_HEAD\n" +" PyObject *first; /* first name */\n" +" PyObject *last; /* last name */\n" +" int number;\n" +"} CustomObject;\n" +"\n" +"static void\n" +"Custom_dealloc(CustomObject *self)\n" +"{\n" +" Py_XDECREF(self->first);\n" +" Py_XDECREF(self->last);\n" +" Py_TYPE(self)->tp_free((PyObject *) self);\n" +"}\n" +"\n" +"static PyObject *\n" +"Custom_new(PyTypeObject *type, PyObject *args, PyObject *kwds)\n" +"{\n" +" CustomObject *self;\n" +" self = (CustomObject *) type->tp_alloc(type, 0);\n" +" if (self != NULL) {\n" +" self->first = PyUnicode_FromString(\"\");\n" +" if (self->first == NULL) {\n" +" Py_DECREF(self);\n" +" return NULL;\n" +" }\n" +" self->last = PyUnicode_FromString(\"\");\n" +" if (self->last == NULL) {\n" +" Py_DECREF(self);\n" +" return NULL;\n" +" }\n" +" self->number = 0;\n" +" }\n" +" return (PyObject *) self;\n" +"}\n" +"\n" +"static int\n" +"Custom_init(CustomObject *self, PyObject *args, PyObject *kwds)\n" +"{\n" +" static char *kwlist[] = {\"first\", \"last\", \"number\", NULL};\n" +" PyObject *first = NULL, *last = NULL;\n" +"\n" +" if (!PyArg_ParseTupleAndKeywords(args, kwds, \"|OOi\", kwlist,\n" +" &first, &last,\n" +" &self->number))\n" +" return -1;\n" +"\n" +" if (first) {\n" +" Py_XSETREF(self->first, Py_NewRef(first));\n" +" }\n" +" if (last) {\n" +" Py_XSETREF(self->last, Py_NewRef(last));\n" +" }\n" +" return 0;\n" +"}\n" +"\n" +"static PyMemberDef Custom_members[] = {\n" +" {\"first\", Py_T_OBJECT_EX, offsetof(CustomObject, first), 0,\n" +" \"first name\"},\n" +" {\"last\", Py_T_OBJECT_EX, offsetof(CustomObject, last), 0,\n" +" \"last name\"},\n" +" {\"number\", Py_T_INT, offsetof(CustomObject, number), 0,\n" +" \"custom number\"},\n" +" {NULL} /* Sentinel */\n" +"};\n" +"\n" +"static PyObject *\n" +"Custom_name(CustomObject *self, PyObject *Py_UNUSED(ignored))\n" +"{\n" +" if (self->first == NULL) {\n" +" PyErr_SetString(PyExc_AttributeError, \"first\");\n" +" return NULL;\n" +" }\n" +" if (self->last == NULL) {\n" +" PyErr_SetString(PyExc_AttributeError, \"last\");\n" +" return NULL;\n" +" }\n" +" return PyUnicode_FromFormat(\"%S %S\", self->first, self->last);\n" +"}\n" +"\n" +"static PyMethodDef Custom_methods[] = {\n" +" {\"name\", (PyCFunction) Custom_name, METH_NOARGS,\n" +" \"Return the name, combining the first and last name\"\n" +" },\n" +" {NULL} /* Sentinel */\n" +"};\n" +"\n" +"static PyTypeObject CustomType = {\n" +" .ob_base = PyVarObject_HEAD_INIT(NULL, 0)\n" +" .tp_name = \"custom2.Custom\",\n" +" .tp_doc = PyDoc_STR(\"Custom objects\"),\n" +" .tp_basicsize = sizeof(CustomObject),\n" +" .tp_itemsize = 0,\n" +" .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,\n" +" .tp_new = Custom_new,\n" +" .tp_init = (initproc) Custom_init,\n" +" .tp_dealloc = (destructor) Custom_dealloc,\n" +" .tp_members = Custom_members,\n" +" .tp_methods = Custom_methods,\n" +"};\n" +"\n" +"static PyModuleDef custommodule = {\n" +" .m_base =PyModuleDef_HEAD_INIT,\n" +" .m_name = \"custom2\",\n" +" .m_doc = \"Example module that creates an extension type.\",\n" +" .m_size = -1,\n" +"};\n" +"\n" +"PyMODINIT_FUNC\n" +"PyInit_custom2(void)\n" +"{\n" +" PyObject *m;\n" +" if (PyType_Ready(&CustomType) < 0)\n" +" return NULL;\n" +"\n" +" m = PyModule_Create(&custommodule);\n" +" if (m == NULL)\n" +" return NULL;\n" +"\n" +" if (PyModule_AddObjectRef(m, \"Custom\", (PyObject *) &CustomType) < 0) " +"{\n" +" Py_DECREF(m);\n" +" return NULL;\n" +" }\n" +"\n" +" return m;\n" +"}\n" +msgstr "" + +msgid "This version of the module has a number of changes." +msgstr "Ця версія модуля має низку змін." + +msgid "" +"The :class:`!Custom` type now has three data attributes in its C struct, " +"*first*, *last*, and *number*. The *first* and *last* variables are Python " +"strings containing first and last names. The *number* attribute is a C " +"integer." +msgstr "" + +msgid "The object structure is updated accordingly::" +msgstr "Відповідно оновлено структуру об'єкта:" + +msgid "" +"typedef struct {\n" +" PyObject_HEAD\n" +" PyObject *first; /* first name */\n" +" PyObject *last; /* last name */\n" +" int number;\n" +"} CustomObject;" +msgstr "" + +msgid "" +"Because we now have data to manage, we have to be more careful about object " +"allocation and deallocation. At a minimum, we need a deallocation method::" +msgstr "" +"Оскільки тепер у нас є дані, якими потрібно керувати, ми повинні бути " +"обережнішими щодо розподілу та звільнення об’єктів. Як мінімум, нам потрібен " +"метод звільнення:" + +msgid "" +"static void\n" +"Custom_dealloc(CustomObject *self)\n" +"{\n" +" Py_XDECREF(self->first);\n" +" Py_XDECREF(self->last);\n" +" Py_TYPE(self)->tp_free((PyObject *) self);\n" +"}" +msgstr "" + +msgid "which is assigned to the :c:member:`~PyTypeObject.tp_dealloc` member::" +msgstr "який призначено члену :c:member:`~PyTypeObject.tp_dealloc`::" + +msgid ".tp_dealloc = (destructor) Custom_dealloc," +msgstr "" + +msgid "" +"This method first clears the reference counts of the two Python attributes. :" +"c:func:`Py_XDECREF` correctly handles the case where its argument is " +"``NULL`` (which might happen here if ``tp_new`` failed midway). It then " +"calls the :c:member:`~PyTypeObject.tp_free` member of the object's type " +"(computed by ``Py_TYPE(self)``) to free the object's memory. Note that the " +"object's type might not be :class:`!CustomType`, because the object may be " +"an instance of a subclass." +msgstr "" + +msgid "" +"The explicit cast to ``destructor`` above is needed because we defined " +"``Custom_dealloc`` to take a ``CustomObject *`` argument, but the " +"``tp_dealloc`` function pointer expects to receive a ``PyObject *`` " +"argument. Otherwise, the compiler will emit a warning. This is object-" +"oriented polymorphism, in C!" +msgstr "" +"Потрібне явне приведення до ``деструктора``, оскільки ми визначили " +"``Custom_dealloc`` для отримання аргументу ``CustomObject *``, але покажчик " +"функції ``tp_dealloc`` очікує отримання ``PyObject *`` аргумент. В іншому " +"випадку компілятор видасть попередження. Це об'єктно-орієнтований " +"поліморфізм у C!" + +msgid "" +"We want to make sure that the first and last names are initialized to empty " +"strings, so we provide a ``tp_new`` implementation::" +msgstr "" +"Ми хочемо переконатися, що ім’я та прізвище ініціалізовано порожніми " +"рядками, тому ми надаємо реалізацію ``tp_new``::" + +msgid "" +"static PyObject *\n" +"Custom_new(PyTypeObject *type, PyObject *args, PyObject *kwds)\n" +"{\n" +" CustomObject *self;\n" +" self = (CustomObject *) type->tp_alloc(type, 0);\n" +" if (self != NULL) {\n" +" self->first = PyUnicode_FromString(\"\");\n" +" if (self->first == NULL) {\n" +" Py_DECREF(self);\n" +" return NULL;\n" +" }\n" +" self->last = PyUnicode_FromString(\"\");\n" +" if (self->last == NULL) {\n" +" Py_DECREF(self);\n" +" return NULL;\n" +" }\n" +" self->number = 0;\n" +" }\n" +" return (PyObject *) self;\n" +"}" +msgstr "" + +msgid "and install it in the :c:member:`~PyTypeObject.tp_new` member::" +msgstr "і встановіть його в :c:member:`~PyTypeObject.tp_new` member::" + +msgid ".tp_new = Custom_new," +msgstr "" + +msgid "" +"The ``tp_new`` handler is responsible for creating (as opposed to " +"initializing) objects of the type. It is exposed in Python as the :meth:" +"`~object.__new__` method. It is not required to define a ``tp_new`` member, " +"and indeed many extension types will simply reuse :c:func:" +"`PyType_GenericNew` as done in the first version of the :class:`!Custom` " +"type above. In this case, we use the ``tp_new`` handler to initialize the " +"``first`` and ``last`` attributes to non-``NULL`` default values." +msgstr "" + +msgid "" +"``tp_new`` is passed the type being instantiated (not necessarily " +"``CustomType``, if a subclass is instantiated) and any arguments passed when " +"the type was called, and is expected to return the instance created. " +"``tp_new`` handlers always accept positional and keyword arguments, but they " +"often ignore the arguments, leaving the argument handling to initializer (a." +"k.a. ``tp_init`` in C or ``__init__`` in Python) methods." +msgstr "" +"``tp_new`` передається тип, який створюється (не обов’язково ``CustomType``, " +"якщо створено підклас) і будь-які аргументи, передані під час виклику типу, " +"і очікується, що він поверне створений екземпляр. Обробники ``tp_new`` " +"завжди приймають позиційні аргументи та аргументи ключових слів, але вони " +"часто ігнорують аргументи, залишаючи обробку аргументів методам " +"ініціалізації (він же ``tp_init`` в C або ``__init__`` в Python)." + +msgid "" +"``tp_new`` shouldn't call ``tp_init`` explicitly, as the interpreter will do " +"it itself." +msgstr "" +"``tp_new`` не повинен викликати ``tp_init`` явно, оскільки інтерпретатор " +"зробить це сам." + +msgid "" +"The ``tp_new`` implementation calls the :c:member:`~PyTypeObject.tp_alloc` " +"slot to allocate memory::" +msgstr "" +"Реалізація ``tp_new`` викликає слот :c:member:`~PyTypeObject.tp_alloc` для " +"виділення пам’яті::" + +msgid "self = (CustomObject *) type->tp_alloc(type, 0);" +msgstr "" + +msgid "" +"Since memory allocation may fail, we must check the :c:member:`~PyTypeObject." +"tp_alloc` result against ``NULL`` before proceeding." +msgstr "" +"Оскільки розподіл пам’яті може завершитися помилкою, ми повинні перевірити " +"результат :c:member:`~PyTypeObject.tp_alloc` на ``NULL`` перед тим, як " +"продовжити." + +msgid "" +"We didn't fill the :c:member:`~PyTypeObject.tp_alloc` slot ourselves. " +"Rather :c:func:`PyType_Ready` fills it for us by inheriting it from our base " +"class, which is :class:`object` by default. Most types use the default " +"allocation strategy." +msgstr "" +"Ми самі не заповнювали слот :c:member:`~PyTypeObject.tp_alloc`. Швидше :c:" +"func:`PyType_Ready` заповнює його за нас, успадковуючи його від нашого " +"базового класу, яким за замовчуванням є :class:`object`. Більшість типів " +"використовує стратегію розподілу за замовчуванням." + +msgid "" +"If you are creating a co-operative :c:member:`~PyTypeObject.tp_new` (one " +"that calls a base type's :c:member:`~PyTypeObject.tp_new` or :meth:`~object." +"__new__`), you must *not* try to determine what method to call using method " +"resolution order at runtime. Always statically determine what type you are " +"going to call, and call its :c:member:`~PyTypeObject.tp_new` directly, or " +"via ``type->tp_base->tp_new``. If you do not do this, Python subclasses of " +"your type that also inherit from other Python-defined classes may not work " +"correctly. (Specifically, you may not be able to create instances of such " +"subclasses without getting a :exc:`TypeError`.)" +msgstr "" + +msgid "" +"We also define an initialization function which accepts arguments to provide " +"initial values for our instance::" +msgstr "" +"Ми також визначаємо функцію ініціалізації, яка приймає аргументи для надання " +"початкових значень для нашого екземпляра:" + +msgid "" +"static int\n" +"Custom_init(CustomObject *self, PyObject *args, PyObject *kwds)\n" +"{\n" +" static char *kwlist[] = {\"first\", \"last\", \"number\", NULL};\n" +" PyObject *first = NULL, *last = NULL, *tmp;\n" +"\n" +" if (!PyArg_ParseTupleAndKeywords(args, kwds, \"|OOi\", kwlist,\n" +" &first, &last,\n" +" &self->number))\n" +" return -1;\n" +"\n" +" if (first) {\n" +" tmp = self->first;\n" +" Py_INCREF(first);\n" +" self->first = first;\n" +" Py_XDECREF(tmp);\n" +" }\n" +" if (last) {\n" +" tmp = self->last;\n" +" Py_INCREF(last);\n" +" self->last = last;\n" +" Py_XDECREF(tmp);\n" +" }\n" +" return 0;\n" +"}" +msgstr "" + +msgid "by filling the :c:member:`~PyTypeObject.tp_init` slot. ::" +msgstr "заповнивши слот :c:member:`~PyTypeObject.tp_init`. ::" + +msgid ".tp_init = (initproc) Custom_init," +msgstr "" + +msgid "" +"The :c:member:`~PyTypeObject.tp_init` slot is exposed in Python as the :meth:" +"`~object.__init__` method. It is used to initialize an object after it's " +"created. Initializers always accept positional and keyword arguments, and " +"they should return either ``0`` on success or ``-1`` on error." +msgstr "" + +msgid "" +"Unlike the ``tp_new`` handler, there is no guarantee that ``tp_init`` is " +"called at all (for example, the :mod:`pickle` module by default doesn't " +"call :meth:`~object.__init__` on unpickled instances). It can also be " +"called multiple times. Anyone can call the :meth:`!__init__` method on our " +"objects. For this reason, we have to be extra careful when assigning the " +"new attribute values. We might be tempted, for example to assign the " +"``first`` member like this::" +msgstr "" + +msgid "" +"if (first) {\n" +" Py_XDECREF(self->first);\n" +" Py_INCREF(first);\n" +" self->first = first;\n" +"}" +msgstr "" + +msgid "" +"But this would be risky. Our type doesn't restrict the type of the " +"``first`` member, so it could be any kind of object. It could have a " +"destructor that causes code to be executed that tries to access the " +"``first`` member; or that destructor could release the :term:`Global " +"interpreter Lock ` and let arbitrary code run in other threads that " +"accesses and modifies our object." +msgstr "" +"Але це було б ризиковано. Наш тип не обмежує тип ``першого`` члена, тому це " +"може бути будь-який об’єкт. Він може мати деструктор, який викликає " +"виконання коду, який намагається отримати доступ до ``першого`` члена; або " +"цей деструктор може звільнити :term:`глобальний інтерпретатор Lock ` і " +"дозволити довільному коду виконуватися в інших потоках, які звертаються до " +"нашого об’єкта та змінюють його." + +msgid "" +"To be paranoid and protect ourselves against this possibility, we almost " +"always reassign members before decrementing their reference counts. When " +"don't we have to do this?" +msgstr "" +"Щоб бути параноїком і захистити себе від такої можливості, ми майже завжди " +"перепризначаємо учасників перед тим, як зменшити їх кількість посилань. Коли " +"ми не повинні це робити?" + +msgid "when we absolutely know that the reference count is greater than 1;" +msgstr "коли ми точно знаємо, що кількість посилань перевищує 1;" + +msgid "" +"when we know that deallocation of the object [#]_ will neither release the :" +"term:`GIL` nor cause any calls back into our type's code;" +msgstr "" +"коли ми знаємо, що звільнення об’єкта [#]_ не звільнить :term:`GIL` і не " +"призведе до зворотних викликів коду нашого типу;" + +msgid "" +"when decrementing a reference count in a :c:member:`~PyTypeObject." +"tp_dealloc` handler on a type which doesn't support cyclic garbage " +"collection [#]_." +msgstr "" +"під час зменшення кількості посилань у обробнику :c:member:`~PyTypeObject." +"tp_dealloc` для типу, який не підтримує циклічне збирання сміття [#]_." + +msgid "" +"We want to expose our instance variables as attributes. There are a number " +"of ways to do that. The simplest way is to define member definitions::" +msgstr "" +"Ми хочемо представити наші змінні екземпляра як атрибути. Є кілька способів " +"зробити це. Найпростішим способом є визначення членів:" + +msgid "" +"static PyMemberDef Custom_members[] = {\n" +" {\"first\", Py_T_OBJECT_EX, offsetof(CustomObject, first), 0,\n" +" \"first name\"},\n" +" {\"last\", Py_T_OBJECT_EX, offsetof(CustomObject, last), 0,\n" +" \"last name\"},\n" +" {\"number\", Py_T_INT, offsetof(CustomObject, number), 0,\n" +" \"custom number\"},\n" +" {NULL} /* Sentinel */\n" +"};" +msgstr "" + +msgid "" +"and put the definitions in the :c:member:`~PyTypeObject.tp_members` slot::" +msgstr "і помістіть визначення в слот :c:member:`~PyTypeObject.tp_members`::" + +msgid ".tp_members = Custom_members," +msgstr "" + +msgid "" +"Each member definition has a member name, type, offset, access flags and " +"documentation string. See the :ref:`Generic-Attribute-Management` section " +"below for details." +msgstr "" +"Кожне визначення члена має ім’я члена, тип, зсув, позначки доступу та рядок " +"документації. Подробиці див. у розділі :ref:`Generic-Attribute-Management` " +"нижче." + +msgid "" +"A disadvantage of this approach is that it doesn't provide a way to restrict " +"the types of objects that can be assigned to the Python attributes. We " +"expect the first and last names to be strings, but any Python objects can be " +"assigned. Further, the attributes can be deleted, setting the C pointers to " +"``NULL``. Even though we can make sure the members are initialized to non-" +"``NULL`` values, the members can be set to ``NULL`` if the attributes are " +"deleted." +msgstr "" +"Недолік цього підходу полягає в тому, що він не дає можливості обмежити типи " +"об’єктів, які можна призначити атрибутам Python. Ми очікуємо, що ім’я та " +"прізвище будуть рядками, але можна призначити будь-які об’єкти Python. Крім " +"того, атрибути можна видалити, встановивши покажчики C на ``NULL``. " +"Незважаючи на те, що ми можемо переконатися, що члени ініціалізовані " +"значеннями, відмінними від ``NULL``, членам можна встановити значення " +"``NULL``, якщо атрибути видалено." + +msgid "" +"We define a single method, :meth:`!Custom.name`, that outputs the objects " +"name as the concatenation of the first and last names. ::" +msgstr "" + +msgid "" +"static PyObject *\n" +"Custom_name(CustomObject *self, PyObject *Py_UNUSED(ignored))\n" +"{\n" +" if (self->first == NULL) {\n" +" PyErr_SetString(PyExc_AttributeError, \"first\");\n" +" return NULL;\n" +" }\n" +" if (self->last == NULL) {\n" +" PyErr_SetString(PyExc_AttributeError, \"last\");\n" +" return NULL;\n" +" }\n" +" return PyUnicode_FromFormat(\"%S %S\", self->first, self->last);\n" +"}" +msgstr "" + +msgid "" +"The method is implemented as a C function that takes a :class:`!Custom` (or :" +"class:`!Custom` subclass) instance as the first argument. Methods always " +"take an instance as the first argument. Methods often take positional and " +"keyword arguments as well, but in this case we don't take any and don't need " +"to accept a positional argument tuple or keyword argument dictionary. This " +"method is equivalent to the Python method:" +msgstr "" + +msgid "" +"def name(self):\n" +" return \"%s %s\" % (self.first, self.last)" +msgstr "" + +msgid "" +"Note that we have to check for the possibility that our :attr:`!first` and :" +"attr:`!last` members are ``NULL``. This is because they can be deleted, in " +"which case they are set to ``NULL``. It would be better to prevent deletion " +"of these attributes and to restrict the attribute values to be strings. " +"We'll see how to do that in the next section." +msgstr "" + +msgid "" +"Now that we've defined the method, we need to create an array of method " +"definitions::" +msgstr "" +"Тепер, коли ми визначили метод, нам потрібно створити масив визначень " +"методів::" + +msgid "" +"static PyMethodDef Custom_methods[] = {\n" +" {\"name\", (PyCFunction) Custom_name, METH_NOARGS,\n" +" \"Return the name, combining the first and last name\"\n" +" },\n" +" {NULL} /* Sentinel */\n" +"};" +msgstr "" + +msgid "" +"(note that we used the :c:macro:`METH_NOARGS` flag to indicate that the " +"method is expecting no arguments other than *self*)" +msgstr "" + +msgid "and assign it to the :c:member:`~PyTypeObject.tp_methods` slot::" +msgstr "і призначте його :c:member:`~PyTypeObject.tp_methods` слот::" + +msgid ".tp_methods = Custom_methods," +msgstr "" + +msgid "" +"Finally, we'll make our type usable as a base class for subclassing. We've " +"written our methods carefully so far so that they don't make any assumptions " +"about the type of the object being created or used, so all we need to do is " +"to add the :c:macro:`Py_TPFLAGS_BASETYPE` to our class flag definition::" +msgstr "" + +msgid ".tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE," +msgstr "" + +msgid "" +"We rename :c:func:`!PyInit_custom` to :c:func:`!PyInit_custom2`, update the " +"module name in the :c:type:`PyModuleDef` struct, and update the full class " +"name in the :c:type:`PyTypeObject` struct." +msgstr "" + +msgid "Finally, we update our :file:`setup.py` file to include the new module," +msgstr "" + +msgid "" +"from setuptools import Extension, setup\n" +"setup(ext_modules=[\n" +" Extension(\"custom\", [\"custom.c\"]),\n" +" Extension(\"custom2\", [\"custom2.c\"]),\n" +"])" +msgstr "" + +msgid "and then we re-install so that we can ``import custom2``:" +msgstr "" + +msgid "Providing finer control over data attributes" +msgstr "Забезпечення більш точного контролю над атрибутами даних" + +msgid "" +"In this section, we'll provide finer control over how the :attr:`!first` " +"and :attr:`!last` attributes are set in the :class:`!Custom` example. In the " +"previous version of our module, the instance variables :attr:`!first` and :" +"attr:`!last` could be set to non-string values or even deleted. We want to " +"make sure that these attributes always contain strings." +msgstr "" + +msgid "" +"#define PY_SSIZE_T_CLEAN\n" +"#include \n" +"#include /* for offsetof() */\n" +"\n" +"typedef struct {\n" +" PyObject_HEAD\n" +" PyObject *first; /* first name */\n" +" PyObject *last; /* last name */\n" +" int number;\n" +"} CustomObject;\n" +"\n" +"static void\n" +"Custom_dealloc(CustomObject *self)\n" +"{\n" +" Py_XDECREF(self->first);\n" +" Py_XDECREF(self->last);\n" +" Py_TYPE(self)->tp_free((PyObject *) self);\n" +"}\n" +"\n" +"static PyObject *\n" +"Custom_new(PyTypeObject *type, PyObject *args, PyObject *kwds)\n" +"{\n" +" CustomObject *self;\n" +" self = (CustomObject *) type->tp_alloc(type, 0);\n" +" if (self != NULL) {\n" +" self->first = PyUnicode_FromString(\"\");\n" +" if (self->first == NULL) {\n" +" Py_DECREF(self);\n" +" return NULL;\n" +" }\n" +" self->last = PyUnicode_FromString(\"\");\n" +" if (self->last == NULL) {\n" +" Py_DECREF(self);\n" +" return NULL;\n" +" }\n" +" self->number = 0;\n" +" }\n" +" return (PyObject *) self;\n" +"}\n" +"\n" +"static int\n" +"Custom_init(CustomObject *self, PyObject *args, PyObject *kwds)\n" +"{\n" +" static char *kwlist[] = {\"first\", \"last\", \"number\", NULL};\n" +" PyObject *first = NULL, *last = NULL;\n" +"\n" +" if (!PyArg_ParseTupleAndKeywords(args, kwds, \"|UUi\", kwlist,\n" +" &first, &last,\n" +" &self->number))\n" +" return -1;\n" +"\n" +" if (first) {\n" +" Py_SETREF(self->first, Py_NewRef(first));\n" +" }\n" +" if (last) {\n" +" Py_SETREF(self->last, Py_NewRef(last));\n" +" }\n" +" return 0;\n" +"}\n" +"\n" +"static PyMemberDef Custom_members[] = {\n" +" {\"number\", Py_T_INT, offsetof(CustomObject, number), 0,\n" +" \"custom number\"},\n" +" {NULL} /* Sentinel */\n" +"};\n" +"\n" +"static PyObject *\n" +"Custom_getfirst(CustomObject *self, void *closure)\n" +"{\n" +" return Py_NewRef(self->first);\n" +"}\n" +"\n" +"static int\n" +"Custom_setfirst(CustomObject *self, PyObject *value, void *closure)\n" +"{\n" +" if (value == NULL) {\n" +" PyErr_SetString(PyExc_TypeError, \"Cannot delete the first " +"attribute\");\n" +" return -1;\n" +" }\n" +" if (!PyUnicode_Check(value)) {\n" +" PyErr_SetString(PyExc_TypeError,\n" +" \"The first attribute value must be a string\");\n" +" return -1;\n" +" }\n" +" Py_SETREF(self->first, Py_NewRef(value));\n" +" return 0;\n" +"}\n" +"\n" +"static PyObject *\n" +"Custom_getlast(CustomObject *self, void *closure)\n" +"{\n" +" return Py_NewRef(self->last);\n" +"}\n" +"\n" +"static int\n" +"Custom_setlast(CustomObject *self, PyObject *value, void *closure)\n" +"{\n" +" if (value == NULL) {\n" +" PyErr_SetString(PyExc_TypeError, \"Cannot delete the last " +"attribute\");\n" +" return -1;\n" +" }\n" +" if (!PyUnicode_Check(value)) {\n" +" PyErr_SetString(PyExc_TypeError,\n" +" \"The last attribute value must be a string\");\n" +" return -1;\n" +" }\n" +" Py_SETREF(self->last, Py_NewRef(value));\n" +" return 0;\n" +"}\n" +"\n" +"static PyGetSetDef Custom_getsetters[] = {\n" +" {\"first\", (getter) Custom_getfirst, (setter) Custom_setfirst,\n" +" \"first name\", NULL},\n" +" {\"last\", (getter) Custom_getlast, (setter) Custom_setlast,\n" +" \"last name\", NULL},\n" +" {NULL} /* Sentinel */\n" +"};\n" +"\n" +"static PyObject *\n" +"Custom_name(CustomObject *self, PyObject *Py_UNUSED(ignored))\n" +"{\n" +" return PyUnicode_FromFormat(\"%S %S\", self->first, self->last);\n" +"}\n" +"\n" +"static PyMethodDef Custom_methods[] = {\n" +" {\"name\", (PyCFunction) Custom_name, METH_NOARGS,\n" +" \"Return the name, combining the first and last name\"\n" +" },\n" +" {NULL} /* Sentinel */\n" +"};\n" +"\n" +"static PyTypeObject CustomType = {\n" +" .ob_base = PyVarObject_HEAD_INIT(NULL, 0)\n" +" .tp_name = \"custom3.Custom\",\n" +" .tp_doc = PyDoc_STR(\"Custom objects\"),\n" +" .tp_basicsize = sizeof(CustomObject),\n" +" .tp_itemsize = 0,\n" +" .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,\n" +" .tp_new = Custom_new,\n" +" .tp_init = (initproc) Custom_init,\n" +" .tp_dealloc = (destructor) Custom_dealloc,\n" +" .tp_members = Custom_members,\n" +" .tp_methods = Custom_methods,\n" +" .tp_getset = Custom_getsetters,\n" +"};\n" +"\n" +"static PyModuleDef custommodule = {\n" +" .m_base = PyModuleDef_HEAD_INIT,\n" +" .m_name = \"custom3\",\n" +" .m_doc = \"Example module that creates an extension type.\",\n" +" .m_size = -1,\n" +"};\n" +"\n" +"PyMODINIT_FUNC\n" +"PyInit_custom3(void)\n" +"{\n" +" PyObject *m;\n" +" if (PyType_Ready(&CustomType) < 0)\n" +" return NULL;\n" +"\n" +" m = PyModule_Create(&custommodule);\n" +" if (m == NULL)\n" +" return NULL;\n" +"\n" +" if (PyModule_AddObjectRef(m, \"Custom\", (PyObject *) &CustomType) < 0) " +"{\n" +" Py_DECREF(m);\n" +" return NULL;\n" +" }\n" +"\n" +" return m;\n" +"}\n" +msgstr "" + +msgid "" +"To provide greater control, over the :attr:`!first` and :attr:`!last` " +"attributes, we'll use custom getter and setter functions. Here are the " +"functions for getting and setting the :attr:`!first` attribute::" +msgstr "" + +msgid "" +"static PyObject *\n" +"Custom_getfirst(CustomObject *self, void *closure)\n" +"{\n" +" Py_INCREF(self->first);\n" +" return self->first;\n" +"}\n" +"\n" +"static int\n" +"Custom_setfirst(CustomObject *self, PyObject *value, void *closure)\n" +"{\n" +" PyObject *tmp;\n" +" if (value == NULL) {\n" +" PyErr_SetString(PyExc_TypeError, \"Cannot delete the first " +"attribute\");\n" +" return -1;\n" +" }\n" +" if (!PyUnicode_Check(value)) {\n" +" PyErr_SetString(PyExc_TypeError,\n" +" \"The first attribute value must be a string\");\n" +" return -1;\n" +" }\n" +" tmp = self->first;\n" +" Py_INCREF(value);\n" +" self->first = value;\n" +" Py_DECREF(tmp);\n" +" return 0;\n" +"}" +msgstr "" + +msgid "" +"The getter function is passed a :class:`!Custom` object and a \"closure\", " +"which is a void pointer. In this case, the closure is ignored. (The " +"closure supports an advanced usage in which definition data is passed to the " +"getter and setter. This could, for example, be used to allow a single set of " +"getter and setter functions that decide the attribute to get or set based on " +"data in the closure.)" +msgstr "" + +msgid "" +"The setter function is passed the :class:`!Custom` object, the new value, " +"and the closure. The new value may be ``NULL``, in which case the attribute " +"is being deleted. In our setter, we raise an error if the attribute is " +"deleted or if its new value is not a string." +msgstr "" + +msgid "We create an array of :c:type:`PyGetSetDef` structures::" +msgstr "Ми створюємо масив структур :c:type:`PyGetSetDef`::" + +msgid "" +"static PyGetSetDef Custom_getsetters[] = {\n" +" {\"first\", (getter) Custom_getfirst, (setter) Custom_setfirst,\n" +" \"first name\", NULL},\n" +" {\"last\", (getter) Custom_getlast, (setter) Custom_setlast,\n" +" \"last name\", NULL},\n" +" {NULL} /* Sentinel */\n" +"};" +msgstr "" + +msgid "and register it in the :c:member:`~PyTypeObject.tp_getset` slot::" +msgstr "і зареєструйте його в слоті :c:member:`~PyTypeObject.tp_getset`::" + +msgid ".tp_getset = Custom_getsetters," +msgstr "" + +msgid "" +"The last item in a :c:type:`PyGetSetDef` structure is the \"closure\" " +"mentioned above. In this case, we aren't using a closure, so we just pass " +"``NULL``." +msgstr "" +"Останнім елементом у структурі :c:type:`PyGetSetDef` є \"закриття\", згадане " +"вище. У цьому випадку ми не використовуємо закриття, тому ми просто " +"передаємо ``NULL``." + +msgid "We also remove the member definitions for these attributes::" +msgstr "Ми також видаляємо визначення учасників для цих атрибутів:" + +msgid "" +"static PyMemberDef Custom_members[] = {\n" +" {\"number\", Py_T_INT, offsetof(CustomObject, number), 0,\n" +" \"custom number\"},\n" +" {NULL} /* Sentinel */\n" +"};" +msgstr "" + +msgid "" +"We also need to update the :c:member:`~PyTypeObject.tp_init` handler to only " +"allow strings [#]_ to be passed::" +msgstr "" +"Нам також потрібно оновити обробник :c:member:`~PyTypeObject.tp_init`, щоб " +"дозволити передавати лише рядки [#]_::" + +msgid "" +"static int\n" +"Custom_init(CustomObject *self, PyObject *args, PyObject *kwds)\n" +"{\n" +" static char *kwlist[] = {\"first\", \"last\", \"number\", NULL};\n" +" PyObject *first = NULL, *last = NULL, *tmp;\n" +"\n" +" if (!PyArg_ParseTupleAndKeywords(args, kwds, \"|UUi\", kwlist,\n" +" &first, &last,\n" +" &self->number))\n" +" return -1;\n" +"\n" +" if (first) {\n" +" tmp = self->first;\n" +" Py_INCREF(first);\n" +" self->first = first;\n" +" Py_DECREF(tmp);\n" +" }\n" +" if (last) {\n" +" tmp = self->last;\n" +" Py_INCREF(last);\n" +" self->last = last;\n" +" Py_DECREF(tmp);\n" +" }\n" +" return 0;\n" +"}" +msgstr "" + +msgid "" +"With these changes, we can assure that the ``first`` and ``last`` members " +"are never ``NULL`` so we can remove checks for ``NULL`` values in almost all " +"cases. This means that most of the :c:func:`Py_XDECREF` calls can be " +"converted to :c:func:`Py_DECREF` calls. The only place we can't change " +"these calls is in the ``tp_dealloc`` implementation, where there is the " +"possibility that the initialization of these members failed in ``tp_new``." +msgstr "" +"Завдяки цим змінам ми можемо гарантувати, що ``перший`` і ``останній`` члени " +"ніколи не є ``NULL``, тому ми можемо видалити перевірки значень ``NULL`` " +"майже у всіх випадках. Це означає, що більшість викликів :c:func:" +"`Py_XDECREF` можна перетворити на виклики :c:func:`Py_DECREF`. Єдине місце, " +"де ми не можемо змінити ці виклики, це реалізація ``tp_dealloc``, де існує " +"ймовірність того, що ініціалізація цих учасників не вдалася в ``tp_new``." + +msgid "" +"We also rename the module initialization function and module name in the " +"initialization function, as we did before, and we add an extra definition to " +"the :file:`setup.py` file." +msgstr "" +"Ми також перейменуємо функцію ініціалізації модуля та назву модуля у функції " +"ініціалізації, як ми робили раніше, і додамо додаткове визначення до файлу :" +"file:`setup.py`." + +msgid "Supporting cyclic garbage collection" +msgstr "Підтримка циклічного збирання сміття" + +msgid "" +"Python has a :term:`cyclic garbage collector (GC) ` that " +"can identify unneeded objects even when their reference counts are not zero. " +"This can happen when objects are involved in cycles. For example, consider:" +msgstr "" +"У Python є :term:`циклічний збирач сміття (GC) `, який " +"може ідентифікувати непотрібні об’єкти, навіть якщо їх кількість посилань не " +"дорівнює нулю. Це може статися, коли об’єкти беруть участь у циклах. " +"Наприклад, розглянемо:" + +msgid "" +">>> l = []\n" +">>> l.append(l)\n" +">>> del l" +msgstr "" + +msgid "" +"In this example, we create a list that contains itself. When we delete it, " +"it still has a reference from itself. Its reference count doesn't drop to " +"zero. Fortunately, Python's cyclic garbage collector will eventually figure " +"out that the list is garbage and free it." +msgstr "" +"У цьому прикладі ми створюємо список, який містить сам себе. Коли ми його " +"видаляємо, воно все ще має посилання на себе. Його кількість посилань не " +"падає до нуля. На щастя, циклічний збирач сміття Python зрештою визначить, " +"що список є сміттям, і звільнить його." + +msgid "" +"In the second version of the :class:`!Custom` example, we allowed any kind " +"of object to be stored in the :attr:`!first` or :attr:`!last` attributes " +"[#]_. Besides, in the second and third versions, we allowed subclassing :" +"class:`!Custom`, and subclasses may add arbitrary attributes. For any of " +"those two reasons, :class:`!Custom` objects can participate in cycles:" +msgstr "" + +msgid "" +">>> import custom3\n" +">>> class Derived(custom3.Custom): pass\n" +"...\n" +">>> n = Derived()\n" +">>> n.some_attribute = n" +msgstr "" + +msgid "" +"To allow a :class:`!Custom` instance participating in a reference cycle to " +"be properly detected and collected by the cyclic GC, our :class:`!Custom` " +"type needs to fill two additional slots and to enable a flag that enables " +"these slots:" +msgstr "" + +msgid "" +"#define PY_SSIZE_T_CLEAN\n" +"#include \n" +"#include /* for offsetof() */\n" +"\n" +"typedef struct {\n" +" PyObject_HEAD\n" +" PyObject *first; /* first name */\n" +" PyObject *last; /* last name */\n" +" int number;\n" +"} CustomObject;\n" +"\n" +"static int\n" +"Custom_traverse(CustomObject *self, visitproc visit, void *arg)\n" +"{\n" +" Py_VISIT(self->first);\n" +" Py_VISIT(self->last);\n" +" return 0;\n" +"}\n" +"\n" +"static int\n" +"Custom_clear(CustomObject *self)\n" +"{\n" +" Py_CLEAR(self->first);\n" +" Py_CLEAR(self->last);\n" +" return 0;\n" +"}\n" +"\n" +"static void\n" +"Custom_dealloc(CustomObject *self)\n" +"{\n" +" PyObject_GC_UnTrack(self);\n" +" Custom_clear(self);\n" +" Py_TYPE(self)->tp_free((PyObject *) self);\n" +"}\n" +"\n" +"static PyObject *\n" +"Custom_new(PyTypeObject *type, PyObject *args, PyObject *kwds)\n" +"{\n" +" CustomObject *self;\n" +" self = (CustomObject *) type->tp_alloc(type, 0);\n" +" if (self != NULL) {\n" +" self->first = PyUnicode_FromString(\"\");\n" +" if (self->first == NULL) {\n" +" Py_DECREF(self);\n" +" return NULL;\n" +" }\n" +" self->last = PyUnicode_FromString(\"\");\n" +" if (self->last == NULL) {\n" +" Py_DECREF(self);\n" +" return NULL;\n" +" }\n" +" self->number = 0;\n" +" }\n" +" return (PyObject *) self;\n" +"}\n" +"\n" +"static int\n" +"Custom_init(CustomObject *self, PyObject *args, PyObject *kwds)\n" +"{\n" +" static char *kwlist[] = {\"first\", \"last\", \"number\", NULL};\n" +" PyObject *first = NULL, *last = NULL;\n" +"\n" +" if (!PyArg_ParseTupleAndKeywords(args, kwds, \"|UUi\", kwlist,\n" +" &first, &last,\n" +" &self->number))\n" +" return -1;\n" +"\n" +" if (first) {\n" +" Py_SETREF(self->first, Py_NewRef(first));\n" +" }\n" +" if (last) {\n" +" Py_SETREF(self->last, Py_NewRef(last));\n" +" }\n" +" return 0;\n" +"}\n" +"\n" +"static PyMemberDef Custom_members[] = {\n" +" {\"number\", Py_T_INT, offsetof(CustomObject, number), 0,\n" +" \"custom number\"},\n" +" {NULL} /* Sentinel */\n" +"};\n" +"\n" +"static PyObject *\n" +"Custom_getfirst(CustomObject *self, void *closure)\n" +"{\n" +" return Py_NewRef(self->first);\n" +"}\n" +"\n" +"static int\n" +"Custom_setfirst(CustomObject *self, PyObject *value, void *closure)\n" +"{\n" +" if (value == NULL) {\n" +" PyErr_SetString(PyExc_TypeError, \"Cannot delete the first " +"attribute\");\n" +" return -1;\n" +" }\n" +" if (!PyUnicode_Check(value)) {\n" +" PyErr_SetString(PyExc_TypeError,\n" +" \"The first attribute value must be a string\");\n" +" return -1;\n" +" }\n" +" Py_XSETREF(self->first, Py_NewRef(value));\n" +" return 0;\n" +"}\n" +"\n" +"static PyObject *\n" +"Custom_getlast(CustomObject *self, void *closure)\n" +"{\n" +" return Py_NewRef(self->last);\n" +"}\n" +"\n" +"static int\n" +"Custom_setlast(CustomObject *self, PyObject *value, void *closure)\n" +"{\n" +" if (value == NULL) {\n" +" PyErr_SetString(PyExc_TypeError, \"Cannot delete the last " +"attribute\");\n" +" return -1;\n" +" }\n" +" if (!PyUnicode_Check(value)) {\n" +" PyErr_SetString(PyExc_TypeError,\n" +" \"The last attribute value must be a string\");\n" +" return -1;\n" +" }\n" +" Py_XSETREF(self->last, Py_NewRef(value));\n" +" return 0;\n" +"}\n" +"\n" +"static PyGetSetDef Custom_getsetters[] = {\n" +" {\"first\", (getter) Custom_getfirst, (setter) Custom_setfirst,\n" +" \"first name\", NULL},\n" +" {\"last\", (getter) Custom_getlast, (setter) Custom_setlast,\n" +" \"last name\", NULL},\n" +" {NULL} /* Sentinel */\n" +"};\n" +"\n" +"static PyObject *\n" +"Custom_name(CustomObject *self, PyObject *Py_UNUSED(ignored))\n" +"{\n" +" return PyUnicode_FromFormat(\"%S %S\", self->first, self->last);\n" +"}\n" +"\n" +"static PyMethodDef Custom_methods[] = {\n" +" {\"name\", (PyCFunction) Custom_name, METH_NOARGS,\n" +" \"Return the name, combining the first and last name\"\n" +" },\n" +" {NULL} /* Sentinel */\n" +"};\n" +"\n" +"static PyTypeObject CustomType = {\n" +" .ob_base = PyVarObject_HEAD_INIT(NULL, 0)\n" +" .tp_name = \"custom4.Custom\",\n" +" .tp_doc = PyDoc_STR(\"Custom objects\"),\n" +" .tp_basicsize = sizeof(CustomObject),\n" +" .tp_itemsize = 0,\n" +" .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | " +"Py_TPFLAGS_HAVE_GC,\n" +" .tp_new = Custom_new,\n" +" .tp_init = (initproc) Custom_init,\n" +" .tp_dealloc = (destructor) Custom_dealloc,\n" +" .tp_traverse = (traverseproc) Custom_traverse,\n" +" .tp_clear = (inquiry) Custom_clear,\n" +" .tp_members = Custom_members,\n" +" .tp_methods = Custom_methods,\n" +" .tp_getset = Custom_getsetters,\n" +"};\n" +"\n" +"static PyModuleDef custommodule = {\n" +" .m_base = PyModuleDef_HEAD_INIT,\n" +" .m_name = \"custom4\",\n" +" .m_doc = \"Example module that creates an extension type.\",\n" +" .m_size = -1,\n" +"};\n" +"\n" +"PyMODINIT_FUNC\n" +"PyInit_custom4(void)\n" +"{\n" +" PyObject *m;\n" +" if (PyType_Ready(&CustomType) < 0)\n" +" return NULL;\n" +"\n" +" m = PyModule_Create(&custommodule);\n" +" if (m == NULL)\n" +" return NULL;\n" +"\n" +" if (PyModule_AddObjectRef(m, \"Custom\", (PyObject *) &CustomType) < 0) " +"{\n" +" Py_DECREF(m);\n" +" return NULL;\n" +" }\n" +"\n" +" return m;\n" +"}\n" +msgstr "" + +msgid "" +"First, the traversal method lets the cyclic GC know about subobjects that " +"could participate in cycles::" +msgstr "" +"По-перше, метод обходу дозволяє циклічному GC знати про підоб’єкти, які " +"можуть брати участь у циклах::" + +msgid "" +"static int\n" +"Custom_traverse(CustomObject *self, visitproc visit, void *arg)\n" +"{\n" +" int vret;\n" +" if (self->first) {\n" +" vret = visit(self->first, arg);\n" +" if (vret != 0)\n" +" return vret;\n" +" }\n" +" if (self->last) {\n" +" vret = visit(self->last, arg);\n" +" if (vret != 0)\n" +" return vret;\n" +" }\n" +" return 0;\n" +"}" +msgstr "" + +msgid "" +"For each subobject that can participate in cycles, we need to call the :c:" +"func:`!visit` function, which is passed to the traversal method. The :c:func:" +"`!visit` function takes as arguments the subobject and the extra argument " +"*arg* passed to the traversal method. It returns an integer value that must " +"be returned if it is non-zero." +msgstr "" + +msgid "" +"Python provides a :c:func:`Py_VISIT` macro that automates calling visit " +"functions. With :c:func:`Py_VISIT`, we can minimize the amount of " +"boilerplate in ``Custom_traverse``::" +msgstr "" +"Python надає макрос :c:func:`Py_VISIT`, який автоматизує виклик функцій " +"відвідування. За допомогою :c:func:`Py_VISIT` ми можемо мінімізувати " +"кількість шаблонів у ``Custom_traverse``::" + +msgid "" +"static int\n" +"Custom_traverse(CustomObject *self, visitproc visit, void *arg)\n" +"{\n" +" Py_VISIT(self->first);\n" +" Py_VISIT(self->last);\n" +" return 0;\n" +"}" +msgstr "" + +msgid "" +"The :c:member:`~PyTypeObject.tp_traverse` implementation must name its " +"arguments exactly *visit* and *arg* in order to use :c:func:`Py_VISIT`." +msgstr "" +"Реалізація :c:member:`~PyTypeObject.tp_traverse` повинна називати свої " +"аргументи точно *visit* і *arg*, щоб використовувати :c:func:`Py_VISIT`." + +msgid "" +"Second, we need to provide a method for clearing any subobjects that can " +"participate in cycles::" +msgstr "" +"По-друге, нам потрібно надати метод для очищення будь-яких підоб’єктів, які " +"можуть брати участь у циклах::" + +msgid "" +"static int\n" +"Custom_clear(CustomObject *self)\n" +"{\n" +" Py_CLEAR(self->first);\n" +" Py_CLEAR(self->last);\n" +" return 0;\n" +"}" +msgstr "" + +msgid "" +"Notice the use of the :c:func:`Py_CLEAR` macro. It is the recommended and " +"safe way to clear data attributes of arbitrary types while decrementing " +"their reference counts. If you were to call :c:func:`Py_XDECREF` instead on " +"the attribute before setting it to ``NULL``, there is a possibility that the " +"attribute's destructor would call back into code that reads the attribute " +"again (*especially* if there is a reference cycle)." +msgstr "" +"Зверніть увагу на використання макросу :c:func:`Py_CLEAR`. Це рекомендований " +"і безпечний спосіб очищення атрибутів даних довільних типів із одночасним " +"зменшенням кількості посилань. Якщо ви замість цього викликаєте :c:func:" +"`Py_XDECREF` для атрибута перед встановленням значення ``NULL``, існує " +"ймовірність того, що деструктор атрибута знову звернеться до коду, який " +"знову зчитує атрибут (*особливо*, якщо є еталонний цикл)." + +msgid "You could emulate :c:func:`Py_CLEAR` by writing::" +msgstr "Ви можете емулювати :c:func:`Py_CLEAR`, написавши::" + +msgid "" +"PyObject *tmp;\n" +"tmp = self->first;\n" +"self->first = NULL;\n" +"Py_XDECREF(tmp);" +msgstr "" + +msgid "" +"Nevertheless, it is much easier and less error-prone to always use :c:func:" +"`Py_CLEAR` when deleting an attribute. Don't try to micro-optimize at the " +"expense of robustness!" +msgstr "" +"Тим не менше, набагато простіше та менш схильне до помилок завжди " +"використовувати :c:func:`Py_CLEAR` під час видалення атрибута. Не " +"намагайтеся зробити мікрооптимізацію за рахунок надійності!" + +msgid "" +"The deallocator ``Custom_dealloc`` may call arbitrary code when clearing " +"attributes. It means the circular GC can be triggered inside the function. " +"Since the GC assumes reference count is not zero, we need to untrack the " +"object from the GC by calling :c:func:`PyObject_GC_UnTrack` before clearing " +"members. Here is our reimplemented deallocator using :c:func:" +"`PyObject_GC_UnTrack` and ``Custom_clear``::" +msgstr "" +"Розділювач ``Custom_dealloc`` може викликати довільний код під час очищення " +"атрибутів. Це означає, що циклічний GC може бути запущений всередині " +"функції. Оскільки GC передбачає, що кількість посилань не дорівнює нулю, нам " +"потрібно скасувати відстеження об’єкта з GC, викликавши :c:func:" +"`PyObject_GC_UnTrack` перед очищенням елементів. Ось наш повторно " +"реалізований делокатор з використанням :c:func:`PyObject_GC_UnTrack` і " +"``Custom_clear``::" + +msgid "" +"static void\n" +"Custom_dealloc(CustomObject *self)\n" +"{\n" +" PyObject_GC_UnTrack(self);\n" +" Custom_clear(self);\n" +" Py_TYPE(self)->tp_free((PyObject *) self);\n" +"}" +msgstr "" + +msgid "" +"Finally, we add the :c:macro:`Py_TPFLAGS_HAVE_GC` flag to the class flags::" +msgstr "" + +msgid "" +".tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC," +msgstr "" + +msgid "" +"That's pretty much it. If we had written custom :c:member:`~PyTypeObject." +"tp_alloc` or :c:member:`~PyTypeObject.tp_free` handlers, we'd need to modify " +"them for cyclic garbage collection. Most extensions will use the versions " +"automatically provided." +msgstr "" +"Це майже все. Якби ми написали спеціальні обробники :c:member:`~PyTypeObject." +"tp_alloc` або :c:member:`~PyTypeObject.tp_free`, нам потрібно було б змінити " +"їх для циклічного збирання сміття. Більшість розширень використовуватимуть " +"автоматично надані версії." + +msgid "Subclassing other types" +msgstr "Підкласи інших типів" + +msgid "" +"It is possible to create new extension types that are derived from existing " +"types. It is easiest to inherit from the built in types, since an extension " +"can easily use the :c:type:`PyTypeObject` it needs. It can be difficult to " +"share these :c:type:`PyTypeObject` structures between extension modules." +msgstr "" +"Можна створювати нові типи розширень, які є похідними від існуючих типів. " +"Найпростіше успадковувати вбудовані типи, оскільки розширення може легко " +"використовувати необхідний :c:type:`PyTypeObject`. Може бути важко " +"поділитися цими структурами :c:type:`PyTypeObject` між модулями розширення." + +msgid "" +"In this example we will create a :class:`!SubList` type that inherits from " +"the built-in :class:`list` type. The new type will be completely compatible " +"with regular lists, but will have an additional :meth:`!increment` method " +"that increases an internal counter:" +msgstr "" + +msgid "" +">>> import sublist\n" +">>> s = sublist.SubList(range(3))\n" +">>> s.extend(s)\n" +">>> print(len(s))\n" +"6\n" +">>> print(s.increment())\n" +"1\n" +">>> print(s.increment())\n" +"2" +msgstr "" + +msgid "" +"#define PY_SSIZE_T_CLEAN\n" +"#include \n" +"\n" +"typedef struct {\n" +" PyListObject list;\n" +" int state;\n" +"} SubListObject;\n" +"\n" +"static PyObject *\n" +"SubList_increment(SubListObject *self, PyObject *unused)\n" +"{\n" +" self->state++;\n" +" return PyLong_FromLong(self->state);\n" +"}\n" +"\n" +"static PyMethodDef SubList_methods[] = {\n" +" {\"increment\", (PyCFunction) SubList_increment, METH_NOARGS,\n" +" PyDoc_STR(\"increment state counter\")},\n" +" {NULL},\n" +"};\n" +"\n" +"static int\n" +"SubList_init(SubListObject *self, PyObject *args, PyObject *kwds)\n" +"{\n" +" if (PyList_Type.tp_init((PyObject *) self, args, kwds) < 0)\n" +" return -1;\n" +" self->state = 0;\n" +" return 0;\n" +"}\n" +"\n" +"static PyTypeObject SubListType = {\n" +" PyVarObject_HEAD_INIT(NULL, 0)\n" +" .tp_name = \"sublist.SubList\",\n" +" .tp_doc = PyDoc_STR(\"SubList objects\"),\n" +" .tp_basicsize = sizeof(SubListObject),\n" +" .tp_itemsize = 0,\n" +" .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,\n" +" .tp_init = (initproc) SubList_init,\n" +" .tp_methods = SubList_methods,\n" +"};\n" +"\n" +"static PyModuleDef sublistmodule = {\n" +" PyModuleDef_HEAD_INIT,\n" +" .m_name = \"sublist\",\n" +" .m_doc = \"Example module that creates an extension type.\",\n" +" .m_size = -1,\n" +"};\n" +"\n" +"PyMODINIT_FUNC\n" +"PyInit_sublist(void)\n" +"{\n" +" PyObject *m;\n" +" SubListType.tp_base = &PyList_Type;\n" +" if (PyType_Ready(&SubListType) < 0)\n" +" return NULL;\n" +"\n" +" m = PyModule_Create(&sublistmodule);\n" +" if (m == NULL)\n" +" return NULL;\n" +"\n" +" if (PyModule_AddObjectRef(m, \"SubList\", (PyObject *) &SubListType) < " +"0) {\n" +" Py_DECREF(m);\n" +" return NULL;\n" +" }\n" +"\n" +" return m;\n" +"}\n" +msgstr "" + +msgid "" +"As you can see, the source code closely resembles the :class:`!Custom` " +"examples in previous sections. We will break down the main differences " +"between them. ::" +msgstr "" + +msgid "" +"typedef struct {\n" +" PyListObject list;\n" +" int state;\n" +"} SubListObject;" +msgstr "" + +msgid "" +"The primary difference for derived type objects is that the base type's " +"object structure must be the first value. The base type will already " +"include the :c:func:`PyObject_HEAD` at the beginning of its structure." +msgstr "" +"Основна відмінність для об’єктів похідного типу полягає в тому, що структура " +"об’єкта базового типу має бути першим значенням. Базовий тип уже включатиме :" +"c:func:`PyObject_HEAD` на початку своєї структури." + +msgid "" +"When a Python object is a :class:`!SubList` instance, its ``PyObject *`` " +"pointer can be safely cast to both ``PyListObject *`` and ``SubListObject " +"*``::" +msgstr "" + +msgid "" +"static int\n" +"SubList_init(SubListObject *self, PyObject *args, PyObject *kwds)\n" +"{\n" +" if (PyList_Type.tp_init((PyObject *) self, args, kwds) < 0)\n" +" return -1;\n" +" self->state = 0;\n" +" return 0;\n" +"}" +msgstr "" + +msgid "" +"We see above how to call through to the :meth:`~object.__init__` method of " +"the base type." +msgstr "" + +msgid "" +"This pattern is important when writing a type with custom :c:member:" +"`~PyTypeObject.tp_new` and :c:member:`~PyTypeObject.tp_dealloc` members. " +"The :c:member:`~PyTypeObject.tp_new` handler should not actually create the " +"memory for the object with its :c:member:`~PyTypeObject.tp_alloc`, but let " +"the base class handle it by calling its own :c:member:`~PyTypeObject.tp_new`." +msgstr "" +"Цей шаблон важливий під час написання типу з власними елементами :c:member:" +"`~PyTypeObject.tp_new` і :c:member:`~PyTypeObject.tp_dealloc`. Обробник :c:" +"member:`~PyTypeObject.tp_new` насправді не повинен створювати пам’ять для " +"об’єкта за допомогою його :c:member:`~PyTypeObject.tp_alloc`, а дозволити " +"базовому класу обробляти це, викликаючи власний :c:member:`~PyTypeObject." +"tp_new`." + +msgid "" +"The :c:type:`PyTypeObject` struct supports a :c:member:`~PyTypeObject." +"tp_base` specifying the type's concrete base class. Due to cross-platform " +"compiler issues, you can't fill that field directly with a reference to :c:" +"type:`PyList_Type`; it should be done later in the module initialization " +"function::" +msgstr "" +"Структура :c:type:`PyTypeObject` підтримує :c:member:`~PyTypeObject." +"tp_base`, що визначає конкретний базовий клас типу. Через проблеми " +"міжплатформного компілятора ви не можете заповнити це поле безпосередньо " +"посиланням на :c:type:`PyList_Type`; це слід зробити пізніше у функції " +"ініціалізації модуля:" + +msgid "" +"PyMODINIT_FUNC\n" +"PyInit_sublist(void)\n" +"{\n" +" PyObject* m;\n" +" SubListType.tp_base = &PyList_Type;\n" +" if (PyType_Ready(&SubListType) < 0)\n" +" return NULL;\n" +"\n" +" m = PyModule_Create(&sublistmodule);\n" +" if (m == NULL)\n" +" return NULL;\n" +"\n" +" if (PyModule_AddObjectRef(m, \"SubList\", (PyObject *) &SubListType) < " +"0) {\n" +" Py_DECREF(m);\n" +" return NULL;\n" +" }\n" +"\n" +" return m;\n" +"}" +msgstr "" + +msgid "" +"Before calling :c:func:`PyType_Ready`, the type structure must have the :c:" +"member:`~PyTypeObject.tp_base` slot filled in. When we are deriving an " +"existing type, it is not necessary to fill out the :c:member:`~PyTypeObject." +"tp_alloc` slot with :c:func:`PyType_GenericNew` -- the allocation function " +"from the base type will be inherited." +msgstr "" +"Перш ніж викликати :c:func:`PyType_Ready`, у структурі типу має бути " +"заповнений слот :c:member:`~PyTypeObject.tp_base`. Коли ми створюємо " +"існуючий тип, немає необхідності заповнювати :c:member:`~PyTypeObject." +"tp_alloc` слот з :c:func:`PyType_GenericNew` -- функція розподілу з базового " +"типу буде успадкована." + +msgid "" +"After that, calling :c:func:`PyType_Ready` and adding the type object to the " +"module is the same as with the basic :class:`!Custom` examples." +msgstr "" + +msgid "Footnotes" +msgstr "Виноски" + +msgid "" +"This is true when we know that the object is a basic type, like a string or " +"a float." +msgstr "" +"Це вірно, коли ми знаємо, що об’єкт є базовим типом, як-от рядок або float." + +msgid "" +"We relied on this in the :c:member:`~PyTypeObject.tp_dealloc` handler in " +"this example, because our type doesn't support garbage collection." +msgstr "" +"Ми покладалися на це в обробнику :c:member:`~PyTypeObject.tp_dealloc` у " +"цьому прикладі, оскільки наш тип не підтримує збирання сміття." + +msgid "" +"We now know that the first and last members are strings, so perhaps we could " +"be less careful about decrementing their reference counts, however, we " +"accept instances of string subclasses. Even though deallocating normal " +"strings won't call back into our objects, we can't guarantee that " +"deallocating an instance of a string subclass won't call back into our " +"objects." +msgstr "" +"Тепер ми знаємо, що перший і останній члени є рядками, тому, можливо, ми " +"могли б бути менш обережними щодо зменшення їх кількості посилань, однак ми " +"приймаємо екземпляри підкласів рядків. Незважаючи на те, що звільнення від " +"розміщення звичайних рядків не призведе до зворотного виклику наших " +"об’єктів, ми не можемо гарантувати, що звільнення від розміщення екземпляра " +"підкласу рядка не призведе до зворотного виклику до наших об’єктів." + +msgid "" +"Also, even with our attributes restricted to strings instances, the user " +"could pass arbitrary :class:`str` subclasses and therefore still create " +"reference cycles." +msgstr "" +"Крім того, навіть якщо наші атрибути обмежені екземплярами рядків, " +"користувач може передавати довільні підкласи :class:`str` і, отже, " +"створювати цикли посилань." diff --git a/extending/windows.po b/extending/windows.po new file mode 100644 index 000000000..ca88f8312 --- /dev/null +++ b/extending/windows.po @@ -0,0 +1,256 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:52+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Building C and C++ Extensions on Windows" +msgstr "Створення розширень C і C++ у Windows" + +msgid "" +"This chapter briefly explains how to create a Windows extension module for " +"Python using Microsoft Visual C++, and follows with more detailed background " +"information on how it works. The explanatory material is useful for both " +"the Windows programmer learning to build Python extensions and the Unix " +"programmer interested in producing software which can be successfully built " +"on both Unix and Windows." +msgstr "" +"У цій главі коротко пояснюється, як створити модуль розширення Windows для " +"Python за допомогою Microsoft Visual C++, а далі надається більш детальна " +"довідкова інформація про те, як це працює. Пояснювальний матеріал корисний " +"як для Windows-програміста, який навчається створювати розширення Python, " +"так і для Unix-програміста, зацікавленого у створенні програмного " +"забезпечення, яке можна успішно створювати як на Unix, так і на Windows." + +msgid "" +"Module authors are encouraged to use the distutils approach for building " +"extension modules, instead of the one described in this section. You will " +"still need the C compiler that was used to build Python; typically Microsoft " +"Visual C++." +msgstr "" +"Авторам модулів рекомендується використовувати підхід distutils для " +"створення модулів розширення замість описаного в цьому розділі. Вам все одно " +"знадобиться компілятор C, який використовувався для створення Python; " +"зазвичай Microsoft Visual C++." + +msgid "" +"This chapter mentions a number of filenames that include an encoded Python " +"version number. These filenames are represented with the version number " +"shown as ``XY``; in practice, ``'X'`` will be the major version number and " +"``'Y'`` will be the minor version number of the Python release you're " +"working with. For example, if you are using Python 2.2.1, ``XY`` will " +"actually be ``22``." +msgstr "" +"У цьому розділі згадується кілька імен файлів, які включають закодований " +"номер версії Python. Ці назви файлів представлені номером версії, показаним " +"як ``XY``; на практиці ``'X'`` буде номером основної версії, а ``'Y''`` буде " +"номером другорядної версії випуску Python, з яким ви працюєте. Наприклад, " +"якщо ви використовуєте Python 2.2.1, ``XY`` насправді буде ``22``." + +msgid "A Cookbook Approach" +msgstr "Підхід з кулінарної книги" + +msgid "" +"There are two approaches to building extension modules on Windows, just as " +"there are on Unix: use the ``setuptools`` package to control the build " +"process, or do things manually. The setuptools approach works well for most " +"extensions; documentation on using ``setuptools`` to build and package " +"extension modules is available in :ref:`setuptools-index`. If you find you " +"really need to do things manually, it may be instructive to study the " +"project file for the :source:`winsound ` standard " +"library module." +msgstr "" + +msgid "Differences Between Unix and Windows" +msgstr "Відмінності між Unix і Windows" + +msgid "" +"Unix and Windows use completely different paradigms for run-time loading of " +"code. Before you try to build a module that can be dynamically loaded, be " +"aware of how your system works." +msgstr "" +"Unix і Windows використовують абсолютно різні парадигми для завантаження " +"коду під час виконання. Перш ніж спробувати створити модуль, який можна " +"динамічно завантажувати, ознайомтеся з тим, як працює ваша система." + +msgid "" +"In Unix, a shared object (:file:`.so`) file contains code to be used by the " +"program, and also the names of functions and data that it expects to find in " +"the program. When the file is joined to the program, all references to " +"those functions and data in the file's code are changed to point to the " +"actual locations in the program where the functions and data are placed in " +"memory. This is basically a link operation." +msgstr "" +"В Unix файл спільного об’єкта (:file:`.so`) містить код, який буде " +"використовуватися програмою, а також назви функцій і даних, які вона очікує " +"знайти в програмі. Коли файл приєднується до програми, усі посилання на ці " +"функції та дані в коді файлу змінюються, щоб вказувати на фактичні місця в " +"програмі, де функції та дані розміщені в пам’яті. По суті, це операція " +"посилання." + +msgid "" +"In Windows, a dynamic-link library (:file:`.dll`) file has no dangling " +"references. Instead, an access to functions or data goes through a lookup " +"table. So the DLL code does not have to be fixed up at runtime to refer to " +"the program's memory; instead, the code already uses the DLL's lookup table, " +"and the lookup table is modified at runtime to point to the functions and " +"data." +msgstr "" +"У Windows файл бібліотеки динамічного компонування (:file:`.dll`) не має " +"висячих посилань. Натомість доступ до функцій або даних відбувається через " +"таблицю пошуку. Тому код DLL не потрібно виправляти під час виконання, щоб " +"посилатися на пам’ять програми; замість цього код уже використовує таблицю " +"пошуку DLL, і таблиця пошуку змінюється під час виконання, щоб вказувати на " +"функції та дані." + +msgid "" +"In Unix, there is only one type of library file (:file:`.a`) which contains " +"code from several object files (:file:`.o`). During the link step to create " +"a shared object file (:file:`.so`), the linker may find that it doesn't know " +"where an identifier is defined. The linker will look for it in the object " +"files in the libraries; if it finds it, it will include all the code from " +"that object file." +msgstr "" +"В Unix існує лише один тип файлу бібліотеки (:file:`.a`), який містить код " +"із кількох об’єктних файлів (:file:`.o`). Під час етапу зв’язування для " +"створення файлу спільного об’єкта (:file:`.so`) компонувальник може виявити, " +"що він не знає, де визначено ідентифікатор. Компонувальник шукатиме його в " +"об’єктних файлах у бібліотеках; якщо він знайде його, він включить увесь код " +"із цього об’єктного файлу." + +msgid "" +"In Windows, there are two types of library, a static library and an import " +"library (both called :file:`.lib`). A static library is like a Unix :file:`." +"a` file; it contains code to be included as necessary. An import library is " +"basically used only to reassure the linker that a certain identifier is " +"legal, and will be present in the program when the DLL is loaded. So the " +"linker uses the information from the import library to build the lookup " +"table for using identifiers that are not included in the DLL. When an " +"application or a DLL is linked, an import library may be generated, which " +"will need to be used for all future DLLs that depend on the symbols in the " +"application or DLL." +msgstr "" +"У Windows існує два типи бібліотек: статична та імпортована (обидві " +"називаються :file:`.lib`). Статична бібліотека схожа на файл Unix :file:`." +"a`; він містить код, який слід включити за необхідності. Бібліотека імпорту " +"в основному використовується лише для того, щоб переконати компонувальник у " +"тому, що певний ідентифікатор є законним і буде присутній у програмі, коли " +"DLL завантажується. Таким чином, компонувальник використовує інформацію з " +"бібліотеки імпорту для створення таблиці пошуку для використання " +"ідентифікаторів, які не включені в DLL. Коли програму або DLL пов’язано, " +"може бути створена бібліотека імпорту, яку потрібно буде використовувати для " +"всіх майбутніх DLL, які залежать від символів у програмі чи DLL." + +msgid "" +"Suppose you are building two dynamic-load modules, B and C, which should " +"share another block of code A. On Unix, you would *not* pass :file:`A.a` to " +"the linker for :file:`B.so` and :file:`C.so`; that would cause it to be " +"included twice, so that B and C would each have their own copy. In Windows, " +"building :file:`A.dll` will also build :file:`A.lib`. You *do* pass :file:" +"`A.lib` to the linker for B and C. :file:`A.lib` does not contain code; it " +"just contains information which will be used at runtime to access A's code." +msgstr "" +"Припустімо, ви створюєте два модулі динамічного завантаження, B і C, які " +"мають спільно використовувати ще один блок коду A. В Unix ви *не* передаєте :" +"file:`A.a` компонувальнику для :file:`B.so` і :file:`C.so`; це призвело б до " +"того, що його було б включено двічі, так що B і C мали б кожен свою копію. У " +"Windows збірка :file:`A.dll` також створить :file:`A.lib`. Ви *передаєте* :" +"file:`A.lib` компонувальнику для B і C. :file:`A.lib` не містить коду; він " +"просто містить інформацію, яка буде використана під час виконання для " +"доступу до коду A." + +msgid "" +"In Windows, using an import library is sort of like using ``import spam``; " +"it gives you access to spam's names, but does not create a separate copy. " +"On Unix, linking with a library is more like ``from spam import *``; it does " +"create a separate copy." +msgstr "" +"У Windows використання бібліотеки імпорту схоже на використання ``import " +"spam``; він надає вам доступ до імен спаму, але не створює окремої копії. В " +"Unix зв’язування з бібліотекою більше схоже на ``імпорт спаму *``; він " +"створює окрему копію." + +msgid "Using DLLs in Practice" +msgstr "Використання DLL на практиці" + +msgid "" +"Windows Python is built in Microsoft Visual C++; using other compilers may " +"or may not work. The rest of this section is MSVC++ specific." +msgstr "" +"Windows Python побудовано на Microsoft Visual C++; використання інших " +"компіляторів може працювати, а може і не працювати. Решта цього розділу " +"стосується MSVC++." + +msgid "" +"When creating DLLs in Windows, you must pass :file:`pythonXY.lib` to the " +"linker. To build two DLLs, spam and ni (which uses C functions found in " +"spam), you could use these commands::" +msgstr "" +"Під час створення DLL у Windows ви повинні передати :file:`pythonXY.lib` до " +"компонувальника. Щоб створити дві бібліотеки DLL, spam і ni (яка " +"використовує функції C, знайдені в спамі), ви можете використати такі " +"команди:" + +msgid "" +"cl /LD /I/python/include spam.c ../libs/pythonXY.lib\n" +"cl /LD /I/python/include ni.c spam.lib ../libs/pythonXY.lib" +msgstr "" + +msgid "" +"The first command created three files: :file:`spam.obj`, :file:`spam.dll` " +"and :file:`spam.lib`. :file:`Spam.dll` does not contain any Python " +"functions (such as :c:func:`PyArg_ParseTuple`), but it does know how to find " +"the Python code thanks to :file:`pythonXY.lib`." +msgstr "" +"Перша команда створила три файли: :file:`spam.obj`, :file:`spam.dll` і :file:" +"`spam.lib`. :file:`Spam.dll` не містить жодних функцій Python (таких як :c:" +"func:`PyArg_ParseTuple`), але він знає, як знайти код Python завдяки :file:" +"`pythonXY.lib`." + +msgid "" +"The second command created :file:`ni.dll` (and :file:`.obj` and :file:`." +"lib`), which knows how to find the necessary functions from spam, and also " +"from the Python executable." +msgstr "" +"Друга команда створила :file:`ni.dll` (і :file:`.obj` і :file:`.lib`), який " +"вміє знаходити потрібні функції в спамі, а також у виконуваному файлі Python." + +msgid "" +"Not every identifier is exported to the lookup table. If you want any other " +"modules (including Python) to be able to see your identifiers, you have to " +"say ``_declspec(dllexport)``, as in ``void _declspec(dllexport) " +"initspam(void)`` or ``PyObject _declspec(dllexport) *NiGetSpamData(void)``." +msgstr "" +"Не кожен ідентифікатор експортується до таблиці пошуку. Якщо ви хочете, щоб " +"будь-які інші модулі (включно з Python) могли бачити ваші ідентифікатори, " +"вам потрібно сказати ``_declspec(dllexport)``, як у ``void " +"_declspec(dllexport) initspam(void)`` або ``PyObject _declspec(dllexport) " +"*NiGetSpamData(void)``." + +msgid "" +"Developer Studio will throw in a lot of import libraries that you do not " +"really need, adding about 100K to your executable. To get rid of them, use " +"the Project Settings dialog, Link tab, to specify *ignore default " +"libraries*. Add the correct :file:`msvcrt{xx}.lib` to the list of libraries." +msgstr "" diff --git a/faq/design.po b/faq/design.po new file mode 100644 index 000000000..87d70cf3e --- /dev/null +++ b/faq/design.po @@ -0,0 +1,1369 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# Vadim Kashirny, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:52+0000\n" +"Last-Translator: Vadim Kashirny, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Design and History FAQ" +msgstr "Поширені запитання про оформлення та історію" + +msgid "Contents" +msgstr "Зміст" + +msgid "Why does Python use indentation for grouping of statements?" +msgstr "Чому Python використовує відступи для групування операторів?" + +msgid "" +"Guido van Rossum believes that using indentation for grouping is extremely " +"elegant and contributes a lot to the clarity of the average Python program. " +"Most people learn to love this feature after a while." +msgstr "" +"Гвідо ван Россум вважає, що використання відступів для групування є " +"надзвичайно елегантним і значною мірою сприяє ясності звичайної програми на " +"Python. Більшість людей через деякий час полюблять цю функцію." + +msgid "" +"Since there are no begin/end brackets there cannot be a disagreement between " +"grouping perceived by the parser and the human reader. Occasionally C " +"programmers will encounter a fragment of code like this::" +msgstr "" +"Оскільки немає початкових/кінцевих дужок, не може бути розбіжностей між " +"групуванням, сприйнятим синтаксичним аналізатором і людиною, що читає код. " +"Час від часу програмісти на C стикаються з таким фрагментом коду:" + +msgid "" +"if (x <= y)\n" +" x++;\n" +" y--;\n" +"z++;" +msgstr "" + +msgid "" +"Only the ``x++`` statement is executed if the condition is true, but the " +"indentation leads many to believe otherwise. Even experienced C programmers " +"will sometimes stare at it a long time wondering as to why ``y`` is being " +"decremented even for ``x > y``." +msgstr "" +"Тільки оператор ``x++`` виконується, якщо умова виконується, але відступ " +"змушує багатьох вважати протилежне. Навіть досвідчені С-програмісти іноді " +"довго дивляться на нього, дивуючись, чому ``y`` зменшується навіть для ``x > " +"y``." + +msgid "" +"Because there are no begin/end brackets, Python is much less prone to coding-" +"style conflicts. In C there are many different ways to place the braces. " +"After becoming used to reading and writing code using a particular style, it " +"is normal to feel somewhat uneasy when reading (or being required to write) " +"in a different one." +msgstr "" +"Оскільки немає початкових/кінцевих фігурних дужок, Python значно менше " +"схильний до конфліктів стилю кодування. У C є багато різних способів " +"розміщення фігурних дужок. Після того, як ви звикли читати та писати код, " +"використовуючи певний стиль, це нормально відчувати незручності, коли " +"читаєте (або коли вам потрібно писати) в іншому стилі." + +msgid "" +"Many coding styles place begin/end brackets on a line by themselves. This " +"makes programs considerably longer and wastes valuable screen space, making " +"it harder to get a good overview of a program. Ideally, a function should " +"fit on one screen (say, 20--30 lines). 20 lines of Python can do a lot more " +"work than 20 lines of C. This is not solely due to the lack of begin/end " +"brackets -- the lack of declarations and the high-level data types are also " +"responsible -- but the indentation-based syntax certainly helps." +msgstr "" +"Багато стилів кодування розміщують початкові/кінцеві дужки на рядку " +"самостійно. Це робить програми значно довшими та витрачає дорогоцінний " +"простір на екрані, що ускладнює гарний огляд програми. В ідеалі функція " +"повинна міститися на одному екрані (скажімо, 20--30 рядків). 20 рядків " +"Python можуть виконувати набагато більше роботи, ніж 20 рядків C. Це " +"пов’язано не лише з відсутністю початкових/кінцевих дужок – відсутність " +"декларацій і високорівневих типів даних також відповідає – але оснований на " +"відступах синтаксис, звичайно, допомагає." + +msgid "Why am I getting strange results with simple arithmetic operations?" +msgstr "Чому я отримую дивні результати під час простих арифметичних операцій?" + +msgid "See the next question." +msgstr "Дивіться наступне запитання." + +msgid "Why are floating-point calculations so inaccurate?" +msgstr "Чому обчислення з плаваючою комою настільки неточні?" + +msgid "Users are often surprised by results like this::" +msgstr "Користувачів часто дивують такі результати:" + +msgid "" +">>> 1.2 - 1.0\n" +"0.19999999999999996" +msgstr "" + +msgid "" +"and think it is a bug in Python. It's not. This has little to do with " +"Python, and much more to do with how the underlying platform handles " +"floating-point numbers." +msgstr "" +"і вони думають, що це помилка в Python. Це не так. Це має мало спільного з " +"Python, і набагато більше пов’язане з тим, як базова платформа обробляє " +"числа з плаваючою комою." + +msgid "" +"The :class:`float` type in CPython uses a C ``double`` for storage. A :" +"class:`float` object's value is stored in binary floating-point with a fixed " +"precision (typically 53 bits) and Python uses C operations, which in turn " +"rely on the hardware implementation in the processor, to perform floating-" +"point operations. This means that as far as floating-point operations are " +"concerned, Python behaves like many popular languages including C and Java." +msgstr "" +"Тип :class:`float` у CPython використовує C ``double`` для зберігання. " +"Значення об’єкта :class:`float` зберігається у двійковій формі з плаваючою " +"комою з фіксованою точністю (зазвичай 53 біти), і Python використовує " +"операції C, які, у свою чергу, покладаються на апаратну реалізацію в " +"процесорі, щоб виконувати операції з плаваючою комою. Це означає, що в " +"операціях з плаваючою комою Python поводиться як багато популярних мов, " +"включаючи C і Java." + +msgid "" +"Many numbers that can be written easily in decimal notation cannot be " +"expressed exactly in binary floating point. For example, after::" +msgstr "" + +msgid ">>> x = 1.2" +msgstr "" + +msgid "" +"the value stored for ``x`` is a (very good) approximation to the decimal " +"value ``1.2``, but is not exactly equal to it. On a typical machine, the " +"actual stored value is::" +msgstr "" +"значення, яке зберігається для ``x``, є (дуже точним) наближенням до " +"десяткового значення ``1.2``, але не зовсім дорівнює йому. На типовій машині " +"фактичне збережене значення:" + +msgid "1.0011001100110011001100110011001100110011001100110011 (binary)" +msgstr "" + +msgid "which is exactly::" +msgstr "а саме::" + +msgid "1.1999999999999999555910790149937383830547332763671875 (decimal)" +msgstr "" + +msgid "" +"The typical precision of 53 bits provides Python floats with 15--16 decimal " +"digits of accuracy." +msgstr "" +"Типова точність в 53 біти забезпечує числа з плаваючою точкою Python з " +"точністю 15--16 десяткових цифр." + +msgid "" +"For a fuller explanation, please see the :ref:`floating-point arithmetic " +"` chapter in the Python tutorial." +msgstr "" + +msgid "Why are Python strings immutable?" +msgstr "Чому рядки Python немутабельні?" + +msgid "There are several advantages." +msgstr "Є кілька переваг." + +msgid "" +"One is performance: knowing that a string is immutable means we can allocate " +"space for it at creation time, and the storage requirements are fixed and " +"unchanging. This is also one of the reasons for the distinction between " +"tuples and lists." +msgstr "" +"Одна з них — це продуктивність: знання того, що рядок є незмінним, означає, " +"що ми можемо виділити для нього місце під час створення, а вимоги до пам’яті " +"є фіксованими та незмінними. Це також одна з причин відмінності між " +"кортежами та списками." + +msgid "" +"Another advantage is that strings in Python are considered as \"elemental\" " +"as numbers. No amount of activity will change the value 8 to anything else, " +"and in Python, no amount of activity will change the string \"eight\" to " +"anything else." +msgstr "" +"Ще одна перевага полягає в тому, що рядки в Python вважаються такими ж " +"\"елементарними\", як і числа. Жодна активність не змінить значення 8 на " +"щось інше, а в Python жодна активність не змінить рядок \"вісім\" на щось " +"інше." + +msgid "Why must 'self' be used explicitly in method definitions and calls?" +msgstr "" +"Чому \"self\" має використовуватися явно у визначеннях і викликах методів?" + +msgid "" +"The idea was borrowed from Modula-3. It turns out to be very useful, for a " +"variety of reasons." +msgstr "" +"Ідея була запозичена з Modula-3. Це виявляється дуже корисним з різних " +"причин." + +msgid "" +"First, it's more obvious that you are using a method or instance attribute " +"instead of a local variable. Reading ``self.x`` or ``self.meth()`` makes it " +"absolutely clear that an instance variable or method is used even if you " +"don't know the class definition by heart. In C++, you can sort of tell by " +"the lack of a local variable declaration (assuming globals are rare or " +"easily recognizable) -- but in Python, there are no local variable " +"declarations, so you'd have to look up the class definition to be sure. " +"Some C++ and Java coding standards call for instance attributes to have an " +"``m_`` prefix, so this explicitness is still useful in those languages, too." +msgstr "" +"По-перше, більш очевидно, що ви використовуєте метод або атрибут екземпляра " +"замість локальної змінної. Читання ``self.x`` або ``self.meth()`` робить " +"абсолютно зрозумілим, що використовується змінна екземпляра або метод, " +"навіть якщо ви не знаєте визначення класу напам'ять. У C++ це можна " +"визначити за відсутністю оголошення локальної змінної (якщо глобальні " +"значення рідкісні або легко впізнавані), але в Python немає оголошення " +"локальної змінної, тому вам доведеться шукати визначення класу, щоб бути " +"впевненим. Деякі стандарти кодування C++ і Java вимагають, щоб атрибути " +"екземплярів мали префікс ``m_``, тому ця чіткість все ще корисна в цих мовах." + +msgid "" +"Second, it means that no special syntax is necessary if you want to " +"explicitly reference or call the method from a particular class. In C++, if " +"you want to use a method from a base class which is overridden in a derived " +"class, you have to use the ``::`` operator -- in Python you can write " +"``baseclass.methodname(self, )``. This is particularly " +"useful for :meth:`~object.__init__` methods, and in general in cases where a " +"derived class method wants to extend the base class method of the same name " +"and thus has to call the base class method somehow." +msgstr "" + +msgid "" +"Finally, for instance variables it solves a syntactic problem with " +"assignment: since local variables in Python are (by definition!) those " +"variables to which a value is assigned in a function body (and that aren't " +"explicitly declared global), there has to be some way to tell the " +"interpreter that an assignment was meant to assign to an instance variable " +"instead of to a local variable, and it should preferably be syntactic (for " +"efficiency reasons). C++ does this through declarations, but Python doesn't " +"have declarations and it would be a pity having to introduce them just for " +"this purpose. Using the explicit ``self.var`` solves this nicely. " +"Similarly, for using instance variables, having to write ``self.var`` means " +"that references to unqualified names inside a method don't have to search " +"the instance's directories. To put it another way, local variables and " +"instance variables live in two different namespaces, and you need to tell " +"Python which namespace to use." +msgstr "" +"Нарешті, для змінних екземпляра, такий підхід вирішує синтаксичну проблему " +"з призначенням: оскільки локальні змінні в Python — це (за визначенням!) ті " +"змінні, яким присвоєно значення в тілі функції (і які явно не оголошені " +"глобальними), необхідно бути якимось способом повідомити інтерпретатору, що " +"це призначено для встановленния значення змінній екземпляра, а не локальній " +"змінній, і бажано, щоб воно було синтаксичним (з причин ефективності). C++ " +"робить це за допомогою декларацій, але Python не має декларацій, і було б " +"шкода вводити їх лише для цієї мети. Використання явного ``self.var`` добре " +"вирішує цю проблему. Подібним чином, для використання змінних екземпляра " +"необхідність запису ``self.var`` означає, що посилання на некваліфіковані " +"імена всередині методу не потребують пошуку в каталогах екземпляра. Іншими " +"словами, локальні змінні та змінні екземплярів живуть у двох різних " +"просторах імен, і вам потрібно сказати інтерпритатору Python, який простір " +"імен використовувати." + +msgid "Why can't I use an assignment in an expression?" +msgstr "Чому я не можу використовувати присвоєння у виразі?" + +msgid "Starting in Python 3.8, you can!" +msgstr "Починаючи з Python 3.8, ви можете!" + +msgid "" +"Assignment expressions using the walrus operator ``:=`` assign a variable in " +"an expression::" +msgstr "" + +msgid "" +"while chunk := fp.read(200):\n" +" print(chunk)" +msgstr "" + +msgid "See :pep:`572` for more information." +msgstr "Перегляньте :pep:`572` для отримання додаткової інформації." + +msgid "" +"Why does Python use methods for some functionality (e.g. list.index()) but " +"functions for other (e.g. len(list))?" +msgstr "" +"Чому Python використовує методи для одних функцій (наприклад, list.index()), " +"а функції для інших (наприклад, len(list))?" + +msgid "As Guido said:" +msgstr "Як сказав Гвідо:" + +msgid "" +"(a) For some operations, prefix notation just reads better than postfix -- " +"prefix (and infix!) operations have a long tradition in mathematics which " +"likes notations where the visuals help the mathematician thinking about a " +"problem. Compare the easy with which we rewrite a formula like x*(a+b) into " +"x*a + x*b to the clumsiness of doing the same thing using a raw OO notation." +msgstr "" +"(a) Для деяких операцій префіксна нотація просто читається краще, ніж " +"постфіксна — префіксні (та інфіксні!) операції мають давню традицію в " +"математиці, яка любить нотації, де візуальні елементи допомагають математику " +"думати про проблему. Порівняйте легкість, за допомогою якої ми переписуємо " +"формулу на кшталт x*(a+b) на x*a + x*b, із незграбністю виконання того ж " +"самого, використовуючи чисту нотацію OO." + +msgid "" +"(b) When I read code that says len(x) I *know* that it is asking for the " +"length of something. This tells me two things: the result is an integer, and " +"the argument is some kind of container. To the contrary, when I read x." +"len(), I have to already know that x is some kind of container implementing " +"an interface or inheriting from a class that has a standard len(). Witness " +"the confusion we occasionally have when a class that is not implementing a " +"mapping has a get() or keys() method, or something that isn't a file has a " +"write() method." +msgstr "" +"(b) Коли я читаю код, який каже len(x), я *знаю*, що він запитує довжину " +"чогось. Це говорить мені про дві речі: результат є цілим числом, а аргумент " +"є певним контейнером. Навпаки, коли я читаю x.len(), я вже маю знати, що x — " +"це якийсь контейнер, який реалізує інтерфейс або успадковує від класу, який " +"має стандартний len(). Подивіться, яка плутанина у нас іноді виникає, коли " +"клас, який не реалізує відображення, має метод get() або keys(), або щось, " +"що не є файлом, має метод write()." + +msgid "https://mail.python.org/pipermail/python-3000/2006-November/004643.html" +msgstr "" +"https://mail.python.org/pipermail/python-3000/2006-November/004643.html" + +msgid "Why is join() a string method instead of a list or tuple method?" +msgstr "Чому метод join() є методом рядків, а не методом списку чи кортежу?" + +msgid "" +"Strings became much more like other standard types starting in Python 1.6, " +"when methods were added which give the same functionality that has always " +"been available using the functions of the string module. Most of these new " +"methods have been widely accepted, but the one which appears to make some " +"programmers feel uncomfortable is::" +msgstr "" +"Рядки стали набагато більше схожими на інші стандартні типи, починаючи з " +"Python 1.6, коли були додані методи, які надають ту саму функціональність, " +"яка завжди була доступна за допомогою функцій модуля string. Більшість цих " +"нових методів були широко прийняті, але один, який, здається, змушує деяких " +"програмістів почуватися некомфортно:" + +msgid "\", \".join(['1', '2', '4', '8', '16'])" +msgstr "" + +msgid "which gives the result::" +msgstr "що дає результат::" + +msgid "\"1, 2, 4, 8, 16\"" +msgstr "" + +msgid "There are two common arguments against this usage." +msgstr "Існує два загальні аргументи проти такого використання." + +msgid "" +"The first runs along the lines of: \"It looks really ugly using a method of " +"a string literal (string constant)\", to which the answer is that it might, " +"but a string literal is just a fixed value. If the methods are to be allowed " +"on names bound to strings there is no logical reason to make them " +"unavailable on literals." +msgstr "" +"Перше звучить так: \"Це виглядає дуже потворно, використовуючи метод " +"рядкового літералу (рядкова константа)\", на що є відповідь, що це може " +"бути, навіть якщо рядковий літерал це лише фіксоване значення. Якщо методи " +"мають бути дозволені для імен, прив’язаних до рядків, немає логічної причини " +"робити їх недоступними для літералів." + +msgid "" +"The second objection is typically cast as: \"I am really telling a sequence " +"to join its members together with a string constant\". Sadly, you aren't. " +"For some reason there seems to be much less difficulty with having :meth:" +"`~str.split` as a string method, since in that case it is easy to see that ::" +msgstr "" +"Друге заперечення, як правило, формулюється так: \"Я справді кажу " +"послідовності об’єднати її члени за допомогою рядкової константи\". На жаль, " +"ні. З певних причин здається, що з використанням :meth:`~str.split` як " +"рядкового методу набагато менше труднощів, оскільки в цьому випадку легко " +"побачити, що:" + +msgid "\"1, 2, 4, 8, 16\".split(\", \")" +msgstr "" + +msgid "" +"is an instruction to a string literal to return the substrings delimited by " +"the given separator (or, by default, arbitrary runs of white space)." +msgstr "" +"це вказівка для рядкового літералу повертати підрядки, розділені заданим " +"роздільником (або, за замовчуванням, пробілом)." + +msgid "" +":meth:`~str.join` is a string method because in using it you are telling the " +"separator string to iterate over a sequence of strings and insert itself " +"between adjacent elements. This method can be used with any argument which " +"obeys the rules for sequence objects, including any new classes you might " +"define yourself. Similar methods exist for bytes and bytearray objects." +msgstr "" +":meth:`~str.join` — це рядковий метод, оскільки, використовуючи його, ви " +"вказуєте рядку-роздільнику перебирати послідовність рядків і вставляти себе " +"між суміжними елементами. Цей метод можна використовувати з будь-яким " +"аргументом, який підкоряється правилам для об’єктів послідовності, включаючи " +"будь-які нові класи, які ви можете визначити самостійно. Подібні методи " +"існують для об’єктів bytes і bytearray." + +msgid "How fast are exceptions?" +msgstr "Як швидко працюють винятки?" + +msgid "" +"A :keyword:`try`/:keyword:`except` block is extremely efficient if no " +"exceptions are raised. Actually catching an exception is expensive. In " +"versions of Python prior to 2.0 it was common to use this idiom::" +msgstr "" + +msgid "" +"try:\n" +" value = mydict[key]\n" +"except KeyError:\n" +" mydict[key] = getvalue(key)\n" +" value = mydict[key]" +msgstr "" + +msgid "" +"This only made sense when you expected the dict to have the key almost all " +"the time. If that wasn't the case, you coded it like this::" +msgstr "" +"Це мало сенс лише тоді, коли ви очікували, що dict матиме ключ майже весь " +"час. Якщо це не так, ви закодували це так::" + +msgid "" +"if key in mydict:\n" +" value = mydict[key]\n" +"else:\n" +" value = mydict[key] = getvalue(key)" +msgstr "" + +msgid "" +"For this specific case, you could also use ``value = dict.setdefault(key, " +"getvalue(key))``, but only if the ``getvalue()`` call is cheap enough " +"because it is evaluated in all cases." +msgstr "" +"Для цього конкретного випадку ви також можете використати ``value = dict." +"setdefault(key, getvalue(key))``, але лише якщо виклик ``getvalue()`` досить " +"дешевий, оскільки він оцінюється в усіх випадках." + +msgid "Why isn't there a switch or case statement in Python?" +msgstr "Чому в Python немає оператора switch або case?" + +msgid "" +"In general, structured switch statements execute one block of code when an " +"expression has a particular value or set of values. Since Python 3.10 one " +"can easily match literal values, or constants within a namespace, with a " +"``match ... case`` statement. An older alternative is a sequence of ``if... " +"elif... elif... else``." +msgstr "" + +msgid "" +"For cases where you need to choose from a very large number of " +"possibilities, you can create a dictionary mapping case values to functions " +"to call. For example::" +msgstr "" +"У випадках, коли вам потрібно вибрати з дуже великої кількості можливостей, " +"ви можете створити словник, який зіставлятиме значення регістру з функціями " +"для виклику. Наприклад::" + +msgid "" +"functions = {'a': function_1,\n" +" 'b': function_2,\n" +" 'c': self.method_1}\n" +"\n" +"func = functions[value]\n" +"func()" +msgstr "" + +msgid "" +"For calling methods on objects, you can simplify yet further by using the :" +"func:`getattr` built-in to retrieve methods with a particular name::" +msgstr "" +"Для виклику методів об’єктів ви можете ще більше спростити, використовуючи " +"вбудований :func:`getattr` для отримання методів із певним іменем::" + +msgid "" +"class MyVisitor:\n" +" def visit_a(self):\n" +" ...\n" +"\n" +" def dispatch(self, value):\n" +" method_name = 'visit_' + str(value)\n" +" method = getattr(self, method_name)\n" +" method()" +msgstr "" + +msgid "" +"It's suggested that you use a prefix for the method names, such as " +"``visit_`` in this example. Without such a prefix, if values are coming " +"from an untrusted source, an attacker would be able to call any method on " +"your object." +msgstr "" +"Рекомендується використовувати префікс для імен методів, наприклад " +"``visit_`` у цьому прикладі. Без такого префікса, якщо значення надходять із " +"ненадійного джерела, зловмисник зможе викликати будь-який метод вашого " +"об’єкта." + +msgid "" +"Imitating switch with fallthrough, as with C's switch-case-default, is " +"possible, much harder, and less needed." +msgstr "" + +msgid "" +"Can't you emulate threads in the interpreter instead of relying on an OS-" +"specific thread implementation?" +msgstr "" +"Чи не можна емулювати потоки в інтерпретаторі замість того, щоб покладатися " +"на реалізацію потоку, специфічного для ОС?" + +msgid "" +"Answer 1: Unfortunately, the interpreter pushes at least one C stack frame " +"for each Python stack frame. Also, extensions can call back into Python at " +"almost random moments. Therefore, a complete threads implementation " +"requires thread support for C." +msgstr "" +"Відповідь 1: На жаль, інтерпретатор надсилає принаймні один кадр стека C для " +"кожного кадру стека Python. Крім того, розширення можуть повертатися до " +"Python у майже випадкові моменти. Таким чином, повна реалізація потоків " +"вимагає підтримки потоків для C." + +msgid "" +"Answer 2: Fortunately, there is `Stackless Python `_, which has a completely redesigned " +"interpreter loop that avoids the C stack." +msgstr "" +"Відповідь 2: На щастя, є `Stackless Python `_, який має повністю перероблений цикл інтерпретатора, який " +"уникає стека C." + +msgid "Why can't lambda expressions contain statements?" +msgstr "Чому лямбда-вирази не можуть містити оператори?" + +msgid "" +"Python lambda expressions cannot contain statements because Python's " +"syntactic framework can't handle statements nested inside expressions. " +"However, in Python, this is not a serious problem. Unlike lambda forms in " +"other languages, where they add functionality, Python lambdas are only a " +"shorthand notation if you're too lazy to define a function." +msgstr "" +"Лямбда-вирази Python не можуть містити оператори, оскільки синтаксична " +"структура Python не може обробляти оператори, вкладені у вирази. Однак у " +"Python це не є серйозною проблемою. На відміну від лямбда-форм в інших " +"мовах, де вони додають функціональність, лямбда-вирази Python є лише " +"скороченою нотацією, якщо вам ліньки визначати функцію." + +msgid "" +"Functions are already first class objects in Python, and can be declared in " +"a local scope. Therefore the only advantage of using a lambda instead of a " +"locally defined function is that you don't need to invent a name for the " +"function -- but that's just a local variable to which the function object " +"(which is exactly the same type of object that a lambda expression yields) " +"is assigned!" +msgstr "" + +msgid "Can Python be compiled to machine code, C or some other language?" +msgstr "Чи можна Python скомпілювати до машинного коду, мови C чи іншої?" + +msgid "" +"`Cython `_ compiles a modified version of Python with " +"optional annotations into C extensions. `Nuitka `_ is " +"an up-and-coming compiler of Python into C++ code, aiming to support the " +"full Python language." +msgstr "" + +msgid "How does Python manage memory?" +msgstr "Як Python керує пам'яттю?" + +msgid "" +"The details of Python memory management depend on the implementation. The " +"standard implementation of Python, :term:`CPython`, uses reference counting " +"to detect inaccessible objects, and another mechanism to collect reference " +"cycles, periodically executing a cycle detection algorithm which looks for " +"inaccessible cycles and deletes the objects involved. The :mod:`gc` module " +"provides functions to perform a garbage collection, obtain debugging " +"statistics, and tune the collector's parameters." +msgstr "" +"Деталі керування пам’яттю Python залежать від реалізації. Стандартна " +"реалізація Python, :term:`CPython`, використовує підрахунок посилань для " +"виявлення недоступних об’єктів та інший механізм для збору посилальних " +"циклів, періодично виконуючи алгоритм виявлення циклів, який шукає " +"недоступні цикли та видаляє залучені об’єкти. Модуль :mod:`gc` надає функції " +"для збирання сміття, отримання статистики налагодження та налаштування " +"параметрів збирача." + +msgid "" +"Other implementations (such as `Jython `_ or `PyPy " +"`_), however, can rely on a different mechanism such as a " +"full-blown garbage collector. This difference can cause some subtle porting " +"problems if your Python code depends on the behavior of the reference " +"counting implementation." +msgstr "" + +msgid "" +"In some Python implementations, the following code (which is fine in " +"CPython) will probably run out of file descriptors::" +msgstr "" +"У деяких реалізаціях Python наступний код (який добре процює у CPython), " +"ймовірно, не матиме файлових дескрипторів::" + +msgid "" +"for file in very_long_list_of_files:\n" +" f = open(file)\n" +" c = f.read(1)" +msgstr "" + +msgid "" +"Indeed, using CPython's reference counting and destructor scheme, each new " +"assignment to ``f`` closes the previous file. With a traditional GC, " +"however, those file objects will only get collected (and closed) at varying " +"and possibly long intervals." +msgstr "" + +msgid "" +"If you want to write code that will work with any Python implementation, you " +"should explicitly close the file or use the :keyword:`with` statement; this " +"will work regardless of memory management scheme::" +msgstr "" +"Якщо ви хочете написати код, який працюватиме з будь-якою реалізацією " +"Python, вам слід явно закрити файл або використати оператор :keyword:`with`; " +"це працюватиме незалежно від схеми керування пам'яттю:" + +msgid "" +"for file in very_long_list_of_files:\n" +" with open(file) as f:\n" +" c = f.read(1)" +msgstr "" + +msgid "Why doesn't CPython use a more traditional garbage collection scheme?" +msgstr "Чому CPython не використовує більш традиційну схему збирання сміття?" + +msgid "" +"For one thing, this is not a C standard feature and hence it's not portable. " +"(Yes, we know about the Boehm GC library. It has bits of assembler code for " +"*most* common platforms, not for all of them, and although it is mostly " +"transparent, it isn't completely transparent; patches are required to get " +"Python to work with it.)" +msgstr "" +"По-перше, це не є стандартною функцією C, а отже, вона не переносна. (Так, " +"ми знаємо про бібліотеку Boehm GC. Вона містить фрагменти коду асемблера для " +"*найбільш* поширених платформ, не для всіх, і хоча вона здебільшого прозора, " +"але всеж таки не зовсім прозора; для Python потрібні патчи щоб працювати з " +"нею.)" + +msgid "" +"Traditional GC also becomes a problem when Python is embedded into other " +"applications. While in a standalone Python it's fine to replace the " +"standard ``malloc()`` and ``free()`` with versions provided by the GC " +"library, an application embedding Python may want to have its *own* " +"substitute for ``malloc()`` and ``free()``, and may not want Python's. " +"Right now, CPython works with anything that implements ``malloc()`` and " +"``free()`` properly." +msgstr "" + +msgid "Why isn't all memory freed when CPython exits?" +msgstr "Чому не вся пам'ять звільняється, коли CPython завершує роботу?" + +msgid "" +"Objects referenced from the global namespaces of Python modules are not " +"always deallocated when Python exits. This may happen if there are circular " +"references. There are also certain bits of memory that are allocated by the " +"C library that are impossible to free (e.g. a tool like Purify will complain " +"about these). Python is, however, aggressive about cleaning up memory on " +"exit and does try to destroy every single object." +msgstr "" +"Об’єкти, на які посилаються глобальні простори імен модулів Python, не " +"завжди звільняються, коли Python завершує роботу. Це може статися, якщо є " +"циклічні посилання. Є також певні частини пам’яті, виділені бібліотекою C, " +"які неможливо звільнити (наприклад, такий інструмент, як Purify, буде " +"скаржитися на це). Однак Python агресивно очищає пам’ять під час виходу та " +"намагається знищити кожен окремий об’єкт." + +msgid "" +"If you want to force Python to delete certain things on deallocation use " +"the :mod:`atexit` module to run a function that will force those deletions." +msgstr "" +"Якщо ви хочете змусити Python видалити певні речі під час звільнення, " +"скористайтеся модулем :mod:`atexit`, щоб запустити функцію, яка примусово " +"прискорить ці видалення." + +msgid "Why are there separate tuple and list data types?" +msgstr "Чому існують окремі типи даних кортежу та списку?" + +msgid "" +"Lists and tuples, while similar in many respects, are generally used in " +"fundamentally different ways. Tuples can be thought of as being similar to " +"Pascal ``records`` or C ``structs``; they're small collections of related " +"data which may be of different types which are operated on as a group. For " +"example, a Cartesian coordinate is appropriately represented as a tuple of " +"two or three numbers." +msgstr "" + +msgid "" +"Lists, on the other hand, are more like arrays in other languages. They " +"tend to hold a varying number of objects all of which have the same type and " +"which are operated on one-by-one. For example, :func:`os.listdir('.') ` returns a list of strings representing the files in the current " +"directory. Functions which operate on this output would generally not break " +"if you added another file or two to the directory." +msgstr "" + +msgid "" +"Tuples are immutable, meaning that once a tuple has been created, you can't " +"replace any of its elements with a new value. Lists are mutable, meaning " +"that you can always change a list's elements. Only immutable elements can " +"be used as dictionary keys, and hence only tuples and not lists can be used " +"as keys." +msgstr "" +"Кортежі є незмінними, тобто після створення кортежу ви не можете замінити " +"жоден із його елементів новим значенням. Списки є змінними, тобто ви завжди " +"можете змінити елементи списку. Тільки незмінні елементи можна " +"використовувати як ключі словника, а отже, лише кортежі можна " +"використовувати як ключі, а списки не можна." + +msgid "How are lists implemented in CPython?" +msgstr "Як списки реалізовані в CPython?" + +msgid "" +"CPython's lists are really variable-length arrays, not Lisp-style linked " +"lists. The implementation uses a contiguous array of references to other " +"objects, and keeps a pointer to this array and the array's length in a list " +"head structure." +msgstr "" +"Списки CPython насправді є масивами змінної довжини, а не пов’язаними " +"списками як у стилі Lisp. Реалізація використовує безперервний масив " +"посилань на інші об’єкти та зберігає вказівник на цей масив і довжину масиву " +"в структурі заголовка списку." + +msgid "" +"This makes indexing a list ``a[i]`` an operation whose cost is independent " +"of the size of the list or the value of the index." +msgstr "" +"Це робить індексацію списку ``a[i]`` операцією, вартість якої не залежить " +"від розміру списку або значення індексу." + +msgid "" +"When items are appended or inserted, the array of references is resized. " +"Some cleverness is applied to improve the performance of appending items " +"repeatedly; when the array must be grown, some extra space is allocated so " +"the next few times don't require an actual resize." +msgstr "" +"Коли елементи додаються або вставляються, розмір масиву посилань змінюється. " +"Деяка кмітливість застосована для покращення продуктивності багаторазового " +"додавання елементів; коли масив потрібно збільшити, виділяється додатковий " +"простір, тому наступні кілька разів не вимагають фактичної зміни розміру." + +msgid "How are dictionaries implemented in CPython?" +msgstr "Як реалізовані словники в CPython?" + +msgid "" +"CPython's dictionaries are implemented as resizable hash tables. Compared " +"to B-trees, this gives better performance for lookup (the most common " +"operation by far) under most circumstances, and the implementation is " +"simpler." +msgstr "" +"Словники CPython реалізовані як хеш-таблиці зі змінним розміром. Порівняно з " +"B-деревами, це дає кращу продуктивність для пошуку (найпоширеніша операція " +"на сьогоднішній день) у більшості випадків, а реалізація є простішою." + +msgid "" +"Dictionaries work by computing a hash code for each key stored in the " +"dictionary using the :func:`hash` built-in function. The hash code varies " +"widely depending on the key and a per-process seed; for example, " +"``'Python'`` could hash to ``-539294296`` while ``'python'``, a string that " +"differs by a single bit, could hash to ``1142331976``. The hash code is " +"then used to calculate a location in an internal array where the value will " +"be stored. Assuming that you're storing keys that all have different hash " +"values, this means that dictionaries take constant time -- *O*\\ (1), in Big-" +"O notation -- to retrieve a key." +msgstr "" + +msgid "Why must dictionary keys be immutable?" +msgstr "Чому ключі словника повинні бути незмінними?" + +msgid "" +"The hash table implementation of dictionaries uses a hash value calculated " +"from the key value to find the key. If the key were a mutable object, its " +"value could change, and thus its hash could also change. But since whoever " +"changes the key object can't tell that it was being used as a dictionary " +"key, it can't move the entry around in the dictionary. Then, when you try " +"to look up the same object in the dictionary it won't be found because its " +"hash value is different. If you tried to look up the old value it wouldn't " +"be found either, because the value of the object found in that hash bin " +"would be different." +msgstr "" +"Реалізація хеш-таблиці словників використовує хеш-значення, обчислене зі " +"значення ключа, щоб знайти ключ. Якби ключ був змінним об’єктом, його " +"значення могло б змінитися, а отже, і його хеш також міг би змінитися. Але " +"оскільки той, хто змінює об’єкт ключа, не може сказати, що він " +"використовувався як ключ словника, він не може переміщувати запис у " +"словнику. Тоді, коли ви спробуєте знайти той самий об’єкт у словнику, він не " +"буде знайдений, оскільки його хеш-значення інше. Якщо ви спробуєте знайти " +"старе значення, його також не буде знайдено, оскільки значення об’єкта, " +"знайденого в цьому хеш-біні, буде іншим." + +msgid "" +"If you want a dictionary indexed with a list, simply convert the list to a " +"tuple first; the function ``tuple(L)`` creates a tuple with the same entries " +"as the list ``L``. Tuples are immutable and can therefore be used as " +"dictionary keys." +msgstr "" +"Якщо ви хочете, щоб словник був індексований списком, просто спочатку " +"перетворіть список на кортеж; функція ``tuple(L)`` створює кортеж з тими " +"самими записами, що і список ``L``. Кортежі є незмінними, тому їх можна " +"використовувати як ключі словника." + +msgid "Some unacceptable solutions that have been proposed:" +msgstr "Деякі неприйнятні рішення, які були запропоновані:" + +msgid "" +"Hash lists by their address (object ID). This doesn't work because if you " +"construct a new list with the same value it won't be found; e.g.::" +msgstr "" +"Хешувати списки за їхньою адресою (ID об'єкта). Це не працює, тому що якщо " +"ви створите новий список із тим самим значенням, його не буде знайдено; " +"наприклад::" + +msgid "" +"mydict = {[1, 2]: '12'}\n" +"print(mydict[[1, 2]])" +msgstr "" + +msgid "" +"would raise a :exc:`KeyError` exception because the id of the ``[1, 2]`` " +"used in the second line differs from that in the first line. In other " +"words, dictionary keys should be compared using ``==``, not using :keyword:" +"`is`." +msgstr "" +"викличе виняток :exc:`KeyError`, оскільки ідентифікатор ``[1, 2]``, який " +"використовується у другому рядку, відрізняється від ідентифікатора в першому " +"рядку. Іншими словами, ключі словника слід порівнювати за допомогою ``==``, " +"а не за допомогою :keyword:`is`." + +msgid "" +"Make a copy when using a list as a key. This doesn't work because the list, " +"being a mutable object, could contain a reference to itself, and then the " +"copying code would run into an infinite loop." +msgstr "" +"Зробити копію, якщо використовуєте список як ключ. Це не працює, тому що " +"список, будучи змінним об’єктом, може містити посилання на себе, і тоді код " +"копіювання запускатиметься в нескінченний цикл." + +msgid "" +"Allow lists as keys but tell the user not to modify them. This would allow " +"a class of hard-to-track bugs in programs when you forgot or modified a list " +"by accident. It also invalidates an important invariant of dictionaries: " +"every value in ``d.keys()`` is usable as a key of the dictionary." +msgstr "" +"Дозволити списки як ключі, але сказати користувачеві не змінювати їх. Це " +"дозволило б створити клас помилок, які важко відстежити в програмах, коли ви " +"випадково забули або змінили список. Це також робить недійсним важливий " +"інваріант словників: кожне значення в ``d.keys()`` можна використовувати як " +"ключ словника." + +msgid "" +"Mark lists as read-only once they are used as a dictionary key. The problem " +"is that it's not just the top-level object that could change its value; you " +"could use a tuple containing a list as a key. Entering anything as a key " +"into a dictionary would require marking all objects reachable from there as " +"read-only -- and again, self-referential objects could cause an infinite " +"loop." +msgstr "" +"Позначайте списки як доступні лише для читання, коли вони використовуються " +"як ключ словника. Проблема полягає в тому, що не лише об’єкт верхнього рівня " +"може змінити своє значення; ви можете використовувати кортеж, що містить " +"список, як ключ. Введення будь-чого як ключа до словника вимагало б " +"позначити всі доступні звідти об’єкти як доступні лише для читання – і знову " +"ж таки самопосилання на об’єкти могло б спричинити нескінченний цикл." + +msgid "" +"There is a trick to get around this if you need to, but use it at your own " +"risk: You can wrap a mutable structure inside a class instance which has " +"both a :meth:`~object.__eq__` and a :meth:`~object.__hash__` method. You " +"must then make sure that the hash value for all such wrapper objects that " +"reside in a dictionary (or other hash based structure), remain fixed while " +"the object is in the dictionary (or other structure). ::" +msgstr "" + +msgid "" +"class ListWrapper:\n" +" def __init__(self, the_list):\n" +" self.the_list = the_list\n" +"\n" +" def __eq__(self, other):\n" +" return self.the_list == other.the_list\n" +"\n" +" def __hash__(self):\n" +" l = self.the_list\n" +" result = 98767 - len(l)*555\n" +" for i, el in enumerate(l):\n" +" try:\n" +" result = result + (hash(el) % 9999999) * 1001 + i\n" +" except Exception:\n" +" result = (result % 7777777) + i * 333\n" +" return result" +msgstr "" + +msgid "" +"Note that the hash computation is complicated by the possibility that some " +"members of the list may be unhashable and also by the possibility of " +"arithmetic overflow." +msgstr "" +"Зверніть увагу, що обчислення хешу ускладнюється можливістю того, що деякі " +"члени списку можуть бути нехешованими, а також можливістю арифметичного " +"переповнення." + +msgid "" +"Furthermore it must always be the case that if ``o1 == o2`` (ie ``o1." +"__eq__(o2) is True``) then ``hash(o1) == hash(o2)`` (ie, ``o1.__hash__() == " +"o2.__hash__()``), regardless of whether the object is in a dictionary or " +"not. If you fail to meet these restrictions dictionaries and other hash " +"based structures will misbehave." +msgstr "" +"Крім того, завжди має бути так, що якщо ``o1 == o2`` (тобто ``o1.__eq__(o2) " +"має значення True``), тоді ``hash(o1) == hash(o2)`` (тобто, ``o1.__hash__() " +"== o2.__hash__()``), незалежно від того, чи є об’єкт у словнику чи ні. Якщо " +"ви не впораєтеся з цими обмеженнями, словники та інші хеш-структури " +"працюватимуть неправильно." + +msgid "" +"In the case of :class:`!ListWrapper`, whenever the wrapper object is in a " +"dictionary the wrapped list must not change to avoid anomalies. Don't do " +"this unless you are prepared to think hard about the requirements and the " +"consequences of not meeting them correctly. Consider yourself warned." +msgstr "" + +msgid "Why doesn't list.sort() return the sorted list?" +msgstr "Чому list.sort() не повертає відсортований список?" + +msgid "" +"In situations where performance matters, making a copy of the list just to " +"sort it would be wasteful. Therefore, :meth:`list.sort` sorts the list in " +"place. In order to remind you of that fact, it does not return the sorted " +"list. This way, you won't be fooled into accidentally overwriting a list " +"when you need a sorted copy but also need to keep the unsorted version " +"around." +msgstr "" +"У ситуаціях, коли продуктивність має значення, створення копії списку лише " +"для його сортування було б марним. Тому :meth:`list.sort` сортує список за " +"місцем. Щоб нагадати вам про цей факт, він не повертає відсортований список. " +"Таким чином, вас не введуть в оману випадковим перезаписом списку, коли вам " +"потрібна відсортована копія, але також потрібно зберегти невідсортовану " +"версію." + +msgid "" +"If you want to return a new list, use the built-in :func:`sorted` function " +"instead. This function creates a new list from a provided iterable, sorts " +"it and returns it. For example, here's how to iterate over the keys of a " +"dictionary in sorted order::" +msgstr "" +"Якщо ви хочете повернути новий список, скористайтеся вбудованою функцією :" +"func:`sorted`. Ця функція створює новий список із наданого ітератора, сортує " +"його та повертає. Наприклад, ось як виконати ітерацію по ключах словника у " +"відсортованому порядку:" + +msgid "" +"for key in sorted(mydict):\n" +" ... # do whatever with mydict[key]..." +msgstr "" + +msgid "How do you specify and enforce an interface spec in Python?" +msgstr "Як визначити та застосувати специфікацію інтерфейсу в Python?" + +msgid "" +"An interface specification for a module as provided by languages such as C++ " +"and Java describes the prototypes for the methods and functions of the " +"module. Many feel that compile-time enforcement of interface specifications " +"helps in the construction of large programs." +msgstr "" +"Специфікація інтерфейсу для модуля, яка надається такими мовами, як C++ і " +"Java, описує прототипи методів і функцій модуля. Багато хто вважає, що " +"примусове виконання специфікацій інтерфейсу під час компіляції допомагає " +"створювати великі програми." + +msgid "" +"Python 2.6 adds an :mod:`abc` module that lets you define Abstract Base " +"Classes (ABCs). You can then use :func:`isinstance` and :func:`issubclass` " +"to check whether an instance or a class implements a particular ABC. The :" +"mod:`collections.abc` module defines a set of useful ABCs such as :class:" +"`~collections.abc.Iterable`, :class:`~collections.abc.Container`, and :class:" +"`~collections.abc.MutableMapping`." +msgstr "" +"Python 2.6 додає модуль :mod:`abc`, який дозволяє визначати абстрактні " +"базові класи (ABC - Abstract Base Classes ). Потім ви можете " +"використовувати :func:`isinstance` і :func:`issubclass`, щоб перевірити, чи " +"екземпляр або клас певного ABC їх реалізує. Модуль :mod:`collections.abc` " +"визначає набір корисних ABC, таких як :class:`~collections.abc.Iterable`, :" +"class:`~collections.abc.Container` і :class:`~collections. abc." +"MutableMapping`." + +msgid "" +"For Python, many of the advantages of interface specifications can be " +"obtained by an appropriate test discipline for components." +msgstr "" +"Для Python багато переваг специфікацій інтерфейсу можна отримати за " +"допомогою відповідного порядку тестування компонентів." + +msgid "" +"A good test suite for a module can both provide a regression test and serve " +"as a module interface specification and a set of examples. Many Python " +"modules can be run as a script to provide a simple \"self test.\" Even " +"modules which use complex external interfaces can often be tested in " +"isolation using trivial \"stub\" emulations of the external interface. The :" +"mod:`doctest` and :mod:`unittest` modules or third-party test frameworks can " +"be used to construct exhaustive test suites that exercise every line of code " +"in a module." +msgstr "" +"Хороший набір тестів для модуля може як забезпечити регресійний тест, так і " +"служити специфікацією інтерфейсу модуля та набором прикладів. Багато модулів " +"Python можна запускати як сценарій для забезпечення простого " +"\"самотестування\". Навіть модулі, які використовують складні зовнішні " +"інтерфейси, часто можуть бути протестовані ізольовано за допомогою " +"тривіальних \"заглушок\" емуляції зовнішнього інтерфейсу. Модулі :mod:" +"`doctest` і :mod:`unittest` або сторонні фреймворки тестування можна " +"використовувати для створення вичерпних наборів тестів, які перевіряють " +"кожен рядок коду в модулі." + +msgid "" +"An appropriate testing discipline can help build large complex applications " +"in Python as well as having interface specifications would. In fact, it can " +"be better because an interface specification cannot test certain properties " +"of a program. For example, the :meth:`!list.append` method is expected to " +"add new elements to the end of some internal list; an interface " +"specification cannot test that your :meth:`!list.append` implementation will " +"actually do this correctly, but it's trivial to check this property in a " +"test suite." +msgstr "" + +msgid "" +"Writing test suites is very helpful, and you might want to design your code " +"to make it easily tested. One increasingly popular technique, test-driven " +"development, calls for writing parts of the test suite first, before you " +"write any of the actual code. Of course Python allows you to be sloppy and " +"not write test cases at all." +msgstr "" +"Написання наборів тестів дуже корисно, і ви можете розробити свій код, щоб " +"його було легко перевірити. Одна з технік, що стає все більш популярною, — " +"розробка на основі тестування (TDD - test-driven development)— вимагає " +"спочатку написати частини набору тестів, перш ніж писати будь-який фактичний " +"код. Звичайно, Python дозволяє вам бути неохайними і взагалі не писати тести." + +msgid "Why is there no goto?" +msgstr "Чому немає goto?" + +msgid "" +"In the 1970s people realized that unrestricted goto could lead to messy " +"\"spaghetti\" code that was hard to understand and revise. In a high-level " +"language, it is also unneeded as long as there are ways to branch (in " +"Python, with :keyword:`if` statements and :keyword:`or`, :keyword:`and`, " +"and :keyword:`if`/:keyword:`else` expressions) and loop (with :keyword:" +"`while` and :keyword:`for` statements, possibly containing :keyword:" +"`continue` and :keyword:`break`)." +msgstr "" + +msgid "" +"One can also use exceptions to provide a \"structured goto\" that works even " +"across function calls. Many feel that exceptions can conveniently emulate " +"all reasonable uses of the ``go`` or ``goto`` constructs of C, Fortran, and " +"other languages. For example::" +msgstr "" + +msgid "" +"class label(Exception): pass # declare a label\n" +"\n" +"try:\n" +" ...\n" +" if condition: raise label() # goto label\n" +" ...\n" +"except label: # where to goto\n" +" pass\n" +"..." +msgstr "" + +msgid "" +"This doesn't allow you to jump into the middle of a loop, but that's usually " +"considered an abuse of ``goto`` anyway. Use sparingly." +msgstr "" + +msgid "Why can't raw strings (r-strings) end with a backslash?" +msgstr "" +"Чому необроблені рядки (r-рядки) не можуть закінчуватися зворотною косою " +"рискою?" + +msgid "" +"More precisely, they can't end with an odd number of backslashes: the " +"unpaired backslash at the end escapes the closing quote character, leaving " +"an unterminated string." +msgstr "" +"Точніше, вони не можуть закінчуватися непарною кількістю зворотних скісних " +"рисок: непарна зворотна коса риска в кінці виходить із символу закриваючої " +"лапки, залишаючи незакінчений рядок." + +msgid "" +"Raw strings were designed to ease creating input for processors (chiefly " +"regular expression engines) that want to do their own backslash escape " +"processing. Such processors consider an unmatched trailing backslash to be " +"an error anyway, so raw strings disallow that. In return, they allow you to " +"pass on the string quote character by escaping it with a backslash. These " +"rules work well when r-strings are used for their intended purpose." +msgstr "" +"Необроблені рядки були розроблені, щоб полегшити створення вхідних даних для " +"процесорів (головним чином механізмів регулярних виразів), які хочуть " +"виконувати власну обробку зворотного слеша. Такі процесори в будь-якому " +"випадку вважають невідповідну зворотну косу риску в кінці помилкою, тому " +"необроблені рядки це забороняють. Натомість вони дозволяють вам передати " +"символ лапки рядка, екрануючи його зворотною косою рискою. Ці правила добре " +"працюють, коли r-рядки використовуються за призначенням." + +msgid "" +"If you're trying to build Windows pathnames, note that all Windows system " +"calls accept forward slashes too::" +msgstr "" +"Якщо ви намагаєтеся створити імена шляхів Windows, зверніть увагу, що всі " +"системні виклики Windows також приймають косу риску::" + +msgid "f = open(\"/mydir/file.txt\") # works fine!" +msgstr "" + +msgid "" +"If you're trying to build a pathname for a DOS command, try e.g. one of ::" +msgstr "" +"Якщо ви намагаєтеся створити шлях для команди DOS, спробуйте, наприклад. " +"один з ::" + +msgid "" +"dir = r\"\\this\\is\\my\\dos\\dir\" \"\\\\\"\n" +"dir = r\"\\this\\is\\my\\dos\\dir\\ \"[:-1]\n" +"dir = \"\\\\this\\\\is\\\\my\\\\dos\\\\dir\\\\\"" +msgstr "" + +msgid "Why doesn't Python have a \"with\" statement for attribute assignments?" +msgstr "Чому в Python немає оператора \"with\" для призначення атрибутів?" + +msgid "" +"Python has a :keyword:`with` statement that wraps the execution of a block, " +"calling code on the entrance and exit from the block. Some languages have a " +"construct that looks like this::" +msgstr "" + +msgid "" +"with obj:\n" +" a = 1 # equivalent to obj.a = 1\n" +" total = total + 1 # obj.total = obj.total + 1" +msgstr "" + +msgid "In Python, such a construct would be ambiguous." +msgstr "У Python така конструкція була б неоднозначною." + +msgid "" +"Other languages, such as Object Pascal, Delphi, and C++, use static types, " +"so it's possible to know, in an unambiguous way, what member is being " +"assigned to. This is the main point of static typing -- the compiler " +"*always* knows the scope of every variable at compile time." +msgstr "" +"Інші мови, такі як Object Pascal, Delphi та C++, використовують статичні " +"типи, тому можна однозначно знати, якому члену призначено. Це головний " +"момент статичної типізації -- компілятор *завжди* знає область кожної " +"змінної під час компіляції." + +msgid "" +"Python uses dynamic types. It is impossible to know in advance which " +"attribute will be referenced at runtime. Member attributes may be added or " +"removed from objects on the fly. This makes it impossible to know, from a " +"simple reading, what attribute is being referenced: a local one, a global " +"one, or a member attribute?" +msgstr "" +"Python використовує динамічні типи. Неможливо знати заздалегідь, на який " +"атрибут буде посилатися під час виконання. Атрибути учасників можна додавати " +"або видаляти з об’єктів на льоту. Це робить неможливим з простого читання " +"дізнатися, на який атрибут посилається: локальний, глобальний чи атрибут-" +"член?" + +msgid "For instance, take the following incomplete snippet::" +msgstr "Наприклад, візьмемо наступний неповний фрагмент:" + +msgid "" +"def foo(a):\n" +" with a:\n" +" print(x)" +msgstr "" + +msgid "" +"The snippet assumes that ``a`` must have a member attribute called ``x``. " +"However, there is nothing in Python that tells the interpreter this. What " +"should happen if ``a`` is, let us say, an integer? If there is a global " +"variable named ``x``, will it be used inside the :keyword:`with` block? As " +"you see, the dynamic nature of Python makes such choices much harder." +msgstr "" + +msgid "" +"The primary benefit of :keyword:`with` and similar language features " +"(reduction of code volume) can, however, easily be achieved in Python by " +"assignment. Instead of::" +msgstr "" + +msgid "" +"function(args).mydict[index][index].a = 21\n" +"function(args).mydict[index][index].b = 42\n" +"function(args).mydict[index][index].c = 63" +msgstr "" + +msgid "write this::" +msgstr "напиши це::" + +msgid "" +"ref = function(args).mydict[index][index]\n" +"ref.a = 21\n" +"ref.b = 42\n" +"ref.c = 63" +msgstr "" + +msgid "" +"This also has the side-effect of increasing execution speed because name " +"bindings are resolved at run-time in Python, and the second version only " +"needs to perform the resolution once." +msgstr "" +"Це також має побічний ефект збільшення швидкості виконання, оскільки " +"прив’язки імен вирішуються під час виконання в Python, а другій версії " +"потрібно виконати розв’язання лише один раз." + +msgid "" +"Similar proposals that would introduce syntax to further reduce code volume, " +"such as using a 'leading dot', have been rejected in favour of explicitness " +"(see https://mail.python.org/pipermail/python-ideas/2016-May/040070.html)." +msgstr "" + +msgid "Why don't generators support the with statement?" +msgstr "Чому генератори не підтримують оператор with?" + +msgid "" +"For technical reasons, a generator used directly as a context manager would " +"not work correctly. When, as is most common, a generator is used as an " +"iterator run to completion, no closing is needed. When it is, wrap it as :" +"func:`contextlib.closing(generator) ` in the :keyword:" +"`with` statement." +msgstr "" + +msgid "Why are colons required for the if/while/def/class statements?" +msgstr "Чому в операторах if/while/def/class потрібні двокрапки?" + +msgid "" +"The colon is required primarily to enhance readability (one of the results " +"of the experimental ABC language). Consider this::" +msgstr "" +"Двокрапка потрібна насамперед для покращення читабельності (один із " +"результатів експериментальної мови ABC). Розглянемо це::" + +msgid "" +"if a == b\n" +" print(a)" +msgstr "" + +msgid "versus ::" +msgstr "проти ::" + +msgid "" +"if a == b:\n" +" print(a)" +msgstr "" + +msgid "" +"Notice how the second one is slightly easier to read. Notice further how a " +"colon sets off the example in this FAQ answer; it's a standard usage in " +"English." +msgstr "" +"Зверніть увагу, що другий читається трохи легше. Зверніть увагу на те, як " +"двокрапка виділяє приклад у цій відповіді на поширені запитання; це " +"стандартне використання в англійській мові." + +msgid "" +"Another minor reason is that the colon makes it easier for editors with " +"syntax highlighting; they can look for colons to decide when indentation " +"needs to be increased instead of having to do a more elaborate parsing of " +"the program text." +msgstr "" +"Інша незначна причина полягає в тому, що двокрапка полегшує роботу " +"редакторів із підсвічуванням синтаксису; вони можуть шукати двокрапки, щоб " +"вирішити, коли потрібно збільшити відступ, замість того, щоб виконувати " +"більш детальний розбір тексту програми." + +msgid "Why does Python allow commas at the end of lists and tuples?" +msgstr "Чому Python допускає коми в кінці списків і кортежів?" + +msgid "" +"Python lets you add a trailing comma at the end of lists, tuples, and " +"dictionaries::" +msgstr "" +"Python дозволяє додавати кінцеву кому в кінці списків, кортежів і словників:" + +msgid "" +"[1, 2, 3,]\n" +"('a', 'b', 'c',)\n" +"d = {\n" +" \"A\": [1, 5],\n" +" \"B\": [6, 7], # last trailing comma is optional but good style\n" +"}" +msgstr "" + +msgid "There are several reasons to allow this." +msgstr "Є кілька причин дозволити це." + +msgid "" +"When you have a literal value for a list, tuple, or dictionary spread across " +"multiple lines, it's easier to add more elements because you don't have to " +"remember to add a comma to the previous line. The lines can also be " +"reordered without creating a syntax error." +msgstr "" +"Коли у вас є літеральне значення для списку, кортежу чи словника, " +"розкиданого на кілька рядків, легше додати більше елементів, оскільки вам не " +"потрібно пам’ятати про додавання коми в попередній рядок. Рядки також можна " +"змінити, не створюючи синтаксичних помилок." + +msgid "" +"Accidentally omitting the comma can lead to errors that are hard to " +"diagnose. For example::" +msgstr "" +"Випадковий пропуск коми може призвести до помилок, які важко діагностувати. " +"Наприклад::" + +msgid "" +"x = [\n" +" \"fee\",\n" +" \"fie\"\n" +" \"foo\",\n" +" \"fum\"\n" +"]" +msgstr "" + +msgid "" +"This list looks like it has four elements, but it actually contains three: " +"\"fee\", \"fiefoo\" and \"fum\". Always adding the comma avoids this source " +"of error." +msgstr "" +"Цей список виглядає так, ніби він складається з чотирьох елементів, але " +"насправді він містить три: \"fee\", \"fiefoo\" і \"fum\". Постійне додавання " +"коми дозволяє уникнути цього джерела помилки." + +msgid "" +"Allowing the trailing comma may also make programmatic code generation " +"easier." +msgstr "Дозвіл кінцевої коми також може полегшити генерацію програмного коду." diff --git a/faq/extending.po b/faq/extending.po new file mode 100644 index 000000000..9d782a9a0 --- /dev/null +++ b/faq/extending.po @@ -0,0 +1,472 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# Vadim Kashirny, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:52+0000\n" +"Last-Translator: Vadim Kashirny, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Extending/Embedding FAQ" +msgstr "Поширені запитання про розширення/вбудовування" + +msgid "Contents" +msgstr "Зміст" + +msgid "Can I create my own functions in C?" +msgstr "Чи можу я створювати власні функції на C?" + +msgid "" +"Yes, you can create built-in modules containing functions, variables, " +"exceptions and even new types in C. This is explained in the document :ref:" +"`extending-index`." +msgstr "" +"Так, у C можна створювати вбудовані модулі, що містять функції, змінні, " +"винятки та навіть нові типи. Це пояснюється в документі :ref:`extending-" +"index`." + +msgid "Most intermediate or advanced Python books will also cover this topic." +msgstr "" +"Більшість книжок про Python середнього та просунутого рівня також охоплюють " +"цю тему." + +msgid "Can I create my own functions in C++?" +msgstr "Чи можу я створювати власні функції на C++?" + +msgid "" +"Yes, using the C compatibility features found in C++. Place ``extern \"C\" " +"{ ... }`` around the Python include files and put ``extern \"C\"`` before " +"each function that is going to be called by the Python interpreter. Global " +"or static C++ objects with constructors are probably not a good idea." +msgstr "" +"Так, використовуючи функції сумісності з C, наявні в C++. Розмістіть " +"``extern \"C\" { ... }`` навколо файлів включення Python і поставте ``extern " +"\"C\"`` перед кожною функцією, яку буде викликати інтерпретатор Python. " +"Глобальні чи статичні об’єкти C++ із конструкторами, мабуть, не є гарною " +"ідеєю." + +msgid "Writing C is hard; are there any alternatives?" +msgstr "Писати С важко; є якісь альтернативи?" + +msgid "" +"There are a number of alternatives to writing your own C extensions, " +"depending on what you're trying to do." +msgstr "" +"Існує кілька альтернатив написанню власних розширень C, залежно від того, що " +"ви намагаєтеся зробити." + +msgid "" +"`Cython `_ and its relative `Pyrex `_ are compilers that accept a " +"slightly modified form of Python and generate the corresponding C code. " +"Cython and Pyrex make it possible to write an extension without having to " +"learn Python's C API." +msgstr "" + +msgid "" +"If you need to interface to some C or C++ library for which no Python " +"extension currently exists, you can try wrapping the library's data types " +"and functions with a tool such as `SWIG `_. `SIP " +"`__, `CXX `_ `Boost `_, or `Weave " +"`_ are also alternatives for wrapping C++ " +"libraries." +msgstr "" + +msgid "How can I execute arbitrary Python statements from C?" +msgstr "Як я можу виконати довільні оператори Python із C?" + +msgid "" +"The highest-level function to do this is :c:func:`PyRun_SimpleString` which " +"takes a single string argument to be executed in the context of the module " +"``__main__`` and returns ``0`` for success and ``-1`` when an exception " +"occurred (including :exc:`SyntaxError`). If you want more control, use :c:" +"func:`PyRun_String`; see the source for :c:func:`PyRun_SimpleString` in " +"``Python/pythonrun.c``." +msgstr "" +"Функція найвищого рівня для цього — :c:func:`PyRun_SimpleString`, яка " +"приймає один рядковий аргумент для виконання в контексті модуля ``__main__`` " +"і повертає ``0`` для успіху та ``- 1``, коли стався виняток (включаючи :exc:" +"`SyntaxError`). Якщо вам потрібен більше контролю, використовуйте :c:func:" +"`PyRun_String`; див. джерело для :c:func:`PyRun_SimpleString` у ``Python/" +"pythonrun.c``." + +msgid "How can I evaluate an arbitrary Python expression from C?" +msgstr "Як я можу обчислити довільний вираз Python із C?" + +msgid "" +"Call the function :c:func:`PyRun_String` from the previous question with the " +"start symbol :c:data:`Py_eval_input`; it parses an expression, evaluates it " +"and returns its value." +msgstr "" +"Викличте функцію :c:func:`PyRun_String` з попереднього запитання з символом " +"початку :c:data:`Py_eval_input`; він аналізує вираз, обчислює його та " +"повертає його значення." + +msgid "How do I extract C values from a Python object?" +msgstr "Як отримати значення C з об’єкта Python?" + +msgid "" +"That depends on the object's type. If it's a tuple, :c:func:`PyTuple_Size` " +"returns its length and :c:func:`PyTuple_GetItem` returns the item at a " +"specified index. Lists have similar functions, :c:func:`PyList_Size` and :c:" +"func:`PyList_GetItem`." +msgstr "" + +msgid "" +"For bytes, :c:func:`PyBytes_Size` returns its length and :c:func:" +"`PyBytes_AsStringAndSize` provides a pointer to its value and its length. " +"Note that Python bytes objects may contain null bytes so C's :c:func:`!" +"strlen` should not be used." +msgstr "" + +msgid "" +"To test the type of an object, first make sure it isn't ``NULL``, and then " +"use :c:func:`PyBytes_Check`, :c:func:`PyTuple_Check`, :c:func:" +"`PyList_Check`, etc." +msgstr "" +"Щоб перевірити тип об’єкта, спочатку переконайтеся, що він не ``NULL``, а " +"потім скористайтеся :c:func:`PyBytes_Check`, :c:func:`PyTuple_Check`, :c:" +"func:`PyList_Check` і т.д." + +msgid "" +"There is also a high-level API to Python objects which is provided by the so-" +"called 'abstract' interface -- read ``Include/abstract.h`` for further " +"details. It allows interfacing with any kind of Python sequence using calls " +"like :c:func:`PySequence_Length`, :c:func:`PySequence_GetItem`, etc. as well " +"as many other useful protocols such as numbers (:c:func:`PyNumber_Index` et " +"al.) and mappings in the PyMapping APIs." +msgstr "" +"Існує також високорівневий API для об’єктів Python, який надається так " +"званим \"абстрактним\" інтерфейсом — читайте ``Include/abstract.h`` для " +"отримання додаткової інформації. Він дозволяє взаємодіяти з будь-якою " +"послідовністю Python за допомогою таких викликів, як :c:func:" +"`PySequence_Length`, :c:func:`PySequence_GetItem` тощо, а також багатьох " +"інших корисних протоколів, таких як числа (:c:func:`PyNumber_Index` та ін.) " +"і відображення в API PyMapping." + +msgid "How do I use Py_BuildValue() to create a tuple of arbitrary length?" +msgstr "" +"Як я можу використовувати Py_BuildValue() для створення кортежу довільної " +"довжини?" + +msgid "You can't. Use :c:func:`PyTuple_Pack` instead." +msgstr "" +"Ви не можете це робити. Натомість використовуйте :c:func:`PyTuple_Pack`." + +msgid "How do I call an object's method from C?" +msgstr "Як викликати метод об’єкта з C?" + +msgid "" +"The :c:func:`PyObject_CallMethod` function can be used to call an arbitrary " +"method of an object. The parameters are the object, the name of the method " +"to call, a format string like that used with :c:func:`Py_BuildValue`, and " +"the argument values::" +msgstr "" +"Функцію :c:func:`PyObject_CallMethod` можна використовувати для виклику " +"довільного методу об’єкта. Параметрами є об’єкт, ім’я методу для виклику, " +"рядок формату, який використовується з :c:func:`Py_BuildValue`, і значення " +"аргументів::" + +msgid "" +"PyObject *\n" +"PyObject_CallMethod(PyObject *object, const char *method_name,\n" +" const char *arg_format, ...);" +msgstr "" + +msgid "" +"This works for any object that has methods -- whether built-in or user-" +"defined. You are responsible for eventually :c:func:`Py_DECREF`\\ 'ing the " +"return value." +msgstr "" +"Це працює для будь-якого об’єкта, який має методи – вбудовані чи визначені " +"користувачем. Ви несете відповідальність за остаточне :c:func:`Py_DECREF`\\ " +"'виведення значення, що повертається." + +msgid "" +"To call, e.g., a file object's \"seek\" method with arguments 10, 0 " +"(assuming the file object pointer is \"f\")::" +msgstr "" +"Щоб викликати, наприклад, метод \"seek\" файлового об'єкта з аргументами 10, " +"0 (припускаючи, що вказівник на файловий об'єкт є \"f\")::" + +msgid "" +"res = PyObject_CallMethod(f, \"seek\", \"(ii)\", 10, 0);\n" +"if (res == NULL) {\n" +" ... an exception occurred ...\n" +"}\n" +"else {\n" +" Py_DECREF(res);\n" +"}" +msgstr "" + +msgid "" +"Note that since :c:func:`PyObject_CallObject` *always* wants a tuple for the " +"argument list, to call a function without arguments, pass \"()\" for the " +"format, and to call a function with one argument, surround the argument in " +"parentheses, e.g. \"(i)\"." +msgstr "" +"Зауважте, що оскільки :c:func:`PyObject_CallObject` *завжди* вимагає кортеж " +"для списку аргументів, щоб викликати функцію без аргументів, передайте " +"\"()\" для формату, а щоб викликати функцію з одним аргументом, оточіть " +"аргумент в дужках, напр. \"(i)\"." + +msgid "" +"How do I catch the output from PyErr_Print() (or anything that prints to " +"stdout/stderr)?" +msgstr "" +"Як мені перехопити вихідні дані PyErr_Print() (або будь-чого, що друкує в " +"stdout/stderr)?" + +msgid "" +"In Python code, define an object that supports the ``write()`` method. " +"Assign this object to :data:`sys.stdout` and :data:`sys.stderr`. Call " +"print_error, or just allow the standard traceback mechanism to work. Then, " +"the output will go wherever your ``write()`` method sends it." +msgstr "" +"У коді Python визначте об’єкт, який підтримує метод ``write()``. Призначте " +"цей об’єкт :data:`sys.stdout` і :data:`sys.stderr`. Викличте print_error або " +"просто дозвольте стандартному механізму відстеження працювати. Тоді вивід " +"буде відправлятися туди, куди його надсилає метод ``write()``." + +msgid "The easiest way to do this is to use the :class:`io.StringIO` class:" +msgstr "" +"Найпростіший спосіб зробити це — використати клас :class:`io.StringIO`:" + +msgid "" +">>> import io, sys\n" +">>> sys.stdout = io.StringIO()\n" +">>> print('foo')\n" +">>> print('hello world!')\n" +">>> sys.stderr.write(sys.stdout.getvalue())\n" +"foo\n" +"hello world!" +msgstr "" + +msgid "A custom object to do the same would look like this:" +msgstr "Настроюваний об’єкт, який буде робити те саме, виглядатиме так:" + +msgid "" +">>> import io, sys\n" +">>> class StdoutCatcher(io.TextIOBase):\n" +"... def __init__(self):\n" +"... self.data = []\n" +"... def write(self, stuff):\n" +"... self.data.append(stuff)\n" +"...\n" +">>> import sys\n" +">>> sys.stdout = StdoutCatcher()\n" +">>> print('foo')\n" +">>> print('hello world!')\n" +">>> sys.stderr.write(''.join(sys.stdout.data))\n" +"foo\n" +"hello world!" +msgstr "" + +msgid "How do I access a module written in Python from C?" +msgstr "Як отримати доступ до модуля, написаного мовою Python, із C?" + +msgid "You can get a pointer to the module object as follows::" +msgstr "Ви можете отримати вказівник на об’єкт модуля наступним чином:" + +msgid "module = PyImport_ImportModule(\"\");" +msgstr "" + +msgid "" +"If the module hasn't been imported yet (i.e. it is not yet present in :data:" +"`sys.modules`), this initializes the module; otherwise it simply returns the " +"value of ``sys.modules[\"\"]``. Note that it doesn't enter the " +"module into any namespace -- it only ensures it has been initialized and is " +"stored in :data:`sys.modules`." +msgstr "" +"Якщо модуль ще не було імпортовано (тобто його ще немає в :data:`sys." +"modules`), це ініціалізує модуль; інакше він просто повертає значення ``sys." +"modules[\" \"]``. Зверніть увагу, що він не вводить модуль у " +"простір імен — він лише гарантує, що його було ініціалізовано та збережено " +"в :data:`sys.modules`." + +msgid "" +"You can then access the module's attributes (i.e. any name defined in the " +"module) as follows::" +msgstr "" +"Потім ви можете отримати доступ до атрибутів модуля (тобто до будь-якого " +"імені, визначеного в модулі) наступним чином:" + +msgid "attr = PyObject_GetAttrString(module, \"\");" +msgstr "" + +msgid "" +"Calling :c:func:`PyObject_SetAttrString` to assign to variables in the " +"module also works." +msgstr "" +"Виклик :c:func:`PyObject_SetAttrString` для призначення змінним у модулі " +"також працює." + +msgid "How do I interface to C++ objects from Python?" +msgstr "Як підключитися до об’єктів C++ із Python?" + +msgid "" +"Depending on your requirements, there are many approaches. To do this " +"manually, begin by reading :ref:`the \"Extending and Embedding\" document " +"`. Realize that for the Python run-time system, there " +"isn't a whole lot of difference between C and C++ -- so the strategy of " +"building a new Python type around a C structure (pointer) type will also " +"work for C++ objects." +msgstr "" +"Залежно від ваших вимог існує багато підходів. Щоб зробити це вручну, " +"почніть із прочитання документу :ref:`\"Розширення та вбудовування\\ " +"`. Зрозумійте, що для системи виконання Python немає " +"великої різниці між C і C++, тому стратегія побудови нового типу Python " +"навколо типу структури (вказівника) C також працюватиме для об’єктів C++." + +msgid "For C++ libraries, see :ref:`c-wrapper-software`." +msgstr "Для бібліотек C++ див. :ref:`c-wrapper-software`." + +msgid "I added a module using the Setup file and the make fails; why?" +msgstr "Я додав модуль за допомогою файлу Setup, і отримав помилку, чому?" + +msgid "" +"Setup must end in a newline, if there is no newline there, the build process " +"fails. (Fixing this requires some ugly shell script hackery, and this bug " +"is so minor that it doesn't seem worth the effort.)" +msgstr "" +"Налаштування має закінчуватися символом нового рядка, якщо там немає нового " +"рядка, процес збирання завершується помилкою. (Щоб виправити це, потрібне " +"негарне хакерство сценарію оболонки, і ця помилка настільки незначна, що " +"здається не вартою зусиль.)" + +msgid "How do I debug an extension?" +msgstr "Як відлагодити розширення?" + +msgid "" +"When using GDB with dynamically loaded extensions, you can't set a " +"breakpoint in your extension until your extension is loaded." +msgstr "" +"Під час використання GDB із динамічно завантажуваними розширеннями ви не " +"можете встановити точку зупинки у своєму розширенні, доки воно не " +"завантажиться." + +msgid "In your ``.gdbinit`` file (or interactively), add the command:" +msgstr "У свій файл ``.gdbinit`` (або інтерактивно) додайте команду:" + +msgid "br _PyImport_LoadDynamicModule" +msgstr "" + +msgid "Then, when you run GDB:" +msgstr "Тоді, коли ви запускаєте GDB:" + +msgid "" +"$ gdb /local/bin/python\n" +"gdb) run myscript.py\n" +"gdb) continue # repeat until your extension is loaded\n" +"gdb) finish # so that your extension is loaded\n" +"gdb) br myfunction.c:50\n" +"gdb) continue" +msgstr "" + +msgid "" +"I want to compile a Python module on my Linux system, but some files are " +"missing. Why?" +msgstr "" +"Я хочу скомпілювати модуль Python у своїй системі Linux, але деякі файли " +"відсутні. чому" + +msgid "" +"Most packaged versions of Python omit some files required for compiling " +"Python extensions." +msgstr "" + +msgid "For Red Hat, install the python3-devel RPM to get the necessary files." +msgstr "" + +msgid "For Debian, run ``apt-get install python3-dev``." +msgstr "" + +msgid "How do I tell \"incomplete input\" from \"invalid input\"?" +msgstr "Як відрізнити \"неповне введення\" від \"некоректного введення\"?" + +msgid "" +"Sometimes you want to emulate the Python interactive interpreter's behavior, " +"where it gives you a continuation prompt when the input is incomplete (e.g. " +"you typed the start of an \"if\" statement or you didn't close your " +"parentheses or triple string quotes), but it gives you a syntax error " +"message immediately when the input is invalid." +msgstr "" +"Іноді потрібно імітувати поведінку інтерактивного інтерпретатора Python, " +"коли він дає вам запит на продовження, коли введення неповне (наприклад, ви " +"ввели початок оператора \"if\" або не закрили дужки чи потрійні рядкові " +"лапки), але він дає вам повідомлення про синтаксичну помилку негайно, коли " +"введення некректне." + +msgid "" +"In Python you can use the :mod:`codeop` module, which approximates the " +"parser's behavior sufficiently. IDLE uses this, for example." +msgstr "" +"У Python ви можете використовувати модуль :mod:`codeop`, який достатньо " +"наближає поведінку аналізатора. IDLE використовує це, наприклад." + +msgid "" +"The easiest way to do it in C is to call :c:func:`PyRun_InteractiveLoop` " +"(perhaps in a separate thread) and let the Python interpreter handle the " +"input for you. You can also set the :c:func:`PyOS_ReadlineFunctionPointer` " +"to point at your custom input function. See ``Modules/readline.c`` and " +"``Parser/myreadline.c`` for more hints." +msgstr "" +"Найпростіший спосіб зробити це в C — викликати :c:func:" +"`PyRun_InteractiveLoop` (можливо, в окремому потоці) і дозволити " +"інтерпретатору Python обробити вхідні дані за вас. Ви також можете " +"встановити :c:func:`PyOS_ReadlineFunctionPointer` так, щоб він вказував на " +"вашу власну функцію введення. Перегляньте ``Modules/readline.c`` і ``Parser/" +"myreadline.c`` для отримання додаткових підказок." + +msgid "How do I find undefined g++ symbols __builtin_new or __pure_virtual?" +msgstr "Як знайти невизначені символи g++ __builtin_new або __pure_virtual?" + +msgid "" +"To dynamically load g++ extension modules, you must recompile Python, relink " +"it using g++ (change LINKCC in the Python Modules Makefile), and link your " +"extension module using g++ (e.g., ``g++ -shared -o mymodule.so mymodule.o``)." +msgstr "" +"Щоб динамічно завантажувати модулі розширення g++, ви повинні " +"перекомпілювати Python, перекомпілювати його за допомогою g++ (змінити " +"LINKCC у Makefile модулів Python) і пов'язати свій модуль розширення за " +"допомогою g++ (наприклад, ``g++ -shared -o mymodule.so mymodule.o``)." + +msgid "" +"Can I create an object class with some methods implemented in C and others " +"in Python (e.g. through inheritance)?" +msgstr "" +"Чи можу я створити клас об’єктів за допомогою деяких методів, реалізованих у " +"C, а інших – у Python (наприклад, через успадкування)?" + +msgid "" +"Yes, you can inherit from built-in classes such as :class:`int`, :class:" +"`list`, :class:`dict`, etc." +msgstr "" +"Так, ви можете успадкувати такі вбудовані класи, як :class:`int`, :class:" +"`list`, :class:`dict` тощо." + +msgid "" +"The Boost Python Library (BPL, https://www.boost.org/libs/python/doc/index." +"html) provides a way of doing this from C++ (i.e. you can inherit from an " +"extension class written in C++ using the BPL)." +msgstr "" diff --git a/faq/general.po b/faq/general.po new file mode 100644 index 000000000..6558aab76 --- /dev/null +++ b/faq/general.po @@ -0,0 +1,773 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Vadim Kashirny, 2022 +# Dmytro Kazanzhy, 2025 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:52+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2025\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "General Python FAQ" +msgstr "Загальні поширені запитання щодо Python" + +msgid "Contents" +msgstr "Зміст" + +msgid "General Information" +msgstr "Загальна інформація" + +msgid "What is Python?" +msgstr "Що таке Python?" + +msgid "" +"Python is an interpreted, interactive, object-oriented programming " +"language. It incorporates modules, exceptions, dynamic typing, very high " +"level dynamic data types, and classes. It supports multiple programming " +"paradigms beyond object-oriented programming, such as procedural and " +"functional programming. Python combines remarkable power with very clear " +"syntax. It has interfaces to many system calls and libraries, as well as to " +"various window systems, and is extensible in C or C++. It is also usable as " +"an extension language for applications that need a programmable interface. " +"Finally, Python is portable: it runs on many Unix variants including Linux " +"and macOS, and on Windows." +msgstr "" +"Python — це інтерпретована, інтерактивна, об’єктно-орієнтована мова " +"програмування. Він містить модулі, винятки, динамічну типізацію, динамічні " +"типи даних дуже високого рівня та класи. Він підтримує кілька парадигм " +"програмування, окрім об’єктно-орієнтованого програмування, наприклад " +"процедурне та функціональне програмування. Python поєднує в собі надзвичайну " +"потужність із дуже чітким синтаксисом. Він має інтерфейси для багатьох " +"системних викликів і бібліотек, а також для різних віконних систем і " +"розширюється на C або C++. Його також можна використовувати як мову " +"розширення для програм, яким потрібен програмований інтерфейс. Нарешті, " +"Python портативний: він працює на багатьох варіантах Unix, включаючи Linux і " +"macOS, а також на Windows." + +msgid "" +"To find out more, start with :ref:`tutorial-index`. The `Beginner's Guide " +"to Python `_ links to other " +"introductory tutorials and resources for learning Python." +msgstr "" +"Щоб дізнатися більше, почніть з :ref:`tutorial-index`. `Посібник для " +"початківців з Python `_ містить " +"посилання на інші вступні посібники та ресурси для вивчення Python." + +msgid "What is the Python Software Foundation?" +msgstr "Що таке Python Software Foundation?" + +msgid "" +"The Python Software Foundation is an independent non-profit organization " +"that holds the copyright on Python versions 2.1 and newer. The PSF's " +"mission is to advance open source technology related to the Python " +"programming language and to publicize the use of Python. The PSF's home " +"page is at https://www.python.org/psf/." +msgstr "" +"Python Software Foundation — це незалежна некомерційна організація, яка " +"володіє авторськими правами на Python версії 2.1 і новіших. Місія PSF " +"полягає в тому, щоб просувати технологію з відкритим кодом, пов’язану з " +"мовою програмування Python, і оприлюднювати використання Python. Домашня " +"сторінка PSF знаходиться за адресою https://www.python.org/psf/." + +msgid "" +"Donations to the PSF are tax-exempt in the US. If you use Python and find " +"it helpful, please contribute via `the PSF donation page `_." +msgstr "" +"Пожертви на користь PSF звільняються від податків у США. Якщо ви " +"використовуєте Python і вважаєте його корисним, зробіть свій внесок через " +"`сторінку пожертв PSF `_." + +msgid "Are there copyright restrictions on the use of Python?" +msgstr "Чи існують обмеження авторського права на використання Python?" + +msgid "" +"You can do anything you want with the source, as long as you leave the " +"copyrights in and display those copyrights in any documentation about Python " +"that you produce. If you honor the copyright rules, it's OK to use Python " +"for commercial use, to sell copies of Python in source or binary form " +"(modified or unmodified), or to sell products that incorporate Python in " +"some form. We would still like to know about all commercial use of Python, " +"of course." +msgstr "" +"Ви можете робити з вихідним кодом усе, що завгодно, за умови, що ви залишите " +"авторські права та відобразите ці авторські права в будь-якій документації " +"щодо Python, яку ви створюєте. Якщо ви дотримуєтеся правил авторського " +"права, можна використовувати Python для комерційного використання, продавати " +"копії Python у вихідній чи двійковій формі (модифікованій чи " +"немодифікованій) або продавати продукти, які в тій чи іншій формі містять " +"Python. Звичайно, ми все ще хотіли б знати про комерційне використання " +"Python." + +msgid "" +"See `the license page `_ to find " +"further explanations and the full text of the PSF License." +msgstr "" + +msgid "" +"The Python logo is trademarked, and in certain cases permission is required " +"to use it. Consult `the Trademark Usage Policy `__ for more information." +msgstr "" +"Логотип Python є торговою маркою, і в деяких випадках для його використання " +"потрібен дозвіл. Зверніться до `Політики використання торговельних марок " +"`__ для отримання додаткової " +"інформації." + +msgid "Why was Python created in the first place?" +msgstr "Чому взагалі був створений Python?" + +msgid "" +"Here's a *very* brief summary of what started it all, written by Guido van " +"Rossum:" +msgstr "" +"Ось *дуже* короткий виклад того, з чого все почалося, написаний Гвідо ван " +"Россумом:" + +msgid "" +"I had extensive experience with implementing an interpreted language in the " +"ABC group at CWI, and from working with this group I had learned a lot about " +"language design. This is the origin of many Python features, including the " +"use of indentation for statement grouping and the inclusion of very-high-" +"level data types (although the details are all different in Python)." +msgstr "" +"У мене був великий досвід впровадження мови інтерпретації в групі ABC у CWI, " +"і, працюючи з цією групою, я багато чого дізнався про мовний дизайн. Це " +"походження багатьох функцій Python, включаючи використання відступів для " +"групування операторів і включення типів даних дуже високого рівня (хоча всі " +"деталі в Python різні)." + +msgid "" +"I had a number of gripes about the ABC language, but also liked many of its " +"features. It was impossible to extend the ABC language (or its " +"implementation) to remedy my complaints -- in fact its lack of extensibility " +"was one of its biggest problems. I had some experience with using Modula-2+ " +"and talked with the designers of Modula-3 and read the Modula-3 report. " +"Modula-3 is the origin of the syntax and semantics used for exceptions, and " +"some other Python features." +msgstr "" +"У мене було кілька нарікань щодо мови ABC, але мені також сподобалися багато " +"її функцій. Неможливо було розширити мову ABC (або її реалізацію), щоб " +"виправити мої скарги - насправді її відсутність розширюваності була однією з " +"найбільших проблем. У мене був певний досвід використання Modula-2+, я " +"поспілкувався з розробниками Modula-3 і прочитав звіт Modula-3. Modula-3 є " +"джерелом синтаксису та семантики, які використовуються для винятків, а також " +"деяких інших функцій Python." + +msgid "" +"I was working in the Amoeba distributed operating system group at CWI. We " +"needed a better way to do system administration than by writing either C " +"programs or Bourne shell scripts, since Amoeba had its own system call " +"interface which wasn't easily accessible from the Bourne shell. My " +"experience with error handling in Amoeba made me acutely aware of the " +"importance of exceptions as a programming language feature." +msgstr "" +"Я працював у групі розподілених операційних систем Amoeba в CWI. Нам " +"потрібен був кращий спосіб адміністрування системи, ніж написання програм на " +"C або сценаріїв оболонки Bourne, оскільки Amoeba мала власний інтерфейс " +"системних викликів, до якого було важко отримати доступ із оболонки Bourne. " +"Мій досвід обробки помилок в Amoeba дав мені чітке усвідомлення важливості " +"винятків як функції мови програмування." + +msgid "" +"It occurred to me that a scripting language with a syntax like ABC but with " +"access to the Amoeba system calls would fill the need. I realized that it " +"would be foolish to write an Amoeba-specific language, so I decided that I " +"needed a language that was generally extensible." +msgstr "" +"Мені спало на думку, що мова сценаріїв із синтаксисом, подібним до ABC, але " +"з доступом до системних викликів Amoeba, задовольнить цю потребу. Я " +"зрозумів, що було б нерозумно писати мову, специфічну для Amoeba, тому я " +"вирішив, що мені потрібна мова, яка загалом розширювана." + +msgid "" +"During the 1989 Christmas holidays, I had a lot of time on my hand, so I " +"decided to give it a try. During the next year, while still mostly working " +"on it in my own time, Python was used in the Amoeba project with increasing " +"success, and the feedback from colleagues made me add many early " +"improvements." +msgstr "" +"Під час різдвяних свят 1989 року в мене було багато часу, тож я вирішив " +"спробувати. Протягом наступного року, хоча я все ще здебільшого працював над " +"ним у свій час, Python використовувався в проекті Amoeba з дедалі більшим " +"успіхом, і відгуки колег змусили мене додати багато перших покращень." + +msgid "" +"In February 1991, after just over a year of development, I decided to post " +"to USENET. The rest is in the ``Misc/HISTORY`` file." +msgstr "" +"У лютому 1991 року, після трохи більше ніж року розробки, я вирішив " +"опублікувати повідомлення в USENET. Решта у файлі ``Misc/HISTORY``." + +msgid "What is Python good for?" +msgstr "Чим корисний Python?" + +msgid "" +"Python is a high-level general-purpose programming language that can be " +"applied to many different classes of problems." +msgstr "" +"Python — це мова програмування високого рівня загального призначення, яку " +"можна застосовувати до багатьох різних класів задач." + +msgid "" +"The language comes with a large standard library that covers areas such as " +"string processing (regular expressions, Unicode, calculating differences " +"between files), internet protocols (HTTP, FTP, SMTP, XML-RPC, POP, IMAP), " +"software engineering (unit testing, logging, profiling, parsing Python " +"code), and operating system interfaces (system calls, filesystems, TCP/IP " +"sockets). Look at the table of contents for :ref:`library-index` to get an " +"idea of what's available. A wide variety of third-party extensions are also " +"available. Consult `the Python Package Index `_ to find " +"packages of interest to you." +msgstr "" + +msgid "How does the Python version numbering scheme work?" +msgstr "Як працює схема нумерації версій Python?" + +msgid "Python versions are numbered \"A.B.C\" or \"A.B\":" +msgstr "" + +msgid "" +"*A* is the major version number -- it is only incremented for really major " +"changes in the language." +msgstr "" + +msgid "" +"*B* is the minor version number -- it is incremented for less earth-" +"shattering changes." +msgstr "" + +msgid "" +"*C* is the micro version number -- it is incremented for each bugfix release." +msgstr "" + +msgid "" +"Not all releases are bugfix releases. In the run-up to a new feature " +"release, a series of development releases are made, denoted as alpha, beta, " +"or release candidate. Alphas are early releases in which interfaces aren't " +"yet finalized; it's not unexpected to see an interface change between two " +"alpha releases. Betas are more stable, preserving existing interfaces but " +"possibly adding new modules, and release candidates are frozen, making no " +"changes except as needed to fix critical bugs." +msgstr "" + +msgid "Alpha, beta and release candidate versions have an additional suffix:" +msgstr "" + +msgid "The suffix for an alpha version is \"aN\" for some small number *N*." +msgstr "" + +msgid "The suffix for a beta version is \"bN\" for some small number *N*." +msgstr "" + +msgid "" +"The suffix for a release candidate version is \"rcN\" for some small number " +"*N*." +msgstr "" + +msgid "" +"In other words, all versions labeled *2.0aN* precede the versions labeled " +"*2.0bN*, which precede versions labeled *2.0rcN*, and *those* precede 2.0." +msgstr "" + +msgid "" +"You may also find version numbers with a \"+\" suffix, e.g. \"2.2+\". These " +"are unreleased versions, built directly from the CPython development " +"repository. In practice, after a final minor release is made, the version " +"is incremented to the next minor version, which becomes the \"a0\" version, " +"e.g. \"2.4a0\"." +msgstr "" +"Ви також можете знайти номери версій із суфіксом \"+\", напр. \"2,2+\". Це " +"неопубліковані версії, створені безпосередньо з репозиторію розробки " +"CPython. На практиці, після створення остаточного мінорного випуску, версія " +"збільшується до наступної мінорної версії, яка стає версією \"a0\", напр. " +"\"2.4a0\"." + +msgid "" +"See the `Developer's Guide `__ for more information about the development cycle, " +"and :pep:`387` to learn more about Python's backward compatibility policy. " +"See also the documentation for :data:`sys.version`, :data:`sys.hexversion`, " +"and :data:`sys.version_info`." +msgstr "" + +msgid "How do I obtain a copy of the Python source?" +msgstr "Як отримати копію вихідного коду Python?" + +msgid "" +"The latest Python source distribution is always available from python.org, " +"at https://www.python.org/downloads/. The latest development sources can be " +"obtained at https://github.com/python/cpython/." +msgstr "" +"Найновіший вихідний код Python завжди доступний на сайті python.org за " +"адресою https://www.python.org/downloads/. Останні джерела розробки можна " +"отримати на https://github.com/python/cpython/." + +msgid "" +"The source distribution is a gzipped tar file containing the complete C " +"source, Sphinx-formatted documentation, Python library modules, example " +"programs, and several useful pieces of freely distributable software. The " +"source will compile and run out of the box on most UNIX platforms." +msgstr "" +"Дистрибутив вихідного коду — це файл tar у форматі gzip, що містить повний " +"вихідний код C, документацію у форматі Sphinx, модулі бібліотеки Python, " +"приклади програм і кілька корисних частин програмного забезпечення, яке " +"вільно розповсюджується. Джерело компілюється та запускається з коробки на " +"більшості платформ UNIX." + +msgid "" +"Consult the `Getting Started section of the Python Developer's Guide " +"`__ for more information on getting the " +"source code and compiling it." +msgstr "" +"Зверніться до розділу `\"Початок роботи\" Посібника розробника Python " +"`__, щоб дізнатися більше про отримання " +"вихідного коду та його компіляцію." + +msgid "How do I get documentation on Python?" +msgstr "Як отримати документацію на Python?" + +msgid "" +"The standard documentation for the current stable version of Python is " +"available at https://docs.python.org/3/. PDF, plain text, and downloadable " +"HTML versions are also available at https://docs.python.org/3/download.html." +msgstr "" +"Стандартна документація для поточної стабільної версії Python доступна за " +"адресою https://docs.python.org/3/. PDF, звичайний текст і HTML-версії для " +"завантаження також доступні за адресою https://docs.python.org/3/download." +"html." + +msgid "" +"The documentation is written in reStructuredText and processed by `the " +"Sphinx documentation tool `__. The " +"reStructuredText source for the documentation is part of the Python source " +"distribution." +msgstr "" + +msgid "I've never programmed before. Is there a Python tutorial?" +msgstr "Я ніколи раніше не програмував. Чи є підручник з Python?" + +msgid "" +"There are numerous tutorials and books available. The standard " +"documentation includes :ref:`tutorial-index`." +msgstr "" +"Доступно багато підручників і книг. Стандартна документація включає :ref:" +"`tutorial-index`." + +msgid "" +"Consult `the Beginner's Guide `_ to find information for beginning Python programmers, " +"including lists of tutorials." +msgstr "" +"Зверніться до `Посібника для початківців `_, щоб знайти інформацію для початківців програмістів " +"Python, включаючи списки навчальних посібників." + +msgid "Is there a newsgroup or mailing list devoted to Python?" +msgstr "Чи існує група новин або список розсилки, присвячений Python?" + +msgid "" +"There is a newsgroup, :newsgroup:`comp.lang.python`, and a mailing list, " +"`python-list `_. The " +"newsgroup and mailing list are gatewayed into each other -- if you can read " +"news it's unnecessary to subscribe to the mailing list. :newsgroup:`comp." +"lang.python` is high-traffic, receiving hundreds of postings every day, and " +"Usenet readers are often more able to cope with this volume." +msgstr "" +"Є група новин :newsgroup:`comp.lang.python` і список розсилки `python-list " +"`_. Група новин і " +"список розсилки пов’язані один з одним — якщо ви можете читати новини, немає " +"необхідності підписуватися на список розсилки. :newsgroup:`comp.lang.python` " +"має високий трафік, отримує сотні публікацій щодня, і читачам Usenet часто " +"легше впоратися з цим обсягом." + +msgid "" +"Announcements of new software releases and events can be found in comp.lang." +"python.announce, a low-traffic moderated list that receives about five " +"postings per day. It's available as `the python-announce mailing list " +"`_." +msgstr "" + +msgid "" +"More info about other mailing lists and newsgroups can be found at https://" +"www.python.org/community/lists/." +msgstr "" +"Додаткову інформацію про інші списки розсилки та групи новин можна знайти на " +"https://www.python.org/community/lists/." + +msgid "How do I get a beta test version of Python?" +msgstr "Як отримати тестову бета-версію Python?" + +msgid "" +"Alpha and beta releases are available from https://www.python.org/" +"downloads/. All releases are announced on the comp.lang.python and comp." +"lang.python.announce newsgroups and on the Python home page at https://www." +"python.org/; an RSS feed of news is available." +msgstr "" +"Альфа- та бета-версії доступні за адресою https://www.python.org/downloads/. " +"Усі випуски оголошуються в групах новин comp.lang.python і comp.lang.python." +"announce, а також на домашній сторінці Python за адресою https://www.python." +"org/; доступна RSS-канал новин." + +msgid "" +"You can also access the development version of Python through Git. See `The " +"Python Developer's Guide `_ for details." +msgstr "" +"Ви також можете отримати доступ до версії Python для розробки через Git. " +"Перегляньте `Посібник розробника Python `_ для " +"отримання додаткової інформації." + +msgid "How do I submit bug reports and patches for Python?" +msgstr "Як надіслати звіти про помилки та виправлення для Python?" + +msgid "" +"To report a bug or submit a patch, use the issue tracker at https://github." +"com/python/cpython/issues." +msgstr "" + +msgid "" +"For more information on how Python is developed, consult `the Python " +"Developer's Guide `_." +msgstr "" +"Щоб дізнатися більше про те, як розробляється Python, зверніться до " +"`Посібника розробника Python `_." + +msgid "Are there any published articles about Python that I can reference?" +msgstr "Чи є опубліковані статті про Python, на які я можу посилатися?" + +msgid "It's probably best to cite your favorite book about Python." +msgstr "Мабуть, найкраще процитувати вашу улюблену книгу про Python." + +msgid "" +"The `very first article `_ about Python was " +"written in 1991 and is now quite outdated." +msgstr "" + +msgid "" +"Guido van Rossum and Jelke de Boer, \"Interactively Testing Remote Servers " +"Using the Python Programming Language\", CWI Quarterly, Volume 4, Issue 4 " +"(December 1991), Amsterdam, pp 283--303." +msgstr "" +"Гвідо ван Россум і Джелке де Бур, \"Інтерактивне тестування віддалених " +"серверів за допомогою мови програмування Python\", CWI Quarterly, том 4, " +"випуск 4 (грудень 1991), Амстердам, стор. 283--303." + +msgid "Are there any books on Python?" +msgstr "Чи є книги про Python?" + +msgid "" +"Yes, there are many, and more are being published. See the python.org wiki " +"at https://wiki.python.org/moin/PythonBooks for a list." +msgstr "" +"Так, їх багато, і публікується більше. Перегляньте список у вікі python.org " +"за адресою https://wiki.python.org/moin/PythonBooks." + +msgid "" +"You can also search online bookstores for \"Python\" and filter out the " +"Monty Python references; or perhaps search for \"Python\" and \"language\"." +msgstr "" +"Ви також можете шукати в книжкових онлайн-магазинах \"Python\" і " +"відфільтрувати посилання на Monty Python; або, можливо, шукайте \"Python\" і " +"\"мова\"." + +msgid "Where in the world is www.python.org located?" +msgstr "Де у світі знаходиться www.python.org?" + +msgid "" +"The Python project's infrastructure is located all over the world and is " +"managed by the Python Infrastructure Team. Details `here `__." +msgstr "" + +msgid "Why is it called Python?" +msgstr "Чому він називається Python?" + +msgid "" +"When he began implementing Python, Guido van Rossum was also reading the " +"published scripts from `\"Monty Python's Flying Circus\" `__, a BBC comedy series from the 1970s. " +"Van Rossum thought he needed a name that was short, unique, and slightly " +"mysterious, so he decided to call the language Python." +msgstr "" +"Коли Гвідо ван Россум почав впроваджувати Python, він також читав " +"опубліковані сценарії з `\"Летючого цирку Монті Пайтона\" `__, комедійного серіалу BBC 1970-х років. " +"Ван Россум подумав, що йому потрібна коротка, унікальна та трохи загадкова " +"назва, тому він вирішив назвати мову Python." + +msgid "Do I have to like \"Monty Python's Flying Circus\"?" +msgstr "" +"Чи обов’язково мені повинен подобатись \"Летючий цирк Монті Пайтона\"?" + +msgid "No, but it helps. :)" +msgstr "Ні, але допомагає. :)" + +msgid "Python in the real world" +msgstr "Python у реальному світі" + +msgid "How stable is Python?" +msgstr "Наскільки стабільний Python?" + +msgid "" +"Very stable. New, stable releases have been coming out roughly every 6 to " +"18 months since 1991, and this seems likely to continue. As of version 3.9, " +"Python will have a new feature release every 12 months (:pep:`602`)." +msgstr "" + +msgid "" +"The developers issue bugfix releases of older versions, so the stability of " +"existing releases gradually improves. Bugfix releases, indicated by a third " +"component of the version number (e.g. 3.5.3, 3.6.2), are managed for " +"stability; only fixes for known problems are included in a bugfix release, " +"and it's guaranteed that interfaces will remain the same throughout a series " +"of bugfix releases." +msgstr "" + +msgid "" +"The latest stable releases can always be found on the `Python download page " +"`_. Python 3.x is the recommended version " +"and supported by most widely used libraries. Python 2.x :pep:`is not " +"maintained anymore <373>`." +msgstr "" + +msgid "How many people are using Python?" +msgstr "Скільки людей використовують Python?" + +msgid "" +"There are probably millions of users, though it's difficult to obtain an " +"exact count." +msgstr "" +"Ймовірно, є мільйони користувачів, хоча важко отримати точну кількість." + +msgid "" +"Python is available for free download, so there are no sales figures, and " +"it's available from many different sites and packaged with many Linux " +"distributions, so download statistics don't tell the whole story either." +msgstr "" +"Python доступний для безкоштовного завантаження, тому немає даних про " +"продажі, і він доступний на багатьох різних сайтах і входить до складу " +"багатьох дистрибутивів Linux, тому статистика завантажень також не говорить " +"усієї історії." + +msgid "" +"The comp.lang.python newsgroup is very active, but not all Python users post " +"to the group or even read it." +msgstr "" +"Група новин comp.lang.python дуже активна, але не всі користувачі Python " +"пишають у групі або навіть читають її." + +msgid "Have any significant projects been done in Python?" +msgstr "Чи були якісь значні проекти виконані на Python?" + +msgid "" +"See https://www.python.org/about/success for a list of projects that use " +"Python. Consulting the proceedings for `past Python conferences `_ will reveal contributions from many " +"different companies and organizations." +msgstr "" +"Див. https://www.python.org/about/success, щоб переглянути список проектів, " +"які використовують Python. Перегляд матеріалів `минулих конференцій Python " +"`_ покаже внески багатьох " +"різних компаній і організацій." + +msgid "" +"High-profile Python projects include `the Mailman mailing list manager " +"`_ and `the Zope application server `_. Several Linux distributions, most notably `Red Hat `_, have written part or all of their installer and system " +"administration software in Python. Companies that use Python internally " +"include Google, Yahoo, and Lucasfilm Ltd." +msgstr "" + +msgid "What new developments are expected for Python in the future?" +msgstr "Які нові розробки очікуються для Python у майбутньому?" + +msgid "" +"See https://peps.python.org/ for the Python Enhancement Proposals (PEPs). " +"PEPs are design documents describing a suggested new feature for Python, " +"providing a concise technical specification and a rationale. Look for a PEP " +"titled \"Python X.Y Release Schedule\", where X.Y is a version that hasn't " +"been publicly released yet." +msgstr "" + +msgid "" +"New development is discussed on `the python-dev mailing list `_." +msgstr "" + +msgid "Is it reasonable to propose incompatible changes to Python?" +msgstr "Чи розумно пропонувати несумісні зміни в Python?" + +msgid "" +"In general, no. There are already millions of lines of Python code around " +"the world, so any change in the language that invalidates more than a very " +"small fraction of existing programs has to be frowned upon. Even if you can " +"provide a conversion program, there's still the problem of updating all " +"documentation; many books have been written about Python, and we don't want " +"to invalidate them all at a single stroke." +msgstr "" +"Загалом ні. По всьому світу вже існують мільйони рядків коду Python, тому " +"будь-яку зміну в мові, яка робить недійсною більш ніж дуже малу частину " +"існуючих програм, слід сприймати несхвально. Навіть якщо ви можете надати " +"програму перетворення, все одно залишається проблема оновлення всієї " +"документації; Про Python написано багато книжок, і ми не хочемо скасувати їх " +"усі одним ударом." + +msgid "" +"Providing a gradual upgrade path is necessary if a feature has to be " +"changed. :pep:`5` describes the procedure followed for introducing backward-" +"incompatible changes while minimizing disruption for users." +msgstr "" +"Надання поступового шляху оновлення є необхідним, якщо функцію потрібно " +"змінити. :pep:`5` описує процедуру введення змін, несумісних із попередніми " +"версіями, мінімізуючи перешкоди для користувачів." + +msgid "Is Python a good language for beginning programmers?" +msgstr "Чи є Python хорошою мовою для програмістів-початківців?" + +msgid "Yes." +msgstr "Так." + +msgid "" +"It is still common to start students with a procedural and statically typed " +"language such as Pascal, C, or a subset of C++ or Java. Students may be " +"better served by learning Python as their first language. Python has a very " +"simple and consistent syntax and a large standard library and, most " +"importantly, using Python in a beginning programming course lets students " +"concentrate on important programming skills such as problem decomposition " +"and data type design. With Python, students can be quickly introduced to " +"basic concepts such as loops and procedures. They can probably even work " +"with user-defined objects in their very first course." +msgstr "" +"Досі прийнято починати студентів із процедурної та статично типізованої " +"мови, такої як Pascal, C або підмножини C++ чи Java. Студентам краще буде " +"вивчати Python як першу мову. Python має дуже простий і послідовний " +"синтаксис і велику стандартну бібліотеку, і, що найважливіше, використання " +"Python на початковому курсі програмування дозволяє студентам зосередитися на " +"важливих навичках програмування, таких як декомпозиція задачі та " +"проектування типів даних. За допомогою Python студенти можуть швидко " +"познайомитися з основними поняттями, такими як цикли та процедури. Ймовірно, " +"вони навіть можуть працювати з об’єктами, визначеними користувачем, у своєму " +"першому курсі." + +msgid "" +"For a student who has never programmed before, using a statically typed " +"language seems unnatural. It presents additional complexity that the " +"student must master and slows the pace of the course. The students are " +"trying to learn to think like a computer, decompose problems, design " +"consistent interfaces, and encapsulate data. While learning to use a " +"statically typed language is important in the long term, it is not " +"necessarily the best topic to address in the students' first programming " +"course." +msgstr "" +"Для студента, який ніколи раніше не програмував, використання статично " +"типізованої мови виглядає неприродним. Це створює додаткову складність, яку " +"студент повинен освоїти, і уповільнює темп курсу. Студенти намагаються " +"навчитися мислити як комп’ютер, декомпонувати проблеми, проектувати " +"послідовні інтерфейси та інкапсулювати дані. Хоча навчитися використовувати " +"статично типізовану мову є важливим у довгостроковій перспективі, це не " +"обов’язково найкраща тема для вивчення в першому курсі програмування " +"студентів." + +msgid "" +"Many other aspects of Python make it a good first language. Like Java, " +"Python has a large standard library so that students can be assigned " +"programming projects very early in the course that *do* something. " +"Assignments aren't restricted to the standard four-function calculator and " +"check balancing programs. By using the standard library, students can gain " +"the satisfaction of working on realistic applications as they learn the " +"fundamentals of programming. Using the standard library also teaches " +"students about code reuse. Third-party modules such as PyGame are also " +"helpful in extending the students' reach." +msgstr "" +"Багато інших аспектів Python роблять його хорошою першою мовою. Подібно до " +"Java, Python має велику стандартну бібліотеку, тому студентам можна " +"призначати проекти програмування на початку курсу, які *роблять* щось. " +"Завдання не обмежуються стандартним чотирифункціональним калькулятором і " +"програмами перевірки балансу. Використовуючи стандартну бібліотеку, студенти " +"можуть отримати задоволення від роботи над реалістичними програмами, " +"вивчаючи основи програмування. Використання стандартної бібліотеки також " +"навчає студентів повторному використанню коду. Сторонні модулі, такі як " +"PyGame, також допомагають розширити охоплення студентів." + +msgid "" +"Python's interactive interpreter enables students to test language features " +"while they're programming. They can keep a window with the interpreter " +"running while they enter their program's source in another window. If they " +"can't remember the methods for a list, they can do something like this::" +msgstr "" +"Інтерактивний інтерпретатор Python дозволяє студентам тестувати функції мови " +"під час програмування. Вони можуть тримати вікно з запущеним " +"інтерпретатором, поки вони вводять код своєї програми в інше вікно. Якщо " +"вони не можуть згадати методи для списку, вони можуть зробити щось подібне:" + +msgid "" +">>> L = []\n" +">>> dir(L)\n" +"['__add__', '__class__', '__contains__', '__delattr__', '__delitem__',\n" +"'__dir__', '__doc__', '__eq__', '__format__', '__ge__',\n" +"'__getattribute__', '__getitem__', '__gt__', '__hash__', '__iadd__',\n" +"'__imul__', '__init__', '__iter__', '__le__', '__len__', '__lt__',\n" +"'__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__',\n" +"'__repr__', '__reversed__', '__rmul__', '__setattr__', '__setitem__',\n" +"'__sizeof__', '__str__', '__subclasshook__', 'append', 'clear',\n" +"'copy', 'count', 'extend', 'index', 'insert', 'pop', 'remove',\n" +"'reverse', 'sort']\n" +">>> [d for d in dir(L) if '__' not in d]\n" +"['append', 'clear', 'copy', 'count', 'extend', 'index', 'insert', 'pop', " +"'remove', 'reverse', 'sort']\n" +"\n" +">>> help(L.append)\n" +"Help on built-in function append:\n" +"\n" +"append(...)\n" +" L.append(object) -> None -- append object to end\n" +"\n" +">>> L.append(1)\n" +">>> L\n" +"[1]" +msgstr "" + +msgid "" +"With the interpreter, documentation is never far from the student as they " +"are programming." +msgstr "" +"З інтерпретатором документація завжди є доступною для студента, оскільки він " +"програмує." + +msgid "" +"There are also good IDEs for Python. IDLE is a cross-platform IDE for " +"Python that is written in Python using Tkinter. Emacs users will be happy to " +"know that there is a very good Python mode for Emacs. All of these " +"programming environments provide syntax highlighting, auto-indenting, and " +"access to the interactive interpreter while coding. Consult `the Python " +"wiki `_ for a full list of " +"Python editing environments." +msgstr "" + +msgid "" +"If you want to discuss Python's use in education, you may be interested in " +"joining `the edu-sig mailing list `_." +msgstr "" +"Якщо ви хочете обговорити використання Python в освіті, вам може бути цікаво " +"приєднатися до `списку розсилки edu-sig `_." diff --git a/faq/gui.po b/faq/gui.po new file mode 100644 index 000000000..f5f20cd1a --- /dev/null +++ b/faq/gui.po @@ -0,0 +1,125 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# Vadim Kashirny, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:52+0000\n" +"Last-Translator: Vadim Kashirny, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Graphic User Interface FAQ" +msgstr "Поширені запитання про графічний інтерфейс користувача" + +msgid "Contents" +msgstr "Зміст" + +msgid "General GUI Questions" +msgstr "Загальні запитання графічного інтерфейсу" + +msgid "What GUI toolkits exist for Python?" +msgstr "Які інструменти GUI існують для Python?" + +msgid "" +"Standard builds of Python include an object-oriented interface to the Tcl/Tk " +"widget set, called :ref:`tkinter `. This is probably the easiest " +"to install (since it comes included with most `binary distributions `_ of Python) and use. For more info about Tk, " +"including pointers to the source, see the `Tcl/Tk home page `_. Tcl/Tk is fully portable to the macOS, Windows, and Unix platforms." +msgstr "" +"Стандартні збірки Python містять об’єктно-орієнтований інтерфейс до набору " +"віджетів Tcl/Tk під назвою :ref:`tkinter `. Це, мабуть, " +"найпростіший для встановлення (оскільки він входить до складу більшості " +"`бінарних дистрибутивів `_ Python) і " +"використання. Для отримання додаткової інформації про Tk, включаючи " +"покажчики на джерело, перегляньте `домашню сторінку Tcl/Tk `_. Tcl/Tk повністю переноситься на платформи macOS, Windows і Unix." + +msgid "" +"Depending on what platform(s) you are aiming at, there are also several " +"alternatives. A `list of cross-platform `_ and `platform-specific `_ GUI " +"frameworks can be found on the python wiki." +msgstr "" +"Залежно від того, на яку платформу(и) ви орієнтуєтеся, є також кілька " +"альтернатив. `Список кросплатформних `_ і `специфічних для платформи " +"`_ " +"фреймворків графічного інтерфейсу можна знайти на python wiki." + +msgid "Tkinter questions" +msgstr "Питання по Tkinter" + +msgid "How do I freeze Tkinter applications?" +msgstr "Як заморозити програми Tkinter?" + +msgid "" +"Freeze is a tool to create stand-alone applications. When freezing Tkinter " +"applications, the applications will not be truly stand-alone, as the " +"application will still need the Tcl and Tk libraries." +msgstr "" +"Freeze — це інструмент для створення автономних програм. Під час " +"заморожування програм Tkinter програми не будуть справді автономними, " +"оскільки програмі все одно знадобляться бібліотеки Tcl і Tk." + +msgid "" +"One solution is to ship the application with the Tcl and Tk libraries, and " +"point to them at run-time using the :envvar:`!TCL_LIBRARY` and :envvar:`!" +"TK_LIBRARY` environment variables." +msgstr "" + +msgid "" +"Various third-party freeze libraries such as py2exe and cx_Freeze have " +"handling for Tkinter applications built-in." +msgstr "" + +msgid "Can I have Tk events handled while waiting for I/O?" +msgstr "Чи можу я обробляти події Tk під час очікування введення-виведення?" + +msgid "" +"On platforms other than Windows, yes, and you don't even need threads! But " +"you'll have to restructure your I/O code a bit. Tk has the equivalent of " +"Xt's :c:func:`!XtAddInput` call, which allows you to register a callback " +"function which will be called from the Tk mainloop when I/O is possible on a " +"file descriptor. See :ref:`tkinter-file-handlers`." +msgstr "" + +msgid "I can't get key bindings to work in Tkinter: why?" +msgstr "Я не можу змусити прив’язки клавіш працювати в Tkinter: чому?" + +msgid "" +"An often-heard complaint is that event handlers :ref:`bound ` to events with the :meth:`!bind` method don't get handled even when " +"the appropriate key is pressed." +msgstr "" + +msgid "" +"The most common cause is that the widget to which the binding applies " +"doesn't have \"keyboard focus\". Check out the Tk documentation for the " +"focus command. Usually a widget is given the keyboard focus by clicking in " +"it (but not for labels; see the takefocus option)." +msgstr "" +"Найпоширенішою причиною є те, що віджет, до якого застосовується прив’язка, " +"не має \"фокусу клавіатури\". Перегляньте документацію Tk для команди focus. " +"Зазвичай віджет отримує фокус клавіатури, клацнувши його (але не для міток; " +"див. опцію takefocus)." diff --git a/faq/index.po b/faq/index.po new file mode 100644 index 000000000..5d4358ff5 --- /dev/null +++ b/faq/index.po @@ -0,0 +1,29 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:52+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Python Frequently Asked Questions" +msgstr "Часті запитання щодо Python" diff --git a/faq/installed.po b/faq/installed.po new file mode 100644 index 000000000..f112d5aaa --- /dev/null +++ b/faq/installed.po @@ -0,0 +1,138 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# Vadim Kashirny, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:52+0000\n" +"Last-Translator: Vadim Kashirny, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "\"Why is Python Installed on my Computer?\" FAQ" +msgstr "\"Чому на моєму комп’ютері встановлено Python?\" FAQ" + +msgid "What is Python?" +msgstr "Що таке Python?" + +msgid "" +"Python is a programming language. It's used for many different " +"applications. It's used in some high schools and colleges as an introductory " +"programming language because Python is easy to learn, but it's also used by " +"professional software developers at places such as Google, NASA, and " +"Lucasfilm Ltd." +msgstr "" +"Python — мова програмування. Він використовується для багатьох різних " +"застосувань. Його вивчають у деяких середніх школах і коледжах як першу мову " +"програмування, оскільки Python легко вивчити, але його також використовують " +"професійні розробники програмного забезпечення в таких організаціях, як " +"Google, NASA та Lucasfilm Ltd." + +msgid "" +"If you wish to learn more about Python, start with the `Beginner's Guide to " +"Python `_." +msgstr "" +"Якщо ви хочете дізнатися більше про Python, почніть із `Посібника для " +"початківців з Python `_." + +msgid "Why is Python installed on my machine?" +msgstr "Чому на моїй машині встановлено Python?" + +msgid "" +"If you find Python installed on your system but don't remember installing " +"it, there are several possible ways it could have gotten there." +msgstr "" +"Якщо у вашій системі встановлено Python, але ви не пам’ятаєте, що " +"встановлювали його, існує кілька можливих шляхів, якими він міг туди " +"потрапити." + +msgid "" +"Perhaps another user on the computer wanted to learn programming and " +"installed it; you'll have to figure out who's been using the machine and " +"might have installed it." +msgstr "" +"Можливо, інший користувач комп'ютера хотів навчитися програмуванню і " +"встановив його; вам доведеться з’ясувати, хто використовував машину і, " +"можливо, її встановив." + +msgid "" +"A third-party application installed on the machine might have been written " +"in Python and included a Python installation. There are many such " +"applications, from GUI programs to network servers and administrative " +"scripts." +msgstr "" +"Програма стороннього виробника, встановлена на машині, могла бути написана " +"на Python і включала інсталяцію Python. Існує багато таких програм, це і " +"програми з графічним користувацьким инерфейсом і мережеві сервери і " +"адміністративні сценарії." + +msgid "" +"Some Windows machines also have Python installed. At this writing we're " +"aware of computers from Hewlett-Packard and Compaq that include Python. " +"Apparently some of HP/Compaq's administrative tools are written in Python." +msgstr "" +"На деяких машинах Windows також встановлено Python. На момент написання цієї " +"статті ми знаємо про комп’ютери Hewlett-Packard і Compaq, які включають " +"Python. Очевидно, деякі інструменти адміністрування HP/Compaq написані на " +"Python." + +msgid "" +"Many Unix-compatible operating systems, such as macOS and some Linux " +"distributions, have Python installed by default; it's included in the base " +"installation." +msgstr "" +"У багатьох Unix-сумісних операційних системах, таких як macOS і деякі " +"дистрибутиви Linux, стандартно встановлено Python; він включений в базову " +"установку." + +msgid "Can I delete Python?" +msgstr "Чи можу я видалити Python?" + +msgid "That depends on where Python came from." +msgstr "Це залежить від того, звідки взявся Python." + +msgid "" +"If someone installed it deliberately, you can remove it without hurting " +"anything. On Windows, use the Add/Remove Programs icon in the Control Panel." +msgstr "" +"Якщо хтось встановив його додатково, ви можете видалити його, нічого не " +"пошкодивши. У Windows використовуйте піктограму \"Установка/видалення " +"програм\" на панелі керування." + +msgid "" +"If Python was installed by a third-party application, you can also remove " +"it, but that application will no longer work. You should use that " +"application's uninstaller rather than removing Python directly." +msgstr "" +"Якщо Python було встановлено в комплекті разом з іншою програмою, ви також " +"можете видалити його, але така програма більше не працюватиме. Вам слід " +"використовувати програму видалення цієї програми, а не видаляти Python " +"безпосередньо." + +msgid "" +"If Python came with your operating system, removing it is not recommended. " +"If you remove it, whatever tools were written in Python will no longer run, " +"and some of them might be important to you. Reinstalling the whole system " +"would then be required to fix things again." +msgstr "" +"Якщо Python поставляється разом із вашою операційною системою, видаляти його " +"не рекомендується. Якщо ви видалите його, усі інструменти, написані на " +"Python, більше не працюватимуть, а деякі з них можуть бути для вас " +"важливими. Щоб виправити ситуацію, знадобиться перевстановити всю систему." diff --git a/faq/library.po b/faq/library.po new file mode 100644 index 000000000..cd82f04cf --- /dev/null +++ b/faq/library.po @@ -0,0 +1,1109 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:52+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Library and Extension FAQ" +msgstr "Поширені запитання про бібліотеку та розширення" + +msgid "Contents" +msgstr "Зміст" + +msgid "General Library Questions" +msgstr "Загальні бібліотечні питання" + +msgid "How do I find a module or application to perform task X?" +msgstr "Як знайти модуль або програму для виконання завдання X?" + +msgid "" +"Check :ref:`the Library Reference ` to see if there's a " +"relevant standard library module. (Eventually you'll learn what's in the " +"standard library and will be able to skip this step.)" +msgstr "" +"Перевірте :ref:`довідник бібліотеки `, щоб побачити, чи є " +"відповідний модуль стандартної бібліотеки. (Згодом ви дізнаєтеся, що " +"міститься в стандартній бібліотеці, і зможете пропустити цей крок.)" + +msgid "" +"For third-party packages, search the `Python Package Index `_ or try `Google `_ or another web search " +"engine. Searching for \"Python\" plus a keyword or two for your topic of " +"interest will usually find something helpful." +msgstr "" +"Пакунки сторонніх розробників шукайте в `Python Package Index `_ або спробуйте `Google `_ або іншу веб-" +"пошукову систему. Якщо шукати \"Python\" і кілька ключових слів для теми, " +"яка вас цікавить, зазвичай знайдете щось корисне." + +msgid "Where is the math.py (socket.py, regex.py, etc.) source file?" +msgstr "Де знаходиться вихідний файл math.py (socket.py, regex.py тощо)?" + +msgid "" +"If you can't find a source file for a module it may be a built-in or " +"dynamically loaded module implemented in C, C++ or other compiled language. " +"In this case you may not have the source file or it may be something like :" +"file:`mathmodule.c`, somewhere in a C source directory (not on the Python " +"Path)." +msgstr "" +"Якщо ви не можете знайти вихідний файл для модуля, це може бути вбудований " +"або динамічно завантажуваний модуль, реалізований на C, C++ або іншій " +"скомпільованій мові. У цьому випадку ви можете не мати вихідного файлу або " +"це може бути щось на кшталт :file:`mathmodule.c`, десь у каталозі вихідного " +"коду C (не на шляху Python)." + +msgid "There are (at least) three kinds of modules in Python:" +msgstr "У Python є (принаймні) три типи модулів:" + +msgid "modules written in Python (.py);" +msgstr "модулі, написані мовою Python (.py);" + +msgid "" +"modules written in C and dynamically loaded (.dll, .pyd, .so, .sl, etc);" +msgstr "" +"модулі, написані на C і динамічно завантажуються (.dll, .pyd, .so, .sl тощо);" + +msgid "" +"modules written in C and linked with the interpreter; to get a list of " +"these, type::" +msgstr "" +"модулі, написані на C і пов'язані з інтерпретатором; щоб отримати їх список, " +"введіть::" + +msgid "" +"import sys\n" +"print(sys.builtin_module_names)" +msgstr "" + +msgid "How do I make a Python script executable on Unix?" +msgstr "Як зробити сценарій Python виконуваним у Unix?" + +msgid "" +"You need to do two things: the script file's mode must be executable and the " +"first line must begin with ``#!`` followed by the path of the Python " +"interpreter." +msgstr "" +"Вам потрібно зробити дві речі: режим файлу сценарію має бути виконуваним, а " +"перший рядок має починатися з ``#!``, за яким слідує шлях інтерпретатора " +"Python." + +msgid "" +"The first is done by executing ``chmod +x scriptfile`` or perhaps ``chmod " +"755 scriptfile``." +msgstr "" +"Перший виконується шляхом виконання ``chmod +x scriptfile`` або, можливо, " +"``chmod 755 scriptfile``." + +msgid "" +"The second can be done in a number of ways. The most straightforward way is " +"to write ::" +msgstr "" +"Друге можна зробити кількома способами. Найпростіший спосіб - написати ::" + +msgid "#!/usr/local/bin/python" +msgstr "" + +msgid "" +"as the very first line of your file, using the pathname for where the Python " +"interpreter is installed on your platform." +msgstr "" +"як перший рядок вашого файлу, використовуючи ім’я шляху для того, де на " +"вашій платформі встановлено інтерпретатор Python." + +msgid "" +"If you would like the script to be independent of where the Python " +"interpreter lives, you can use the :program:`env` program. Almost all Unix " +"variants support the following, assuming the Python interpreter is in a " +"directory on the user's :envvar:`PATH`::" +msgstr "" +"Якщо ви бажаєте, щоб сценарій не залежав від місця розташування " +"інтерпретатора Python, ви можете скористатися програмою :program:`env`. " +"Майже всі варіанти Unix підтримують наступне, припускаючи, що інтерпретатор " +"Python знаходиться в каталозі користувача :envvar:`PATH`::" + +msgid "#!/usr/bin/env python" +msgstr "" + +msgid "" +"*Don't* do this for CGI scripts. The :envvar:`PATH` variable for CGI " +"scripts is often very minimal, so you need to use the actual absolute " +"pathname of the interpreter." +msgstr "" +"*Не* робіть цього для сценаріїв CGI. Змінна :envvar:`PATH` для сценаріїв CGI " +"часто дуже мінімальна, тому вам потрібно використовувати фактичний " +"абсолютний шлях інтерпретатора." + +msgid "" +"Occasionally, a user's environment is so full that the :program:`/usr/bin/" +"env` program fails; or there's no env program at all. In that case, you can " +"try the following hack (due to Alex Rezinsky):" +msgstr "" +"Іноді середовище користувача настільки переповнене, що програма :program:`/" +"usr/bin/env` дає збій; або взагалі немає програми env. У такому випадку ви " +"можете спробувати наступний хак (завдяки Alex Rezinsky):" + +msgid "" +"#! /bin/sh\n" +"\"\"\":\"\n" +"exec python $0 ${1+\"$@\"}\n" +"\"\"\"" +msgstr "" + +msgid "" +"The minor disadvantage is that this defines the script's __doc__ string. " +"However, you can fix that by adding ::" +msgstr "" +"Незначним недоліком є те, що це визначає рядок __doc__ сценарію. Однак ви " +"можете виправити це, додавши ::" + +msgid "__doc__ = \"\"\"...Whatever...\"\"\"" +msgstr "" + +msgid "Is there a curses/termcap package for Python?" +msgstr "Чи є пакет curses/termcap для Python?" + +msgid "" +"For Unix variants: The standard Python source distribution comes with a " +"curses module in the :source:`Modules` subdirectory, though it's not " +"compiled by default. (Note that this is not available in the Windows " +"distribution -- there is no curses module for Windows.)" +msgstr "" +"Для варіантів Unix: Стандартний дистрибутив вихідного коду Python " +"постачається з модулем curses у підкаталозі :source:`Modules`, хоча він не " +"скомпільований за замовчуванням. (Зауважте, що це недоступно в дистрибутиві " +"Windows — для Windows немає модуля curses.)" + +msgid "" +"The :mod:`curses` module supports basic curses features as well as many " +"additional functions from ncurses and SYSV curses such as colour, " +"alternative character set support, pads, and mouse support. This means the " +"module isn't compatible with operating systems that only have BSD curses, " +"but there don't seem to be any currently maintained OSes that fall into this " +"category." +msgstr "" +"Модуль :mod:`curses` підтримує базові функції curses, а також багато " +"додаткових функцій від ncurses і curses SYSV, таких як підтримка кольору, " +"альтернативного набору символів, панелей і підтримки миші. Це означає, що " +"модуль не сумісний з операційними системами, які мають лише прокляття BSD, " +"але, здається, на даний момент не існує операційних систем, які підпадають " +"під цю категорію." + +msgid "Is there an equivalent to C's onexit() in Python?" +msgstr "Чи є еквівалент onexit() C у Python?" + +msgid "" +"The :mod:`atexit` module provides a register function that is similar to " +"C's :c:func:`!onexit`." +msgstr "" + +msgid "Why don't my signal handlers work?" +msgstr "Чому мої обробники сигналів не працюють?" + +msgid "" +"The most common problem is that the signal handler is declared with the " +"wrong argument list. It is called as ::" +msgstr "" +"Найбільш поширеною проблемою є те, що обробник сигналу оголошено з " +"неправильним списком аргументів. Називається як ::" + +msgid "handler(signum, frame)" +msgstr "" + +msgid "so it should be declared with two parameters::" +msgstr "тому його слід оголосити з двома параметрами::" + +msgid "" +"def handler(signum, frame):\n" +" ..." +msgstr "" + +msgid "Common tasks" +msgstr "Загальні завдання" + +msgid "How do I test a Python program or component?" +msgstr "Як перевірити програму або компонент Python?" + +msgid "" +"Python comes with two testing frameworks. The :mod:`doctest` module finds " +"examples in the docstrings for a module and runs them, comparing the output " +"with the expected output given in the docstring." +msgstr "" +"Python постачається з двома платформами тестування. Модуль :mod:`doctest` " +"знаходить приклади в рядках документів для модуля та запускає їх, порівнюючи " +"вихідні дані з очікуваними результатами, указаними в рядках документів." + +msgid "" +"The :mod:`unittest` module is a fancier testing framework modelled on Java " +"and Smalltalk testing frameworks." +msgstr "" +"Модуль :mod:`unittest` — це модніша платформа для тестування, змодельована " +"на платформах тестування Java і Smalltalk." + +msgid "" +"To make testing easier, you should use good modular design in your program. " +"Your program should have almost all functionality encapsulated in either " +"functions or class methods -- and this sometimes has the surprising and " +"delightful effect of making the program run faster (because local variable " +"accesses are faster than global accesses). Furthermore the program should " +"avoid depending on mutating global variables, since this makes testing much " +"more difficult to do." +msgstr "" +"Щоб спростити тестування, вам слід використовувати хороший модульний дизайн " +"у вашій програмі. Ваша програма повинна мати майже всю функціональність, " +"інкапсульовану або у функції, або в методи класу - і це іноді має дивовижний " +"і чудовий ефект, прискорюючи роботу програми (оскільки доступ до локальних " +"змінних є швидшим, ніж доступ до глобальних). Крім того, програмі слід " +"уникати залежності від мутації глобальних змінних, оскільки це значно " +"ускладнює виконання тестування." + +msgid "The \"global main logic\" of your program may be as simple as ::" +msgstr "" +"\"Глобальна основна логіка\" вашої програми може бути такою ж простою, як:" + +msgid "" +"if __name__ == \"__main__\":\n" +" main_logic()" +msgstr "" + +msgid "at the bottom of the main module of your program." +msgstr "у нижній частині головного модуля вашої програми." + +msgid "" +"Once your program is organized as a tractable collection of function and " +"class behaviours, you should write test functions that exercise the " +"behaviours. A test suite that automates a sequence of tests can be " +"associated with each module. This sounds like a lot of work, but since " +"Python is so terse and flexible it's surprisingly easy. You can make coding " +"much more pleasant and fun by writing your test functions in parallel with " +"the \"production code\", since this makes it easy to find bugs and even " +"design flaws earlier." +msgstr "" +"Після того, як ваша програма організована як придатна для читання колекція " +"поведінки функцій і класів, ви повинні написати тестові функції, які " +"реалізують поведінку. З кожним модулем можна пов’язати набір тестів, який " +"автоматизує послідовність тестів. Це звучить як велика робота, але оскільки " +"Python такий стислий і гнучкий, це напрочуд легко. Ви можете зробити " +"кодування набагато приємнішим і веселішим, написавши тестові функції " +"паралельно з \"виробничим кодом\", оскільки це полегшить пошук помилок і " +"навіть недоліків дизайну раніше." + +msgid "" +"\"Support modules\" that are not intended to be the main module of a program " +"may include a self-test of the module. ::" +msgstr "" +"\"Модулі підтримки\", які не призначені бути основними модулями програми, " +"можуть включати самотестування модуля. ::" + +msgid "" +"if __name__ == \"__main__\":\n" +" self_test()" +msgstr "" + +msgid "" +"Even programs that interact with complex external interfaces may be tested " +"when the external interfaces are unavailable by using \"fake\" interfaces " +"implemented in Python." +msgstr "" +"Навіть програми, які взаємодіють зі складними зовнішніми інтерфейсами, можна " +"перевіряти, коли зовнішні інтерфейси недоступні, використовуючи \"фальшиві\" " +"інтерфейси, реалізовані на Python." + +msgid "How do I create documentation from doc strings?" +msgstr "Як створити документацію з рядків документа?" + +msgid "" +"The :mod:`pydoc` module can create HTML from the doc strings in your Python " +"source code. An alternative for creating API documentation purely from " +"docstrings is `epydoc `_. `Sphinx `_ can also include docstring content." +msgstr "" + +msgid "How do I get a single keypress at a time?" +msgstr "Як отримати одне натискання клавіші за раз?" + +msgid "" +"For Unix variants there are several solutions. It's straightforward to do " +"this using curses, but curses is a fairly large module to learn." +msgstr "" +"Для варіантів Unix є кілька рішень. Це легко зробити за допомогою curses, " +"але curses — це досить великий модуль для вивчення." + +msgid "Threads" +msgstr "Нитки" + +msgid "How do I program using threads?" +msgstr "Як програмувати за допомогою потоків?" + +msgid "" +"Be sure to use the :mod:`threading` module and not the :mod:`_thread` " +"module. The :mod:`threading` module builds convenient abstractions on top of " +"the low-level primitives provided by the :mod:`_thread` module." +msgstr "" +"Обов’язково використовуйте модуль :mod:`threading`, а не модуль :mod:" +"`_thread`. Модуль :mod:`threading` створює зручні абстракції на основі " +"низькорівневих примітивів, які надає модуль :mod:`_thread`." + +msgid "None of my threads seem to run: why?" +msgstr "Здається, жодна з моїх тем не працює: чому?" + +msgid "" +"As soon as the main thread exits, all threads are killed. Your main thread " +"is running too quickly, giving the threads no time to do any work." +msgstr "" +"Як тільки головний потік виходить, усі потоки припиняються. Ваш основний " +"потік працює надто швидко, не даючи потокам часу виконувати будь-яку роботу." + +msgid "" +"A simple fix is to add a sleep to the end of the program that's long enough " +"for all the threads to finish::" +msgstr "" +"Простим виправленням є додавання сну до кінця програми, який буде достатнім " +"для завершення всіх потоків:" + +msgid "" +"import threading, time\n" +"\n" +"def thread_task(name, n):\n" +" for i in range(n):\n" +" print(name, i)\n" +"\n" +"for i in range(10):\n" +" T = threading.Thread(target=thread_task, args=(str(i), i))\n" +" T.start()\n" +"\n" +"time.sleep(10) # <---------------------------!" +msgstr "" + +msgid "" +"But now (on many platforms) the threads don't run in parallel, but appear to " +"run sequentially, one at a time! The reason is that the OS thread scheduler " +"doesn't start a new thread until the previous thread is blocked." +msgstr "" +"Але тепер (на багатьох платформах) потоки не працюють паралельно, а, " +"здається, виконуються послідовно, один за одним! Причина полягає в тому, що " +"планувальник потоків ОС не запускає новий потік, доки попередній потік не " +"буде заблоковано." + +msgid "A simple fix is to add a tiny sleep to the start of the run function::" +msgstr "" +"Просте виправлення полягає в тому, щоб додати крихітний сон до початку " +"функції запуску:" + +msgid "" +"def thread_task(name, n):\n" +" time.sleep(0.001) # <--------------------!\n" +" for i in range(n):\n" +" print(name, i)\n" +"\n" +"for i in range(10):\n" +" T = threading.Thread(target=thread_task, args=(str(i), i))\n" +" T.start()\n" +"\n" +"time.sleep(10)" +msgstr "" + +msgid "" +"Instead of trying to guess a good delay value for :func:`time.sleep`, it's " +"better to use some kind of semaphore mechanism. One idea is to use the :mod:" +"`queue` module to create a queue object, let each thread append a token to " +"the queue when it finishes, and let the main thread read as many tokens from " +"the queue as there are threads." +msgstr "" +"Замість того, щоб намагатися вгадати хороше значення затримки для :func:" +"`time.sleep`, краще використати якийсь семафорний механізм. Одна з ідей " +"полягає в тому, щоб використовувати модуль :mod:`queue` для створення " +"об’єкта черги, дозволити кожному потоку додавати маркер до черги, коли він " +"закінчиться, і дозволити основному потоку читати стільки маркерів із черги, " +"скільки є потоків." + +msgid "How do I parcel out work among a bunch of worker threads?" +msgstr "Як розділити роботу серед групи робочих потоків?" + +msgid "" +"The easiest way is to use the :mod:`concurrent.futures` module, especially " +"the :mod:`~concurrent.futures.ThreadPoolExecutor` class." +msgstr "" +"Найпростішим способом є використання модуля :mod:`concurrent.futures`, " +"особливо класу :mod:`~concurrent.futures.ThreadPoolExecutor`." + +msgid "" +"Or, if you want fine control over the dispatching algorithm, you can write " +"your own logic manually. Use the :mod:`queue` module to create a queue " +"containing a list of jobs. The :class:`~queue.Queue` class maintains a list " +"of objects and has a ``.put(obj)`` method that adds items to the queue and a " +"``.get()`` method to return them. The class will take care of the locking " +"necessary to ensure that each job is handed out exactly once." +msgstr "" +"Або, якщо вам потрібен точний контроль над алгоритмом диспетчеризації, ви " +"можете написати власну логіку вручну. Використовуйте модуль :mod:`queue`, " +"щоб створити чергу зі списком завдань. Клас :class:`~queue.Queue` підтримує " +"список об’єктів і має метод ``.put(obj)``, який додає елементи до черги, і " +"метод ``.get()`` для їх повернення. Клас подбає про блокування, необхідне " +"для того, щоб кожне завдання було роздано рівно один раз." + +msgid "Here's a trivial example::" +msgstr "Ось тривіальний приклад::" + +msgid "" +"import threading, queue, time\n" +"\n" +"# The worker thread gets jobs off the queue. When the queue is empty, it\n" +"# assumes there will be no more work and exits.\n" +"# (Realistically workers will run until terminated.)\n" +"def worker():\n" +" print('Running worker')\n" +" time.sleep(0.1)\n" +" while True:\n" +" try:\n" +" arg = q.get(block=False)\n" +" except queue.Empty:\n" +" print('Worker', threading.current_thread(), end=' ')\n" +" print('queue empty')\n" +" break\n" +" else:\n" +" print('Worker', threading.current_thread(), end=' ')\n" +" print('running with argument', arg)\n" +" time.sleep(0.5)\n" +"\n" +"# Create queue\n" +"q = queue.Queue()\n" +"\n" +"# Start a pool of 5 workers\n" +"for i in range(5):\n" +" t = threading.Thread(target=worker, name='worker %i' % (i+1))\n" +" t.start()\n" +"\n" +"# Begin adding work to the queue\n" +"for i in range(50):\n" +" q.put(i)\n" +"\n" +"# Give threads time to run\n" +"print('Main thread sleeping')\n" +"time.sleep(5)" +msgstr "" + +msgid "When run, this will produce the following output:" +msgstr "Під час запуску це створить такий результат:" + +msgid "" +"Running worker\n" +"Running worker\n" +"Running worker\n" +"Running worker\n" +"Running worker\n" +"Main thread sleeping\n" +"Worker running with argument 0\n" +"Worker running with argument 1\n" +"Worker running with argument 2\n" +"Worker running with argument 3\n" +"Worker running with argument 4\n" +"Worker running with argument 5\n" +"..." +msgstr "" + +msgid "" +"Consult the module's documentation for more details; the :class:`~queue." +"Queue` class provides a featureful interface." +msgstr "" +"Щоб дізнатися більше, зверніться до документації модуля; клас :class:`~queue." +"Queue` забезпечує зручний інтерфейс." + +msgid "What kinds of global value mutation are thread-safe?" +msgstr "Які види глобальної мутації значення є потокобезпечними?" + +msgid "" +"A :term:`global interpreter lock` (GIL) is used internally to ensure that " +"only one thread runs in the Python VM at a time. In general, Python offers " +"to switch among threads only between bytecode instructions; how frequently " +"it switches can be set via :func:`sys.setswitchinterval`. Each bytecode " +"instruction and therefore all the C implementation code reached from each " +"instruction is therefore atomic from the point of view of a Python program." +msgstr "" +":term:`global interpreter lock` (GIL) використовується внутрішньо, щоб " +"забезпечити виконання лише одного потоку у віртуальній машині Python " +"одночасно. Загалом, Python пропонує перемикатися між потоками лише між " +"інструкціями байт-коду; як часто він перемикається, можна встановити через :" +"func:`sys.setswitchinterval`. Кожна інструкція байт-коду і, отже, весь код " +"реалізації C, отриманий від кожної інструкції, є атомарними з точки зору " +"програми Python." + +msgid "" +"In theory, this means an exact accounting requires an exact understanding of " +"the PVM bytecode implementation. In practice, it means that operations on " +"shared variables of built-in data types (ints, lists, dicts, etc) that " +"\"look atomic\" really are." +msgstr "" +"Теоретично це означає, що точний облік вимагає точного розуміння реалізації " +"байт-коду PVM. На практиці це означає, що операції зі спільними змінними " +"вбудованих типів даних (int, списки, dicts тощо), які \"виглядають " +"атомарними\", дійсно є такими." + +msgid "" +"For example, the following operations are all atomic (L, L1, L2 are lists, " +"D, D1, D2 are dicts, x, y are objects, i, j are ints)::" +msgstr "" +"Наприклад, усі наступні операції є атомарними (L, L1, L2 — списки, D, D1, D2 " +"— dicts, x, y — об’єкти, i, j — цілі):" + +msgid "" +"L.append(x)\n" +"L1.extend(L2)\n" +"x = L[i]\n" +"x = L.pop()\n" +"L1[i:j] = L2\n" +"L.sort()\n" +"x = y\n" +"x.field = y\n" +"D[x] = y\n" +"D1.update(D2)\n" +"D.keys()" +msgstr "" + +msgid "These aren't::" +msgstr "Це не::" + +msgid "" +"i = i+1\n" +"L.append(L[-1])\n" +"L[i] = L[j]\n" +"D[x] = D[x] + 1" +msgstr "" + +msgid "" +"Operations that replace other objects may invoke those other objects' :meth:" +"`~object.__del__` method when their reference count reaches zero, and that " +"can affect things. This is especially true for the mass updates to " +"dictionaries and lists. When in doubt, use a mutex!" +msgstr "" + +msgid "Can't we get rid of the Global Interpreter Lock?" +msgstr "Чи не можемо ми позбутися глобального блокування інтерпретатора?" + +msgid "" +"The :term:`global interpreter lock` (GIL) is often seen as a hindrance to " +"Python's deployment on high-end multiprocessor server machines, because a " +"multi-threaded Python program effectively only uses one CPU, due to the " +"insistence that (almost) all Python code can only run while the GIL is held." +msgstr "" +":term:`global interpreter lock` (GIL) часто розглядається як перешкода для " +"розгортання Python на високоякісних багатопроцесорних серверах, оскільки " +"багатопотокова програма Python фактично використовує лише один ЦП, через те, " +"що (майже) весь код Python може виконуватися лише під час утримання GIL." + +msgid "" +"With the approval of :pep:`703` work is now underway to remove the GIL from " +"the CPython implementation of Python. Initially it will be implemented as " +"an optional compiler flag when building the interpreter, and so separate " +"builds will be available with and without the GIL. Long-term, the hope is " +"to settle on a single build, once the performance implications of removing " +"the GIL are fully understood. Python 3.13 is likely to be the first release " +"containing this work, although it may not be completely functional in this " +"release." +msgstr "" + +msgid "" +"The current work to remove the GIL is based on a `fork of Python 3.9 with " +"the GIL removed `_ by Sam Gross. Prior " +"to that, in the days of Python 1.5, Greg Stein actually implemented a " +"comprehensive patch set (the \"free threading\" patches) that removed the " +"GIL and replaced it with fine-grained locking. Adam Olsen did a similar " +"experiment in his `python-safethread `_ project. Unfortunately, both of these earlier " +"experiments exhibited a sharp drop in single-thread performance (at least " +"30% slower), due to the amount of fine-grained locking necessary to " +"compensate for the removal of the GIL. The Python 3.9 fork is the first " +"attempt at removing the GIL with an acceptable performance impact." +msgstr "" + +msgid "" +"The presence of the GIL in current Python releases doesn't mean that you " +"can't make good use of Python on multi-CPU machines! You just have to be " +"creative with dividing the work up between multiple *processes* rather than " +"multiple *threads*. The :class:`~concurrent.futures.ProcessPoolExecutor` " +"class in the new :mod:`concurrent.futures` module provides an easy way of " +"doing so; the :mod:`multiprocessing` module provides a lower-level API in " +"case you want more control over dispatching of tasks." +msgstr "" + +msgid "" +"Judicious use of C extensions will also help; if you use a C extension to " +"perform a time-consuming task, the extension can release the GIL while the " +"thread of execution is in the C code and allow other threads to get some " +"work done. Some standard library modules such as :mod:`zlib` and :mod:" +"`hashlib` already do this." +msgstr "" +"Розумне використання розширень C також допоможе; якщо ви використовуєте " +"розширення C для виконання трудомісткого завдання, розширення може звільнити " +"GIL, поки потік виконання знаходиться в коді C, і дозволить іншим потокам " +"виконати певну роботу. Деякі стандартні бібліотечні модулі, такі як :mod:" +"`zlib` і :mod:`hashlib`, вже це роблять." + +msgid "" +"An alternative approach to reducing the impact of the GIL is to make the GIL " +"a per-interpreter-state lock rather than truly global. This was :ref:`first " +"implemented in Python 3.12 ` and is available in the C " +"API. A Python interface to it is expected in Python 3.13. The main " +"limitation to it at the moment is likely to be 3rd party extension modules, " +"since these must be written with multiple interpreters in mind in order to " +"be usable, so many older extension modules will not be usable." +msgstr "" + +msgid "Input and Output" +msgstr "Вхід і вихід" + +msgid "How do I delete a file? (And other file questions...)" +msgstr "Як видалити файл? (І інші запитання щодо файлів...)" + +msgid "" +"Use ``os.remove(filename)`` or ``os.unlink(filename)``; for documentation, " +"see the :mod:`os` module. The two functions are identical; :func:`~os." +"unlink` is simply the name of the Unix system call for this function." +msgstr "" +"Використовуйте ``os.remove(ім’я файлу)`` або ``os.unlink(ім’я файлу)``; для " +"документації дивіться модуль :mod:`os`. Дві функції ідентичні; :func:`~os." +"unlink` — це просто назва системного виклику Unix для цієї функції." + +msgid "" +"To remove a directory, use :func:`os.rmdir`; use :func:`os.mkdir` to create " +"one. ``os.makedirs(path)`` will create any intermediate directories in " +"``path`` that don't exist. ``os.removedirs(path)`` will remove intermediate " +"directories as long as they're empty; if you want to delete an entire " +"directory tree and its contents, use :func:`shutil.rmtree`." +msgstr "" +"Щоб видалити каталог, використовуйте :func:`os.rmdir`; використовуйте :func:" +"`os.mkdir`, щоб створити його. ``os.makedirs(path)`` створить будь-які " +"проміжні каталоги в ``path``, яких не існує. ``os.removedirs(path)`` " +"видалить проміжні каталоги, якщо вони порожні; якщо ви хочете видалити ціле " +"дерево каталогів і його вміст, використовуйте :func:`shutil.rmtree`." + +msgid "To rename a file, use ``os.rename(old_path, new_path)``." +msgstr "" +"Щоб перейменувати файл, використовуйте ``os.rename(old_path, new_path)``." + +msgid "" +"To truncate a file, open it using ``f = open(filename, \"rb+\")``, and use " +"``f.truncate(offset)``; offset defaults to the current seek position. " +"There's also ``os.ftruncate(fd, offset)`` for files opened with :func:`os." +"open`, where *fd* is the file descriptor (a small integer)." +msgstr "" +"Щоб скоротити файл, відкрийте його за допомогою ``f = open(filename, \"rb+" +"\")`` і використовуйте ``f.truncate(offset)``; offset за замовчуванням до " +"поточної позиції пошуку. Існує також ``os.ftruncate(fd, offset)`` для " +"файлів, відкритих за допомогою :func:`os.open`, де *fd* є дескриптором файлу " +"(мале ціле число)." + +msgid "" +"The :mod:`shutil` module also contains a number of functions to work on " +"files including :func:`~shutil.copyfile`, :func:`~shutil.copytree`, and :" +"func:`~shutil.rmtree`." +msgstr "" +"Модуль :mod:`shutil` також містить ряд функцій для роботи з файлами, " +"включаючи :func:`~shutil.copyfile`, :func:`~shutil.copytree` і :func:" +"`~shutil.rmtree`." + +msgid "How do I copy a file?" +msgstr "Як скопіювати файл?" + +msgid "" +"The :mod:`shutil` module contains a :func:`~shutil.copyfile` function. Note " +"that on Windows NTFS volumes, it does not copy `alternate data streams " +"`_ nor " +"`resource forks `__ on macOS " +"HFS+ volumes, though both are now rarely used. It also doesn't copy file " +"permissions and metadata, though using :func:`shutil.copy2` instead will " +"preserve most (though not all) of it." +msgstr "" +"Модуль :mod:`shutil` містить функцію :func:`~shutil.copyfile`. Зауважте, що " +"на томах Windows NTFS він не копіює `альтернативні потоки даних `_ і `розгалуження " +"ресурсів `__ на томах macOS " +"HFS+, хоча обидва зараз використовуються рідко. Він також не копіює дозволи " +"на файли та метадані, хоча використання натомість :func:`shutil.copy2` " +"збереже більшість (хоча не всі) з них." + +msgid "How do I read (or write) binary data?" +msgstr "Як читати (або записувати) двійкові дані?" + +msgid "" +"To read or write complex binary data formats, it's best to use the :mod:" +"`struct` module. It allows you to take a string containing binary data " +"(usually numbers) and convert it to Python objects; and vice versa." +msgstr "" +"Для читання або запису складних двійкових форматів даних найкраще " +"використовувати модуль :mod:`struct`. Це дозволяє вам взяти рядок, що " +"містить двійкові дані (зазвичай числа), і перетворити його на об’єкти " +"Python; і навпаки." + +msgid "" +"For example, the following code reads two 2-byte integers and one 4-byte " +"integer in big-endian format from a file::" +msgstr "" +"Наприклад, наступний код читає два 2-байтових цілих числа та одне 4-байтове " +"ціле число у форматі big-endian з файлу::" + +msgid "" +"import struct\n" +"\n" +"with open(filename, \"rb\") as f:\n" +" s = f.read(8)\n" +" x, y, z = struct.unpack(\">hhl\", s)" +msgstr "" + +msgid "" +"The '>' in the format string forces big-endian data; the letter 'h' reads " +"one \"short integer\" (2 bytes), and 'l' reads one \"long integer\" (4 " +"bytes) from the string." +msgstr "" +"Знак \">\" у рядку формату примусово вводить дані в бік старшого; літера 'h' " +"читає одне \"коротке ціле число\" (2 байти), а 'l' читає одне \"довге ціле " +"число\" (4 байти) з рядка." + +msgid "" +"For data that is more regular (e.g. a homogeneous list of ints or floats), " +"you can also use the :mod:`array` module." +msgstr "" +"Для даних, які є більш регулярними (наприклад, однорідний список int або " +"float), ви також можете використовувати модуль :mod:`array`." + +msgid "" +"To read and write binary data, it is mandatory to open the file in binary " +"mode (here, passing ``\"rb\"`` to :func:`open`). If you use ``\"r\"`` " +"instead (the default), the file will be open in text mode and ``f.read()`` " +"will return :class:`str` objects rather than :class:`bytes` objects." +msgstr "" +"Щоб читати та записувати двійкові дані, необхідно відкрити файл у двійковому " +"режимі (тут передаючи ``\"rb\"`` до :func:`open`). Якщо замість цього " +"використовувати ``\"r\"`` (за замовчуванням), файл буде відкритий у " +"текстовому режимі, а ``f.read()`` повертатиме об’єкти :class:`str`, а не :" +"class:`bytes` об'єктів." + +msgid "I can't seem to use os.read() on a pipe created with os.popen(); why?" +msgstr "" +"Здається, я не можу використовувати os.read() у каналі, створеному за " +"допомогою os.popen(); чому?" + +msgid "" +":func:`os.read` is a low-level function which takes a file descriptor, a " +"small integer representing the opened file. :func:`os.popen` creates a high-" +"level file object, the same type returned by the built-in :func:`open` " +"function. Thus, to read *n* bytes from a pipe *p* created with :func:`os." +"popen`, you need to use ``p.read(n)``." +msgstr "" +":func:`os.read` — це функція низького рівня, яка приймає дескриптор файлу, " +"маленьке ціле число, що представляє відкритий файл. :func:`os.popen` створює " +"об’єкт файлу високого рівня, того самого типу, який повертає вбудована " +"функція :func:`open`. Таким чином, щоб прочитати *n* байт з каналу *p*, " +"створеного за допомогою :func:`os.popen`, вам потрібно використовувати ``p." +"read(n)``." + +msgid "How do I access the serial (RS232) port?" +msgstr "Як отримати доступ до послідовного (RS232) порту?" + +msgid "For Win32, OSX, Linux, BSD, Jython, IronPython:" +msgstr "Для Win32, OSX, Linux, BSD, Jython, IronPython:" + +msgid ":pypi:`pyserial`" +msgstr "" + +msgid "For Unix, see a Usenet post by Mitch Chapman:" +msgstr "Щодо Unix, перегляньте публікацію Usenet від Мітча Чепмена:" + +msgid "https://groups.google.com/groups?selm=34A04430.CF9@ohioee.com" +msgstr "https://groups.google.com/groups?selm=34A04430.CF9@ohioee.com" + +msgid "Why doesn't closing sys.stdout (stdin, stderr) really close it?" +msgstr "Чому закриття sys.stdout (stdin, stderr) насправді не закриває його?" + +msgid "" +"Python :term:`file objects ` are a high-level layer of " +"abstraction on low-level C file descriptors." +msgstr "" +"Python :term:`файлові об’єкти ` є високорівневим рівнем " +"абстракції на низькорівневих файлових дескрипторах C." + +msgid "" +"For most file objects you create in Python via the built-in :func:`open` " +"function, ``f.close()`` marks the Python file object as being closed from " +"Python's point of view, and also arranges to close the underlying C file " +"descriptor. This also happens automatically in ``f``'s destructor, when " +"``f`` becomes garbage." +msgstr "" +"Для більшості файлових об’єктів, які ви створюєте в Python за допомогою " +"вбудованої функції :func:`open`, ``f.close()`` позначає файловий об’єкт " +"Python як закритий з точки зору Python, а також організовує закриття базовий " +"дескриптор файлу C. Це також відбувається автоматично в деструкторі ``f``, " +"коли ``f`` стає сміттям." + +msgid "" +"But stdin, stdout and stderr are treated specially by Python, because of the " +"special status also given to them by C. Running ``sys.stdout.close()`` " +"marks the Python-level file object as being closed, but does *not* close the " +"associated C file descriptor." +msgstr "" +"Але stdin, stdout і stderr спеціально обробляються Python через особливий " +"статус, наданий їм також C. Запуск ``sys.stdout.close()`` позначає файловий " +"об’єкт на рівні Python як закритий, але *не* закривати пов’язаний дескриптор " +"файлу C." + +msgid "" +"To close the underlying C file descriptor for one of these three, you should " +"first be sure that's what you really want to do (e.g., you may confuse " +"extension modules trying to do I/O). If it is, use :func:`os.close`::" +msgstr "" +"Щоб закрити базовий дескриптор файлу C для одного з цих трьох, ви повинні " +"спочатку переконатися, що це те, що ви дійсно хочете зробити (наприклад, ви " +"можете сплутати модулі розширення, які намагаються виконати введення-" +"виведення). Якщо так, використовуйте :func:`os.close`::" + +msgid "" +"os.close(stdin.fileno())\n" +"os.close(stdout.fileno())\n" +"os.close(stderr.fileno())" +msgstr "" + +msgid "Or you can use the numeric constants 0, 1 and 2, respectively." +msgstr "Або ви можете використовувати числові константи 0, 1 і 2 відповідно." + +msgid "Network/Internet Programming" +msgstr "Програмування мережі/Інтернету" + +msgid "What WWW tools are there for Python?" +msgstr "Які інструменти WWW існують для Python?" + +msgid "" +"See the chapters titled :ref:`internet` and :ref:`netdata` in the Library " +"Reference Manual. Python has many modules that will help you build server-" +"side and client-side web systems." +msgstr "" +"Див. розділи під назвою :ref:`internet` і :ref:`netdata` у Довідковому " +"посібнику з бібліотеки. Python має багато модулів, які допоможуть вам " +"створювати серверні та клієнтські веб-системи." + +msgid "" +"A summary of available frameworks is maintained by Paul Boddie at https://" +"wiki.python.org/moin/WebProgramming\\ ." +msgstr "" +"Резюме доступних фреймворків підтримує Пол Бодді на https://wiki.python.org/" +"moin/WebProgramming\\ ." + +msgid "What module should I use to help with generating HTML?" +msgstr "Який модуль мені слід використовувати для створення HTML?" + +msgid "" +"You can find a collection of useful links on the `Web Programming wiki page " +"`_." +msgstr "" +"Ви можете знайти колекцію корисних посилань на `Вікі-сторінці веб-" +"програмування `_." + +msgid "How do I send mail from a Python script?" +msgstr "Як надіслати пошту за допомогою сценарію Python?" + +msgid "Use the standard library module :mod:`smtplib`." +msgstr "Використовуйте стандартний бібліотечний модуль :mod:`smtplib`." + +msgid "" +"Here's a very simple interactive mail sender that uses it. This method will " +"work on any host that supports an SMTP listener. ::" +msgstr "" +"Ось дуже простий інтерактивний відправник пошти, який його використовує. Цей " +"метод працюватиме на будь-якому хості, який підтримує прослуховувач SMTP. ::" + +msgid "" +"import sys, smtplib\n" +"\n" +"fromaddr = input(\"From: \")\n" +"toaddrs = input(\"To: \").split(',')\n" +"print(\"Enter message, end with ^D:\")\n" +"msg = ''\n" +"while True:\n" +" line = sys.stdin.readline()\n" +" if not line:\n" +" break\n" +" msg += line\n" +"\n" +"# The actual mail send\n" +"server = smtplib.SMTP('localhost')\n" +"server.sendmail(fromaddr, toaddrs, msg)\n" +"server.quit()" +msgstr "" + +msgid "" +"A Unix-only alternative uses sendmail. The location of the sendmail program " +"varies between systems; sometimes it is ``/usr/lib/sendmail``, sometimes ``/" +"usr/sbin/sendmail``. The sendmail manual page will help you out. Here's " +"some sample code::" +msgstr "" +"Альтернатива лише для Unix використовує sendmail. Розташування програми " +"sendmail залежить від системи; іноді це ``/usr/lib/sendmail``, іноді ``/usr/" +"sbin/sendmail``. Довідкова сторінка sendmail допоможе вам. Ось приклад коду::" + +msgid "" +"import os\n" +"\n" +"SENDMAIL = \"/usr/sbin/sendmail\" # sendmail location\n" +"p = os.popen(\"%s -t -i\" % SENDMAIL, \"w\")\n" +"p.write(\"To: receiver@example.com\\n\")\n" +"p.write(\"Subject: test\\n\")\n" +"p.write(\"\\n\") # blank line separating headers from body\n" +"p.write(\"Some text\\n\")\n" +"p.write(\"some more text\\n\")\n" +"sts = p.close()\n" +"if sts != 0:\n" +" print(\"Sendmail exit status\", sts)" +msgstr "" + +msgid "How do I avoid blocking in the connect() method of a socket?" +msgstr "Як уникнути блокування в методі connect() сокета?" + +msgid "" +"The :mod:`select` module is commonly used to help with asynchronous I/O on " +"sockets." +msgstr "" +"Модуль :mod:`select` зазвичай використовується для допомоги з асинхронним " +"введенням/виведенням на сокетах." + +msgid "" +"To prevent the TCP connect from blocking, you can set the socket to non-" +"blocking mode. Then when you do the :meth:`~socket.socket.connect`, you " +"will either connect immediately (unlikely) or get an exception that contains " +"the error number as ``.errno``. ``errno.EINPROGRESS`` indicates that the " +"connection is in progress, but hasn't finished yet. Different OSes will " +"return different values, so you're going to have to check what's returned on " +"your system." +msgstr "" + +msgid "" +"You can use the :meth:`~socket.socket.connect_ex` method to avoid creating " +"an exception. It will just return the errno value. To poll, you can call :" +"meth:`~socket.socket.connect_ex` again later -- ``0`` or ``errno.EISCONN`` " +"indicate that you're connected -- or you can pass this socket to :meth:" +"`select.select` to check if it's writable." +msgstr "" + +msgid "" +"The :mod:`asyncio` module provides a general purpose single-threaded and " +"concurrent asynchronous library, which can be used for writing non-blocking " +"network code. The third-party `Twisted `_ library is a " +"popular and feature-rich alternative." +msgstr "" + +msgid "Databases" +msgstr "Бази даних" + +msgid "Are there any interfaces to database packages in Python?" +msgstr "Чи існують інтерфейси для пакетів баз даних у Python?" + +msgid "Yes." +msgstr "Так." + +msgid "" +"Interfaces to disk-based hashes such as :mod:`DBM ` and :mod:`GDBM " +"` are also included with standard Python. There is also the :mod:" +"`sqlite3` module, which provides a lightweight disk-based relational " +"database." +msgstr "" +"Інтерфейси для дискових хешів, таких як :mod:`DBM ` і :mod:`GDBM " +"`, також включені в стандартний Python. Існує також модуль :mod:" +"`sqlite3`, який забезпечує полегшену дискову реляційну базу даних." + +msgid "" +"Support for most relational databases is available. See the " +"`DatabaseProgramming wiki page `_ for details." +msgstr "" +"Доступна підтримка більшості реляційних баз даних. Перегляньте " +"`DatabaseProgramming вікі-сторінку `_ для отримання додаткової інформації." + +msgid "How do you implement persistent objects in Python?" +msgstr "Як реалізувати постійні об’єкти в Python?" + +msgid "" +"The :mod:`pickle` library module solves this in a very general way (though " +"you still can't store things like open files, sockets or windows), and the :" +"mod:`shelve` library module uses pickle and (g)dbm to create persistent " +"mappings containing arbitrary Python objects." +msgstr "" +"Модуль бібліотеки :mod:`pickle` вирішує це у дуже загальний спосіб (хоча ви " +"все одно не можете зберігати такі речі, як відкриті файли, сокети чи вікна), " +"а модуль бібліотеки :mod:`shelve` використовує pickle і (g) dbm для " +"створення постійних відображень, що містять довільні об’єкти Python." + +msgid "Mathematics and Numerics" +msgstr "Математика та цифри" + +msgid "How do I generate random numbers in Python?" +msgstr "Як генерувати випадкові числа в Python?" + +msgid "" +"The standard module :mod:`random` implements a random number generator. " +"Usage is simple::" +msgstr "" +"Стандартний модуль :mod:`random` реалізує генератор випадкових чисел. " +"Використання просте::" + +msgid "" +"import random\n" +"random.random()" +msgstr "" + +msgid "This returns a random floating-point number in the range [0, 1)." +msgstr "" + +msgid "" +"There are also many other specialized generators in this module, such as:" +msgstr "" +"У цьому модулі також є багато інших спеціалізованих генераторів, таких як:" + +msgid "``randrange(a, b)`` chooses an integer in the range [a, b)." +msgstr "``randrange(a, b)`` вибирає ціле число в діапазоні [a, b)." + +msgid "``uniform(a, b)`` chooses a floating-point number in the range [a, b)." +msgstr "" + +msgid "" +"``normalvariate(mean, sdev)`` samples the normal (Gaussian) distribution." +msgstr "" +"``normalvariate(mean, sdev)`` вибірка нормального (гауссового) розподілу." + +msgid "Some higher-level functions operate on sequences directly, such as:" +msgstr "" +"Деякі функції вищого рівня працюють безпосередньо з послідовностями, " +"наприклад:" + +msgid "``choice(S)`` chooses a random element from a given sequence." +msgstr "``choice(S)`` вибирає випадковий елемент із заданої послідовності." + +msgid "``shuffle(L)`` shuffles a list in-place, i.e. permutes it randomly." +msgstr "" +"``shuffle(L)`` перемішує список на місці, тобто переставляє його випадковим " +"чином." + +msgid "" +"There's also a ``Random`` class you can instantiate to create independent " +"multiple random number generators." +msgstr "" +"Існує також клас ``Random``, який можна створити для створення незалежних " +"кількох генераторів випадкових чисел." diff --git a/faq/programming.po b/faq/programming.po new file mode 100644 index 000000000..52afb58d6 --- /dev/null +++ b/faq/programming.po @@ -0,0 +1,3545 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2023 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:52+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2023\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Programming FAQ" +msgstr "FAQ з програмування" + +msgid "Contents" +msgstr "Зміст" + +msgid "General Questions" +msgstr "Загальні питання" + +msgid "" +"Is there a source code level debugger with breakpoints, single-stepping, " +"etc.?" +msgstr "" +"Чи існує налагоджувач рівня вихідного коду з точками зупинки, однокроковим " +"режимом тощо?" + +msgid "Yes." +msgstr "Так." + +msgid "" +"Several debuggers for Python are described below, and the built-in function :" +"func:`breakpoint` allows you to drop into any of them." +msgstr "" +"Нижче описано кілька налагоджувачів для Python, і вбудована функція :func:" +"`breakpoint` дозволяє вам перейти до будь-якого з них." + +msgid "" +"The pdb module is a simple but adequate console-mode debugger for Python. It " +"is part of the standard Python library, and is :mod:`documented in the " +"Library Reference Manual `. You can also write your own debugger by " +"using the code for pdb as an example." +msgstr "" +"Модуль pdb — це простий, але адекватний налагоджувач у консольному режимі " +"для Python. Це частина стандартної бібліотеки Python і :mod:`задокументована " +"в Library Reference Manual `. Ви також можете написати власний " +"налагоджувач, використовуючи код для pdb як приклад." + +msgid "" +"The IDLE interactive development environment, which is part of the standard " +"Python distribution (normally available as `Tools/scripts/idle3 `_), includes a " +"graphical debugger." +msgstr "" + +msgid "" +"PythonWin is a Python IDE that includes a GUI debugger based on pdb. The " +"PythonWin debugger colors breakpoints and has quite a few cool features such " +"as debugging non-PythonWin programs. PythonWin is available as part of " +"`pywin32 `_ project and as a part of " +"the `ActivePython `_ " +"distribution." +msgstr "" +"PythonWin — це середовище розробки Python, яке містить налагоджувач " +"графічного інтерфейсу на основі pdb. Налагоджувач PythonWin забарвлює точки " +"зупину та має чимало цікавих функцій, таких як налагодження програм, які не " +"належать до PythonWin. PythonWin доступний як частина проекту `pywin32 " +"`_ і як частина дистрибутива " +"`ActivePython `_." + +msgid "" +"`Eric `_ is an IDE built on PyQt and " +"the Scintilla editing component." +msgstr "" + +msgid "" +"`trepan3k `_ is a gdb-like " +"debugger." +msgstr "" +"`trepan3k `_ є gdb-подібним " +"налагоджувачем." + +msgid "" +"`Visual Studio Code `_ is an IDE with " +"debugging tools that integrates with version-control software." +msgstr "" +"`Visual Studio Code `_ — це середовище " +"розробки з інструментами налагодження, яке інтегрується з програмним " +"забезпеченням для керування версіями." + +msgid "" +"There are a number of commercial Python IDEs that include graphical " +"debuggers. They include:" +msgstr "" +"Існує кілька комерційних Python IDE, які містять графічні налагоджувачі. " +"Вони включають:" + +msgid "`Wing IDE `_" +msgstr "`Wing IDE `_" + +msgid "`Komodo IDE `_" +msgstr "`Komodo IDE `_" + +msgid "`PyCharm `_" +msgstr "`PyCharm `_" + +msgid "Are there tools to help find bugs or perform static analysis?" +msgstr "" +"Чи існують інструменти, які допомагають знайти помилки або виконати " +"статичний аналіз?" + +msgid "" +"`Pylint `_ and `Pyflakes " +"`_ do basic checking that will help you " +"catch bugs sooner." +msgstr "" + +msgid "" +"Static type checkers such as `Mypy `_, `Pyre " +"`_, and `Pytype `_ can check type hints in Python source code." +msgstr "" + +msgid "How can I create a stand-alone binary from a Python script?" +msgstr "Як я можу створити автономний двійковий файл зі сценарію Python?" + +msgid "" +"You don't need the ability to compile Python to C code if all you want is a " +"stand-alone program that users can download and run without having to " +"install the Python distribution first. There are a number of tools that " +"determine the set of modules required by a program and bind these modules " +"together with a Python binary to produce a single executable." +msgstr "" +"Вам не потрібна можливість компілювати код Python до C, якщо все, що вам " +"потрібно, це окрема програма, яку користувачі можуть завантажити та " +"запустити без попередньої інсталяції дистрибутива Python. Існує ряд " +"інструментів, які визначають набір модулів, необхідних для програми, і " +"зв’язують ці модулі з двійковим файлом Python для створення єдиного " +"виконуваного файлу." + +msgid "" +"One is to use the freeze tool, which is included in the Python source tree " +"as `Tools/freeze `_. It converts Python byte code to C arrays; with a C compiler you " +"can embed all your modules into a new program, which is then linked with the " +"standard Python modules." +msgstr "" + +msgid "" +"It works by scanning your source recursively for import statements (in both " +"forms) and looking for the modules in the standard Python path as well as in " +"the source directory (for built-in modules). It then turns the bytecode for " +"modules written in Python into C code (array initializers that can be turned " +"into code objects using the marshal module) and creates a custom-made config " +"file that only contains those built-in modules which are actually used in " +"the program. It then compiles the generated C code and links it with the " +"rest of the Python interpreter to form a self-contained binary which acts " +"exactly like your script." +msgstr "" +"Він працює шляхом рекурсивного сканування джерела на наявність інструкцій " +"імпорту (в обох формах) і пошуку модулів у стандартному шляху Python, а " +"також у вихідному каталозі (для вбудованих модулів). Потім він перетворює " +"байт-код для модулів, написаних на Python, у код C (ініціалізатори масивів, " +"які можна перетворити на об’єкти коду за допомогою модуля marshal) і створює " +"спеціальний файл конфігурації, який містить лише ті вбудовані модулі, які " +"фактично використовуються в програма. Потім він компілює згенерований код C " +"і пов’язує його з рештою інтерпретатора Python, щоб сформувати самодостатній " +"двійковий файл, який діє точно так само, як ваш сценарій." + +msgid "" +"The following packages can help with the creation of console and GUI " +"executables:" +msgstr "" +"Наступні пакети можуть допомогти зі створенням консолі та виконуваних файлів " +"графічного інтерфейсу користувача:" + +msgid "`Nuitka `_ (Cross-platform)" +msgstr "`Nuitka `_ (Кросплатформенний)" + +msgid "`PyInstaller `_ (Cross-platform)" +msgstr "" + +msgid "" +"`PyOxidizer `_ (Cross-platform)" +msgstr "" +"`PyOxidizer `_ " +"(Кросплатформенний)" + +msgid "" +"`cx_Freeze `_ (Cross-platform)" +msgstr "" +"`cx_Freeze `_ " +"(Кросплатформенний)" + +msgid "`py2app `_ (macOS only)" +msgstr "`py2app `_ (лише для macOS)" + +msgid "`py2exe `_ (Windows only)" +msgstr "" + +msgid "Are there coding standards or a style guide for Python programs?" +msgstr "" +"Чи існують стандарти кодування чи керівництво по стилю для програм Python?" + +msgid "" +"Yes. The coding style required for standard library modules is documented " +"as :pep:`8`." +msgstr "" +"Так. Стиль кодування, необхідний для модулів стандартної бібліотеки, " +"задокументовано як :pep:`8`." + +msgid "Core Language" +msgstr "Основна мова" + +msgid "Why am I getting an UnboundLocalError when the variable has a value?" +msgstr "Чому я отримую помилку UnboundLocalError, коли змінна має значення?" + +msgid "" +"It can be a surprise to get the :exc:`UnboundLocalError` in previously " +"working code when it is modified by adding an assignment statement somewhere " +"in the body of a function." +msgstr "" + +msgid "This code:" +msgstr "Цей код:" + +msgid "works, but this code:" +msgstr "працює, але цей код:" + +msgid "results in an :exc:`!UnboundLocalError`:" +msgstr "" + +msgid "" +"This is because when you make an assignment to a variable in a scope, that " +"variable becomes local to that scope and shadows any similarly named " +"variable in the outer scope. Since the last statement in foo assigns a new " +"value to ``x``, the compiler recognizes it as a local variable. " +"Consequently when the earlier ``print(x)`` attempts to print the " +"uninitialized local variable and an error results." +msgstr "" +"Це пояснюється тим, що коли ви робите призначення змінній в області " +"видимості, ця змінна стає локальною для цієї області і затьмарює будь-яку " +"змінну з подібним іменем у зовнішній області. Оскільки останній оператор у " +"foo присвоює нове значення ``x``, компілятор розпізнає його як локальну " +"змінну. Отже, коли попередній ``print(x)`` намагається надрукувати " +"неініціалізовану локальну змінну, виникає помилка." + +msgid "" +"In the example above you can access the outer scope variable by declaring it " +"global:" +msgstr "" +"У наведеному вище прикладі ви можете отримати доступ до зовнішньої змінної " +"області видимості, оголосивши її глобальною:" + +msgid "" +"This explicit declaration is required in order to remind you that (unlike " +"the superficially analogous situation with class and instance variables) you " +"are actually modifying the value of the variable in the outer scope:" +msgstr "" +"Ця явна декларація потрібна, щоб нагадати вам, що (на відміну від зовнішньо " +"аналогічної ситуації зі змінними класу та екземпляра) ви фактично змінюєте " +"значення змінної у зовнішній області:" + +msgid "" +"You can do a similar thing in a nested scope using the :keyword:`nonlocal` " +"keyword:" +msgstr "" +"Ви можете зробити подібне у вкладеній області, використовуючи ключове слово :" +"keyword:`nonlocal`:" + +msgid "What are the rules for local and global variables in Python?" +msgstr "Які правила для локальних і глобальних змінних у Python?" + +msgid "" +"In Python, variables that are only referenced inside a function are " +"implicitly global. If a variable is assigned a value anywhere within the " +"function's body, it's assumed to be a local unless explicitly declared as " +"global." +msgstr "" +"У Python змінні, на які посилаються лише всередині функції, є неявно " +"глобальними. Якщо змінній присвоєно значення будь-де в тілі функції, вона " +"вважається локальною, якщо вона явно не оголошена як глобальна." + +msgid "" +"Though a bit surprising at first, a moment's consideration explains this. " +"On one hand, requiring :keyword:`global` for assigned variables provides a " +"bar against unintended side-effects. On the other hand, if ``global`` was " +"required for all global references, you'd be using ``global`` all the time. " +"You'd have to declare as global every reference to a built-in function or to " +"a component of an imported module. This clutter would defeat the usefulness " +"of the ``global`` declaration for identifying side-effects." +msgstr "" +"Хоча це трохи дивно спочатку, мить міркування пояснює це. З одного боку, " +"вимога :keyword:`global` для призначених змінних забезпечує захист від " +"ненавмисних побічних ефектів. З іншого боку, якби ``global`` був потрібний " +"для всіх глобальних посилань, ви б використовували ``global`` весь час. Ви " +"повинні оголосити як глобальне кожне посилання на вбудовану функцію або на " +"компонент імпортованого модуля. Цей безлад перекреслив би корисність " +"оголошення ``global`` для визначення побічних ефектів." + +msgid "" +"Why do lambdas defined in a loop with different values all return the same " +"result?" +msgstr "" +"Чому всі лямбда-вирази, визначені в циклі з різними значеннями, повертають " +"однаковий результат?" + +msgid "" +"Assume you use a for loop to define a few different lambdas (or even plain " +"functions), e.g.::" +msgstr "" +"Припустімо, що ви використовуєте цикл for для визначення кількох різних " +"лямбда-виразів (або навіть простих функцій), наприклад::" + +msgid "" +">>> squares = []\n" +">>> for x in range(5):\n" +"... squares.append(lambda: x**2)" +msgstr "" + +msgid "" +"This gives you a list that contains 5 lambdas that calculate ``x**2``. You " +"might expect that, when called, they would return, respectively, ``0``, " +"``1``, ``4``, ``9``, and ``16``. However, when you actually try you will " +"see that they all return ``16``::" +msgstr "" +"Це дає вам список, який містить 5 лямбда-виразів, які обчислюють ``x**2``. " +"Можна очікувати, що під час виклику вони повертатимуть, відповідно, ``0``, " +"``1``, ``4``, ``9`` і ``16``. Однак, коли ви насправді спробуєте, ви " +"побачите, що всі вони повертають ``16``::" + +msgid "" +">>> squares[2]()\n" +"16\n" +">>> squares[4]()\n" +"16" +msgstr "" + +msgid "" +"This happens because ``x`` is not local to the lambdas, but is defined in " +"the outer scope, and it is accessed when the lambda is called --- not when " +"it is defined. At the end of the loop, the value of ``x`` is ``4``, so all " +"the functions now return ``4**2``, i.e. ``16``. You can also verify this by " +"changing the value of ``x`` and see how the results of the lambdas change::" +msgstr "" +"Це відбувається тому, що ``x`` не є локальним для лямбда-вираз, а визначено " +"у зовнішній області видимості, і доступ до нього здійснюється під час " +"виклику лямбда-виразки --- а не тоді, коли вона визначена. Наприкінці циклу " +"значення ``x`` дорівнює ``4``, тому всі функції тепер повертають ``4**2``, " +"тобто ``16``. Ви також можете перевірити це, змінивши значення ``x`` і " +"подивившись, як змінюються результати лямбда-виражень:" + +msgid "" +">>> x = 8\n" +">>> squares[2]()\n" +"64" +msgstr "" + +msgid "" +"In order to avoid this, you need to save the values in variables local to " +"the lambdas, so that they don't rely on the value of the global ``x``::" +msgstr "" +"Щоб уникнути цього, вам потрібно зберегти значення в змінних, локальних для " +"лямбда-виразів, щоб вони не покладалися на значення глобального ``x``::" + +msgid "" +">>> squares = []\n" +">>> for x in range(5):\n" +"... squares.append(lambda n=x: n**2)" +msgstr "" + +msgid "" +"Here, ``n=x`` creates a new variable ``n`` local to the lambda and computed " +"when the lambda is defined so that it has the same value that ``x`` had at " +"that point in the loop. This means that the value of ``n`` will be ``0`` in " +"the first lambda, ``1`` in the second, ``2`` in the third, and so on. " +"Therefore each lambda will now return the correct result::" +msgstr "" +"Тут ``n=x`` створює нову змінну ``n``, локальну для лямбда-виразу, яка " +"обчислюється, коли лямбда-визначення визначено таким чином, щоб воно мало те " +"саме значення, яке ``x`` мав у цій точці циклу. Це означає, що значення " +"``n`` буде ``0`` у першому лямбда, ``1`` у другому, ``2`` у третьому, і так " +"далі. Тому кожна лямбда тепер повертатиме правильний результат::" + +msgid "" +">>> squares[2]()\n" +"4\n" +">>> squares[4]()\n" +"16" +msgstr "" + +msgid "" +"Note that this behaviour is not peculiar to lambdas, but applies to regular " +"functions too." +msgstr "" +"Зауважте, що ця поведінка не властива лямбда-виразам, але також стосується " +"звичайних функцій." + +msgid "How do I share global variables across modules?" +msgstr "Як поділитися глобальними змінними між модулями?" + +msgid "" +"The canonical way to share information across modules within a single " +"program is to create a special module (often called config or cfg). Just " +"import the config module in all modules of your application; the module then " +"becomes available as a global name. Because there is only one instance of " +"each module, any changes made to the module object get reflected " +"everywhere. For example:" +msgstr "" +"Канонічний спосіб обміну інформацією між модулями в одній програмі полягає у " +"створенні спеціального модуля (часто називається config або cfg). Просто " +"імпортуйте модуль конфігурації в усі модулі вашої програми; потім модуль " +"стає доступним як глобальне ім'я. Оскільки існує лише один екземпляр кожного " +"модуля, будь-які зміни, внесені до об’єкта модуля, відображаються всюди. " +"Наприклад:" + +msgid "config.py::" +msgstr "config.py::" + +msgid "x = 0 # Default value of the 'x' configuration setting" +msgstr "" + +msgid "mod.py::" +msgstr "mod.py::" + +msgid "" +"import config\n" +"config.x = 1" +msgstr "" + +msgid "main.py::" +msgstr "main.py::" + +msgid "" +"import config\n" +"import mod\n" +"print(config.x)" +msgstr "" + +msgid "" +"Note that using a module is also the basis for implementing the singleton " +"design pattern, for the same reason." +msgstr "" + +msgid "What are the \"best practices\" for using import in a module?" +msgstr "Які \"найкращі практики\" використання імпорту в модулі?" + +msgid "" +"In general, don't use ``from modulename import *``. Doing so clutters the " +"importer's namespace, and makes it much harder for linters to detect " +"undefined names." +msgstr "" +"Загалом, не використовуйте ``from modulename import *``. Це захаращує " +"простір імен імпортера, і значно ускладнює для лінтерів виявлення " +"невизначених імен." + +msgid "" +"Import modules at the top of a file. Doing so makes it clear what other " +"modules your code requires and avoids questions of whether the module name " +"is in scope. Using one import per line makes it easy to add and delete " +"module imports, but using multiple imports per line uses less screen space." +msgstr "" +"Імпорт модулів у верхній частині файлу. Це дає зрозуміти, які інші модулі " +"вимагає ваш код, і уникає запитань про те, чи входить ім’я модуля в область " +"видимості. Використання одного імпорту на рядок полегшує додавання та " +"видалення імпортованих модулів, але використання кількох імпортів на рядок " +"займає менше місця на екрані." + +msgid "It's good practice if you import modules in the following order:" +msgstr "Доцільно імпортувати модулі в такому порядку:" + +msgid "" +"standard library modules -- e.g. :mod:`sys`, :mod:`os`, :mod:`argparse`, :" +"mod:`re`" +msgstr "" + +msgid "" +"third-party library modules (anything installed in Python's site-packages " +"directory) -- e.g. :mod:`!dateutil`, :mod:`!requests`, :mod:`!PIL.Image`" +msgstr "" + +msgid "locally developed modules" +msgstr "" + +msgid "" +"It is sometimes necessary to move imports to a function or class to avoid " +"problems with circular imports. Gordon McMillan says:" +msgstr "" +"Іноді необхідно перемістити імпорт до функції чи класу, щоб уникнути проблем " +"із циклічним імпортом. Гордон Макміллан каже:" + +msgid "" +"Circular imports are fine where both modules use the \"import \" " +"form of import. They fail when the 2nd module wants to grab a name out of " +"the first (\"from module import name\") and the import is at the top level. " +"That's because names in the 1st are not yet available, because the first " +"module is busy importing the 2nd." +msgstr "" +"Циклічний імпорт підходить, якщо обидва модулі використовують форму імпорту " +"\"import \". Вони зазнають невдачі, коли 2-й модуль хоче отримати " +"ім’я з першого (\"з імені імпорту модуля\"), а імпорт здійснюється на " +"верхньому рівні. Це тому, що імена в 1-му ще недоступні, оскільки перший " +"модуль зайнятий імпортом 2-го." + +msgid "" +"In this case, if the second module is only used in one function, then the " +"import can easily be moved into that function. By the time the import is " +"called, the first module will have finished initializing, and the second " +"module can do its import." +msgstr "" +"У цьому випадку, якщо другий модуль використовується лише в одній функції, " +"імпорт можна легко перемістити в цю функцію. До моменту виклику імпорту " +"перший модуль завершить ініціалізацію, і другий модуль зможе виконувати свій " +"імпорт." + +msgid "" +"It may also be necessary to move imports out of the top level of code if " +"some of the modules are platform-specific. In that case, it may not even be " +"possible to import all of the modules at the top of the file. In this case, " +"importing the correct modules in the corresponding platform-specific code is " +"a good option." +msgstr "" +"Також може знадобитися перемістити імпорт із верхнього рівня коду, якщо " +"деякі модулі залежать від платформи. У цьому випадку може бути навіть " +"неможливо імпортувати всі модулі у верхній частині файлу. У цьому випадку " +"хорошим варіантом є імпорт правильних модулів у відповідний специфічний для " +"платформи код." + +msgid "" +"Only move imports into a local scope, such as inside a function definition, " +"if it's necessary to solve a problem such as avoiding a circular import or " +"are trying to reduce the initialization time of a module. This technique is " +"especially helpful if many of the imports are unnecessary depending on how " +"the program executes. You may also want to move imports into a function if " +"the modules are only ever used in that function. Note that loading a module " +"the first time may be expensive because of the one time initialization of " +"the module, but loading a module multiple times is virtually free, costing " +"only a couple of dictionary lookups. Even if the module name has gone out " +"of scope, the module is probably available in :data:`sys.modules`." +msgstr "" +"Переміщуйте імпорт у локальну область, наприклад, у визначення функції, лише " +"якщо це необхідно для вирішення проблеми, як-от уникнення циклічного імпорту " +"або намагання скоротити час ініціалізації модуля. Ця техніка особливо " +"корисна, якщо багато імпортів непотрібні залежно від того, як виконується " +"програма. Ви також можете перемістити імпорт у функцію, якщо модулі " +"використовуються лише в цій функції. Зауважте, що завантаження модуля вперше " +"може бути дорогим через одноразову ініціалізацію модуля, але багаторазове " +"завантаження модуля практично безкоштовне, коштуючи лише кількох пошуків у " +"словнику. Навіть якщо назва модуля вийшла за межі видимості, модуль, " +"імовірно, доступний у :data:`sys.modules`." + +msgid "Why are default values shared between objects?" +msgstr "Чому значення за замовчуванням є спільними між об’єктами?" + +msgid "" +"This type of bug commonly bites neophyte programmers. Consider this " +"function::" +msgstr "" +"Цей тип помилок зазвичай кусає програмістів-неофітів. Розглянемо цю функцію::" + +msgid "" +"def foo(mydict={}): # Danger: shared reference to one dict for all calls\n" +" ... compute something ...\n" +" mydict[key] = value\n" +" return mydict" +msgstr "" + +msgid "" +"The first time you call this function, ``mydict`` contains a single item. " +"The second time, ``mydict`` contains two items because when ``foo()`` begins " +"executing, ``mydict`` starts out with an item already in it." +msgstr "" +"Під час першого виклику цієї функції ``mydict`` містить один елемент. " +"Другого разу ``mydict`` містить два елементи, тому що коли ``foo()`` починає " +"виконуватися, ``mydict`` починає з елементом, який уже є в ньому." + +msgid "" +"It is often expected that a function call creates new objects for default " +"values. This is not what happens. Default values are created exactly once, " +"when the function is defined. If that object is changed, like the " +"dictionary in this example, subsequent calls to the function will refer to " +"this changed object." +msgstr "" +"Часто очікується, що виклик функції створює нові об’єкти для значень за " +"замовчуванням. Такого не буває. Значення за замовчуванням створюються рівно " +"один раз під час визначення функції. Якщо цей об’єкт змінено, як і словник у " +"цьому прикладі, наступні виклики функції посилатимуться на цей змінений " +"об’єкт." + +msgid "" +"By definition, immutable objects such as numbers, strings, tuples, and " +"``None``, are safe from change. Changes to mutable objects such as " +"dictionaries, lists, and class instances can lead to confusion." +msgstr "" +"За визначенням, незмінні об’єкти, такі як числа, рядки, кортежі та ``None``, " +"захищені від змін. Зміни змінних об’єктів, таких як словники, списки та " +"екземпляри класів, можуть призвести до плутанини." + +msgid "" +"Because of this feature, it is good programming practice to not use mutable " +"objects as default values. Instead, use ``None`` as the default value and " +"inside the function, check if the parameter is ``None`` and create a new " +"list/dictionary/whatever if it is. For example, don't write::" +msgstr "" +"Через цю функцію хороша практика програмування не використовувати змінні " +"об’єкти як значення за замовчуванням. Натомість використовуйте ``None`` як " +"значення за замовчуванням і всередині функції перевірте, чи параметр " +"``None``, і створіть новий список/словник/що завгодно, якщо він є. " +"Наприклад, не пишіть::" + +msgid "" +"def foo(mydict={}):\n" +" ..." +msgstr "" + +msgid "but::" +msgstr "але ::" + +msgid "" +"def foo(mydict=None):\n" +" if mydict is None:\n" +" mydict = {} # create a new dict for local namespace" +msgstr "" + +msgid "" +"This feature can be useful. When you have a function that's time-consuming " +"to compute, a common technique is to cache the parameters and the resulting " +"value of each call to the function, and return the cached value if the same " +"value is requested again. This is called \"memoizing\", and can be " +"implemented like this::" +msgstr "" +"Ця функція може бути корисною. Якщо у вас є функція, обчислення якої " +"потребує багато часу, поширеною технікою є кешування параметрів і " +"результуючого значення кожного виклику функції та повернення кешованого " +"значення, якщо те саме значення запитується знову. Це називається " +"\"запам'ятовування\" і може бути реалізовано так:" + +msgid "" +"# Callers can only provide two parameters and optionally pass _cache by " +"keyword\n" +"def expensive(arg1, arg2, *, _cache={}):\n" +" if (arg1, arg2) in _cache:\n" +" return _cache[(arg1, arg2)]\n" +"\n" +" # Calculate the value\n" +" result = ... expensive computation ...\n" +" _cache[(arg1, arg2)] = result # Store result in the cache\n" +" return result" +msgstr "" + +msgid "" +"You could use a global variable containing a dictionary instead of the " +"default value; it's a matter of taste." +msgstr "" +"Ви можете використовувати глобальну змінну, що містить словник, замість " +"значення за замовчуванням; це справа смаку." + +msgid "" +"How can I pass optional or keyword parameters from one function to another?" +msgstr "" +"Як я можу передати необов’язкові або ключові параметри з однієї функції в " +"іншу?" + +msgid "" +"Collect the arguments using the ``*`` and ``**`` specifiers in the " +"function's parameter list; this gives you the positional arguments as a " +"tuple and the keyword arguments as a dictionary. You can then pass these " +"arguments when calling another function by using ``*`` and ``**``::" +msgstr "" +"Зберіть аргументи за допомогою специфікаторів ``*`` і ``**`` у списку " +"параметрів функції; це дає вам позиційні аргументи як кортеж і ключові " +"аргументи як словник. Потім ви можете передати ці аргументи під час виклику " +"іншої функції за допомогою ``*`` і ``**``::" + +msgid "" +"def f(x, *args, **kwargs):\n" +" ...\n" +" kwargs['width'] = '14.3c'\n" +" ...\n" +" g(x, *args, **kwargs)" +msgstr "" + +msgid "What is the difference between arguments and parameters?" +msgstr "Яка різниця між аргументами та параметрами?" + +msgid "" +":term:`Parameters ` are defined by the names that appear in a " +"function definition, whereas :term:`arguments ` are the values " +"actually passed to a function when calling it. Parameters define what :term:" +"`kind of arguments ` a function can accept. For example, given " +"the function definition::" +msgstr "" + +msgid "" +"def func(foo, bar=None, **kwargs):\n" +" pass" +msgstr "" + +msgid "" +"*foo*, *bar* and *kwargs* are parameters of ``func``. However, when calling " +"``func``, for example::" +msgstr "" +"*foo*, *bar* і *kwargs* є параметрами ``func``. Однак під час виклику " +"``func``, наприклад::" + +msgid "func(42, bar=314, extra=somevar)" +msgstr "" + +msgid "the values ``42``, ``314``, and ``somevar`` are arguments." +msgstr "значення ``42``, ``314`` і ``somevar`` є аргументами." + +msgid "Why did changing list 'y' also change list 'x'?" +msgstr "Чому зміна списку 'y' також змінила список 'x'?" + +msgid "If you wrote code like::" +msgstr "Якщо ви написали такий код::" + +msgid "" +">>> x = []\n" +">>> y = x\n" +">>> y.append(10)\n" +">>> y\n" +"[10]\n" +">>> x\n" +"[10]" +msgstr "" + +msgid "" +"you might be wondering why appending an element to ``y`` changed ``x`` too." +msgstr "" +"можливо, вам буде цікаво, чому додавання елемента до ``y`` також змінило " +"``x``." + +msgid "There are two factors that produce this result:" +msgstr "Є два чинники, які призводять до такого результату:" + +msgid "" +"Variables are simply names that refer to objects. Doing ``y = x`` doesn't " +"create a copy of the list -- it creates a new variable ``y`` that refers to " +"the same object ``x`` refers to. This means that there is only one object " +"(the list), and both ``x`` and ``y`` refer to it." +msgstr "" +"Змінні - це просто імена, які посилаються на об'єкти. Виконання ``y = x`` не " +"створює копію списку — воно створює нову змінну ``y``, яка посилається на " +"той самий об’єкт, на який посилається ``x``. Це означає, що є лише один " +"об’єкт (список), і як ``x``, так і ``y`` посилаються на нього." + +msgid "" +"Lists are :term:`mutable`, which means that you can change their content." +msgstr "" +"Списки :term:`mutable`, що означає, що ви можете змінювати їхній вміст." + +msgid "" +"After the call to :meth:`!append`, the content of the mutable object has " +"changed from ``[]`` to ``[10]``. Since both the variables refer to the same " +"object, using either name accesses the modified value ``[10]``." +msgstr "" + +msgid "If we instead assign an immutable object to ``x``::" +msgstr "Якщо натомість ми призначимо незмінний об’єкт ``x``::" + +msgid "" +">>> x = 5 # ints are immutable\n" +">>> y = x\n" +">>> x = x + 1 # 5 can't be mutated, we are creating a new object here\n" +">>> x\n" +"6\n" +">>> y\n" +"5" +msgstr "" + +msgid "" +"we can see that in this case ``x`` and ``y`` are not equal anymore. This is " +"because integers are :term:`immutable`, and when we do ``x = x + 1`` we are " +"not mutating the int ``5`` by incrementing its value; instead, we are " +"creating a new object (the int ``6``) and assigning it to ``x`` (that is, " +"changing which object ``x`` refers to). After this assignment we have two " +"objects (the ints ``6`` and ``5``) and two variables that refer to them " +"(``x`` now refers to ``6`` but ``y`` still refers to ``5``)." +msgstr "" +"ми бачимо, що в цьому випадку ``x`` і ``y`` більше не рівні. Це тому, що " +"цілі числа :term:`immutable`, і коли ми робимо ``x = x + 1``, ми не змінюємо " +"int ``5``, збільшуючи його значення; натомість ми створюємо новий об’єкт " +"(int ``6``) і призначаємо його ``x`` (тобто змінюємо, на який об’єкт " +"посилається ``x``). Після цього призначення ми маємо два об’єкти (цілі ``6`` " +"і ``5``) і дві змінні, які посилаються на них (``x`` тепер посилається на " +"``6``, але ``y`` все ще посилається на ``5``)." + +msgid "" +"Some operations (for example ``y.append(10)`` and ``y.sort()``) mutate the " +"object, whereas superficially similar operations (for example ``y = y + " +"[10]`` and :func:`sorted(y) `) create a new object. In general in " +"Python (and in all cases in the standard library) a method that mutates an " +"object will return ``None`` to help avoid getting the two types of " +"operations confused. So if you mistakenly write ``y.sort()`` thinking it " +"will give you a sorted copy of ``y``, you'll instead end up with ``None``, " +"which will likely cause your program to generate an easily diagnosed error." +msgstr "" + +msgid "" +"However, there is one class of operations where the same operation sometimes " +"has different behaviors with different types: the augmented assignment " +"operators. For example, ``+=`` mutates lists but not tuples or ints " +"(``a_list += [1, 2, 3]`` is equivalent to ``a_list.extend([1, 2, 3])`` and " +"mutates ``a_list``, whereas ``some_tuple += (1, 2, 3)`` and ``some_int += " +"1`` create new objects)." +msgstr "" +"Однак існує один клас операцій, де одна й та сама операція іноді має різну " +"поведінку з різними типами: розширені оператори присвоєння. Наприклад, " +"``+=`` змінює списки, але не кортежі чи цілі (``a_list += [1, 2, 3]`` " +"еквівалентно ``a_list.extend([1, 2, 3])`` і змінює ``a_list``, тоді як " +"``some_tuple += (1, 2, 3)`` і ``some_int += 1`` створюють нові об’єкти)." + +msgid "In other words:" +msgstr "Іншими словами:" + +msgid "" +"If we have a mutable object (:class:`list`, :class:`dict`, :class:`set`, " +"etc.), we can use some specific operations to mutate it and all the " +"variables that refer to it will see the change." +msgstr "" +"Якщо у нас є змінний об’єкт (:class:`list`, :class:`dict`, :class:`set` " +"тощо), ми можемо використати певні операції, щоб змінити його, і всі змінні, " +"які посилаються на нього, будуть побачити зміни." + +msgid "" +"If we have an immutable object (:class:`str`, :class:`int`, :class:`tuple`, " +"etc.), all the variables that refer to it will always see the same value, " +"but operations that transform that value into a new value always return a " +"new object." +msgstr "" +"Якщо у нас є незмінний об’єкт (:class:`str`, :class:`int`, :class:`tuple` " +"тощо), усі змінні, які посилаються на нього, завжди бачитимуть те саме " +"значення, але операції, що перетворюють це значення в нове значення завжди " +"повертає новий об’єкт." + +msgid "" +"If you want to know if two variables refer to the same object or not, you " +"can use the :keyword:`is` operator, or the built-in function :func:`id`." +msgstr "" +"Якщо ви хочете знати, чи дві змінні посилаються на той самий об’єкт, ви " +"можете скористатися оператором :keyword:`is` або вбудованою функцією :func:" +"`id`." + +msgid "How do I write a function with output parameters (call by reference)?" +msgstr "Як написати функцію з вихідними параметрами (виклик за посиланням)?" + +msgid "" +"Remember that arguments are passed by assignment in Python. Since " +"assignment just creates references to objects, there's no alias between an " +"argument name in the caller and callee, and so no call-by-reference per se. " +"You can achieve the desired effect in a number of ways." +msgstr "" +"Пам’ятайте, що в Python аргументи передаються шляхом присвоєння. Оскільки " +"присвоєння лише створює посилання на об’єкти, немає псевдоніма між ім’ям " +"аргументу у викликаючому та викликаному, а тому немає виклику за посиланням " +"як такого. Бажаного ефекту можна досягти кількома способами." + +msgid "By returning a tuple of the results::" +msgstr "Повертаючи кортеж результатів::" + +msgid "" +">>> def func1(a, b):\n" +"... a = 'new-value' # a and b are local names\n" +"... b = b + 1 # assigned to new objects\n" +"... return a, b # return new values\n" +"...\n" +">>> x, y = 'old-value', 99\n" +">>> func1(x, y)\n" +"('new-value', 100)" +msgstr "" + +msgid "This is almost always the clearest solution." +msgstr "Це майже завжди найясніше рішення." + +msgid "" +"By using global variables. This isn't thread-safe, and is not recommended." +msgstr "" +"За допомогою глобальних змінних. Це небезпечно для потоків і не " +"рекомендується." + +msgid "By passing a mutable (changeable in-place) object::" +msgstr "Передаючи змінний (змінний на місці) об’єкт::" + +msgid "" +">>> def func2(a):\n" +"... a[0] = 'new-value' # 'a' references a mutable list\n" +"... a[1] = a[1] + 1 # changes a shared object\n" +"...\n" +">>> args = ['old-value', 99]\n" +">>> func2(args)\n" +">>> args\n" +"['new-value', 100]" +msgstr "" + +msgid "By passing in a dictionary that gets mutated::" +msgstr "Передаючи словник, який мутується::" + +msgid "" +">>> def func3(args):\n" +"... args['a'] = 'new-value' # args is a mutable dictionary\n" +"... args['b'] = args['b'] + 1 # change it in-place\n" +"...\n" +">>> args = {'a': 'old-value', 'b': 99}\n" +">>> func3(args)\n" +">>> args\n" +"{'a': 'new-value', 'b': 100}" +msgstr "" + +msgid "Or bundle up values in a class instance::" +msgstr "Або об'єднайте значення в екземпляр класу::" + +msgid "" +">>> class Namespace:\n" +"... def __init__(self, /, **args):\n" +"... for key, value in args.items():\n" +"... setattr(self, key, value)\n" +"...\n" +">>> def func4(args):\n" +"... args.a = 'new-value' # args is a mutable Namespace\n" +"... args.b = args.b + 1 # change object in-place\n" +"...\n" +">>> args = Namespace(a='old-value', b=99)\n" +">>> func4(args)\n" +">>> vars(args)\n" +"{'a': 'new-value', 'b': 100}" +msgstr "" + +msgid "There's almost never a good reason to get this complicated." +msgstr "Майже ніколи не буває вагомих причин ускладнювати це." + +msgid "Your best choice is to return a tuple containing the multiple results." +msgstr "Ваш найкращий вибір — повернути кортеж, що містить кілька результатів." + +msgid "How do you make a higher order function in Python?" +msgstr "Як створити функцію вищого порядку в Python?" + +msgid "" +"You have two choices: you can use nested scopes or you can use callable " +"objects. For example, suppose you wanted to define ``linear(a,b)`` which " +"returns a function ``f(x)`` that computes the value ``a*x+b``. Using nested " +"scopes::" +msgstr "" +"У вас є два варіанти: ви можете використовувати вкладені області або ви " +"можете використовувати викликані об’єкти. Наприклад, припустімо, що ви " +"хочете визначити ``linear(a,b)``, яка повертає функцію ``f(x)``, яка " +"обчислює значення ``a*x+b``. Використання вкладених областей::" + +msgid "" +"def linear(a, b):\n" +" def result(x):\n" +" return a * x + b\n" +" return result" +msgstr "" + +msgid "Or using a callable object::" +msgstr "Або за допомогою викликаного об'єкта::" + +msgid "" +"class linear:\n" +"\n" +" def __init__(self, a, b):\n" +" self.a, self.b = a, b\n" +"\n" +" def __call__(self, x):\n" +" return self.a * x + self.b" +msgstr "" + +msgid "In both cases, ::" +msgstr "В обох випадках ::" + +msgid "taxes = linear(0.3, 2)" +msgstr "" + +msgid "gives a callable object where ``taxes(10e6) == 0.3 * 10e6 + 2``." +msgstr "дає викликуваний об’єкт, де ``taxes(10e6) == 0,3 * 10e6 + 2``." + +msgid "" +"The callable object approach has the disadvantage that it is a bit slower " +"and results in slightly longer code. However, note that a collection of " +"callables can share their signature via inheritance::" +msgstr "" +"Підхід викликаного об’єкта має той недолік, що він трохи повільніший і " +"призводить до трохи довшого коду. Однак зауважте, що колекція викликів може " +"ділитися своїм підписом через успадкування::" + +msgid "" +"class exponential(linear):\n" +" # __init__ inherited\n" +" def __call__(self, x):\n" +" return self.a * (x ** self.b)" +msgstr "" + +msgid "Object can encapsulate state for several methods::" +msgstr "Об'єкт може інкапсулювати стан кількома методами:" + +msgid "" +"class counter:\n" +"\n" +" value = 0\n" +"\n" +" def set(self, x):\n" +" self.value = x\n" +"\n" +" def up(self):\n" +" self.value = self.value + 1\n" +"\n" +" def down(self):\n" +" self.value = self.value - 1\n" +"\n" +"count = counter()\n" +"inc, dec, reset = count.up, count.down, count.set" +msgstr "" + +msgid "" +"Here ``inc()``, ``dec()`` and ``reset()`` act like functions which share the " +"same counting variable." +msgstr "" +"Тут ``inc()``, ``dec()`` і ``reset()`` діють як функції, які спільно " +"використовують ту саму змінну підрахунку." + +msgid "How do I copy an object in Python?" +msgstr "Як скопіювати об’єкт у Python?" + +msgid "" +"In general, try :func:`copy.copy` or :func:`copy.deepcopy` for the general " +"case. Not all objects can be copied, but most can." +msgstr "" +"Загалом, спробуйте :func:`copy.copy` або :func:`copy.deepcopy` для " +"загального випадку. Не всі об'єкти можна скопіювати, але більшість можна." + +msgid "" +"Some objects can be copied more easily. Dictionaries have a :meth:`~dict." +"copy` method::" +msgstr "" +"Деякі об'єкти можна легше скопіювати. Словники мають метод :meth:`~dict." +"copy`::" + +msgid "newdict = olddict.copy()" +msgstr "" + +msgid "Sequences can be copied by slicing::" +msgstr "Послідовності можна скопіювати шляхом нарізки:" + +msgid "new_l = l[:]" +msgstr "" + +msgid "How can I find the methods or attributes of an object?" +msgstr "Як я можу знайти методи або атрибути об’єкта?" + +msgid "" +"For an instance ``x`` of a user-defined class, :func:`dir(x) ` returns " +"an alphabetized list of the names containing the instance attributes and " +"methods and attributes defined by its class." +msgstr "" + +msgid "How can my code discover the name of an object?" +msgstr "Як мій код може виявити назву об’єкта?" + +msgid "" +"Generally speaking, it can't, because objects don't really have names. " +"Essentially, assignment always binds a name to a value; the same is true of " +"``def`` and ``class`` statements, but in that case the value is a callable. " +"Consider the following code::" +msgstr "" +"Загалом, не може, тому що об’єкти насправді не мають назв. По суті, " +"присвоєння завжди прив’язує ім’я до значення; те саме стосується операторів " +"``def`` і ``class``, але в цьому випадку значення є викликаним. Розглянемо " +"наступний код::" + +msgid "" +">>> class A:\n" +"... pass\n" +"...\n" +">>> B = A\n" +">>> a = B()\n" +">>> b = a\n" +">>> print(b)\n" +"<__main__.A object at 0x16D07CC>\n" +">>> print(a)\n" +"<__main__.A object at 0x16D07CC>" +msgstr "" + +msgid "" +"Arguably the class has a name: even though it is bound to two names and " +"invoked through the name ``B`` the created instance is still reported as an " +"instance of class ``A``. However, it is impossible to say whether the " +"instance's name is ``a`` or ``b``, since both names are bound to the same " +"value." +msgstr "" + +msgid "" +"Generally speaking it should not be necessary for your code to \"know the " +"names\" of particular values. Unless you are deliberately writing " +"introspective programs, this is usually an indication that a change of " +"approach might be beneficial." +msgstr "" +"Взагалі кажучи, вашому коду не потрібно \"знати імена\" певних значень. Якщо " +"ви не навмисне пишете інтроспективні програми, це зазвичай свідчить про те, " +"що зміна підходу може бути корисною." + +msgid "" +"In comp.lang.python, Fredrik Lundh once gave an excellent analogy in answer " +"to this question:" +msgstr "" +"У comp.lang.python Фредрік Лунд якось дав чудову аналогію у відповідь на це " +"запитання:" + +msgid "" +"The same way as you get the name of that cat you found on your porch: the " +"cat (object) itself cannot tell you its name, and it doesn't really care -- " +"so the only way to find out what it's called is to ask all your neighbours " +"(namespaces) if it's their cat (object)..." +msgstr "" +"Так само, як ви отримуєте ім’я того кота, якого знайшли на своєму під’їзді: " +"кіт (об’єкт) сам не може назвати вам своє ім’я, і йому це не дуже важливо, " +"тому єдиний спосіб дізнатися, як його звуть, це запитайте всіх своїх сусідів " +"(простір імен), чи це їхній кіт (об’єкт)..." + +msgid "" +"....and don't be surprised if you'll find that it's known by many names, or " +"no name at all!" +msgstr "" +"....і не дивуйтеся, якщо ви побачите, що він відомий під багатьма іменами " +"або взагалі без назви!" + +msgid "What's up with the comma operator's precedence?" +msgstr "Що трапилося з пріоритетом оператора коми?" + +msgid "Comma is not an operator in Python. Consider this session::" +msgstr "Кома не є оператором у Python. Розгляньте цю сесію::" + +msgid "" +">>> \"a\" in \"b\", \"a\"\n" +"(False, 'a')" +msgstr "" + +msgid "" +"Since the comma is not an operator, but a separator between expressions the " +"above is evaluated as if you had entered::" +msgstr "" +"Оскільки кома є не оператором, а роздільником між виразами, наведене вище " +"оцінюється так, ніби ви ввели::" + +msgid "(\"a\" in \"b\"), \"a\"" +msgstr "" + +msgid "not::" +msgstr "ні ::" + +msgid "\"a\" in (\"b\", \"a\")" +msgstr "" + +msgid "" +"The same is true of the various assignment operators (``=``, ``+=`` etc). " +"They are not truly operators but syntactic delimiters in assignment " +"statements." +msgstr "" +"Те саме стосується різних операторів присвоювання (``=``, ``+=`` тощо). Вони " +"насправді не є операторами, а синтаксичними роздільниками в операторах " +"присвоєння." + +msgid "Is there an equivalent of C's \"?:\" ternary operator?" +msgstr "Чи існує еквівалент потрійного оператора C \"?:\"?" + +msgid "Yes, there is. The syntax is as follows::" +msgstr "Так, є. Синтаксис такий::" + +msgid "" +"[on_true] if [expression] else [on_false]\n" +"\n" +"x, y = 50, 25\n" +"small = x if x < y else y" +msgstr "" + +msgid "" +"Before this syntax was introduced in Python 2.5, a common idiom was to use " +"logical operators::" +msgstr "" +"До появи цього синтаксису в Python 2.5 поширеною ідіомою було використання " +"логічних операторів::" + +msgid "[expression] and [on_true] or [on_false]" +msgstr "" + +msgid "" +"However, this idiom is unsafe, as it can give wrong results when *on_true* " +"has a false boolean value. Therefore, it is always better to use the ``... " +"if ... else ...`` form." +msgstr "" +"Однак ця ідіома небезпечна, оскільки може дати неправильні результати, якщо " +"*on_true* має хибне логічне значення. Тому завжди краще використовувати " +"форму ``... if ... else ...``." + +msgid "Is it possible to write obfuscated one-liners in Python?" +msgstr "Чи можна написати обфусковані однорядкові тексти на Python?" + +msgid "" +"Yes. Usually this is done by nesting :keyword:`lambda` within :keyword:`!" +"lambda`. See the following three examples, slightly adapted from Ulf " +"Bartelt::" +msgstr "" + +msgid "" +"from functools import reduce\n" +"\n" +"# Primes < 1000\n" +"print(list(filter(None,map(lambda y:y*reduce(lambda x,y:x*y!=0,\n" +"map(lambda x,y=y:y%x,range(2,int(pow(y,0.5)+1))),1),range(2,1000)))))\n" +"\n" +"# First 10 Fibonacci numbers\n" +"print(list(map(lambda x,f=lambda x,f:(f(x-1,f)+f(x-2,f)) if x>1 else 1:\n" +"f(x,f), range(10))))\n" +"\n" +"# Mandelbrot set\n" +"print((lambda Ru,Ro,Iu,Io,IM,Sx,Sy:reduce(lambda x,y:x+'\\n'+y,map(lambda " +"y,\n" +"Iu=Iu,Io=Io,Ru=Ru,Ro=Ro,Sy=Sy,L=lambda yc,Iu=Iu,Io=Io,Ru=Ru,Ro=Ro,i=IM,\n" +"Sx=Sx,Sy=Sy:reduce(lambda x,y:x+y,map(lambda x,xc=Ru,yc=yc,Ru=Ru,Ro=Ro,\n" +"i=i,Sx=Sx,F=lambda xc,yc,x,y,k,f=lambda xc,yc,x,y,k,f:(k<=0)or (x*x+y*y\n" +">=4.0) or 1+f(xc,yc,x*x-y*y+xc,2.0*x*y+yc,k-1,f):f(xc,yc,x,y,k,f):chr(\n" +"64+F(Ru+x*(Ro-Ru)/Sx,yc,0,0,i)),range(Sx))):L(Iu+y*(Io-Iu)/Sy),range(Sy\n" +"))))(-2.1, 0.7, -1.2, 1.2, 30, 80, 24))\n" +"# \\___ ___/ \\___ ___/ | | |__ lines on screen\n" +"# V V | |______ columns on screen\n" +"# | | |__________ maximum of \"iterations\"\n" +"# | |_________________ range on y axis\n" +"# |____________________________ range on x axis" +msgstr "" + +msgid "Don't try this at home, kids!" +msgstr "Не пробуйте цього вдома, діти!" + +msgid "What does the slash(/) in the parameter list of a function mean?" +msgstr "Що означає коса риска (/) у списку параметрів функції?" + +msgid "" +"A slash in the argument list of a function denotes that the parameters prior " +"to it are positional-only. Positional-only parameters are the ones without " +"an externally usable name. Upon calling a function that accepts positional-" +"only parameters, arguments are mapped to parameters based solely on their " +"position. For example, :func:`divmod` is a function that accepts positional-" +"only parameters. Its documentation looks like this::" +msgstr "" + +msgid "" +">>> help(divmod)\n" +"Help on built-in function divmod in module builtins:\n" +"\n" +"divmod(x, y, /)\n" +" Return the tuple (x//y, x%y). Invariant: div*y + mod == x." +msgstr "" + +msgid "" +"The slash at the end of the parameter list means that both parameters are " +"positional-only. Thus, calling :func:`divmod` with keyword arguments would " +"lead to an error::" +msgstr "" +"Слеш у кінці списку параметрів означає, що обидва параметри є лише " +"позиційними. Таким чином, виклик :func:`divmod` з ключовими аргументами " +"призведе до помилки::" + +msgid "" +">>> divmod(x=3, y=4)\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"TypeError: divmod() takes no keyword arguments" +msgstr "" + +msgid "Numbers and strings" +msgstr "Числа та рядки" + +msgid "How do I specify hexadecimal and octal integers?" +msgstr "Як вказати шістнадцяткові та вісімкові цілі числа?" + +msgid "" +"To specify an octal digit, precede the octal value with a zero, and then a " +"lower or uppercase \"o\". For example, to set the variable \"a\" to the " +"octal value \"10\" (8 in decimal), type::" +msgstr "" +"Щоб вказати вісімкову цифру, поставте перед вісімковим значенням нуль, а " +"потім малу або велику літеру \"o\". Наприклад, щоб встановити змінну \"a\" у " +"вісімкове значення \"10\" (8 у десятковій системі), введіть::" + +msgid "" +">>> a = 0o10\n" +">>> a\n" +"8" +msgstr "" + +msgid "" +"Hexadecimal is just as easy. Simply precede the hexadecimal number with a " +"zero, and then a lower or uppercase \"x\". Hexadecimal digits can be " +"specified in lower or uppercase. For example, in the Python interpreter::" +msgstr "" +"Шістнадцяткове так само легко. Просто поставте перед шістнадцятковим числом " +"нуль, а потім малий або великий регістр \"x\". Шістнадцяткові цифри можна " +"вказувати як у нижньому, так і у верхньому регістрі. Наприклад, в " +"інтерпретаторі Python::" + +msgid "" +">>> a = 0xa5\n" +">>> a\n" +"165\n" +">>> b = 0XB2\n" +">>> b\n" +"178" +msgstr "" + +msgid "Why does -22 // 10 return -3?" +msgstr "Чому -22 // 10 повертає -3?" + +msgid "" +"It's primarily driven by the desire that ``i % j`` have the same sign as " +"``j``. If you want that, and also want::" +msgstr "" +"Головним чином це зумовлено бажанням, щоб ``i % j`` мав той самий знак, що " +"``j``. Якщо ви цього хочете, а також хочете::" + +msgid "i == (i // j) * j + (i % j)" +msgstr "" + +msgid "" +"then integer division has to return the floor. C also requires that " +"identity to hold, and then compilers that truncate ``i // j`` need to make " +"``i % j`` have the same sign as ``i``." +msgstr "" +"тоді цілочисельне ділення має повернути підлогу. C також вимагає збереження " +"цієї ідентичності, а потім компіляторам, які скорочують ``i // j``, потрібно " +"зробити так, щоб ``i % j`` мав той самий знак, що і ``i``." + +msgid "" +"There are few real use cases for ``i % j`` when ``j`` is negative. When " +"``j`` is positive, there are many, and in virtually all of them it's more " +"useful for ``i % j`` to be ``>= 0``. If the clock says 10 now, what did it " +"say 200 hours ago? ``-190 % 12 == 2`` is useful; ``-190 % 12 == -10`` is a " +"bug waiting to bite." +msgstr "" +"Є кілька реальних випадків використання ``i % j``, коли ``j`` є від'ємним. " +"Коли ``j`` додатне, їх багато, і практично в усіх з них корисніше, щоб ``i % " +"j`` було ``>= 0``. Якщо годинник показує 10 зараз, що він показував 200 " +"годин тому? ``-190 % 12 == 2`` є корисним; ``-190 % 12 == -10`` - це " +"помилка, яка чекає, щоб вкусити." + +msgid "How do I get int literal attribute instead of SyntaxError?" +msgstr "Як отримати атрибут int literal замість SyntaxError?" + +msgid "" +"Trying to lookup an ``int`` literal attribute in the normal manner gives a :" +"exc:`SyntaxError` because the period is seen as a decimal point::" +msgstr "" + +msgid "" +">>> 1.__class__\n" +" File \"\", line 1\n" +" 1.__class__\n" +" ^\n" +"SyntaxError: invalid decimal literal" +msgstr "" + +msgid "" +"The solution is to separate the literal from the period with either a space " +"or parentheses." +msgstr "" +"Рішення полягає в тому, щоб відокремити літерал від крапки пробілом або " +"дужками." + +msgid "How do I convert a string to a number?" +msgstr "Як перетворити рядок на число?" + +msgid "" +"For integers, use the built-in :func:`int` type constructor, e.g. " +"``int('144') == 144``. Similarly, :func:`float` converts to a floating-" +"point number, e.g. ``float('144') == 144.0``." +msgstr "" + +msgid "" +"By default, these interpret the number as decimal, so that ``int('0144') == " +"144`` holds true, and ``int('0x144')`` raises :exc:`ValueError`. " +"``int(string, base)`` takes the base to convert from as a second optional " +"argument, so ``int( '0x144', 16) == 324``. If the base is specified as 0, " +"the number is interpreted using Python's rules: a leading '0o' indicates " +"octal, and '0x' indicates a hex number." +msgstr "" +"За замовчуванням вони інтерпретують число як десяткове, так що ``int('0144') " +"== 144`` залишається істинним, а ``int('0x144')`` викликає :exc:" +"`ValueError`. ``int(string, base)`` бере основу для перетворення як другий " +"необов’язковий аргумент, тому ``int( '0x144', 16) == 324``. Якщо основа " +"вказана як 0, число інтерпретується за правилами Python: \"0o\" на початку " +"означає вісімкове число, а \"0x\" означає шістнадцяткове число." + +msgid "" +"Do not use the built-in function :func:`eval` if all you need is to convert " +"strings to numbers. :func:`eval` will be significantly slower and it " +"presents a security risk: someone could pass you a Python expression that " +"might have unwanted side effects. For example, someone could pass " +"``__import__('os').system(\"rm -rf $HOME\")`` which would erase your home " +"directory." +msgstr "" +"Не використовуйте вбудовану функцію :func:`eval`, якщо вам потрібно лише " +"перетворити рядки на числа. :func:`eval` буде значно повільніше, і це " +"становить ризик для безпеки: хтось може передати вам вираз Python, який може " +"мати небажані побічні ефекти. Наприклад, хтось може передати " +"``__import__('os').system(\"rm -rf $HOME\")``, що стерло б ваш домашній " +"каталог." + +msgid "" +":func:`eval` also has the effect of interpreting numbers as Python " +"expressions, so that e.g. ``eval('09')`` gives a syntax error because Python " +"does not allow leading '0' in a decimal number (except '0')." +msgstr "" +":func:`eval` також має ефект інтерпретації чисел як виразів Python, так що, " +"наприклад, ``eval('09')`` дає синтаксичну помилку, оскільки Python не " +"дозволяє починати '0' у десятковому числі (окрім '0')." + +msgid "How do I convert a number to a string?" +msgstr "Як перетворити число на рядок?" + +msgid "" +"To convert, e.g., the number ``144`` to the string ``'144'``, use the built-" +"in type constructor :func:`str`. If you want a hexadecimal or octal " +"representation, use the built-in functions :func:`hex` or :func:`oct`. For " +"fancy formatting, see the :ref:`f-strings` and :ref:`formatstrings` " +"sections, e.g. ``\"{:04d}\".format(144)`` yields ``'0144'`` and ``\"{:.3f}\"." +"format(1.0/3.0)`` yields ``'0.333'``." +msgstr "" + +msgid "How do I modify a string in place?" +msgstr "Як змінити рядок на місці?" + +msgid "" +"You can't, because strings are immutable. In most situations, you should " +"simply construct a new string from the various parts you want to assemble it " +"from. However, if you need an object with the ability to modify in-place " +"unicode data, try using an :class:`io.StringIO` object or the :mod:`array` " +"module::" +msgstr "" +"Ви не можете, тому що рядки незмінні. У більшості ситуацій вам слід просто " +"побудувати нову струну з різних частин, з яких ви хочете її зібрати. Однак, " +"якщо вам потрібен об’єкт із можливістю змінювати дані Unicode на місці, " +"спробуйте використати об’єкт :class:`io.StringIO` або модуль :mod:`array`::" + +msgid "" +">>> import io\n" +">>> s = \"Hello, world\"\n" +">>> sio = io.StringIO(s)\n" +">>> sio.getvalue()\n" +"'Hello, world'\n" +">>> sio.seek(7)\n" +"7\n" +">>> sio.write(\"there!\")\n" +"6\n" +">>> sio.getvalue()\n" +"'Hello, there!'\n" +"\n" +">>> import array\n" +">>> a = array.array('w', s)\n" +">>> print(a)\n" +"array('w', 'Hello, world')\n" +">>> a[0] = 'y'\n" +">>> print(a)\n" +"array('w', 'yello, world')\n" +">>> a.tounicode()\n" +"'yello, world'" +msgstr "" + +msgid "How do I use strings to call functions/methods?" +msgstr "Як використовувати рядки для виклику функцій/методів?" + +msgid "There are various techniques." +msgstr "Існують різні техніки." + +msgid "" +"The best is to use a dictionary that maps strings to functions. The primary " +"advantage of this technique is that the strings do not need to match the " +"names of the functions. This is also the primary technique used to emulate " +"a case construct::" +msgstr "" +"Найкраще використовувати словник, який відображає рядки на функції. Основна " +"перевага цього методу полягає в тому, що рядки не повинні збігатися з " +"назвами функцій. Це також основна техніка, яка використовується для емуляції " +"конструкції case:" + +msgid "" +"def a():\n" +" pass\n" +"\n" +"def b():\n" +" pass\n" +"\n" +"dispatch = {'go': a, 'stop': b} # Note lack of parens for funcs\n" +"\n" +"dispatch[get_input()]() # Note trailing parens to call function" +msgstr "" + +msgid "Use the built-in function :func:`getattr`::" +msgstr "Використовуйте вбудовану функцію :func:`getattr`::" + +msgid "" +"import foo\n" +"getattr(foo, 'bar')()" +msgstr "" + +msgid "" +"Note that :func:`getattr` works on any object, including classes, class " +"instances, modules, and so on." +msgstr "" +"Зауважте, що :func:`getattr` працює з будь-яким об’єктом, включаючи класи, " +"екземпляри класів, модулі тощо." + +msgid "This is used in several places in the standard library, like this::" +msgstr "" +"Це використовується в кількох місцях стандартної бібліотеки, наприклад:" + +msgid "" +"class Foo:\n" +" def do_foo(self):\n" +" ...\n" +"\n" +" def do_bar(self):\n" +" ...\n" +"\n" +"f = getattr(foo_instance, 'do_' + opname)\n" +"f()" +msgstr "" + +msgid "Use :func:`locals` to resolve the function name::" +msgstr "Використовуйте :func:`locals` для визначення імені функції::" + +msgid "" +"def myFunc():\n" +" print(\"hello\")\n" +"\n" +"fname = \"myFunc\"\n" +"\n" +"f = locals()[fname]\n" +"f()" +msgstr "" + +msgid "" +"Is there an equivalent to Perl's ``chomp()`` for removing trailing newlines " +"from strings?" +msgstr "" + +msgid "" +"You can use ``S.rstrip(\"\\r\\n\")`` to remove all occurrences of any line " +"terminator from the end of the string ``S`` without removing other trailing " +"whitespace. If the string ``S`` represents more than one line, with several " +"empty lines at the end, the line terminators for all the blank lines will be " +"removed::" +msgstr "" +"Ви можете використовувати ``S.rstrip(\"\\r\\n\")``, щоб видалити всі " +"входження будь-якого термінатора рядка з кінця рядка ``S``, не видаляючи " +"інші пробіли в кінці. Якщо рядок ``S`` представляє більше одного рядка з " +"кількома порожніми рядками в кінці, кінцеві знаки для всіх порожніх рядків " +"буде видалено:" + +msgid "" +">>> lines = (\"line 1 \\r\\n\"\n" +"... \"\\r\\n\"\n" +"... \"\\r\\n\")\n" +">>> lines.rstrip(\"\\n\\r\")\n" +"'line 1 '" +msgstr "" + +msgid "" +"Since this is typically only desired when reading text one line at a time, " +"using ``S.rstrip()`` this way works well." +msgstr "" +"Оскільки це зазвичай бажано лише під час читання тексту по одному рядку, " +"використання ``S.rstrip()`` цей спосіб працює добре." + +msgid "Is there a ``scanf()`` or ``sscanf()`` equivalent?" +msgstr "" + +msgid "Not as such." +msgstr "Не як такої." + +msgid "" +"For simple input parsing, the easiest approach is usually to split the line " +"into whitespace-delimited words using the :meth:`~str.split` method of " +"string objects and then convert decimal strings to numeric values using :" +"func:`int` or :func:`float`. :meth:`!split` supports an optional \"sep\" " +"parameter which is useful if the line uses something other than whitespace " +"as a separator." +msgstr "" + +msgid "" +"For more complicated input parsing, regular expressions are more powerful " +"than C's ``sscanf`` and better suited for the task." +msgstr "" + +msgid "What does ``UnicodeDecodeError`` or ``UnicodeEncodeError`` error mean?" +msgstr "" + +msgid "See the :ref:`unicode-howto`." +msgstr "Перегляньте :ref:`unicode-howto`." + +msgid "Can I end a raw string with an odd number of backslashes?" +msgstr "" + +msgid "" +"A raw string ending with an odd number of backslashes will escape the " +"string's quote::" +msgstr "" + +msgid "" +">>> r'C:\\this\\will\\not\\work\\'\n" +" File \"\", line 1\n" +" r'C:\\this\\will\\not\\work\\'\n" +" ^\n" +"SyntaxError: unterminated string literal (detected at line 1)" +msgstr "" + +msgid "" +"There are several workarounds for this. One is to use regular strings and " +"double the backslashes::" +msgstr "" + +msgid "" +">>> 'C:\\\\this\\\\will\\\\work\\\\'\n" +"'C:\\\\this\\\\will\\\\work\\\\'" +msgstr "" + +msgid "" +"Another is to concatenate a regular string containing an escaped backslash " +"to the raw string::" +msgstr "" + +msgid "" +">>> r'C:\\this\\will\\work' '\\\\'\n" +"'C:\\\\this\\\\will\\\\work\\\\'" +msgstr "" + +msgid "" +"It is also possible to use :func:`os.path.join` to append a backslash on " +"Windows::" +msgstr "" + +msgid "" +">>> os.path.join(r'C:\\this\\will\\work', '')\n" +"'C:\\\\this\\\\will\\\\work\\\\'" +msgstr "" + +msgid "" +"Note that while a backslash will \"escape\" a quote for the purposes of " +"determining where the raw string ends, no escaping occurs when interpreting " +"the value of the raw string. That is, the backslash remains present in the " +"value of the raw string::" +msgstr "" + +msgid "" +">>> r'backslash\\'preserved'\n" +"\"backslash\\\\'preserved\"" +msgstr "" + +msgid "Also see the specification in the :ref:`language reference `." +msgstr "" + +msgid "Performance" +msgstr "Продуктивність" + +msgid "My program is too slow. How do I speed it up?" +msgstr "Моя програма надто повільна. Як це прискорити?" + +msgid "" +"That's a tough one, in general. First, here are a list of things to " +"remember before diving further:" +msgstr "" +"Загалом, це важко. По-перше, ось список речей, які слід запам’ятати перед " +"подальшим зануренням:" + +msgid "" +"Performance characteristics vary across Python implementations. This FAQ " +"focuses on :term:`CPython`." +msgstr "" +"Характеристики продуктивності відрізняються в різних реалізаціях Python. Цей " +"FAQ присвячений :term:`CPython`." + +msgid "" +"Behaviour can vary across operating systems, especially when talking about I/" +"O or multi-threading." +msgstr "" +"Поведінка може відрізнятися в різних операційних системах, особливо коли " +"мова йде про введення-виведення або багатопотоковість." + +msgid "" +"You should always find the hot spots in your program *before* attempting to " +"optimize any code (see the :mod:`profile` module)." +msgstr "" +"Ви завжди повинні знаходити гарячі точки у своїй програмі *перед* спробою " +"оптимізувати будь-який код (дивіться модуль :mod:`profile`)." + +msgid "" +"Writing benchmark scripts will allow you to iterate quickly when searching " +"for improvements (see the :mod:`timeit` module)." +msgstr "" +"Написання тестових сценаріїв дозволить вам швидко виконувати ітерації під " +"час пошуку покращень (дивіться модуль :mod:`timeit`)." + +msgid "" +"It is highly recommended to have good code coverage (through unit testing or " +"any other technique) before potentially introducing regressions hidden in " +"sophisticated optimizations." +msgstr "" +"Настійно рекомендується добре охопити код (через модульне тестування або " +"будь-яку іншу техніку), перш ніж потенційно вводити регресії, приховані в " +"складних оптимізаціях." + +msgid "" +"That being said, there are many tricks to speed up Python code. Here are " +"some general principles which go a long way towards reaching acceptable " +"performance levels:" +msgstr "" +"З огляду на це, існує багато прийомів, щоб пришвидшити код Python. Ось " +"кілька загальних принципів, які допоможуть досягти прийнятного рівня " +"продуктивності:" + +msgid "" +"Making your algorithms faster (or changing to faster ones) can yield much " +"larger benefits than trying to sprinkle micro-optimization tricks all over " +"your code." +msgstr "" +"Пришвидшення ваших алгоритмів (або заміна на швидші) може дати набагато " +"більші переваги, ніж спроба розсипати трюки мікрооптимізації по всьому коду." + +msgid "" +"Use the right data structures. Study documentation for the :ref:`bltin-" +"types` and the :mod:`collections` module." +msgstr "" +"Використовуйте правильні структури даних. Навчальна документація для " +"модулів :ref:`bltin-types` і :mod:`collections`." + +msgid "" +"When the standard library provides a primitive for doing something, it is " +"likely (although not guaranteed) to be faster than any alternative you may " +"come up with. This is doubly true for primitives written in C, such as " +"builtins and some extension types. For example, be sure to use either the :" +"meth:`list.sort` built-in method or the related :func:`sorted` function to " +"do sorting (and see the :ref:`sortinghowto` for examples of moderately " +"advanced usage)." +msgstr "" +"Коли стандартна бібліотека надає примітив для виконання чогось, швидше за " +"все (хоча це не гарантовано) буде швидше, ніж будь-яка альтернатива, яку ви " +"можете придумати. Це подвійно вірно для примітивів, написаних на C, таких як " +"вбудовані модулі та деякі типи розширень. Наприклад, обов’язково " +"використовуйте або вбудований метод :meth:`list.sort`, або пов’язану " +"функцію :func:`sorted` для виконання сортування (і перегляньте :ref:" +"`sortinghowto` для прикладів помірно просунутого використання )." + +msgid "" +"Abstractions tend to create indirections and force the interpreter to work " +"more. If the levels of indirection outweigh the amount of useful work done, " +"your program will be slower. You should avoid excessive abstraction, " +"especially under the form of tiny functions or methods (which are also often " +"detrimental to readability)." +msgstr "" +"Абстракції, як правило, створюють непрямість і змушують перекладача " +"працювати більше. Якщо рівень опосередкованості переважає обсяг виконаної " +"корисної роботи, ваша програма працюватиме повільніше. Вам слід уникати " +"надмірної абстракції, особливо у формі крихітних функцій або методів (які " +"також часто шкодять читабельності)." + +msgid "" +"If you have reached the limit of what pure Python can allow, there are tools " +"to take you further away. For example, `Cython `_ can " +"compile a slightly modified version of Python code into a C extension, and " +"can be used on many different platforms. Cython can take advantage of " +"compilation (and optional type annotations) to make your code significantly " +"faster than when interpreted. If you are confident in your C programming " +"skills, you can also :ref:`write a C extension module ` " +"yourself." +msgstr "" + +msgid "" +"The wiki page devoted to `performance tips `_." +msgstr "" +"Вікі-сторінка, присвячена `порадам щодо продуктивності `_." + +msgid "What is the most efficient way to concatenate many strings together?" +msgstr "Який найефективніший спосіб об’єднати багато рядків?" + +msgid "" +":class:`str` and :class:`bytes` objects are immutable, therefore " +"concatenating many strings together is inefficient as each concatenation " +"creates a new object. In the general case, the total runtime cost is " +"quadratic in the total string length." +msgstr "" +"Об’єкти :class:`str` і :class:`bytes` є незмінними, тому конкатенація " +"багатьох рядків разом неефективна, оскільки кожна конкатенація створює новий " +"об’єкт. У загальному випадку загальна вартість виконання є квадратичною щодо " +"загальної довжини рядка." + +msgid "" +"To accumulate many :class:`str` objects, the recommended idiom is to place " +"them into a list and call :meth:`str.join` at the end::" +msgstr "" +"Щоб накопичити багато об’єктів :class:`str`, рекомендована ідіома полягає в " +"тому, щоб помістити їх у список і викликати :meth:`str.join` в кінці::" + +msgid "" +"chunks = []\n" +"for s in my_strings:\n" +" chunks.append(s)\n" +"result = ''.join(chunks)" +msgstr "" + +msgid "(another reasonably efficient idiom is to use :class:`io.StringIO`)" +msgstr "(іншою досить ефективною ідіомою є використання :class:`io.StringIO`)" + +msgid "" +"To accumulate many :class:`bytes` objects, the recommended idiom is to " +"extend a :class:`bytearray` object using in-place concatenation (the ``+=`` " +"operator)::" +msgstr "" +"Щоб накопичити багато об’єктів :class:`bytes`, рекомендована ідіома полягає " +"в тому, щоб розширити об’єкт :class:`bytearray` за допомогою конкатенації на " +"місці (оператор ``+=``):" + +msgid "" +"result = bytearray()\n" +"for b in my_bytes_objects:\n" +" result += b" +msgstr "" + +msgid "Sequences (Tuples/Lists)" +msgstr "Послідовності (кортежі/списки)" + +msgid "How do I convert between tuples and lists?" +msgstr "Як конвертувати між кортежами та списками?" + +msgid "" +"The type constructor ``tuple(seq)`` converts any sequence (actually, any " +"iterable) into a tuple with the same items in the same order." +msgstr "" +"Конструктор типу ``tuple(seq)`` перетворює будь-яку послідовність (фактично, " +"будь-яку ітерацію) у кортеж з тими самими елементами в тому самому порядку." + +msgid "" +"For example, ``tuple([1, 2, 3])`` yields ``(1, 2, 3)`` and ``tuple('abc')`` " +"yields ``('a', 'b', 'c')``. If the argument is a tuple, it does not make a " +"copy but returns the same object, so it is cheap to call :func:`tuple` when " +"you aren't sure that an object is already a tuple." +msgstr "" +"Наприклад, ``tuple([1, 2, 3])`` дає ``(1, 2, 3)``, ``tuple('abc')`` дає " +"``('a', 'b ', 'c')``. Якщо аргумент є кортежем, він не створює копію, а " +"повертає той самий об’єкт, тому дешево викликати :func:`tuple`, коли ви не " +"впевнені, що об’єкт уже є кортежем." + +msgid "" +"The type constructor ``list(seq)`` converts any sequence or iterable into a " +"list with the same items in the same order. For example, ``list((1, 2, " +"3))`` yields ``[1, 2, 3]`` and ``list('abc')`` yields ``['a', 'b', 'c']``. " +"If the argument is a list, it makes a copy just like ``seq[:]`` would." +msgstr "" +"Конструктор типу ``list(seq)`` перетворює будь-яку послідовність або " +"ітерацію в список з тими самими елементами в тому самому порядку. Наприклад, " +"``list((1, 2, 3))`` дає ``[1, 2, 3]``, а ``list('abc')`` дає ``['a', 'b ', " +"'c']``. Якщо аргумент є списком, він створює копію так само, як ``seq[:]``." + +msgid "What's a negative index?" +msgstr "Що таке негативний індекс?" + +msgid "" +"Python sequences are indexed with positive numbers and negative numbers. " +"For positive numbers 0 is the first index 1 is the second index and so " +"forth. For negative indices -1 is the last index and -2 is the penultimate " +"(next to last) index and so forth. Think of ``seq[-n]`` as the same as " +"``seq[len(seq)-n]``." +msgstr "" +"Послідовності Python індексуються позитивними та негативними числами. Для " +"додатних чисел 0 є першим індексом, 1 є другим індексом і так далі. Для " +"негативних індексів -1 є останнім індексом, а -2 є передостаннім " +"(передостаннім) індексом і так далі. Подумайте про ``seq[-n]`` як про те " +"саме, що ``seq[len(seq)-n]``." + +msgid "" +"Using negative indices can be very convenient. For example ``S[:-1]`` is " +"all of the string except for its last character, which is useful for " +"removing the trailing newline from a string." +msgstr "" +"Використання від’ємних індексів може бути дуже зручним. Наприклад, " +"``S[:-1]`` — це весь рядок, за винятком останнього символу, який корисний " +"для видалення кінцевого символу нового рядка з рядка." + +msgid "How do I iterate over a sequence in reverse order?" +msgstr "Як мені виконати ітерацію по послідовності у зворотному порядку?" + +msgid "Use the :func:`reversed` built-in function::" +msgstr "Використовуйте вбудовану функцію :func:`reversed`::" + +msgid "" +"for x in reversed(sequence):\n" +" ... # do something with x ..." +msgstr "" + +msgid "" +"This won't touch your original sequence, but build a new copy with reversed " +"order to iterate over." +msgstr "" +"Це не торкнеться вашої оригінальної послідовності, але створить нову копію " +"зі зворотним порядком повторення." + +msgid "How do you remove duplicates from a list?" +msgstr "Як видалити дублікати зі списку?" + +msgid "See the Python Cookbook for a long discussion of many ways to do this:" +msgstr "" +"Перегляньте кулінарну книгу Python для довгого обговорення багатьох способів " +"зробити це:" + +msgid "https://code.activestate.com/recipes/52560/" +msgstr "https://code.activestate.com/recipes/52560/" + +msgid "" +"If you don't mind reordering the list, sort it and then scan from the end of " +"the list, deleting duplicates as you go::" +msgstr "" +"Якщо ви не проти змінити порядок списку, відсортуйте його, а потім скануйте " +"з кінця списку, видаляючи дублікати по ходу::" + +msgid "" +"if mylist:\n" +" mylist.sort()\n" +" last = mylist[-1]\n" +" for i in range(len(mylist)-2, -1, -1):\n" +" if last == mylist[i]:\n" +" del mylist[i]\n" +" else:\n" +" last = mylist[i]" +msgstr "" + +msgid "" +"If all elements of the list may be used as set keys (i.e. they are all :term:" +"`hashable`) this is often faster ::" +msgstr "" +"Якщо всі елементи списку можна використовувати як набір ключів (тобто всі " +"вони :term:`hashable`), це часто швидше ::" + +msgid "mylist = list(set(mylist))" +msgstr "" + +msgid "" +"This converts the list into a set, thereby removing duplicates, and then " +"back into a list." +msgstr "" +"Це перетворює список на набір, таким чином видаляючи дублікати, а потім " +"знову на список." + +msgid "How do you remove multiple items from a list" +msgstr "Як видалити кілька елементів зі списку" + +msgid "" +"As with removing duplicates, explicitly iterating in reverse with a delete " +"condition is one possibility. However, it is easier and faster to use slice " +"replacement with an implicit or explicit forward iteration. Here are three " +"variations.::" +msgstr "" +"Як і у випадку з видаленням дублікатів, явне повторення у зворотному порядку " +"з умовою видалення є однією з можливостей. Однак простіше і швидше " +"використовувати заміну фрагмента з неявною або явною прямою ітерацією. Ось " +"три варіації::" + +msgid "" +"mylist[:] = filter(keep_function, mylist)\n" +"mylist[:] = (x for x in mylist if keep_condition)\n" +"mylist[:] = [x for x in mylist if keep_condition]" +msgstr "" + +msgid "The list comprehension may be fastest." +msgstr "Розуміння списку може бути найшвидшим." + +msgid "How do you make an array in Python?" +msgstr "Як створити масив у Python?" + +msgid "Use a list::" +msgstr "Використовуйте список::" + +msgid "[\"this\", 1, \"is\", \"an\", \"array\"]" +msgstr "" + +msgid "" +"Lists are equivalent to C or Pascal arrays in their time complexity; the " +"primary difference is that a Python list can contain objects of many " +"different types." +msgstr "" +"За часовою складністю списки еквівалентні масивам C або Pascal; основна " +"відмінність полягає в тому, що список Python може містити об’єкти багатьох " +"різних типів." + +msgid "" +"The ``array`` module also provides methods for creating arrays of fixed " +"types with compact representations, but they are slower to index than " +"lists. Also note that `NumPy `_ and other third party " +"packages define array-like structures with various characteristics as well." +msgstr "" + +msgid "" +"To get Lisp-style linked lists, you can emulate *cons cells* using tuples::" +msgstr "" + +msgid "lisp_list = (\"like\", (\"this\", (\"example\", None) ) )" +msgstr "" + +msgid "" +"If mutability is desired, you could use lists instead of tuples. Here the " +"analogue of a Lisp *car* is ``lisp_list[0]`` and the analogue of *cdr* is " +"``lisp_list[1]``. Only do this if you're sure you really need to, because " +"it's usually a lot slower than using Python lists." +msgstr "" + +msgid "How do I create a multidimensional list?" +msgstr "Як створити багатовимірний список?" + +msgid "You probably tried to make a multidimensional array like this::" +msgstr "" +"Можливо, ви намагалися створити багатовимірний масив, подібний до цього:" + +msgid ">>> A = [[None] * 2] * 3" +msgstr "" + +msgid "This looks correct if you print it:" +msgstr "Це виглядає правильно, якщо ви його надрукуєте:" + +msgid "" +">>> A\n" +"[[None, None], [None, None], [None, None]]" +msgstr "" + +msgid "But when you assign a value, it shows up in multiple places:" +msgstr "" +"Але коли ви призначаєте значення, воно відображається в кількох місцях:" + +msgid "" +">>> A[0][0] = 5\n" +">>> A\n" +"[[5, None], [5, None], [5, None]]" +msgstr "" + +msgid "" +"The reason is that replicating a list with ``*`` doesn't create copies, it " +"only creates references to the existing objects. The ``*3`` creates a list " +"containing 3 references to the same list of length two. Changes to one row " +"will show in all rows, which is almost certainly not what you want." +msgstr "" +"Причина полягає в тому, що реплікація списку з ``*`` не створює копії, а " +"лише створює посилання на існуючі об’єкти. ``*3`` створює список, що містить " +"3 посилання на той самий список довжиною два. Зміни в одному рядку " +"відображатимуться в усіх рядках, що майже напевно не те, що ви хочете." + +msgid "" +"The suggested approach is to create a list of the desired length first and " +"then fill in each element with a newly created list::" +msgstr "" +"Пропонований підхід полягає в тому, щоб спочатку створити список потрібної " +"довжини, а потім заповнити кожен елемент новоствореним списком::" + +msgid "" +"A = [None] * 3\n" +"for i in range(3):\n" +" A[i] = [None] * 2" +msgstr "" + +msgid "" +"This generates a list containing 3 different lists of length two. You can " +"also use a list comprehension::" +msgstr "" +"Це генерує список, що містить 3 різні списки довжиною два. Ви також можете " +"використовувати розуміння списку:" + +msgid "" +"w, h = 2, 3\n" +"A = [[None] * w for i in range(h)]" +msgstr "" + +msgid "" +"Or, you can use an extension that provides a matrix datatype; `NumPy " +"`_ is the best known." +msgstr "" + +msgid "How do I apply a method or function to a sequence of objects?" +msgstr "" + +msgid "" +"To call a method or function and accumulate the return values is a list, a :" +"term:`list comprehension` is an elegant solution::" +msgstr "" + +msgid "" +"result = [obj.method() for obj in mylist]\n" +"\n" +"result = [function(obj) for obj in mylist]" +msgstr "" + +msgid "" +"To just run the method or function without saving the return values, a " +"plain :keyword:`for` loop will suffice::" +msgstr "" + +msgid "" +"for obj in mylist:\n" +" obj.method()\n" +"\n" +"for obj in mylist:\n" +" function(obj)" +msgstr "" + +msgid "" +"Why does a_tuple[i] += ['item'] raise an exception when the addition works?" +msgstr "" +"Чому a_tuple[i] += ['item'] викликає виключення, коли додавання працює?" + +msgid "" +"This is because of a combination of the fact that augmented assignment " +"operators are *assignment* operators, and the difference between mutable and " +"immutable objects in Python." +msgstr "" +"Це пояснюється поєднанням того факту, що розширені оператори присвоєння є " +"операторами *присвоєння*, а також різниці між змінними та незмінними " +"об’єктами в Python." + +msgid "" +"This discussion applies in general when augmented assignment operators are " +"applied to elements of a tuple that point to mutable objects, but we'll use " +"a ``list`` and ``+=`` as our exemplar." +msgstr "" +"Це обговорення загалом стосується випадків, коли розширені оператори " +"присвоєння застосовуються до елементів кортежу, які вказують на змінні " +"об’єкти, але ми будемо використовувати ``list`` і ``+=`` як наш приклад." + +msgid "If you wrote::" +msgstr "Якщо ви написали::" + +msgid "" +">>> a_tuple = (1, 2)\n" +">>> a_tuple[0] += 1\n" +"Traceback (most recent call last):\n" +" ...\n" +"TypeError: 'tuple' object does not support item assignment" +msgstr "" + +msgid "" +"The reason for the exception should be immediately clear: ``1`` is added to " +"the object ``a_tuple[0]`` points to (``1``), producing the result object, " +"``2``, but when we attempt to assign the result of the computation, ``2``, " +"to element ``0`` of the tuple, we get an error because we can't change what " +"an element of a tuple points to." +msgstr "" +"Причина винятку має бути зрозуміла одразу: ``1`` додається до об’єкта " +"``a_tuple[0]``, що вказує на (``1``), створюючи об’єкт результату ``2``, але " +"коли ми намагаємося призначити результат обчислення, ``2``, елементу ``0`` " +"кортежу, ми отримуємо помилку, оскільки ми не можемо змінити те, на що " +"вказує елемент кортежу." + +msgid "" +"Under the covers, what this augmented assignment statement is doing is " +"approximately this::" +msgstr "" +"Під обкладинками цей доповнений оператор присвоєння робить приблизно " +"наступне:" + +msgid "" +">>> result = a_tuple[0] + 1\n" +">>> a_tuple[0] = result\n" +"Traceback (most recent call last):\n" +" ...\n" +"TypeError: 'tuple' object does not support item assignment" +msgstr "" + +msgid "" +"It is the assignment part of the operation that produces the error, since a " +"tuple is immutable." +msgstr "" +"Саме частина операції присвоєння створює помилку, оскільки кортеж є " +"незмінним." + +msgid "When you write something like::" +msgstr "Коли ви пишете щось на зразок::" + +msgid "" +">>> a_tuple = (['foo'], 'bar')\n" +">>> a_tuple[0] += ['item']\n" +"Traceback (most recent call last):\n" +" ...\n" +"TypeError: 'tuple' object does not support item assignment" +msgstr "" + +msgid "" +"The exception is a bit more surprising, and even more surprising is the fact " +"that even though there was an error, the append worked::" +msgstr "" +"Виняток є трохи більш дивним, і ще більш дивним є той факт, що, незважаючи " +"на помилку, додаток працював:" + +msgid "" +">>> a_tuple[0]\n" +"['foo', 'item']" +msgstr "" + +msgid "" +"To see why this happens, you need to know that (a) if an object implements " +"an :meth:`~object.__iadd__` magic method, it gets called when the ``+=`` " +"augmented assignment is executed, and its return value is what gets used in " +"the assignment statement; and (b) for lists, :meth:`!__iadd__` is equivalent " +"to calling :meth:`!extend` on the list and returning the list. That's why " +"we say that for lists, ``+=`` is a \"shorthand\" for :meth:`!list.extend`::" +msgstr "" + +msgid "" +">>> a_list = []\n" +">>> a_list += [1]\n" +">>> a_list\n" +"[1]" +msgstr "" + +msgid "This is equivalent to::" +msgstr "Це еквівалентно::" + +msgid "" +">>> result = a_list.__iadd__([1])\n" +">>> a_list = result" +msgstr "" + +msgid "" +"The object pointed to by a_list has been mutated, and the pointer to the " +"mutated object is assigned back to ``a_list``. The end result of the " +"assignment is a no-op, since it is a pointer to the same object that " +"``a_list`` was previously pointing to, but the assignment still happens." +msgstr "" +"Об’єкт, на який вказує a_list, було змінено, і вказівник на змінений об’єкт " +"знову призначено ``a_list``. Кінцевим результатом призначення є no-op, " +"оскільки це вказівник на той самий об’єкт, на який раніше вказував " +"``a_list``, але призначення все одно відбувається." + +msgid "Thus, in our tuple example what is happening is equivalent to::" +msgstr "" +"Таким чином, у нашому прикладі кортежу те, що відбувається, еквівалентно::" + +msgid "" +">>> result = a_tuple[0].__iadd__(['item'])\n" +">>> a_tuple[0] = result\n" +"Traceback (most recent call last):\n" +" ...\n" +"TypeError: 'tuple' object does not support item assignment" +msgstr "" + +msgid "" +"The :meth:`!__iadd__` succeeds, and thus the list is extended, but even " +"though ``result`` points to the same object that ``a_tuple[0]`` already " +"points to, that final assignment still results in an error, because tuples " +"are immutable." +msgstr "" + +msgid "" +"I want to do a complicated sort: can you do a Schwartzian Transform in " +"Python?" +msgstr "" +"Я хочу зробити складне сортування: чи можете ви виконати перетворення Шварца " +"в Python?" + +msgid "" +"The technique, attributed to Randal Schwartz of the Perl community, sorts " +"the elements of a list by a metric which maps each element to its \"sort " +"value\". In Python, use the ``key`` argument for the :meth:`list.sort` " +"method::" +msgstr "" +"Техніка, яку приписують Рендалу Шварцу зі спільноти Perl, сортує елементи " +"списку за метрикою, яка відображає кожен елемент на його \"значення " +"сортування\". У Python використовуйте аргумент ``key`` для методу :meth:" +"`list.sort`::" + +msgid "" +"Isorted = L[:]\n" +"Isorted.sort(key=lambda s: int(s[10:15]))" +msgstr "" + +msgid "How can I sort one list by values from another list?" +msgstr "Як я можу сортувати один список за значеннями з іншого списку?" + +msgid "" +"Merge them into an iterator of tuples, sort the resulting list, and then " +"pick out the element you want. ::" +msgstr "" +"Об’єднайте їх у ітератор кортежів, відсортуйте отриманий список, а потім " +"виберіть потрібний елемент. ::" + +msgid "" +">>> list1 = [\"what\", \"I'm\", \"sorting\", \"by\"]\n" +">>> list2 = [\"something\", \"else\", \"to\", \"sort\"]\n" +">>> pairs = zip(list1, list2)\n" +">>> pairs = sorted(pairs)\n" +">>> pairs\n" +"[(\"I'm\", 'else'), ('by', 'sort'), ('sorting', 'to'), ('what', " +"'something')]\n" +">>> result = [x[1] for x in pairs]\n" +">>> result\n" +"['else', 'sort', 'to', 'something']" +msgstr "" + +msgid "Objects" +msgstr "Об'єкти" + +msgid "What is a class?" +msgstr "Що таке клас?" + +msgid "" +"A class is the particular object type created by executing a class " +"statement. Class objects are used as templates to create instance objects, " +"which embody both the data (attributes) and code (methods) specific to a " +"datatype." +msgstr "" +"Клас — це окремий тип об’єкта, створений шляхом виконання оператора класу. " +"Об’єкти класу використовуються як шаблони для створення об’єктів " +"екземплярів, які втілюють як дані (атрибути), так і код (методи), специфічні " +"для типу даних." + +msgid "" +"A class can be based on one or more other classes, called its base " +"class(es). It then inherits the attributes and methods of its base classes. " +"This allows an object model to be successively refined by inheritance. You " +"might have a generic ``Mailbox`` class that provides basic accessor methods " +"for a mailbox, and subclasses such as ``MboxMailbox``, ``MaildirMailbox``, " +"``OutlookMailbox`` that handle various specific mailbox formats." +msgstr "" +"Клас може базуватися на одному або кількох інших класах, які називаються " +"базовими класами. Потім він успадковує атрибути та методи своїх базових " +"класів. Це дозволяє послідовно вдосконалювати об’єктну модель шляхом " +"успадкування. У вас може бути загальний клас ``Поштова скринька``, який " +"надає основні методи доступу до поштової скриньки, і підкласи, такі як " +"``MboxMailbox``, ``MaildirMailbox``, ``OutlookMailbox``, які обробляють " +"різні конкретні формати поштових скриньок." + +msgid "What is a method?" +msgstr "Що таке метод?" + +msgid "" +"A method is a function on some object ``x`` that you normally call as ``x." +"name(arguments...)``. Methods are defined as functions inside the class " +"definition::" +msgstr "" +"Метод — це функція для деякого об’єкта ``x``, який зазвичай викликається як " +"``x.name(arguments...)``. Методи визначаються як функції всередині " +"визначення класу::" + +msgid "" +"class C:\n" +" def meth(self, arg):\n" +" return arg * 2 + self.attribute" +msgstr "" + +msgid "What is self?" +msgstr "Що таке себе?" + +msgid "" +"Self is merely a conventional name for the first argument of a method. A " +"method defined as ``meth(self, a, b, c)`` should be called as ``x.meth(a, b, " +"c)`` for some instance ``x`` of the class in which the definition occurs; " +"the called method will think it is called as ``meth(x, a, b, c)``." +msgstr "" +"Self — це просто умовна назва для першого аргументу методу. Метод, " +"визначений як ``meth(self, a, b, c)``, слід викликати як ``x.meth(a, b, c)`` " +"для деякого екземпляра ``x`` класу, в якому відбувається визначення; " +"викликаний метод вважатиме, що він викликається як ``meth(x, a, b, c)``." + +msgid "See also :ref:`why-self`." +msgstr "Дивіться також :ref:`why-self`." + +msgid "" +"How do I check if an object is an instance of a given class or of a subclass " +"of it?" +msgstr "" +"Як перевірити, чи є об’єкт екземпляром заданого класу чи його підкласу?" + +msgid "" +"Use the built-in function :func:`isinstance(obj, cls) `. You " +"can check if an object is an instance of any of a number of classes by " +"providing a tuple instead of a single class, e.g. ``isinstance(obj, (class1, " +"class2, ...))``, and can also check whether an object is one of Python's " +"built-in types, e.g. ``isinstance(obj, str)`` or ``isinstance(obj, (int, " +"float, complex))``." +msgstr "" + +msgid "" +"Note that :func:`isinstance` also checks for virtual inheritance from an :" +"term:`abstract base class`. So, the test will return ``True`` for a " +"registered class even if hasn't directly or indirectly inherited from it. " +"To test for \"true inheritance\", scan the :term:`MRO` of the class:" +msgstr "" +"Зауважте, що :func:`isinstance` також перевіряє віртуальне успадкування від :" +"term:`abstract base class`. Таким чином, тест поверне ``True`` для " +"зареєстрованого класу, навіть якщо він прямо чи опосередковано не успадкував " +"його. Щоб перевірити \"справжнє успадкування\", проскануйте :term:`MRO` " +"класу:" + +msgid "" +"from collections.abc import Mapping\n" +"\n" +"class P:\n" +" pass\n" +"\n" +"class C(P):\n" +" pass\n" +"\n" +"Mapping.register(P)" +msgstr "" + +msgid "" +">>> c = C()\n" +">>> isinstance(c, C) # direct\n" +"True\n" +">>> isinstance(c, P) # indirect\n" +"True\n" +">>> isinstance(c, Mapping) # virtual\n" +"True\n" +"\n" +"# Actual inheritance chain\n" +">>> type(c).__mro__\n" +"(, , )\n" +"\n" +"# Test for \"true inheritance\"\n" +">>> Mapping in type(c).__mro__\n" +"False" +msgstr "" + +msgid "" +"Note that most programs do not use :func:`isinstance` on user-defined " +"classes very often. If you are developing the classes yourself, a more " +"proper object-oriented style is to define methods on the classes that " +"encapsulate a particular behaviour, instead of checking the object's class " +"and doing a different thing based on what class it is. For example, if you " +"have a function that does something::" +msgstr "" +"Зауважте, що більшість програм не дуже часто використовують :func:" +"`isinstance` у визначених користувачем класах. Якщо ви розробляєте класи " +"самостійно, більш правильним об’єктно-орієнтованим стилем є визначення " +"методів у класах, які інкапсулюють конкретну поведінку, замість перевірки " +"класу об’єкта та виконання інших дій на основі того, який це клас. " +"Наприклад, якщо у вас є функція, яка щось робить:" + +msgid "" +"def search(obj):\n" +" if isinstance(obj, Mailbox):\n" +" ... # code to search a mailbox\n" +" elif isinstance(obj, Document):\n" +" ... # code to search a document\n" +" elif ..." +msgstr "" + +msgid "" +"A better approach is to define a ``search()`` method on all the classes and " +"just call it::" +msgstr "" +"Кращий підхід полягає в тому, щоб визначити метод ``search()`` для всіх " +"класів і просто викликати його::" + +msgid "" +"class Mailbox:\n" +" def search(self):\n" +" ... # code to search a mailbox\n" +"\n" +"class Document:\n" +" def search(self):\n" +" ... # code to search a document\n" +"\n" +"obj.search()" +msgstr "" + +msgid "What is delegation?" +msgstr "Що таке делегування?" + +msgid "" +"Delegation is an object oriented technique (also called a design pattern). " +"Let's say you have an object ``x`` and want to change the behaviour of just " +"one of its methods. You can create a new class that provides a new " +"implementation of the method you're interested in changing and delegates all " +"other methods to the corresponding method of ``x``." +msgstr "" +"Делегування — це об’єктно-орієнтована техніка (яка також називається " +"шаблоном проектування). Припустімо, у вас є об’єкт ``x`` і ви хочете змінити " +"поведінку лише одного з його методів. Ви можете створити новий клас, який " +"забезпечує нову реалізацію методу, який ви хочете змінити, і делегує всі " +"інші методи відповідному методу ``x``." + +msgid "" +"Python programmers can easily implement delegation. For example, the " +"following class implements a class that behaves like a file but converts all " +"written data to uppercase::" +msgstr "" +"Програмісти на Python можуть легко реалізувати делегування. Наприклад, " +"наступний клас реалізує клас, який поводиться як файл, але перетворює всі " +"записані дані у верхній регістр:" + +msgid "" +"class UpperOut:\n" +"\n" +" def __init__(self, outfile):\n" +" self._outfile = outfile\n" +"\n" +" def write(self, s):\n" +" self._outfile.write(s.upper())\n" +"\n" +" def __getattr__(self, name):\n" +" return getattr(self._outfile, name)" +msgstr "" + +msgid "" +"Here the ``UpperOut`` class redefines the ``write()`` method to convert the " +"argument string to uppercase before calling the underlying ``self._outfile." +"write()`` method. All other methods are delegated to the underlying ``self." +"_outfile`` object. The delegation is accomplished via the :meth:`~object." +"__getattr__` method; consult :ref:`the language reference ` for more information about controlling attribute access." +msgstr "" + +msgid "" +"Note that for more general cases delegation can get trickier. When " +"attributes must be set as well as retrieved, the class must define a :meth:" +"`~object.__setattr__` method too, and it must do so carefully. The basic " +"implementation of :meth:`!__setattr__` is roughly equivalent to the " +"following::" +msgstr "" + +msgid "" +"class X:\n" +" ...\n" +" def __setattr__(self, name, value):\n" +" self.__dict__[name] = value\n" +" ..." +msgstr "" + +msgid "" +"Many :meth:`~object.__setattr__` implementations call :meth:`!object." +"__setattr__` to set an attribute on self without causing infinite recursion::" +msgstr "" + +msgid "" +"class X:\n" +" def __setattr__(self, name, value):\n" +" # Custom logic here...\n" +" object.__setattr__(self, name, value)" +msgstr "" + +msgid "" +"Alternatively, it is possible to set attributes by inserting entries into :" +"attr:`self.__dict__ ` directly." +msgstr "" + +msgid "" +"How do I call a method defined in a base class from a derived class that " +"extends it?" +msgstr "" +"Як викликати метод, визначений у базовому класі, з похідного класу, який " +"його розширює?" + +msgid "Use the built-in :func:`super` function::" +msgstr "Використовуйте вбудовану функцію :func:`super`::" + +msgid "" +"class Derived(Base):\n" +" def meth(self):\n" +" super().meth() # calls Base.meth" +msgstr "" + +msgid "" +"In the example, :func:`super` will automatically determine the instance from " +"which it was called (the ``self`` value), look up the :term:`method " +"resolution order` (MRO) with ``type(self).__mro__``, and return the next in " +"line after ``Derived`` in the MRO: ``Base``." +msgstr "" +"У прикладі :func:`super` автоматично визначатиме екземпляр, з якого його " +"було викликано (значення ``self``), шукатиме :term:`method resolution order` " +"(MRO) за допомогою ``type(self) ).__mro__`` і повертає наступний рядок після " +"``Derived`` у MRO: ``Base``." + +msgid "How can I organize my code to make it easier to change the base class?" +msgstr "Як я можу організувати свій код, щоб полегшити зміну базового класу?" + +msgid "" +"You could assign the base class to an alias and derive from the alias. Then " +"all you have to change is the value assigned to the alias. Incidentally, " +"this trick is also handy if you want to decide dynamically (e.g. depending " +"on availability of resources) which base class to use. Example::" +msgstr "" +"Ви можете призначити базовий клас псевдоніму та отримати його від " +"псевдоніма. Тоді все, що вам потрібно змінити, це значення, присвоєне " +"псевдоніму. До речі, цей прийом також зручний, якщо ви хочете динамічно " +"(наприклад, залежно від наявності ресурсів) вирішувати, який базовий клас " +"використовувати. Приклад::" + +msgid "" +"class Base:\n" +" ...\n" +"\n" +"BaseAlias = Base\n" +"\n" +"class Derived(BaseAlias):\n" +" ..." +msgstr "" + +msgid "How do I create static class data and static class methods?" +msgstr "Як створити статичні дані класу та статичні методи класу?" + +msgid "" +"Both static data and static methods (in the sense of C++ or Java) are " +"supported in Python." +msgstr "" +"У Python підтримуються як статичні дані, так і статичні методи (у сенсі C++ " +"або Java)." + +msgid "" +"For static data, simply define a class attribute. To assign a new value to " +"the attribute, you have to explicitly use the class name in the assignment::" +msgstr "" +"Для статичних даних просто визначте атрибут класу. Щоб призначити нове " +"значення атрибуту, ви повинні явно використовувати ім’я класу в призначенні::" + +msgid "" +"class C:\n" +" count = 0 # number of times C.__init__ called\n" +"\n" +" def __init__(self):\n" +" C.count = C.count + 1\n" +"\n" +" def getcount(self):\n" +" return C.count # or return self.count" +msgstr "" + +msgid "" +"``c.count`` also refers to ``C.count`` for any ``c`` such that " +"``isinstance(c, C)`` holds, unless overridden by ``c`` itself or by some " +"class on the base-class search path from ``c.__class__`` back to ``C``." +msgstr "" +"``c.count`` також посилається на ``C.count`` для будь-якого ``c`` такого, що " +"``isinstance(c, C)`` має місце, якщо не перевизначено самим ``c`` або " +"деякими на шляху пошуку базового класу від ``c.__class__`` назад до ``C``." + +msgid "" +"Caution: within a method of C, an assignment like ``self.count = 42`` " +"creates a new and unrelated instance named \"count\" in ``self``'s own " +"dict. Rebinding of a class-static data name must always specify the class " +"whether inside a method or not::" +msgstr "" +"Застереження: у методі C призначення на кшталт ``self.count = 42`` створює " +"новий і непов’язаний екземпляр під назвою \"count\" у власному дикторі " +"``self``. Повторне прив’язування назви статичних даних класу має завжди " +"вказувати клас незалежно від того, чи знаходиться він у методі чи ні:" + +msgid "C.count = 314" +msgstr "" + +msgid "Static methods are possible::" +msgstr "Можливі статичні методи:" + +msgid "" +"class C:\n" +" @staticmethod\n" +" def static(arg1, arg2, arg3):\n" +" # No 'self' parameter!\n" +" ..." +msgstr "" + +msgid "" +"However, a far more straightforward way to get the effect of a static method " +"is via a simple module-level function::" +msgstr "" +"Однак набагато більш простий спосіб отримати ефект статичного методу — це за " +"допомогою простої функції на рівні модуля::" + +msgid "" +"def getcount():\n" +" return C.count" +msgstr "" + +msgid "" +"If your code is structured so as to define one class (or tightly related " +"class hierarchy) per module, this supplies the desired encapsulation." +msgstr "" +"Якщо ваш код структурований таким чином, щоб визначити один клас (або тісно " +"пов’язану ієрархію класів) на модуль, це забезпечує бажану інкапсуляцію." + +msgid "How can I overload constructors (or methods) in Python?" +msgstr "Як я можу перевантажити конструктори (або методи) у Python?" + +msgid "" +"This answer actually applies to all methods, but the question usually comes " +"up first in the context of constructors." +msgstr "" +"Ця відповідь фактично стосується всіх методів, але зазвичай це питання " +"виникає першим у контексті конструкторів." + +msgid "In C++ you'd write" +msgstr "У C++ ви б написали" + +msgid "" +"class C {\n" +" C() { cout << \"No arguments\\n\"; }\n" +" C(int i) { cout << \"Argument is \" << i << \"\\n\"; }\n" +"}" +msgstr "" + +msgid "" +"In Python you have to write a single constructor that catches all cases " +"using default arguments. For example::" +msgstr "" +"У Python ви повинні написати єдиний конструктор, який ловить усі випадки, " +"використовуючи аргументи за замовчуванням. Наприклад::" + +msgid "" +"class C:\n" +" def __init__(self, i=None):\n" +" if i is None:\n" +" print(\"No arguments\")\n" +" else:\n" +" print(\"Argument is\", i)" +msgstr "" + +msgid "This is not entirely equivalent, but close enough in practice." +msgstr "Це не зовсім еквівалентно, але досить близько на практиці." + +msgid "You could also try a variable-length argument list, e.g. ::" +msgstr "" +"Ви також можете спробувати список аргументів змінної довжини, наприклад. ::" + +msgid "" +"def __init__(self, *args):\n" +" ..." +msgstr "" + +msgid "The same approach works for all method definitions." +msgstr "Той самий підхід працює для всіх визначень методів." + +msgid "I try to use __spam and I get an error about _SomeClassName__spam." +msgstr "" +"Я намагаюся використовувати __спам і отримую помилку про " +"_SomeClassName__спам." + +msgid "" +"Variable names with double leading underscores are \"mangled\" to provide a " +"simple but effective way to define class private variables. Any identifier " +"of the form ``__spam`` (at least two leading underscores, at most one " +"trailing underscore) is textually replaced with ``_classname__spam``, where " +"``classname`` is the current class name with any leading underscores " +"stripped." +msgstr "" +"Назви змінних із подвійним підкресленням на початку \"спотворені\", щоб " +"забезпечити простий, але ефективний спосіб визначення приватних змінних " +"класу. Будь-який ідентифікатор у формі ``__spam`` (принаймні два символи " +"підкреслення на початку, не більше одного символу підкреслення в кінці) " +"текстово замінюється на ``_classname__spam``, де ``classname`` є поточною " +"назвою класу з будь-якими початковими символами підкреслення." + +msgid "" +"The identifier can be used unchanged within the class, but to access it " +"outside the class, the mangled name must be used:" +msgstr "" + +msgid "" +"class A:\n" +" def __one(self):\n" +" return 1\n" +" def two(self):\n" +" return 2 * self.__one()\n" +"\n" +"class B(A):\n" +" def three(self):\n" +" return 3 * self._A__one()\n" +"\n" +"four = 4 * A()._A__one()" +msgstr "" + +msgid "" +"In particular, this does not guarantee privacy since an outside user can " +"still deliberately access the private attribute; many Python programmers " +"never bother to use private variable names at all." +msgstr "" + +msgid "" +"The :ref:`private name mangling specifications ` for " +"details and special cases." +msgstr "" + +msgid "My class defines __del__ but it is not called when I delete the object." +msgstr "" +"Мій клас визначає __del__, але він не викликається, коли я видаляю об’єкт." + +msgid "There are several possible reasons for this." +msgstr "Для цього є кілька можливих причин." + +msgid "" +"The :keyword:`del` statement does not necessarily call :meth:`~object." +"__del__` -- it simply decrements the object's reference count, and if this " +"reaches zero :meth:`!__del__` is called." +msgstr "" + +msgid "" +"If your data structures contain circular links (e.g. a tree where each child " +"has a parent reference and each parent has a list of children) the reference " +"counts will never go back to zero. Once in a while Python runs an algorithm " +"to detect such cycles, but the garbage collector might run some time after " +"the last reference to your data structure vanishes, so your :meth:`!__del__` " +"method may be called at an inconvenient and random time. This is " +"inconvenient if you're trying to reproduce a problem. Worse, the order in " +"which object's :meth:`!__del__` methods are executed is arbitrary. You can " +"run :func:`gc.collect` to force a collection, but there *are* pathological " +"cases where objects will never be collected." +msgstr "" + +msgid "" +"Despite the cycle collector, it's still a good idea to define an explicit " +"``close()`` method on objects to be called whenever you're done with them. " +"The ``close()`` method can then remove attributes that refer to subobjects. " +"Don't call :meth:`!__del__` directly -- :meth:`!__del__` should call " +"``close()`` and ``close()`` should make sure that it can be called more than " +"once for the same object." +msgstr "" + +msgid "" +"Another way to avoid cyclical references is to use the :mod:`weakref` " +"module, which allows you to point to objects without incrementing their " +"reference count. Tree data structures, for instance, should use weak " +"references for their parent and sibling references (if they need them!)." +msgstr "" +"Іншим способом уникнути циклічних посилань є використання модуля :mod:" +"`weakref`, який дозволяє вам вказувати на об’єкти, не збільшуючи їх " +"кількість посилань. Деревоподібні структури даних, наприклад, повинні " +"використовувати слабкі посилання для своїх батьківських і братських посилань " +"(якщо вони їм потрібні!)." + +msgid "" +"Finally, if your :meth:`!__del__` method raises an exception, a warning " +"message is printed to :data:`sys.stderr`." +msgstr "" + +msgid "How do I get a list of all instances of a given class?" +msgstr "Як отримати список усіх екземплярів певного класу?" + +msgid "" +"Python does not keep track of all instances of a class (or of a built-in " +"type). You can program the class's constructor to keep track of all " +"instances by keeping a list of weak references to each instance." +msgstr "" +"Python не відстежує всі екземпляри класу (або вбудованого типу). Ви можете " +"запрограмувати конструктор класу для відстеження всіх екземплярів, " +"зберігаючи список слабких посилань на кожен екземпляр." + +msgid "Why does the result of ``id()`` appear to be not unique?" +msgstr "Чому результат ``id()`` здається не унікальним?" + +msgid "" +"The :func:`id` builtin returns an integer that is guaranteed to be unique " +"during the lifetime of the object. Since in CPython, this is the object's " +"memory address, it happens frequently that after an object is deleted from " +"memory, the next freshly created object is allocated at the same position in " +"memory. This is illustrated by this example:" +msgstr "" +"Вбудований :func:`id` повертає ціле число, яке гарантовано буде унікальним " +"протягом усього життя об’єкта. Оскільки в CPython це адреса пам’яті об’єкта, " +"часто трапляється так, що після видалення об’єкта з пам’яті наступний щойно " +"створений об’єкт розміщується в тій же позиції в пам’яті. Це проілюстровано " +"таким прикладом:" + +msgid "" +"The two ids belong to different integer objects that are created before, and " +"deleted immediately after execution of the ``id()`` call. To be sure that " +"objects whose id you want to examine are still alive, create another " +"reference to the object:" +msgstr "" +"Два ідентифікатори належать до різних цілочисельних об’єктів, створених " +"раніше та видалених одразу після виконання виклику ``id()``. Щоб " +"переконатися, що об’єкти, чий ідентифікатор ви хочете перевірити, все ще " +"живі, створіть інше посилання на об’єкт:" + +msgid "When can I rely on identity tests with the *is* operator?" +msgstr "Коли я можу покладатися на перевірку ідентичності з оператором *is*?" + +msgid "" +"The ``is`` operator tests for object identity. The test ``a is b`` is " +"equivalent to ``id(a) == id(b)``." +msgstr "" +"Оператор ``is`` перевіряє ідентичність об'єкта. Перевірка \"a is b\" " +"еквівалентна \"id(a) == id(b)\"." + +msgid "" +"The most important property of an identity test is that an object is always " +"identical to itself, ``a is a`` always returns ``True``. Identity tests are " +"usually faster than equality tests. And unlike equality tests, identity " +"tests are guaranteed to return a boolean ``True`` or ``False``." +msgstr "" +"Найважливіша властивість перевірки ідентичності полягає в тому, що об’єкт " +"завжди ідентичний самому собі, ``a is a`` завжди повертає ``True``. Тести " +"ідентифікації зазвичай швидші, ніж тести рівності. І на відміну від тестів " +"на рівність, тести ідентичності гарантовано повертають логічне значення " +"``True`` або ``False``." + +msgid "" +"However, identity tests can *only* be substituted for equality tests when " +"object identity is assured. Generally, there are three circumstances where " +"identity is guaranteed:" +msgstr "" +"Однак тести на ідентичність можна *тільки* замінити на тести на рівність, " +"якщо ідентичність об’єкта забезпечена. Загалом існує три обставини, за яких " +"ідентичність гарантується:" + +msgid "" +"Assignments create new names but do not change object identity. After the " +"assignment ``new = old``, it is guaranteed that ``new is old``." +msgstr "" + +msgid "" +"Putting an object in a container that stores object references does not " +"change object identity. After the list assignment ``s[0] = x``, it is " +"guaranteed that ``s[0] is x``." +msgstr "" + +msgid "" +"If an object is a singleton, it means that only one instance of that object " +"can exist. After the assignments ``a = None`` and ``b = None``, it is " +"guaranteed that ``a is b`` because ``None`` is a singleton." +msgstr "" + +msgid "" +"In most other circumstances, identity tests are inadvisable and equality " +"tests are preferred. In particular, identity tests should not be used to " +"check constants such as :class:`int` and :class:`str` which aren't " +"guaranteed to be singletons::" +msgstr "" +"У більшості інших обставин тести на ідентичність є недоцільними, а тести на " +"рівність є кращими. Зокрема, тести ідентичності не слід використовувати для " +"перевірки таких констант, як :class:`int` і :class:`str`, які не гарантовано " +"є одиночними:" + +msgid "" +">>> a = 1000\n" +">>> b = 500\n" +">>> c = b + 500\n" +">>> a is c\n" +"False\n" +"\n" +">>> a = 'Python'\n" +">>> b = 'Py'\n" +">>> c = b + 'thon'\n" +">>> a is c\n" +"False" +msgstr "" + +msgid "Likewise, new instances of mutable containers are never identical::" +msgstr "" +"Подібним чином нові екземпляри змінних контейнерів ніколи не бувають " +"ідентичними:" + +msgid "" +">>> a = []\n" +">>> b = []\n" +">>> a is b\n" +"False" +msgstr "" + +msgid "" +"In the standard library code, you will see several common patterns for " +"correctly using identity tests:" +msgstr "" +"У коді стандартної бібліотеки ви побачите кілька загальних шаблонів для " +"правильного використання тестів ідентичності:" + +msgid "" +"As recommended by :pep:`8`, an identity test is the preferred way to check " +"for ``None``. This reads like plain English in code and avoids confusion " +"with other objects that may have boolean values that evaluate to false." +msgstr "" + +msgid "" +"Detecting optional arguments can be tricky when ``None`` is a valid input " +"value. In those situations, you can create a singleton sentinel object " +"guaranteed to be distinct from other objects. For example, here is how to " +"implement a method that behaves like :meth:`dict.pop`:" +msgstr "" + +msgid "" +"_sentinel = object()\n" +"\n" +"def pop(self, key, default=_sentinel):\n" +" if key in self:\n" +" value = self[key]\n" +" del self[key]\n" +" return value\n" +" if default is _sentinel:\n" +" raise KeyError(key)\n" +" return default" +msgstr "" + +msgid "" +"Container implementations sometimes need to augment equality tests with " +"identity tests. This prevents the code from being confused by objects such " +"as ``float('NaN')`` that are not equal to themselves." +msgstr "" + +msgid "" +"For example, here is the implementation of :meth:`!collections.abc.Sequence." +"__contains__`::" +msgstr "" + +msgid "" +"def __contains__(self, value):\n" +" for v in self:\n" +" if v is value or v == value:\n" +" return True\n" +" return False" +msgstr "" + +msgid "" +"How can a subclass control what data is stored in an immutable instance?" +msgstr "" +"Як підклас може контролювати, які дані зберігаються в незмінному екземплярі?" + +msgid "" +"When subclassing an immutable type, override the :meth:`~object.__new__` " +"method instead of the :meth:`~object.__init__` method. The latter only runs " +"*after* an instance is created, which is too late to alter data in an " +"immutable instance." +msgstr "" + +msgid "" +"All of these immutable classes have a different signature than their parent " +"class:" +msgstr "Усі ці незмінні класи мають інший підпис, ніж їх батьківський клас:" + +msgid "" +"from datetime import date\n" +"\n" +"class FirstOfMonthDate(date):\n" +" \"Always choose the first day of the month\"\n" +" def __new__(cls, year, month, day):\n" +" return super().__new__(cls, year, month, 1)\n" +"\n" +"class NamedInt(int):\n" +" \"Allow text names for some numbers\"\n" +" xlat = {'zero': 0, 'one': 1, 'ten': 10}\n" +" def __new__(cls, value):\n" +" value = cls.xlat.get(value, value)\n" +" return super().__new__(cls, value)\n" +"\n" +"class TitleStr(str):\n" +" \"Convert str to name suitable for a URL path\"\n" +" def __new__(cls, s):\n" +" s = s.lower().replace(' ', '-')\n" +" s = ''.join([c for c in s if c.isalnum() or c == '-'])\n" +" return super().__new__(cls, s)" +msgstr "" + +msgid "The classes can be used like this:" +msgstr "Класи можна використовувати так:" + +msgid "" +">>> FirstOfMonthDate(2012, 2, 14)\n" +"FirstOfMonthDate(2012, 2, 1)\n" +">>> NamedInt('ten')\n" +"10\n" +">>> NamedInt(20)\n" +"20\n" +">>> TitleStr('Blog: Why Python Rocks')\n" +"'blog-why-python-rocks'" +msgstr "" + +msgid "How do I cache method calls?" +msgstr "Як кешувати виклики методів?" + +msgid "" +"The two principal tools for caching methods are :func:`functools." +"cached_property` and :func:`functools.lru_cache`. The former stores results " +"at the instance level and the latter at the class level." +msgstr "" +"Двома основними інструментами для методів кешування є :func:`functools." +"cached_property` і :func:`functools.lru_cache`. Перший зберігає результати " +"на рівні екземпляра, а другий — на рівні класу." + +msgid "" +"The *cached_property* approach only works with methods that do not take any " +"arguments. It does not create a reference to the instance. The cached " +"method result will be kept only as long as the instance is alive." +msgstr "" +"Підхід *cached_property* працює лише з методами, які не приймають жодних " +"аргументів. Він не створює посилання на екземпляр. Кешований результат " +"методу зберігатиметься лише доти, доки екземпляр активний." + +msgid "" +"The advantage is that when an instance is no longer used, the cached method " +"result will be released right away. The disadvantage is that if instances " +"accumulate, so too will the accumulated method results. They can grow " +"without bound." +msgstr "" +"Перевагою є те, що коли екземпляр більше не використовується, кешований " +"результат методу буде негайно опубліковано. Недоліком є те, що якщо " +"екземпляри накопичуються, накопичений метод теж буде результатом. Вони " +"можуть рости необмежено." + +msgid "" +"The *lru_cache* approach works with methods that have :term:`hashable` " +"arguments. It creates a reference to the instance unless special efforts " +"are made to pass in weak references." +msgstr "" + +msgid "" +"The advantage of the least recently used algorithm is that the cache is " +"bounded by the specified *maxsize*. The disadvantage is that instances are " +"kept alive until they age out of the cache or until the cache is cleared." +msgstr "" +"Перевага найменш використовуваного алгоритму полягає в тому, що кеш " +"обмежений указаним *maxsize*. Недоліком є те, що екземпляри залишаються " +"активними, поки вони не вичерпаються з кешу або поки кеш не буде очищено." + +msgid "This example shows the various techniques::" +msgstr "Цей приклад демонструє різні техніки:" + +msgid "" +"class Weather:\n" +" \"Lookup weather information on a government website\"\n" +"\n" +" def __init__(self, station_id):\n" +" self._station_id = station_id\n" +" # The _station_id is private and immutable\n" +"\n" +" def current_temperature(self):\n" +" \"Latest hourly observation\"\n" +" # Do not cache this because old results\n" +" # can be out of date.\n" +"\n" +" @cached_property\n" +" def location(self):\n" +" \"Return the longitude/latitude coordinates of the station\"\n" +" # Result only depends on the station_id\n" +"\n" +" @lru_cache(maxsize=20)\n" +" def historic_rainfall(self, date, units='mm'):\n" +" \"Rainfall on a given date\"\n" +" # Depends on the station_id, date, and units." +msgstr "" + +msgid "" +"The above example assumes that the *station_id* never changes. If the " +"relevant instance attributes are mutable, the *cached_property* approach " +"can't be made to work because it cannot detect changes to the attributes." +msgstr "" +"Наведений вище приклад передбачає, що *station_id* ніколи не змінюється. " +"Якщо відповідні атрибути екземпляра є змінними, підхід *cached_property* не " +"може працювати, оскільки він не може виявити зміни в атрибутах." + +msgid "" +"To make the *lru_cache* approach work when the *station_id* is mutable, the " +"class needs to define the :meth:`~object.__eq__` and :meth:`~object." +"__hash__` methods so that the cache can detect relevant attribute updates::" +msgstr "" + +msgid "" +"class Weather:\n" +" \"Example with a mutable station identifier\"\n" +"\n" +" def __init__(self, station_id):\n" +" self.station_id = station_id\n" +"\n" +" def change_station(self, station_id):\n" +" self.station_id = station_id\n" +"\n" +" def __eq__(self, other):\n" +" return self.station_id == other.station_id\n" +"\n" +" def __hash__(self):\n" +" return hash(self.station_id)\n" +"\n" +" @lru_cache(maxsize=20)\n" +" def historic_rainfall(self, date, units='cm'):\n" +" 'Rainfall on a given date'\n" +" # Depends on the station_id, date, and units." +msgstr "" + +msgid "Modules" +msgstr "Модулі" + +msgid "How do I create a .pyc file?" +msgstr "Як створити файл .pyc?" + +msgid "" +"When a module is imported for the first time (or when the source file has " +"changed since the current compiled file was created) a ``.pyc`` file " +"containing the compiled code should be created in a ``__pycache__`` " +"subdirectory of the directory containing the ``.py`` file. The ``.pyc`` " +"file will have a filename that starts with the same name as the ``.py`` " +"file, and ends with ``.pyc``, with a middle component that depends on the " +"particular ``python`` binary that created it. (See :pep:`3147` for details.)" +msgstr "" +"Коли модуль імпортується вперше (або якщо вихідний файл змінився після " +"створення поточного скомпільованого файлу), файл ``.pyc``, що містить " +"скомпільований код, має бути створений у підкаталозі ``__pycache__`` " +"каталог, що містить файл ``.py``. Файл ``.pyc`` матиме назву файлу, яка " +"починається з тієї самої назви, що й файл ``.py``, і закінчується ``.pyc``, " +"із середнім компонентом, який залежить від конкретного ``python`` двійковий " +"файл, який його створив. (Докладніше див. :pep:`3147`.)" + +msgid "" +"One reason that a ``.pyc`` file may not be created is a permissions problem " +"with the directory containing the source file, meaning that the " +"``__pycache__`` subdirectory cannot be created. This can happen, for " +"example, if you develop as one user but run as another, such as if you are " +"testing with a web server." +msgstr "" +"Однією з причин того, що файл ``.pyc`` може не бути створений, є проблема з " +"дозволами для каталогу, що містить вихідний файл, тобто неможливо створити " +"підкаталог ``__pycache__``. Це може статися, наприклад, якщо ви розробляєте " +"як один користувач, але запускаєте як інший, наприклад, якщо ви тестуєте за " +"допомогою веб-сервера." + +msgid "" +"Unless the :envvar:`PYTHONDONTWRITEBYTECODE` environment variable is set, " +"creation of a .pyc file is automatic if you're importing a module and Python " +"has the ability (permissions, free space, etc...) to create a " +"``__pycache__`` subdirectory and write the compiled module to that " +"subdirectory." +msgstr "" +"Якщо не встановлено змінну середовища :envvar:`PYTHONDONTWRITEBYTECODE`, " +"створення файлу .pyc відбувається автоматично, якщо ви імпортуєте модуль і " +"Python має можливість (дозволи, вільне місце тощо) створити ``__pycache__`` " +"підкаталог і записати скомпільований модуль у цей підкаталог." + +msgid "" +"Running Python on a top level script is not considered an import and no ``." +"pyc`` will be created. For example, if you have a top-level module ``foo." +"py`` that imports another module ``xyz.py``, when you run ``foo`` (by typing " +"``python foo.py`` as a shell command), a ``.pyc`` will be created for " +"``xyz`` because ``xyz`` is imported, but no ``.pyc`` file will be created " +"for ``foo`` since ``foo.py`` isn't being imported." +msgstr "" +"Запуск Python на сценарії верхнього рівня не вважається імпортом, і ``.pyc`` " +"не буде створено. Наприклад, якщо у вас є модуль верхнього рівня ``foo.py``, " +"який імпортує інший модуль ``xyz.py``, коли ви запускаєте ``foo`` (ввівши " +"``python foo.py`` як команду оболонки), для ``xyz`` буде створено ``.pyc``, " +"оскільки ``xyz`` імпортовано, але файл ``.pyc`` не буде створено для " +"``foo``, оскільки ``foo.py`` не імпортується." + +msgid "" +"If you need to create a ``.pyc`` file for ``foo`` -- that is, to create a ``." +"pyc`` file for a module that is not imported -- you can, using the :mod:" +"`py_compile` and :mod:`compileall` modules." +msgstr "" +"Якщо вам потрібно створити файл ``.pyc`` для ``foo``, тобто створити файл ``." +"pyc`` для модуля, який не імпортується, ви можете, використовувати модулі :" +"mod:`py_compile` і :mod:`compileall`." + +msgid "" +"The :mod:`py_compile` module can manually compile any module. One way is to " +"use the ``compile()`` function in that module interactively::" +msgstr "" +"Модуль :mod:`py_compile` може вручну скомпілювати будь-який модуль. Одним із " +"способів є використання функції ``compile()`` у цьому модулі в " +"інтерактивному режимі:" + +msgid "" +">>> import py_compile\n" +">>> py_compile.compile('foo.py')" +msgstr "" + +msgid "" +"This will write the ``.pyc`` to a ``__pycache__`` subdirectory in the same " +"location as ``foo.py`` (or you can override that with the optional parameter " +"``cfile``)." +msgstr "" +"Це запише ``.pyc`` до підкаталогу ``__pycache__`` в тому самому місці, що " +"``foo.py`` (або ви можете змінити це за допомогою додаткового параметра " +"``cfile``)." + +msgid "" +"You can also automatically compile all files in a directory or directories " +"using the :mod:`compileall` module. You can do it from the shell prompt by " +"running ``compileall.py`` and providing the path of a directory containing " +"Python files to compile::" +msgstr "" +"Ви також можете автоматично скомпілювати всі файли в каталозі або каталогах " +"за допомогою модуля :mod:`compileall`. Ви можете зробити це з підказки " +"оболонки, запустивши ``compileall.py`` і вказавши шлях до каталогу, що " +"містить файли Python для компіляції::" + +msgid "python -m compileall ." +msgstr "" + +msgid "How do I find the current module name?" +msgstr "Як знайти поточну назву модуля?" + +msgid "" +"A module can find out its own module name by looking at the predefined " +"global variable ``__name__``. If this has the value ``'__main__'``, the " +"program is running as a script. Many modules that are usually used by " +"importing them also provide a command-line interface or a self-test, and " +"only execute this code after checking ``__name__``::" +msgstr "" +"Модуль може дізнатися власну назву модуля, дивлячись на попередньо визначену " +"глобальну змінну ``__name__``. Якщо має значення ``'__main__``, програма " +"виконується як сценарій. Багато модулів, які зазвичай використовуються " +"шляхом їх імпорту, також забезпечують інтерфейс командного рядка або " +"самоперевірку та виконують цей код лише після перевірки ``__name__``::" + +msgid "" +"def main():\n" +" print('Running test...')\n" +" ...\n" +"\n" +"if __name__ == '__main__':\n" +" main()" +msgstr "" + +msgid "How can I have modules that mutually import each other?" +msgstr "Як я можу мати модулі, які взаємно імпортують один одного?" + +msgid "Suppose you have the following modules:" +msgstr "Припустимо, у вас є такі модулі:" + +msgid ":file:`foo.py`::" +msgstr ":file:`foo.py`::" + +msgid "" +"from bar import bar_var\n" +"foo_var = 1" +msgstr "" + +msgid ":file:`bar.py`::" +msgstr ":file:`bar.py`::" + +msgid "" +"from foo import foo_var\n" +"bar_var = 2" +msgstr "" + +msgid "The problem is that the interpreter will perform the following steps:" +msgstr "Проблема полягає в тому, що перекладач виконуватиме наступні кроки:" + +msgid "main imports ``foo``" +msgstr "основний імпорт ``foo``" + +msgid "Empty globals for ``foo`` are created" +msgstr "Створюються порожні глобальні значення для ``foo``" + +msgid "``foo`` is compiled and starts executing" +msgstr "``foo`` компілюється та починає виконуватися" + +msgid "``foo`` imports ``bar``" +msgstr "``foo`` імпортує ``bar``" + +msgid "Empty globals for ``bar`` are created" +msgstr "Створено порожні глобали для ``bar``" + +msgid "``bar`` is compiled and starts executing" +msgstr "``bar`` компілюється та починає виконуватися" + +msgid "" +"``bar`` imports ``foo`` (which is a no-op since there already is a module " +"named ``foo``)" +msgstr "" +"``bar`` імпортує ``foo`` (що є безопераційним, оскільки вже існує модуль з " +"назвою ``foo``)" + +msgid "" +"The import mechanism tries to read ``foo_var`` from ``foo`` globals, to set " +"``bar.foo_var = foo.foo_var``" +msgstr "" +"Механізм імпорту намагається прочитати ``foo_var`` з ``foo`` глобальних, щоб " +"встановити ``bar.foo_var = foo.foo_var``" + +msgid "" +"The last step fails, because Python isn't done with interpreting ``foo`` yet " +"and the global symbol dictionary for ``foo`` is still empty." +msgstr "" +"Останній крок не вдається, оскільки Python ще не завершив інтерпретацію " +"``foo``, а глобальний словник символів для ``foo`` все ще порожній." + +msgid "" +"The same thing happens when you use ``import foo``, and then try to access " +"``foo.foo_var`` in global code." +msgstr "" +"Те ж саме відбувається, коли ви використовуєте ``import foo``, а потім " +"намагаєтесь отримати доступ ``foo.foo_var`` у глобальному коді." + +msgid "There are (at least) three possible workarounds for this problem." +msgstr "Є (принаймні) три можливі способи вирішення цієї проблеми." + +msgid "" +"Guido van Rossum recommends avoiding all uses of ``from import ..." +"``, and placing all code inside functions. Initializations of global " +"variables and class variables should use constants or built-in functions " +"only. This means everything from an imported module is referenced as " +"``.``." +msgstr "" +"Гвідо ван Россум рекомендує уникати будь-якого використання ``from " +"import ...`` і розміщувати весь код у функціях. Для ініціалізації глобальних " +"змінних і змінних класу слід використовувати лише константи або вбудовані " +"функції. Це означає, що все з імпортованого модуля посилається як " +"`` . ``." + +msgid "" +"Jim Roskind suggests performing steps in the following order in each module:" +msgstr "" +"Джим Роскінд пропонує виконувати кроки в такому порядку в кожному модулі:" + +msgid "" +"exports (globals, functions, and classes that don't need imported base " +"classes)" +msgstr "" +"експорт (глобальні елементи, функції та класи, яким не потрібні імпортовані " +"базові класи)" + +msgid "``import`` statements" +msgstr "оператори ``імпорту``" + +msgid "" +"active code (including globals that are initialized from imported values)." +msgstr "" +"активний код (включаючи глобальні значення, ініціалізовані з імпортованих " +"значень)." + +msgid "" +"Van Rossum doesn't like this approach much because the imports appear in a " +"strange place, but it does work." +msgstr "" +"Ван Россуму не дуже подобається такий підхід, оскільки імпорт з’являється в " +"незнайомому місці, але він працює." + +msgid "" +"Matthias Urlichs recommends restructuring your code so that the recursive " +"import is not necessary in the first place." +msgstr "" +"Матіас Урліхс рекомендує реструктуризувати ваш код, щоб рекурсивний імпорт " +"не був необхідним." + +msgid "These solutions are not mutually exclusive." +msgstr "Ці рішення не є взаємовиключними." + +msgid "__import__('x.y.z') returns ; how do I get z?" +msgstr "__import__('x.y.z') повертає ; як я можу отримати z?" + +msgid "" +"Consider using the convenience function :func:`~importlib.import_module` " +"from :mod:`importlib` instead::" +msgstr "" +"Замість цього можна скористатися зручною функцією :func:`~importlib." +"import_module` з :mod:`importlib`::" + +msgid "z = importlib.import_module('x.y.z')" +msgstr "" + +msgid "" +"When I edit an imported module and reimport it, the changes don't show up. " +"Why does this happen?" +msgstr "" +"Коли я редагую імпортований модуль і повторно імпортую його, зміни не " +"відображаються. чому це відбувається" + +msgid "" +"For reasons of efficiency as well as consistency, Python only reads the " +"module file on the first time a module is imported. If it didn't, in a " +"program consisting of many modules where each one imports the same basic " +"module, the basic module would be parsed and re-parsed many times. To force " +"re-reading of a changed module, do this::" +msgstr "" +"З міркувань ефективності та узгодженості Python читає файл модуля лише під " +"час першого імпорту модуля. Якби цього не було, у програмі, що складається з " +"багатьох модулів, кожен з яких імпортує той самий базовий модуль, базовий " +"модуль аналізувався б і повторно аналізувався багато разів. Щоб примусово " +"перечитати змінений модуль, виконайте наступне:" + +msgid "" +"import importlib\n" +"import modname\n" +"importlib.reload(modname)" +msgstr "" + +msgid "" +"Warning: this technique is not 100% fool-proof. In particular, modules " +"containing statements like ::" +msgstr "" +"Попередження: ця техніка не є на 100% надійною. Зокрема, модулі, що містять " +"оператори типу ::" + +msgid "from modname import some_objects" +msgstr "" + +msgid "" +"will continue to work with the old version of the imported objects. If the " +"module contains class definitions, existing class instances will *not* be " +"updated to use the new class definition. This can result in the following " +"paradoxical behaviour::" +msgstr "" +"продовжить працювати зі старою версією імпортованих об'єктів. Якщо модуль " +"містить визначення класу, існуючі екземпляри класу *не* будуть оновлені для " +"використання нового визначення класу. Це може призвести до наступної " +"парадоксальної поведінки:" + +msgid "" +">>> import importlib\n" +">>> import cls\n" +">>> c = cls.C() # Create an instance of C\n" +">>> importlib.reload(cls)\n" +"\n" +">>> isinstance(c, cls.C) # isinstance is false?!?\n" +"False" +msgstr "" + +msgid "" +"The nature of the problem is made clear if you print out the \"identity\" of " +"the class objects::" +msgstr "" +"Природа проблеми стане зрозумілою, якщо ви роздрукуєте \"ідентичність\" " +"об’єктів класу:" + +msgid "" +">>> hex(id(c.__class__))\n" +"'0x7352a0'\n" +">>> hex(id(cls.C))\n" +"'0x4198d0'" +msgstr "" + +msgid "argument" +msgstr "аргумент" + +msgid "difference from parameter" +msgstr "" + +msgid "parameter" +msgstr "параметр" + +msgid "difference from argument" +msgstr "" diff --git a/faq/windows.po b/faq/windows.po new file mode 100644 index 000000000..35e38b2a3 --- /dev/null +++ b/faq/windows.po @@ -0,0 +1,510 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:52+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Python on Windows FAQ" +msgstr "Поширені запитання про Python у Windows" + +msgid "Contents" +msgstr "Зміст" + +msgid "How do I run a Python program under Windows?" +msgstr "Як запустити програму Python під Windows?" + +msgid "" +"This is not necessarily a straightforward question. If you are already " +"familiar with running programs from the Windows command line then everything " +"will seem obvious; otherwise, you might need a little more guidance." +msgstr "" +"Це не обов’язково однозначне запитання. Якщо ви вже знайомі із запуском " +"програм із командного рядка Windows, то все буде здаватися очевидним; інакше " +"вам може знадобитися трохи більше вказівок." + +msgid "" +"Unless you use some sort of integrated development environment, you will end " +"up *typing* Windows commands into what is referred to as a \"Command prompt " +"window\". Usually you can create such a window from your search bar by " +"searching for ``cmd``. You should be able to recognize when you have " +"started such a window because you will see a Windows \"command prompt\", " +"which usually looks like this:" +msgstr "" +"Якщо ви не використовуєте якесь інтегроване середовище розробки, вам " +"доведеться *вводити* команди Windows у так зване \"вікно командного рядка\". " +"Зазвичай ви можете створити таке вікно з панелі пошуку, виконавши пошук за " +"``cmd``. Ви повинні мати змогу розпізнати, коли ви запустили таке вікно, " +"оскільки ви побачите \"командний рядок\" Windows, який зазвичай виглядає так:" + +msgid "C:\\>" +msgstr "" + +msgid "" +"The letter may be different, and there might be other things after it, so " +"you might just as easily see something like:" +msgstr "" +"Літера може бути іншою, і після неї можуть бути інші речі, тому ви можете " +"так само легко побачити щось на зразок:" + +msgid "D:\\YourName\\Projects\\Python>" +msgstr "" + +msgid "" +"depending on how your computer has been set up and what else you have " +"recently done with it. Once you have started such a window, you are well on " +"the way to running Python programs." +msgstr "" +"залежно від того, як налаштовано ваш комп’ютер і що ще ви нещодавно з ним " +"робили. Як тільки ви запустили таке вікно, ви вже на шляху до запуску " +"програм Python." + +msgid "" +"You need to realize that your Python scripts have to be processed by another " +"program called the Python *interpreter*. The interpreter reads your script, " +"compiles it into bytecodes, and then executes the bytecodes to run your " +"program. So, how do you arrange for the interpreter to handle your Python?" +msgstr "" +"Ви повинні усвідомити, що ваші сценарії Python мають оброблятися іншою " +"програмою під назвою *інтерпретатор* Python. Інтерпретатор читає ваш " +"сценарій, компілює його в байт-коди, а потім виконує байт-коди для запуску " +"вашої програми. Отже, як організувати роботу інтерпретатора з вашим Python?" + +msgid "" +"First, you need to make sure that your command window recognises the word " +"\"py\" as an instruction to start the interpreter. If you have opened a " +"command window, you should try entering the command ``py`` and hitting " +"return:" +msgstr "" +"По-перше, вам потрібно переконатися, що ваше командне вікно розпізнає слово " +"\"py\" як інструкцію для запуску інтерпретатора. Якщо ви відкрили командне " +"вікно, спробуйте ввести команду ``py`` і натиснути клавішу return:" + +msgid "C:\\Users\\YourName> py" +msgstr "" + +msgid "You should then see something like:" +msgstr "Тоді ви повинні побачити щось на зразок:" + +msgid "" +"Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:04:45) [MSC v.1900 32 bit " +"(Intel)] on win32\n" +"Type \"help\", \"copyright\", \"credits\" or \"license\" for more " +"information.\n" +">>>" +msgstr "" + +msgid "" +"You have started the interpreter in \"interactive mode\". That means you can " +"enter Python statements or expressions interactively and have them executed " +"or evaluated while you wait. This is one of Python's strongest features. " +"Check it by entering a few expressions of your choice and seeing the results:" +msgstr "" +"Ви запустили перекладач в \"інтерактивному режимі\". Це означає, що ви " +"можете інтерактивно вводити оператори або вирази Python і виконувати їх чи " +"оцінювати, поки ви чекаєте. Це одна з найсильніших можливостей Python. " +"Перевірте це, ввівши кілька виразів на ваш вибір і переглянувши результати:" + +msgid "" +">>> print(\"Hello\")\n" +"Hello\n" +">>> \"Hello\" * 3\n" +"'HelloHelloHello'" +msgstr "" + +msgid "" +"Many people use the interactive mode as a convenient yet highly programmable " +"calculator. When you want to end your interactive Python session, call the :" +"func:`exit` function or hold the :kbd:`Ctrl` key down while you enter a :kbd:" +"`Z`, then hit the \":kbd:`Enter`\" key to get back to your Windows command " +"prompt." +msgstr "" +"Багато людей використовують інтерактивний режим як зручний, але добре " +"програмований калькулятор. Якщо ви хочете завершити свій інтерактивний сеанс " +"Python, викличте функцію :func:`exit` або утримуйте клавішу :kbd:`Ctrl`, " +"вводячи :kbd:`Z`, а потім натисніть \":kbd:`Enter`\", щоб повернутися до " +"командного рядка Windows." + +msgid "" +"You may also find that you have a Start-menu entry such as :menuselection:" +"`Start --> Programs --> Python 3.x --> Python (command line)` that results " +"in you seeing the ``>>>`` prompt in a new window. If so, the window will " +"disappear after you call the :func:`exit` function or enter the :kbd:`Ctrl-" +"Z` character; Windows is running a single \"python\" command in the window, " +"and closes it when you terminate the interpreter." +msgstr "" +"Ви також можете виявити, що у вас є пункт меню \"Пуск\", наприклад :" +"menuselection:`Пуск --> Програми --> Python 3.x --> Python (командний " +"рядок)`, який призводить до того, що ви бачите ``>>>`` у новому вікні. Якщо " +"так, вікно зникне після виклику функції :func:`exit` або введення символу :" +"kbd:`Ctrl-Z`; Windows виконує одну команду \"python\" у вікні та закриває " +"її, коли ви завершуєте роботу інтерпретатора." + +msgid "" +"Now that we know the ``py`` command is recognized, you can give your Python " +"script to it. You'll have to give either an absolute or a relative path to " +"the Python script. Let's say your Python script is located in your desktop " +"and is named ``hello.py``, and your command prompt is nicely opened in your " +"home directory so you're seeing something similar to::" +msgstr "" +"Тепер, коли ми знаємо, що команда ``py`` розпізнається, ви можете надати їй " +"свій сценарій Python. Вам потрібно буде вказати або абсолютний, або " +"відносний шлях до сценарію Python. Припустімо, що ваш сценарій Python " +"розташований на робочому столі та має назву ``hello.py``, а ваш командний " +"рядок добре відкрито у вашому домашньому каталозі, тому ви бачите щось " +"подібне до:" + +msgid "C:\\Users\\YourName>" +msgstr "" + +msgid "" +"So now you'll ask the ``py`` command to give your script to Python by typing " +"``py`` followed by your script path::" +msgstr "" +"Отже, тепер ви попросите команду ``py`` передати ваш сценарій Python, ввівши " +"``py``, а потім шлях до вашого сценарію::" + +msgid "" +"C:\\Users\\YourName> py Desktop\\hello.py\n" +"hello" +msgstr "" + +msgid "How do I make Python scripts executable?" +msgstr "Як зробити сценарії Python виконуваними?" + +msgid "" +"On Windows, the standard Python installer already associates the .py " +"extension with a file type (Python.File) and gives that file type an open " +"command that runs the interpreter (``D:\\Program Files\\Python\\python.exe " +"\"%1\" %*``). This is enough to make scripts executable from the command " +"prompt as 'foo.py'. If you'd rather be able to execute the script by simple " +"typing 'foo' with no extension you need to add .py to the PATHEXT " +"environment variable." +msgstr "" +"У Windows стандартний інсталятор Python уже пов’язує розширення .py з типом " +"файлу (Python.File) і дає цьому типу файлу команду відкриття, яка запускає " +"інтерпретатор (``D:\\Program Files\\Python\\python.exe \"% 1\" %*``). Цього " +"достатньо, щоб зробити скрипти виконуваними з командного рядка як \"foo." +"py\". Якщо ви бажаєте виконати сценарій, просто ввівши 'foo' без розширення, " +"вам потрібно додати .py до змінної середовища PATHEXT." + +msgid "Why does Python sometimes take so long to start?" +msgstr "Чому іноді Python запускається так довго?" + +msgid "" +"Usually Python starts very quickly on Windows, but occasionally there are " +"bug reports that Python suddenly begins to take a long time to start up. " +"This is made even more puzzling because Python will work fine on other " +"Windows systems which appear to be configured identically." +msgstr "" +"Зазвичай Python запускається дуже швидко в Windows, але іноді з’являються " +"повідомлення про помилки, коли Python раптово починає займати багато часу " +"для запуску. Це стає ще більш загадковим, оскільки Python добре працюватиме " +"на інших системах Windows, які, здається, налаштовані однаково." + +msgid "" +"The problem may be caused by a misconfiguration of virus checking software " +"on the problem machine. Some virus scanners have been known to introduce " +"startup overhead of two orders of magnitude when the scanner is configured " +"to monitor all reads from the filesystem. Try checking the configuration of " +"virus scanning software on your systems to ensure that they are indeed " +"configured identically. McAfee, when configured to scan all file system read " +"activity, is a particular offender." +msgstr "" +"Проблема може бути викликана неправильною конфігурацією програмного " +"забезпечення перевірки вірусів на проблемній машині. Відомо, що деякі " +"сканери вірусів створюють накладні витрати на запуск у два порядки величини, " +"коли сканер налаштовано на моніторинг усіх зчитувань із файлової системи. " +"Спробуйте перевірити конфігурацію програмного забезпечення для сканування " +"вірусів у своїх системах, щоб переконатися, що вони справді налаштовані " +"однаково. McAfee, налаштований на сканування всіх операцій читання файлової " +"системи, є особливим порушником." + +msgid "How do I make an executable from a Python script?" +msgstr "Як створити виконуваний файл із сценарію Python?" + +msgid "" +"See :ref:`faq-create-standalone-binary` for a list of tools that can be used " +"to make executables." +msgstr "" +"Перегляньте :ref:`faq-create-standalone-binary` список інструментів, які " +"можна використовувати для створення виконуваних файлів." + +msgid "Is a ``*.pyd`` file the same as a DLL?" +msgstr "Чи файл ``*.pyd`` те саме, що DLL?" + +msgid "" +"Yes, .pyd files are dll's, but there are a few differences. If you have a " +"DLL named ``foo.pyd``, then it must have a function ``PyInit_foo()``. You " +"can then write Python \"import foo\", and Python will search for foo.pyd (as " +"well as foo.py, foo.pyc) and if it finds it, will attempt to call " +"``PyInit_foo()`` to initialize it. You do not link your .exe with foo.lib, " +"as that would cause Windows to require the DLL to be present." +msgstr "" +"Так, файли .pyd є dll, але є кілька відмінностей. Якщо у вас є DLL з назвою " +"``foo.pyd``, тоді вона повинна мати функцію ``PyInit_foo()``. Потім ви " +"можете написати Python \"import foo\", і Python шукатиме foo.pyd (а також " +"foo.py, foo.pyc) і, якщо знайде його, спробує викликати ``PyInit_foo()``, " +"щоб ініціалізувати його . Ви не пов’язуєте свій .exe з foo.lib, оскільки це " +"змусить Windows вимагати наявності DLL." + +msgid "" +"Note that the search path for foo.pyd is PYTHONPATH, not the same as the " +"path that Windows uses to search for foo.dll. Also, foo.pyd need not be " +"present to run your program, whereas if you linked your program with a dll, " +"the dll is required. Of course, foo.pyd is required if you want to say " +"``import foo``. In a DLL, linkage is declared in the source code with " +"``__declspec(dllexport)``. In a .pyd, linkage is defined in a list of " +"available functions." +msgstr "" +"Зауважте, що шлях пошуку для foo.pyd — це PYTHONPATH, а не шлях, який " +"Windows використовує для пошуку foo.dll. Крім того, foo.pyd не обов’язково " +"присутній для запуску вашої програми, тоді як якщо ви пов’язали свою " +"програму з dll, dll потрібна. Звичайно, foo.pyd потрібен, якщо ви хочете " +"сказати ``import foo``. У DLL зв’язок оголошується у вихідному коді за " +"допомогою ``__declspec(dllexport)``. У .pyd зв’язок визначається у списку " +"доступних функцій." + +msgid "How can I embed Python into a Windows application?" +msgstr "Як я можу вставити Python у програму Windows?" + +msgid "" +"Embedding the Python interpreter in a Windows app can be summarized as " +"follows:" +msgstr "" +"Вбудовування інтерпретатора Python у програму Windows можна підсумувати " +"таким чином:" + +msgid "" +"Do **not** build Python into your .exe file directly. On Windows, Python " +"must be a DLL to handle importing modules that are themselves DLL's. (This " +"is the first key undocumented fact.) Instead, link to :file:`python{NN}." +"dll`; it is typically installed in ``C:\\Windows\\System``. *NN* is the " +"Python version, a number such as \"33\" for Python 3.3." +msgstr "" + +msgid "" +"You can link to Python in two different ways. Load-time linking means " +"linking against :file:`python{NN}.lib`, while run-time linking means linking " +"against :file:`python{NN}.dll`. (General note: :file:`python{NN}.lib` is " +"the so-called \"import lib\" corresponding to :file:`python{NN}.dll`. It " +"merely defines symbols for the linker.)" +msgstr "" +"Ви можете зв’язатися з Python двома різними способами. Зв’язування під час " +"завантаження означає зв’язування з :file:`python{NN}.lib`, тоді як " +"зв’язування під час виконання означає зв’язування з :file:`python{NN}.dll`. " +"(Загальна примітка: :file:`python{NN}.lib` — це так звана \"імпортована " +"бібліотека\", яка відповідає :file:`python{NN}.dll`. Вона лише визначає " +"символи для компонувальника.)" + +msgid "" +"Run-time linking greatly simplifies link options; everything happens at run " +"time. Your code must load :file:`python{NN}.dll` using the Windows " +"``LoadLibraryEx()`` routine. The code must also use access routines and " +"data in :file:`python{NN}.dll` (that is, Python's C API's) using pointers " +"obtained by the Windows ``GetProcAddress()`` routine. Macros can make using " +"these pointers transparent to any C code that calls routines in Python's C " +"API." +msgstr "" +"Зв’язування під час виконання значно спрощує параметри зв’язування; все " +"відбувається під час виконання. Ваш код має завантажити :file:`python{NN}." +"dll` за допомогою процедури Windows ``LoadLibraryEx()``. Код також має " +"використовувати підпрограми доступу та дані в :file:`python{NN}.dll` (тобто " +"C API Python), використовуючи покажчики, отримані підпрограмою " +"``GetProcAddress()`` Windows. Макроси можуть зробити використання цих " +"покажчиків прозорим для будь-якого коду C, який викликає підпрограми в C API " +"Python." + +msgid "" +"If you use SWIG, it is easy to create a Python \"extension module\" that " +"will make the app's data and methods available to Python. SWIG will handle " +"just about all the grungy details for you. The result is C code that you " +"link *into* your .exe file (!) You do **not** have to create a DLL file, " +"and this also simplifies linking." +msgstr "" + +msgid "" +"SWIG will create an init function (a C function) whose name depends on the " +"name of the extension module. For example, if the name of the module is " +"leo, the init function will be called initleo(). If you use SWIG shadow " +"classes, as you should, the init function will be called initleoc(). This " +"initializes a mostly hidden helper class used by the shadow class." +msgstr "" +"SWIG створить функцію ініціалізації (функцію C), назва якої залежить від " +"назви модуля розширення. Наприклад, якщо назва модуля leo, функція init буде " +"називатися initleo(). Якщо ви використовуєте тіньові класи SWIG, як і має " +"бути, функція init називатиметься initleoc(). Це ініціалізує здебільшого " +"прихований допоміжний клас, який використовується тіньовим класом." + +msgid "" +"The reason you can link the C code in step 2 into your .exe file is that " +"calling the initialization function is equivalent to importing the module " +"into Python! (This is the second key undocumented fact.)" +msgstr "" +"Причина, по якій ви можете пов’язати код C на кроці 2 у свій файл .exe, " +"полягає в тому, що виклик функції ініціалізації еквівалентний імпорту модуля " +"в Python! (Це другий ключовий незадокументований факт.)" + +msgid "" +"In short, you can use the following code to initialize the Python " +"interpreter with your extension module." +msgstr "" +"Коротше кажучи, ви можете використовувати наступний код для ініціалізації " +"інтерпретатора Python за допомогою вашого модуля розширення." + +msgid "" +"#include \n" +"...\n" +"Py_Initialize(); // Initialize Python.\n" +"initmyAppc(); // Initialize (import) the helper class.\n" +"PyRun_SimpleString(\"import myApp\"); // Import the shadow class." +msgstr "" + +msgid "" +"There are two problems with Python's C API which will become apparent if you " +"use a compiler other than MSVC, the compiler used to build pythonNN.dll." +msgstr "" +"Є дві проблеми з C API Python, які стануть очевидними, якщо ви " +"використовуєте компілятор, відмінний від MSVC, компілятора, який " +"використовується для створення pythonNN.dll." + +msgid "" +"Problem 1: The so-called \"Very High Level\" functions that take ``FILE *`` " +"arguments will not work in a multi-compiler environment because each " +"compiler's notion of a ``struct FILE`` will be different. From an " +"implementation standpoint these are very low level functions." +msgstr "" + +msgid "" +"Problem 2: SWIG generates the following code when generating wrappers to " +"void functions:" +msgstr "" +"Проблема 2: SWIG генерує такий код під час генерації обгорток для функцій " +"void:" + +msgid "" +"Py_INCREF(Py_None);\n" +"_resultobj = Py_None;\n" +"return _resultobj;" +msgstr "" + +msgid "" +"Alas, Py_None is a macro that expands to a reference to a complex data " +"structure called _Py_NoneStruct inside pythonNN.dll. Again, this code will " +"fail in a mult-compiler environment. Replace such code by:" +msgstr "" +"На жаль, Py_None — це макрос, який розширюється до посилання на складну " +"структуру даних під назвою _Py_NoneStruct усередині pythonNN.dll. Знову ж " +"таки, цей код не працюватиме в середовищі з декількома компіляторами. " +"Замініть такий код на:" + +msgid "return Py_BuildValue(\"\");" +msgstr "" + +msgid "" +"It may be possible to use SWIG's ``%typemap`` command to make the change " +"automatically, though I have not been able to get this to work (I'm a " +"complete SWIG newbie)." +msgstr "" +"Можливо, можна використати команду ``%typemap`` SWIG, щоб внести зміни " +"автоматично, хоча мені не вдалося змусити це працювати (я абсолютно новачок " +"у SWIG)." + +msgid "" +"Using a Python shell script to put up a Python interpreter window from " +"inside your Windows app is not a good idea; the resulting window will be " +"independent of your app's windowing system. Rather, you (or the " +"wxPythonWindow class) should create a \"native\" interpreter window. It is " +"easy to connect that window to the Python interpreter. You can redirect " +"Python's i/o to _any_ object that supports read and write, so all you need " +"is a Python object (defined in your extension module) that contains read() " +"and write() methods." +msgstr "" +"Використання сценарію оболонки Python для розміщення вікна інтерпретатора " +"Python із програми Windows не є гарною ідеєю; отримане вікно не залежатиме " +"від віконної системи вашої програми. Швидше, ви (або клас wxPythonWindow) " +"повинні створити \"власне\" вікно інтерпретатора. Це вікно легко підключити " +"до інтерпретатора Python. Ви можете перенаправити введення/виведення Python " +"до будь-якого об'єкта, який підтримує читання та запис, тому все, що вам " +"потрібно, це об’єкт Python (визначений у вашому модулі розширення), який " +"містить методи read() і write()." + +msgid "How do I keep editors from inserting tabs into my Python source?" +msgstr "Як заборонити редакторам вставляти вкладки в мій джерело Python?" + +msgid "" +"The FAQ does not recommend using tabs, and the Python style guide, :pep:`8`, " +"recommends 4 spaces for distributed Python code; this is also the Emacs " +"python-mode default." +msgstr "" +"FAQ не рекомендує використовувати вкладки, а посібник зі стилю Python, :pep:" +"`8`, рекомендує 4 пробіли для розподіленого коду Python; це також " +"стандартний режим Emacs python." + +msgid "" +"Under any editor, mixing tabs and spaces is a bad idea. MSVC is no " +"different in this respect, and is easily configured to use spaces: Take :" +"menuselection:`Tools --> Options --> Tabs`, and for file type \"Default\" " +"set \"Tab size\" and \"Indent size\" to 4, and select the \"Insert spaces\" " +"radio button." +msgstr "" +"У будь-якому редакторі змішувати табуляції та пробіли – погана ідея. MSVC " +"нічим не відрізняється в цьому відношенні, і його легко налаштувати для " +"використання пробілів: візьміть :menuselection:`Інструменти --> Параметри --" +"> Вкладки`, а для типу файлу \"За замовчуванням\" встановіть \"Розмір " +"вкладки\" та \"Розмір відступу\" на 4 і виберіть перемикач \"Вставити " +"пробіли\"." + +msgid "" +"Python raises :exc:`IndentationError` or :exc:`TabError` if mixed tabs and " +"spaces are causing problems in leading whitespace. You may also run the :mod:" +"`tabnanny` module to check a directory tree in batch mode." +msgstr "" +"Python викликає :exc:`IndentationError` або :exc:`TabError`, якщо змішані " +"символи табуляції та пробіли спричиняють проблеми на початку пробілу. Ви " +"також можете запустити модуль :mod:`tabnanny`, щоб перевірити дерево " +"каталогів у пакетному режимі." + +msgid "How do I check for a keypress without blocking?" +msgstr "Як перевірити натискання клавіш без блокування?" + +msgid "" +"Use the :mod:`msvcrt` module. This is a standard Windows-specific extension " +"module. It defines a function ``kbhit()`` which checks whether a keyboard " +"hit is present, and ``getch()`` which gets one character without echoing it." +msgstr "" +"Використовуйте модуль :mod:`msvcrt`. Це стандартний модуль розширення для " +"Windows. Він визначає функцію ``kbhit()``, яка перевіряє наявність " +"натискання клавіатури, і ``getch()``, яка отримує один символ, не повторюючи " +"його." + +msgid "How do I solve the missing api-ms-win-crt-runtime-l1-1-0.dll error?" +msgstr "" + +msgid "" +"This can occur on Python 3.5 and later when using Windows 8.1 or earlier " +"without all updates having been installed. First ensure your operating " +"system is supported and is up to date, and if that does not resolve the " +"issue, visit the `Microsoft support page `_ for guidance on manually installing the C Runtime update." +msgstr "" diff --git a/glossary.po b/glossary.po new file mode 100644 index 000000000..c172e7cc8 --- /dev/null +++ b/glossary.po @@ -0,0 +1,2676 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# 00855e18280655590868913ef9ddc9fe_b1aeac7, 2022 +# Taras Kuzyo , 2022 +# Vadim Kashirny, 2022 +# Ivan Prytula, 2023 +# Pavlo Slavynskyy, 2024 +# Dmytro Kazanzhy, 2025 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:47+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2025\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Glossary" +msgstr "Глосарій" + +msgid "``>>>``" +msgstr "``>>>``" + +msgid "" +"The default Python prompt of the :term:`interactive` shell. Often seen for " +"code examples which can be executed interactively in the interpreter." +msgstr "" +"Запрошення :term:`інтерактивної` оболонки Python за замовчуванням. Часто " +"використовується у прикладах коду, які можна виконати інтерактивно у " +"інтерпретаторі." + +msgid "``...``" +msgstr "``...``" + +msgid "Can refer to:" +msgstr "Може посилатися на:" + +msgid "" +"The default Python prompt of the :term:`interactive` shell when entering the " +"code for an indented code block, when within a pair of matching left and " +"right delimiters (parentheses, square brackets, curly braces or triple " +"quotes), or after specifying a decorator." +msgstr "" +"Запрошення :term:`інтерактивної` оболонки Python при введенні блоку коду з " +"відступами, між парою відповідних лівих і правих розділювачів (круглих, " +"квадратних чи фігурних дужок або потрійних лапок), чи після зазначення " +"декоратора." + +msgid "The :const:`Ellipsis` built-in constant." +msgstr "Вбудована константа :const:`Ellipsis`." + +msgid "abstract base class" +msgstr "абстрактний базовий клас" + +msgid "" +"Abstract base classes complement :term:`duck-typing` by providing a way to " +"define interfaces when other techniques like :func:`hasattr` would be clumsy " +"or subtly wrong (for example with :ref:`magic methods `). " +"ABCs introduce virtual subclasses, which are classes that don't inherit from " +"a class but are still recognized by :func:`isinstance` and :func:" +"`issubclass`; see the :mod:`abc` module documentation. Python comes with " +"many built-in ABCs for data structures (in the :mod:`collections.abc` " +"module), numbers (in the :mod:`numbers` module), streams (in the :mod:`io` " +"module), import finders and loaders (in the :mod:`importlib.abc` module). " +"You can create your own ABCs with the :mod:`abc` module." +msgstr "" +"Абстрактні базові класи доповнюють :term:`duck-typing`, надаючи спосіб для " +"визначення інтерфейсів, коли інші методи, такі як :func:`hasattr`, були б " +"незручними або дещо неправильними (наприклад, з :ref:`магічними методами " +"`). ABC вводить віртуальні підкласи, що є класами, які не " +"успадковуються від класу, але все ще можуть розпізнватися за допомогою :func:" +"`isinstance` та :func:`issubclass`; дивіться документацію модуля :mod:`abc`. " +"Python має багато вбудованх ABC для різних структур(у модулі :mod:" +"`collections.abc`), чисел (у модулі :mod:`numbers`), потоків (у модулі :mod:" +"`io`) , шукачів імпортів і завантажувачів (у модулі :mod:`importlib.abc`). " +"Ви можете створювати власні азбуки за допомогою модуля :mod:`abc`." + +msgid "annotation" +msgstr "анотація" + +msgid "" +"A label associated with a variable, a class attribute or a function " +"parameter or return value, used by convention as a :term:`type hint`." +msgstr "" +"Мітка, пов’язана зі змінною, атрибутом класу або параметром функції чи " +"результатом функції, застосовується за конвенцією як :term:`type hint`." + +msgid "" +"Annotations of local variables cannot be accessed at runtime, but " +"annotations of global variables, class attributes, and functions are stored " +"in the :attr:`__annotations__` special attribute of modules, classes, and " +"functions, respectively." +msgstr "" +"Анотації локальних змінних недоступні під час виконання, але анотації " +"глобальних змінних, атрибутів класів і функцій зберігаються в спеціальному " +"атрибуті :attr:`__annotations__` модулів, класів і функцій відповідно." + +msgid "" +"See :term:`variable annotation`, :term:`function annotation`, :pep:`484` " +"and :pep:`526`, which describe this functionality. Also see :ref:" +"`annotations-howto` for best practices on working with annotations." +msgstr "" +"Перегляньте :term:`variable annotation`, :term:`function annotation`, :pep:" +"`484` та :pep:`526`, які описують цю функціональність. Також перегляньте :" +"ref:`annotations-howto`, щоб дізнатися про найкращі практики роботи з " +"анотаціями." + +msgid "argument" +msgstr "аргумент" + +msgid "" +"A value passed to a :term:`function` (or :term:`method`) when calling the " +"function. There are two kinds of argument:" +msgstr "" +"Значення, яке передається :term:`function` (або :term:`method`) під час " +"виклику функції. Існує два види аргументів:" + +msgid "" +":dfn:`keyword argument`: an argument preceded by an identifier (e.g. " +"``name=``) in a function call or passed as a value in a dictionary preceded " +"by ``**``. For example, ``3`` and ``5`` are both keyword arguments in the " +"following calls to :func:`complex`::" +msgstr "" +":dfn:`keyword argument`: аргумент, якому передує ідентифікатор (наприклад, " +"``name=``) під час виклику функції або передається як значення в словнику " +"перед яким ``**``. Наприклад, ``3`` і ``5`` є ключовими аргументами в " +"наступних викликах :func:`complex`::" + +msgid "" +"complex(real=3, imag=5)\n" +"complex(**{'real': 3, 'imag': 5})" +msgstr "" +"complex(real=3, imag=5)\n" +"complex(**{'real': 3, 'imag': 5})" + +msgid "" +":dfn:`positional argument`: an argument that is not a keyword argument. " +"Positional arguments can appear at the beginning of an argument list and/or " +"be passed as elements of an :term:`iterable` preceded by ``*``. For example, " +"``3`` and ``5`` are both positional arguments in the following calls::" +msgstr "" +":dfn:`positional argument`: аргумент, який не є аргументом ключового слова. " +"Позиційні аргументи можуть з’являтися на початку списку аргументів і/або " +"передаватися як елементи :term:`iterable`, яким передує ``*``. Наприклад, " +"``3`` і ``5`` є позиційними аргументами в наступних викликах:" + +msgid "" +"complex(3, 5)\n" +"complex(*(3, 5))" +msgstr "" +"complex(3, 5)\n" +"complex(*(3, 5))" + +msgid "" +"Arguments are assigned to the named local variables in a function body. See " +"the :ref:`calls` section for the rules governing this assignment. " +"Syntactically, any expression can be used to represent an argument; the " +"evaluated value is assigned to the local variable." +msgstr "" +"Аргументи призначаються названим локальним змінним у тілі функції. " +"Перегляньте розділ :ref:`calls` для правил, що регулюють це призначення. " +"Синтаксично будь-який вираз можна використовувати для представлення " +"аргументу; обчислене значення присвоюється локальній змінній." + +msgid "" +"See also the :term:`parameter` glossary entry, the FAQ question on :ref:`the " +"difference between arguments and parameters `, " +"and :pep:`362`." +msgstr "" +"Дивіться також :term:`parameter` глосарій, питання FAQ про :ref:`різницю між " +"аргументами та параметрами `, і :pep:`362`." + +msgid "asynchronous context manager" +msgstr "менеджер асинхронного контексту" + +msgid "" +"An object which controls the environment seen in an :keyword:`async with` " +"statement by defining :meth:`~object.__aenter__` and :meth:`~object." +"__aexit__` methods. Introduced by :pep:`492`." +msgstr "" +"Об'єкт, що контролює оточення, вказаний у інструкції :keyword:`async with` " +"визначенням методів :meth:`~object.__aenter__` і :meth:`~object.__aexit__`. " +"Запроваджено у :pep:`492`." + +msgid "asynchronous generator" +msgstr "асинхронний генератор" + +msgid "" +"A function which returns an :term:`asynchronous generator iterator`. It " +"looks like a coroutine function defined with :keyword:`async def` except " +"that it contains :keyword:`yield` expressions for producing a series of " +"values usable in an :keyword:`async for` loop." +msgstr "" +"Функція, яка повертає :term:`asynchronous generator iterator`. Це виглядає " +"як функція співпрограми, визначена за допомогою :keyword:`async def`, за " +"винятком того, що вона містить вирази :keyword:`yield` для створення серії " +"значень, які можна використовувати в циклі :keyword:`async for`." + +msgid "" +"Usually refers to an asynchronous generator function, but may refer to an " +"*asynchronous generator iterator* in some contexts. In cases where the " +"intended meaning isn't clear, using the full terms avoids ambiguity." +msgstr "" +"Зазвичай відноситься до функції асинхронного генератора, але в деяких " +"контекстах може посилатися на *ітератор асинхронного генератора*. У " +"випадках, коли передбачуване значення не є зрозумілим, використання повних " +"термінів дозволяє уникнути двозначності." + +msgid "" +"An asynchronous generator function may contain :keyword:`await` expressions " +"as well as :keyword:`async for`, and :keyword:`async with` statements." +msgstr "" +"Функція асинхронного генератора може містити вирази :keyword:`await`, а " +"також оператори :keyword:`async for` і :keyword:`async with`." + +msgid "asynchronous generator iterator" +msgstr "ітератор асинхронного генератора" + +msgid "An object created by a :term:`asynchronous generator` function." +msgstr "Об’єкт, створений функцією :term:`asynchronous generator`." + +msgid "" +"This is an :term:`asynchronous iterator` which when called using the :meth:" +"`~object.__anext__` method returns an awaitable object which will execute " +"the body of the asynchronous generator function until the next :keyword:" +"`yield` expression." +msgstr "" +"Це :term:`асинхронний ітератор`, який при виклику за допомогою методу :meth:" +"`~object.__anext__` повертає очікуваний об'єкт, який виконає тіло функції " +"асинхронного генератора до наступного виразу :keyword:`yield`." + +msgid "" +"Each :keyword:`yield` temporarily suspends processing, remembering the " +"execution state (including local variables and pending try-statements). " +"When the *asynchronous generator iterator* effectively resumes with another " +"awaitable returned by :meth:`~object.__anext__`, it picks up where it left " +"off. See :pep:`492` and :pep:`525`." +msgstr "" + +msgid "asynchronous iterable" +msgstr "асинхронний ітерований" + +msgid "" +"An object, that can be used in an :keyword:`async for` statement. Must " +"return an :term:`asynchronous iterator` from its :meth:`~object.__aiter__` " +"method. Introduced by :pep:`492`." +msgstr "" +"Об'єкт, який можна використовувати в інструкції :keyword:`async for`. " +"Повинен повертати an :term:`асинхронний ітератор` своїм методом :meth:" +"`~object.__aiter__` . Запроваджено у :pep:`492`." + +msgid "asynchronous iterator" +msgstr "асинхронний ітератор" + +msgid "" +"An object that implements the :meth:`~object.__aiter__` and :meth:`~object." +"__anext__` methods. :meth:`~object.__anext__` must return an :term:" +"`awaitable` object. :keyword:`async for` resolves the awaitables returned by " +"an asynchronous iterator's :meth:`~object.__anext__` method until it raises " +"a :exc:`StopAsyncIteration` exception. Introduced by :pep:`492`." +msgstr "" +"Об'єкт, який реалізує методи :meth:`~object.__aiter__` та :meth:`~object." +"__anext__`. :meth:`~object.__anext__` має повертати :term:`очікуваний` " +"об'єкт. :keyword:`async for` обчислює очікувані об'єкти, повернуті методом " +"асинхронноо ітератора :meth:`~object.__anext__`, доки він не створює " +"виняток :exc:`StopAsyncIteration`. Запроваджено :pep:`492`." + +msgid "attribute" +msgstr "атрибут" + +msgid "" +"A value associated with an object which is usually referenced by name using " +"dotted expressions. For example, if an object *o* has an attribute *a* it " +"would be referenced as *o.a*." +msgstr "" + +msgid "" +"It is possible to give an object an attribute whose name is not an " +"identifier as defined by :ref:`identifiers`, for example using :func:" +"`setattr`, if the object allows it. Such an attribute will not be accessible " +"using a dotted expression, and would instead need to be retrieved with :func:" +"`getattr`." +msgstr "" + +msgid "awaitable" +msgstr "очікуваний" + +msgid "" +"An object that can be used in an :keyword:`await` expression. Can be a :" +"term:`coroutine` or an object with an :meth:`~object.__await__` method. See " +"also :pep:`492`." +msgstr "" + +msgid "BDFL" +msgstr "BDFL" + +msgid "" +"Benevolent Dictator For Life, a.k.a. `Guido van Rossum `_, Python's creator." +msgstr "" +"Доброзичливий диктатор на все життя (BDFL - Benevolent Dictator For Life), " +"також відомий як `Гвідо ван Россум `_, " +"творець Python." + +msgid "binary file" +msgstr "бінарний файл" + +msgid "" +"A :term:`file object` able to read and write :term:`bytes-like objects " +"`. Examples of binary files are files opened in binary " +"mode (``'rb'``, ``'wb'`` or ``'rb+'``), :data:`sys.stdin.buffer `, :data:`sys.stdout.buffer `, and instances of :class:`io." +"BytesIO` and :class:`gzip.GzipFile`." +msgstr "" + +msgid "" +"See also :term:`text file` for a file object able to read and write :class:" +"`str` objects." +msgstr "" +"Дивіться також :term:`text file` для об’єкта файлу, здатного читати та " +"записувати об’єкти :class:`str`." + +msgid "borrowed reference" +msgstr "запозичене посилання" + +msgid "" +"In Python's C API, a borrowed reference is a reference to an object, where " +"the code using the object does not own the reference. It becomes a dangling " +"pointer if the object is destroyed. For example, a garbage collection can " +"remove the last :term:`strong reference` to the object and so destroy it." +msgstr "" + +msgid "" +"Calling :c:func:`Py_INCREF` on the :term:`borrowed reference` is recommended " +"to convert it to a :term:`strong reference` in-place, except when the object " +"cannot be destroyed before the last usage of the borrowed reference. The :c:" +"func:`Py_NewRef` function can be used to create a new :term:`strong " +"reference`." +msgstr "" +"Виклик :c:func:`Py_INCREF` для :term:`borrowed reference` рекомендовано для " +"перетворення його на :term:`strong reference` на місці, за винятком " +"випадків, коли об’єкт не можна знищити до останнього використання " +"запозиченого посилання. Функцію :c:func:`Py_NewRef` можна використати для " +"створення нового :term:`strong reference`." + +msgid "bytes-like object" +msgstr "байтоподібний об'єкт" + +msgid "" +"An object that supports the :ref:`bufferobjects` and can export a C-:term:" +"`contiguous` buffer. This includes all :class:`bytes`, :class:`bytearray`, " +"and :class:`array.array` objects, as well as many common :class:`memoryview` " +"objects. Bytes-like objects can be used for various operations that work " +"with binary data; these include compression, saving to a binary file, and " +"sending over a socket." +msgstr "" +"Об’єкт, який підтримує :ref:`bufferobjects` і може експортувати буфер C-:" +"term:`contiguous`. Це включає всі об’єкти :class:`bytes`, :class:`bytearray` " +"і :class:`array.array`, а також багато поширених об’єктів :class:" +"`memoryview`. Байтоподібні об'єкти можна використовувати для різних " +"операцій, які працюють з двійковими даними; вони включають стиснення, " +"збереження у бінарний файл і надсилання через сокет." + +msgid "" +"Some operations need the binary data to be mutable. The documentation often " +"refers to these as \"read-write bytes-like objects\". Example mutable " +"buffer objects include :class:`bytearray` and a :class:`memoryview` of a :" +"class:`bytearray`. Other operations require the binary data to be stored in " +"immutable objects (\"read-only bytes-like objects\"); examples of these " +"include :class:`bytes` and a :class:`memoryview` of a :class:`bytes` object." +msgstr "" +"Для деяких операцій двійкові дані повинні бути змінними. У документації вони " +"часто називаються \"байтоподібними об’єктами читання-запису\". Приклади " +"змінних буферних об’єктів включають :class:`bytearray` і :class:" +"`memoryview` :class:`bytearray`. Інші операції вимагають, щоб двійкові дані " +"зберігалися в незмінних об’єктах (\"байтоподібні об’єкти лише для " +"читання\"); прикладами таких є :class:`bytes` і :class:`memoryview` об’єкта :" +"class:`bytes`." + +msgid "bytecode" +msgstr "байт-код" + +msgid "" +"Python source code is compiled into bytecode, the internal representation of " +"a Python program in the CPython interpreter. The bytecode is also cached in " +"``.pyc`` files so that executing the same file is faster the second time " +"(recompilation from source to bytecode can be avoided). This \"intermediate " +"language\" is said to run on a :term:`virtual machine` that executes the " +"machine code corresponding to each bytecode. Do note that bytecodes are not " +"expected to work between different Python virtual machines, nor to be stable " +"between Python releases." +msgstr "" +"Вихідний код Python компілюється в байт-код, внутрішнє представлення " +"програми Python в інтерпретаторі CPython. Байт-код також кешується у файлах " +"``.pyc``, тому виконання того самого файлу відбувається швидше вдруге (можна " +"уникнути перекомпіляції з вихідного коду в байт-код). Кажуть, що ця " +"\"проміжна мова\" працює на :term:`virtual machine`, яка виконує машинний " +"код, що відповідає кожному байт-коду. Зауважте, що байт-коди не повинні " +"працювати між різними віртуальними машинами Python, а також бути стабільними " +"між випусками Python." + +msgid "" +"A list of bytecode instructions can be found in the documentation for :ref:" +"`the dis module `." +msgstr "" +"Список інструкцій байт-коду можна знайти в документації для :ref:`the dis " +"module `." + +msgid "callable" +msgstr "викликний" + +msgid "" +"A callable is an object that can be called, possibly with a set of arguments " +"(see :term:`argument`), with the following syntax::" +msgstr "" + +msgid "callable(argument1, argument2, argumentN)" +msgstr "" + +msgid "" +"A :term:`function`, and by extension a :term:`method`, is a callable. An " +"instance of a class that implements the :meth:`~object.__call__` method is " +"also a callable." +msgstr "" + +msgid "callback" +msgstr "зворотній виклик" + +msgid "" +"A subroutine function which is passed as an argument to be executed at some " +"point in the future." +msgstr "" +"Функція підпрограми, яка передається як аргумент для виконання в певний " +"момент у майбутньому." + +msgid "class" +msgstr "клас" + +msgid "" +"A template for creating user-defined objects. Class definitions normally " +"contain method definitions which operate on instances of the class." +msgstr "" +"Шаблон для створення користувальницьких об'єктів. Визначення класу зазвичай " +"містять визначення методів, які працюють над екземплярами класу." + +msgid "class variable" +msgstr "змінна класу" + +msgid "" +"A variable defined in a class and intended to be modified only at class " +"level (i.e., not in an instance of the class)." +msgstr "" +"Змінна, визначена в класі та призначена для зміни лише на рівні класу (тобто " +"не в екземплярі класу)." + +msgid "closure variable" +msgstr "" + +msgid "" +"A :term:`free variable` referenced from a :term:`nested scope` that is " +"defined in an outer scope rather than being resolved at runtime from the " +"globals or builtin namespaces. May be explicitly defined with the :keyword:" +"`nonlocal` keyword to allow write access, or implicitly defined if the " +"variable is only being read." +msgstr "" + +msgid "" +"For example, in the ``inner`` function in the following code, both ``x`` and " +"``print`` are :term:`free variables `, but only ``x`` is a " +"*closure variable*::" +msgstr "" + +msgid "" +"def outer():\n" +" x = 0\n" +" def inner():\n" +" nonlocal x\n" +" x += 1\n" +" print(x)\n" +" return inner" +msgstr "" + +msgid "" +"Due to the :attr:`codeobject.co_freevars` attribute (which, despite its " +"name, only includes the names of closure variables rather than listing all " +"referenced free variables), the more general :term:`free variable` term is " +"sometimes used even when the intended meaning is to refer specifically to " +"closure variables." +msgstr "" + +msgid "complex number" +msgstr "комплексне число" + +msgid "" +"An extension of the familiar real number system in which all numbers are " +"expressed as a sum of a real part and an imaginary part. Imaginary numbers " +"are real multiples of the imaginary unit (the square root of ``-1``), often " +"written ``i`` in mathematics or ``j`` in engineering. Python has built-in " +"support for complex numbers, which are written with this latter notation; " +"the imaginary part is written with a ``j`` suffix, e.g., ``3+1j``. To get " +"access to complex equivalents of the :mod:`math` module, use :mod:`cmath`. " +"Use of complex numbers is a fairly advanced mathematical feature. If you're " +"not aware of a need for them, it's almost certain you can safely ignore them." +msgstr "" +"Розширення відомої дійсної системи числення, у якій усі числа виражаються як " +"сума дійсної та уявної частин. Уявні числа — це дійсні кратні уявної одиниці " +"(квадратного кореня з ``-1``), які часто пишуться ``i`` в математиці або " +"``j`` в інженерії. Python має вбудовану підтримку комплексних чисел, які " +"записуються з використанням цієї останньої нотації; уявна частина " +"записується з суфіксом ``j``, наприклад, ``3+1j``. Щоб отримати доступ до " +"комплексних еквівалентів модуля :mod:`math`, використовуйте :mod:`cmath`. " +"Використання комплексних чисел є досить просунутою математичною функцією. " +"Якщо ви не усвідомлюєте потреби в них, майже впевнено, що можете спокійно їх " +"ігнорувати." + +msgid "context" +msgstr "" + +msgid "" +"This term has different meanings depending on where and how it is used. Some " +"common meanings:" +msgstr "" + +msgid "" +"The temporary state or environment established by a :term:`context manager` " +"via a :keyword:`with` statement." +msgstr "" + +msgid "" +"The collection of key­value bindings associated with a particular :class:" +"`contextvars.Context` object and accessed via :class:`~contextvars." +"ContextVar` objects. Also see :term:`context variable`." +msgstr "" + +msgid "" +"A :class:`contextvars.Context` object. Also see :term:`current context`." +msgstr "" + +msgid "context management protocol" +msgstr "" + +msgid "" +"The :meth:`~object.__enter__` and :meth:`~object.__exit__` methods called by " +"the :keyword:`with` statement. See :pep:`343`." +msgstr "" + +msgid "context manager" +msgstr "контекстний менеджер" + +msgid "" +"An object which implements the :term:`context management protocol` and " +"controls the environment seen in a :keyword:`with` statement. See :pep:" +"`343`." +msgstr "" + +msgid "context variable" +msgstr "контекстна змінна" + +msgid "" +"A variable whose value depends on which context is the :term:`current " +"context`. Values are accessed via :class:`contextvars.ContextVar` objects. " +"Context variables are primarily used to isolate state between concurrent " +"asynchronous tasks." +msgstr "" + +msgid "contiguous" +msgstr "суміжний" + +msgid "" +"A buffer is considered contiguous exactly if it is either *C-contiguous* or " +"*Fortran contiguous*. Zero-dimensional buffers are C and Fortran " +"contiguous. In one-dimensional arrays, the items must be laid out in memory " +"next to each other, in order of increasing indexes starting from zero. In " +"multidimensional C-contiguous arrays, the last index varies the fastest when " +"visiting items in order of memory address. However, in Fortran contiguous " +"arrays, the first index varies the fastest." +msgstr "" +"Буфер вважається безперервним, якщо він *C-суміжний* або *Fortran " +"безперервний*. Нульвимірні буфери є суміжними на C і Fortran. В одновимірних " +"масивах елементи повинні розташовуватися в пам’яті поруч один з одним у " +"порядку зростання індексів, починаючи з нуля. У багатовимірних C-суміжних " +"масивах останній індекс змінюється найшвидше під час відвідування елементів " +"у порядку адреси пам’яті. Однак у безперервних масивах Fortran перший індекс " +"змінюється найшвидше." + +msgid "coroutine" +msgstr "співпрограма" + +msgid "" +"Coroutines are a more generalized form of subroutines. Subroutines are " +"entered at one point and exited at another point. Coroutines can be " +"entered, exited, and resumed at many different points. They can be " +"implemented with the :keyword:`async def` statement. See also :pep:`492`." +msgstr "" +"Співпрограми є більш узагальненою формою підпрограм. Підпрограми вводяться в " +"одній точці і виходять з іншої. У співпрограми можна ввійти, вийти з них і " +"відновити їх у багатьох різних точках. Їх можна реалізувати за допомогою " +"оператора :keyword:`async def`. Дивіться також :pep:`492`." + +msgid "coroutine function" +msgstr "функція співпрограми" + +msgid "" +"A function which returns a :term:`coroutine` object. A coroutine function " +"may be defined with the :keyword:`async def` statement, and may contain :" +"keyword:`await`, :keyword:`async for`, and :keyword:`async with` keywords. " +"These were introduced by :pep:`492`." +msgstr "" +"Функція, яка повертає об’єкт :term:`coroutine`. Функція співпрограми може " +"бути визначена оператором :keyword:`async def` і може містити ключові слова :" +"keyword:`await`, :keyword:`async for` і :keyword:`async with`. Їх " +"представив :pep:`492`." + +msgid "CPython" +msgstr "CPython" + +msgid "" +"The canonical implementation of the Python programming language, as " +"distributed on `python.org `_. The term \"CPython\" " +"is used when necessary to distinguish this implementation from others such " +"as Jython or IronPython." +msgstr "" +"Канонічна реалізація мови програмування Python, яка розповсюджується на " +"`python.org `_. Термін \"CPython\" використовується, " +"коли необхідно відрізнити цю реалізацію від інших, таких як Jython або " +"IronPython." + +msgid "current context" +msgstr "" + +msgid "" +"The :term:`context` (:class:`contextvars.Context` object) that is currently " +"used by :class:`~contextvars.ContextVar` objects to access (get or set) the " +"values of :term:`context variables `. Each thread has its " +"own current context. Frameworks for executing asynchronous tasks (see :mod:" +"`asyncio`) associate each task with a context which becomes the current " +"context whenever the task starts or resumes execution." +msgstr "" + +msgid "decorator" +msgstr "декоратор" + +msgid "" +"A function returning another function, usually applied as a function " +"transformation using the ``@wrapper`` syntax. Common examples for " +"decorators are :func:`classmethod` and :func:`staticmethod`." +msgstr "" +"Функція, що повертає іншу функцію, зазвичай застосовується як перетворення " +"функції за допомогою синтаксису ``@wrapper``. Типовими прикладами для " +"декораторів є :func:`classmethod` і :func:`staticmethod`." + +msgid "" +"The decorator syntax is merely syntactic sugar, the following two function " +"definitions are semantically equivalent::" +msgstr "" +"Синтаксис декоратора є просто синтаксичним цукром, наступні два визначення " +"функції семантично еквівалентні:" + +msgid "" +"def f(arg):\n" +" ...\n" +"f = staticmethod(f)\n" +"\n" +"@staticmethod\n" +"def f(arg):\n" +" ..." +msgstr "" + +msgid "" +"The same concept exists for classes, but is less commonly used there. See " +"the documentation for :ref:`function definitions ` and :ref:`class " +"definitions ` for more about decorators." +msgstr "" +"Така сама концепція існує для класів, але використовується там рідше. " +"Перегляньте документацію щодо :ref:`визначення функцій ` та :ref:" +"`визначення класів `, щоб дізнатися більше про декоратори." + +msgid "descriptor" +msgstr "дескриптор" + +msgid "" +"Any object which defines the methods :meth:`~object.__get__`, :meth:`~object." +"__set__`, or :meth:`~object.__delete__`. When a class attribute is a " +"descriptor, its special binding behavior is triggered upon attribute " +"lookup. Normally, using *a.b* to get, set or delete an attribute looks up " +"the object named *b* in the class dictionary for *a*, but if *b* is a " +"descriptor, the respective descriptor method gets called. Understanding " +"descriptors is a key to a deep understanding of Python because they are the " +"basis for many features including functions, methods, properties, class " +"methods, static methods, and reference to super classes." +msgstr "" + +msgid "" +"For more information about descriptors' methods, see :ref:`descriptors` or " +"the :ref:`Descriptor How To Guide `." +msgstr "" +"Для отримання додаткової інформації про методи дескрипторів див. :ref:" +"`descriptors` або :ref:`Посібник з використання дескрипторів " +"`." + +msgid "dictionary" +msgstr "словник" + +msgid "" +"An associative array, where arbitrary keys are mapped to values. The keys " +"can be any object with :meth:`~object.__hash__` and :meth:`~object.__eq__` " +"methods. Called a hash in Perl." +msgstr "" + +msgid "dictionary comprehension" +msgstr "dictionary comprehension" + +msgid "" +"A compact way to process all or part of the elements in an iterable and " +"return a dictionary with the results. ``results = {n: n ** 2 for n in " +"range(10)}`` generates a dictionary containing key ``n`` mapped to value ``n " +"** 2``. See :ref:`comprehensions`." +msgstr "" +"Компактний спосіб обробки всіх або частини елементів у ітерації та " +"повернення словника з результатами. ``results = {n: n ** 2 for n in " +"range(10)}`` генерує словник, що містить ключ ``n``, зіставлений зі " +"значенням ``n ** 2``. Дивіться :ref:`comprehensions`." + +msgid "dictionary view" +msgstr "перегляд словника" + +msgid "" +"The objects returned from :meth:`dict.keys`, :meth:`dict.values`, and :meth:" +"`dict.items` are called dictionary views. They provide a dynamic view on the " +"dictionary’s entries, which means that when the dictionary changes, the view " +"reflects these changes. To force the dictionary view to become a full list " +"use ``list(dictview)``. See :ref:`dict-views`." +msgstr "" +"Об’єкти, що повертаються з :meth:`dict.keys`, :meth:`dict.values` і :meth:" +"`dict.items`, називаються представленнями словника. Вони забезпечують " +"динамічний перегляд словникових статей, що означає, що коли словник " +"змінюється, перегляд відображає ці зміни. Щоб змусити перегляд словника " +"стати повним списком, використовуйте ``list(dictview)``. Перегляньте :ref:" +"`dict-views`." + +msgid "docstring" +msgstr "рядок документації" + +msgid "" +"A string literal which appears as the first expression in a class, function " +"or module. While ignored when the suite is executed, it is recognized by " +"the compiler and put into the :attr:`~definition.__doc__` attribute of the " +"enclosing class, function or module. Since it is available via " +"introspection, it is the canonical place for documentation of the object." +msgstr "" + +msgid "duck-typing" +msgstr "Качина типізація" + +msgid "" +"A programming style which does not look at an object's type to determine if " +"it has the right interface; instead, the method or attribute is simply " +"called or used (\"If it looks like a duck and quacks like a duck, it must be " +"a duck.\") By emphasizing interfaces rather than specific types, well-" +"designed code improves its flexibility by allowing polymorphic " +"substitution. Duck-typing avoids tests using :func:`type` or :func:" +"`isinstance`. (Note, however, that duck-typing can be complemented with :" +"term:`abstract base classes `.) Instead, it typically " +"employs :func:`hasattr` tests or :term:`EAFP` programming." +msgstr "" +"Стиль програмування, який не дивиться на тип об’єкта, щоб визначити, чи має " +"він правильний інтерфейс; замість цього метод або атрибут просто " +"викликається або використовується (\"Якщо він схожий на качку і крякає як " +"качка, це має бути качка\".) Підкреслюючи інтерфейси, а не конкретні типи, " +"добре розроблений код покращує свою гнучкість, дозволяючи поліморфне " +"заміщення. Duck-введення дозволяє уникнути тестів з використанням :func:" +"`type` або :func:`isinstance`. (Однак зауважте, що качиний тип може бути " +"доповнений :term:`абстрактними базовими класами `.) " +"Замість цього зазвичай використовуються :func:`hasattr` тести або :term:" +"`EAFP` програмування." + +msgid "EAFP" +msgstr "EAFP" + +msgid "" +"Easier to ask for forgiveness than permission. This common Python coding " +"style assumes the existence of valid keys or attributes and catches " +"exceptions if the assumption proves false. This clean and fast style is " +"characterized by the presence of many :keyword:`try` and :keyword:`except` " +"statements. The technique contrasts with the :term:`LBYL` style common to " +"many other languages such as C." +msgstr "" +"Легше попросити вибачення, ніж дозволу (Easier to ask for forgiveness than " +"permission). Цей поширений стиль кодування Python припускає існування " +"дійсних ключів або атрибутів і перехоплює винятки, якщо припущення виявиться " +"хибним. Цей чистий і швидкий стиль характеризується наявністю багатьох " +"операторів :keyword:`try` і :keyword:`except`. Техніка контрастує зі стилем :" +"term:`LBYL`, поширеним у багатьох інших мовах, таких як C." + +msgid "expression" +msgstr "вираз" + +msgid "" +"A piece of syntax which can be evaluated to some value. In other words, an " +"expression is an accumulation of expression elements like literals, names, " +"attribute access, operators or function calls which all return a value. In " +"contrast to many other languages, not all language constructs are " +"expressions. There are also :term:`statement`\\s which cannot be used as " +"expressions, such as :keyword:`while`. Assignments are also statements, not " +"expressions." +msgstr "" +"Частина синтаксису, яка може бути оцінена до певного значення. Іншими " +"словами, вираз — це сукупність елементів виразу, таких як літерали, імена, " +"доступ до атрибутів, оператори або виклики функцій, які повертають значення. " +"На відміну від багатьох інших мов, не всі мовні конструкції є виразами. " +"Існують також :term:`statement`\\s, які не можна використовувати як вирази, " +"наприклад :keyword:`while`. Присвоєння також є операторами, а не виразами." + +msgid "extension module" +msgstr "модуль розширення" + +msgid "" +"A module written in C or C++, using Python's C API to interact with the core " +"and with user code." +msgstr "" +"Модуль, написаний мовою C або C++, який використовує C API Python для " +"взаємодії з ядром і кодом користувача." + +msgid "f-string" +msgstr "f-рядок" + +msgid "" +"String literals prefixed with ``'f'`` or ``'F'`` are commonly called \"f-" +"strings\" which is short for :ref:`formatted string literals `. " +"See also :pep:`498`." +msgstr "" +"Рядкові літерали з префіксом ``'f'`` або ``'F'`` зазвичай називаються \"f-" +"рядками\", що є скороченням від :ref:`форматованих рядкових літералів `. Дивіться також :pep:`498`." + +msgid "file object" +msgstr "файловий об'єкт" + +msgid "" +"An object exposing a file-oriented API (with methods such as :meth:`!read` " +"or :meth:`!write`) to an underlying resource. Depending on the way it was " +"created, a file object can mediate access to a real on-disk file or to " +"another type of storage or communication device (for example standard input/" +"output, in-memory buffers, sockets, pipes, etc.). File objects are also " +"called :dfn:`file-like objects` or :dfn:`streams`." +msgstr "" + +msgid "" +"There are actually three categories of file objects: raw :term:`binary files " +"`, buffered :term:`binary files ` and :term:`text " +"files `. Their interfaces are defined in the :mod:`io` module. " +"The canonical way to create a file object is by using the :func:`open` " +"function." +msgstr "" +"Фактично існує три категорії файлових об’єктів: необроблені :term:`бінарні " +"файли `, буферизовані :term:`бінарні файли ` і :" +"term:`текстові файли `. Їхні інтерфейси визначені в модулі :mod:" +"`io`. Канонічний спосіб створення файлового об’єкта – це використання " +"функції :func:`open`." + +msgid "file-like object" +msgstr "файлоподібний об'єкт" + +msgid "A synonym for :term:`file object`." +msgstr "Синонім :term:`file object`." + +msgid "filesystem encoding and error handler" +msgstr "кодування файлової системи та обробник помилок" + +msgid "" +"Encoding and error handler used by Python to decode bytes from the operating " +"system and encode Unicode to the operating system." +msgstr "" +"Кодування та обробник помилок, які використовуються Python для декодування " +"байтів з операційної системи та кодування Unicode до операційної системи." + +msgid "" +"The filesystem encoding must guarantee to successfully decode all bytes " +"below 128. If the file system encoding fails to provide this guarantee, API " +"functions can raise :exc:`UnicodeError`." +msgstr "" +"Кодування файлової системи має гарантувати успішне декодування всіх байтів " +"нижче 128. Якщо кодування файлової системи не забезпечує цю гарантію, " +"функції API можуть викликати :exc:`UnicodeError`." + +msgid "" +"The :func:`sys.getfilesystemencoding` and :func:`sys." +"getfilesystemencodeerrors` functions can be used to get the filesystem " +"encoding and error handler." +msgstr "" +"Функції :func:`sys.getfilesystemencoding` і :func:`sys." +"getfilesystemencodeerrors` можна використовувати для отримання кодування " +"файлової системи та обробника помилок." + +msgid "" +"The :term:`filesystem encoding and error handler` are configured at Python " +"startup by the :c:func:`PyConfig_Read` function: see :c:member:`~PyConfig." +"filesystem_encoding` and :c:member:`~PyConfig.filesystem_errors` members of :" +"c:type:`PyConfig`." +msgstr "" +":term:`filesystem encoding and error handler` налаштовуються під час запуску " +"Python за допомогою функції :c:func:`PyConfig_Read`: див. :c:member:" +"`~PyConfig.filesystem_encoding` і :c:member:`~PyConfig. filesystem_errors` " +"члени :c:type:`PyConfig`." + +msgid "See also the :term:`locale encoding`." +msgstr "Дивіться також :term:`locale encoding`." + +msgid "finder" +msgstr "шукач" + +msgid "" +"An object that tries to find the :term:`loader` for a module that is being " +"imported." +msgstr "" +"Об’єкт, який намагається знайти :term:`loader` для модуля, який імпортується." + +msgid "" +"There are two types of finder: :term:`meta path finders ` " +"for use with :data:`sys.meta_path`, and :term:`path entry finders ` for use with :data:`sys.path_hooks`." +msgstr "" + +msgid "" +"See :ref:`finders-and-loaders` and :mod:`importlib` for much more detail." +msgstr "" + +msgid "floor division" +msgstr "поділ поверху" + +msgid "" +"Mathematical division that rounds down to nearest integer. The floor " +"division operator is ``//``. For example, the expression ``11 // 4`` " +"evaluates to ``2`` in contrast to the ``2.75`` returned by float true " +"division. Note that ``(-11) // 4`` is ``-3`` because that is ``-2.75`` " +"rounded *downward*. See :pep:`238`." +msgstr "" +"Математичне ділення, яке округлюється до найближчого цілого числа. Оператор " +"поділу підлоги – ``//``. Наприклад, вираз ``11 // 4`` обчислюється як ``2`` " +"на відміну від ``2,75``, яке повертає float true division. Зауважте, що " +"``(-11) // 4`` є ``-3``, тому що це ``-2,75``, округлене *униз*. Дивіться :" +"pep:`238`." + +msgid "free threading" +msgstr "" + +msgid "" +"A threading model where multiple threads can run Python bytecode " +"simultaneously within the same interpreter. This is in contrast to the :" +"term:`global interpreter lock` which allows only one thread to execute " +"Python bytecode at a time. See :pep:`703`." +msgstr "" + +msgid "free variable" +msgstr "" + +msgid "" +"Formally, as defined in the :ref:`language execution model `, a " +"free variable is any variable used in a namespace which is not a local " +"variable in that namespace. See :term:`closure variable` for an example. " +"Pragmatically, due to the name of the :attr:`codeobject.co_freevars` " +"attribute, the term is also sometimes used as a synonym for :term:`closure " +"variable`." +msgstr "" + +msgid "function" +msgstr "функція" + +msgid "" +"A series of statements which returns some value to a caller. It can also be " +"passed zero or more :term:`arguments ` which may be used in the " +"execution of the body. See also :term:`parameter`, :term:`method`, and the :" +"ref:`function` section." +msgstr "" +"Серія операторів, які повертають певне значення абоненту. Йому також можна " +"передати нуль або більше :term:`аргументів `, які можуть бути " +"використані під час виконання тіла. Дивіться також :term:`parameter`, :term:" +"`method` і розділ :ref:`function`." + +msgid "function annotation" +msgstr "анотація функції" + +msgid "An :term:`annotation` of a function parameter or return value." +msgstr ":term:`annotation` параметра функції або значення, що повертається." + +msgid "" +"Function annotations are usually used for :term:`type hints `: " +"for example, this function is expected to take two :class:`int` arguments " +"and is also expected to have an :class:`int` return value::" +msgstr "" +"Анотації функцій зазвичай використовуються для :term:`підказок типу `: наприклад, ця функція має приймати два аргументи :class:`int` і " +"також має повертати значення :class:`int`::" + +msgid "" +"def sum_two_numbers(a: int, b: int) -> int:\n" +" return a + b" +msgstr "" + +msgid "Function annotation syntax is explained in section :ref:`function`." +msgstr "Синтаксис анотації функції пояснюється в розділі :ref:`function`." + +msgid "" +"See :term:`variable annotation` and :pep:`484`, which describe this " +"functionality. Also see :ref:`annotations-howto` for best practices on " +"working with annotations." +msgstr "" +"Див. :term:`variable annotation` і :pep:`484`, які описують цю " +"функціональність. Також перегляньте :ref:`annotations-howto`, щоб дізнатися " +"про найкращі практики роботи з анотаціями." + +msgid "__future__" +msgstr "__future__" + +msgid "" +"A :ref:`future statement `, ``from __future__ import ``, " +"directs the compiler to compile the current module using syntax or semantics " +"that will become standard in a future release of Python. The :mod:" +"`__future__` module documents the possible values of *feature*. By " +"importing this module and evaluating its variables, you can see when a new " +"feature was first added to the language and when it will (or did) become the " +"default::" +msgstr "" +":ref:`інструкція future `, ``from __future__ import ``, " +"вказує компілятору скомпілювати поточний модуль, використовуючи синтаксис " +"або семантику, які стануть стандартними в майбутньому випуску Python. " +"Модуль :mod:`__future__` документує можливі значення *feature*. Імпортувавши " +"цей модуль та оцінивши його змінні, ви можете побачити, коли нова функція " +"була вперше додана до мови та коли вона стане (або стала) типовою::" + +msgid "" +">>> import __future__\n" +">>> __future__.division\n" +"_Feature((2, 2, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 8192)" +msgstr "" + +msgid "garbage collection" +msgstr "збір сміття" + +msgid "" +"The process of freeing memory when it is not used anymore. Python performs " +"garbage collection via reference counting and a cyclic garbage collector " +"that is able to detect and break reference cycles. The garbage collector " +"can be controlled using the :mod:`gc` module." +msgstr "" +"Процес звільнення пам'яті, коли вона більше не використовується. Python " +"виконує збирання сміття за допомогою підрахунку посилань і циклічного " +"збирача сміття, здатного виявляти та розривати цикли посилань. Збирачем " +"сміття можна керувати за допомогою модуля :mod:`gc`." + +msgid "generator" +msgstr "генератор" + +msgid "" +"A function which returns a :term:`generator iterator`. It looks like a " +"normal function except that it contains :keyword:`yield` expressions for " +"producing a series of values usable in a for-loop or that can be retrieved " +"one at a time with the :func:`next` function." +msgstr "" +"Функція, яка повертає :term:`generator iterator`. Це виглядає як звичайна " +"функція, за винятком того, що вона містить вирази :keyword:`yield` для " +"створення серії значень, які можна використовувати в циклі for або які можна " +"отримати по одному за допомогою функції :func:`next`." + +msgid "" +"Usually refers to a generator function, but may refer to a *generator " +"iterator* in some contexts. In cases where the intended meaning isn't " +"clear, using the full terms avoids ambiguity." +msgstr "" +"Зазвичай відноситься до функції-генератора, але в деяких контекстах може " +"посилатися на *ітератор-генератор*. У випадках, коли передбачуване значення " +"не є зрозумілим, використання повних термінів дозволяє уникнути двозначності." + +msgid "generator iterator" +msgstr "ітератор генератора" + +msgid "An object created by a :term:`generator` function." +msgstr "Об’єкт, створений функцією :term:`generator`." + +msgid "" +"Each :keyword:`yield` temporarily suspends processing, remembering the " +"execution state (including local variables and pending try-statements). " +"When the *generator iterator* resumes, it picks up where it left off (in " +"contrast to functions which start fresh on every invocation)." +msgstr "" + +msgid "generator expression" +msgstr "генераторний вираз" + +msgid "" +"An :term:`expression` that returns an :term:`iterator`. It looks like a " +"normal expression followed by a :keyword:`!for` clause defining a loop " +"variable, range, and an optional :keyword:`!if` clause. The combined " +"expression generates values for an enclosing function::" +msgstr "" + +msgid "" +">>> sum(i*i for i in range(10)) # sum of squares 0, 1, 4, ... 81\n" +"285" +msgstr "" + +msgid "generic function" +msgstr "родова функція" + +msgid "" +"A function composed of multiple functions implementing the same operation " +"for different types. Which implementation should be used during a call is " +"determined by the dispatch algorithm." +msgstr "" +"Функція, що складається з кількох функцій, які реалізують ту саму операцію " +"для різних типів. Яку реалізацію слід використовувати під час виклику, " +"визначається алгоритмом диспетчеризації." + +msgid "" +"See also the :term:`single dispatch` glossary entry, the :func:`functools." +"singledispatch` decorator, and :pep:`443`." +msgstr "" +"Дивіться також запис глосарію :term:`single dispatch`, декоратор :func:" +"`functools.singledispatch` і :pep:`443`." + +msgid "generic type" +msgstr "родовий тип" + +msgid "" +"A :term:`type` that can be parameterized; typically a :ref:`container " +"class` such as :class:`list` or :class:`dict`. Used for :" +"term:`type hints ` and :term:`annotations `." +msgstr "" +":term:`type`, який можна параметризувати; зазвичай це :ref:`клас-контейнер " +"`, наприклад :class:`list` або :class:`dict`. " +"Використовується для :term:`підказок типу ` та :term:`анотацій " +"`." + +msgid "" +"For more details, see :ref:`generic alias types`, :pep:" +"`483`, :pep:`484`, :pep:`585`, and the :mod:`typing` module." +msgstr "" +"Для отримання додаткової інформації див. :ref:`загальні типи псевдонімів " +"`, :pep:`483`, :pep:`484`, :pep:`585` і модуль :mod:" +"`typing`." + +msgid "GIL" +msgstr "GIL" + +msgid "See :term:`global interpreter lock`." +msgstr "Дивіться :term:`global interpreter lock`." + +msgid "global interpreter lock" +msgstr "глобальне блокування інтерпретатора" + +msgid "" +"The mechanism used by the :term:`CPython` interpreter to assure that only " +"one thread executes Python :term:`bytecode` at a time. This simplifies the " +"CPython implementation by making the object model (including critical built-" +"in types such as :class:`dict`) implicitly safe against concurrent access. " +"Locking the entire interpreter makes it easier for the interpreter to be " +"multi-threaded, at the expense of much of the parallelism afforded by multi-" +"processor machines." +msgstr "" +"Механізм, який використовується інтерпретатором :term:`CPython`, щоб " +"гарантувати, що лише один потік виконує :term:`bytecode` Python за раз. Це " +"спрощує реалізацію CPython, роблячи об’єктну модель (включно з критично " +"важливими вбудованими типами, такими як :class:`dict`) неявно захищеною від " +"одночасного доступу. Блокування всього інтерпретатора полегшує " +"багатопотоковість інтерпретатора за рахунок більшої частини паралелізму, " +"який надають багатопроцесорні машини." + +msgid "" +"However, some extension modules, either standard or third-party, are " +"designed so as to release the GIL when doing computationally intensive tasks " +"such as compression or hashing. Also, the GIL is always released when doing " +"I/O." +msgstr "" + +msgid "" +"As of Python 3.13, the GIL can be disabled using the :option:`--disable-gil` " +"build configuration. After building Python with this option, code must be " +"run with :option:`-X gil=0 <-X>` or after setting the :envvar:`PYTHON_GIL=0 " +"` environment variable. This feature enables improved " +"performance for multi-threaded applications and makes it easier to use multi-" +"core CPUs efficiently. For more details, see :pep:`703`." +msgstr "" + +msgid "hash-based pyc" +msgstr "на основі хешу pyc" + +msgid "" +"A bytecode cache file that uses the hash rather than the last-modified time " +"of the corresponding source file to determine its validity. See :ref:`pyc-" +"invalidation`." +msgstr "" +"Файл кешу байт-коду, який використовує хеш, а не час останньої зміни " +"відповідного вихідного файлу для визначення його дійсності. Перегляньте :ref:" +"`pyc-invalidation`." + +msgid "hashable" +msgstr "хешований" + +msgid "" +"An object is *hashable* if it has a hash value which never changes during " +"its lifetime (it needs a :meth:`~object.__hash__` method), and can be " +"compared to other objects (it needs an :meth:`~object.__eq__` method). " +"Hashable objects which compare equal must have the same hash value." +msgstr "" + +msgid "" +"Hashability makes an object usable as a dictionary key and a set member, " +"because these data structures use the hash value internally." +msgstr "" +"Хешування робить об’єкт придатним для використання як ключ словника та член " +"набору, оскільки ці структури даних використовують хеш-значення внутрішньо." + +msgid "" +"Most of Python's immutable built-in objects are hashable; mutable containers " +"(such as lists or dictionaries) are not; immutable containers (such as " +"tuples and frozensets) are only hashable if their elements are hashable. " +"Objects which are instances of user-defined classes are hashable by " +"default. They all compare unequal (except with themselves), and their hash " +"value is derived from their :func:`id`." +msgstr "" +"Більшість незмінних вбудованих об’єктів Python можна хешувати; змінні " +"контейнери (такі як списки або словники) не є; незмінні контейнери (такі як " +"кортежі та заморожені набори) можна хешувати, лише якщо їх елементи " +"хешуються. Об’єкти, які є екземплярами визначених користувачем класів, " +"хешуються за замовчуванням. Усі вони порівнюються неоднаково (за винятком " +"самих себе), і їх хеш-значення походить від їхнього :func:`id`." + +msgid "IDLE" +msgstr "ПРОСТОЮЧИЙ" + +msgid "" +"An Integrated Development and Learning Environment for Python. :ref:`idle` " +"is a basic editor and interpreter environment which ships with the standard " +"distribution of Python." +msgstr "" + +msgid "immortal" +msgstr "" + +msgid "" +"*Immortal objects* are a CPython implementation detail introduced in :pep:" +"`683`." +msgstr "" + +msgid "" +"If an object is immortal, its :term:`reference count` is never modified, and " +"therefore it is never deallocated while the interpreter is running. For " +"example, :const:`True` and :const:`None` are immortal in CPython." +msgstr "" + +msgid "immutable" +msgstr "незмінний" + +msgid "" +"An object with a fixed value. Immutable objects include numbers, strings " +"and tuples. Such an object cannot be altered. A new object has to be " +"created if a different value has to be stored. They play an important role " +"in places where a constant hash value is needed, for example as a key in a " +"dictionary." +msgstr "" +"Об’єкт із фіксованим значенням. До незмінних об’єктів належать числа, рядки " +"та кортежі. Такий об'єкт не можна змінити. Якщо потрібно зберегти інше " +"значення, потрібно створити новий об’єкт. Вони відіграють важливу роль у " +"місцях, де потрібне постійне хеш-значення, наприклад, як ключ у словнику." + +msgid "import path" +msgstr "шлях імпорту" + +msgid "" +"A list of locations (or :term:`path entries `) that are searched " +"by the :term:`path based finder` for modules to import. During import, this " +"list of locations usually comes from :data:`sys.path`, but for subpackages " +"it may also come from the parent package's ``__path__`` attribute." +msgstr "" +"Список розташувань (або :term:`записів шляху `), у яких :term:" +"`path based finder` шукає модулі для імпорту. Під час імпорту цей список " +"розташувань зазвичай надходить із :data:`sys.path`, але для підпакетів він " +"також може надходити з атрибута ``__path__`` батьківського пакета." + +msgid "importing" +msgstr "імпортування" + +msgid "" +"The process by which Python code in one module is made available to Python " +"code in another module." +msgstr "" +"Процес, за допомогою якого код Python в одному модулі стає доступним для " +"коду Python в іншому модулі." + +msgid "importer" +msgstr "імпортер" + +msgid "" +"An object that both finds and loads a module; both a :term:`finder` and :" +"term:`loader` object." +msgstr "" +"Об’єкт, який знаходить і завантажує модуль; як об’єкт :term:`finder`, так і :" +"term:`loader`." + +msgid "interactive" +msgstr "інтерактивний" + +msgid "" +"Python has an interactive interpreter which means you can enter statements " +"and expressions at the interpreter prompt, immediately execute them and see " +"their results. Just launch ``python`` with no arguments (possibly by " +"selecting it from your computer's main menu). It is a very powerful way to " +"test out new ideas or inspect modules and packages (remember ``help(x)``). " +"For more on interactive mode, see :ref:`tut-interac`." +msgstr "" + +msgid "interpreted" +msgstr "інтерпретований" + +msgid "" +"Python is an interpreted language, as opposed to a compiled one, though the " +"distinction can be blurry because of the presence of the bytecode compiler. " +"This means that source files can be run directly without explicitly creating " +"an executable which is then run. Interpreted languages typically have a " +"shorter development/debug cycle than compiled ones, though their programs " +"generally also run more slowly. See also :term:`interactive`." +msgstr "" +"Python є інтерпретованою мовою, на відміну від скомпільованої, хоча " +"відмінність може бути розмитою через наявність компілятора байт-коду. Це " +"означає, що вихідні файли можна запускати безпосередньо без явного створення " +"виконуваного файлу, який потім запускається. Інтерпретовані мови зазвичай " +"мають коротший цикл розробки/налагодження, ніж скомпільовані, хоча їхні " +"програми також працюють повільніше. Дивіться також :term:`interactive`." + +msgid "interpreter shutdown" +msgstr "вимкнення перекладача" + +msgid "" +"When asked to shut down, the Python interpreter enters a special phase where " +"it gradually releases all allocated resources, such as modules and various " +"critical internal structures. It also makes several calls to the :term:" +"`garbage collector `. This can trigger the execution of " +"code in user-defined destructors or weakref callbacks. Code executed during " +"the shutdown phase can encounter various exceptions as the resources it " +"relies on may not function anymore (common examples are library modules or " +"the warnings machinery)." +msgstr "" +"Коли його попросять завершити роботу, інтерпретатор Python переходить у " +"спеціальну фазу, де він поступово звільняє всі виділені ресурси, такі як " +"модулі та різні критичні внутрішні структури. Він також робить кілька " +"викликів до :term:`збирача сміття `. Це може ініціювати " +"виконання коду в визначених користувачем деструкторах або зворотних викликах " +"weakref. Код, який виконується під час фази завершення роботи, може " +"зіткнутися з різними винятками, оскільки ресурси, на які він покладається, " +"можуть більше не функціонувати (поширеними прикладами є бібліотечні модулі " +"або механізм попереджень)." + +msgid "" +"The main reason for interpreter shutdown is that the ``__main__`` module or " +"the script being run has finished executing." +msgstr "" +"Основною причиною вимкнення інтерпретатора є завершення виконання модуля " +"``__main__`` або сценарію, який виконується." + +msgid "iterable" +msgstr "ітерований" + +msgid "" +"An object capable of returning its members one at a time. Examples of " +"iterables include all sequence types (such as :class:`list`, :class:`str`, " +"and :class:`tuple`) and some non-sequence types like :class:`dict`, :term:" +"`file objects `, and objects of any classes you define with an :" +"meth:`~object.__iter__` method or with a :meth:`~object.__getitem__` method " +"that implements :term:`sequence` semantics." +msgstr "" + +msgid "" +"Iterables can be used in a :keyword:`for` loop and in many other places " +"where a sequence is needed (:func:`zip`, :func:`map`, ...). When an " +"iterable object is passed as an argument to the built-in function :func:" +"`iter`, it returns an iterator for the object. This iterator is good for " +"one pass over the set of values. When using iterables, it is usually not " +"necessary to call :func:`iter` or deal with iterator objects yourself. The :" +"keyword:`for` statement does that automatically for you, creating a " +"temporary unnamed variable to hold the iterator for the duration of the " +"loop. See also :term:`iterator`, :term:`sequence`, and :term:`generator`." +msgstr "" + +msgid "iterator" +msgstr "ітератор" + +msgid "" +"An object representing a stream of data. Repeated calls to the iterator's :" +"meth:`~iterator.__next__` method (or passing it to the built-in function :" +"func:`next`) return successive items in the stream. When no more data are " +"available a :exc:`StopIteration` exception is raised instead. At this " +"point, the iterator object is exhausted and any further calls to its :meth:`!" +"__next__` method just raise :exc:`StopIteration` again. Iterators are " +"required to have an :meth:`~iterator.__iter__` method that returns the " +"iterator object itself so every iterator is also iterable and may be used in " +"most places where other iterables are accepted. One notable exception is " +"code which attempts multiple iteration passes. A container object (such as " +"a :class:`list`) produces a fresh new iterator each time you pass it to the :" +"func:`iter` function or use it in a :keyword:`for` loop. Attempting this " +"with an iterator will just return the same exhausted iterator object used in " +"the previous iteration pass, making it appear like an empty container." +msgstr "" + +msgid "More information can be found in :ref:`typeiter`." +msgstr "Більше інформації можна знайти в :ref:`typeiter`." + +msgid "" +"CPython does not consistently apply the requirement that an iterator define :" +"meth:`~iterator.__iter__`. And also please note that the free-threading " +"CPython does not guarantee the thread-safety of iterator operations." +msgstr "" + +msgid "key function" +msgstr "ключова функція" + +msgid "" +"A key function or collation function is a callable that returns a value used " +"for sorting or ordering. For example, :func:`locale.strxfrm` is used to " +"produce a sort key that is aware of locale specific sort conventions." +msgstr "" +"Ключова функція або функція зіставлення — це виклик, який повертає значення, " +"яке використовується для сортування або впорядкування. Наприклад, :func:" +"`locale.strxfrm` використовується для створення ключа сортування, який " +"враховує умови сортування для певної мови." + +msgid "" +"A number of tools in Python accept key functions to control how elements are " +"ordered or grouped. They include :func:`min`, :func:`max`, :func:`sorted`, :" +"meth:`list.sort`, :func:`heapq.merge`, :func:`heapq.nsmallest`, :func:`heapq." +"nlargest`, and :func:`itertools.groupby`." +msgstr "" +"Кілька інструментів у Python приймають ключові функції для керування тим, як " +"елементи впорядковуються чи групуються. Серед них :func:`min`, :func:`max`, :" +"func:`sorted`, :meth:`list.sort`, :func:`heapq.merge`, :func:`heapq." +"nsmallest`, :func:`heapq.nlargest` і :func:`itertools.groupby`." + +msgid "" +"There are several ways to create a key function. For example. the :meth:" +"`str.lower` method can serve as a key function for case insensitive sorts. " +"Alternatively, a key function can be built from a :keyword:`lambda` " +"expression such as ``lambda r: (r[0], r[2])``. Also, :func:`operator." +"attrgetter`, :func:`operator.itemgetter`, and :func:`operator.methodcaller` " +"are three key function constructors. See the :ref:`Sorting HOW TO " +"` for examples of how to create and use key functions." +msgstr "" + +msgid "keyword argument" +msgstr "аргумент ключового слова" + +msgid "See :term:`argument`." +msgstr "Дивіться :term:`argument`." + +msgid "lambda" +msgstr "лямбда" + +msgid "" +"An anonymous inline function consisting of a single :term:`expression` which " +"is evaluated when the function is called. The syntax to create a lambda " +"function is ``lambda [parameters]: expression``" +msgstr "" +"Анонімна вбудована функція, що складається з одного :term:`expression`, який " +"обчислюється під час виклику функції. Синтаксис створення лямбда-функції " +"такий: ``лямбда [параметри]: вираз``" + +msgid "LBYL" +msgstr "LBYL" + +msgid "" +"Look before you leap. This coding style explicitly tests for pre-conditions " +"before making calls or lookups. This style contrasts with the :term:`EAFP` " +"approach and is characterized by the presence of many :keyword:`if` " +"statements." +msgstr "" +"Сім разів відміряй, один раз відріж. Цей стиль кодування явно перевіряє " +"попередні умови перед здійсненням викликів або пошуку. Цей стиль контрастує " +"з підходом :term:`EAFP` і характеризується наявністю багатьох операторів :" +"keyword:`if`." + +msgid "" +"In a multi-threaded environment, the LBYL approach can risk introducing a " +"race condition between \"the looking\" and \"the leaping\". For example, " +"the code, ``if key in mapping: return mapping[key]`` can fail if another " +"thread removes *key* from *mapping* after the test, but before the lookup. " +"This issue can be solved with locks or by using the EAFP approach." +msgstr "" +"У багатопоточному середовищі підхід LBYL може загрожувати введенням умов " +"змагання між \"дивлячим\" і \"стрибаючим\". Наприклад, код ``if key in " +"mapping: return mapping[key]`` може завершитися помилкою, якщо інший потік " +"видаляє *key* із *mapping* після перевірки, але перед пошуком. Цю проблему " +"можна вирішити за допомогою блокувань або використання підходу EAFP." + +msgid "lexical analyzer" +msgstr "" + +msgid "Formal name for the *tokenizer*; see :term:`token`." +msgstr "" + +msgid "list" +msgstr "список" + +msgid "" +"A built-in Python :term:`sequence`. Despite its name it is more akin to an " +"array in other languages than to a linked list since access to elements is " +"*O*\\ (1)." +msgstr "" + +msgid "list comprehension" +msgstr "розуміння списку" + +msgid "" +"A compact way to process all or part of the elements in a sequence and " +"return a list with the results. ``result = ['{:#04x}'.format(x) for x in " +"range(256) if x % 2 == 0]`` generates a list of strings containing even hex " +"numbers (0x..) in the range from 0 to 255. The :keyword:`if` clause is " +"optional. If omitted, all elements in ``range(256)`` are processed." +msgstr "" +"Компактний спосіб обробки всіх або частини елементів у послідовності та " +"повернення списку з результатами. ``result = ['{:#04x}'.format(x) for x in " +"range(256) if x % 2 == 0]`` створює список рядків, що містять парні " +"шістнадцяткові числа (0x..) у діапазон від 0 до 255. Речення :keyword:`if` є " +"необов’язковим. Якщо опущено, обробляються всі елементи в діапазоні (256)." + +msgid "loader" +msgstr "навантажувач" + +msgid "" +"An object that loads a module. It must define the :meth:`!exec_module` and :" +"meth:`!create_module` methods to implement the :class:`~importlib.abc." +"Loader` interface. A loader is typically returned by a :term:`finder`. See " +"also:" +msgstr "" + +msgid ":ref:`finders-and-loaders`" +msgstr "" + +msgid ":class:`importlib.abc.Loader`" +msgstr "" + +msgid ":pep:`302`" +msgstr ":pep:`302`" + +msgid "locale encoding" +msgstr "кодування локалі" + +msgid "" +"On Unix, it is the encoding of the LC_CTYPE locale. It can be set with :func:" +"`locale.setlocale(locale.LC_CTYPE, new_locale) `." +msgstr "" + +msgid "On Windows, it is the ANSI code page (ex: ``\"cp1252\"``)." +msgstr "" + +msgid "" +"On Android and VxWorks, Python uses ``\"utf-8\"`` as the locale encoding." +msgstr "" + +msgid ":func:`locale.getencoding` can be used to get the locale encoding." +msgstr "" + +msgid "See also the :term:`filesystem encoding and error handler`." +msgstr "" + +msgid "magic method" +msgstr "магічний метод" + +msgid "An informal synonym for :term:`special method`." +msgstr "Неофіційний синонім слова :term:`special method`." + +msgid "mapping" +msgstr "відображення" + +msgid "" +"A container object that supports arbitrary key lookups and implements the " +"methods specified in the :class:`collections.abc.Mapping` or :class:" +"`collections.abc.MutableMapping` :ref:`abstract base classes `. Examples include :class:`dict`, :class:" +"`collections.defaultdict`, :class:`collections.OrderedDict` and :class:" +"`collections.Counter`." +msgstr "" + +msgid "meta path finder" +msgstr "мета-шлях пошуку" + +msgid "" +"A :term:`finder` returned by a search of :data:`sys.meta_path`. Meta path " +"finders are related to, but different from :term:`path entry finders `." +msgstr "" +":term:`finder`, що повертається в результаті пошуку :data:`sys.meta_path`. " +"Засоби пошуку меташляхів пов’язані з :term:`засобами пошуку записів шляху " +"`, але відрізняються від них." + +msgid "" +"See :class:`importlib.abc.MetaPathFinder` for the methods that meta path " +"finders implement." +msgstr "" +"Перегляньте :class:`importlib.abc.MetaPathFinder` методи, які реалізують " +"засоби пошуку меташляхів." + +msgid "metaclass" +msgstr "метаклас" + +msgid "" +"The class of a class. Class definitions create a class name, a class " +"dictionary, and a list of base classes. The metaclass is responsible for " +"taking those three arguments and creating the class. Most object oriented " +"programming languages provide a default implementation. What makes Python " +"special is that it is possible to create custom metaclasses. Most users " +"never need this tool, but when the need arises, metaclasses can provide " +"powerful, elegant solutions. They have been used for logging attribute " +"access, adding thread-safety, tracking object creation, implementing " +"singletons, and many other tasks." +msgstr "" +"Клас класу. Визначення класу створюють назву класу, словник класу та список " +"базових класів. Метаклас відповідає за отримання цих трьох аргументів і " +"створення класу. Більшість об'єктно-орієнтованих мов програмування " +"забезпечують реалізацію за замовчуванням. Що робить Python особливим, так це " +"те, що можна створювати власні метакласи. Більшості користувачів цей " +"інструмент ніколи не потрібен, але коли виникає потреба, метакласи можуть " +"надати потужні та елегантні рішення. Вони використовувалися для реєстрації " +"доступу до атрибутів, додавання потокової безпеки, відстеження створення " +"об’єктів, реалізації одиночних елементів і багатьох інших завдань." + +msgid "More information can be found in :ref:`metaclasses`." +msgstr "Більше інформації можна знайти в :ref:`metaclasses`." + +msgid "method" +msgstr "метод" + +msgid "" +"A function which is defined inside a class body. If called as an attribute " +"of an instance of that class, the method will get the instance object as its " +"first :term:`argument` (which is usually called ``self``). See :term:" +"`function` and :term:`nested scope`." +msgstr "" +"Функція, яка визначена всередині тіла класу. Якщо викликати його як атрибут " +"примірника цього класу, метод отримає об’єкт примірника як свій перший :term:" +"`argument` (який зазвичай називається ``self``). Див. :term:`function` і :" +"term:`nested scope`." + +msgid "method resolution order" +msgstr "порядок вирішення методу" + +msgid "" +"Method Resolution Order is the order in which base classes are searched for " +"a member during lookup. See :ref:`python_2.3_mro` for details of the " +"algorithm used by the Python interpreter since the 2.3 release." +msgstr "" + +msgid "module" +msgstr "модуль" + +msgid "" +"An object that serves as an organizational unit of Python code. Modules " +"have a namespace containing arbitrary Python objects. Modules are loaded " +"into Python by the process of :term:`importing`." +msgstr "" +"Об’єкт, який є організаційною одиницею коду Python. Модулі мають простір " +"імен, що містить довільні об’єкти Python. Модулі завантажуються в Python за " +"допомогою процесу :term:`importing`." + +msgid "See also :term:`package`." +msgstr "Дивіться також :term:`package`." + +msgid "module spec" +msgstr "модуль спец" + +msgid "" +"A namespace containing the import-related information used to load a module. " +"An instance of :class:`importlib.machinery.ModuleSpec`." +msgstr "" +"Простір імен, що містить пов’язану з імпортом інформацію, яка " +"використовується для завантаження модуля. Екземпляр :class:`importlib." +"machinery.ModuleSpec`." + +msgid "See also :ref:`module-specs`." +msgstr "" + +msgid "MRO" +msgstr "MRO" + +msgid "See :term:`method resolution order`." +msgstr "Дивіться :term:`method resolution order`." + +msgid "mutable" +msgstr "мінливий" + +msgid "" +"Mutable objects can change their value but keep their :func:`id`. See also :" +"term:`immutable`." +msgstr "" +"Змінні об’єкти можуть змінювати своє значення, але зберігають свій :func:" +"`id`. Дивіться також :term:`immutable`." + +msgid "named tuple" +msgstr "іменований кортеж" + +msgid "" +"The term \"named tuple\" applies to any type or class that inherits from " +"tuple and whose indexable elements are also accessible using named " +"attributes. The type or class may have other features as well." +msgstr "" +"Термін \"іменований кортеж\" застосовується до будь-якого типу або класу, " +"який успадковує кортеж і чиї індексовані елементи також доступні за " +"допомогою іменованих атрибутів. Тип або клас також можуть мати інші " +"особливості." + +msgid "" +"Several built-in types are named tuples, including the values returned by :" +"func:`time.localtime` and :func:`os.stat`. Another example is :data:`sys." +"float_info`::" +msgstr "" +"Кілька вбудованих типів є іменованими кортежами, включаючи значення, що " +"повертаються :func:`time.localtime` і :func:`os.stat`. Інший приклад: :data:" +"`sys.float_info`::" + +msgid "" +">>> sys.float_info[1] # indexed access\n" +"1024\n" +">>> sys.float_info.max_exp # named field access\n" +"1024\n" +">>> isinstance(sys.float_info, tuple) # kind of tuple\n" +"True" +msgstr "" + +msgid "" +"Some named tuples are built-in types (such as the above examples). " +"Alternatively, a named tuple can be created from a regular class definition " +"that inherits from :class:`tuple` and that defines named fields. Such a " +"class can be written by hand, or it can be created by inheriting :class:" +"`typing.NamedTuple`, or with the factory function :func:`collections." +"namedtuple`. The latter techniques also add some extra methods that may not " +"be found in hand-written or built-in named tuples." +msgstr "" + +msgid "namespace" +msgstr "простір імен" + +msgid "" +"The place where a variable is stored. Namespaces are implemented as " +"dictionaries. There are the local, global and built-in namespaces as well " +"as nested namespaces in objects (in methods). Namespaces support modularity " +"by preventing naming conflicts. For instance, the functions :func:`builtins." +"open <.open>` and :func:`os.open` are distinguished by their namespaces. " +"Namespaces also aid readability and maintainability by making it clear which " +"module implements a function. For instance, writing :func:`random.seed` or :" +"func:`itertools.islice` makes it clear that those functions are implemented " +"by the :mod:`random` and :mod:`itertools` modules, respectively." +msgstr "" +"Місце, де зберігається змінна. Простори імен реалізовані як словники. " +"Існують локальні, глобальні та вбудовані простори імен, а також вкладені " +"простори імен в об’єктах (у методах). Простори імен підтримують модульність, " +"запобігаючи конфліктам імен. Наприклад, функції :func:`builtins.open <." +"open>` і :func:`os.open` відрізняються своїми просторами імен. Простори імен " +"також сприяють читабельності та зручності обслуговування, пояснюючи, який " +"модуль реалізує функцію. Наприклад, написання :func:`random.seed` або :func:" +"`itertools.islice` дає зрозуміти, що ці функції реалізовані модулями :mod:" +"`random` і :mod:`itertools` відповідно." + +msgid "namespace package" +msgstr "пакет простору імен" + +msgid "" +"A :term:`package` which serves only as a container for subpackages. " +"Namespace packages may have no physical representation, and specifically are " +"not like a :term:`regular package` because they have no ``__init__.py`` file." +msgstr "" + +msgid "" +"Namespace packages allow several individually installable packages to have a " +"common parent package. Otherwise, it is recommended to use a :term:`regular " +"package`." +msgstr "" + +msgid "" +"For more information, see :pep:`420` and :ref:`reference-namespace-package`." +msgstr "" + +msgid "See also :term:`module`." +msgstr "Дивіться також :term:`module`." + +msgid "nested scope" +msgstr "вкладена область" + +msgid "" +"The ability to refer to a variable in an enclosing definition. For " +"instance, a function defined inside another function can refer to variables " +"in the outer function. Note that nested scopes by default work only for " +"reference and not for assignment. Local variables both read and write in " +"the innermost scope. Likewise, global variables read and write to the " +"global namespace. The :keyword:`nonlocal` allows writing to outer scopes." +msgstr "" +"Можливість посилатися на змінну в охоплюючому визначенні. Наприклад, " +"функція, визначена всередині іншої функції, може посилатися на змінні у " +"зовнішній функції. Зауважте, що вкладені області за замовчуванням працюють " +"лише для довідки, а не для призначення. Локальні змінні читають і записують " +"у внутрішній області видимості. Так само глобальні змінні читають і " +"записують у глобальний простір імен. :keyword:`nonlocal` дозволяє писати у " +"зовнішні області." + +msgid "new-style class" +msgstr "клас нового стилю" + +msgid "" +"Old name for the flavor of classes now used for all class objects. In " +"earlier Python versions, only new-style classes could use Python's newer, " +"versatile features like :attr:`~object.__slots__`, descriptors, properties, :" +"meth:`~object.__getattribute__`, class methods, and static methods." +msgstr "" + +msgid "object" +msgstr "об'єкт" + +msgid "" +"Any data with state (attributes or value) and defined behavior (methods). " +"Also the ultimate base class of any :term:`new-style class`." +msgstr "" +"Будь-які дані зі станом (атрибути або значення) і визначеною поведінкою " +"(методи). Також остаточний базовий клас будь-якого :term:`new-style class`." + +msgid "optimized scope" +msgstr "" + +msgid "" +"A scope where target local variable names are reliably known to the compiler " +"when the code is compiled, allowing optimization of read and write access to " +"these names. The local namespaces for functions, generators, coroutines, " +"comprehensions, and generator expressions are optimized in this fashion. " +"Note: most interpreter optimizations are applied to all scopes, only those " +"relying on a known set of local and nonlocal variable names are restricted " +"to optimized scopes." +msgstr "" + +msgid "package" +msgstr "пакет" + +msgid "" +"A Python :term:`module` which can contain submodules or recursively, " +"subpackages. Technically, a package is a Python module with a ``__path__`` " +"attribute." +msgstr "" +":term:`модуль` Python, що може містити підмодулі чи, рекурсивно, підпакети. " +"З технічного боку, пакет є модулем Python з атрибутом ``__path__``." + +msgid "See also :term:`regular package` and :term:`namespace package`." +msgstr "Дивіться також :term:`regular package` і :term:`namespace package`." + +msgid "parameter" +msgstr "параметр" + +msgid "" +"A named entity in a :term:`function` (or method) definition that specifies " +"an :term:`argument` (or in some cases, arguments) that the function can " +"accept. There are five kinds of parameter:" +msgstr "" +"Іменована сутність у визначенні :term:`function` (або методу), яка визначає :" +"term:`argument` (або в деяких випадках аргументи), які функція може " +"прийняти. Є п'ять типів параметрів:" + +msgid "" +":dfn:`positional-or-keyword`: specifies an argument that can be passed " +"either :term:`positionally ` or as a :term:`keyword argument " +"`. This is the default kind of parameter, for example *foo* and " +"*bar* in the following::" +msgstr "" +":dfn:`positional-or-keyword`: визначає аргумент, який можна передати :term:" +"`позиційно ` або як :term:`аргумент ключового слова `. " +"Це тип параметра за замовчуванням, наприклад *foo* і *bar* у наступному::" + +msgid "def func(foo, bar=None): ..." +msgstr "def func(foo, bar=None): ..." + +msgid "" +":dfn:`positional-only`: specifies an argument that can be supplied only by " +"position. Positional-only parameters can be defined by including a ``/`` " +"character in the parameter list of the function definition after them, for " +"example *posonly1* and *posonly2* in the following::" +msgstr "" +":dfn:`positional-only`: визначає аргумент, який можна надати лише за " +"позицією. Лише позиційні параметри можна визначити, включивши символ ``/`` у " +"список параметрів визначення функції після них, наприклад *posonly1* і " +"*posonly2* у наступному::" + +msgid "def func(posonly1, posonly2, /, positional_or_keyword): ..." +msgstr "def func(posonly1, posonly2, /, positional_or_keyword): ..." + +msgid "" +":dfn:`keyword-only`: specifies an argument that can be supplied only by " +"keyword. Keyword-only parameters can be defined by including a single var-" +"positional parameter or bare ``*`` in the parameter list of the function " +"definition before them, for example *kw_only1* and *kw_only2* in the " +"following::" +msgstr "" +":dfn:`keyword-only`: визначає аргумент, який можна надати лише за ключовим " +"словом. Параметри, що містять лише ключове слово, можна визначити, включивши " +"один змінний позиційний параметр або голий ``*`` у список параметрів " +"визначення функції перед ними, наприклад *kw_only1* і *kw_only2* у " +"наступному:" + +msgid "def func(arg, *, kw_only1, kw_only2): ..." +msgstr "def func(arg, *, kw_only1, kw_only2): ..." + +msgid "" +":dfn:`var-positional`: specifies that an arbitrary sequence of positional " +"arguments can be provided (in addition to any positional arguments already " +"accepted by other parameters). Such a parameter can be defined by " +"prepending the parameter name with ``*``, for example *args* in the " +"following::" +msgstr "" +":dfn:`var-positional`: вказує, що можна надати довільну послідовність " +"позиційних аргументів (на додаток до будь-яких позиційних аргументів, уже " +"прийнятих іншими параметрами). Такий параметр можна визначити, додавши перед " +"назвою параметра ``*``, наприклад *args* у наступному::" + +msgid "def func(*args, **kwargs): ..." +msgstr "def func(*args, **kwargs): ..." + +msgid "" +":dfn:`var-keyword`: specifies that arbitrarily many keyword arguments can be " +"provided (in addition to any keyword arguments already accepted by other " +"parameters). Such a parameter can be defined by prepending the parameter " +"name with ``**``, for example *kwargs* in the example above." +msgstr "" +":dfn:`var-keyword`: вказує, що можна надати довільну кількість аргументів " +"ключових слів (на додаток до будь-яких аргументів ключових слів, які вже " +"прийняті іншими параметрами). Такий параметр можна визначити, додавши перед " +"назвою параметра ``**``, наприклад *kwargs* у прикладі вище." + +msgid "" +"Parameters can specify both optional and required arguments, as well as " +"default values for some optional arguments." +msgstr "" +"Параметри можуть вказувати як необов’язкові, так і обов’язкові аргументи, а " +"також значення за умовчанням для деяких необов’язкових аргументів." + +msgid "" +"See also the :term:`argument` glossary entry, the FAQ question on :ref:`the " +"difference between arguments and parameters `, " +"the :class:`inspect.Parameter` class, the :ref:`function` section, and :pep:" +"`362`." +msgstr "" +"Дивіться також :term:`argument` глосарій, питання FAQ про :ref:`різницю між " +"аргументами та параметрами `, :class:`inspect." +"Parameter` клас, :ref:`function` розділ та :pep:`362`." + +msgid "path entry" +msgstr "запис шляху" + +msgid "" +"A single location on the :term:`import path` which the :term:`path based " +"finder` consults to find modules for importing." +msgstr "" +"Єдине розташування на :term:`import path`, до якого :term:`path based " +"finder` звертається, щоб знайти модулі для імпорту." + +msgid "path entry finder" +msgstr "шукач запису шляху" + +msgid "" +"A :term:`finder` returned by a callable on :data:`sys.path_hooks` (i.e. a :" +"term:`path entry hook`) which knows how to locate modules given a :term:" +"`path entry`." +msgstr "" +":term:`finder`, що повертається викликом на :data:`sys.path_hooks` (тобто :" +"term:`path entry hook`), який знає, як знаходити модулі за допомогою :term:" +"`path entry`." + +msgid "" +"See :class:`importlib.abc.PathEntryFinder` for the methods that path entry " +"finders implement." +msgstr "" +"Перегляньте :class:`importlib.abc.PathEntryFinder` методи, які реалізують " +"засоби пошуку запису шляху." + +msgid "path entry hook" +msgstr "гачок входу шляху" + +msgid "" +"A callable on the :data:`sys.path_hooks` list which returns a :term:`path " +"entry finder` if it knows how to find modules on a specific :term:`path " +"entry`." +msgstr "" + +msgid "path based finder" +msgstr "пошук на основі шляху" + +msgid "" +"One of the default :term:`meta path finders ` which " +"searches an :term:`import path` for modules." +msgstr "" +"Один із стандартних :term:`мета-шляхів пошуку `, який " +"шукає :term:`import path` для модулів." + +msgid "path-like object" +msgstr "шляхоподібний об’єкт" + +msgid "" +"An object representing a file system path. A path-like object is either a :" +"class:`str` or :class:`bytes` object representing a path, or an object " +"implementing the :class:`os.PathLike` protocol. An object that supports the :" +"class:`os.PathLike` protocol can be converted to a :class:`str` or :class:" +"`bytes` file system path by calling the :func:`os.fspath` function; :func:" +"`os.fsdecode` and :func:`os.fsencode` can be used to guarantee a :class:" +"`str` or :class:`bytes` result instead, respectively. Introduced by :pep:" +"`519`." +msgstr "" +"Об'єкт, що представляє шлях до файлової системи. Шляховий об’єкт – це або :" +"class:`str`, або :class:`bytes` об’єкт, що представляє шлях, або об’єкт, що " +"реалізує протокол :class:`os.PathLike`. Об’єкт, який підтримує протокол :" +"class:`os.PathLike`, можна перетворити на шлях файлової системи :class:`str` " +"або :class:`bytes` шляхом виклику функції :func:`os.fspath`; :func:`os." +"fsdecode` і :func:`os.fsencode` можна використовувати, щоб гарантувати " +"результат :class:`str` або :class:`bytes` відповідно. Представлений :pep:" +"`519`." + +msgid "PEP" +msgstr "PEP" + +msgid "" +"Python Enhancement Proposal. A PEP is a design document providing " +"information to the Python community, or describing a new feature for Python " +"or its processes or environment. PEPs should provide a concise technical " +"specification and a rationale for proposed features." +msgstr "" +"Пропозиція вдосконалення Python. PEP — це проектний документ, який надає " +"інформацію спільноті Python або описує нову функцію для Python або його " +"процеси чи середовище. Публічні діячі повинні надавати стислу технічну " +"специфікацію та обґрунтування запропонованих функцій." + +msgid "" +"PEPs are intended to be the primary mechanisms for proposing major new " +"features, for collecting community input on an issue, and for documenting " +"the design decisions that have gone into Python. The PEP author is " +"responsible for building consensus within the community and documenting " +"dissenting opinions." +msgstr "" +"PEP мають бути основними механізмами для пропонування основних нових " +"функцій, для збору інформації спільноти щодо проблеми та для документування " +"проектних рішень, які увійшли в Python. Автор PEP відповідає за формування " +"консенсусу в спільноті та документування особливих думок." + +msgid "See :pep:`1`." +msgstr "Дивіться :pep:`1`." + +msgid "portion" +msgstr "частина" + +msgid "" +"A set of files in a single directory (possibly stored in a zip file) that " +"contribute to a namespace package, as defined in :pep:`420`." +msgstr "" +"Набір файлів в одному каталозі (можливо, збережених у файлі zip), які " +"входять до пакету простору імен, як визначено в :pep:`420`." + +msgid "positional argument" +msgstr "позиційний аргумент" + +msgid "provisional API" +msgstr "тимчасовий API" + +msgid "" +"A provisional API is one which has been deliberately excluded from the " +"standard library's backwards compatibility guarantees. While major changes " +"to such interfaces are not expected, as long as they are marked provisional, " +"backwards incompatible changes (up to and including removal of the " +"interface) may occur if deemed necessary by core developers. Such changes " +"will not be made gratuitously -- they will occur only if serious fundamental " +"flaws are uncovered that were missed prior to the inclusion of the API." +msgstr "" +"Попередній API — це той, який був навмисно виключений із гарантій зворотної " +"сумісності стандартної бібліотеки. Хоча суттєвих змін у таких інтерфейсах не " +"очікується, доки вони позначені як тимчасові, зворотні несумісні зміни (аж " +"до видалення інтерфейсу включно) можуть відбутися, якщо розробники ядра " +"вважають це за потрібне. Такі зміни не будуть внесені безоплатно — вони " +"відбудуться лише за умови виявлення серйозних фундаментальних недоліків, які " +"були пропущені до включення API." + +msgid "" +"Even for provisional APIs, backwards incompatible changes are seen as a " +"\"solution of last resort\" - every attempt will still be made to find a " +"backwards compatible resolution to any identified problems." +msgstr "" +"Навіть для тимчасових API зворотні несумісні зміни розглядаються як " +"\"вирішення останньої інстанції\" — все одно будуть зроблені всі спроби " +"знайти зворотно сумісне вирішення будь-яких виявлених проблем." + +msgid "" +"This process allows the standard library to continue to evolve over time, " +"without locking in problematic design errors for extended periods of time. " +"See :pep:`411` for more details." +msgstr "" +"Цей процес дозволяє стандартній бібліотеці продовжувати розвиватися з часом, " +"не блокуючи проблемні помилки проектування протягом тривалих періодів часу. " +"Дивіться :pep:`411` для більш детальної інформації." + +msgid "provisional package" +msgstr "тимчасовий пакет" + +msgid "See :term:`provisional API`." +msgstr "Перегляньте :term:`provisional API`." + +msgid "Python 3000" +msgstr "Python 3000" + +msgid "" +"Nickname for the Python 3.x release line (coined long ago when the release " +"of version 3 was something in the distant future.) This is also abbreviated " +"\"Py3k\"." +msgstr "" +"Псевдонім для рядка випусків Python 3.x (придуманий давно, коли випуск " +"версії 3 був чимось у віддаленому майбутньому). Це також скорочено \"Py3k\"." + +msgid "Pythonic" +msgstr "Pythonic" + +msgid "" +"An idea or piece of code which closely follows the most common idioms of the " +"Python language, rather than implementing code using concepts common to " +"other languages. For example, a common idiom in Python is to loop over all " +"elements of an iterable using a :keyword:`for` statement. Many other " +"languages don't have this type of construct, so people unfamiliar with " +"Python sometimes use a numerical counter instead::" +msgstr "" +"Ідея або фрагмент коду, який точно відповідає найпоширенішим ідіомам мови " +"Python, а не реалізує код за допомогою концепцій, спільних для інших мов. " +"Наприклад, поширена ідіома в Python полягає в тому, щоб перебирати всі " +"елементи ітерованого за допомогою оператора :keyword:`for`. Багато інших мов " +"не мають такого типу конструкції, тому люди, які не знайомі з Python, іноді " +"замість цього використовують числовий лічильник::" + +msgid "" +"for i in range(len(food)):\n" +" print(food[i])" +msgstr "" +"for i in range(len(food)):\n" +" print(food[i])" + +msgid "As opposed to the cleaner, Pythonic method::" +msgstr "На відміну від очищувача, метод Pythonic::" + +msgid "" +"for piece in food:\n" +" print(piece)" +msgstr "" +"for piece in food:\n" +" print(piece)" + +msgid "qualified name" +msgstr "кваліфіковане ім'я" + +msgid "" +"A dotted name showing the \"path\" from a module's global scope to a class, " +"function or method defined in that module, as defined in :pep:`3155`. For " +"top-level functions and classes, the qualified name is the same as the " +"object's name::" +msgstr "" +"Назва з крапками, що вказує \"шлях\" від глобальної області видимості модуля " +"до класу, функції або методу, визначеного в цьому модулі, як визначено в :" +"pep:`3155`. Для функцій і класів верхнього рівня кваліфіковане ім’я " +"збігається з ім’ям об’єкта::" + +msgid "" +">>> class C:\n" +"... class D:\n" +"... def meth(self):\n" +"... pass\n" +"...\n" +">>> C.__qualname__\n" +"'C'\n" +">>> C.D.__qualname__\n" +"'C.D'\n" +">>> C.D.meth.__qualname__\n" +"'C.D.meth'" +msgstr "" +">>> class C:\n" +"... class D:\n" +"... def meth(self):\n" +"... pass\n" +"...\n" +">>> C.__qualname__\n" +"'C'\n" +">>> C.D.__qualname__\n" +"'C.D'\n" +">>> C.D.meth.__qualname__\n" +"'C.D.meth'" + +msgid "" +"When used to refer to modules, the *fully qualified name* means the entire " +"dotted path to the module, including any parent packages, e.g. ``email.mime." +"text``::" +msgstr "" +"Коли використовується для позначення модулів, *повне ім’я* означає весь шлях " +"до модуля, розділений крапками, включаючи будь-які батьківські пакети, напр. " +"``email.mime.text``::" + +msgid "" +">>> import email.mime.text\n" +">>> email.mime.text.__name__\n" +"'email.mime.text'" +msgstr "" +">>> import email.mime.text\n" +">>> email.mime.text.__name__\n" +"'email.mime.text'" + +msgid "reference count" +msgstr "кількість посилань" + +msgid "" +"The number of references to an object. When the reference count of an " +"object drops to zero, it is deallocated. Some objects are :term:`immortal` " +"and have reference counts that are never modified, and therefore the objects " +"are never deallocated. Reference counting is generally not visible to " +"Python code, but it is a key element of the :term:`CPython` implementation. " +"Programmers can call the :func:`sys.getrefcount` function to return the " +"reference count for a particular object." +msgstr "" + +msgid "regular package" +msgstr "звичайний пакет" + +msgid "" +"A traditional :term:`package`, such as a directory containing an ``__init__." +"py`` file." +msgstr "" +"Традиційний :term:`package`, як-от каталог, що містить файл ``__init__.py``." + +msgid "See also :term:`namespace package`." +msgstr "Дивіться також :term:`namespace package`." + +msgid "REPL" +msgstr "REPL" + +msgid "" +"An acronym for the \"read–eval–print loop\", another name for the :term:" +"`interactive` interpreter shell." +msgstr "" +"Акронім від \"read–eval–print loop\" (цикл читання-обчислення-вивід), інша " +"назва для :term:`інтерактивної` оболонки інтерпретатора." + +msgid "__slots__" +msgstr "__slots__" + +msgid "" +"A declaration inside a class that saves memory by pre-declaring space for " +"instance attributes and eliminating instance dictionaries. Though popular, " +"the technique is somewhat tricky to get right and is best reserved for rare " +"cases where there are large numbers of instances in a memory-critical " +"application." +msgstr "" +"Оголошення всередині класу, яке економить пам’ять шляхом попереднього " +"оголошення місця для атрибутів екземпляра та видалення словників " +"екземплярів. Незважаючи на те, що ця техніка популярна, її дещо складно " +"застосувати, і її найкраще використовувати для рідкісних випадків, коли в " +"програмі, критичній до пам’яті, є велика кількість екземплярів." + +msgid "sequence" +msgstr "послідовність" + +msgid "" +"An :term:`iterable` which supports efficient element access using integer " +"indices via the :meth:`~object.__getitem__` special method and defines a :" +"meth:`~object.__len__` method that returns the length of the sequence. Some " +"built-in sequence types are :class:`list`, :class:`str`, :class:`tuple`, " +"and :class:`bytes`. Note that :class:`dict` also supports :meth:`~object." +"__getitem__` and :meth:`!__len__`, but is considered a mapping rather than a " +"sequence because the lookups use arbitrary :term:`hashable` keys rather than " +"integers." +msgstr "" + +msgid "" +"The :class:`collections.abc.Sequence` abstract base class defines a much " +"richer interface that goes beyond just :meth:`~object.__getitem__` and :meth:" +"`~object.__len__`, adding :meth:`!count`, :meth:`!index`, :meth:`~object." +"__contains__`, and :meth:`~object.__reversed__`. Types that implement this " +"expanded interface can be registered explicitly using :func:`~abc.ABCMeta." +"register`. For more documentation on sequence methods generally, see :ref:" +"`Common Sequence Operations `." +msgstr "" + +msgid "set comprehension" +msgstr "встановити розуміння" + +msgid "" +"A compact way to process all or part of the elements in an iterable and " +"return a set with the results. ``results = {c for c in 'abracadabra' if c " +"not in 'abc'}`` generates the set of strings ``{'r', 'd'}``. See :ref:" +"`comprehensions`." +msgstr "" +"Компактний спосіб обробки всіх або частини елементів у ітерації та " +"повернення набору з результатами. ``results = {c for c in 'abracadabra' if c " +"not in 'abc'}`` генерує набір рядків ``{'r', 'd'}``. Дивіться :ref:" +"`comprehensions`." + +msgid "single dispatch" +msgstr "єдина відправка" + +msgid "" +"A form of :term:`generic function` dispatch where the implementation is " +"chosen based on the type of a single argument." +msgstr "" +"Форма відправки :term:`generic function`, де реалізація вибирається на " +"основі типу одного аргументу." + +msgid "slice" +msgstr "шматочок" + +msgid "" +"An object usually containing a portion of a :term:`sequence`. A slice is " +"created using the subscript notation, ``[]`` with colons between numbers " +"when several are given, such as in ``variable_name[1:3:5]``. The bracket " +"(subscript) notation uses :class:`slice` objects internally." +msgstr "" +"Об’єкт, який зазвичай містить частину :term:`sequence`. Зріз створюється з " +"використанням нижнього індексу ``[]`` з двокрапками між числами, якщо " +"вказано кілька, наприклад, ``variable_name[1:3:5]``. Нотація в дужках " +"(підрядковому) використовує внутрішньо об’єкти :class:`slice`." + +msgid "soft deprecated" +msgstr "" + +msgid "" +"A soft deprecated API should not be used in new code, but it is safe for " +"already existing code to use it. The API remains documented and tested, but " +"will not be enhanced further." +msgstr "" + +msgid "" +"Soft deprecation, unlike normal deprecation, does not plan on removing the " +"API and will not emit warnings." +msgstr "" + +msgid "" +"See `PEP 387: Soft Deprecation `_." +msgstr "" + +msgid "special method" +msgstr "спеціальний метод" + +msgid "" +"A method that is called implicitly by Python to execute a certain operation " +"on a type, such as addition. Such methods have names starting and ending " +"with double underscores. Special methods are documented in :ref:" +"`specialnames`." +msgstr "" +"Метод, який неявно викликається Python для виконання певної операції над " +"типом, наприклад додавання. Такі методи мають назви, що починаються і " +"закінчуються подвійним підкресленням. Спеціальні методи описані в :ref:" +"`specialnames`." + +msgid "statement" +msgstr "заява" + +msgid "" +"A statement is part of a suite (a \"block\" of code). A statement is either " +"an :term:`expression` or one of several constructs with a keyword, such as :" +"keyword:`if`, :keyword:`while` or :keyword:`for`." +msgstr "" +"Оператор є частиною набору (\"блоку\" коду). Інструкція є або :term:" +"`expression`, або однією з кількох конструкцій із ключовим словом, таким як :" +"keyword:`if`, :keyword:`while` або :keyword:`for`." + +msgid "static type checker" +msgstr "" + +msgid "" +"An external tool that reads Python code and analyzes it, looking for issues " +"such as incorrect types. See also :term:`type hints ` and the :" +"mod:`typing` module." +msgstr "" + +msgid "strong reference" +msgstr "сильна посилання" + +msgid "" +"In Python's C API, a strong reference is a reference to an object which is " +"owned by the code holding the reference. The strong reference is taken by " +"calling :c:func:`Py_INCREF` when the reference is created and released with :" +"c:func:`Py_DECREF` when the reference is deleted." +msgstr "" + +msgid "" +"The :c:func:`Py_NewRef` function can be used to create a strong reference to " +"an object. Usually, the :c:func:`Py_DECREF` function must be called on the " +"strong reference before exiting the scope of the strong reference, to avoid " +"leaking one reference." +msgstr "" +"Функцію :c:func:`Py_NewRef` можна використовувати для створення сильного " +"посилання на об’єкт. Зазвичай функцію :c:func:`Py_DECREF` потрібно викликати " +"для сильного посилання перед виходом із області сильного посилання, щоб " +"уникнути витоку одного посилання." + +msgid "See also :term:`borrowed reference`." +msgstr "Дивіться також :term:`borrowed reference`." + +msgid "text encoding" +msgstr "кодування тексту" + +msgid "" +"A string in Python is a sequence of Unicode code points (in range " +"``U+0000``--``U+10FFFF``). To store or transfer a string, it needs to be " +"serialized as a sequence of bytes." +msgstr "" +"Рядок у Python — це послідовність кодових точок Unicode (у діапазоні " +"``U+0000``--``U+10FFFF``). Щоб зберегти або передати рядок, його потрібно " +"серіалізувати як послідовність байтів." + +msgid "" +"Serializing a string into a sequence of bytes is known as \"encoding\", and " +"recreating the string from the sequence of bytes is known as \"decoding\"." +msgstr "" +"Серіалізація рядка в послідовність байтів відома як \"кодування\", а " +"відтворення рядка з послідовності байтів відоме як \"декодування\"." + +msgid "" +"There are a variety of different text serialization :ref:`codecs `, which are collectively referred to as \"text encodings\"." +msgstr "" +"Існує безліч різних :ref:`кодеків ` серіалізації тексту, " +"які спільно називаються \"текстовими кодуваннями\"." + +msgid "text file" +msgstr "текстовий файл" + +msgid "" +"A :term:`file object` able to read and write :class:`str` objects. Often, a " +"text file actually accesses a byte-oriented datastream and handles the :term:" +"`text encoding` automatically. Examples of text files are files opened in " +"text mode (``'r'`` or ``'w'``), :data:`sys.stdin`, :data:`sys.stdout`, and " +"instances of :class:`io.StringIO`." +msgstr "" +"Об’єкт :term:`file object`, здатний читати та записувати об’єкти :class:" +"`str`. Часто текстовий файл насправді отримує доступ до байт-орієнтованого " +"потоку даних і автоматично обробляє :term:`text encoding`. Прикладами " +"текстових файлів є файли, відкриті в текстовому режимі (``'r'`` або " +"``'w'``), :data:`sys.stdin`, :data:`sys.stdout`, а також екземпляри: :class:" +"`io.StringIO`." + +msgid "" +"See also :term:`binary file` for a file object able to read and write :term:" +"`bytes-like objects `." +msgstr "" +"Дивіться також :term:`binary file` щодо файлового об’єкта, здатного читати " +"та записувати :term:`байтоподібні об’єкти `." + +msgid "token" +msgstr "" + +msgid "" +"A small unit of source code, generated by the :ref:`lexical analyzer " +"` (also called the *tokenizer*). Names, numbers, strings, " +"operators, newlines and similar are represented by tokens." +msgstr "" + +msgid "" +"The :mod:`tokenize` module exposes Python's lexical analyzer. The :mod:" +"`token` module contains information on the various types of tokens." +msgstr "" + +msgid "triple-quoted string" +msgstr "рядок із потрійними лапками" + +msgid "" +"A string which is bound by three instances of either a quotation mark (\") " +"or an apostrophe ('). While they don't provide any functionality not " +"available with single-quoted strings, they are useful for a number of " +"reasons. They allow you to include unescaped single and double quotes " +"within a string and they can span multiple lines without the use of the " +"continuation character, making them especially useful when writing " +"docstrings." +msgstr "" +"Рядок, обмежений трьома лапками (\") або апострофом ('). Хоча вони не " +"надають жодної функції, недоступної для рядків із одинарними лапками, вони " +"корисні з кількох причин. Вони дозволяють ви можете включити неекрановані " +"одинарні та подвійні лапки в рядок, і вони можуть охоплювати кілька рядків " +"без використання символу продовження, що робить їх особливо корисними під " +"час написання рядків документів." + +msgid "type" +msgstr "тип" + +msgid "" +"The type of a Python object determines what kind of object it is; every " +"object has a type. An object's type is accessible as its :attr:`~object." +"__class__` attribute or can be retrieved with ``type(obj)``." +msgstr "" +"Тип об'єкта Python визначає, що це за об'єкт; кожен об'єкт має тип. Тип " +"об'єкта доступний як атрибут :attr:`~object.__class__`, або може бути " +"отриманий за допомогою ``type(obj)``." + +msgid "type alias" +msgstr "псевдонім типу" + +msgid "A synonym for a type, created by assigning the type to an identifier." +msgstr "Синонім типу, створений шляхом присвоєння типу ідентифікатору." + +msgid "" +"Type aliases are useful for simplifying :term:`type hints `. For " +"example::" +msgstr "" +"Псевдоніми типів корисні для спрощення :term:`підказок типу `. " +"Наприклад::" + +msgid "" +"def remove_gray_shades(\n" +" colors: list[tuple[int, int, int]]) -> list[tuple[int, int, int]]:\n" +" pass" +msgstr "" +"def remove_gray_shades(\n" +" colors: list[tuple[int, int, int]]) -> list[tuple[int, int, int]]:\n" +" pass" + +msgid "could be made more readable like this::" +msgstr "можна зробити більш читабельним таким чином::" + +msgid "" +"Color = tuple[int, int, int]\n" +"\n" +"def remove_gray_shades(colors: list[Color]) -> list[Color]:\n" +" pass" +msgstr "" +"Color = tuple[int, int, int]\n" +"\n" +"def remove_gray_shades(colors: list[Color]) -> list[Color]:\n" +" pass" + +msgid "See :mod:`typing` and :pep:`484`, which describe this functionality." +msgstr "Перегляньте :mod:`typing` і :pep:`484`, які описують цю функцію." + +msgid "type hint" +msgstr "підказка типу" + +msgid "" +"An :term:`annotation` that specifies the expected type for a variable, a " +"class attribute, or a function parameter or return value." +msgstr "" +":term:`annotation`, яка визначає очікуваний тип для змінної, атрибута класу " +"або параметра функції чи значення, що повертається." + +msgid "" +"Type hints are optional and are not enforced by Python but they are useful " +"to :term:`static type checkers `. They can also aid " +"IDEs with code completion and refactoring." +msgstr "" +"Підказки типу є необов'язковими і не вимагаються Python, але вони корисні " +"для :term:`програм для статичної перевірки типів `. " +"Вони також можуть допомогти IDE з завершенням коду та рефакторингом." + +msgid "" +"Type hints of global variables, class attributes, and functions, but not " +"local variables, can be accessed using :func:`typing.get_type_hints`." +msgstr "" +"Доступ до підказок типу глобальних змінних, атрибутів класу та функцій, але " +"не локальних змінних, можна отримати за допомогою :func:`typing." +"get_type_hints`." + +msgid "universal newlines" +msgstr "універсальні символи нового рядка" + +msgid "" +"A manner of interpreting text streams in which all of the following are " +"recognized as ending a line: the Unix end-of-line convention ``'\\n'``, the " +"Windows convention ``'\\r\\n'``, and the old Macintosh convention " +"``'\\r'``. See :pep:`278` and :pep:`3116`, as well as :func:`bytes." +"splitlines` for an additional use." +msgstr "" +"Спосіб інтерпретації текстових потоків, у якому все наступне розпізнається " +"як завершення рядка: угода Unix про кінець рядка ``'\\n'``, угода Windows " +"``'\\r\\n'``, і стару конвенцію Macintosh ``'\\r'``. Перегляньте :pep:`278` " +"і :pep:`3116`, а також :func:`bytes.splitlines` для додаткового використання." + +msgid "variable annotation" +msgstr "анотація змінної" + +msgid "An :term:`annotation` of a variable or a class attribute." +msgstr ":term:`annotation` змінної або атрибута класу." + +msgid "" +"When annotating a variable or a class attribute, assignment is optional::" +msgstr "" +"При анотуванні змінної або атрибута класу призначення є необов’язковим:" + +msgid "" +"class C:\n" +" field: 'annotation'" +msgstr "" +"class C:\n" +" field: 'annotation'" + +msgid "" +"Variable annotations are usually used for :term:`type hints `: " +"for example this variable is expected to take :class:`int` values::" +msgstr "" +"Анотації змінних зазвичай використовуються для :term:`підказок типу `: наприклад, очікується, що ця змінна прийматиме значення :class:" +"`int`::" + +msgid "count: int = 0" +msgstr "count: int = 0" + +msgid "Variable annotation syntax is explained in section :ref:`annassign`." +msgstr "Синтаксис анотації змінної пояснюється в розділі :ref:`annassign`." + +msgid "" +"See :term:`function annotation`, :pep:`484` and :pep:`526`, which describe " +"this functionality. Also see :ref:`annotations-howto` for best practices on " +"working with annotations." +msgstr "" +"Перегляньте :term:`function annotation`, :pep:`484` та :pep:`526`, які " +"описують цю функціональність. Також перегляньте :ref:`annotations-howto`, " +"щоб дізнатися про найкращі практики роботи з анотаціями." + +msgid "virtual environment" +msgstr "віртуальне середовище" + +msgid "" +"A cooperatively isolated runtime environment that allows Python users and " +"applications to install and upgrade Python distribution packages without " +"interfering with the behaviour of other Python applications running on the " +"same system." +msgstr "" +"Спільно ізольоване середовище виконання, яке дозволяє користувачам і " +"програмам Python встановлювати та оновлювати дистрибутивні пакети Python, не " +"втручаючись у поведінку інших програм Python, що працюють у тій же системі." + +msgid "See also :mod:`venv`." +msgstr "Дивіться також :mod:`venv`." + +msgid "virtual machine" +msgstr "віртуальна машина" + +msgid "" +"A computer defined entirely in software. Python's virtual machine executes " +"the :term:`bytecode` emitted by the bytecode compiler." +msgstr "" +"Комп’ютер, повністю визначений програмним забезпеченням. Віртуальна машина " +"Python виконує :term:`bytecode`, виданий компілятором байт-коду." + +msgid "Zen of Python" +msgstr "Дзен Python" + +msgid "" +"Listing of Python design principles and philosophies that are helpful in " +"understanding and using the language. The listing can be found by typing " +"\"``import this``\" at the interactive prompt." +msgstr "" +"Перелік принципів дизайну та філософії Python, які допоможуть зрозуміти та " +"використовувати мову. Перелік можна знайти, ввівши \"``import this``\" в " +"інтерактивному рядку." + +msgid "C-contiguous" +msgstr "" + +msgid "Fortran contiguous" +msgstr "" + +msgid "magic" +msgstr "" + +msgid "special" +msgstr "" diff --git a/howto/annotations.po b/howto/annotations.po new file mode 100644 index 000000000..7267f0f0a --- /dev/null +++ b/howto/annotations.po @@ -0,0 +1,423 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:52+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Annotations Best Practices" +msgstr "Рекомендації щодо анотацій" + +msgid "author" +msgstr "автор" + +msgid "Larry Hastings" +msgstr "Larry Hastings" + +msgid "Abstract" +msgstr "Анотація" + +msgid "" +"This document is designed to encapsulate the best practices for working with " +"annotations dicts. If you write Python code that examines " +"``__annotations__`` on Python objects, we encourage you to follow the " +"guidelines described below." +msgstr "" +"Цей документ розроблено, щоб узагальнити найкращі методи роботи з анотаціями " +"dicts. Якщо ви пишете код на Python, який перевіряє ``__annotations__`` на " +"об’єктах Python, радимо дотримуватися вказівок, описаних нижче." + +msgid "" +"The document is organized into four sections: best practices for accessing " +"the annotations of an object in Python versions 3.10 and newer, best " +"practices for accessing the annotations of an object in Python versions 3.9 " +"and older, other best practices for ``__annotations__`` that apply to any " +"Python version, and quirks of ``__annotations__``." +msgstr "" +"Документ складається з чотирьох розділів: найкращі методи доступу до " +"анотацій об’єкта в Python версії 3.10 і новіших, найкращі методи доступу до " +"анотацій об’єктів у Python 3.9 і старіших версій, інші найкращі практики для " +"``__annotations__``, які застосовуються до будь-якої версії Python, а " +"особливості ``__annotations__``." + +msgid "" +"Note that this document is specifically about working with " +"``__annotations__``, not uses *for* annotations. If you're looking for " +"information on how to use \"type hints\" in your code, please see the :mod:" +"`typing` module." +msgstr "" +"Зверніть увагу, що в цьому документі йдеться саме про роботу з " +"``__annotations__``, а не про використання анотацій *for*. Якщо ви шукаєте " +"інформацію про те, як використовувати \"підказки типу\" у вашому коді, " +"перегляньте модуль :mod:`typing`." + +msgid "Accessing The Annotations Dict Of An Object In Python 3.10 And Newer" +msgstr "Доступ до анотацій Dict об’єкта в Python 3.10 і новіших версіях" + +msgid "" +"Python 3.10 adds a new function to the standard library: :func:`inspect." +"get_annotations`. In Python versions 3.10 and newer, calling this function " +"is the best practice for accessing the annotations dict of any object that " +"supports annotations. This function can also \"un-stringize\" stringized " +"annotations for you." +msgstr "" +"Python 3.10 додає нову функцію до стандартної бібліотеки: :func:`inspect." +"get_annotations`. У версіях Python 3.10 і новіших, виклик цієї функції є " +"найкращою практикою для доступу до dict анотацій будь-якого об’єкта, який " +"підтримує анотації. Ця функція також може \"відмінювати\" рядкові анотації " +"для вас." + +msgid "" +"If for some reason :func:`inspect.get_annotations` isn't viable for your use " +"case, you may access the ``__annotations__`` data member manually. Best " +"practice for this changed in Python 3.10 as well: as of Python 3.10, ``o." +"__annotations__`` is guaranteed to *always* work on Python functions, " +"classes, and modules. If you're certain the object you're examining is one " +"of these three *specific* objects, you may simply use ``o.__annotations__`` " +"to get at the object's annotations dict." +msgstr "" +"Якщо з якоїсь причини :func:`inspect.get_annotations` непридатний для вашого " +"випадку використання, ви можете отримати доступ до елемента даних " +"``__annotations__`` вручну. У Python 3.10 також змінилася найкраща практика " +"щодо цього: починаючи з Python 3.10, ``o.__annotations__`` гарантовано " +"*завжди* працюватиме з функціями, класами та модулями Python. Якщо ви " +"впевнені, що об’єкт, який ви досліджуєте, є одним із цих трьох *специфічних* " +"об’єктів, ви можете просто використати ``o.__annotations__``, щоб отримати " +"dict анотацій об’єкта." + +msgid "" +"However, other types of callables--for example, callables created by :func:" +"`functools.partial`--may not have an ``__annotations__`` attribute defined. " +"When accessing the ``__annotations__`` of a possibly unknown object, best " +"practice in Python versions 3.10 and newer is to call :func:`getattr` with " +"three arguments, for example ``getattr(o, '__annotations__', None)``." +msgstr "" +"Однак інші типи викликів, наприклад, виклики, створені :func:`functools." +"partial`, можуть не мати визначеного атрибута ``__annotations__``. Під час " +"доступу до ``__annotations__`` можливо невідомого об’єкта, найкраща практика " +"в Python версії 3.10 і новіших — викликати :func:`getattr` з трьома " +"аргументами, наприклад ``getattr(o, '__annotations__', None)``." + +msgid "" +"Before Python 3.10, accessing ``__annotations__`` on a class that defines no " +"annotations but that has a parent class with annotations would return the " +"parent's ``__annotations__``. In Python 3.10 and newer, the child class's " +"annotations will be an empty dict instead." +msgstr "" + +msgid "Accessing The Annotations Dict Of An Object In Python 3.9 And Older" +msgstr "Доступ до анотацій Dict об’єкта в Python 3.9 і старіших версіях" + +msgid "" +"In Python 3.9 and older, accessing the annotations dict of an object is much " +"more complicated than in newer versions. The problem is a design flaw in " +"these older versions of Python, specifically to do with class annotations." +msgstr "" +"У Python 3.9 і старіших версіях доступ до анотацій dict об’єкта набагато " +"складніший, ніж у новіших версіях. Проблема полягає в недоліку дизайну в цих " +"старих версіях Python, зокрема щодо анотацій класів." + +msgid "" +"Best practice for accessing the annotations dict of other objects--" +"functions, other callables, and modules--is the same as best practice for " +"3.10, assuming you aren't calling :func:`inspect.get_annotations`: you " +"should use three-argument :func:`getattr` to access the object's " +"``__annotations__`` attribute." +msgstr "" +"Найкраща практика доступу до анотацій dict інших об’єктів — функцій, інших " +"викликів і модулів — така ж, як і найкраща практика для 3.10, припускаючи, " +"що ви не викликаєте :func:`inspect.get_annotations`: вам слід " +"використовувати три- аргумент :func:`getattr` для доступу до атрибута " +"``__annotations__`` об’єкта." + +msgid "" +"Unfortunately, this isn't best practice for classes. The problem is that, " +"since ``__annotations__`` is optional on classes, and because classes can " +"inherit attributes from their base classes, accessing the " +"``__annotations__`` attribute of a class may inadvertently return the " +"annotations dict of a *base class.* As an example::" +msgstr "" +"На жаль, це не найкраща практика для занять. Проблема полягає в тому, що, " +"оскільки ``__annotations__`` є необов’язковим для класів, і оскільки класи " +"можуть успадковувати атрибути від своїх базових класів, доступ до атрибута " +"``__annotations__`` класу може ненавмисно повернути анотації dict *base " +"class*. Як приклад::" + +msgid "" +"class Base:\n" +" a: int = 3\n" +" b: str = 'abc'\n" +"\n" +"class Derived(Base):\n" +" pass\n" +"\n" +"print(Derived.__annotations__)" +msgstr "" + +msgid "This will print the annotations dict from ``Base``, not ``Derived``." +msgstr "Це надрукує анотації dict з ``Base``, а не ``Derived``." + +msgid "" +"Your code will have to have a separate code path if the object you're " +"examining is a class (``isinstance(o, type)``). In that case, best practice " +"relies on an implementation detail of Python 3.9 and before: if a class has " +"annotations defined, they are stored in the class's :attr:`~type.__dict__` " +"dictionary. Since the class may or may not have annotations defined, best " +"practice is to call the :meth:`~dict.get` method on the class dict." +msgstr "" + +msgid "" +"To put it all together, here is some sample code that safely accesses the " +"``__annotations__`` attribute on an arbitrary object in Python 3.9 and " +"before::" +msgstr "" +"Ось приклад коду, який безпечно отримує доступ до атрибута " +"``__annotations__`` довільного об’єкта в Python 3.9 і раніше:" + +msgid "" +"if isinstance(o, type):\n" +" ann = o.__dict__.get('__annotations__', None)\n" +"else:\n" +" ann = getattr(o, '__annotations__', None)" +msgstr "" + +msgid "" +"After running this code, ``ann`` should be either a dictionary or ``None``. " +"You're encouraged to double-check the type of ``ann`` using :func:" +"`isinstance` before further examination." +msgstr "" +"Після виконання цього коду ``ann`` має бути або словником, або ``None``. " +"Перед подальшим вивченням радимо ще раз перевірити тип ``ann`` за допомогою :" +"func:`isinstance`." + +msgid "" +"Note that some exotic or malformed type objects may not have a :attr:`~type." +"__dict__` attribute, so for extra safety you may also wish to use :func:" +"`getattr` to access :attr:`!__dict__`." +msgstr "" + +msgid "Manually Un-Stringizing Stringized Annotations" +msgstr "Ручне видалення струнних анотацій" + +msgid "" +"In situations where some annotations may be \"stringized\", and you wish to " +"evaluate those strings to produce the Python values they represent, it " +"really is best to call :func:`inspect.get_annotations` to do this work for " +"you." +msgstr "" +"У ситуаціях, коли деякі анотації можуть бути \"рядковими\", і ви бажаєте " +"оцінити ці рядки для створення значень Python, які вони представляють, " +"дійсно найкраще викликати :func:`inspect.get_annotations`, щоб зробити цю " +"роботу за вас." + +msgid "" +"If you're using Python 3.9 or older, or if for some reason you can't use :" +"func:`inspect.get_annotations`, you'll need to duplicate its logic. You're " +"encouraged to examine the implementation of :func:`inspect.get_annotations` " +"in the current Python version and follow a similar approach." +msgstr "" +"Якщо ви використовуєте Python 3.9 або старішу версію, або якщо з якоїсь " +"причини ви не можете використовувати :func:`inspect.get_annotations`, вам " +"потрібно буде скопіювати його логіку. Радимо перевірити реалізацію :func:" +"`inspect.get_annotations` у поточній версії Python і застосувати подібний " +"підхід." + +msgid "" +"In a nutshell, if you wish to evaluate a stringized annotation on an " +"arbitrary object ``o``:" +msgstr "" +"У двох словах, якщо ви бажаєте оцінити рядкову анотацію довільного об’єкта " +"``o``:" + +msgid "" +"If ``o`` is a module, use ``o.__dict__`` as the ``globals`` when calling :" +"func:`eval`." +msgstr "" +"Якщо ``o`` є модулем, використовуйте ``o.__dict__`` як ``globals`` під час " +"виклику :func:`eval`." + +msgid "" +"If ``o`` is a class, use ``sys.modules[o.__module__].__dict__`` as the " +"``globals``, and ``dict(vars(o))`` as the ``locals``, when calling :func:" +"`eval`." +msgstr "" +"Якщо ``o`` є класом, використовуйте ``sys.modules[o.__module__].__dict__`` " +"як ``globals``, а ``dict(vars(o))`` як ``locals``, під час виклику :func:" +"`eval`." + +msgid "" +"If ``o`` is a wrapped callable using :func:`functools.update_wrapper`, :func:" +"`functools.wraps`, or :func:`functools.partial`, iteratively unwrap it by " +"accessing either ``o.__wrapped__`` or ``o.func`` as appropriate, until you " +"have found the root unwrapped function." +msgstr "" +"Якщо ``o`` є обернутим викликом за допомогою :func:`functools." +"update_wrapper`, :func:`functools.wraps` або :func:`functools.partial`, " +"ітеративно розгортайте його, звертаючись до ``o.__wrapped__`` або ``o.func`` " +"відповідно, доки ви не знайдете кореневу розгорнуту функцію." + +msgid "" +"If ``o`` is a callable (but not a class), use :attr:`o.__globals__ ` as the globals when calling :func:`eval`." +msgstr "" + +msgid "" +"However, not all string values used as annotations can be successfully " +"turned into Python values by :func:`eval`. String values could theoretically " +"contain any valid string, and in practice there are valid use cases for type " +"hints that require annotating with string values that specifically *can't* " +"be evaluated. For example:" +msgstr "" +"Однак не всі рядкові значення, які використовуються як анотації, можна " +"успішно перетворити на значення Python за допомогою :func:`eval`. Рядкові " +"значення теоретично можуть містити будь-який дійсний рядок, і на практиці є " +"дійсні випадки використання підказок типу, які вимагають анотування " +"рядковими значеннями, які конкретно *неможливо* оцінити. Наприклад:" + +msgid "" +":pep:`604` union types using ``|``, before support for this was added to " +"Python 3.10." +msgstr "" +":pep:`604` типи об’єднання з використанням ``|``, перш ніж підтримку цього " +"було додано в Python 3.10." + +msgid "" +"Definitions that aren't needed at runtime, only imported when :const:`typing." +"TYPE_CHECKING` is true." +msgstr "" +"Визначення, які не потрібні під час виконання, імпортуються лише тоді, коли :" +"const:`typing.TYPE_CHECKING` має значення true." + +msgid "" +"If :func:`eval` attempts to evaluate such values, it will fail and raise an " +"exception. So, when designing a library API that works with annotations, " +"it's recommended to only attempt to evaluate string values when explicitly " +"requested to by the caller." +msgstr "" +"Якщо :func:`eval` спробує обчислити такі значення, це зазнає невдачі та " +"викличе виняток. Таким чином, під час розробки API бібліотеки, яка працює з " +"анотаціями, рекомендується намагатися оцінити значення рядка лише тоді, коли " +"це явно вимагається від викликаючого." + +msgid "Best Practices For ``__annotations__`` In Any Python Version" +msgstr "Найкращі методи роботи з ``__annotations__`` в будь-якій версії Python" + +msgid "" +"You should avoid assigning to the ``__annotations__`` member of objects " +"directly. Let Python manage setting ``__annotations__``." +msgstr "" +"Вам слід уникати безпосереднього призначення члену ``__annotations__`` " +"об’єктів. Дозвольте Python керувати налаштуванням ``__annotations__``." + +msgid "" +"If you do assign directly to the ``__annotations__`` member of an object, " +"you should always set it to a ``dict`` object." +msgstr "" +"Якщо ви призначаєте безпосередньо члену ``__annotations__`` об’єкта, ви " +"завжди повинні встановлювати його на об’єкт ``dict``." + +msgid "" +"If you directly access the ``__annotations__`` member of an object, you " +"should ensure that it's a dictionary before attempting to examine its " +"contents." +msgstr "" +"Якщо ви здійснюєте прямий доступ до елемента ``__annotations__`` об’єкта, ви " +"повинні переконатися, що це словник, перш ніж намагатися перевірити його " +"вміст." + +msgid "You should avoid modifying ``__annotations__`` dicts." +msgstr "Слід уникати змінення ``__annotations__`` dicts." + +msgid "" +"You should avoid deleting the ``__annotations__`` attribute of an object." +msgstr "Слід уникати видалення атрибута ``__annotations__`` об’єкта." + +msgid "``__annotations__`` Quirks" +msgstr "``__annotations__`` Примхи" + +msgid "" +"In all versions of Python 3, function objects lazy-create an annotations " +"dict if no annotations are defined on that object. You can delete the " +"``__annotations__`` attribute using ``del fn.__annotations__``, but if you " +"then access ``fn.__annotations__`` the object will create a new empty dict " +"that it will store and return as its annotations. Deleting the annotations " +"on a function before it has lazily created its annotations dict will throw " +"an ``AttributeError``; using ``del fn.__annotations__`` twice in a row is " +"guaranteed to always throw an ``AttributeError``." +msgstr "" +"У всіх версіях Python 3 функціональні об’єкти відкладено створюють анотації " +"dict, якщо для цього об’єкта не визначено анотацій. Ви можете видалити " +"атрибут ``__annotations__`` за допомогою ``del fn.__annotations__``, але " +"якщо ви потім отримаєте доступ до ``fn.__annotations__``, об’єкт створить " +"новий порожній dict, який він зберігатиме та повертатиме як свої анотації. " +"Видалення анотацій у функції до того, як вона ліниво створить свої анотації " +"dict, викличе ``AttributeError``; використання ``del fn.__annotations__`` " +"двічі поспіль гарантовано завжди викидає ``AttributeError``." + +msgid "" +"Everything in the above paragraph also applies to class and module objects " +"in Python 3.10 and newer." +msgstr "" +"Усе, що наведено вище, також стосується об’єктів класу та модуля в Python " +"3.10 і новіших версіях." + +msgid "" +"In all versions of Python 3, you can set ``__annotations__`` on a function " +"object to ``None``. However, subsequently accessing the annotations on that " +"object using ``fn.__annotations__`` will lazy-create an empty dictionary as " +"per the first paragraph of this section. This is *not* true of modules and " +"classes, in any Python version; those objects permit setting " +"``__annotations__`` to any Python value, and will retain whatever value is " +"set." +msgstr "" +"У всіх версіях Python 3 для ``__annotations__`` для об’єкта функції можна " +"встановити значення ``None``. Однак подальший доступ до анотацій цього " +"об’єкта за допомогою ``fn.__annotations__`` призведе до відкладеного " +"створення порожнього словника згідно з першим параграфом цього розділу. Це " +"*не* стосується модулів і класів у будь-якій версії Python; ці об’єкти " +"дозволяють установлювати ``__annotations__`` на будь-яке значення Python і " +"збережуть будь-яке встановлене значення." + +msgid "" +"If Python stringizes your annotations for you (using ``from __future__ " +"import annotations``), and you specify a string as an annotation, the string " +"will itself be quoted. In effect the annotation is quoted *twice.* For " +"example::" +msgstr "" +"Якщо Python створить для вас рядкові анотації (за допомогою ``from " +"__future__ import annotations``), і ви вкажете рядок як анотацію, сам рядок " +"буде взято в лапки. По суті, анотація взята в лапки *двічі.* Наприклад::" + +msgid "" +"from __future__ import annotations\n" +"def foo(a: \"str\"): pass\n" +"\n" +"print(foo.__annotations__)" +msgstr "" + +msgid "" +"This prints ``{'a': \"'str'\"}``. This shouldn't really be considered a " +"\"quirk\"; it's mentioned here simply because it might be surprising." +msgstr "" +"Це друкує ``{'a': \"'str'\"}``. Це насправді не слід вважати \"химерністю\"; " +"це згадується тут просто тому, що це може бути несподіваним." diff --git a/howto/argparse-optparse.po b/howto/argparse-optparse.po new file mode 100644 index 000000000..70fd76e3d --- /dev/null +++ b/howto/argparse-optparse.po @@ -0,0 +1,146 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2024-10-11 14:19+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Migrating ``optparse`` code to ``argparse``" +msgstr "" + +msgid "" +"The :mod:`argparse` module offers several higher level features not natively " +"provided by the :mod:`optparse` module, including:" +msgstr "" + +msgid "Handling positional arguments." +msgstr "Обробка позиційних аргументів." + +msgid "Supporting subcommands." +msgstr "" + +msgid "Allowing alternative option prefixes like ``+`` and ``/``." +msgstr "Дозволяє альтернативні префікси параметрів, наприклад ``+`` і ``/``." + +msgid "Handling zero-or-more and one-or-more style arguments." +msgstr "Обробка нуля або більше та одного або кількох аргументів стилю." + +msgid "Producing more informative usage messages." +msgstr "Створення більш інформативних повідомлень про використання." + +msgid "Providing a much simpler interface for custom ``type`` and ``action``." +msgstr "" +"Забезпечення набагато простішого інтерфейсу для користувацького ``типу`` і " +"``дії``." + +msgid "" +"Originally, the :mod:`argparse` module attempted to maintain compatibility " +"with :mod:`optparse`. However, the fundamental design differences between " +"supporting declarative command line option processing (while leaving " +"positional argument processing to application code), and supporting both " +"named options and positional arguments in the declarative interface mean " +"that the API has diverged from that of ``optparse`` over time." +msgstr "" + +msgid "" +"As described in :ref:`choosing-an-argument-parser`, applications that are " +"currently using :mod:`optparse` and are happy with the way it works can just " +"continue to use ``optparse``." +msgstr "" + +msgid "" +"Application developers that are considering migrating should also review the " +"list of intrinsic behavioural differences described in that section before " +"deciding whether or not migration is desirable." +msgstr "" + +msgid "" +"For applications that do choose to migrate from :mod:`optparse` to :mod:" +"`argparse`, the following suggestions should be helpful:" +msgstr "" + +msgid "" +"Replace all :meth:`optparse.OptionParser.add_option` calls with :meth:" +"`ArgumentParser.add_argument` calls." +msgstr "" +"Замініть усі виклики :meth:`optparse.OptionParser.add_option` на виклики :" +"meth:`ArgumentParser.add_argument`." + +msgid "" +"Replace ``(options, args) = parser.parse_args()`` with ``args = parser." +"parse_args()`` and add additional :meth:`ArgumentParser.add_argument` calls " +"for the positional arguments. Keep in mind that what was previously called " +"``options``, now in the :mod:`argparse` context is called ``args``." +msgstr "" +"Замініть ``(options, args) = parser.parse_args()`` на ``args = parser." +"parse_args()`` і додайте додаткові виклики :meth:`ArgumentParser." +"add_argument` для позиційних аргументів. Майте на увазі, що те, що раніше " +"називалося ``options``, тепер у контексті :mod:`argparse` називається " +"``args``." + +msgid "" +"Replace :meth:`optparse.OptionParser.disable_interspersed_args` by using :" +"meth:`~ArgumentParser.parse_intermixed_args` instead of :meth:" +"`~ArgumentParser.parse_args`." +msgstr "" +"Замініть :meth:`optparse.OptionParser.disable_interspersed_args` на " +"використання :meth:`~ArgumentParser.parse_intermixed_args` замість :meth:" +"`~ArgumentParser.parse_args`." + +msgid "" +"Replace callback actions and the ``callback_*`` keyword arguments with " +"``type`` or ``action`` arguments." +msgstr "" +"Замініть дії зворотного виклику та аргументи ключового слова ``callback_*`` " +"на аргументи ``type`` або ``action``." + +msgid "" +"Replace string names for ``type`` keyword arguments with the corresponding " +"type objects (e.g. int, float, complex, etc)." +msgstr "" +"Замініть назви рядків для ключових аргументів ``type`` відповідними " +"об’єктами типу (наприклад, int, float, complex тощо)." + +msgid "" +"Replace :class:`optparse.Values` with :class:`Namespace` and :exc:`optparse." +"OptionError` and :exc:`optparse.OptionValueError` with :exc:`ArgumentError`." +msgstr "" +"Замініть :class:`optparse.Values` на :class:`Namespace` і :exc:`optparse." +"OptionError` і :exc:`optparse.OptionValueError` на :exc:`ArgumentError`." + +msgid "" +"Replace strings with implicit arguments such as ``%default`` or ``%prog`` " +"with the standard Python syntax to use dictionaries to format strings, that " +"is, ``%(default)s`` and ``%(prog)s``." +msgstr "" +"Замініть рядки неявними аргументами, такими як ``%default`` або ``%prog`` " +"стандартним синтаксисом Python, щоб використовувати словники для " +"форматування рядків, тобто ``%(default)s`` і ``%(prog)s``." + +msgid "" +"Replace the OptionParser constructor ``version`` argument with a call to " +"``parser.add_argument('--version', action='version', version='')``." +msgstr "" +"Замініть аргумент ``version`` конструктора OptionParser на виклик ``parser." +"add_argument('--version', action='version', version=' ')``." diff --git a/howto/argparse.po b/howto/argparse.po new file mode 100644 index 000000000..a00a74e4b --- /dev/null +++ b/howto/argparse.po @@ -0,0 +1,1178 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:52+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Argparse Tutorial" +msgstr "Підручник Argparse" + +msgid "author" +msgstr "автор" + +msgid "Tshepang Mbambo" +msgstr "" + +msgid "" +"This tutorial is intended to be a gentle introduction to :mod:`argparse`, " +"the recommended command-line parsing module in the Python standard library." +msgstr "" +"Цей підручник призначений для ознайомлення з :mod:`argparse`, рекомендованим " +"модулем аналізу командного рядка в стандартній бібліотеці Python." + +msgid "" +"The standard library includes two other libraries directly related to " +"command-line parameter processing: the lower level :mod:`optparse` module " +"(which may require more code to configure for a given application, but also " +"allows an application to request behaviors that ``argparse`` doesn't " +"support), and the very low level :mod:`getopt` (which specifically serves as " +"an equivalent to the :c:func:`!getopt` family of functions available to C " +"programmers). While neither of those modules is covered directly in this " +"guide, many of the core concepts in ``argparse`` first originated in " +"``optparse``, so some aspects of this tutorial will also be relevant to " +"``optparse`` users." +msgstr "" + +msgid "Concepts" +msgstr "Концепції" + +msgid "" +"Let's show the sort of functionality that we are going to explore in this " +"introductory tutorial by making use of the :command:`ls` command:" +msgstr "" +"Давайте покажемо тип функціональності, який ми збираємося досліджувати в " +"цьому вступному посібнику, використовуючи команду :command:`ls`:" + +msgid "" +"$ ls\n" +"cpython devguide prog.py pypy rm-unused-function.patch\n" +"$ ls pypy\n" +"ctypes_configure demo dotviewer include lib_pypy lib-python ...\n" +"$ ls -l\n" +"total 20\n" +"drwxr-xr-x 19 wena wena 4096 Feb 18 18:51 cpython\n" +"drwxr-xr-x 4 wena wena 4096 Feb 8 12:04 devguide\n" +"-rwxr-xr-x 1 wena wena 535 Feb 19 00:05 prog.py\n" +"drwxr-xr-x 14 wena wena 4096 Feb 7 00:59 pypy\n" +"-rw-r--r-- 1 wena wena 741 Feb 18 01:01 rm-unused-function.patch\n" +"$ ls --help\n" +"Usage: ls [OPTION]... [FILE]...\n" +"List information about the FILEs (the current directory by default).\n" +"Sort entries alphabetically if none of -cftuvSUX nor --sort is specified.\n" +"..." +msgstr "" + +msgid "A few concepts we can learn from the four commands:" +msgstr "Кілька понять, які ми можемо вивчити з чотирьох команд:" + +msgid "" +"The :command:`ls` command is useful when run without any options at all. It " +"defaults to displaying the contents of the current directory." +msgstr "" +"Команда :command:`ls` корисна, якщо її запускати без жодних опцій. За " +"замовчуванням відображається вміст поточного каталогу." + +msgid "" +"If we want beyond what it provides by default, we tell it a bit more. In " +"this case, we want it to display a different directory, ``pypy``. What we " +"did is specify what is known as a positional argument. It's named so because " +"the program should know what to do with the value, solely based on where it " +"appears on the command line. This concept is more relevant to a command " +"like :command:`cp`, whose most basic usage is ``cp SRC DEST``. The first " +"position is *what you want copied,* and the second position is *where you " +"want it copied to*." +msgstr "" +"Якщо ми хочемо вийти за межі того, що він надає за замовчуванням, ми " +"розповідаємо про це трохи більше. У цьому випадку ми хочемо, щоб він " +"відображав інший каталог, ``pypy``. Ми вказали так званий позиційний " +"аргумент. Це названо так, тому що програма повинна знати, що робити зі " +"значенням, виключно на основі того, де воно з’являється в командному рядку. " +"Ця концепція більш актуальна для такої команди, як :command:`cp`, основним " +"використанням якої є ``cp SRC DEST``. Перша позиція — це *те, що ви хочете " +"скопіювати*, а друга позиція — це *куди ви хочете це скопіювати*." + +msgid "" +"Now, say we want to change behaviour of the program. In our example, we " +"display more info for each file instead of just showing the file names. The " +"``-l`` in that case is known as an optional argument." +msgstr "" +"Тепер, скажімо, ми хочемо змінити поведінку програми. У нашому прикладі ми " +"показуємо більше інформації для кожного файлу, а не просто показуємо імена " +"файлів. ``-l`` у цьому випадку відомий як необов'язковий аргумент." + +msgid "" +"That's a snippet of the help text. It's very useful in that you can come " +"across a program you have never used before, and can figure out how it works " +"simply by reading its help text." +msgstr "" +"Це фрагмент довідкового тексту. Це дуже корисно, оскільки ви можете " +"натрапити на програму, якою ніколи раніше не користувалися, і зрозуміти, як " +"вона працює, просто прочитавши довідковий текст." + +msgid "The basics" +msgstr "Основи" + +msgid "Let us start with a very simple example which does (almost) nothing::" +msgstr "Почнемо з дуже простого прикладу, який (майже) нічого не робить:" + +msgid "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.parse_args()" +msgstr "" + +msgid "Following is a result of running the code:" +msgstr "Нижче наведено результат виконання коду:" + +msgid "" +"$ python prog.py\n" +"$ python prog.py --help\n" +"usage: prog.py [-h]\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +"$ python prog.py --verbose\n" +"usage: prog.py [-h]\n" +"prog.py: error: unrecognized arguments: --verbose\n" +"$ python prog.py foo\n" +"usage: prog.py [-h]\n" +"prog.py: error: unrecognized arguments: foo" +msgstr "" + +msgid "Here is what is happening:" +msgstr "Ось що відбувається:" + +msgid "" +"Running the script without any options results in nothing displayed to " +"stdout. Not so useful." +msgstr "" +"Запуск сценарію без будь-яких параметрів призводить до того, що стандартний " +"вивід нічого не відображає. Не дуже корисно." + +msgid "" +"The second one starts to display the usefulness of the :mod:`argparse` " +"module. We have done almost nothing, but already we get a nice help message." +msgstr "" +"Другий починає відображати корисність модуля :mod:`argparse`. Ми майже " +"нічого не зробили, але вже отримуємо гарне довідкове повідомлення." + +msgid "" +"The ``--help`` option, which can also be shortened to ``-h``, is the only " +"option we get for free (i.e. no need to specify it). Specifying anything " +"else results in an error. But even then, we do get a useful usage message, " +"also for free." +msgstr "" +"Опція ``--help``, яку також можна скоротити до ``-h``, є єдиною опцією, яку " +"ми отримуємо безкоштовно (тобто її не потрібно вказувати). Вказівка будь-" +"чого іншого призводить до помилки. Але навіть тоді ми отримуємо корисне " +"повідомлення про використання, також безкоштовно." + +msgid "Introducing Positional arguments" +msgstr "Представлення позиційних аргументів" + +msgid "An example::" +msgstr "Приклад::" + +msgid "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"echo\")\n" +"args = parser.parse_args()\n" +"print(args.echo)" +msgstr "" + +msgid "And running the code:" +msgstr "І запуск коду:" + +msgid "" +"$ python prog.py\n" +"usage: prog.py [-h] echo\n" +"prog.py: error: the following arguments are required: echo\n" +"$ python prog.py --help\n" +"usage: prog.py [-h] echo\n" +"\n" +"positional arguments:\n" +" echo\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +"$ python prog.py foo\n" +"foo" +msgstr "" + +msgid "Here is what's happening:" +msgstr "Ось що відбувається:" + +msgid "" +"We've added the :meth:`~ArgumentParser.add_argument` method, which is what " +"we use to specify which command-line options the program is willing to " +"accept. In this case, I've named it ``echo`` so that it's in line with its " +"function." +msgstr "" + +msgid "Calling our program now requires us to specify an option." +msgstr "Для виклику нашої програми тепер потрібно вказати опцію." + +msgid "" +"The :meth:`~ArgumentParser.parse_args` method actually returns some data " +"from the options specified, in this case, ``echo``." +msgstr "" + +msgid "" +"The variable is some form of 'magic' that :mod:`argparse` performs for free " +"(i.e. no need to specify which variable that value is stored in). You will " +"also notice that its name matches the string argument given to the method, " +"``echo``." +msgstr "" +"Змінна є певною формою \"магії\", яку :mod:`argparse` виконує безкоштовно " +"(тобто не потрібно вказувати, у якій змінній це значення зберігається). Ви " +"також помітите, що його назва відповідає рядковому аргументу, наданому " +"методу, ``echo``." + +msgid "" +"Note however that, although the help display looks nice and all, it " +"currently is not as helpful as it can be. For example we see that we got " +"``echo`` as a positional argument, but we don't know what it does, other " +"than by guessing or by reading the source code. So, let's make it a bit more " +"useful::" +msgstr "" +"Зауважте, однак, що, незважаючи на те, що екран довідки виглядає гарно і все " +"таке, наразі він не такий корисний, як міг би бути. Наприклад, ми бачимо, що " +"ми отримали ``echo`` як позиційний аргумент, але ми не знаємо, що він " +"робить, окрім здогадок або читання вихідного коду. Отже, давайте зробимо це " +"трохи кориснішим::" + +msgid "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"echo\", help=\"echo the string you use here\")\n" +"args = parser.parse_args()\n" +"print(args.echo)" +msgstr "" + +msgid "And we get:" +msgstr "І отримуємо:" + +msgid "" +"$ python prog.py -h\n" +"usage: prog.py [-h] echo\n" +"\n" +"positional arguments:\n" +" echo echo the string you use here\n" +"\n" +"options:\n" +" -h, --help show this help message and exit" +msgstr "" + +msgid "Now, how about doing something even more useful::" +msgstr "А тепер як щодо того, щоб зробити щось ще корисніше:" + +msgid "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"square\", help=\"display a square of a given " +"number\")\n" +"args = parser.parse_args()\n" +"print(args.square**2)" +msgstr "" + +msgid "" +"$ python prog.py 4\n" +"Traceback (most recent call last):\n" +" File \"prog.py\", line 5, in \n" +" print(args.square**2)\n" +"TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'" +msgstr "" + +msgid "" +"That didn't go so well. That's because :mod:`argparse` treats the options we " +"give it as strings, unless we tell it otherwise. So, let's tell :mod:" +"`argparse` to treat that input as an integer::" +msgstr "" +"Це пішло не так добре. Це тому, що :mod:`argparse` розглядає надані нами " +"параметри як рядки, якщо ми не вкажемо інше. Отже, давайте скажемо :mod:" +"`argparse` розглядати цей вхід як ціле число::" + +msgid "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"square\", help=\"display a square of a given " +"number\",\n" +" type=int)\n" +"args = parser.parse_args()\n" +"print(args.square**2)" +msgstr "" + +msgid "" +"$ python prog.py 4\n" +"16\n" +"$ python prog.py four\n" +"usage: prog.py [-h] square\n" +"prog.py: error: argument square: invalid int value: 'four'" +msgstr "" + +msgid "" +"That went well. The program now even helpfully quits on bad illegal input " +"before proceeding." +msgstr "" +"Це пройшло добре. Програма тепер навіть допомагає завершити роботу, якщо " +"неправильно введено неправильні дані, перш ніж продовжити." + +msgid "Introducing Optional arguments" +msgstr "Представляємо додаткові аргументи" + +msgid "" +"So far we have been playing with positional arguments. Let us have a look on " +"how to add optional ones::" +msgstr "" +"Досі ми гралися з позиційними аргументами. Давайте розглянемо, як додати " +"необов'язкові:" + +msgid "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"--verbosity\", help=\"increase output verbosity\")\n" +"args = parser.parse_args()\n" +"if args.verbosity:\n" +" print(\"verbosity turned on\")" +msgstr "" + +msgid "And the output:" +msgstr "І вихід:" + +msgid "" +"$ python prog.py --verbosity 1\n" +"verbosity turned on\n" +"$ python prog.py\n" +"$ python prog.py --help\n" +"usage: prog.py [-h] [--verbosity VERBOSITY]\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" --verbosity VERBOSITY\n" +" increase output verbosity\n" +"$ python prog.py --verbosity\n" +"usage: prog.py [-h] [--verbosity VERBOSITY]\n" +"prog.py: error: argument --verbosity: expected one argument" +msgstr "" + +msgid "" +"The program is written so as to display something when ``--verbosity`` is " +"specified and display nothing when not." +msgstr "" +"Програма написана таким чином, щоб щось відображати, коли вказано ``--" +"verbosity``, і нічого не відображати, якщо ні." + +msgid "" +"To show that the option is actually optional, there is no error when running " +"the program without it. Note that by default, if an optional argument isn't " +"used, the relevant variable, in this case ``args.verbosity``, is given " +"``None`` as a value, which is the reason it fails the truth test of the :" +"keyword:`if` statement." +msgstr "" + +msgid "The help message is a bit different." +msgstr "Довідкове повідомлення дещо інше." + +msgid "" +"When using the ``--verbosity`` option, one must also specify some value, any " +"value." +msgstr "" +"При використанні опції ``--verbosity`` необхідно також вказати певне " +"значення, будь-яке значення." + +msgid "" +"The above example accepts arbitrary integer values for ``--verbosity``, but " +"for our simple program, only two values are actually useful, ``True`` or " +"``False``. Let's modify the code accordingly::" +msgstr "" +"Наведений вище приклад приймає довільні цілі значення для ``--verbosity``, " +"але для нашої простої програми насправді корисними є лише два значення, " +"``True`` або ``False``. Давайте відповідно змінимо код::" + +msgid "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"--verbose\", help=\"increase output verbosity\",\n" +" action=\"store_true\")\n" +"args = parser.parse_args()\n" +"if args.verbose:\n" +" print(\"verbosity turned on\")" +msgstr "" + +msgid "" +"$ python prog.py --verbose\n" +"verbosity turned on\n" +"$ python prog.py --verbose 1\n" +"usage: prog.py [-h] [--verbose]\n" +"prog.py: error: unrecognized arguments: 1\n" +"$ python prog.py --help\n" +"usage: prog.py [-h] [--verbose]\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" --verbose increase output verbosity" +msgstr "" + +msgid "" +"The option is now more of a flag than something that requires a value. We " +"even changed the name of the option to match that idea. Note that we now " +"specify a new keyword, ``action``, and give it the value ``\"store_true\"``. " +"This means that, if the option is specified, assign the value ``True`` to " +"``args.verbose``. Not specifying it implies ``False``." +msgstr "" + +msgid "" +"It complains when you specify a value, in true spirit of what flags actually " +"are." +msgstr "" +"Він скаржиться, коли ви вказуєте значення, у справжньому дусі того, чим " +"насправді є прапори." + +msgid "Notice the different help text." +msgstr "Зверніть увагу на інший текст довідки." + +msgid "Short options" +msgstr "Короткі варіанти" + +msgid "" +"If you are familiar with command line usage, you will notice that I haven't " +"yet touched on the topic of short versions of the options. It's quite " +"simple::" +msgstr "" +"Якщо ви знайомі з використанням командного рядка, ви помітите, що я ще не " +"торкався теми коротких версій параметрів. Це досить просто::" + +msgid "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"-v\", \"--verbose\", help=\"increase output " +"verbosity\",\n" +" action=\"store_true\")\n" +"args = parser.parse_args()\n" +"if args.verbose:\n" +" print(\"verbosity turned on\")" +msgstr "" + +msgid "And here goes:" +msgstr "І ось:" + +msgid "" +"$ python prog.py -v\n" +"verbosity turned on\n" +"$ python prog.py --help\n" +"usage: prog.py [-h] [-v]\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" -v, --verbose increase output verbosity" +msgstr "" + +msgid "Note that the new ability is also reflected in the help text." +msgstr "" +"Зверніть увагу, що нова здатність також відображається в тексті довідки." + +msgid "Combining Positional and Optional arguments" +msgstr "Поєднання позиційних і необов’язкових аргументів" + +msgid "Our program keeps growing in complexity::" +msgstr "Наша програма постійно ускладнюється:" + +msgid "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"square\", type=int,\n" +" help=\"display a square of a given number\")\n" +"parser.add_argument(\"-v\", \"--verbose\", action=\"store_true\",\n" +" help=\"increase output verbosity\")\n" +"args = parser.parse_args()\n" +"answer = args.square**2\n" +"if args.verbose:\n" +" print(f\"the square of {args.square} equals {answer}\")\n" +"else:\n" +" print(answer)" +msgstr "" + +msgid "And now the output:" +msgstr "А тепер вихід:" + +msgid "" +"$ python prog.py\n" +"usage: prog.py [-h] [-v] square\n" +"prog.py: error: the following arguments are required: square\n" +"$ python prog.py 4\n" +"16\n" +"$ python prog.py 4 --verbose\n" +"the square of 4 equals 16\n" +"$ python prog.py --verbose 4\n" +"the square of 4 equals 16" +msgstr "" + +msgid "We've brought back a positional argument, hence the complaint." +msgstr "Ми повернули позиційний аргумент, тому скарга." + +msgid "Note that the order does not matter." +msgstr "Зауважте, що порядок не має значення." + +msgid "" +"How about we give this program of ours back the ability to have multiple " +"verbosity values, and actually get to use them::" +msgstr "" +"Як щодо того, щоб ми повернули цій нашій програмі можливість мати кілька " +"значень докладності та фактично отримати їх використання:" + +msgid "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"square\", type=int,\n" +" help=\"display a square of a given number\")\n" +"parser.add_argument(\"-v\", \"--verbosity\", type=int,\n" +" help=\"increase output verbosity\")\n" +"args = parser.parse_args()\n" +"answer = args.square**2\n" +"if args.verbosity == 2:\n" +" print(f\"the square of {args.square} equals {answer}\")\n" +"elif args.verbosity == 1:\n" +" print(f\"{args.square}^2 == {answer}\")\n" +"else:\n" +" print(answer)" +msgstr "" + +msgid "" +"$ python prog.py 4\n" +"16\n" +"$ python prog.py 4 -v\n" +"usage: prog.py [-h] [-v VERBOSITY] square\n" +"prog.py: error: argument -v/--verbosity: expected one argument\n" +"$ python prog.py 4 -v 1\n" +"4^2 == 16\n" +"$ python prog.py 4 -v 2\n" +"the square of 4 equals 16\n" +"$ python prog.py 4 -v 3\n" +"16" +msgstr "" + +msgid "" +"These all look good except the last one, which exposes a bug in our program. " +"Let's fix it by restricting the values the ``--verbosity`` option can " +"accept::" +msgstr "" +"Усі вони виглядають добре, крім останнього, який виявляє помилку в нашій " +"програмі. Давайте виправимо це, обмеживши значення, які може приймати " +"параметр ``--verbosity``:" + +msgid "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"square\", type=int,\n" +" help=\"display a square of a given number\")\n" +"parser.add_argument(\"-v\", \"--verbosity\", type=int, choices=[0, 1, 2],\n" +" help=\"increase output verbosity\")\n" +"args = parser.parse_args()\n" +"answer = args.square**2\n" +"if args.verbosity == 2:\n" +" print(f\"the square of {args.square} equals {answer}\")\n" +"elif args.verbosity == 1:\n" +" print(f\"{args.square}^2 == {answer}\")\n" +"else:\n" +" print(answer)" +msgstr "" + +msgid "" +"$ python prog.py 4 -v 3\n" +"usage: prog.py [-h] [-v {0,1,2}] square\n" +"prog.py: error: argument -v/--verbosity: invalid choice: 3 (choose from 0, " +"1, 2)\n" +"$ python prog.py 4 -h\n" +"usage: prog.py [-h] [-v {0,1,2}] square\n" +"\n" +"positional arguments:\n" +" square display a square of a given number\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" -v, --verbosity {0,1,2}\n" +" increase output verbosity" +msgstr "" + +msgid "" +"Note that the change also reflects both in the error message as well as the " +"help string." +msgstr "" +"Зауважте, що зміна також відображається як у повідомленні про помилку, так і " +"в рядку довідки." + +msgid "" +"Now, let's use a different approach of playing with verbosity, which is " +"pretty common. It also matches the way the CPython executable handles its " +"own verbosity argument (check the output of ``python --help``)::" +msgstr "" +"Тепер давайте використаємо інший підхід гри з багатослівністю, який є досить " +"поширеним. Це також відповідає тому, як виконуваний файл CPython обробляє " +"власний аргумент багатослівності (перевірте вихід ``python --help``)::" + +msgid "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"square\", type=int,\n" +" help=\"display the square of a given number\")\n" +"parser.add_argument(\"-v\", \"--verbosity\", action=\"count\",\n" +" help=\"increase output verbosity\")\n" +"args = parser.parse_args()\n" +"answer = args.square**2\n" +"if args.verbosity == 2:\n" +" print(f\"the square of {args.square} equals {answer}\")\n" +"elif args.verbosity == 1:\n" +" print(f\"{args.square}^2 == {answer}\")\n" +"else:\n" +" print(answer)" +msgstr "" + +msgid "" +"We have introduced another action, \"count\", to count the number of " +"occurrences of specific options." +msgstr "" +"Ми запровадили ще одну дію, \"підрахунок\", щоб підрахувати кількість " +"повторень певних параметрів." + +msgid "" +"$ python prog.py 4\n" +"16\n" +"$ python prog.py 4 -v\n" +"4^2 == 16\n" +"$ python prog.py 4 -vv\n" +"the square of 4 equals 16\n" +"$ python prog.py 4 --verbosity --verbosity\n" +"the square of 4 equals 16\n" +"$ python prog.py 4 -v 1\n" +"usage: prog.py [-h] [-v] square\n" +"prog.py: error: unrecognized arguments: 1\n" +"$ python prog.py 4 -h\n" +"usage: prog.py [-h] [-v] square\n" +"\n" +"positional arguments:\n" +" square display a square of a given number\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" -v, --verbosity increase output verbosity\n" +"$ python prog.py 4 -vvv\n" +"16" +msgstr "" + +msgid "" +"Yes, it's now more of a flag (similar to ``action=\"store_true\"``) in the " +"previous version of our script. That should explain the complaint." +msgstr "" +"Так, тепер це більше позначка (схожа на ``action=\"store_true\"``) у " +"попередній версії нашого сценарію. Це має пояснити скаргу." + +msgid "It also behaves similar to \"store_true\" action." +msgstr "Він також поводиться подібно до дії \"store_true\"." + +msgid "" +"Now here's a demonstration of what the \"count\" action gives. You've " +"probably seen this sort of usage before." +msgstr "" +"Тепер ось демонстрація того, що дає дія \"підрахунок\". Ви, напевно, бачили " +"таке використання раніше." + +msgid "" +"And if you don't specify the ``-v`` flag, that flag is considered to have " +"``None`` value." +msgstr "" +"І якщо ви не вкажете прапорець ``-v``, цей прапорець вважатиметься таким, що " +"має значення ``None``." + +msgid "" +"As should be expected, specifying the long form of the flag, we should get " +"the same output." +msgstr "" +"Як і слід було очікувати, вказавши довгу форму прапора, ми повинні отримати " +"той самий результат." + +msgid "" +"Sadly, our help output isn't very informative on the new ability our script " +"has acquired, but that can always be fixed by improving the documentation " +"for our script (e.g. via the ``help`` keyword argument)." +msgstr "" +"На жаль, результати нашої довідки не надто інформативні щодо нових " +"можливостей, які отримав наш сценарій, але це завжди можна виправити, " +"покращивши документацію для нашого сценарію (наприклад, за допомогою " +"аргументу ключового слова ``help``)." + +msgid "That last output exposes a bug in our program." +msgstr "Цей останній вихід виявляє помилку в нашій програмі." + +msgid "Let's fix::" +msgstr "Виправимо::" + +msgid "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"square\", type=int,\n" +" help=\"display a square of a given number\")\n" +"parser.add_argument(\"-v\", \"--verbosity\", action=\"count\",\n" +" help=\"increase output verbosity\")\n" +"args = parser.parse_args()\n" +"answer = args.square**2\n" +"\n" +"# bugfix: replace == with >=\n" +"if args.verbosity >= 2:\n" +" print(f\"the square of {args.square} equals {answer}\")\n" +"elif args.verbosity >= 1:\n" +" print(f\"{args.square}^2 == {answer}\")\n" +"else:\n" +" print(answer)" +msgstr "" + +msgid "And this is what it gives:" +msgstr "І ось що це дає:" + +msgid "" +"$ python prog.py 4 -vvv\n" +"the square of 4 equals 16\n" +"$ python prog.py 4 -vvvv\n" +"the square of 4 equals 16\n" +"$ python prog.py 4\n" +"Traceback (most recent call last):\n" +" File \"prog.py\", line 11, in \n" +" if args.verbosity >= 2:\n" +"TypeError: '>=' not supported between instances of 'NoneType' and 'int'" +msgstr "" + +msgid "" +"First output went well, and fixes the bug we had before. That is, we want " +"any value >= 2 to be as verbose as possible." +msgstr "" +"Перший вихід пройшов добре та виправляє помилку, яку ми мали раніше. Тобто " +"ми хочемо, щоб будь-яке значення >= 2 було якомога детальнішим." + +msgid "Third output not so good." +msgstr "Третій вихід не дуже хороший." + +msgid "Let's fix that bug::" +msgstr "Давайте виправимо цю помилку::" + +msgid "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"square\", type=int,\n" +" help=\"display a square of a given number\")\n" +"parser.add_argument(\"-v\", \"--verbosity\", action=\"count\", default=0,\n" +" help=\"increase output verbosity\")\n" +"args = parser.parse_args()\n" +"answer = args.square**2\n" +"if args.verbosity >= 2:\n" +" print(f\"the square of {args.square} equals {answer}\")\n" +"elif args.verbosity >= 1:\n" +" print(f\"{args.square}^2 == {answer}\")\n" +"else:\n" +" print(answer)" +msgstr "" + +msgid "" +"We've just introduced yet another keyword, ``default``. We've set it to " +"``0`` in order to make it comparable to the other int values. Remember that " +"by default, if an optional argument isn't specified, it gets the ``None`` " +"value, and that cannot be compared to an int value (hence the :exc:" +"`TypeError` exception)." +msgstr "" +"Ми щойно представили ще одне ключове слово, ``default``. Ми встановили для " +"нього значення ``0``, щоб зробити його порівнянним з іншими значеннями int. " +"Пам’ятайте, що за замовчуванням, якщо необов’язковий аргумент не вказано, " +"він отримує значення ``None``, яке не можна порівняти зі значенням int " +"(отже, виняток :exc:`TypeError`)." + +msgid "And:" +msgstr "і:" + +msgid "" +"$ python prog.py 4\n" +"16" +msgstr "" + +msgid "" +"You can go quite far just with what we've learned so far, and we have only " +"scratched the surface. The :mod:`argparse` module is very powerful, and " +"we'll explore a bit more of it before we end this tutorial." +msgstr "" +"Ви можете зайти досить далеко лише з тим, що ми навчилися досі, і ми лише " +"подряпали поверхню. Модуль :mod:`argparse` дуже потужний, і ми вивчимо його " +"трохи більше, перш ніж закінчити цей підручник." + +msgid "Getting a little more advanced" +msgstr "Ставши трохи більш просунутим" + +msgid "" +"What if we wanted to expand our tiny program to perform other powers, not " +"just squares::" +msgstr "" +"Що, якби ми захотіли розширити нашу крихітну програму для виконання інших " +"ступенів, а не лише квадратів:" + +msgid "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"x\", type=int, help=\"the base\")\n" +"parser.add_argument(\"y\", type=int, help=\"the exponent\")\n" +"parser.add_argument(\"-v\", \"--verbosity\", action=\"count\", default=0)\n" +"args = parser.parse_args()\n" +"answer = args.x**args.y\n" +"if args.verbosity >= 2:\n" +" print(f\"{args.x} to the power {args.y} equals {answer}\")\n" +"elif args.verbosity >= 1:\n" +" print(f\"{args.x}^{args.y} == {answer}\")\n" +"else:\n" +" print(answer)" +msgstr "" + +msgid "Output:" +msgstr "Вихід:" + +msgid "" +"$ python prog.py\n" +"usage: prog.py [-h] [-v] x y\n" +"prog.py: error: the following arguments are required: x, y\n" +"$ python prog.py -h\n" +"usage: prog.py [-h] [-v] x y\n" +"\n" +"positional arguments:\n" +" x the base\n" +" y the exponent\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" -v, --verbosity\n" +"$ python prog.py 4 2 -v\n" +"4^2 == 16" +msgstr "" + +msgid "" +"Notice that so far we've been using verbosity level to *change* the text " +"that gets displayed. The following example instead uses verbosity level to " +"display *more* text instead::" +msgstr "" +"Зверніть увагу, що досі ми використовували рівень докладності, щоб *змінити* " +"текст, який відображається. Натомість у наступному прикладі використовується " +"рівень детальності для відображення *більше* тексту::" + +msgid "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"x\", type=int, help=\"the base\")\n" +"parser.add_argument(\"y\", type=int, help=\"the exponent\")\n" +"parser.add_argument(\"-v\", \"--verbosity\", action=\"count\", default=0)\n" +"args = parser.parse_args()\n" +"answer = args.x**args.y\n" +"if args.verbosity >= 2:\n" +" print(f\"Running '{__file__}'\")\n" +"if args.verbosity >= 1:\n" +" print(f\"{args.x}^{args.y} == \", end=\"\")\n" +"print(answer)" +msgstr "" + +msgid "" +"$ python prog.py 4 2\n" +"16\n" +"$ python prog.py 4 2 -v\n" +"4^2 == 16\n" +"$ python prog.py 4 2 -vv\n" +"Running 'prog.py'\n" +"4^2 == 16" +msgstr "" + +msgid "Specifying ambiguous arguments" +msgstr "" + +msgid "" +"When there is ambiguity in deciding whether an argument is positional or for " +"an argument, ``--`` can be used to tell :meth:`~ArgumentParser.parse_args` " +"that everything after that is a positional argument::" +msgstr "" + +msgid "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('-n', nargs='+')\n" +">>> parser.add_argument('args', nargs='*')\n" +"\n" +">>> # ambiguous, so parse_args assumes it's an option\n" +">>> parser.parse_args(['-f'])\n" +"usage: PROG [-h] [-n N [N ...]] [args ...]\n" +"PROG: error: unrecognized arguments: -f\n" +"\n" +">>> parser.parse_args(['--', '-f'])\n" +"Namespace(args=['-f'], n=None)\n" +"\n" +">>> # ambiguous, so the -n option greedily accepts arguments\n" +">>> parser.parse_args(['-n', '1', '2', '3'])\n" +"Namespace(args=[], n=['1', '2', '3'])\n" +"\n" +">>> parser.parse_args(['-n', '1', '--', '2', '3'])\n" +"Namespace(args=['2', '3'], n=['1'])" +msgstr "" + +msgid "Conflicting options" +msgstr "Конфліктні варіанти" + +msgid "" +"So far, we have been working with two methods of an :class:`argparse." +"ArgumentParser` instance. Let's introduce a third one, :meth:" +"`~ArgumentParser.add_mutually_exclusive_group`. It allows for us to specify " +"options that conflict with each other. Let's also change the rest of the " +"program so that the new functionality makes more sense: we'll introduce the " +"``--quiet`` option, which will be the opposite of the ``--verbose`` one::" +msgstr "" + +msgid "" +"import argparse\n" +"\n" +"parser = argparse.ArgumentParser()\n" +"group = parser.add_mutually_exclusive_group()\n" +"group.add_argument(\"-v\", \"--verbose\", action=\"store_true\")\n" +"group.add_argument(\"-q\", \"--quiet\", action=\"store_true\")\n" +"parser.add_argument(\"x\", type=int, help=\"the base\")\n" +"parser.add_argument(\"y\", type=int, help=\"the exponent\")\n" +"args = parser.parse_args()\n" +"answer = args.x**args.y\n" +"\n" +"if args.quiet:\n" +" print(answer)\n" +"elif args.verbose:\n" +" print(f\"{args.x} to the power {args.y} equals {answer}\")\n" +"else:\n" +" print(f\"{args.x}^{args.y} == {answer}\")" +msgstr "" + +msgid "" +"Our program is now simpler, and we've lost some functionality for the sake " +"of demonstration. Anyways, here's the output:" +msgstr "" +"Наша програма стала простішою, і ми втратили деякі функції заради " +"демонстрації. У будь-якому випадку, ось результат:" + +msgid "" +"$ python prog.py 4 2\n" +"4^2 == 16\n" +"$ python prog.py 4 2 -q\n" +"16\n" +"$ python prog.py 4 2 -v\n" +"4 to the power 2 equals 16\n" +"$ python prog.py 4 2 -vq\n" +"usage: prog.py [-h] [-v | -q] x y\n" +"prog.py: error: argument -q/--quiet: not allowed with argument -v/--verbose\n" +"$ python prog.py 4 2 -v --quiet\n" +"usage: prog.py [-h] [-v | -q] x y\n" +"prog.py: error: argument -q/--quiet: not allowed with argument -v/--verbose" +msgstr "" + +msgid "" +"That should be easy to follow. I've added that last output so you can see " +"the sort of flexibility you get, i.e. mixing long form options with short " +"form ones." +msgstr "" +"Це повинно бути легко слідкувати. Я додав цей останній вихід, щоб ви могли " +"бачити, яку гнучкість ви отримуєте, тобто змішування параметрів довгої форми " +"з опціями короткої." + +msgid "" +"Before we conclude, you probably want to tell your users the main purpose of " +"your program, just in case they don't know::" +msgstr "" +"Перш ніж завершити, ви, ймовірно, захочете повідомити своїм користувачам " +"головну мету вашої програми, на випадок, якщо вони не знають:" + +msgid "" +"import argparse\n" +"\n" +"parser = argparse.ArgumentParser(description=\"calculate X to the power of " +"Y\")\n" +"group = parser.add_mutually_exclusive_group()\n" +"group.add_argument(\"-v\", \"--verbose\", action=\"store_true\")\n" +"group.add_argument(\"-q\", \"--quiet\", action=\"store_true\")\n" +"parser.add_argument(\"x\", type=int, help=\"the base\")\n" +"parser.add_argument(\"y\", type=int, help=\"the exponent\")\n" +"args = parser.parse_args()\n" +"answer = args.x**args.y\n" +"\n" +"if args.quiet:\n" +" print(answer)\n" +"elif args.verbose:\n" +" print(f\"{args.x} to the power {args.y} equals {answer}\")\n" +"else:\n" +" print(f\"{args.x}^{args.y} == {answer}\")" +msgstr "" + +msgid "" +"Note that slight difference in the usage text. Note the ``[-v | -q]``, which " +"tells us that we can either use ``-v`` or ``-q``, but not both at the same " +"time:" +msgstr "" +"Зверніть увагу на невелику різницю в тексті використання. Зверніть увагу на " +"``[-v | -q]``, який говорить нам, що ми можемо використовувати ``-v`` або ``-" +"q``, але не обидва одночасно:" + +msgid "" +"$ python prog.py --help\n" +"usage: prog.py [-h] [-v | -q] x y\n" +"\n" +"calculate X to the power of Y\n" +"\n" +"positional arguments:\n" +" x the base\n" +" y the exponent\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" -v, --verbose\n" +" -q, --quiet" +msgstr "" + +msgid "How to translate the argparse output" +msgstr "" + +msgid "" +"The output of the :mod:`argparse` module such as its help text and error " +"messages are all made translatable using the :mod:`gettext` module. This " +"allows applications to easily localize messages produced by :mod:`argparse`. " +"See also :ref:`i18n-howto`." +msgstr "" + +msgid "For instance, in this :mod:`argparse` output:" +msgstr "" + +msgid "" +"The strings ``usage:``, ``positional arguments:``, ``options:`` and ``show " +"this help message and exit`` are all translatable." +msgstr "" + +msgid "" +"In order to translate these strings, they must first be extracted into a ``." +"po`` file. For example, using `Babel `__, run this " +"command:" +msgstr "" + +msgid "$ pybabel extract -o messages.po /usr/lib/python3.12/argparse.py" +msgstr "" + +msgid "" +"This command will extract all translatable strings from the :mod:`argparse` " +"module and output them into a file named ``messages.po``. This command " +"assumes that your Python installation is in ``/usr/lib``." +msgstr "" + +msgid "" +"You can find out the location of the :mod:`argparse` module on your system " +"using this script::" +msgstr "" + +msgid "" +"import argparse\n" +"print(argparse.__file__)" +msgstr "" + +msgid "" +"Once the messages in the ``.po`` file are translated and the translations " +"are installed using :mod:`gettext`, :mod:`argparse` will be able to display " +"the translated messages." +msgstr "" + +msgid "" +"To translate your own strings in the :mod:`argparse` output, use :mod:" +"`gettext`." +msgstr "" + +msgid "Custom type converters" +msgstr "" + +msgid "" +"The :mod:`argparse` module allows you to specify custom type converters for " +"your command-line arguments. This allows you to modify user input before " +"it's stored in the :class:`argparse.Namespace`. This can be useful when you " +"need to pre-process the input before it is used in your program." +msgstr "" + +msgid "" +"When using a custom type converter, you can use any callable that takes a " +"single string argument (the argument value) and returns the converted value. " +"However, if you need to handle more complex scenarios, you can use a custom " +"action class with the **action** parameter instead." +msgstr "" + +msgid "" +"For example, let's say you want to handle arguments with different prefixes " +"and process them accordingly::" +msgstr "" + +msgid "" +"import argparse\n" +"\n" +"parser = argparse.ArgumentParser(prefix_chars='-+')\n" +"\n" +"parser.add_argument('-a', metavar='', action='append',\n" +" type=lambda x: ('-', x))\n" +"parser.add_argument('+a', metavar='', action='append',\n" +" type=lambda x: ('+', x))\n" +"\n" +"args = parser.parse_args()\n" +"print(args)" +msgstr "" + +msgid "" +"$ python prog.py -a value1 +a value2\n" +"Namespace(a=[('-', 'value1'), ('+', 'value2')])" +msgstr "" + +msgid "In this example, we:" +msgstr "" + +msgid "" +"Created a parser with custom prefix characters using the ``prefix_chars`` " +"parameter." +msgstr "" + +msgid "" +"Defined two arguments, ``-a`` and ``+a``, which used the ``type`` parameter " +"to create custom type converters to store the value in a tuple with the " +"prefix." +msgstr "" + +msgid "" +"Without the custom type converters, the arguments would have treated the ``-" +"a`` and ``+a`` as the same argument, which would have been undesirable. By " +"using custom type converters, we were able to differentiate between the two " +"arguments." +msgstr "" + +msgid "Conclusion" +msgstr "Висновок" + +msgid "" +"The :mod:`argparse` module offers a lot more than shown here. Its docs are " +"quite detailed and thorough, and full of examples. Having gone through this " +"tutorial, you should easily digest them without feeling overwhelmed." +msgstr "" +"Модуль :mod:`argparse` пропонує набагато більше, ніж показано тут. Його " +"документи досить докладні та ретельні та повні прикладів. Пройшовши цей " +"підручник, ви повинні легко засвоїти їх, не відчуваючи себе приголомшеними." diff --git a/howto/clinic.po b/howto/clinic.po new file mode 100644 index 000000000..477d188f5 --- /dev/null +++ b/howto/clinic.po @@ -0,0 +1,38 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2024 +# Yuliia Shevchenko, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:52+0000\n" +"Last-Translator: Yuliia Shevchenko, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Argument Clinic How-To" +msgstr "Інструкції клініки аргументів" + +msgid "" +"The Argument Clinic How-TO has been moved to the `Python Developer's Guide " +"`__." +msgstr "" +"Посібник з використання Argument Clinic був переміщений до `Посібника для " +"розробників Python``__." diff --git a/howto/cporting.po b/howto/cporting.po new file mode 100644 index 000000000..53b45b1c8 --- /dev/null +++ b/howto/cporting.po @@ -0,0 +1,62 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:52+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Porting Extension Modules to Python 3" +msgstr "Перенесення модулів розширення на Python 3" + +msgid "" +"We recommend the following resources for porting extension modules to Python " +"3:" +msgstr "" +"Ми рекомендуємо такі ресурси для перенесення модулів розширення на Python 3:" + +msgid "" +"The `Migrating C extensions`_ chapter from *Supporting Python 3: An in-depth " +"guide*, a book on moving from Python 2 to Python 3 in general, guides the " +"reader through porting an extension module." +msgstr "" +"У розділі `Migrating C extensions`_ із книги \"Підтримка Python 3: докладний " +"посібник*, книги про перехід від Python 2 до Python 3 загалом, читач " +"ознайомиться з перенесенням модуля розширення." + +msgid "" +"The `Porting guide`_ from the *py3c* project provides opinionated " +"suggestions with supporting code." +msgstr "" +"`Porting guide`_ з проекту *py3c* містить упевнені пропозиції з допоміжним " +"кодом." + +msgid "" +"The `Cython`_ and `CFFI`_ libraries offer abstractions over Python's C API. " +"Extensions generally need to be re-written to use one of them, but the " +"library then handles differences between various Python versions and " +"implementations." +msgstr "" +"Бібліотеки `Cython`_ і `CFFI`_ пропонують абстракції над C API Python. " +"Розширення зазвичай потрібно переписати, щоб використовувати одне з них, але " +"тоді бібліотека обробляє відмінності між різними версіями та реалізаціями " +"Python." diff --git a/howto/curses.po b/howto/curses.po new file mode 100644 index 000000000..2ffb1a665 --- /dev/null +++ b/howto/curses.po @@ -0,0 +1,960 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:53+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Curses Programming with Python" +msgstr "Програмування Curses на Python" + +msgid "Author" +msgstr "Автор" + +msgid "A.M. Kuchling, Eric S. Raymond" +msgstr "A.M. Kuchling, Eric S. Raymond" + +msgid "Release" +msgstr "Реліз" + +msgid "2.04" +msgstr "2.04" + +msgid "Abstract" +msgstr "Анотація" + +msgid "" +"This document describes how to use the :mod:`curses` extension module to " +"control text-mode displays." +msgstr "" +"У цьому документі описано, як використовувати модуль розширення :mod:" +"`curses` для керування відображеннями в текстовому режимі." + +msgid "What is curses?" +msgstr "Що таке прокляття?" + +msgid "" +"The curses library supplies a terminal-independent screen-painting and " +"keyboard-handling facility for text-based terminals; such terminals include " +"VT100s, the Linux console, and the simulated terminal provided by various " +"programs. Display terminals support various control codes to perform common " +"operations such as moving the cursor, scrolling the screen, and erasing " +"areas. Different terminals use widely differing codes, and often have their " +"own minor quirks." +msgstr "" +"Бібліотека curses надає незалежне від терміналу засіб малювання екрану та " +"керування клавіатурою для текстових терміналів; такі термінали включають " +"VT100s, консоль Linux і імітований термінал, що надається різними " +"програмами. Дисплейні термінали підтримують різні керуючі коди для виконання " +"типових операцій, таких як переміщення курсору, прокручування екрана та " +"стирання областей. Різні термінали використовують дуже різні коди та часто " +"мають власні незначні особливості." + +msgid "" +"In a world of graphical displays, one might ask \"why bother\"? It's true " +"that character-cell display terminals are an obsolete technology, but there " +"are niches in which being able to do fancy things with them are still " +"valuable. One niche is on small-footprint or embedded Unixes that don't run " +"an X server. Another is tools such as OS installers and kernel " +"configurators that may have to run before any graphical support is available." +msgstr "" +"У світі графічних дисплеїв хтось може запитати \"навіщо турбуватися\"? Це " +"правда, що дисплеї з символьними комірками є застарілою технологією, але є " +"ніші, в яких можливість робити з ними фантастичні речі все ще цінна. Одна " +"ніша займає малогабаритні або вбудовані системи Unix, на яких не працює X-" +"сервер. Інші інструменти, такі як інсталятори ОС і конфігуратори ядра, які, " +"можливо, доведеться запустити, перш ніж буде доступна будь-яка графічна " +"підтримка." + +msgid "" +"The curses library provides fairly basic functionality, providing the " +"programmer with an abstraction of a display containing multiple non-" +"overlapping windows of text. The contents of a window can be changed in " +"various ways---adding text, erasing it, changing its appearance---and the " +"curses library will figure out what control codes need to be sent to the " +"terminal to produce the right output. curses doesn't provide many user-" +"interface concepts such as buttons, checkboxes, or dialogs; if you need such " +"features, consider a user interface library such as :pypi:`Urwid`." +msgstr "" + +msgid "" +"The curses library was originally written for BSD Unix; the later System V " +"versions of Unix from AT&T added many enhancements and new functions. BSD " +"curses is no longer maintained, having been replaced by ncurses, which is an " +"open-source implementation of the AT&T interface. If you're using an open-" +"source Unix such as Linux or FreeBSD, your system almost certainly uses " +"ncurses. Since most current commercial Unix versions are based on System V " +"code, all the functions described here will probably be available. The " +"older versions of curses carried by some proprietary Unixes may not support " +"everything, though." +msgstr "" +"Бібліотека curses спочатку була написана для BSD Unix; пізніші версії System " +"V Unix від AT&T додали багато вдосконалень і нових функцій. BSD curses " +"більше не підтримується, їх замінив ncurses, який є реалізацією інтерфейсу " +"AT&T з відкритим кодом. Якщо ви використовуєте Unix з відкритим кодом, " +"наприклад Linux або FreeBSD, ваша система майже напевно використовує " +"ncurses. Оскільки більшість сучасних комерційних версій Unix базується на " +"коді System V, усі описані тут функції, ймовірно, будуть доступні. Однак " +"старіші версії curses, які містяться в деяких пропрієтарних системах Unix, " +"можуть не підтримувати все." + +msgid "" +"The Windows version of Python doesn't include the :mod:`curses` module. A " +"ported version called :pypi:`UniCurses` is available." +msgstr "" + +msgid "The Python curses module" +msgstr "Модуль проклинань Python" + +msgid "" +"The Python module is a fairly simple wrapper over the C functions provided " +"by curses; if you're already familiar with curses programming in C, it's " +"really easy to transfer that knowledge to Python. The biggest difference is " +"that the Python interface makes things simpler by merging different C " +"functions such as :c:func:`!addstr`, :c:func:`!mvaddstr`, and :c:func:`!" +"mvwaddstr` into a single :meth:`~curses.window.addstr` method. You'll see " +"this covered in more detail later." +msgstr "" + +msgid "" +"This HOWTO is an introduction to writing text-mode programs with curses and " +"Python. It doesn't attempt to be a complete guide to the curses API; for " +"that, see the Python library guide's section on ncurses, and the C manual " +"pages for ncurses. It will, however, give you the basic ideas." +msgstr "" +"Цей HOWTO є вступом до написання програм у текстовому режимі за допомогою " +"curses і Python. Він не намагається бути повним посібником з curses API; для " +"цього дивіться розділ посібника з бібліотеки Python про ncurses і сторінки " +"посібника C для ncurses. Однак це дасть вам основні ідеї." + +msgid "Starting and ending a curses application" +msgstr "Запуск і завершення програми curses" + +msgid "" +"Before doing anything, curses must be initialized. This is done by calling " +"the :func:`~curses.initscr` function, which will determine the terminal " +"type, send any required setup codes to the terminal, and create various " +"internal data structures. If successful, :func:`!initscr` returns a window " +"object representing the entire screen; this is usually called ``stdscr`` " +"after the name of the corresponding C variable. ::" +msgstr "" + +msgid "" +"import curses\n" +"stdscr = curses.initscr()" +msgstr "" + +msgid "" +"Usually curses applications turn off automatic echoing of keys to the " +"screen, in order to be able to read keys and only display them under certain " +"circumstances. This requires calling the :func:`~curses.noecho` function. ::" +msgstr "" +"Зазвичай програми curses вимикають автоматичне відлуння клавіш на екрані, " +"щоб мати можливість читати клавіші та відображати їх лише за певних " +"обставин. Для цього потрібно викликати функцію :func:`~curses.noecho`. ::" + +msgid "curses.noecho()" +msgstr "" + +msgid "" +"Applications will also commonly need to react to keys instantly, without " +"requiring the Enter key to be pressed; this is called cbreak mode, as " +"opposed to the usual buffered input mode. ::" +msgstr "" +"Додаткам також зазвичай потрібно миттєво реагувати на натискання клавіш, не " +"вимагаючи натискання клавіші Enter; це називається режимом cbreak, на " +"відміну від звичайного режиму буферизованого введення. ::" + +msgid "curses.cbreak()" +msgstr "" + +msgid "" +"Terminals usually return special keys, such as the cursor keys or navigation " +"keys such as Page Up and Home, as a multibyte escape sequence. While you " +"could write your application to expect such sequences and process them " +"accordingly, curses can do it for you, returning a special value such as :" +"const:`curses.KEY_LEFT`. To get curses to do the job, you'll have to enable " +"keypad mode. ::" +msgstr "" +"Термінали зазвичай повертають спеціальні клавіші, такі як клавіші керування " +"курсором або навігаційні клавіші, такі як Page Up і Home, як багатобайтову " +"escape-послідовність. Хоча ви можете написати свою програму так, щоб " +"очікувати такі послідовності та обробляти їх відповідно, curses може зробити " +"це за вас, повертаючи спеціальне значення, наприклад :const:`curses." +"KEY_LEFT`. Щоб змусити прокляття виконувати роботу, вам потрібно буде " +"ввімкнути режим клавіатури. ::" + +msgid "stdscr.keypad(True)" +msgstr "" + +msgid "" +"Terminating a curses application is much easier than starting one. You'll " +"need to call::" +msgstr "" +"Завершити роботу програми curses набагато легше, ніж розпочати її. Вам " +"потрібно зателефонувати::" + +msgid "" +"curses.nocbreak()\n" +"stdscr.keypad(False)\n" +"curses.echo()" +msgstr "" + +msgid "" +"to reverse the curses-friendly terminal settings. Then call the :func:" +"`~curses.endwin` function to restore the terminal to its original operating " +"mode. ::" +msgstr "" +"щоб змінити налаштування терміналу, зручні для curses. Потім викличте " +"функцію :func:`~curses.endwin`, щоб відновити термінал до вихідного режиму " +"роботи. ::" + +msgid "curses.endwin()" +msgstr "" + +msgid "" +"A common problem when debugging a curses application is to get your terminal " +"messed up when the application dies without restoring the terminal to its " +"previous state. In Python this commonly happens when your code is buggy and " +"raises an uncaught exception. Keys are no longer echoed to the screen when " +"you type them, for example, which makes using the shell difficult." +msgstr "" +"Поширеною проблемою під час налагодження програми curses є псування " +"терміналу, коли програма вимикається без відновлення попереднього стану " +"терміналу. У Python це зазвичай трапляється, коли ваш код має помилки та " +"викликає неперехоплений виняток. Наприклад, клавіші більше не відтворюються " +"на екрані, коли ви їх вводите, що ускладнює використання оболонки." + +msgid "" +"In Python you can avoid these complications and make debugging much easier " +"by importing the :func:`curses.wrapper` function and using it like this::" +msgstr "" +"У Python ви можете уникнути цих ускладнень і значно полегшити налагодження, " +"імпортувавши функцію :func:`curses.wrapper` і використовуючи її таким чином::" + +msgid "" +"from curses import wrapper\n" +"\n" +"def main(stdscr):\n" +" # Clear screen\n" +" stdscr.clear()\n" +"\n" +" # This raises ZeroDivisionError when i == 10.\n" +" for i in range(0, 11):\n" +" v = i-10\n" +" stdscr.addstr(i, 0, '10 divided by {} is {}'.format(v, 10/v))\n" +"\n" +" stdscr.refresh()\n" +" stdscr.getkey()\n" +"\n" +"wrapper(main)" +msgstr "" + +msgid "" +"The :func:`~curses.wrapper` function takes a callable object and does the " +"initializations described above, also initializing colors if color support " +"is present. :func:`!wrapper` then runs your provided callable. Once the " +"callable returns, :func:`!wrapper` will restore the original state of the " +"terminal. The callable is called inside a :keyword:`try`...\\ :keyword:" +"`except` that catches exceptions, restores the state of the terminal, and " +"then re-raises the exception. Therefore your terminal won't be left in a " +"funny state on exception and you'll be able to read the exception's message " +"and traceback." +msgstr "" + +msgid "Windows and Pads" +msgstr "Вікна та колодки" + +msgid "" +"Windows are the basic abstraction in curses. A window object represents a " +"rectangular area of the screen, and supports methods to display text, erase " +"it, allow the user to input strings, and so forth." +msgstr "" +"Вікна є основною абстракцією в curses. Об’єкт вікна представляє прямокутну " +"область екрана та підтримує методи відображення тексту, його стирання, " +"дозволу користувачеві вводити рядки тощо." + +msgid "" +"The ``stdscr`` object returned by the :func:`~curses.initscr` function is a " +"window object that covers the entire screen. Many programs may need only " +"this single window, but you might wish to divide the screen into smaller " +"windows, in order to redraw or clear them separately. The :func:`~curses." +"newwin` function creates a new window of a given size, returning the new " +"window object. ::" +msgstr "" +"Об’єкт ``stdscr``, що повертається функцією :func:`~curses.initscr`, є " +"об’єктом вікна, що покриває весь екран. Багатьом програмам може знадобитися " +"лише це одне вікно, але ви можете розділити екран на менші вікна, щоб " +"перемалювати або очистити їх окремо. Функція :func:`~curses.newwin` створює " +"нове вікно заданого розміру, повертаючи новий об’єкт вікна. ::" + +msgid "" +"begin_x = 20; begin_y = 7\n" +"height = 5; width = 40\n" +"win = curses.newwin(height, width, begin_y, begin_x)" +msgstr "" + +msgid "" +"Note that the coordinate system used in curses is unusual. Coordinates are " +"always passed in the order *y,x*, and the top-left corner of a window is " +"coordinate (0,0). This breaks the normal convention for handling " +"coordinates where the *x* coordinate comes first. This is an unfortunate " +"difference from most other computer applications, but it's been part of " +"curses since it was first written, and it's too late to change things now." +msgstr "" +"Зверніть увагу, що система координат, яка використовується в curses, є " +"незвичною. Координати завжди передаються в порядку *y,x*, а верхній лівий " +"кут вікна є координатою (0,0). Це порушує звичайну угоду щодо обробки " +"координат, де координата *x* стоїть першою. Це прикра відмінність від " +"більшості інших комп’ютерних програм, але вона була частиною прокляття " +"відтоді, як була написана, і зараз надто пізно щось змінювати." + +msgid "" +"Your application can determine the size of the screen by using the :data:" +"`curses.LINES` and :data:`curses.COLS` variables to obtain the *y* and *x* " +"sizes. Legal coordinates will then extend from ``(0,0)`` to ``(curses.LINES " +"- 1, curses.COLS - 1)``." +msgstr "" +"Ваша програма може визначити розмір екрана за допомогою змінних :data:" +"`curses.LINES` і :data:`curses.COLS` для отримання розмірів *y* і *x*. Тоді " +"юридичні координати розширюватимуться від ``(0,0)`` до ``(curses.LINES - 1, " +"curses.COLS - 1)``." + +msgid "" +"When you call a method to display or erase text, the effect doesn't " +"immediately show up on the display. Instead you must call the :meth:" +"`~curses.window.refresh` method of window objects to update the screen." +msgstr "" +"Коли ви викликаєте метод для відображення або стирання тексту, ефект не " +"відразу відображається на дисплеї. Натомість ви повинні викликати метод :" +"meth:`~curses.window.refresh` об’єктів вікна, щоб оновити екран." + +msgid "" +"This is because curses was originally written with slow 300-baud terminal " +"connections in mind; with these terminals, minimizing the time required to " +"redraw the screen was very important. Instead curses accumulates changes to " +"the screen and displays them in the most efficient manner when you call :" +"meth:`!refresh`. For example, if your program displays some text in a " +"window and then clears the window, there's no need to send the original text " +"because they're never visible." +msgstr "" + +msgid "" +"In practice, explicitly telling curses to redraw a window doesn't really " +"complicate programming with curses much. Most programs go into a flurry of " +"activity, and then pause waiting for a keypress or some other action on the " +"part of the user. All you have to do is to be sure that the screen has been " +"redrawn before pausing to wait for user input, by first calling :meth:`!" +"stdscr.refresh` or the :meth:`!refresh` method of some other relevant window." +msgstr "" + +msgid "" +"A pad is a special case of a window; it can be larger than the actual " +"display screen, and only a portion of the pad displayed at a time. Creating " +"a pad requires the pad's height and width, while refreshing a pad requires " +"giving the coordinates of the on-screen area where a subsection of the pad " +"will be displayed. ::" +msgstr "" +"Колодка — окремий випадок вікна; він може бути більшим, ніж фактичний екран " +"дисплея, і одночасно відображатися лише частина панелі. Щоб створити " +"блокнот, потрібно вказати його висоту та ширину, тоді як для оновлення " +"блокнота потрібно вказати координати області на екрані, де відображатиметься " +"його підрозділ. ::" + +msgid "" +"pad = curses.newpad(100, 100)\n" +"# These loops fill the pad with letters; addch() is\n" +"# explained in the next section\n" +"for y in range(0, 99):\n" +" for x in range(0, 99):\n" +" pad.addch(y,x, ord('a') + (x*x+y*y) % 26)\n" +"\n" +"# Displays a section of the pad in the middle of the screen.\n" +"# (0,0) : coordinate of upper-left corner of pad area to display.\n" +"# (5,5) : coordinate of upper-left corner of window area to be filled\n" +"# with pad content.\n" +"# (20, 75) : coordinate of lower-right corner of window area to be\n" +"# : filled with pad content.\n" +"pad.refresh( 0,0, 5,5, 20,75)" +msgstr "" + +msgid "" +"The :meth:`!refresh` call displays a section of the pad in the rectangle " +"extending from coordinate (5,5) to coordinate (20,75) on the screen; the " +"upper left corner of the displayed section is coordinate (0,0) on the pad. " +"Beyond that difference, pads are exactly like ordinary windows and support " +"the same methods." +msgstr "" + +msgid "" +"If you have multiple windows and pads on screen there is a more efficient " +"way to update the screen and prevent annoying screen flicker as each part of " +"the screen gets updated. :meth:`!refresh` actually does two things:" +msgstr "" + +msgid "" +"Calls the :meth:`~curses.window.noutrefresh` method of each window to update " +"an underlying data structure representing the desired state of the screen." +msgstr "" +"Викликає метод :meth:`~curses.window.noutrefresh` кожного вікна, щоб оновити " +"базову структуру даних, що представляє потрібний стан екрана." + +msgid "" +"Calls the function :func:`~curses.doupdate` function to change the physical " +"screen to match the desired state recorded in the data structure." +msgstr "" +"Викликає функцію :func:`~curses.doupdate`, щоб змінити фізичний екран " +"відповідно до потрібного стану, записаного в структурі даних." + +msgid "" +"Instead you can call :meth:`!noutrefresh` on a number of windows to update " +"the data structure, and then call :func:`!doupdate` to update the screen." +msgstr "" + +msgid "Displaying Text" +msgstr "Відображення тексту" + +msgid "" +"From a C programmer's point of view, curses may sometimes look like a twisty " +"maze of functions, all subtly different. For example, :c:func:`!addstr` " +"displays a string at the current cursor location in the ``stdscr`` window, " +"while :c:func:`!mvaddstr` moves to a given y,x coordinate first before " +"displaying the string. :c:func:`!waddstr` is just like :c:func:`!addstr`, " +"but allows specifying a window to use instead of using ``stdscr`` by " +"default. :c:func:`!mvwaddstr` allows specifying both a window and a " +"coordinate." +msgstr "" + +msgid "" +"Fortunately the Python interface hides all these details. ``stdscr`` is a " +"window object like any other, and methods such as :meth:`~curses.window." +"addstr` accept multiple argument forms. Usually there are four different " +"forms." +msgstr "" +"На щастя, інтерфейс Python приховує всі ці деталі. ``stdscr`` є віконним " +"об’єктом, як і будь-який інший, і такі методи, як :meth:`~curses.window." +"addstr` приймають кілька форм аргументів. Зазвичай є чотири різні форми." + +msgid "Form" +msgstr "Форма" + +msgid "Description" +msgstr "опис" + +msgid "*str* or *ch*" +msgstr "*str* або *ch*" + +msgid "Display the string *str* or character *ch* at the current position" +msgstr "Відобразити рядок *str* або символ *ch* у поточній позиції" + +msgid "*str* or *ch*, *attr*" +msgstr "*str* або *ch*, *attr*" + +msgid "" +"Display the string *str* or character *ch*, using attribute *attr* at the " +"current position" +msgstr "" +"Відобразити рядок *str* або символ *ch*, використовуючи атрибут *attr* у " +"поточній позиції" + +msgid "*y*, *x*, *str* or *ch*" +msgstr "*y*, *x*, *str* або *ch*" + +msgid "Move to position *y,x* within the window, and display *str* or *ch*" +msgstr "Перейдіть до позиції *y,x* у вікні та відобразіть *str* або *ch*" + +msgid "*y*, *x*, *str* or *ch*, *attr*" +msgstr "*y*, *x*, *str* або *ch*, *attr*" + +msgid "" +"Move to position *y,x* within the window, and display *str* or *ch*, using " +"attribute *attr*" +msgstr "" +"Перейдіть до позиції *y,x* у вікні та відобразіть *str* або *ch*, " +"використовуючи атрибут *attr*" + +msgid "" +"Attributes allow displaying text in highlighted forms such as boldface, " +"underline, reverse code, or in color. They'll be explained in more detail " +"in the next subsection." +msgstr "" +"Атрибути дозволяють відображати текст у виділених формах, наприклад жирним " +"шрифтом, підкресленням, зворотним кодом або кольором. Вони будуть пояснені " +"більш детально в наступному підрозділі." + +msgid "" +"The :meth:`~curses.window.addstr` method takes a Python string or bytestring " +"as the value to be displayed. The contents of bytestrings are sent to the " +"terminal as-is. Strings are encoded to bytes using the value of the " +"window's :attr:`~window.encoding` attribute; this defaults to the default " +"system encoding as returned by :func:`locale.getencoding`." +msgstr "" + +msgid "" +"The :meth:`~curses.window.addch` methods take a character, which can be " +"either a string of length 1, a bytestring of length 1, or an integer." +msgstr "" +"Методи :meth:`~curses.window.addch` приймають символ, який може бути рядком " +"довжини 1, байтовим рядком довжини 1 або цілим числом." + +msgid "" +"Constants are provided for extension characters; these constants are " +"integers greater than 255. For example, :const:`ACS_PLMINUS` is a +/- " +"symbol, and :const:`ACS_ULCORNER` is the upper left corner of a box (handy " +"for drawing borders). You can also use the appropriate Unicode character." +msgstr "" +"Константи надаються для символів розширення; ці константи є цілими числами, " +"більшими за 255. Наприклад, :const:`ACS_PLMINUS` — це символ +/-, а :const:" +"`ACS_ULCORNER` — верхній лівий кут прямокутника (зручно для малювання меж). " +"Ви також можете використовувати відповідний символ Unicode." + +msgid "" +"Windows remember where the cursor was left after the last operation, so if " +"you leave out the *y,x* coordinates, the string or character will be " +"displayed wherever the last operation left off. You can also move the " +"cursor with the ``move(y,x)`` method. Because some terminals always display " +"a flashing cursor, you may want to ensure that the cursor is positioned in " +"some location where it won't be distracting; it can be confusing to have the " +"cursor blinking at some apparently random location." +msgstr "" +"Windows запам’ятовує, де був залишений курсор після останньої операції, " +"тому, якщо ви пропустите координати *y,x*, рядок або символ " +"відображатиметься там, де зупинилася остання операція. Ви також можете " +"перемістити курсор за допомогою методу ``move(y,x)``. Оскільки деякі " +"термінали завжди відображають блимаючий курсор, ви можете переконатися, що " +"курсор розташований у певному місці, де він не буде відволікати; блимання " +"курсора в певному, начебто випадковому, місці може бути збентеженим." + +msgid "" +"If your application doesn't need a blinking cursor at all, you can call " +"``curs_set(False)`` to make it invisible. For compatibility with older " +"curses versions, there's a ``leaveok(bool)`` function that's a synonym for :" +"func:`~curses.curs_set`. When *bool* is true, the curses library will " +"attempt to suppress the flashing cursor, and you won't need to worry about " +"leaving it in odd locations." +msgstr "" +"Якщо вашій програмі зовсім не потрібен мерехтливий курсор, ви можете " +"викликати ``curs_set(False)``, щоб зробити його невидимим. Для сумісності зі " +"старішими версіями curses існує функція ``leaveok(bool)``, яка є синонімом :" +"func:`~curses.curs_set`. Якщо *bool* має значення true, бібліотека curses " +"намагатиметься придушити миготливий курсор, і вам не потрібно буде " +"турбуватися про те, щоб залишити його в незвичних місцях." + +msgid "Attributes and Color" +msgstr "Атрибути та колір" + +msgid "" +"Characters can be displayed in different ways. Status lines in a text-based " +"application are commonly shown in reverse video, or a text viewer may need " +"to highlight certain words. curses supports this by allowing you to specify " +"an attribute for each cell on the screen." +msgstr "" +"Символи можуть відображатися різними способами. Рядки стану в текстовій " +"програмі зазвичай відображаються у зворотному відео, або програмі перегляду " +"тексту може знадобитися виділити певні слова. curses підтримує це, " +"дозволяючи вам вказати атрибут для кожної клітинки на екрані." + +msgid "" +"An attribute is an integer, each bit representing a different attribute. " +"You can try to display text with multiple attribute bits set, but curses " +"doesn't guarantee that all the possible combinations are available, or that " +"they're all visually distinct. That depends on the ability of the terminal " +"being used, so it's safest to stick to the most commonly available " +"attributes, listed here." +msgstr "" +"Атрибут — це ціле число, кожен біт якого представляє окремий атрибут. Ви " +"можете спробувати відобразити текст з кількома встановленими бітами " +"атрибутів, але curses не гарантує, що всі можливі комбінації доступні, або " +"що всі вони візуально відрізняються. Це залежить від можливостей " +"використовуваного терміналу, тому найбезпечніше дотримуватися найпоширеніших " +"атрибутів, перелічених тут." + +msgid "Attribute" +msgstr "Атрибут" + +msgid ":const:`A_BLINK`" +msgstr ":const:`A_BLINK`" + +msgid "Blinking text" +msgstr "Миготливий текст" + +msgid ":const:`A_BOLD`" +msgstr ":const:`A_BOLD`" + +msgid "Extra bright or bold text" +msgstr "Дуже яскравий або жирний текст" + +msgid ":const:`A_DIM`" +msgstr ":const:`A_DIM`" + +msgid "Half bright text" +msgstr "Наполовину яскравий текст" + +msgid ":const:`A_REVERSE`" +msgstr ":const:`A_REVERSE`" + +msgid "Reverse-video text" +msgstr "Зворотний відеотекст" + +msgid ":const:`A_STANDOUT`" +msgstr ":const:`A_STANDOUT`" + +msgid "The best highlighting mode available" +msgstr "Найкращий доступний режим підсвічування" + +msgid ":const:`A_UNDERLINE`" +msgstr ":const:`A_UNDERLINE`" + +msgid "Underlined text" +msgstr "Підкреслений текст" + +msgid "" +"So, to display a reverse-video status line on the top line of the screen, " +"you could code::" +msgstr "" +"Отже, щоб відобразити рядок стану реверсивного відео у верхньому рядку " +"екрана, ви можете закодувати:" + +msgid "" +"stdscr.addstr(0, 0, \"Current mode: Typing mode\",\n" +" curses.A_REVERSE)\n" +"stdscr.refresh()" +msgstr "" + +msgid "" +"The curses library also supports color on those terminals that provide it. " +"The most common such terminal is probably the Linux console, followed by " +"color xterms." +msgstr "" +"Бібліотека curses також підтримує колір на тих терміналах, які його надають. " +"Найпоширенішим таким терміналом, ймовірно, є консоль Linux, за якою слідують " +"кольорові xterms." + +msgid "" +"To use color, you must call the :func:`~curses.start_color` function soon " +"after calling :func:`~curses.initscr`, to initialize the default color set " +"(the :func:`curses.wrapper` function does this automatically). Once that's " +"done, the :func:`~curses.has_colors` function returns TRUE if the terminal " +"in use can actually display color. (Note: curses uses the American spelling " +"'color', instead of the Canadian/British spelling 'colour'. If you're used " +"to the British spelling, you'll have to resign yourself to misspelling it " +"for the sake of these functions.)" +msgstr "" +"Щоб використовувати колір, ви повинні викликати функцію :func:`~curses." +"start_color` відразу після виклику :func:`~curses.initscr`, щоб " +"ініціалізувати набір кольорів за замовчуванням (це робить функція :func:" +"`curses.wrapper` автоматично). Після цього функція :func:`~curses." +"has_colors` повертає TRUE, якщо термінал, що використовується, справді може " +"відображати колір. (Примітка: curses використовує американське написання " +"\"колір\" замість канадсько-британського написання \"колір\". Якщо ви звикли " +"до британського написання, вам доведеться змиритися з орфографічною помилкою " +"заради цих функцій. )" + +msgid "" +"The curses library maintains a finite number of color pairs, containing a " +"foreground (or text) color and a background color. You can get the " +"attribute value corresponding to a color pair with the :func:`~curses." +"color_pair` function; this can be bitwise-OR'ed with other attributes such " +"as :const:`A_REVERSE`, but again, such combinations are not guaranteed to " +"work on all terminals." +msgstr "" +"Бібліотека curses підтримує кінцеву кількість пар кольорів, що містять колір " +"переднього плану (або тексту) і колір фону. Ви можете отримати значення " +"атрибута, що відповідає парі кольорів, за допомогою функції :func:`~curses." +"color_pair`; це можна об’єднати порозрядним АБО з іншими атрибутами, такими " +"як :const:`A_REVERSE`, але знову ж таки, такі комбінації не гарантовано " +"працюють на всіх терміналах." + +msgid "An example, which displays a line of text using color pair 1::" +msgstr "Приклад, який відображає рядок тексту за допомогою пари кольорів 1::" + +msgid "" +"stdscr.addstr(\"Pretty text\", curses.color_pair(1))\n" +"stdscr.refresh()" +msgstr "" + +msgid "" +"As I said before, a color pair consists of a foreground and background " +"color. The ``init_pair(n, f, b)`` function changes the definition of color " +"pair *n*, to foreground color f and background color b. Color pair 0 is " +"hard-wired to white on black, and cannot be changed." +msgstr "" +"Як я вже говорив раніше, пара кольорів складається з кольору переднього " +"плану та кольору фону. Функція ``init_pair(n, f, b)`` змінює визначення пари " +"кольорів *n* на колір переднього плану f і колір фону b. Пара кольорів 0 " +"жорстко з’єднана з білим на чорному, і її неможливо змінити." + +msgid "" +"Colors are numbered, and :func:`start_color` initializes 8 basic colors when " +"it activates color mode. They are: 0:black, 1:red, 2:green, 3:yellow, 4:" +"blue, 5:magenta, 6:cyan, and 7:white. The :mod:`curses` module defines " +"named constants for each of these colors: :const:`curses.COLOR_BLACK`, :" +"const:`curses.COLOR_RED`, and so forth." +msgstr "" +"Кольори пронумеровані, і :func:`start_color` ініціалізує 8 основних " +"кольорів, коли він активує колірний режим. Це: 0:чорний, 1:червоний, 2:" +"зелений, 3:жовтий, 4:синій, 5:пурпурний, 6:блакитний і 7:білий. Модуль :mod:" +"`curses` визначає іменовані константи для кожного з цих кольорів: :const:" +"`curses.COLOR_BLACK`, :const:`curses.COLOR_RED` і так далі." + +msgid "" +"Let's put all this together. To change color 1 to red text on a white " +"background, you would call::" +msgstr "" +"Давайте все це разом. Щоб змінити колір 1 на червоний текст на білому фоні, " +"ви повинні викликати:" + +msgid "curses.init_pair(1, curses.COLOR_RED, curses.COLOR_WHITE)" +msgstr "" + +msgid "" +"When you change a color pair, any text already displayed using that color " +"pair will change to the new colors. You can also display new text in this " +"color with::" +msgstr "" +"Коли ви змінюєте пару кольорів, будь-який текст, який уже відображається за " +"допомогою цієї пари кольорів, зміниться на нові кольори. Ви також можете " +"відобразити новий текст у цьому кольорі за допомогою:" + +msgid "stdscr.addstr(0,0, \"RED ALERT!\", curses.color_pair(1))" +msgstr "" + +msgid "" +"Very fancy terminals can change the definitions of the actual colors to a " +"given RGB value. This lets you change color 1, which is usually red, to " +"purple or blue or any other color you like. Unfortunately, the Linux " +"console doesn't support this, so I'm unable to try it out, and can't provide " +"any examples. You can check if your terminal can do this by calling :func:" +"`~curses.can_change_color`, which returns ``True`` if the capability is " +"there. If you're lucky enough to have such a talented terminal, consult " +"your system's man pages for more information." +msgstr "" +"Дуже модні термінали можуть змінювати визначення фактичних кольорів на " +"задане значення RGB. Це дозволяє змінити колір 1, який зазвичай червоний, на " +"фіолетовий, синій або будь-який інший колір, який вам подобається. На жаль, " +"консоль Linux не підтримує це, тому я не можу випробувати це й не можу " +"надати жодних прикладів. Ви можете перевірити, чи ваш термінал може зробити " +"це, викликавши :func:`~curses.can_change_color`, який повертає ``True``, " +"якщо така можливість є. Якщо вам пощастило мати такий талановитий термінал, " +"зверніться до сторінок керівництва вашої системи для отримання додаткової " +"інформації." + +msgid "User Input" +msgstr "Введення користувача" + +msgid "" +"The C curses library offers only very simple input mechanisms. Python's :mod:" +"`curses` module adds a basic text-input widget. (Other libraries such as :" +"pypi:`Urwid` have more extensive collections of widgets.)" +msgstr "" + +msgid "There are two methods for getting input from a window:" +msgstr "Існує два способи отримання даних із вікна:" + +msgid "" +":meth:`~curses.window.getch` refreshes the screen and then waits for the " +"user to hit a key, displaying the key if :func:`~curses.echo` has been " +"called earlier. You can optionally specify a coordinate to which the cursor " +"should be moved before pausing." +msgstr "" +":meth:`~curses.window.getch` оновлює екран, а потім чекає, поки користувач " +"натисне клавішу, відображаючи клавішу, якщо :func:`~curses.echo` було " +"викликано раніше. Додатково можна вказати координату, до якої слід " +"перемістити курсор перед паузою." + +msgid "" +":meth:`~curses.window.getkey` does the same thing but converts the integer " +"to a string. Individual characters are returned as 1-character strings, and " +"special keys such as function keys return longer strings containing a key " +"name such as ``KEY_UP`` or ``^G``." +msgstr "" +":meth:`~curses.window.getkey` робить те саме, але перетворює ціле число на " +"рядок. Окремі символи повертаються як рядки з 1 символу, а спеціальні " +"клавіші, такі як функціональні клавіші, повертають довші рядки, що містять " +"ім’я ключа, наприклад ``KEY_UP`` або ``^G``." + +msgid "" +"It's possible to not wait for the user using the :meth:`~curses.window." +"nodelay` window method. After ``nodelay(True)``, :meth:`!getch` and :meth:`!" +"getkey` for the window become non-blocking. To signal that no input is " +"ready, :meth:`!getch` returns ``curses.ERR`` (a value of -1) and :meth:`!" +"getkey` raises an exception. There's also a :func:`~curses.halfdelay` " +"function, which can be used to (in effect) set a timer on each :meth:`!" +"getch`; if no input becomes available within a specified delay (measured in " +"tenths of a second), curses raises an exception." +msgstr "" + +msgid "" +"The :meth:`!getch` method returns an integer; if it's between 0 and 255, it " +"represents the ASCII code of the key pressed. Values greater than 255 are " +"special keys such as Page Up, Home, or the cursor keys. You can compare the " +"value returned to constants such as :const:`curses.KEY_PPAGE`, :const:" +"`curses.KEY_HOME`, or :const:`curses.KEY_LEFT`. The main loop of your " +"program may look something like this::" +msgstr "" + +msgid "" +"while True:\n" +" c = stdscr.getch()\n" +" if c == ord('p'):\n" +" PrintDocument()\n" +" elif c == ord('q'):\n" +" break # Exit the while loop\n" +" elif c == curses.KEY_HOME:\n" +" x = y = 0" +msgstr "" + +msgid "" +"The :mod:`curses.ascii` module supplies ASCII class membership functions " +"that take either integer or 1-character string arguments; these may be " +"useful in writing more readable tests for such loops. It also supplies " +"conversion functions that take either integer or 1-character-string " +"arguments and return the same type. For example, :func:`curses.ascii.ctrl` " +"returns the control character corresponding to its argument." +msgstr "" +"Модуль :mod:`curses.ascii` надає функції приналежності до класу ASCII, які " +"приймають цілі або односимвольні рядкові аргументи; вони можуть бути " +"корисними для написання більш читабельних тестів для таких циклів. Він також " +"надає функції перетворення, які приймають цілі або односимвольні аргументи " +"та повертають той самий тип. Наприклад, :func:`curses.ascii.ctrl` повертає " +"керуючий символ, що відповідає його аргументу." + +msgid "" +"There's also a method to retrieve an entire string, :meth:`~curses.window." +"getstr`. It isn't used very often, because its functionality is quite " +"limited; the only editing keys available are the backspace key and the Enter " +"key, which terminates the string. It can optionally be limited to a fixed " +"number of characters. ::" +msgstr "" +"Існує також метод для отримання цілого рядка, :meth:`~curses.window.getstr`. " +"Використовується не дуже часто, оскільки його функціональність досить " +"обмежена; єдиними доступними клавішами редагування є клавіша повернення та " +"клавіша Enter, яка завершує рядок. За бажанням його можна обмежити " +"фіксованою кількістю символів. ::" + +msgid "" +"curses.echo() # Enable echoing of characters\n" +"\n" +"# Get a 15-character string, with the cursor on the top line\n" +"s = stdscr.getstr(0,0, 15)" +msgstr "" + +msgid "" +"The :mod:`curses.textpad` module supplies a text box that supports an Emacs-" +"like set of keybindings. Various methods of the :class:`~curses.textpad." +"Textbox` class support editing with input validation and gathering the edit " +"results either with or without trailing spaces. Here's an example::" +msgstr "" +"Модуль :mod:`curses.textpad` надає текстове поле, яке підтримує Emacs-" +"подібний набір сполучень клавіш. Різні методи класу :class:`~curses.textpad." +"Textbox` підтримують редагування з перевіркою введених даних і збиранням " +"результатів редагування з пробілами в кінці або без них. Ось приклад::" + +msgid "" +"import curses\n" +"from curses.textpad import Textbox, rectangle\n" +"\n" +"def main(stdscr):\n" +" stdscr.addstr(0, 0, \"Enter IM message: (hit Ctrl-G to send)\")\n" +"\n" +" editwin = curses.newwin(5,30, 2,1)\n" +" rectangle(stdscr, 1,0, 1+5+1, 1+30+1)\n" +" stdscr.refresh()\n" +"\n" +" box = Textbox(editwin)\n" +"\n" +" # Let the user edit until Ctrl-G is struck.\n" +" box.edit()\n" +"\n" +" # Get resulting contents\n" +" message = box.gather()" +msgstr "" + +msgid "" +"See the library documentation on :mod:`curses.textpad` for more details." +msgstr "" +"Перегляньте документацію бібліотеки на :mod:`curses.textpad` для отримання " +"додаткової інформації." + +msgid "For More Information" +msgstr "Для отримання додаткової інформації" + +msgid "" +"This HOWTO doesn't cover some advanced topics, such as reading the contents " +"of the screen or capturing mouse events from an xterm instance, but the " +"Python library page for the :mod:`curses` module is now reasonably " +"complete. You should browse it next." +msgstr "" +"Цей HOWTO не охоплює деякі складні теми, такі як читання вмісту екрана чи " +"захоплення подій миші з екземпляра xterm, але сторінка бібліотеки Python для " +"модуля :mod:`curses` тепер досить повна. Ви повинні переглянути його далі." + +msgid "" +"If you're in doubt about the detailed behavior of the curses functions, " +"consult the manual pages for your curses implementation, whether it's " +"ncurses or a proprietary Unix vendor's. The manual pages will document any " +"quirks, and provide complete lists of all the functions, attributes, and :" +"ref:`ACS_\\* ` characters available to you." +msgstr "" + +msgid "" +"Because the curses API is so large, some functions aren't supported in the " +"Python interface. Often this isn't because they're difficult to implement, " +"but because no one has needed them yet. Also, Python doesn't yet support " +"the menu library associated with ncurses. Patches adding support for these " +"would be welcome; see `the Python Developer's Guide `_ to learn more about submitting patches to Python." +msgstr "" +"Оскільки API curses дуже великий, деякі функції не підтримуються в " +"інтерфейсі Python. Часто це відбувається не тому, що їх важко реалізувати, а " +"тому, що вони ще нікому не потрібні. Крім того, Python ще не підтримує " +"бібліотеку меню, пов’язану з ncurses. Латки, що додають підтримку для них, " +"будуть вітатися; див. `Посібник розробника Python `_, щоб дізнатися більше про надсилання виправлень у Python." + +msgid "" +"`Writing Programs with NCURSES `_: a lengthy tutorial for C programmers." +msgstr "" + +msgid "`The ncurses man page `_" +msgstr "`Довідкова сторінка ncurses `_" + +msgid "" +"`The ncurses FAQ `_" +msgstr "" + +msgid "" +"`\"Use curses... don't swear\" `_: video of a PyCon 2013 talk on controlling terminals using " +"curses or Urwid." +msgstr "" +"`\"Використовуйте прокляття... не лайтеся\" `_: відео розмови на PyCon 2013 про керування терміналами за " +"допомогою проклять або Urwid." + +msgid "" +"`\"Console Applications with Urwid\" `_: video of a PyCon CA 2012 talk demonstrating some " +"applications written using Urwid." +msgstr "" diff --git a/howto/descriptor.po b/howto/descriptor.po new file mode 100644 index 000000000..08107d003 --- /dev/null +++ b/howto/descriptor.po @@ -0,0 +1,1867 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:53+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Descriptor Guide" +msgstr "" + +msgid "Author" +msgstr "Автор" + +msgid "Raymond Hettinger" +msgstr "Raymond Hettinger" + +msgid "Contact" +msgstr "контакт" + +msgid "" +msgstr " " + +msgid "Contents" +msgstr "Зміст" + +msgid "" +":term:`Descriptors ` let objects customize attribute lookup, " +"storage, and deletion." +msgstr "" +":term:`Дескриптори ` дозволяють об’єктам налаштовувати пошук " +"атрибутів, зберігання та видалення." + +msgid "This guide has four major sections:" +msgstr "Цей посібник складається з чотирьох основних розділів:" + +msgid "" +"The \"primer\" gives a basic overview, moving gently from simple examples, " +"adding one feature at a time. Start here if you're new to descriptors." +msgstr "" +"\"Буквар\" дає базовий огляд, обережно переходячи від простих прикладів, " +"додаючи одну функцію за раз. Почніть тут, якщо ви новачок у дескрипторах." + +msgid "" +"The second section shows a complete, practical descriptor example. If you " +"already know the basics, start there." +msgstr "" +"Другий розділ показує повний, практичний приклад дескриптора. Якщо ви вже " +"знаєте основи, почніть з цього." + +msgid "" +"The third section provides a more technical tutorial that goes into the " +"detailed mechanics of how descriptors work. Most people don't need this " +"level of detail." +msgstr "" +"Третій розділ містить більш технічний підручник, який детально описує " +"механізм роботи дескрипторів. Більшості людей не потрібен такий рівень " +"деталізації." + +msgid "" +"The last section has pure Python equivalents for built-in descriptors that " +"are written in C. Read this if you're curious about how functions turn into " +"bound methods or about the implementation of common tools like :func:" +"`classmethod`, :func:`staticmethod`, :func:`property`, and :term:`__slots__`." +msgstr "" +"Останній розділ містить чисті еквіваленти Python для вбудованих " +"дескрипторів, написаних мовою C. Прочитайте це, якщо вам цікаво, як функції " +"перетворюються на зв’язані методи, або про реалізацію звичайних " +"інструментів, таких як :func:`classmethod`, :func:`staticmethod`, :func:" +"`property` і :term:`__slots__`." + +msgid "Primer" +msgstr "Буквар" + +msgid "" +"In this primer, we start with the most basic possible example and then we'll " +"add new capabilities one by one." +msgstr "" +"У цьому посібнику ми починаємо з найпростішого можливого прикладу, а потім " +"будемо додавати нові можливості одну за одною." + +msgid "Simple example: A descriptor that returns a constant" +msgstr "Простий приклад: дескриптор, який повертає константу" + +msgid "" +"The :class:`!Ten` class is a descriptor whose :meth:`~object.__get__` method " +"always returns the constant ``10``:" +msgstr "" + +msgid "" +"class Ten:\n" +" def __get__(self, obj, objtype=None):\n" +" return 10" +msgstr "" + +msgid "" +"To use the descriptor, it must be stored as a class variable in another " +"class:" +msgstr "" +"Щоб використовувати дескриптор, його потрібно зберегти як змінну класу в " +"іншому класі:" + +msgid "" +"class A:\n" +" x = 5 # Regular class attribute\n" +" y = Ten() # Descriptor instance" +msgstr "" + +msgid "" +"An interactive session shows the difference between normal attribute lookup " +"and descriptor lookup:" +msgstr "" +"Інтерактивний сеанс показує різницю між звичайним пошуком атрибута та " +"пошуком дескриптора:" + +msgid "" +">>> a = A() # Make an instance of class A\n" +">>> a.x # Normal attribute lookup\n" +"5\n" +">>> a.y # Descriptor lookup\n" +"10" +msgstr "" + +msgid "" +"In the ``a.x`` attribute lookup, the dot operator finds ``'x': 5`` in the " +"class dictionary. In the ``a.y`` lookup, the dot operator finds a " +"descriptor instance, recognized by its ``__get__`` method. Calling that " +"method returns ``10``." +msgstr "" +"Під час пошуку атрибутів ``a.x`` оператор крапки знаходить ``'x': 5`` у " +"словнику класу. Під час пошуку ``a.y`` оператор точки знаходить екземпляр " +"дескриптора, розпізнаний його методом ``__get__``. Виклик цього методу " +"повертає ``10``." + +msgid "" +"Note that the value ``10`` is not stored in either the class dictionary or " +"the instance dictionary. Instead, the value ``10`` is computed on demand." +msgstr "" +"Зверніть увагу, що значення ``10`` не зберігається ні в словнику класу, ні в " +"словнику екземпляра. Натомість значення ``10`` обчислюється на вимогу." + +msgid "" +"This example shows how a simple descriptor works, but it isn't very useful. " +"For retrieving constants, normal attribute lookup would be better." +msgstr "" +"Цей приклад показує, як працює простий дескриптор, але він не дуже корисний. " +"Для отримання констант кращим буде звичайний пошук атрибутів." + +msgid "" +"In the next section, we'll create something more useful, a dynamic lookup." +msgstr "У наступному розділі ми створимо щось більш корисне, динамічний пошук." + +msgid "Dynamic lookups" +msgstr "Динамічні пошуки" + +msgid "" +"Interesting descriptors typically run computations instead of returning " +"constants:" +msgstr "" +"Цікаві дескриптори зазвичай запускають обчислення замість повернення " +"констант:" + +msgid "" +"import os\n" +"\n" +"class DirectorySize:\n" +"\n" +" def __get__(self, obj, objtype=None):\n" +" return len(os.listdir(obj.dirname))\n" +"\n" +"class Directory:\n" +"\n" +" size = DirectorySize() # Descriptor instance\n" +"\n" +" def __init__(self, dirname):\n" +" self.dirname = dirname # Regular instance attribute" +msgstr "" + +msgid "" +"An interactive session shows that the lookup is dynamic — it computes " +"different, updated answers each time::" +msgstr "" +"Інтерактивний сеанс показує, що пошук є динамічним — він щоразу обчислює " +"різні оновлені відповіді:" + +msgid "" +">>> s = Directory('songs')\n" +">>> g = Directory('games')\n" +">>> s.size # The songs directory has twenty " +"files\n" +"20\n" +">>> g.size # The games directory has three " +"files\n" +"3\n" +">>> os.remove('games/chess') # Delete a game\n" +">>> g.size # File count is automatically " +"updated\n" +"2" +msgstr "" + +msgid "" +"Besides showing how descriptors can run computations, this example also " +"reveals the purpose of the parameters to :meth:`~object.__get__`. The " +"*self* parameter is *size*, an instance of *DirectorySize*. The *obj* " +"parameter is either *g* or *s*, an instance of *Directory*. It is the *obj* " +"parameter that lets the :meth:`~object.__get__` method learn the target " +"directory. The *objtype* parameter is the class *Directory*." +msgstr "" + +msgid "Managed attributes" +msgstr "Керовані атрибути" + +msgid "" +"A popular use for descriptors is managing access to instance data. The " +"descriptor is assigned to a public attribute in the class dictionary while " +"the actual data is stored as a private attribute in the instance " +"dictionary. The descriptor's :meth:`~object.__get__` and :meth:`~object." +"__set__` methods are triggered when the public attribute is accessed." +msgstr "" + +msgid "" +"In the following example, *age* is the public attribute and *_age* is the " +"private attribute. When the public attribute is accessed, the descriptor " +"logs the lookup or update:" +msgstr "" +"У наступному прикладі *age* є публічним атрибутом, а *_age* є приватним. " +"Коли здійснюється доступ до публічного атрибута, дескриптор реєструє пошук " +"або оновлення:" + +msgid "" +"import logging\n" +"\n" +"logging.basicConfig(level=logging.INFO)\n" +"\n" +"class LoggedAgeAccess:\n" +"\n" +" def __get__(self, obj, objtype=None):\n" +" value = obj._age\n" +" logging.info('Accessing %r giving %r', 'age', value)\n" +" return value\n" +"\n" +" def __set__(self, obj, value):\n" +" logging.info('Updating %r to %r', 'age', value)\n" +" obj._age = value\n" +"\n" +"class Person:\n" +"\n" +" age = LoggedAgeAccess() # Descriptor instance\n" +"\n" +" def __init__(self, name, age):\n" +" self.name = name # Regular instance attribute\n" +" self.age = age # Calls __set__()\n" +"\n" +" def birthday(self):\n" +" self.age += 1 # Calls both __get__() and __set__()" +msgstr "" + +msgid "" +"An interactive session shows that all access to the managed attribute *age* " +"is logged, but that the regular attribute *name* is not logged:" +msgstr "" +"Інтерактивний сеанс показує, що весь доступ до керованого атрибута *age* " +"реєструється, але звичайний атрибут *name* не реєструється:" + +msgid "" +">>> mary = Person('Mary M', 30) # The initial age update is logged\n" +"INFO:root:Updating 'age' to 30\n" +">>> dave = Person('David D', 40)\n" +"INFO:root:Updating 'age' to 40\n" +"\n" +">>> vars(mary) # The actual data is in a private " +"attribute\n" +"{'name': 'Mary M', '_age': 30}\n" +">>> vars(dave)\n" +"{'name': 'David D', '_age': 40}\n" +"\n" +">>> mary.age # Access the data and log the " +"lookup\n" +"INFO:root:Accessing 'age' giving 30\n" +"30\n" +">>> mary.birthday() # Updates are logged as well\n" +"INFO:root:Accessing 'age' giving 30\n" +"INFO:root:Updating 'age' to 31\n" +"\n" +">>> dave.name # Regular attribute lookup isn't " +"logged\n" +"'David D'\n" +">>> dave.age # Only the managed attribute is " +"logged\n" +"INFO:root:Accessing 'age' giving 40\n" +"40" +msgstr "" + +msgid "" +"One major issue with this example is that the private name *_age* is " +"hardwired in the *LoggedAgeAccess* class. That means that each instance can " +"only have one logged attribute and that its name is unchangeable. In the " +"next example, we'll fix that problem." +msgstr "" +"Однією з основних проблем у цьому прикладі є те, що приватне ім’я *_age* " +"закріплено в класі *LoggedAgeAccess*. Це означає, що кожен екземпляр може " +"мати лише один зареєстрований атрибут і що його ім’я не змінюється. У " +"наступному прикладі ми вирішимо цю проблему." + +msgid "Customized names" +msgstr "Індивідуальні імена" + +msgid "" +"When a class uses descriptors, it can inform each descriptor about which " +"variable name was used." +msgstr "" +"Коли клас використовує дескриптори, він може інформувати кожен дескриптор " +"про те, яке ім'я змінної було використано." + +msgid "" +"In this example, the :class:`!Person` class has two descriptor instances, " +"*name* and *age*. When the :class:`!Person` class is defined, it makes a " +"callback to :meth:`~object.__set_name__` in *LoggedAccess* so that the field " +"names can be recorded, giving each descriptor its own *public_name* and " +"*private_name*:" +msgstr "" + +msgid "" +"import logging\n" +"\n" +"logging.basicConfig(level=logging.INFO)\n" +"\n" +"class LoggedAccess:\n" +"\n" +" def __set_name__(self, owner, name):\n" +" self.public_name = name\n" +" self.private_name = '_' + name\n" +"\n" +" def __get__(self, obj, objtype=None):\n" +" value = getattr(obj, self.private_name)\n" +" logging.info('Accessing %r giving %r', self.public_name, value)\n" +" return value\n" +"\n" +" def __set__(self, obj, value):\n" +" logging.info('Updating %r to %r', self.public_name, value)\n" +" setattr(obj, self.private_name, value)\n" +"\n" +"class Person:\n" +"\n" +" name = LoggedAccess() # First descriptor instance\n" +" age = LoggedAccess() # Second descriptor instance\n" +"\n" +" def __init__(self, name, age):\n" +" self.name = name # Calls the first descriptor\n" +" self.age = age # Calls the second descriptor\n" +"\n" +" def birthday(self):\n" +" self.age += 1" +msgstr "" + +msgid "" +"An interactive session shows that the :class:`!Person` class has called :" +"meth:`~object.__set_name__` so that the field names would be recorded. Here " +"we call :func:`vars` to look up the descriptor without triggering it:" +msgstr "" + +msgid "" +">>> vars(vars(Person)['name'])\n" +"{'public_name': 'name', 'private_name': '_name'}\n" +">>> vars(vars(Person)['age'])\n" +"{'public_name': 'age', 'private_name': '_age'}" +msgstr "" + +msgid "The new class now logs access to both *name* and *age*:" +msgstr "Новий клас тепер реєструє доступ як до *ім’я*, так і до *віку*:" + +msgid "" +">>> pete = Person('Peter P', 10)\n" +"INFO:root:Updating 'name' to 'Peter P'\n" +"INFO:root:Updating 'age' to 10\n" +">>> kate = Person('Catherine C', 20)\n" +"INFO:root:Updating 'name' to 'Catherine C'\n" +"INFO:root:Updating 'age' to 20" +msgstr "" + +msgid "The two *Person* instances contain only the private names:" +msgstr "Два екземпляри *Person* містять лише приватні імена:" + +msgid "" +">>> vars(pete)\n" +"{'_name': 'Peter P', '_age': 10}\n" +">>> vars(kate)\n" +"{'_name': 'Catherine C', '_age': 20}" +msgstr "" + +msgid "Closing thoughts" +msgstr "Закриття думок" + +msgid "" +"A :term:`descriptor` is what we call any object that defines :meth:`~object." +"__get__`, :meth:`~object.__set__`, or :meth:`~object.__delete__`." +msgstr "" + +msgid "" +"Optionally, descriptors can have a :meth:`~object.__set_name__` method. " +"This is only used in cases where a descriptor needs to know either the class " +"where it was created or the name of class variable it was assigned to. " +"(This method, if present, is called even if the class is not a descriptor.)" +msgstr "" + +msgid "" +"Descriptors get invoked by the dot operator during attribute lookup. If a " +"descriptor is accessed indirectly with ``vars(some_class)" +"[descriptor_name]``, the descriptor instance is returned without invoking it." +msgstr "" +"Дескриптори викликаються оператором крапки під час пошуку атрибутів. Якщо до " +"дескриптора звертаються опосередковано за допомогою ``vars(some_class)" +"[descriptor_name]``, екземпляр дескриптора повертається без його виклику." + +msgid "" +"Descriptors only work when used as class variables. When put in instances, " +"they have no effect." +msgstr "" +"Дескриптори працюють лише тоді, коли використовуються як змінні класу. Якщо " +"їх поставити в інстанції, вони не мають ефекту." + +msgid "" +"The main motivation for descriptors is to provide a hook allowing objects " +"stored in class variables to control what happens during attribute lookup." +msgstr "" +"Основна мотивація для дескрипторів полягає в тому, щоб надати гачок, який " +"дозволяє об’єктам, що зберігаються у змінних класу, контролювати те, що " +"відбувається під час пошуку атрибутів." + +msgid "" +"Traditionally, the calling class controls what happens during lookup. " +"Descriptors invert that relationship and allow the data being looked-up to " +"have a say in the matter." +msgstr "" +"Традиційно викликаючий клас контролює те, що відбувається під час пошуку. " +"Дескриптори інвертують цей зв’язок і дозволяють шуканим даним мати право " +"голосу в цьому питанні." + +msgid "" +"Descriptors are used throughout the language. It is how functions turn into " +"bound methods. Common tools like :func:`classmethod`, :func:" +"`staticmethod`, :func:`property`, and :func:`functools.cached_property` are " +"all implemented as descriptors." +msgstr "" +"Дескриптори використовуються в усій мові. Саме так функції перетворюються на " +"зв’язані методи. Загальні інструменти, такі як :func:`classmethod`, :func:" +"`staticmethod`, :func:`property` і :func:`functools.cached_property`, усі " +"реалізовані як дескриптори." + +msgid "Complete Practical Example" +msgstr "Повний практичний приклад" + +msgid "" +"In this example, we create a practical and powerful tool for locating " +"notoriously hard to find data corruption bugs." +msgstr "" +"У цьому прикладі ми створюємо практичний і потужний інструмент для виявлення " +"помилок пошкодження даних, які, як відомо, важко знайти." + +msgid "Validator class" +msgstr "Клас валідатора" + +msgid "" +"A validator is a descriptor for managed attribute access. Prior to storing " +"any data, it verifies that the new value meets various type and range " +"restrictions. If those restrictions aren't met, it raises an exception to " +"prevent data corruption at its source." +msgstr "" +"Валідатор — це дескриптор керованого доступу до атрибутів. Перш ніж " +"зберігати будь-які дані, він перевіряє, чи нове значення відповідає різним " +"обмеженням типу та діапазону. Якщо ці обмеження не виконуються, створюється " +"виняток, щоб запобігти пошкодженню даних у їх джерелі." + +msgid "" +"This :class:`!Validator` class is both an :term:`abstract base class` and a " +"managed attribute descriptor:" +msgstr "" + +msgid "" +"from abc import ABC, abstractmethod\n" +"\n" +"class Validator(ABC):\n" +"\n" +" def __set_name__(self, owner, name):\n" +" self.private_name = '_' + name\n" +"\n" +" def __get__(self, obj, objtype=None):\n" +" return getattr(obj, self.private_name)\n" +"\n" +" def __set__(self, obj, value):\n" +" self.validate(value)\n" +" setattr(obj, self.private_name, value)\n" +"\n" +" @abstractmethod\n" +" def validate(self, value):\n" +" pass" +msgstr "" + +msgid "" +"Custom validators need to inherit from :class:`!Validator` and must supply " +"a :meth:`!validate` method to test various restrictions as needed." +msgstr "" + +msgid "Custom validators" +msgstr "Спеціальні валідатори" + +msgid "Here are three practical data validation utilities:" +msgstr "Ось три практичні утиліти перевірки даних:" + +msgid "" +":class:`!OneOf` verifies that a value is one of a restricted set of options." +msgstr "" + +msgid "" +":class:`!Number` verifies that a value is either an :class:`int` or :class:" +"`float`. Optionally, it verifies that a value is between a given minimum or " +"maximum." +msgstr "" + +msgid "" +":class:`!String` verifies that a value is a :class:`str`. Optionally, it " +"validates a given minimum or maximum length. It can validate a user-defined " +"`predicate `_ " +"as well." +msgstr "" + +msgid "" +"class OneOf(Validator):\n" +"\n" +" def __init__(self, *options):\n" +" self.options = set(options)\n" +"\n" +" def validate(self, value):\n" +" if value not in self.options:\n" +" raise ValueError(\n" +" f'Expected {value!r} to be one of {self.options!r}'\n" +" )\n" +"\n" +"class Number(Validator):\n" +"\n" +" def __init__(self, minvalue=None, maxvalue=None):\n" +" self.minvalue = minvalue\n" +" self.maxvalue = maxvalue\n" +"\n" +" def validate(self, value):\n" +" if not isinstance(value, (int, float)):\n" +" raise TypeError(f'Expected {value!r} to be an int or float')\n" +" if self.minvalue is not None and value < self.minvalue:\n" +" raise ValueError(\n" +" f'Expected {value!r} to be at least {self.minvalue!r}'\n" +" )\n" +" if self.maxvalue is not None and value > self.maxvalue:\n" +" raise ValueError(\n" +" f'Expected {value!r} to be no more than {self.maxvalue!r}'\n" +" )\n" +"\n" +"class String(Validator):\n" +"\n" +" def __init__(self, minsize=None, maxsize=None, predicate=None):\n" +" self.minsize = minsize\n" +" self.maxsize = maxsize\n" +" self.predicate = predicate\n" +"\n" +" def validate(self, value):\n" +" if not isinstance(value, str):\n" +" raise TypeError(f'Expected {value!r} to be an str')\n" +" if self.minsize is not None and len(value) < self.minsize:\n" +" raise ValueError(\n" +" f'Expected {value!r} to be no smaller than {self.minsize!" +"r}'\n" +" )\n" +" if self.maxsize is not None and len(value) > self.maxsize:\n" +" raise ValueError(\n" +" f'Expected {value!r} to be no bigger than {self.maxsize!r}'\n" +" )\n" +" if self.predicate is not None and not self.predicate(value):\n" +" raise ValueError(\n" +" f'Expected {self.predicate} to be true for {value!r}'\n" +" )" +msgstr "" + +msgid "Practical application" +msgstr "Практичне застосування" + +msgid "Here's how the data validators can be used in a real class:" +msgstr "Ось як валідатори даних можна використовувати в реальному класі:" + +msgid "" +"class Component:\n" +"\n" +" name = String(minsize=3, maxsize=10, predicate=str.isupper)\n" +" kind = OneOf('wood', 'metal', 'plastic')\n" +" quantity = Number(minvalue=0)\n" +"\n" +" def __init__(self, name, kind, quantity):\n" +" self.name = name\n" +" self.kind = kind\n" +" self.quantity = quantity" +msgstr "" + +msgid "The descriptors prevent invalid instances from being created:" +msgstr "Дескриптори запобігають створенню недійсних екземплярів:" + +msgid "" +">>> Component('Widget', 'metal', 5) # Blocked: 'Widget' is not all " +"uppercase\n" +"Traceback (most recent call last):\n" +" ...\n" +"ValueError: Expected to be true for " +"'Widget'\n" +"\n" +">>> Component('WIDGET', 'metle', 5) # Blocked: 'metle' is misspelled\n" +"Traceback (most recent call last):\n" +" ...\n" +"ValueError: Expected 'metle' to be one of {'metal', 'plastic', 'wood'}\n" +"\n" +">>> Component('WIDGET', 'metal', -5) # Blocked: -5 is negative\n" +"Traceback (most recent call last):\n" +" ...\n" +"ValueError: Expected -5 to be at least 0\n" +"\n" +">>> Component('WIDGET', 'metal', 'V') # Blocked: 'V' isn't a number\n" +"Traceback (most recent call last):\n" +" ...\n" +"TypeError: Expected 'V' to be an int or float\n" +"\n" +">>> c = Component('WIDGET', 'metal', 5) # Allowed: The inputs are valid" +msgstr "" + +msgid "Technical Tutorial" +msgstr "Технічний підручник" + +msgid "" +"What follows is a more technical tutorial for the mechanics and details of " +"how descriptors work." +msgstr "" +"Далі є більш технічний підручник для механіки та деталей роботи дескрипторів." + +msgid "Abstract" +msgstr "Анотація" + +msgid "" +"Defines descriptors, summarizes the protocol, and shows how descriptors are " +"called. Provides an example showing how object relational mappings work." +msgstr "" +"Визначає дескриптори, підсумовує протокол і показує, як викликаються " +"дескриптори. Надає приклад, який показує, як працюють об’єктно-реляційні " +"відображення." + +msgid "" +"Learning about descriptors not only provides access to a larger toolset, it " +"creates a deeper understanding of how Python works." +msgstr "" +"Вивчення дескрипторів не тільки забезпечує доступ до більшого набору " +"інструментів, це створює глибше розуміння того, як працює Python." + +msgid "Definition and introduction" +msgstr "Визначення та вступ" + +msgid "" +"In general, a descriptor is an attribute value that has one of the methods " +"in the descriptor protocol. Those methods are :meth:`~object.__get__`, :" +"meth:`~object.__set__`, and :meth:`~object.__delete__`. If any of those " +"methods are defined for an attribute, it is said to be a :term:`descriptor`." +msgstr "" + +msgid "" +"The default behavior for attribute access is to get, set, or delete the " +"attribute from an object's dictionary. For instance, ``a.x`` has a lookup " +"chain starting with ``a.__dict__['x']``, then ``type(a).__dict__['x']``, and " +"continuing through the method resolution order of ``type(a)``. If the looked-" +"up value is an object defining one of the descriptor methods, then Python " +"may override the default behavior and invoke the descriptor method instead. " +"Where this occurs in the precedence chain depends on which descriptor " +"methods were defined." +msgstr "" +"Поведінка за умовчанням для доступу до атрибутів полягає в отриманні, " +"установці або видаленні атрибута зі словника об’єкта. Наприклад, ``a.x`` має " +"ланцюжок пошуку, починаючи з ``a.__dict__['x']``, потім ``type(a)." +"__dict__['x']`` і продовжуючи через дозвіл методу порядок ``type(a)``. Якщо " +"шукане значення є об’єктом, що визначає один із методів дескриптора, тоді " +"Python може замінити поведінку за замовчуванням і замість цього викликати " +"метод дескриптора. Де це відбувається в ланцюжку пріоритетів, залежить від " +"того, які методи дескриптора були визначені." + +msgid "" +"Descriptors are a powerful, general purpose protocol. They are the " +"mechanism behind properties, methods, static methods, class methods, and :" +"func:`super`. They are used throughout Python itself. Descriptors simplify " +"the underlying C code and offer a flexible set of new tools for everyday " +"Python programs." +msgstr "" + +msgid "Descriptor protocol" +msgstr "Дескрипторний протокол" + +msgid "``descr.__get__(self, obj, type=None)``" +msgstr "" + +msgid "``descr.__set__(self, obj, value)``" +msgstr "" + +msgid "``descr.__delete__(self, obj)``" +msgstr "" + +msgid "" +"That is all there is to it. Define any of these methods and an object is " +"considered a descriptor and can override default behavior upon being looked " +"up as an attribute." +msgstr "" +"Це все. Визначте будь-який із цих методів, і об’єкт вважатиметься " +"дескриптором і зможе замінити поведінку за замовчуванням, якщо його шукати " +"як атрибут." + +msgid "" +"If an object defines :meth:`~object.__set__` or :meth:`~object.__delete__`, " +"it is considered a data descriptor. Descriptors that only define :meth:" +"`~object.__get__` are called non-data descriptors (they are often used for " +"methods but other uses are possible)." +msgstr "" + +msgid "" +"Data and non-data descriptors differ in how overrides are calculated with " +"respect to entries in an instance's dictionary. If an instance's dictionary " +"has an entry with the same name as a data descriptor, the data descriptor " +"takes precedence. If an instance's dictionary has an entry with the same " +"name as a non-data descriptor, the dictionary entry takes precedence." +msgstr "" +"Дескриптори даних і не даних відрізняються тим, як обчислюються " +"перевизначення щодо записів у словнику екземпляра. Якщо в словнику " +"екземпляра є запис із таким самим іменем, як і дескриптор даних, дескриптор " +"даних має пріоритет. Якщо в словнику екземпляра є запис із таким же ім’ям, " +"що й дескриптор, що не є даними, пріоритет має словниковий запис." + +msgid "" +"To make a read-only data descriptor, define both :meth:`~object.__get__` " +"and :meth:`~object.__set__` with the :meth:`~object.__set__` raising an :exc:" +"`AttributeError` when called. Defining the :meth:`~object.__set__` method " +"with an exception raising placeholder is enough to make it a data descriptor." +msgstr "" + +msgid "Overview of descriptor invocation" +msgstr "Огляд виклику дескриптора" + +msgid "" +"A descriptor can be called directly with ``desc.__get__(obj)`` or ``desc." +"__get__(None, cls)``." +msgstr "" +"Дескриптор можна викликати безпосередньо за допомогою ``desc.__get__(obj)`` " +"або ``desc.__get__(None, cls)``." + +msgid "" +"But it is more common for a descriptor to be invoked automatically from " +"attribute access." +msgstr "" +"Але частіше дескриптор викликається автоматично з доступу до атрибутів." + +msgid "" +"The expression ``obj.x`` looks up the attribute ``x`` in the chain of " +"namespaces for ``obj``. If the search finds a descriptor outside of the " +"instance :attr:`~object.__dict__`, its :meth:`~object.__get__` method is " +"invoked according to the precedence rules listed below." +msgstr "" + +msgid "" +"The details of invocation depend on whether ``obj`` is an object, class, or " +"instance of super." +msgstr "" +"Деталі виклику залежать від того, чи є ``obj`` об'єктом, класом або " +"екземпляром super." + +msgid "Invocation from an instance" +msgstr "Виклик із екземпляра" + +msgid "" +"Instance lookup scans through a chain of namespaces giving data descriptors " +"the highest priority, followed by instance variables, then non-data " +"descriptors, then class variables, and lastly :meth:`~object.__getattr__` if " +"it is provided." +msgstr "" + +msgid "" +"If a descriptor is found for ``a.x``, then it is invoked with: ``desc." +"__get__(a, type(a))``." +msgstr "" +"Якщо для ``a.x`` знайдено дескриптор, він викликається за допомогою: ``desc." +"__get__(a, type(a))``." + +msgid "" +"The logic for a dotted lookup is in :meth:`object.__getattribute__`. Here " +"is a pure Python equivalent:" +msgstr "" +"Логіка пошуку з пунктиром міститься в :meth:`object.__getattribute__`. Ось " +"чистий еквівалент Python:" + +msgid "" +"def find_name_in_mro(cls, name, default):\n" +" \"Emulate _PyType_Lookup() in Objects/typeobject.c\"\n" +" for base in cls.__mro__:\n" +" if name in vars(base):\n" +" return vars(base)[name]\n" +" return default\n" +"\n" +"def object_getattribute(obj, name):\n" +" \"Emulate PyObject_GenericGetAttr() in Objects/object.c\"\n" +" null = object()\n" +" objtype = type(obj)\n" +" cls_var = find_name_in_mro(objtype, name, null)\n" +" descr_get = getattr(type(cls_var), '__get__', null)\n" +" if descr_get is not null:\n" +" if (hasattr(type(cls_var), '__set__')\n" +" or hasattr(type(cls_var), '__delete__')):\n" +" return descr_get(cls_var, obj, objtype) # data descriptor\n" +" if hasattr(obj, '__dict__') and name in vars(obj):\n" +" return vars(obj)[name] # instance variable\n" +" if descr_get is not null:\n" +" return descr_get(cls_var, obj, objtype) # non-data " +"descriptor\n" +" if cls_var is not null:\n" +" return cls_var # class variable\n" +" raise AttributeError(name)" +msgstr "" + +msgid "" +"Note, there is no :meth:`~object.__getattr__` hook in the :meth:`~object." +"__getattribute__` code. That is why calling :meth:`~object." +"__getattribute__` directly or with ``super().__getattribute__`` will bypass :" +"meth:`~object.__getattr__` entirely." +msgstr "" + +msgid "" +"Instead, it is the dot operator and the :func:`getattr` function that are " +"responsible for invoking :meth:`~object.__getattr__` whenever :meth:`~object." +"__getattribute__` raises an :exc:`AttributeError`. Their logic is " +"encapsulated in a helper function:" +msgstr "" + +msgid "" +"def getattr_hook(obj, name):\n" +" \"Emulate slot_tp_getattr_hook() in Objects/typeobject.c\"\n" +" try:\n" +" return obj.__getattribute__(name)\n" +" except AttributeError:\n" +" if not hasattr(type(obj), '__getattr__'):\n" +" raise\n" +" return type(obj).__getattr__(obj, name) # __getattr__" +msgstr "" + +msgid "Invocation from a class" +msgstr "Виклик із класу" + +msgid "" +"The logic for a dotted lookup such as ``A.x`` is in :meth:`!type." +"__getattribute__`. The steps are similar to those for :meth:`!object." +"__getattribute__` but the instance dictionary lookup is replaced by a search " +"through the class's :term:`method resolution order`." +msgstr "" + +msgid "If a descriptor is found, it is invoked with ``desc.__get__(None, A)``." +msgstr "" +"Якщо дескриптор знайдено, він викликається за допомогою ``desc.__get__(None, " +"A)``." + +msgid "" +"The full C implementation can be found in :c:func:`!type_getattro` and :c:" +"func:`!_PyType_Lookup` in :source:`Objects/typeobject.c`." +msgstr "" + +msgid "Invocation from super" +msgstr "Заклик від супер" + +msgid "" +"The logic for super's dotted lookup is in the :meth:`~object." +"__getattribute__` method for object returned by :func:`super`." +msgstr "" + +msgid "" +"A dotted lookup such as ``super(A, obj).m`` searches ``obj.__class__." +"__mro__`` for the base class ``B`` immediately following ``A`` and then " +"returns ``B.__dict__['m'].__get__(obj, A)``. If not a descriptor, ``m`` is " +"returned unchanged." +msgstr "" +"Пошук із пунктиром, наприклад ``super(A, obj).m``, шукає ``obj.__class__." +"__mro__`` для базового класу ``B`` відразу після ``A``, а потім повертає " +"``B\". __dict__['m'].__get__(obj, A)``. Якщо не є дескриптором, ``m`` " +"повертається без змін." + +msgid "" +"The full C implementation can be found in :c:func:`!super_getattro` in :" +"source:`Objects/typeobject.c`. A pure Python equivalent can be found in " +"`Guido's Tutorial `_." +msgstr "" + +msgid "Summary of invocation logic" +msgstr "Короткий опис логіки виклику" + +msgid "" +"The mechanism for descriptors is embedded in the :meth:`~object." +"__getattribute__` methods for :class:`object`, :class:`type`, and :func:" +"`super`." +msgstr "" + +msgid "The important points to remember are:" +msgstr "Важливо пам’ятати:" + +msgid "Descriptors are invoked by the :meth:`~object.__getattribute__` method." +msgstr "" + +msgid "" +"Classes inherit this machinery from :class:`object`, :class:`type`, or :func:" +"`super`." +msgstr "" +"Класи успадковують цей механізм від :class:`object`, :class:`type` або :func:" +"`super`." + +msgid "" +"Overriding :meth:`~object.__getattribute__` prevents automatic descriptor " +"calls because all the descriptor logic is in that method." +msgstr "" + +msgid "" +":meth:`!object.__getattribute__` and :meth:`!type.__getattribute__` make " +"different calls to :meth:`~object.__get__`. The first includes the instance " +"and may include the class. The second puts in ``None`` for the instance and " +"always includes the class." +msgstr "" + +msgid "Data descriptors always override instance dictionaries." +msgstr "Дескриптори даних завжди перевизначають словники примірників." + +msgid "Non-data descriptors may be overridden by instance dictionaries." +msgstr "" +"Дескриптори, не пов’язані з даними, можуть бути перевизначені словниками " +"примірників." + +msgid "Automatic name notification" +msgstr "Автоматичне сповіщення про ім'я" + +msgid "" +"Sometimes it is desirable for a descriptor to know what class variable name " +"it was assigned to. When a new class is created, the :class:`type` " +"metaclass scans the dictionary of the new class. If any of the entries are " +"descriptors and if they define :meth:`~object.__set_name__`, that method is " +"called with two arguments. The *owner* is the class where the descriptor is " +"used, and the *name* is the class variable the descriptor was assigned to." +msgstr "" + +msgid "" +"The implementation details are in :c:func:`!type_new` and :c:func:`!" +"set_names` in :source:`Objects/typeobject.c`." +msgstr "" + +msgid "" +"Since the update logic is in :meth:`!type.__new__`, notifications only take " +"place at the time of class creation. If descriptors are added to the class " +"afterwards, :meth:`~object.__set_name__` will need to be called manually." +msgstr "" + +msgid "ORM example" +msgstr "Приклад ORM" + +msgid "" +"The following code is a simplified skeleton showing how data descriptors " +"could be used to implement an `object relational mapping `_." +msgstr "" + +msgid "" +"The essential idea is that the data is stored in an external database. The " +"Python instances only hold keys to the database's tables. Descriptors take " +"care of lookups or updates:" +msgstr "" +"Основна ідея полягає в тому, що дані зберігаються у зовнішній базі даних. " +"Екземпляри Python містять лише ключі до таблиць бази даних. Дескриптори " +"піклуються про пошук або оновлення:" + +msgid "" +"class Field:\n" +"\n" +" def __set_name__(self, owner, name):\n" +" self.fetch = f'SELECT {name} FROM {owner.table} WHERE {owner.key}" +"=?;'\n" +" self.store = f'UPDATE {owner.table} SET {name}=? WHERE {owner.key}" +"=?;'\n" +"\n" +" def __get__(self, obj, objtype=None):\n" +" return conn.execute(self.fetch, [obj.key]).fetchone()[0]\n" +"\n" +" def __set__(self, obj, value):\n" +" conn.execute(self.store, [value, obj.key])\n" +" conn.commit()" +msgstr "" + +msgid "" +"We can use the :class:`!Field` class to define `models `_ that describe the schema for each table in a " +"database:" +msgstr "" + +msgid "" +"class Movie:\n" +" table = 'Movies' # Table name\n" +" key = 'title' # Primary key\n" +" director = Field()\n" +" year = Field()\n" +"\n" +" def __init__(self, key):\n" +" self.key = key\n" +"\n" +"class Song:\n" +" table = 'Music'\n" +" key = 'title'\n" +" artist = Field()\n" +" year = Field()\n" +" genre = Field()\n" +"\n" +" def __init__(self, key):\n" +" self.key = key" +msgstr "" + +msgid "To use the models, first connect to the database::" +msgstr "Щоб використовувати моделі, спочатку підключіться до бази даних:" + +msgid "" +">>> import sqlite3\n" +">>> conn = sqlite3.connect('entertainment.db')" +msgstr "" + +msgid "" +"An interactive session shows how data is retrieved from the database and how " +"it can be updated:" +msgstr "" +"Інтерактивний сеанс показує, як дані витягуються з бази даних і як їх можна " +"оновити:" + +msgid "" +">>> Movie('Star Wars').director\n" +"'George Lucas'\n" +">>> jaws = Movie('Jaws')\n" +">>> f'Released in {jaws.year} by {jaws.director}'\n" +"'Released in 1975 by Steven Spielberg'\n" +"\n" +">>> Song('Country Roads').artist\n" +"'John Denver'\n" +"\n" +">>> Movie('Star Wars').director = 'J.J. Abrams'\n" +">>> Movie('Star Wars').director\n" +"'J.J. Abrams'" +msgstr "" + +msgid "Pure Python Equivalents" +msgstr "Чисті еквіваленти Python" + +msgid "" +"The descriptor protocol is simple and offers exciting possibilities. " +"Several use cases are so common that they have been prepackaged into built-" +"in tools. Properties, bound methods, static methods, class methods, and " +"\\_\\_slots\\_\\_ are all based on the descriptor protocol." +msgstr "" +"Протокол дескриптора простий і пропонує захоплюючі можливості. Кілька " +"варіантів використання настільки поширені, що вони були попередньо упаковані " +"у вбудовані інструменти. Властивості, прив’язані методи, статичні методи, " +"методи класу та \\_\\_слоти\\_\\_ базуються на протоколі дескриптора." + +msgid "Properties" +msgstr "Властивості" + +msgid "" +"Calling :func:`property` is a succinct way of building a data descriptor " +"that triggers a function call upon access to an attribute. Its signature " +"is::" +msgstr "" +"Виклик :func:`property` — це короткий спосіб створення дескриптора даних, " +"який ініціює виклик функції після доступу до атрибута. Його підпис::" + +msgid "property(fget=None, fset=None, fdel=None, doc=None) -> property" +msgstr "" + +msgid "" +"The documentation shows a typical use to define a managed attribute ``x``:" +msgstr "" +"У документації показано типове використання для визначення керованого " +"атрибута ``x``:" + +msgid "" +"class C:\n" +" def getx(self): return self.__x\n" +" def setx(self, value): self.__x = value\n" +" def delx(self): del self.__x\n" +" x = property(getx, setx, delx, \"I'm the 'x' property.\")" +msgstr "" + +msgid "" +"To see how :func:`property` is implemented in terms of the descriptor " +"protocol, here is a pure Python equivalent that implements most of the core " +"functionality:" +msgstr "" + +msgid "" +"class Property:\n" +" \"Emulate PyProperty_Type() in Objects/descrobject.c\"\n" +"\n" +" def __init__(self, fget=None, fset=None, fdel=None, doc=None):\n" +" self.fget = fget\n" +" self.fset = fset\n" +" self.fdel = fdel\n" +" if doc is None and fget is not None:\n" +" doc = fget.__doc__\n" +" self.__doc__ = doc\n" +"\n" +" def __set_name__(self, owner, name):\n" +" self.__name__ = name\n" +"\n" +" def __get__(self, obj, objtype=None):\n" +" if obj is None:\n" +" return self\n" +" if self.fget is None:\n" +" raise AttributeError\n" +" return self.fget(obj)\n" +"\n" +" def __set__(self, obj, value):\n" +" if self.fset is None:\n" +" raise AttributeError\n" +" self.fset(obj, value)\n" +"\n" +" def __delete__(self, obj):\n" +" if self.fdel is None:\n" +" raise AttributeError\n" +" self.fdel(obj)\n" +"\n" +" def getter(self, fget):\n" +" return type(self)(fget, self.fset, self.fdel, self.__doc__)\n" +"\n" +" def setter(self, fset):\n" +" return type(self)(self.fget, fset, self.fdel, self.__doc__)\n" +"\n" +" def deleter(self, fdel):\n" +" return type(self)(self.fget, self.fset, fdel, self.__doc__)" +msgstr "" + +msgid "" +"The :func:`property` builtin helps whenever a user interface has granted " +"attribute access and then subsequent changes require the intervention of a " +"method." +msgstr "" +"Вбудована функція :func:`property` допомагає щоразу, коли інтерфейс " +"користувача надає доступ до атрибутів, а подальші зміни вимагають втручання " +"методу." + +msgid "" +"For instance, a spreadsheet class may grant access to a cell value through " +"``Cell('b10').value``. Subsequent improvements to the program require the " +"cell to be recalculated on every access; however, the programmer does not " +"want to affect existing client code accessing the attribute directly. The " +"solution is to wrap access to the value attribute in a property data " +"descriptor:" +msgstr "" +"Наприклад, клас електронної таблиці може надати доступ до значення клітинки " +"через ``Cell('b10').value``. Подальші вдосконалення програми вимагають " +"перерахунку комірки при кожному доступі; однак програміст не хоче впливати " +"на існуючий клієнтський код, який безпосередньо звертається до атрибута. " +"Рішення полягає в тому, щоб загорнути доступ до атрибута значення в " +"дескриптор даних властивості:" + +msgid "" +"class Cell:\n" +" ...\n" +"\n" +" @property\n" +" def value(self):\n" +" \"Recalculate the cell before returning value\"\n" +" self.recalc()\n" +" return self._value" +msgstr "" + +msgid "" +"Either the built-in :func:`property` or our :func:`!Property` equivalent " +"would work in this example." +msgstr "" + +msgid "Functions and methods" +msgstr "Функції та методи" + +msgid "" +"Python's object oriented features are built upon a function based " +"environment. Using non-data descriptors, the two are merged seamlessly." +msgstr "" +"Об’єктно-орієнтовані функції Python побудовані на функціональному " +"середовищі. Використовуючи дескриптори, не пов’язані з даними, ці два " +"об’єднуються без проблем." + +msgid "" +"Functions stored in class dictionaries get turned into methods when invoked. " +"Methods only differ from regular functions in that the object instance is " +"prepended to the other arguments. By convention, the instance is called " +"*self* but could be called *this* or any other variable name." +msgstr "" +"Функції, що зберігаються в словниках класів, під час виклику перетворюються " +"на методи. Методи відрізняються від звичайних функцій лише тим, що екземпляр " +"об’єкта додається до інших аргументів. За домовленістю екземпляр називається " +"*self*, але може мати назву *this* або будь-яке інше ім’я змінної." + +msgid "" +"Methods can be created manually with :class:`types.MethodType` which is " +"roughly equivalent to:" +msgstr "" +"Методи можна створити вручну за допомогою :class:`types.MethodType`, що " +"приблизно еквівалентно:" + +msgid "" +"class MethodType:\n" +" \"Emulate PyMethod_Type in Objects/classobject.c\"\n" +"\n" +" def __init__(self, func, obj):\n" +" self.__func__ = func\n" +" self.__self__ = obj\n" +"\n" +" def __call__(self, *args, **kwargs):\n" +" func = self.__func__\n" +" obj = self.__self__\n" +" return func(obj, *args, **kwargs)\n" +"\n" +" def __getattribute__(self, name):\n" +" \"Emulate method_getset() in Objects/classobject.c\"\n" +" if name == '__doc__':\n" +" return self.__func__.__doc__\n" +" return object.__getattribute__(self, name)\n" +"\n" +" def __getattr__(self, name):\n" +" \"Emulate method_getattro() in Objects/classobject.c\"\n" +" return getattr(self.__func__, name)\n" +"\n" +" def __get__(self, obj, objtype=None):\n" +" \"Emulate method_descr_get() in Objects/classobject.c\"\n" +" return self" +msgstr "" + +msgid "" +"To support automatic creation of methods, functions include the :meth:" +"`~object.__get__` method for binding methods during attribute access. This " +"means that functions are non-data descriptors that return bound methods " +"during dotted lookup from an instance. Here's how it works:" +msgstr "" + +msgid "" +"class Function:\n" +" ...\n" +"\n" +" def __get__(self, obj, objtype=None):\n" +" \"Simulate func_descr_get() in Objects/funcobject.c\"\n" +" if obj is None:\n" +" return self\n" +" return MethodType(self, obj)" +msgstr "" + +msgid "" +"Running the following class in the interpreter shows how the function " +"descriptor works in practice:" +msgstr "" +"Запуск наступного класу в інтерпретаторі показує, як дескриптор функції " +"працює на практиці:" + +msgid "" +"class D:\n" +" def f(self):\n" +" return self\n" +"\n" +"class D2:\n" +" pass" +msgstr "" + +msgid "" +"The function has a :term:`qualified name` attribute to support introspection:" +msgstr "Функція має атрибут :term:`qualified name` для підтримки самоаналізу:" + +msgid "" +">>> D.f.__qualname__\n" +"'D.f'" +msgstr "" + +msgid "" +"Accessing the function through the class dictionary does not invoke :meth:" +"`~object.__get__`. Instead, it just returns the underlying function object::" +msgstr "" + +msgid "" +">>> D.__dict__['f']\n" +"" +msgstr "" + +msgid "" +"Dotted access from a class calls :meth:`~object.__get__` which just returns " +"the underlying function unchanged::" +msgstr "" + +msgid "" +">>> D.f\n" +"" +msgstr "" + +msgid "" +"The interesting behavior occurs during dotted access from an instance. The " +"dotted lookup calls :meth:`~object.__get__` which returns a bound method " +"object::" +msgstr "" + +msgid "" +">>> d = D()\n" +">>> d.f\n" +">" +msgstr "" + +msgid "" +"Internally, the bound method stores the underlying function and the bound " +"instance::" +msgstr "" +"Внутрішньо зв’язаний метод зберігає базову функцію та зв’язаний екземпляр::" + +msgid "" +">>> d.f.__func__\n" +"\n" +"\n" +">>> d.f.__self__\n" +"<__main__.D object at 0x00B18C90>" +msgstr "" + +msgid "" +"If you have ever wondered where *self* comes from in regular methods or " +"where *cls* comes from in class methods, this is it!" +msgstr "" +"Якщо ви коли-небудь задавалися питанням, звідки береться *self* у звичайних " +"методах або звідки *cls* у методах класу, то це все!" + +msgid "Kinds of methods" +msgstr "Види методів" + +msgid "" +"Non-data descriptors provide a simple mechanism for variations on the usual " +"patterns of binding functions into methods." +msgstr "" +"Дескриптори, не пов’язані з даними, надають простий механізм для варіацій " +"звичайних шаблонів зв’язування функцій у методи." + +msgid "" +"To recap, functions have a :meth:`~object.__get__` method so that they can " +"be converted to a method when accessed as attributes. The non-data " +"descriptor transforms an ``obj.f(*args)`` call into ``f(obj, *args)``. " +"Calling ``cls.f(*args)`` becomes ``f(*args)``." +msgstr "" + +msgid "This chart summarizes the binding and its two most useful variants:" +msgstr "Ця діаграма підсумовує прив’язку та два її найкорисніші варіанти:" + +msgid "Transformation" +msgstr "Трансформація" + +msgid "Called from an object" +msgstr "Викликано з об'єкта" + +msgid "Called from a class" +msgstr "Подзвонили з класу" + +msgid "function" +msgstr "функція" + +msgid "f(obj, \\*args)" +msgstr "f(obj, \\*args)" + +msgid "f(\\*args)" +msgstr "f(\\*args)" + +msgid "staticmethod" +msgstr "статичний метод" + +msgid "classmethod" +msgstr "метод класу" + +msgid "f(type(obj), \\*args)" +msgstr "f(type(obj), \\*args)" + +msgid "f(cls, \\*args)" +msgstr "f(cls, \\*args)" + +msgid "Static methods" +msgstr "Статичні методи" + +msgid "" +"Static methods return the underlying function without changes. Calling " +"either ``c.f`` or ``C.f`` is the equivalent of a direct lookup into ``object." +"__getattribute__(c, \"f\")`` or ``object.__getattribute__(C, \"f\")``. As a " +"result, the function becomes identically accessible from either an object or " +"a class." +msgstr "" +"Статичні методи повертають базову функцію без змін. Виклик ``c.f`` або ``C." +"f`` є еквівалентом прямого пошуку ``object.__getattribute__(c, \"f\")`` або " +"``object.__getattribute__(C, \"f\")`` . У результаті функція стає однаково " +"доступною з об’єкта або класу." + +msgid "" +"Good candidates for static methods are methods that do not reference the " +"``self`` variable." +msgstr "" +"Хорошими кандидатами на статичні методи є методи, які не посилаються на " +"змінну ``self``." + +msgid "" +"For instance, a statistics package may include a container class for " +"experimental data. The class provides normal methods for computing the " +"average, mean, median, and other descriptive statistics that depend on the " +"data. However, there may be useful functions which are conceptually related " +"but do not depend on the data. For instance, ``erf(x)`` is handy conversion " +"routine that comes up in statistical work but does not directly depend on a " +"particular dataset. It can be called either from an object or the class: " +"``s.erf(1.5) --> 0.9332`` or ``Sample.erf(1.5) --> 0.9332``." +msgstr "" + +msgid "" +"Since static methods return the underlying function with no changes, the " +"example calls are unexciting:" +msgstr "" +"Оскільки статичні методи повертають базову функцію без змін, приклади " +"викликів нецікаві:" + +msgid "" +"class E:\n" +" @staticmethod\n" +" def f(x):\n" +" return x * 10" +msgstr "" + +msgid "" +">>> E.f(3)\n" +"30\n" +">>> E().f(3)\n" +"30" +msgstr "" + +msgid "" +"Using the non-data descriptor protocol, a pure Python version of :func:" +"`staticmethod` would look like this:" +msgstr "" +"Використовуючи протокол дескриптора без даних, чиста версія :func:" +"`staticmethod` на Python виглядала б так:" + +msgid "" +"import functools\n" +"\n" +"class StaticMethod:\n" +" \"Emulate PyStaticMethod_Type() in Objects/funcobject.c\"\n" +"\n" +" def __init__(self, f):\n" +" self.f = f\n" +" functools.update_wrapper(self, f)\n" +"\n" +" def __get__(self, obj, objtype=None):\n" +" return self.f\n" +"\n" +" def __call__(self, *args, **kwds):\n" +" return self.f(*args, **kwds)" +msgstr "" + +msgid "" +"The :func:`functools.update_wrapper` call adds a ``__wrapped__`` attribute " +"that refers to the underlying function. Also it carries forward the " +"attributes necessary to make the wrapper look like the wrapped function: :" +"attr:`~function.__name__`, :attr:`~function.__qualname__`, :attr:`~function." +"__doc__`, and :attr:`~function.__annotations__`." +msgstr "" + +msgid "Class methods" +msgstr "Методи класу" + +msgid "" +"Unlike static methods, class methods prepend the class reference to the " +"argument list before calling the function. This format is the same for " +"whether the caller is an object or a class:" +msgstr "" +"На відміну від статичних методів, методи класу додають посилання на клас до " +"списку аргументів перед викликом функції. Цей формат є однаковим для того, " +"чи є викликаючий об’єкт чи клас:" + +msgid "" +"class F:\n" +" @classmethod\n" +" def f(cls, x):\n" +" return cls.__name__, x" +msgstr "" + +msgid "" +">>> F.f(3)\n" +"('F', 3)\n" +">>> F().f(3)\n" +"('F', 3)" +msgstr "" + +msgid "" +"This behavior is useful whenever the method only needs to have a class " +"reference and does not rely on data stored in a specific instance. One use " +"for class methods is to create alternate class constructors. For example, " +"the classmethod :func:`dict.fromkeys` creates a new dictionary from a list " +"of keys. The pure Python equivalent is:" +msgstr "" +"Така поведінка корисна, коли метод потребує лише посилання на клас і не " +"покладається на дані, що зберігаються в конкретному екземплярі. Одним із " +"способів використання методів класу є створення альтернативних конструкторів " +"класу. Наприклад, метод класу :func:`dict.fromkeys` створює новий словник зі " +"списку ключів. Чистий еквівалент Python:" + +msgid "" +"class Dict(dict):\n" +" @classmethod\n" +" def fromkeys(cls, iterable, value=None):\n" +" \"Emulate dict_fromkeys() in Objects/dictobject.c\"\n" +" d = cls()\n" +" for key in iterable:\n" +" d[key] = value\n" +" return d" +msgstr "" + +msgid "Now a new dictionary of unique keys can be constructed like this:" +msgstr "Тепер новий словник унікальних ключів можна сконструювати так:" + +msgid "" +">>> d = Dict.fromkeys('abracadabra')\n" +">>> type(d) is Dict\n" +"True\n" +">>> d\n" +"{'a': None, 'b': None, 'r': None, 'c': None, 'd': None}" +msgstr "" + +msgid "" +"Using the non-data descriptor protocol, a pure Python version of :func:" +"`classmethod` would look like this:" +msgstr "" +"Використовуючи протокол дескриптора без даних, чиста версія :func:" +"`classmethod` на Python виглядала б так:" + +msgid "" +"import functools\n" +"\n" +"class ClassMethod:\n" +" \"Emulate PyClassMethod_Type() in Objects/funcobject.c\"\n" +"\n" +" def __init__(self, f):\n" +" self.f = f\n" +" functools.update_wrapper(self, f)\n" +"\n" +" def __get__(self, obj, cls=None):\n" +" if cls is None:\n" +" cls = type(obj)\n" +" return MethodType(self.f, cls)" +msgstr "" + +msgid "" +"The :func:`functools.update_wrapper` call in ``ClassMethod`` adds a " +"``__wrapped__`` attribute that refers to the underlying function. Also it " +"carries forward the attributes necessary to make the wrapper look like the " +"wrapped function: :attr:`~function.__name__`, :attr:`~function." +"__qualname__`, :attr:`~function.__doc__`, and :attr:`~function." +"__annotations__`." +msgstr "" + +msgid "Member objects and __slots__" +msgstr "Об'єкти-члени та __slots__" + +msgid "" +"When a class defines ``__slots__``, it replaces instance dictionaries with a " +"fixed-length array of slot values. From a user point of view that has " +"several effects:" +msgstr "" +"Коли клас визначає ``__slots__``, він замінює словники примірників на масив " +"значень слотів фіксованої довжини. З точки зору користувача, це має кілька " +"ефектів:" + +msgid "" +"1. Provides immediate detection of bugs due to misspelled attribute " +"assignments. Only attribute names specified in ``__slots__`` are allowed:" +msgstr "" +"1. Забезпечує негайне виявлення помилок через неправильно написані атрибути. " +"Дозволяються лише імена атрибутів, указані в ``__slots__``:" + +msgid "" +"class Vehicle:\n" +" __slots__ = ('id_number', 'make', 'model')" +msgstr "" + +msgid "" +">>> auto = Vehicle()\n" +">>> auto.id_nubmer = 'VYE483814LQEX'\n" +"Traceback (most recent call last):\n" +" ...\n" +"AttributeError: 'Vehicle' object has no attribute 'id_nubmer'" +msgstr "" + +msgid "" +"2. Helps create immutable objects where descriptors manage access to private " +"attributes stored in ``__slots__``:" +msgstr "" +"2. Допомагає створювати незмінні об’єкти, де дескриптори керують доступом до " +"приватних атрибутів, що зберігаються в ``__slots__``:" + +msgid "" +"class Immutable:\n" +"\n" +" __slots__ = ('_dept', '_name') # Replace the instance " +"dictionary\n" +"\n" +" def __init__(self, dept, name):\n" +" self._dept = dept # Store to private attribute\n" +" self._name = name # Store to private attribute\n" +"\n" +" @property # Read-only descriptor\n" +" def dept(self):\n" +" return self._dept\n" +"\n" +" @property\n" +" def name(self): # Read-only descriptor\n" +" return self._name" +msgstr "" + +msgid "" +">>> mark = Immutable('Botany', 'Mark Watney')\n" +">>> mark.dept\n" +"'Botany'\n" +">>> mark.dept = 'Space Pirate'\n" +"Traceback (most recent call last):\n" +" ...\n" +"AttributeError: property 'dept' of 'Immutable' object has no setter\n" +">>> mark.location = 'Mars'\n" +"Traceback (most recent call last):\n" +" ...\n" +"AttributeError: 'Immutable' object has no attribute 'location'" +msgstr "" + +msgid "" +"3. Saves memory. On a 64-bit Linux build, an instance with two attributes " +"takes 48 bytes with ``__slots__`` and 152 bytes without. This `flyweight " +"design pattern `_ likely " +"only matters when a large number of instances are going to be created." +msgstr "" +"3. Економить пам'ять. У 64-розрядній збірці Linux екземпляр із двома " +"атрибутами займає 48 байтів із ``__slots__`` і 152 байти без. Цей `шаблон " +"проектування легкої ваги `_, ймовірно, має значення лише тоді, коли буде створено " +"велику кількість екземплярів." + +msgid "" +"4. Improves speed. Reading instance variables is 35% faster with " +"``__slots__`` (as measured with Python 3.10 on an Apple M1 processor)." +msgstr "" +"4. Покращує швидкість. Читання змінних екземплярів відбувається на 35% " +"швидше за допомогою ``__slots__`` (виміряно за допомогою Python 3.10 на " +"процесорі Apple M1)." + +msgid "" +"5. Blocks tools like :func:`functools.cached_property` which require an " +"instance dictionary to function correctly:" +msgstr "" +"5. Блокує такі інструменти, як :func:`functools.cached_property`, яким для " +"коректної роботи потрібен словник екземплярів:" + +msgid "" +"from functools import cached_property\n" +"\n" +"class CP:\n" +" __slots__ = () # Eliminates the instance dict\n" +"\n" +" @cached_property # Requires an instance dict\n" +" def pi(self):\n" +" return 4 * sum((-1.0)**n / (2.0*n + 1.0)\n" +" for n in reversed(range(100_000)))" +msgstr "" + +msgid "" +">>> CP().pi\n" +"Traceback (most recent call last):\n" +" ...\n" +"TypeError: No '__dict__' attribute on 'CP' instance to cache 'pi' property." +msgstr "" + +msgid "" +"It is not possible to create an exact drop-in pure Python version of " +"``__slots__`` because it requires direct access to C structures and control " +"over object memory allocation. However, we can build a mostly faithful " +"simulation where the actual C structure for slots is emulated by a private " +"``_slotvalues`` list. Reads and writes to that private structure are " +"managed by member descriptors:" +msgstr "" +"Неможливо створити точну версію ``__slots__`` на Python, оскільки для цього " +"потрібен прямий доступ до структур C і контроль над розподілом пам’яті " +"об’єктів. Однак ми можемо побудувати здебільшого точну симуляцію, де " +"фактична структура C для слотів емулюється приватним списком " +"``_slotvalues``. Читанням і записом у цю приватну структуру керують " +"дескриптори членів:" + +msgid "" +"null = object()\n" +"\n" +"class Member:\n" +"\n" +" def __init__(self, name, clsname, offset):\n" +" 'Emulate PyMemberDef in Include/structmember.h'\n" +" # Also see descr_new() in Objects/descrobject.c\n" +" self.name = name\n" +" self.clsname = clsname\n" +" self.offset = offset\n" +"\n" +" def __get__(self, obj, objtype=None):\n" +" 'Emulate member_get() in Objects/descrobject.c'\n" +" # Also see PyMember_GetOne() in Python/structmember.c\n" +" if obj is None:\n" +" return self\n" +" value = obj._slotvalues[self.offset]\n" +" if value is null:\n" +" raise AttributeError(self.name)\n" +" return value\n" +"\n" +" def __set__(self, obj, value):\n" +" 'Emulate member_set() in Objects/descrobject.c'\n" +" obj._slotvalues[self.offset] = value\n" +"\n" +" def __delete__(self, obj):\n" +" 'Emulate member_delete() in Objects/descrobject.c'\n" +" value = obj._slotvalues[self.offset]\n" +" if value is null:\n" +" raise AttributeError(self.name)\n" +" obj._slotvalues[self.offset] = null\n" +"\n" +" def __repr__(self):\n" +" 'Emulate member_repr() in Objects/descrobject.c'\n" +" return f''" +msgstr "" + +msgid "" +"The :meth:`!type.__new__` method takes care of adding member objects to " +"class variables:" +msgstr "" + +msgid "" +"class Type(type):\n" +" 'Simulate how the type metaclass adds member objects for slots'\n" +"\n" +" def __new__(mcls, clsname, bases, mapping, **kwargs):\n" +" 'Emulate type_new() in Objects/typeobject.c'\n" +" # type_new() calls PyTypeReady() which calls add_methods()\n" +" slot_names = mapping.get('slot_names', [])\n" +" for offset, name in enumerate(slot_names):\n" +" mapping[name] = Member(name, clsname, offset)\n" +" return type.__new__(mcls, clsname, bases, mapping, **kwargs)" +msgstr "" + +msgid "" +"The :meth:`object.__new__` method takes care of creating instances that have " +"slots instead of an instance dictionary. Here is a rough simulation in pure " +"Python:" +msgstr "" +"Метод :meth:`object.__new__` піклується про створення екземплярів, які мають " +"слоти замість словника екземплярів. Ось приблизне моделювання на чистому " +"Python:" + +msgid "" +"class Object:\n" +" 'Simulate how object.__new__() allocates memory for __slots__'\n" +"\n" +" def __new__(cls, *args, **kwargs):\n" +" 'Emulate object_new() in Objects/typeobject.c'\n" +" inst = super().__new__(cls)\n" +" if hasattr(cls, 'slot_names'):\n" +" empty_slots = [null] * len(cls.slot_names)\n" +" object.__setattr__(inst, '_slotvalues', empty_slots)\n" +" return inst\n" +"\n" +" def __setattr__(self, name, value):\n" +" 'Emulate _PyObject_GenericSetAttrWithDict() Objects/object.c'\n" +" cls = type(self)\n" +" if hasattr(cls, 'slot_names') and name not in cls.slot_names:\n" +" raise AttributeError(\n" +" f'{cls.__name__!r} object has no attribute {name!r}'\n" +" )\n" +" super().__setattr__(name, value)\n" +"\n" +" def __delattr__(self, name):\n" +" 'Emulate _PyObject_GenericSetAttrWithDict() Objects/object.c'\n" +" cls = type(self)\n" +" if hasattr(cls, 'slot_names') and name not in cls.slot_names:\n" +" raise AttributeError(\n" +" f'{cls.__name__!r} object has no attribute {name!r}'\n" +" )\n" +" super().__delattr__(name)" +msgstr "" + +msgid "" +"To use the simulation in a real class, just inherit from :class:`!Object` " +"and set the :term:`metaclass` to :class:`Type`:" +msgstr "" + +msgid "" +"class H(Object, metaclass=Type):\n" +" 'Instance variables stored in slots'\n" +"\n" +" slot_names = ['x', 'y']\n" +"\n" +" def __init__(self, x, y):\n" +" self.x = x\n" +" self.y = y" +msgstr "" + +msgid "" +"At this point, the metaclass has loaded member objects for *x* and *y*::" +msgstr "На даний момент метаклас завантажив об’єкти-члени для *x* і *y*::" + +msgid "" +">>> from pprint import pp\n" +">>> pp(dict(vars(H)))\n" +"{'__module__': '__main__',\n" +" '__doc__': 'Instance variables stored in slots',\n" +" 'slot_names': ['x', 'y'],\n" +" '__init__': ,\n" +" 'x': ,\n" +" 'y': }" +msgstr "" + +msgid "" +"When instances are created, they have a ``slot_values`` list where the " +"attributes are stored:" +msgstr "" +"Коли екземпляри створюються, вони мають список ``slot_values``, де " +"зберігаються атрибути:" + +msgid "" +">>> h = H(10, 20)\n" +">>> vars(h)\n" +"{'_slotvalues': [10, 20]}\n" +">>> h.x = 55\n" +">>> vars(h)\n" +"{'_slotvalues': [55, 20]}" +msgstr "" + +msgid "Misspelled or unassigned attributes will raise an exception:" +msgstr "Помилково введені або непризначені атрибути викликають виняток:" + +msgid "" +">>> h.xz\n" +"Traceback (most recent call last):\n" +" ...\n" +"AttributeError: 'H' object has no attribute 'xz'" +msgstr "" diff --git a/howto/enum.po b/howto/enum.po new file mode 100644 index 000000000..ca8581326 --- /dev/null +++ b/howto/enum.po @@ -0,0 +1,2160 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:53+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Enum HOWTO" +msgstr "Enum HOWTO" + +msgid "" +"An :class:`Enum` is a set of symbolic names bound to unique values. They " +"are similar to global variables, but they offer a more useful :func:`repr`, " +"grouping, type-safety, and a few other features." +msgstr "" + +msgid "" +"They are most useful when you have a variable that can take one of a limited " +"selection of values. For example, the days of the week::" +msgstr "" +"Вони найбільш корисні, коли у вас є змінна, яка може приймати одне з " +"обмеженого вибору значень. Наприклад, дні тижня::" + +msgid "" +">>> from enum import Enum\n" +">>> class Weekday(Enum):\n" +"... MONDAY = 1\n" +"... TUESDAY = 2\n" +"... WEDNESDAY = 3\n" +"... THURSDAY = 4\n" +"... FRIDAY = 5\n" +"... SATURDAY = 6\n" +"... SUNDAY = 7" +msgstr "" + +msgid "Or perhaps the RGB primary colors::" +msgstr "" + +msgid "" +">>> from enum import Enum\n" +">>> class Color(Enum):\n" +"... RED = 1\n" +"... GREEN = 2\n" +"... BLUE = 3" +msgstr "" + +msgid "" +"As you can see, creating an :class:`Enum` is as simple as writing a class " +"that inherits from :class:`Enum` itself." +msgstr "" +"Як бачите, створити :class:`Enum` так само просто, як написати клас, який " +"успадковує сам :class:`Enum`." + +msgid "Case of Enum Members" +msgstr "Випадок членів Enum" + +msgid "" +"Because Enums are used to represent constants, and to help avoid issues with " +"name clashes between mixin-class methods/attributes and enum names, we " +"strongly recommend using UPPER_CASE names for members, and will be using " +"that style in our examples." +msgstr "" + +msgid "" +"Depending on the nature of the enum a member's value may or may not be " +"important, but either way that value can be used to get the corresponding " +"member::" +msgstr "" +"Залежно від характеру переліку значення члена може бути важливим або " +"неважливим, але в будь-якому випадку це значення можна використовувати для " +"отримання відповідного члена::" + +msgid "" +">>> Weekday(3)\n" +"" +msgstr "" + +msgid "" +"As you can see, the ``repr()`` of a member shows the enum name, the member " +"name, and the value. The ``str()`` of a member shows only the enum name and " +"member name::" +msgstr "" + +msgid "" +">>> print(Weekday.THURSDAY)\n" +"Weekday.THURSDAY" +msgstr "" + +msgid "The *type* of an enumeration member is the enum it belongs to::" +msgstr "*Тип* члена переліку — це enum, якому він належить::" + +msgid "" +">>> type(Weekday.MONDAY)\n" +"\n" +">>> isinstance(Weekday.FRIDAY, Weekday)\n" +"True" +msgstr "" + +msgid "Enum members have an attribute that contains just their :attr:`!name`::" +msgstr "" + +msgid "" +">>> print(Weekday.TUESDAY.name)\n" +"TUESDAY" +msgstr "" + +msgid "Likewise, they have an attribute for their :attr:`!value`::" +msgstr "" + +msgid "" +">>> Weekday.WEDNESDAY.value\n" +"3" +msgstr "" + +msgid "" +"Unlike many languages that treat enumerations solely as name/value pairs, " +"Python Enums can have behavior added. For example, :class:`datetime.date` " +"has two methods for returning the weekday: :meth:`~datetime.date.weekday` " +"and :meth:`~datetime.date.isoweekday`. The difference is that one of them " +"counts from 0-6 and the other from 1-7. Rather than keep track of that " +"ourselves we can add a method to the :class:`!Weekday` enum to extract the " +"day from the :class:`~datetime.date` instance and return the matching enum " +"member::" +msgstr "" + +msgid "" +"@classmethod\n" +"def from_date(cls, date):\n" +" return cls(date.isoweekday())" +msgstr "" + +msgid "The complete :class:`!Weekday` enum now looks like this::" +msgstr "" + +msgid "" +">>> class Weekday(Enum):\n" +"... MONDAY = 1\n" +"... TUESDAY = 2\n" +"... WEDNESDAY = 3\n" +"... THURSDAY = 4\n" +"... FRIDAY = 5\n" +"... SATURDAY = 6\n" +"... SUNDAY = 7\n" +"... #\n" +"... @classmethod\n" +"... def from_date(cls, date):\n" +"... return cls(date.isoweekday())" +msgstr "" + +msgid "Now we can find out what today is! Observe::" +msgstr "Тепер ми можемо дізнатися, що таке сьогодні! Спостерігати::" + +msgid "" +">>> from datetime import date\n" +">>> Weekday.from_date(date.today())\n" +"" +msgstr "" + +msgid "" +"Of course, if you're reading this on some other day, you'll see that day " +"instead." +msgstr "Звичайно, якщо ви читаєте це в інший день, ви побачите цей день." + +msgid "" +"This :class:`!Weekday` enum is great if our variable only needs one day, but " +"what if we need several? Maybe we're writing a function to plot chores " +"during a week, and don't want to use a :class:`list` -- we could use a " +"different type of :class:`Enum`::" +msgstr "" + +msgid "" +">>> from enum import Flag\n" +">>> class Weekday(Flag):\n" +"... MONDAY = 1\n" +"... TUESDAY = 2\n" +"... WEDNESDAY = 4\n" +"... THURSDAY = 8\n" +"... FRIDAY = 16\n" +"... SATURDAY = 32\n" +"... SUNDAY = 64" +msgstr "" + +msgid "" +"We've changed two things: we're inherited from :class:`Flag`, and the values " +"are all powers of 2." +msgstr "" +"Ми змінили дві речі: ми успадковані від :class:`Flag`, і всі значення є " +"степенями 2." + +msgid "" +"Just like the original :class:`!Weekday` enum above, we can have a single " +"selection::" +msgstr "" + +msgid "" +">>> first_week_day = Weekday.MONDAY\n" +">>> first_week_day\n" +"" +msgstr "" + +msgid "" +"But :class:`Flag` also allows us to combine several members into a single " +"variable::" +msgstr "" +"Але :class:`Flag` також дозволяє нам об’єднати кілька членів в одну змінну::" + +msgid "" +">>> weekend = Weekday.SATURDAY | Weekday.SUNDAY\n" +">>> weekend\n" +"" +msgstr "" + +msgid "You can even iterate over a :class:`Flag` variable::" +msgstr "Ви навіть можете перебирати змінну :class:`Flag`::" + +msgid "" +">>> for day in weekend:\n" +"... print(day)\n" +"Weekday.SATURDAY\n" +"Weekday.SUNDAY" +msgstr "" + +msgid "Okay, let's get some chores set up::" +msgstr "Гаразд, давайте приступимо до роботи::" + +msgid "" +">>> chores_for_ethan = {\n" +"... 'feed the cat': Weekday.MONDAY | Weekday.WEDNESDAY | Weekday." +"FRIDAY,\n" +"... 'do the dishes': Weekday.TUESDAY | Weekday.THURSDAY,\n" +"... 'answer SO questions': Weekday.SATURDAY,\n" +"... }" +msgstr "" + +msgid "And a function to display the chores for a given day::" +msgstr "І функція для відображення справ за певний день::" + +msgid "" +">>> def show_chores(chores, day):\n" +"... for chore, days in chores.items():\n" +"... if day in days:\n" +"... print(chore)\n" +"...\n" +">>> show_chores(chores_for_ethan, Weekday.SATURDAY)\n" +"answer SO questions" +msgstr "" + +msgid "" +"In cases where the actual values of the members do not matter, you can save " +"yourself some work and use :func:`auto` for the values::" +msgstr "" + +msgid "" +">>> from enum import auto\n" +">>> class Weekday(Flag):\n" +"... MONDAY = auto()\n" +"... TUESDAY = auto()\n" +"... WEDNESDAY = auto()\n" +"... THURSDAY = auto()\n" +"... FRIDAY = auto()\n" +"... SATURDAY = auto()\n" +"... SUNDAY = auto()\n" +"... WEEKEND = SATURDAY | SUNDAY" +msgstr "" + +msgid "Programmatic access to enumeration members and their attributes" +msgstr "Програмний доступ до елементів переліку та їх атрибутів" + +msgid "" +"Sometimes it's useful to access members in enumerations programmatically (i." +"e. situations where ``Color.RED`` won't do because the exact color is not " +"known at program-writing time). ``Enum`` allows such access::" +msgstr "" +"Іноді корисно отримати доступ до членів у перерахуваннях програмно (тобто " +"ситуації, коли ``Color.RED`` не підійде, оскільки точний колір невідомий під " +"час написання програми). ``Enum`` дозволяє такий доступ:" + +msgid "" +">>> Color(1)\n" +"\n" +">>> Color(3)\n" +"" +msgstr "" + +msgid "If you want to access enum members by *name*, use item access::" +msgstr "" +"Якщо ви хочете отримати доступ до членів enum за *ім’ям*, використовуйте " +"доступ до елемента::" + +msgid "" +">>> Color['RED']\n" +"\n" +">>> Color['GREEN']\n" +"" +msgstr "" + +msgid "" +"If you have an enum member and need its :attr:`!name` or :attr:`!value`::" +msgstr "" + +msgid "" +">>> member = Color.RED\n" +">>> member.name\n" +"'RED'\n" +">>> member.value\n" +"1" +msgstr "" + +msgid "Duplicating enum members and values" +msgstr "Дублювання членів enum і значень" + +msgid "Having two enum members with the same name is invalid::" +msgstr "Наявність двох членів переліку з однаковими іменами недійсна::" + +msgid "" +">>> class Shape(Enum):\n" +"... SQUARE = 2\n" +"... SQUARE = 3\n" +"...\n" +"Traceback (most recent call last):\n" +"...\n" +"TypeError: 'SQUARE' already defined as 2" +msgstr "" + +msgid "" +"However, an enum member can have other names associated with it. Given two " +"entries ``A`` and ``B`` with the same value (and ``A`` defined first), ``B`` " +"is an alias for the member ``A``. By-value lookup of the value of ``A`` " +"will return the member ``A``. By-name lookup of ``A`` will return the " +"member ``A``. By-name lookup of ``B`` will also return the member ``A``::" +msgstr "" +"Однак член enum може мати інші імена, пов’язані з ним. За наявності двох " +"записів ``A`` і ``B`` з однаковим значенням (і ``A``, визначеним першим), " +"``B`` є псевдонімом для члена ``A``. Пошук за значенням значення ``A`` " +"поверне член ``A``. Пошук за назвою ``A`` поверне член ``A``. Пошук за " +"назвою ``B`` також поверне член ``A``::" + +msgid "" +">>> class Shape(Enum):\n" +"... SQUARE = 2\n" +"... DIAMOND = 1\n" +"... CIRCLE = 3\n" +"... ALIAS_FOR_SQUARE = 2\n" +"...\n" +">>> Shape.SQUARE\n" +"\n" +">>> Shape.ALIAS_FOR_SQUARE\n" +"\n" +">>> Shape(2)\n" +"" +msgstr "" + +msgid "" +"Attempting to create a member with the same name as an already defined " +"attribute (another member, a method, etc.) or attempting to create an " +"attribute with the same name as a member is not allowed." +msgstr "" +"Спроба створити член із тим же ім’ям, що й уже визначений атрибут (інший " +"член, метод тощо), або спроба створити атрибут із тим же ім’ям, що й член, " +"не дозволяється." + +msgid "Ensuring unique enumeration values" +msgstr "Забезпечення унікальних значень перерахування" + +msgid "" +"By default, enumerations allow multiple names as aliases for the same value. " +"When this behavior isn't desired, you can use the :func:`unique` decorator::" +msgstr "" +"За замовчуванням перерахування дозволяють використовувати кілька імен як " +"псевдоніми для одного значення. Якщо така поведінка небажана, ви можете " +"використати декоратор :func:`unique`::" + +msgid "" +">>> from enum import Enum, unique\n" +">>> @unique\n" +"... class Mistake(Enum):\n" +"... ONE = 1\n" +"... TWO = 2\n" +"... THREE = 3\n" +"... FOUR = 3\n" +"...\n" +"Traceback (most recent call last):\n" +"...\n" +"ValueError: duplicate values found in : FOUR -> THREE" +msgstr "" + +msgid "Using automatic values" +msgstr "Використання автоматичних значень" + +msgid "If the exact value is unimportant you can use :class:`auto`::" +msgstr "" +"Якщо точне значення неважливе, ви можете використовувати :class:`auto`::" + +msgid "" +">>> from enum import Enum, auto\n" +">>> class Color(Enum):\n" +"... RED = auto()\n" +"... BLUE = auto()\n" +"... GREEN = auto()\n" +"...\n" +">>> [member.value for member in Color]\n" +"[1, 2, 3]" +msgstr "" + +msgid "" +"The values are chosen by :func:`~Enum._generate_next_value_`, which can be " +"overridden::" +msgstr "" + +msgid "" +">>> class AutoName(Enum):\n" +"... @staticmethod\n" +"... def _generate_next_value_(name, start, count, last_values):\n" +"... return name\n" +"...\n" +">>> class Ordinal(AutoName):\n" +"... NORTH = auto()\n" +"... SOUTH = auto()\n" +"... EAST = auto()\n" +"... WEST = auto()\n" +"...\n" +">>> [member.value for member in Ordinal]\n" +"['NORTH', 'SOUTH', 'EAST', 'WEST']" +msgstr "" + +msgid "" +"The :meth:`~Enum._generate_next_value_` method must be defined before any " +"members." +msgstr "" + +msgid "Iteration" +msgstr "Ітерація" + +msgid "Iterating over the members of an enum does not provide the aliases::" +msgstr "Перебір членів enum не забезпечує псевдоніми::" + +msgid "" +">>> list(Shape)\n" +"[, , ]\n" +">>> list(Weekday)\n" +"[, , , , , , ]" +msgstr "" + +msgid "" +"Note that the aliases ``Shape.ALIAS_FOR_SQUARE`` and ``Weekday.WEEKEND`` " +"aren't shown." +msgstr "" + +msgid "" +"The special attribute ``__members__`` is a read-only ordered mapping of " +"names to members. It includes all names defined in the enumeration, " +"including the aliases::" +msgstr "" +"Спеціальний атрибут ``__members__`` — це впорядковане відображення імен " +"учасників лише для читання. Він включає всі імена, визначені в переліку, " +"включаючи псевдоніми::" + +msgid "" +">>> for name, member in Shape.__members__.items():\n" +"... name, member\n" +"...\n" +"('SQUARE', )\n" +"('DIAMOND', )\n" +"('CIRCLE', )\n" +"('ALIAS_FOR_SQUARE', )" +msgstr "" + +msgid "" +"The ``__members__`` attribute can be used for detailed programmatic access " +"to the enumeration members. For example, finding all the aliases::" +msgstr "" +"Атрибут ``__members__`` можна використовувати для детального програмного " +"доступу до елементів переліку. Наприклад, пошук усіх псевдонімів::" + +msgid "" +">>> [name for name, member in Shape.__members__.items() if member.name != " +"name]\n" +"['ALIAS_FOR_SQUARE']" +msgstr "" + +msgid "" +"Aliases for flags include values with multiple flags set, such as ``3``, and " +"no flags set, i.e. ``0``." +msgstr "" + +msgid "Comparisons" +msgstr "Порівняння" + +msgid "Enumeration members are compared by identity::" +msgstr "Члени переліку порівнюються за ідентичністю::" + +msgid "" +">>> Color.RED is Color.RED\n" +"True\n" +">>> Color.RED is Color.BLUE\n" +"False\n" +">>> Color.RED is not Color.BLUE\n" +"True" +msgstr "" + +msgid "" +"Ordered comparisons between enumeration values are *not* supported. Enum " +"members are not integers (but see `IntEnum`_ below)::" +msgstr "" +"Упорядковані порівняння між значеннями перерахування *не* підтримуються. " +"Члени Enum не є цілими числами (але дивіться `IntEnum`_ нижче):" + +msgid "" +">>> Color.RED < Color.BLUE\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"TypeError: '<' not supported between instances of 'Color' and 'Color'" +msgstr "" + +msgid "Equality comparisons are defined though::" +msgstr "Однак порівняння рівності визначено:" + +msgid "" +">>> Color.BLUE == Color.RED\n" +"False\n" +">>> Color.BLUE != Color.RED\n" +"True\n" +">>> Color.BLUE == Color.BLUE\n" +"True" +msgstr "" + +msgid "" +"Comparisons against non-enumeration values will always compare not equal " +"(again, :class:`IntEnum` was explicitly designed to behave differently, see " +"below)::" +msgstr "" +"Порівняння зі значеннями, не пов’язаними з перерахуванням, завжди " +"порівнюватиметься нерівними (знову ж таки, :class:`IntEnum` був явно " +"розроблений для іншої поведінки, див. нижче)::" + +msgid "" +">>> Color.BLUE == 2\n" +"False" +msgstr "" + +msgid "" +"It is possible to reload modules -- if a reloaded module contains enums, " +"they will be recreated, and the new members may not compare identical/equal " +"to the original members." +msgstr "" + +msgid "Allowed members and attributes of enumerations" +msgstr "Дозволені члени та атрибути перерахувань" + +msgid "" +"Most of the examples above use integers for enumeration values. Using " +"integers is short and handy (and provided by default by the `Functional " +"API`_), but not strictly enforced. In the vast majority of use-cases, one " +"doesn't care what the actual value of an enumeration is. But if the value " +"*is* important, enumerations can have arbitrary values." +msgstr "" +"Більшість наведених вище прикладів використовують цілі числа для значень " +"перерахування. Використання цілих чисел є коротким і зручним (і надається за " +"замовчуванням `Functional API`_), але не суворо дотримується. У переважній " +"більшості варіантів використання байдуже, яке фактичне значення " +"перерахування. Але якщо значення *є* важливим, перерахування можуть мати " +"довільні значення." + +msgid "" +"Enumerations are Python classes, and can have methods and special methods as " +"usual. If we have this enumeration::" +msgstr "" +"Перерахування є класами Python і, як зазвичай, можуть мати методи та " +"спеціальні методи. Якщо ми маємо цей перелік::" + +msgid "" +">>> class Mood(Enum):\n" +"... FUNKY = 1\n" +"... HAPPY = 3\n" +"...\n" +"... def describe(self):\n" +"... # self is the member here\n" +"... return self.name, self.value\n" +"...\n" +"... def __str__(self):\n" +"... return 'my custom str! {0}'.format(self.value)\n" +"...\n" +"... @classmethod\n" +"... def favorite_mood(cls):\n" +"... # cls here is the enumeration\n" +"... return cls.HAPPY\n" +"..." +msgstr "" + +msgid "Then::" +msgstr "Потім::" + +msgid "" +">>> Mood.favorite_mood()\n" +"\n" +">>> Mood.HAPPY.describe()\n" +"('HAPPY', 3)\n" +">>> str(Mood.FUNKY)\n" +"'my custom str! 1'" +msgstr "" + +msgid "" +"The rules for what is allowed are as follows: names that start and end with " +"a single underscore are reserved by enum and cannot be used; all other " +"attributes defined within an enumeration will become members of this " +"enumeration, with the exception of special methods (:meth:`~object." +"__str__`, :meth:`~object.__add__`, etc.), descriptors (methods are also " +"descriptors), and variable names listed in :attr:`~Enum._ignore_`." +msgstr "" + +msgid "" +"Note: if your enumeration defines :meth:`~object.__new__` and/or :meth:" +"`~object.__init__`, any value(s) given to the enum member will be passed " +"into those methods. See `Planet`_ for an example." +msgstr "" + +msgid "" +"The :meth:`~object.__new__` method, if defined, is used during creation of " +"the Enum members; it is then replaced by Enum's :meth:`~object.__new__` " +"which is used after class creation for lookup of existing members. See :ref:" +"`new-vs-init` for more details." +msgstr "" + +msgid "Restricted Enum subclassing" +msgstr "Обмежений підклас Enum" + +msgid "" +"A new :class:`Enum` class must have one base enum class, up to one concrete " +"data type, and as many :class:`object`-based mixin classes as needed. The " +"order of these base classes is::" +msgstr "" +"Новий клас :class:`Enum` повинен мати один базовий клас enum, до одного " +"конкретного типу даних і стільки класів міксину на основі :class:`object`, " +"скільки потрібно. Порядок цих базових класів:" + +msgid "" +"class EnumName([mix-in, ...,] [data-type,] base-enum):\n" +" pass" +msgstr "" + +msgid "" +"Also, subclassing an enumeration is allowed only if the enumeration does not " +"define any members. So this is forbidden::" +msgstr "" +"Крім того, створення підкласу переліку дозволяється, лише якщо перелік не " +"визначає жодних членів. Тому це заборонено::" + +msgid "" +">>> class MoreColor(Color):\n" +"... PINK = 17\n" +"...\n" +"Traceback (most recent call last):\n" +"...\n" +"TypeError: cannot extend " +msgstr "" + +msgid "But this is allowed::" +msgstr "Але це дозволено::" + +msgid "" +">>> class Foo(Enum):\n" +"... def some_behavior(self):\n" +"... pass\n" +"...\n" +">>> class Bar(Foo):\n" +"... HAPPY = 1\n" +"... SAD = 2\n" +"..." +msgstr "" + +msgid "" +"Allowing subclassing of enums that define members would lead to a violation " +"of some important invariants of types and instances. On the other hand, it " +"makes sense to allow sharing some common behavior between a group of " +"enumerations. (See `OrderedEnum`_ for an example.)" +msgstr "" +"Дозвіл створення підкласів для переліків, які визначають члени, призведе до " +"порушення деяких важливих інваріантів типів і екземплярів. З іншого боку, " +"має сенс дозволити спільну поведінку між групою перерахувань. (Див. " +"`OrderedEnum`_ для прикладу.)" + +msgid "Dataclass support" +msgstr "" + +msgid "" +"When inheriting from a :class:`~dataclasses.dataclass`, the :meth:`~Enum." +"__repr__` omits the inherited class' name. For example::" +msgstr "" + +msgid "" +">>> from dataclasses import dataclass, field\n" +">>> @dataclass\n" +"... class CreatureDataMixin:\n" +"... size: str\n" +"... legs: int\n" +"... tail: bool = field(repr=False, default=True)\n" +"...\n" +">>> class Creature(CreatureDataMixin, Enum):\n" +"... BEETLE = 'small', 6\n" +"... DOG = 'medium', 4\n" +"...\n" +">>> Creature.DOG\n" +"" +msgstr "" + +msgid "" +"Use the :func:`~dataclasses.dataclass` argument ``repr=False`` to use the " +"standard :func:`repr`." +msgstr "" + +msgid "" +"Only the dataclass fields are shown in the value area, not the dataclass' " +"name." +msgstr "" + +msgid "" +"Adding :func:`~dataclasses.dataclass` decorator to :class:`Enum` and its " +"subclasses is not supported. It will not raise any errors, but it will " +"produce very strange results at runtime, such as members being equal to each " +"other::" +msgstr "" + +msgid "" +">>> @dataclass # don't do this: it does not make any sense\n" +"... class Color(Enum):\n" +"... RED = 1\n" +"... BLUE = 2\n" +"...\n" +">>> Color.RED is Color.BLUE\n" +"False\n" +">>> Color.RED == Color.BLUE # problem is here: they should not be equal\n" +"True" +msgstr "" + +msgid "Pickling" +msgstr "Соління" + +msgid "Enumerations can be pickled and unpickled::" +msgstr "Перерахування можна маринувати і не маринувати:" + +msgid "" +">>> from test.test_enum import Fruit\n" +">>> from pickle import dumps, loads\n" +">>> Fruit.TOMATO is loads(dumps(Fruit.TOMATO))\n" +"True" +msgstr "" + +msgid "" +"The usual restrictions for pickling apply: picklable enums must be defined " +"in the top level of a module, since unpickling requires them to be " +"importable from that module." +msgstr "" +"Застосовуються звичайні обмеження для маркування: переліки, які можна " +"піклувати, повинні бути визначені на верхньому рівні модуля, оскільки для " +"скасування потрібно, щоб їх можна було імпортувати з цього модуля." + +msgid "" +"With pickle protocol version 4 it is possible to easily pickle enums nested " +"in other classes." +msgstr "" +"За допомогою протоколу pickle версії 4 можна легко маринувати переліки, " +"вкладені в інші класи." + +msgid "" +"It is possible to modify how enum members are pickled/unpickled by defining :" +"meth:`~object.__reduce_ex__` in the enumeration class. The default method " +"is by-value, but enums with complicated values may want to use by-name::" +msgstr "" + +msgid "" +">>> import enum\n" +">>> class MyEnum(enum.Enum):\n" +"... __reduce_ex__ = enum.pickle_by_enum_name" +msgstr "" + +msgid "" +"Using by-name for flags is not recommended, as unnamed aliases will not " +"unpickle." +msgstr "" + +msgid "Functional API" +msgstr "Функціональний API" + +msgid "" +"The :class:`Enum` class is callable, providing the following functional API::" +msgstr "" +"Клас :class:`Enum` можна викликати, забезпечуючи такий функціональний API:" + +msgid "" +">>> Animal = Enum('Animal', 'ANT BEE CAT DOG')\n" +">>> Animal\n" +"\n" +">>> Animal.ANT\n" +"\n" +">>> list(Animal)\n" +"[, , , ]" +msgstr "" + +msgid "" +"The semantics of this API resemble :class:`~collections.namedtuple`. The " +"first argument of the call to :class:`Enum` is the name of the enumeration." +msgstr "" +"Семантика цього API нагадує :class:`~collections.namedtuple`. Першим " +"аргументом виклику :class:`Enum` є назва переліку." + +msgid "" +"The second argument is the *source* of enumeration member names. It can be " +"a whitespace-separated string of names, a sequence of names, a sequence of 2-" +"tuples with key/value pairs, or a mapping (e.g. dictionary) of names to " +"values. The last two options enable assigning arbitrary values to " +"enumerations; the others auto-assign increasing integers starting with 1 " +"(use the ``start`` parameter to specify a different starting value). A new " +"class derived from :class:`Enum` is returned. In other words, the above " +"assignment to :class:`!Animal` is equivalent to::" +msgstr "" + +msgid "" +">>> class Animal(Enum):\n" +"... ANT = 1\n" +"... BEE = 2\n" +"... CAT = 3\n" +"... DOG = 4\n" +"..." +msgstr "" + +msgid "" +"The reason for defaulting to ``1`` as the starting number and not ``0`` is " +"that ``0`` is ``False`` in a boolean sense, but by default enum members all " +"evaluate to ``True``." +msgstr "" +"Причина того, що за замовчуванням початковим числом є ``1``, а не ``0``, " +"полягає в тому, що ``0`` є ``False`` у логічному сенсі, але за замовчуванням " +"усі члени enum оцінюються як ``True``." + +msgid "" +"Pickling enums created with the functional API can be tricky as frame stack " +"implementation details are used to try and figure out which module the " +"enumeration is being created in (e.g. it will fail if you use a utility " +"function in a separate module, and also may not work on IronPython or " +"Jython). The solution is to specify the module name explicitly as follows::" +msgstr "" + +msgid ">>> Animal = Enum('Animal', 'ANT BEE CAT DOG', module=__name__)" +msgstr "" + +msgid "" +"If ``module`` is not supplied, and Enum cannot determine what it is, the new " +"Enum members will not be unpicklable; to keep errors closer to the source, " +"pickling will be disabled." +msgstr "" +"Якщо ``module`` не вказано, і Enum не може визначити, що це таке, нові члени " +"Enum не можна буде вибрати; щоб зберегти помилки ближче до джерела, " +"травлення буде вимкнено." + +msgid "" +"The new pickle protocol 4 also, in some circumstances, relies on :attr:" +"`~type.__qualname__` being set to the location where pickle will be able to " +"find the class. For example, if the class was made available in class " +"SomeData in the global scope::" +msgstr "" + +msgid "" +">>> Animal = Enum('Animal', 'ANT BEE CAT DOG', qualname='SomeData.Animal')" +msgstr "" + +msgid "The complete signature is::" +msgstr "Повний підпис:" + +msgid "" +"Enum(\n" +" value='NewEnumName',\n" +" names=<...>,\n" +" *,\n" +" module='...',\n" +" qualname='...',\n" +" type=,\n" +" start=1,\n" +" )" +msgstr "" + +msgid "*value*: What the new enum class will record as its name." +msgstr "" + +msgid "" +"*names*: The enum members. This can be a whitespace- or comma-separated " +"string (values will start at 1 unless otherwise specified)::" +msgstr "" + +msgid "'RED GREEN BLUE' | 'RED,GREEN,BLUE' | 'RED, GREEN, BLUE'" +msgstr "" + +msgid "or an iterator of names::" +msgstr "або ітератор імен::" + +msgid "['RED', 'GREEN', 'BLUE']" +msgstr "" + +msgid "or an iterator of (name, value) pairs::" +msgstr "або ітератор пар (ім'я, значення)::" + +msgid "[('CYAN', 4), ('MAGENTA', 5), ('YELLOW', 6)]" +msgstr "" + +msgid "or a mapping::" +msgstr "або відображення::" + +msgid "{'CHARTREUSE': 7, 'SEA_GREEN': 11, 'ROSEMARY': 42}" +msgstr "" + +msgid "*module*: name of module where new enum class can be found." +msgstr "" + +msgid "*qualname*: where in module new enum class can be found." +msgstr "" + +msgid "*type*: type to mix in to new enum class." +msgstr "" + +msgid "*start*: number to start counting at if only names are passed in." +msgstr "" + +msgid "The *start* parameter was added." +msgstr "Додано параметр *start*." + +msgid "Derived Enumerations" +msgstr "Похідні перерахування" + +msgid "IntEnum" +msgstr "IntEnum" + +msgid "" +"The first variation of :class:`Enum` that is provided is also a subclass of :" +"class:`int`. Members of an :class:`IntEnum` can be compared to integers; by " +"extension, integer enumerations of different types can also be compared to " +"each other::" +msgstr "" +"Перший наданий варіант :class:`Enum` також є підкласом :class:`int`. Члени :" +"class:`IntEnum` можна порівняти з цілими числами; за розширенням, " +"цілочисельні перерахування різних типів також можна порівнювати один з одним:" + +msgid "" +">>> from enum import IntEnum\n" +">>> class Shape(IntEnum):\n" +"... CIRCLE = 1\n" +"... SQUARE = 2\n" +"...\n" +">>> class Request(IntEnum):\n" +"... POST = 1\n" +"... GET = 2\n" +"...\n" +">>> Shape == 1\n" +"False\n" +">>> Shape.CIRCLE == 1\n" +"True\n" +">>> Shape.CIRCLE == Request.POST\n" +"True" +msgstr "" + +msgid "" +"However, they still can't be compared to standard :class:`Enum` " +"enumerations::" +msgstr "" +"Однак їх все ще не можна порівняти зі стандартними перерахуваннями :class:" +"`Enum`::" + +msgid "" +">>> class Shape(IntEnum):\n" +"... CIRCLE = 1\n" +"... SQUARE = 2\n" +"...\n" +">>> class Color(Enum):\n" +"... RED = 1\n" +"... GREEN = 2\n" +"...\n" +">>> Shape.CIRCLE == Color.RED\n" +"False" +msgstr "" + +msgid "" +":class:`IntEnum` values behave like integers in other ways you'd expect::" +msgstr "Значення :class:`IntEnum` поводяться як цілі числа іншим чином:" + +msgid "" +">>> int(Shape.CIRCLE)\n" +"1\n" +">>> ['a', 'b', 'c'][Shape.CIRCLE]\n" +"'b'\n" +">>> [i for i in range(Shape.SQUARE)]\n" +"[0, 1]" +msgstr "" + +msgid "StrEnum" +msgstr "StrEnum" + +msgid "" +"The second variation of :class:`Enum` that is provided is also a subclass " +"of :class:`str`. Members of a :class:`StrEnum` can be compared to strings; " +"by extension, string enumerations of different types can also be compared to " +"each other." +msgstr "" + +msgid "IntFlag" +msgstr "IntFlag" + +msgid "" +"The next variation of :class:`Enum` provided, :class:`IntFlag`, is also " +"based on :class:`int`. The difference being :class:`IntFlag` members can be " +"combined using the bitwise operators (&, \\|, ^, ~) and the result is still " +"an :class:`IntFlag` member, if possible. Like :class:`IntEnum`, :class:" +"`IntFlag` members are also integers and can be used wherever an :class:`int` " +"is used." +msgstr "" + +msgid "" +"Any operation on an :class:`IntFlag` member besides the bit-wise operations " +"will lose the :class:`IntFlag` membership." +msgstr "" +"Будь-яка операція з членом :class:`IntFlag`, крім побітових операцій, " +"втрачає членство :class:`IntFlag`." + +msgid "" +"Bit-wise operations that result in invalid :class:`IntFlag` values will lose " +"the :class:`IntFlag` membership. See :class:`FlagBoundary` for details." +msgstr "" +"Побітові операції, які призводять до недійсних значень :class:`IntFlag`, " +"втратять членство :class:`IntFlag`. Перегляньте :class:`FlagBoundary` для " +"деталей." + +msgid "Sample :class:`IntFlag` class::" +msgstr "Приклад :class:`IntFlag` class::" + +msgid "" +">>> from enum import IntFlag\n" +">>> class Perm(IntFlag):\n" +"... R = 4\n" +"... W = 2\n" +"... X = 1\n" +"...\n" +">>> Perm.R | Perm.W\n" +"\n" +">>> Perm.R + Perm.W\n" +"6\n" +">>> RW = Perm.R | Perm.W\n" +">>> Perm.R in RW\n" +"True" +msgstr "" + +msgid "It is also possible to name the combinations::" +msgstr "Також можна назвати комбінації:" + +msgid "" +">>> class Perm(IntFlag):\n" +"... R = 4\n" +"... W = 2\n" +"... X = 1\n" +"... RWX = 7\n" +"...\n" +">>> Perm.RWX\n" +"\n" +">>> ~Perm.RWX\n" +"\n" +">>> Perm(7)\n" +"" +msgstr "" + +msgid "" +"Named combinations are considered aliases. Aliases do not show up during " +"iteration, but can be returned from by-value lookups." +msgstr "" +"Іменовані комбінації вважаються псевдонімами. Псевдоніми не відображаються " +"під час ітерації, але їх можна повернути під час пошуку за значенням." + +msgid "" +"Another important difference between :class:`IntFlag` and :class:`Enum` is " +"that if no flags are set (the value is 0), its boolean evaluation is :data:" +"`False`::" +msgstr "" +"Ще одна важлива відмінність між :class:`IntFlag` і :class:`Enum` полягає в " +"тому, що якщо не встановлено жодного прапора (значення дорівнює 0), його " +"логічна оцінка буде :data:`False`::" + +msgid "" +">>> Perm.R & Perm.X\n" +"\n" +">>> bool(Perm.R & Perm.X)\n" +"False" +msgstr "" + +msgid "" +"Because :class:`IntFlag` members are also subclasses of :class:`int` they " +"can be combined with them (but may lose :class:`IntFlag` membership::" +msgstr "" +"Оскільки члени :class:`IntFlag` також є підкласами :class:`int`, їх можна " +"поєднувати з ними (але вони можуть втратити членство :class:`IntFlag`::" + +msgid "" +">>> Perm.X | 4\n" +"\n" +"\n" +">>> Perm.X + 8\n" +"9" +msgstr "" + +msgid "" +"The negation operator, ``~``, always returns an :class:`IntFlag` member with " +"a positive value::" +msgstr "" +"Оператор заперечення, ``~``, завжди повертає член :class:`IntFlag` із " +"позитивним значенням::" + +msgid "" +">>> (~Perm.X).value == (Perm.R|Perm.W).value == 6\n" +"True" +msgstr "" + +msgid ":class:`IntFlag` members can also be iterated over::" +msgstr "Члени :class:`IntFlag` також можна повторювати:" + +msgid "" +">>> list(RW)\n" +"[, ]" +msgstr "" + +msgid "Flag" +msgstr "Прапор" + +msgid "" +"The last variation is :class:`Flag`. Like :class:`IntFlag`, :class:`Flag` " +"members can be combined using the bitwise operators (&, \\|, ^, ~). Unlike :" +"class:`IntFlag`, they cannot be combined with, nor compared against, any " +"other :class:`Flag` enumeration, nor :class:`int`. While it is possible to " +"specify the values directly it is recommended to use :class:`auto` as the " +"value and let :class:`Flag` select an appropriate value." +msgstr "" +"Останнім варіантом є :class:`Flag`. Подібно до :class:`IntFlag`, члени :" +"class:`Flag` можна комбінувати за допомогою порозрядних операторів (&, \\|, " +"^, ~). На відміну від :class:`IntFlag`, їх не можна комбінувати з будь-яким " +"іншим переліком :class:`Flag` або :class:`int`, ані порівнювати з ними. Хоча " +"можна вказати значення безпосередньо, рекомендується використовувати :class:" +"`auto` як значення, а :class:`Flag` вибрати відповідне значення." + +msgid "" +"Like :class:`IntFlag`, if a combination of :class:`Flag` members results in " +"no flags being set, the boolean evaluation is :data:`False`::" +msgstr "" +"Подібно до :class:`IntFlag`, якщо комбінація членів :class:`Flag` не " +"призводить до встановлення прапорів, логічна оцінка буде :data:`False`::" + +msgid "" +">>> from enum import Flag, auto\n" +">>> class Color(Flag):\n" +"... RED = auto()\n" +"... BLUE = auto()\n" +"... GREEN = auto()\n" +"...\n" +">>> Color.RED & Color.GREEN\n" +"\n" +">>> bool(Color.RED & Color.GREEN)\n" +"False" +msgstr "" + +msgid "" +"Individual flags should have values that are powers of two (1, 2, 4, " +"8, ...), while combinations of flags will not::" +msgstr "" + +msgid "" +">>> class Color(Flag):\n" +"... RED = auto()\n" +"... BLUE = auto()\n" +"... GREEN = auto()\n" +"... WHITE = RED | BLUE | GREEN\n" +"...\n" +">>> Color.WHITE\n" +"" +msgstr "" + +msgid "" +"Giving a name to the \"no flags set\" condition does not change its boolean " +"value::" +msgstr "" +"Присвоєння назви умові \"прапори не встановлено\" не змінює її логічного " +"значення::" + +msgid "" +">>> class Color(Flag):\n" +"... BLACK = 0\n" +"... RED = auto()\n" +"... BLUE = auto()\n" +"... GREEN = auto()\n" +"...\n" +">>> Color.BLACK\n" +"\n" +">>> bool(Color.BLACK)\n" +"False" +msgstr "" + +msgid ":class:`Flag` members can also be iterated over::" +msgstr "Члени :class:`Flag` також можна повторювати:" + +msgid "" +">>> purple = Color.RED | Color.BLUE\n" +">>> list(purple)\n" +"[, ]" +msgstr "" + +msgid "" +"For the majority of new code, :class:`Enum` and :class:`Flag` are strongly " +"recommended, since :class:`IntEnum` and :class:`IntFlag` break some semantic " +"promises of an enumeration (by being comparable to integers, and thus by " +"transitivity to other unrelated enumerations). :class:`IntEnum` and :class:" +"`IntFlag` should be used only in cases where :class:`Enum` and :class:`Flag` " +"will not do; for example, when integer constants are replaced with " +"enumerations, or for interoperability with other systems." +msgstr "" +"Для більшості нового коду наполегливо рекомендується використовувати :class:" +"`Enum` і :class:`Flag`, оскільки :class:`IntEnum` і :class:`IntFlag` " +"порушують деякі семантичні обіцянки перерахування (через їх порівняння з " +"цілі числа, і, таким чином, через перехідність до інших непов’язаних " +"перерахувань). :class:`IntEnum` і :class:`IntFlag` слід використовувати лише " +"у випадках, коли :class:`Enum` і :class:`Flag` не підходять; наприклад, коли " +"цілі константи замінюються перерахуваннями або для взаємодії з іншими " +"системами." + +msgid "Others" +msgstr "інші" + +msgid "" +"While :class:`IntEnum` is part of the :mod:`enum` module, it would be very " +"simple to implement independently::" +msgstr "" +"Хоча :class:`IntEnum` є частиною модуля :mod:`enum`, його було б дуже просто " +"реалізувати незалежно:" + +msgid "" +"class IntEnum(int, ReprEnum): # or Enum instead of ReprEnum\n" +" pass" +msgstr "" + +msgid "" +"This demonstrates how similar derived enumerations can be defined; for " +"example a :class:`!FloatEnum` that mixes in :class:`float` instead of :class:" +"`int`." +msgstr "" + +msgid "Some rules:" +msgstr "Деякі правила:" + +msgid "" +"When subclassing :class:`Enum`, mix-in types must appear before the :class:" +"`Enum` class itself in the sequence of bases, as in the :class:`IntEnum` " +"example above." +msgstr "" + +msgid "" +"Mix-in types must be subclassable. For example, :class:`bool` and :class:" +"`range` are not subclassable and will throw an error during Enum creation if " +"used as the mix-in type." +msgstr "" + +msgid "" +"While :class:`Enum` can have members of any type, once you mix in an " +"additional type, all the members must have values of that type, e.g. :class:" +"`int` above. This restriction does not apply to mix-ins which only add " +"methods and don't specify another type." +msgstr "" +"Хоча :class:`Enum` може мати члени будь-якого типу, коли ви додаєте " +"додатковий тип, усі члени повинні мати значення цього типу, наприклад. :" +"class:`int` вище. Це обмеження не стосується змішувань, які лише додають " +"методи і не вказують інший тип." + +msgid "" +"When another data type is mixed in, the :attr:`~Enum.value` attribute is " +"*not the same* as the enum member itself, although it is equivalent and will " +"compare equal." +msgstr "" + +msgid "" +"A ``data type`` is a mixin that defines :meth:`~object.__new__`, or a :class:" +"`~dataclasses.dataclass`" +msgstr "" + +msgid "" +"%-style formatting: ``%s`` and ``%r`` call the :class:`Enum` class's :meth:" +"`~object.__str__` and :meth:`~object.__repr__` respectively; other codes " +"(such as ``%i`` or ``%h`` for IntEnum) treat the enum member as its mixed-in " +"type." +msgstr "" + +msgid "" +":ref:`Formatted string literals `, :meth:`str.format`, and :func:" +"`format` will use the enum's :meth:`~object.__str__` method." +msgstr "" + +msgid "" +"Because :class:`IntEnum`, :class:`IntFlag`, and :class:`StrEnum` are " +"designed to be drop-in replacements for existing constants, their :meth:" +"`~object.__str__` method has been reset to their data types' :meth:`~object." +"__str__` method." +msgstr "" + +msgid "When to use :meth:`~object.__new__` vs. :meth:`~object.__init__`" +msgstr "" + +msgid "" +":meth:`~object.__new__` must be used whenever you want to customize the " +"actual value of the :class:`Enum` member. Any other modifications may go in " +"either :meth:`~object.__new__` or :meth:`~object.__init__`, with :meth:" +"`~object.__init__` being preferred." +msgstr "" + +msgid "" +"For example, if you want to pass several items to the constructor, but only " +"want one of them to be the value::" +msgstr "" +"Наприклад, якщо ви хочете передати кілька елементів у конструктор, але " +"хочете, щоб лише один із них був значенням::" + +msgid "" +">>> class Coordinate(bytes, Enum):\n" +"... \"\"\"\n" +"... Coordinate with binary codes that can be indexed by the int code.\n" +"... \"\"\"\n" +"... def __new__(cls, value, label, unit):\n" +"... obj = bytes.__new__(cls, [value])\n" +"... obj._value_ = value\n" +"... obj.label = label\n" +"... obj.unit = unit\n" +"... return obj\n" +"... PX = (0, 'P.X', 'km')\n" +"... PY = (1, 'P.Y', 'km')\n" +"... VX = (2, 'V.X', 'km/s')\n" +"... VY = (3, 'V.Y', 'km/s')\n" +"...\n" +"\n" +">>> print(Coordinate['PY'])\n" +"Coordinate.PY\n" +"\n" +">>> print(Coordinate(3))\n" +"Coordinate.VY" +msgstr "" + +msgid "" +"*Do not* call ``super().__new__()``, as the lookup-only ``__new__`` is the " +"one that is found; instead, use the data type directly." +msgstr "" + +msgid "Finer Points" +msgstr "Більш тонкі точки" + +msgid "Supported ``__dunder__`` names" +msgstr "Підтримувані імена ``__dunder__``" + +msgid "" +":attr:`~enum.EnumType.__members__` is a read-only ordered mapping of " +"``member_name``:``member`` items. It is only available on the class." +msgstr "" + +msgid "" +":meth:`~object.__new__`, if specified, must create and return the enum " +"members; it is also a very good idea to set the member's :attr:`~Enum." +"_value_` appropriately. Once all the members are created it is no longer " +"used." +msgstr "" + +msgid "Supported ``_sunder_`` names" +msgstr "Підтримувані імена ``_sunder_``" + +msgid ":attr:`~Enum._name_` -- name of the member" +msgstr "" + +msgid ":attr:`~Enum._value_` -- value of the member; can be set in ``__new__``" +msgstr "" + +msgid "" +":meth:`~Enum._missing_` -- a lookup function used when a value is not found; " +"may be overridden" +msgstr "" + +msgid "" +":attr:`~Enum._ignore_` -- a list of names, either as a :class:`list` or a :" +"class:`str`, that will not be transformed into members, and will be removed " +"from the final class" +msgstr "" + +msgid "" +":meth:`~Enum._generate_next_value_` -- used to get an appropriate value for " +"an enum member; may be overridden" +msgstr "" + +msgid "" +":meth:`~EnumType._add_alias_` -- adds a new name as an alias to an existing " +"member." +msgstr "" + +msgid "" +":meth:`~EnumType._add_value_alias_` -- adds a new value as an alias to an " +"existing member. See `MultiValueEnum`_ for an example." +msgstr "" + +msgid "" +"For standard :class:`Enum` classes the next value chosen is the highest " +"value seen incremented by one." +msgstr "" + +msgid "" +"For :class:`Flag` classes the next value chosen will be the next highest " +"power-of-two." +msgstr "" + +msgid "" +"Prior versions would use the last seen value instead of the highest value." +msgstr "" + +msgid "``_missing_``, ``_order_``, ``_generate_next_value_``" +msgstr "``_missing_``, ``_order_``, ``_generate_next_value_``" + +msgid "``_ignore_``" +msgstr "``_ігнорувати_``" + +msgid "``_add_alias_``, ``_add_value_alias_``" +msgstr "" + +msgid "" +"To help keep Python 2 / Python 3 code in sync an :attr:`~Enum._order_` " +"attribute can be provided. It will be checked against the actual order of " +"the enumeration and raise an error if the two do not match::" +msgstr "" + +msgid "" +">>> class Color(Enum):\n" +"... _order_ = 'RED GREEN BLUE'\n" +"... RED = 1\n" +"... BLUE = 3\n" +"... GREEN = 2\n" +"...\n" +"Traceback (most recent call last):\n" +"...\n" +"TypeError: member order does not match _order_:\n" +" ['RED', 'BLUE', 'GREEN']\n" +" ['RED', 'GREEN', 'BLUE']" +msgstr "" + +msgid "" +"In Python 2 code the :attr:`~Enum._order_` attribute is necessary as " +"definition order is lost before it can be recorded." +msgstr "" + +msgid "_Private__names" +msgstr "_Private__names" + +msgid "" +":ref:`Private names ` are not converted to enum " +"members, but remain normal attributes." +msgstr "" + +msgid "``Enum`` member type" +msgstr "Тип члена ``Enum``" + +msgid "" +"Enum members are instances of their enum class, and are normally accessed as " +"``EnumClass.member``. In certain situations, such as writing custom enum " +"behavior, being able to access one member directly from another is useful, " +"and is supported; however, in order to avoid name clashes between member " +"names and attributes/methods from mixed-in classes, upper-case names are " +"strongly recommended." +msgstr "" + +msgid "Creating members that are mixed with other data types" +msgstr "Створення елементів, змішаних з іншими типами даних" + +msgid "" +"When subclassing other data types, such as :class:`int` or :class:`str`, " +"with an :class:`Enum`, all values after the ``=`` are passed to that data " +"type's constructor. For example::" +msgstr "" + +msgid "" +">>> class MyEnum(IntEnum): # help(int) -> int(x, base=10) -> integer\n" +"... example = '11', 16 # so x='11' and base=16\n" +"...\n" +">>> MyEnum.example.value # and hex(11) is...\n" +"17" +msgstr "" + +msgid "Boolean value of ``Enum`` classes and members" +msgstr "Логічне значення класів і членів ``Enum``" + +msgid "" +"Enum classes that are mixed with non-:class:`Enum` types (such as :class:" +"`int`, :class:`str`, etc.) are evaluated according to the mixed-in type's " +"rules; otherwise, all members evaluate as :data:`True`. To make your own " +"enum's boolean evaluation depend on the member's value add the following to " +"your class::" +msgstr "" +"Класи Enum, змішані з типами не :class:`Enum` (такими як :class:`int`, :" +"class:`str` тощо), оцінюються відповідно до правил змішаного типу; інакше " +"всі члени оцінюються як :data:`True`. Щоб зробити логічне обчислення вашого " +"власного переліку залежним від значення члена, додайте наступне до свого " +"класу:" + +msgid "" +"def __bool__(self):\n" +" return bool(self.value)" +msgstr "" + +msgid "Plain :class:`Enum` classes always evaluate as :data:`True`." +msgstr "Класи Plain :class:`Enum` завжди оцінюються як :data:`True`." + +msgid "``Enum`` classes with methods" +msgstr "``Enum`` класи з методами" + +msgid "" +"If you give your enum subclass extra methods, like the `Planet`_ class " +"below, those methods will show up in a :func:`dir` of the member, but not of " +"the class::" +msgstr "" + +msgid "" +">>> dir(Planet)\n" +"['EARTH', 'JUPITER', 'MARS', 'MERCURY', 'NEPTUNE', 'SATURN', 'URANUS', " +"'VENUS', '__class__', '__doc__', '__members__', '__module__']\n" +">>> dir(Planet.EARTH)\n" +"['__class__', '__doc__', '__module__', 'mass', 'name', 'radius', " +"'surface_gravity', 'value']" +msgstr "" + +msgid "Combining members of ``Flag``" +msgstr "Об'єднання членів ``Прапора``" + +msgid "" +"Iterating over a combination of :class:`Flag` members will only return the " +"members that are comprised of a single bit::" +msgstr "" +"Ітерація по комбінації елементів :class:`Flag` поверне лише елементи, які " +"складаються з одного біта::" + +msgid "" +">>> class Color(Flag):\n" +"... RED = auto()\n" +"... GREEN = auto()\n" +"... BLUE = auto()\n" +"... MAGENTA = RED | BLUE\n" +"... YELLOW = RED | GREEN\n" +"... CYAN = GREEN | BLUE\n" +"...\n" +">>> Color(3) # named combination\n" +"\n" +">>> Color(7) # not named combination\n" +"" +msgstr "" + +msgid "``Flag`` and ``IntFlag`` minutia" +msgstr "Деталі ``Flag`` і ``IntFlag``" + +msgid "Using the following snippet for our examples::" +msgstr "Використовуючи наступний фрагмент для наших прикладів:" + +msgid "" +">>> class Color(IntFlag):\n" +"... BLACK = 0\n" +"... RED = 1\n" +"... GREEN = 2\n" +"... BLUE = 4\n" +"... PURPLE = RED | BLUE\n" +"... WHITE = RED | GREEN | BLUE\n" +"..." +msgstr "" + +msgid "the following are true:" +msgstr "вірно наступне:" + +msgid "single-bit flags are canonical" +msgstr "однобітові прапори є канонічними" + +msgid "multi-bit and zero-bit flags are aliases" +msgstr "багатобітні та нульові бітові прапорці є псевдонімами" + +msgid "only canonical flags are returned during iteration::" +msgstr "під час ітерації повертаються лише канонічні прапори::" + +msgid "" +">>> list(Color.WHITE)\n" +"[, , ]" +msgstr "" + +msgid "" +"negating a flag or flag set returns a new flag/flag set with the " +"corresponding positive integer value::" +msgstr "" +"заперечення прапора або набору прапорів повертає новий прапор/набір прапорів " +"із відповідним додатним цілим значенням::" + +msgid "" +">>> Color.BLUE\n" +"\n" +"\n" +">>> ~Color.BLUE\n" +"" +msgstr "" + +msgid "names of pseudo-flags are constructed from their members' names::" +msgstr "імена псевдо-прапорів складаються з імен їх членів::" + +msgid "" +">>> (Color.RED | Color.GREEN).name\n" +"'RED|GREEN'\n" +"\n" +">>> class Perm(IntFlag):\n" +"... R = 4\n" +"... W = 2\n" +"... X = 1\n" +"...\n" +">>> (Perm.R & Perm.W).name is None # effectively Perm(0)\n" +"True" +msgstr "" + +msgid "multi-bit flags, aka aliases, can be returned from operations::" +msgstr "" +"багатобітові прапорці, або псевдоніми, можуть бути повернуті з операцій::" + +msgid "" +">>> Color.RED | Color.BLUE\n" +"\n" +"\n" +">>> Color(7) # or Color(-1)\n" +"\n" +"\n" +">>> Color(0)\n" +"" +msgstr "" + +msgid "" +"membership / containment checking: zero-valued flags are always considered " +"to be contained::" +msgstr "" + +msgid "" +">>> Color.BLACK in Color.WHITE\n" +"True" +msgstr "" + +msgid "" +"otherwise, only if all bits of one flag are in the other flag will True be " +"returned::" +msgstr "" + +msgid "" +">>> Color.PURPLE in Color.WHITE\n" +"True\n" +"\n" +">>> Color.GREEN in Color.PURPLE\n" +"False" +msgstr "" + +msgid "" +"There is a new boundary mechanism that controls how out-of-range / invalid " +"bits are handled: ``STRICT``, ``CONFORM``, ``EJECT``, and ``KEEP``:" +msgstr "" +"Існує новий граничний механізм, який контролює, як обробляються біти за " +"межами діапазону/недійсні: ``STRICT``, ``CONFORM``, ``EJECT`` і ``KEEP``:" + +msgid "STRICT --> raises an exception when presented with invalid values" +msgstr "STRICT --> створює виняток, якщо надає недійсні значення" + +msgid "CONFORM --> discards any invalid bits" +msgstr "CONFORM --> відкидає всі недійсні біти" + +msgid "EJECT --> lose Flag status and become a normal int with the given value" +msgstr "" +"EJECT --> втрачає статус прапора та стає звичайним int із заданим значенням" + +msgid "KEEP --> keep the extra bits" +msgstr "KEEP --> збережіть зайві біти" + +msgid "keeps Flag status and extra bits" +msgstr "зберігає статус прапора та додаткові біти" + +msgid "extra bits do not show up in iteration" +msgstr "зайві біти не відображаються в ітерації" + +msgid "extra bits do show up in repr() and str()" +msgstr "додаткові біти з’являються в repr() і str()" + +msgid "" +"The default for Flag is ``STRICT``, the default for ``IntFlag`` is " +"``EJECT``, and the default for ``_convert_`` is ``KEEP`` (see ``ssl." +"Options`` for an example of when ``KEEP`` is needed)." +msgstr "" +"Типовим значенням для прапора є ``STRICT``, значенням за замовчуванням " +"``IntFlag`` є ``EJECT``, а за умовчанням для ``_convert_`` є ``KEEP`` (див. " +"``ssl.Options`` для прикладу того, коли потрібен ``KEEP``)." + +msgid "How are Enums and Flags different?" +msgstr "" + +msgid "" +"Enums have a custom metaclass that affects many aspects of both derived :" +"class:`Enum` classes and their instances (members)." +msgstr "" +"Переліки мають спеціальний метаклас, який впливає на багато аспектів як " +"похідних класів :class:`Enum`, так і їх екземплярів (членів)." + +msgid "Enum Classes" +msgstr "Класи Enum" + +msgid "" +"The :class:`EnumType` metaclass is responsible for providing the :meth:" +"`~object.__contains__`, :meth:`~object.__dir__`, :meth:`~object.__iter__` " +"and other methods that allow one to do things with an :class:`Enum` class " +"that fail on a typical class, such as ``list(Color)`` or ``some_enum_var in " +"Color``. :class:`EnumType` is responsible for ensuring that various other " +"methods on the final :class:`Enum` class are correct (such as :meth:`~object." +"__new__`, :meth:`~object.__getnewargs__`, :meth:`~object.__str__` and :meth:" +"`~object.__repr__`)." +msgstr "" + +msgid "Flag Classes" +msgstr "" + +msgid "" +"Flags have an expanded view of aliasing: to be canonical, the value of a " +"flag needs to be a power-of-two value, and not a duplicate name. So, in " +"addition to the :class:`Enum` definition of alias, a flag with no value (a.k." +"a. ``0``) or with more than one power-of-two value (e.g. ``3``) is " +"considered an alias." +msgstr "" + +msgid "Enum Members (aka instances)" +msgstr "Члени Enum (також відомі як екземпляри)" + +msgid "" +"The most interesting thing about enum members is that they are singletons. :" +"class:`EnumType` creates them all while it is creating the enum class " +"itself, and then puts a custom :meth:`~object.__new__` in place to ensure " +"that no new ones are ever instantiated by returning only the existing member " +"instances." +msgstr "" + +msgid "Flag Members" +msgstr "" + +msgid "" +"Flag members can be iterated over just like the :class:`Flag` class, and " +"only the canonical members will be returned. For example::" +msgstr "" + +msgid "" +">>> list(Color)\n" +"[, , ]" +msgstr "" + +msgid "(Note that ``BLACK``, ``PURPLE``, and ``WHITE`` do not show up.)" +msgstr "" + +msgid "" +"Inverting a flag member returns the corresponding positive value, rather " +"than a negative value --- for example::" +msgstr "" + +msgid "" +">>> ~Color.RED\n" +"" +msgstr "" + +msgid "" +"Flag members have a length corresponding to the number of power-of-two " +"values they contain. For example::" +msgstr "" + +msgid "" +">>> len(Color.PURPLE)\n" +"2" +msgstr "" + +msgid "Enum Cookbook" +msgstr "" + +msgid "" +"While :class:`Enum`, :class:`IntEnum`, :class:`StrEnum`, :class:`Flag`, and :" +"class:`IntFlag` are expected to cover the majority of use-cases, they cannot " +"cover them all. Here are recipes for some different types of enumerations " +"that can be used directly, or as examples for creating one's own." +msgstr "" +"Хоча очікується, що :class:`Enum`, :class:`IntEnum`, :class:`StrEnum`, :" +"class:`Flag` і :class:`IntFlag` охоплять більшість варіантів використання, " +"вони не можуть охопити їх усіх. Ось рецепти для деяких різних типів " +"перерахувань, які можна використовувати безпосередньо або як приклади для " +"створення власних." + +msgid "Omitting values" +msgstr "Пропуск значень" + +msgid "" +"In many use-cases, one doesn't care what the actual value of an enumeration " +"is. There are several ways to define this type of simple enumeration:" +msgstr "" + +msgid "use instances of :class:`auto` for the value" +msgstr "використовувати екземпляри :class:`auto` для значення" + +msgid "use instances of :class:`object` as the value" +msgstr "використовуйте екземпляри :class:`object` як значення" + +msgid "use a descriptive string as the value" +msgstr "використовуйте описовий рядок як значення" + +msgid "" +"use a tuple as the value and a custom :meth:`~object.__new__` to replace the " +"tuple with an :class:`int` value" +msgstr "" + +msgid "" +"Using any of these methods signifies to the user that these values are not " +"important, and also enables one to add, remove, or reorder members without " +"having to renumber the remaining members." +msgstr "" +"Використання будь-якого з цих методів означає для користувача, що ці " +"значення не є важливими, а також дозволяє додавати, видаляти або змінювати " +"порядок членів без необхідності перенумеровувати решту членів." + +msgid "Using :class:`auto`" +msgstr "Використання :class:`auto`" + +msgid "Using :class:`auto` would look like::" +msgstr "Використання :class:`auto` виглядатиме так::" + +msgid "" +">>> class Color(Enum):\n" +"... RED = auto()\n" +"... BLUE = auto()\n" +"... GREEN = auto()\n" +"...\n" +">>> Color.GREEN\n" +"" +msgstr "" + +msgid "Using :class:`object`" +msgstr "Використання :class:`object`" + +msgid "Using :class:`object` would look like::" +msgstr "Використання :class:`object` виглядатиме так::" + +msgid "" +">>> class Color(Enum):\n" +"... RED = object()\n" +"... GREEN = object()\n" +"... BLUE = object()\n" +"...\n" +">>> Color.GREEN\n" +">" +msgstr "" + +msgid "" +"This is also a good example of why you might want to write your own :meth:" +"`~object.__repr__`::" +msgstr "" + +msgid "" +">>> class Color(Enum):\n" +"... RED = object()\n" +"... GREEN = object()\n" +"... BLUE = object()\n" +"... def __repr__(self):\n" +"... return \"<%s.%s>\" % (self.__class__.__name__, self._name_)\n" +"...\n" +">>> Color.GREEN\n" +"" +msgstr "" + +msgid "Using a descriptive string" +msgstr "Використання описового рядка" + +msgid "Using a string as the value would look like::" +msgstr "Використання рядка як значення виглядатиме так::" + +msgid "" +">>> class Color(Enum):\n" +"... RED = 'stop'\n" +"... GREEN = 'go'\n" +"... BLUE = 'too fast!'\n" +"...\n" +">>> Color.GREEN\n" +"" +msgstr "" + +msgid "Using a custom :meth:`~object.__new__`" +msgstr "" + +msgid "Using an auto-numbering :meth:`~object.__new__` would look like::" +msgstr "" + +msgid "" +">>> class AutoNumber(Enum):\n" +"... def __new__(cls):\n" +"... value = len(cls.__members__) + 1\n" +"... obj = object.__new__(cls)\n" +"... obj._value_ = value\n" +"... return obj\n" +"...\n" +">>> class Color(AutoNumber):\n" +"... RED = ()\n" +"... GREEN = ()\n" +"... BLUE = ()\n" +"...\n" +">>> Color.GREEN\n" +"" +msgstr "" + +msgid "" +"To make a more general purpose ``AutoNumber``, add ``*args`` to the " +"signature::" +msgstr "" +"Щоб зробити ``AutoNumber`` більш загального призначення, додайте ``*args`` " +"до підпису::" + +msgid "" +">>> class AutoNumber(Enum):\n" +"... def __new__(cls, *args): # this is the only change from above\n" +"... value = len(cls.__members__) + 1\n" +"... obj = object.__new__(cls)\n" +"... obj._value_ = value\n" +"... return obj\n" +"..." +msgstr "" + +msgid "" +"Then when you inherit from ``AutoNumber`` you can write your own " +"``__init__`` to handle any extra arguments::" +msgstr "" +"Тоді, коли ви успадкуєте від ``AutoNumber``, ви можете написати свій власний " +"``__init__`` для обробки будь-яких додаткових аргументів::" + +msgid "" +">>> class Swatch(AutoNumber):\n" +"... def __init__(self, pantone='unknown'):\n" +"... self.pantone = pantone\n" +"... AUBURN = '3497'\n" +"... SEA_GREEN = '1246'\n" +"... BLEACHED_CORAL = () # New color, no Pantone code yet!\n" +"...\n" +">>> Swatch.SEA_GREEN\n" +"\n" +">>> Swatch.SEA_GREEN.pantone\n" +"'1246'\n" +">>> Swatch.BLEACHED_CORAL.pantone\n" +"'unknown'" +msgstr "" + +msgid "" +"The :meth:`~object.__new__` method, if defined, is used during creation of " +"the Enum members; it is then replaced by Enum's :meth:`~object.__new__` " +"which is used after class creation for lookup of existing members." +msgstr "" + +msgid "" +"*Do not* call ``super().__new__()``, as the lookup-only ``__new__`` is the " +"one that is found; instead, use the data type directly -- e.g.::" +msgstr "" + +msgid "obj = int.__new__(cls, value)" +msgstr "" + +msgid "OrderedEnum" +msgstr "OrderedEnum" + +msgid "" +"An ordered enumeration that is not based on :class:`IntEnum` and so " +"maintains the normal :class:`Enum` invariants (such as not being comparable " +"to other enumerations)::" +msgstr "" +"Упорядковане перерахування, яке не базується на :class:`IntEnum` і тому " +"підтримує звичайні інваріанти :class:`Enum` (наприклад, не порівнюється з " +"іншими переліками):" + +msgid "" +">>> class OrderedEnum(Enum):\n" +"... def __ge__(self, other):\n" +"... if self.__class__ is other.__class__:\n" +"... return self.value >= other.value\n" +"... return NotImplemented\n" +"... def __gt__(self, other):\n" +"... if self.__class__ is other.__class__:\n" +"... return self.value > other.value\n" +"... return NotImplemented\n" +"... def __le__(self, other):\n" +"... if self.__class__ is other.__class__:\n" +"... return self.value <= other.value\n" +"... return NotImplemented\n" +"... def __lt__(self, other):\n" +"... if self.__class__ is other.__class__:\n" +"... return self.value < other.value\n" +"... return NotImplemented\n" +"...\n" +">>> class Grade(OrderedEnum):\n" +"... A = 5\n" +"... B = 4\n" +"... C = 3\n" +"... D = 2\n" +"... F = 1\n" +"...\n" +">>> Grade.C < Grade.A\n" +"True" +msgstr "" + +msgid "DuplicateFreeEnum" +msgstr "DuplicateFreeEnum" + +msgid "" +"Raises an error if a duplicate member value is found instead of creating an " +"alias::" +msgstr "" + +msgid "" +">>> class DuplicateFreeEnum(Enum):\n" +"... def __init__(self, *args):\n" +"... cls = self.__class__\n" +"... if any(self.value == e.value for e in cls):\n" +"... a = self.name\n" +"... e = cls(self.value).name\n" +"... raise ValueError(\n" +"... \"aliases not allowed in DuplicateFreeEnum: %r --> " +"%r\"\n" +"... % (a, e))\n" +"...\n" +">>> class Color(DuplicateFreeEnum):\n" +"... RED = 1\n" +"... GREEN = 2\n" +"... BLUE = 3\n" +"... GRENE = 2\n" +"...\n" +"Traceback (most recent call last):\n" +" ...\n" +"ValueError: aliases not allowed in DuplicateFreeEnum: 'GRENE' --> 'GREEN'" +msgstr "" + +msgid "" +"This is a useful example for subclassing Enum to add or change other " +"behaviors as well as disallowing aliases. If the only desired change is " +"disallowing aliases, the :func:`unique` decorator can be used instead." +msgstr "" +"Це корисний приклад для підкласу Enum для додавання або зміни іншої " +"поведінки, а також заборони псевдонімів. Якщо єдиною бажаною зміною є " +"заборона псевдонімів, натомість можна використати декоратор :func:`unique`." + +msgid "MultiValueEnum" +msgstr "" + +msgid "Supports having more than one value per member::" +msgstr "" + +msgid "" +">>> class MultiValueEnum(Enum):\n" +"... def __new__(cls, value, *values):\n" +"... self = object.__new__(cls)\n" +"... self._value_ = value\n" +"... for v in values:\n" +"... self._add_value_alias_(v)\n" +"... return self\n" +"...\n" +">>> class DType(MultiValueEnum):\n" +"... float32 = 'f', 8\n" +"... double64 = 'd', 9\n" +"...\n" +">>> DType('f')\n" +"\n" +">>> DType(9)\n" +"" +msgstr "" + +msgid "Planet" +msgstr "Планета" + +msgid "" +"If :meth:`~object.__new__` or :meth:`~object.__init__` is defined, the value " +"of the enum member will be passed to those methods::" +msgstr "" + +msgid "" +">>> class Planet(Enum):\n" +"... MERCURY = (3.303e+23, 2.4397e6)\n" +"... VENUS = (4.869e+24, 6.0518e6)\n" +"... EARTH = (5.976e+24, 6.37814e6)\n" +"... MARS = (6.421e+23, 3.3972e6)\n" +"... JUPITER = (1.9e+27, 7.1492e7)\n" +"... SATURN = (5.688e+26, 6.0268e7)\n" +"... URANUS = (8.686e+25, 2.5559e7)\n" +"... NEPTUNE = (1.024e+26, 2.4746e7)\n" +"... def __init__(self, mass, radius):\n" +"... self.mass = mass # in kilograms\n" +"... self.radius = radius # in meters\n" +"... @property\n" +"... def surface_gravity(self):\n" +"... # universal gravitational constant (m3 kg-1 s-2)\n" +"... G = 6.67300E-11\n" +"... return G * self.mass / (self.radius * self.radius)\n" +"...\n" +">>> Planet.EARTH.value\n" +"(5.976e+24, 6378140.0)\n" +">>> Planet.EARTH.surface_gravity\n" +"9.802652743337129" +msgstr "" + +msgid "TimePeriod" +msgstr "Період часу" + +msgid "An example to show the :attr:`~Enum._ignore_` attribute in use::" +msgstr "" + +msgid "" +">>> from datetime import timedelta\n" +">>> class Period(timedelta, Enum):\n" +"... \"different lengths of time\"\n" +"... _ignore_ = 'Period i'\n" +"... Period = vars()\n" +"... for i in range(367):\n" +"... Period['day_%d' % i] = i\n" +"...\n" +">>> list(Period)[:2]\n" +"[, ]\n" +">>> list(Period)[-2:]\n" +"[, ]" +msgstr "" + +msgid "Subclassing EnumType" +msgstr "Підклас EnumType" + +msgid "" +"While most enum needs can be met by customizing :class:`Enum` subclasses, " +"either with class decorators or custom functions, :class:`EnumType` can be " +"subclassed to provide a different Enum experience." +msgstr "" +"У той час як більшість потреб enum можна задовольнити, налаштувавши " +"підкласи :class:`Enum`, або за допомогою декораторів класів, або " +"користувацьких функцій, :class:`EnumType` можна створити підкласи, щоб " +"забезпечити інший досвід Enum." diff --git a/howto/free-threading-extensions.po b/howto/free-threading-extensions.po new file mode 100644 index 000000000..c35b6b744 --- /dev/null +++ b/howto/free-threading-extensions.po @@ -0,0 +1,386 @@ +# SOME DESCRIPTIVE TITLE. +# 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 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2024-06-20 06:42+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "C API Extension Support for Free Threading" +msgstr "" + +msgid "" +"Starting with the 3.13 release, CPython has experimental support for running " +"with the :term:`global interpreter lock` (GIL) disabled in a configuration " +"called :term:`free threading`. This document describes how to adapt C API " +"extensions to support free threading." +msgstr "" + +msgid "Identifying the Free-Threaded Build in C" +msgstr "" + +msgid "" +"The CPython C API exposes the ``Py_GIL_DISABLED`` macro: in the free-" +"threaded build it's defined to ``1``, and in the regular build it's not " +"defined. You can use it to enable code that only runs under the free-" +"threaded build::" +msgstr "" + +msgid "" +"#ifdef Py_GIL_DISABLED\n" +"/* code that only runs in the free-threaded build */\n" +"#endif" +msgstr "" + +msgid "Module Initialization" +msgstr "" + +msgid "" +"Extension modules need to explicitly indicate that they support running with " +"the GIL disabled; otherwise importing the extension will raise a warning and " +"enable the GIL at runtime." +msgstr "" + +msgid "" +"There are two ways to indicate that an extension module supports running " +"with the GIL disabled depending on whether the extension uses multi-phase or " +"single-phase initialization." +msgstr "" + +msgid "Multi-Phase Initialization" +msgstr "" + +msgid "" +"Extensions that use multi-phase initialization (i.e., :c:func:" +"`PyModuleDef_Init`) should add a :c:data:`Py_mod_gil` slot in the module " +"definition. If your extension supports older versions of CPython, you " +"should guard the slot with a :c:data:`PY_VERSION_HEX` check." +msgstr "" + +msgid "" +"static struct PyModuleDef_Slot module_slots[] = {\n" +" ...\n" +"#if PY_VERSION_HEX >= 0x030D0000\n" +" {Py_mod_gil, Py_MOD_GIL_NOT_USED},\n" +"#endif\n" +" {0, NULL}\n" +"};\n" +"\n" +"static struct PyModuleDef moduledef = {\n" +" PyModuleDef_HEAD_INIT,\n" +" .m_slots = module_slots,\n" +" ...\n" +"};" +msgstr "" + +msgid "Single-Phase Initialization" +msgstr "" + +msgid "" +"Extensions that use single-phase initialization (i.e., :c:func:" +"`PyModule_Create`) should call :c:func:`PyUnstable_Module_SetGIL` to " +"indicate that they support running with the GIL disabled. The function is " +"only defined in the free-threaded build, so you should guard the call with " +"``#ifdef Py_GIL_DISABLED`` to avoid compilation errors in the regular build." +msgstr "" + +msgid "" +"static struct PyModuleDef moduledef = {\n" +" PyModuleDef_HEAD_INIT,\n" +" ...\n" +"};\n" +"\n" +"PyMODINIT_FUNC\n" +"PyInit_mymodule(void)\n" +"{\n" +" PyObject *m = PyModule_Create(&moduledef);\n" +" if (m == NULL) {\n" +" return NULL;\n" +" }\n" +"#ifdef Py_GIL_DISABLED\n" +" PyUnstable_Module_SetGIL(m, Py_MOD_GIL_NOT_USED);\n" +"#endif\n" +" return m;\n" +"}" +msgstr "" + +msgid "General API Guidelines" +msgstr "" + +msgid "Most of the C API is thread-safe, but there are some exceptions." +msgstr "" + +msgid "" +"**Struct Fields**: Accessing fields in Python C API objects or structs " +"directly is not thread-safe if the field may be concurrently modified." +msgstr "" + +msgid "" +"**Macros**: Accessor macros like :c:macro:`PyList_GET_ITEM` and :c:macro:" +"`PyList_SET_ITEM` do not perform any error checking or locking. These macros " +"are not thread-safe if the container object may be modified concurrently." +msgstr "" + +msgid "" +"**Borrowed References**: C API functions that return :term:`borrowed " +"references ` may not be thread-safe if the containing " +"object is modified concurrently. See the section on :ref:`borrowed " +"references ` for more information." +msgstr "" + +msgid "Container Thread Safety" +msgstr "" + +msgid "" +"Containers like :c:struct:`PyListObject`, :c:struct:`PyDictObject`, and :c:" +"struct:`PySetObject` perform internal locking in the free-threaded build. " +"For example, the :c:func:`PyList_Append` will lock the list before appending " +"an item." +msgstr "" + +msgid "``PyDict_Next``" +msgstr "" + +msgid "" +"A notable exception is :c:func:`PyDict_Next`, which does not lock the " +"dictionary. You should use :c:macro:`Py_BEGIN_CRITICAL_SECTION` to protect " +"the dictionary while iterating over it if the dictionary may be concurrently " +"modified::" +msgstr "" + +msgid "" +"Py_BEGIN_CRITICAL_SECTION(dict);\n" +"PyObject *key, *value;\n" +"Py_ssize_t pos = 0;\n" +"while (PyDict_Next(dict, &pos, &key, &value)) {\n" +" ...\n" +"}\n" +"Py_END_CRITICAL_SECTION();" +msgstr "" + +msgid "Borrowed References" +msgstr "" + +msgid "" +"Some C API functions return :term:`borrowed references `. These APIs are not thread-safe if the containing object is " +"modified concurrently. For example, it's not safe to use :c:func:" +"`PyList_GetItem` if the list may be modified concurrently." +msgstr "" + +msgid "" +"The following table lists some borrowed reference APIs and their " +"replacements that return :term:`strong references `." +msgstr "" + +msgid "Borrowed reference API" +msgstr "" + +msgid "Strong reference API" +msgstr "" + +msgid ":c:func:`PyList_GetItem`" +msgstr "" + +msgid ":c:func:`PyList_GetItemRef`" +msgstr "" + +msgid ":c:func:`PyDict_GetItem`" +msgstr "" + +msgid ":c:func:`PyDict_GetItemRef`" +msgstr "" + +msgid ":c:func:`PyDict_GetItemWithError`" +msgstr "" + +msgid ":c:func:`PyDict_GetItemString`" +msgstr "" + +msgid ":c:func:`PyDict_GetItemStringRef`" +msgstr "" + +msgid ":c:func:`PyDict_SetDefault`" +msgstr "" + +msgid ":c:func:`PyDict_SetDefaultRef`" +msgstr "" + +msgid ":c:func:`PyDict_Next`" +msgstr "" + +msgid "none (see :ref:`PyDict_Next`)" +msgstr "" + +msgid ":c:func:`PyWeakref_GetObject`" +msgstr "" + +msgid ":c:func:`PyWeakref_GetRef`" +msgstr "" + +msgid ":c:func:`PyWeakref_GET_OBJECT`" +msgstr "" + +msgid ":c:func:`PyImport_AddModule`" +msgstr "" + +msgid ":c:func:`PyImport_AddModuleRef`" +msgstr "" + +msgid "" +"Not all APIs that return borrowed references are problematic. For example, :" +"c:func:`PyTuple_GetItem` is safe because tuples are immutable. Similarly, " +"not all uses of the above APIs are problematic. For example, :c:func:" +"`PyDict_GetItem` is often used for parsing keyword argument dictionaries in " +"function calls; those keyword argument dictionaries are effectively private " +"(not accessible by other threads), so using borrowed references in that " +"context is safe." +msgstr "" + +msgid "" +"Some of these functions were added in Python 3.13. You can use the " +"`pythoncapi-compat `_ package " +"to provide implementations of these functions for older Python versions." +msgstr "" + +msgid "Memory Allocation APIs" +msgstr "" + +msgid "" +"Python's memory management C API provides functions in three different :ref:" +"`allocation domains `: \"raw\", \"mem\", and \"object\". " +"For thread-safety, the free-threaded build requires that only Python objects " +"are allocated using the object domain, and that all Python object are " +"allocated using that domain. This differs from the prior Python versions, " +"where this was only a best practice and not a hard requirement." +msgstr "" + +msgid "" +"Search for uses of :c:func:`PyObject_Malloc` in your extension and check " +"that the allocated memory is used for Python objects. Use :c:func:" +"`PyMem_Malloc` to allocate buffers instead of :c:func:`PyObject_Malloc`." +msgstr "" + +msgid "Thread State and GIL APIs" +msgstr "" + +msgid "" +"Python provides a set of functions and macros to manage thread state and the " +"GIL, such as:" +msgstr "" + +msgid ":c:func:`PyGILState_Ensure` and :c:func:`PyGILState_Release`" +msgstr "" + +msgid ":c:func:`PyEval_SaveThread` and :c:func:`PyEval_RestoreThread`" +msgstr "" + +msgid ":c:macro:`Py_BEGIN_ALLOW_THREADS` and :c:macro:`Py_END_ALLOW_THREADS`" +msgstr "" + +msgid "" +"These functions should still be used in the free-threaded build to manage " +"thread state even when the :term:`GIL` is disabled. For example, if you " +"create a thread outside of Python, you must call :c:func:`PyGILState_Ensure` " +"before calling into the Python API to ensure that the thread has a valid " +"Python thread state." +msgstr "" + +msgid "" +"You should continue to call :c:func:`PyEval_SaveThread` or :c:macro:" +"`Py_BEGIN_ALLOW_THREADS` around blocking operations, such as I/O or lock " +"acquisitions, to allow other threads to run the :term:`cyclic garbage " +"collector `." +msgstr "" + +msgid "Protecting Internal Extension State" +msgstr "" + +msgid "" +"Your extension may have internal state that was previously protected by the " +"GIL. You may need to add locking to protect this state. The approach will " +"depend on your extension, but some common patterns include:" +msgstr "" + +msgid "" +"**Caches**: global caches are a common source of shared state. Consider " +"using a lock to protect the cache or disabling it in the free-threaded build " +"if the cache is not critical for performance." +msgstr "" + +msgid "" +"**Global State**: global state may need to be protected by a lock or moved " +"to thread local storage. C11 and C++11 provide the ``thread_local`` or " +"``_Thread_local`` for `thread-local storage `_." +msgstr "" + +msgid "Building Extensions for the Free-Threaded Build" +msgstr "" + +msgid "" +"C API extensions need to be built specifically for the free-threaded build. " +"The wheels, shared libraries, and binaries are indicated by a ``t`` suffix." +msgstr "" + +msgid "" +"`pypa/manylinux `_ supports the free-" +"threaded build, with the ``t`` suffix, such as ``python3.13t``." +msgstr "" + +msgid "" +"`pypa/cibuildwheel `_ supports the " +"free-threaded build if you set `CIBW_FREE_THREADED_SUPPORT `_." +msgstr "" + +msgid "Limited C API and Stable ABI" +msgstr "" + +msgid "" +"The free-threaded build does not currently support the :ref:`Limited C API " +"` or the stable ABI. If you use `setuptools `_ to build your extension and " +"currently set ``py_limited_api=True`` you can use ``py_limited_api=not " +"sysconfig.get_config_var(\"Py_GIL_DISABLED\")`` to opt out of the limited " +"API when building with the free-threaded build." +msgstr "" + +msgid "" +"You will need to build separate wheels specifically for the free-threaded " +"build. If you currently use the stable ABI, you can continue to build a " +"single wheel for multiple non-free-threaded Python versions." +msgstr "" + +msgid "Windows" +msgstr "вікна" + +msgid "" +"Due to a limitation of the official Windows installer, you will need to " +"manually define ``Py_GIL_DISABLED=1`` when building extensions from source." +msgstr "" + +msgid "" +"`Porting Extension Modules to Support Free-Threading `_: A community-maintained porting guide for " +"extension authors." +msgstr "" diff --git a/howto/free-threading-python.po b/howto/free-threading-python.po new file mode 100644 index 000000000..a797cb45f --- /dev/null +++ b/howto/free-threading-python.po @@ -0,0 +1,226 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2024-10-04 14:19+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Python experimental support for free threading" +msgstr "" + +msgid "" +"Starting with the 3.13 release, CPython has experimental support for a build " +"of Python called :term:`free threading` where the :term:`global interpreter " +"lock` (GIL) is disabled. Free-threaded execution allows for full " +"utilization of the available processing power by running threads in parallel " +"on available CPU cores. While not all software will benefit from this " +"automatically, programs designed with threading in mind will run faster on " +"multi-core hardware." +msgstr "" + +msgid "" +"**The free-threaded mode is experimental** and work is ongoing to improve " +"it: expect some bugs and a substantial single-threaded performance hit." +msgstr "" + +msgid "" +"This document describes the implications of free threading for Python code. " +"See :ref:`freethreading-extensions-howto` for information on how to write C " +"extensions that support the free-threaded build." +msgstr "" + +msgid "" +":pep:`703` – Making the Global Interpreter Lock Optional in CPython for an " +"overall description of free-threaded Python." +msgstr "" + +msgid "Installation" +msgstr "" + +msgid "" +"Starting with Python 3.13, the official macOS and Windows installers " +"optionally support installing free-threaded Python binaries. The installers " +"are available at https://www.python.org/downloads/." +msgstr "" + +msgid "" +"For information on other platforms, see the `Installing a Free-Threaded " +"Python `_, a " +"community-maintained installation guide for installing free-threaded Python." +msgstr "" + +msgid "" +"When building CPython from source, the :option:`--disable-gil` configure " +"option should be used to build a free-threaded Python interpreter." +msgstr "" + +msgid "Identifying free-threaded Python" +msgstr "" + +msgid "" +"To check if the current interpreter supports free-threading, :option:`python " +"-VV <-V>` and :data:`sys.version` contain \"experimental free-threading " +"build\". The new :func:`sys._is_gil_enabled` function can be used to check " +"whether the GIL is actually disabled in the running process." +msgstr "" + +msgid "" +"The ``sysconfig.get_config_var(\"Py_GIL_DISABLED\")`` configuration variable " +"can be used to determine whether the build supports free threading. If the " +"variable is set to ``1``, then the build supports free threading. This is " +"the recommended mechanism for decisions related to the build configuration." +msgstr "" + +msgid "The global interpreter lock in free-threaded Python" +msgstr "" + +msgid "" +"Free-threaded builds of CPython support optionally running with the GIL " +"enabled at runtime using the environment variable :envvar:`PYTHON_GIL` or " +"the command-line option :option:`-X gil`." +msgstr "" + +msgid "" +"The GIL may also automatically be enabled when importing a C-API extension " +"module that is not explicitly marked as supporting free threading. A " +"warning will be printed in this case." +msgstr "" + +msgid "" +"In addition to individual package documentation, the following websites " +"track the status of popular packages support for free threading:" +msgstr "" + +msgid "https://py-free-threading.github.io/tracking/" +msgstr "" + +msgid "https://hugovk.github.io/free-threaded-wheels/" +msgstr "" + +msgid "Thread safety" +msgstr "" + +msgid "" +"The free-threaded build of CPython aims to provide similar thread-safety " +"behavior at the Python level to the default GIL-enabled build. Built-in " +"types like :class:`dict`, :class:`list`, and :class:`set` use internal locks " +"to protect against concurrent modifications in ways that behave similarly to " +"the GIL. However, Python has not historically guaranteed specific behavior " +"for concurrent modifications to these built-in types, so this should be " +"treated as a description of the current implementation, not a guarantee of " +"current or future behavior." +msgstr "" + +msgid "" +"It's recommended to use the :class:`threading.Lock` or other synchronization " +"primitives instead of relying on the internal locks of built-in types, when " +"possible." +msgstr "" + +msgid "Known limitations" +msgstr "" + +msgid "" +"This section describes known limitations of the free-threaded CPython build." +msgstr "" + +msgid "Immortalization" +msgstr "" + +msgid "" +"The free-threaded build of the 3.13 release makes some objects :term:" +"`immortal`. Immortal objects are not deallocated and have reference counts " +"that are never modified. This is done to avoid reference count contention " +"that would prevent efficient multi-threaded scaling." +msgstr "" + +msgid "" +"An object will be made immortal when a new thread is started for the first " +"time after the main thread is running. The following objects are " +"immortalized:" +msgstr "" + +msgid "" +":ref:`function ` objects declared at the module level" +msgstr "" + +msgid ":ref:`method ` descriptors" +msgstr "" + +msgid ":ref:`code ` objects" +msgstr "" + +msgid ":term:`module` objects and their dictionaries" +msgstr "" + +msgid ":ref:`classes ` (type objects)" +msgstr "" + +msgid "" +"Because immortal objects are never deallocated, applications that create " +"many objects of these types may see increased memory usage. This is " +"expected to be addressed in the 3.14 release." +msgstr "" + +msgid "" +"Additionally, numeric and string literals in the code as well as strings " +"returned by :func:`sys.intern` are also immortalized. This behavior is " +"expected to remain in the 3.14 free-threaded build." +msgstr "" + +msgid "Frame objects" +msgstr "Рамкові об'єкти" + +msgid "" +"It is not safe to access :ref:`frame ` objects from other " +"threads and doing so may cause your program to crash . This means that :" +"func:`sys._current_frames` is generally not safe to use in a free-threaded " +"build. Functions like :func:`inspect.currentframe` and :func:`sys." +"_getframe` are generally safe as long as the resulting frame object is not " +"passed to another thread." +msgstr "" + +msgid "Iterators" +msgstr "Ітератори" + +msgid "" +"Sharing the same iterator object between multiple threads is generally not " +"safe and threads may see duplicate or missing elements when iterating or " +"crash the interpreter." +msgstr "" + +msgid "Single-threaded performance" +msgstr "" + +msgid "" +"The free-threaded build has additional overhead when executing Python code " +"compared to the default GIL-enabled build. In 3.13, this overhead is about " +"40% on the `pyperformance `_ suite. " +"Programs that spend most of their time in C extensions or I/O will see less " +"of an impact. The largest impact is because the specializing adaptive " +"interpreter (:pep:`659`) is disabled in the free-threaded build. We expect " +"to re-enable it in a thread-safe way in the 3.14 release. This overhead is " +"expected to be reduced in upcoming Python release. We are aiming for an " +"overhead of 10% or less on the pyperformance suite compared to the default " +"GIL-enabled build." +msgstr "" diff --git a/howto/functional.po b/howto/functional.po new file mode 100644 index 000000000..1509779e3 --- /dev/null +++ b/howto/functional.po @@ -0,0 +1,2088 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:53+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Functional Programming HOWTO" +msgstr "Функціональне програмування HOWTO" + +msgid "Author" +msgstr "Автор" + +msgid "A. M. Kuchling" +msgstr "A. M. Kuchling" + +msgid "Release" +msgstr "Реліз" + +msgid "0.32" +msgstr "0,32" + +msgid "" +"In this document, we'll take a tour of Python's features suitable for " +"implementing programs in a functional style. After an introduction to the " +"concepts of functional programming, we'll look at language features such as :" +"term:`iterator`\\s and :term:`generator`\\s and relevant library modules " +"such as :mod:`itertools` and :mod:`functools`." +msgstr "" +"У цьому документі ми ознайомимося з функціями Python, придатними для " +"реалізації програм у функціональному стилі. Після вступу до концепцій " +"функціонального програмування ми розглянемо функції мови, такі як :term:" +"`iterator`\\s і :term:`generator`\\s, а також відповідні бібліотечні модулі, " +"такі як :mod:`itertools` і :mod:`functools`." + +msgid "Introduction" +msgstr "вступ" + +msgid "" +"This section explains the basic concept of functional programming; if you're " +"just interested in learning about Python language features, skip to the next " +"section on :ref:`functional-howto-iterators`." +msgstr "" +"У цьому розділі пояснюється основна концепція функціонального програмування; " +"якщо вам просто цікаво дізнатися про функції мови Python, перейдіть до " +"наступного розділу :ref:`functional-howto-iterators`." + +msgid "" +"Programming languages support decomposing problems in several different ways:" +msgstr "" +"Мови програмування підтримують декомпозицію проблем кількома різними " +"способами:" + +msgid "" +"Most programming languages are **procedural**: programs are lists of " +"instructions that tell the computer what to do with the program's input. C, " +"Pascal, and even Unix shells are procedural languages." +msgstr "" +"Більшість мов програмування є **процедурними**: програми — це списки " +"інструкцій, які вказують комп’ютеру, що робити з вхідними даними програми. " +"C, Pascal і навіть оболонки Unix є процедурними мовами." + +msgid "" +"In **declarative** languages, you write a specification that describes the " +"problem to be solved, and the language implementation figures out how to " +"perform the computation efficiently. SQL is the declarative language you're " +"most likely to be familiar with; a SQL query describes the data set you want " +"to retrieve, and the SQL engine decides whether to scan tables or use " +"indexes, which subclauses should be performed first, etc." +msgstr "" +"У **декларативних** мовах ви пишете специфікацію, яка описує проблему, яку " +"потрібно вирішити, а реалізація мови визначає, як виконати обчислення " +"ефективно. SQL — це декларативна мова, з якою ви, швидше за все, знайомі; " +"SQL-запит описує набір даних, який ви хочете отримати, і механізм SQL " +"вирішує, сканувати таблиці чи використовувати індекси, які підпункти слід " +"виконати першими тощо." + +msgid "" +"**Object-oriented** programs manipulate collections of objects. Objects " +"have internal state and support methods that query or modify this internal " +"state in some way. Smalltalk and Java are object-oriented languages. C++ " +"and Python are languages that support object-oriented programming, but don't " +"force the use of object-oriented features." +msgstr "" +"**Об’єктно-орієнтовані** програми маніпулюють колекціями об’єктів. Об’єкти " +"мають внутрішній стан і підтримують методи, які певним чином запитують або " +"змінюють цей внутрішній стан. Smalltalk і Java є об'єктно-орієнтованими " +"мовами. C++ і Python — це мови, які підтримують об’єктно-орієнтоване " +"програмування, але не примусово використовують об’єктно-орієнтовані функції." + +msgid "" +"**Functional** programming decomposes a problem into a set of functions. " +"Ideally, functions only take inputs and produce outputs, and don't have any " +"internal state that affects the output produced for a given input. Well-" +"known functional languages include the ML family (Standard ML, OCaml, and " +"other variants) and Haskell." +msgstr "" +"**Функціональне** програмування розкладає проблему на набір функцій. В " +"ідеалі функції лише приймають вхідні дані та виробляють виходи, і не мають " +"жодного внутрішнього стану, який впливає на вихідні дані, отримані для " +"даного вхідного елемента. Добре відомі функціональні мови включають " +"сімейство ML (Standard ML, OCaml та інші варіанти) і Haskell." + +msgid "" +"The designers of some computer languages choose to emphasize one particular " +"approach to programming. This often makes it difficult to write programs " +"that use a different approach. Other languages are multi-paradigm languages " +"that support several different approaches. Lisp, C++, and Python are multi-" +"paradigm; you can write programs or libraries that are largely procedural, " +"object-oriented, or functional in all of these languages. In a large " +"program, different sections might be written using different approaches; the " +"GUI might be object-oriented while the processing logic is procedural or " +"functional, for example." +msgstr "" +"Розробники деяких комп’ютерних мов вирішують наголосити на одному " +"конкретному підході до програмування. Це часто ускладнює написання програм, " +"які використовують інший підхід. Інші мови є мовами з кількома парадигмами, " +"які підтримують кілька різних підходів. Lisp, C++ і Python є " +"мультипарадигмальними; ви можете писати програми або бібліотеки, які в " +"основному є процедурними, об'єктно-орієнтованими або функціональними на всіх " +"цих мовах. У великій програмі різні розділи можуть бути написані з " +"використанням різних підходів; GUI може бути об'єктно-орієнтованим, тоді як " +"логіка обробки є процедурною або функціональною, наприклад." + +msgid "" +"In a functional program, input flows through a set of functions. Each " +"function operates on its input and produces some output. Functional style " +"discourages functions with side effects that modify internal state or make " +"other changes that aren't visible in the function's return value. Functions " +"that have no side effects at all are called **purely functional**. Avoiding " +"side effects means not using data structures that get updated as a program " +"runs; every function's output must only depend on its input." +msgstr "" +"У функціональній програмі введення проходить через набір функцій. Кожна " +"функція працює зі своїм входом і видає певний результат. Функціональний " +"стиль не заохочує функції з побічними ефектами, які змінюють внутрішній стан " +"або вносять інші зміни, які не видно у значенні, що повертається функцією. " +"Функції, які взагалі не мають побічних ефектів, називаються **чисто " +"функціональними**. Уникати побічних ефектів означає не використовувати " +"структури даних, які оновлюються під час виконання програми; кожен вихід " +"функції повинен залежати лише від її входу." + +msgid "" +"Some languages are very strict about purity and don't even have assignment " +"statements such as ``a=3`` or ``c = a + b``, but it's difficult to avoid all " +"side effects, such as printing to the screen or writing to a disk file. " +"Another example is a call to the :func:`print` or :func:`time.sleep` " +"function, neither of which returns a useful value. Both are called only for " +"their side effects of sending some text to the screen or pausing execution " +"for a second." +msgstr "" +"Деякі мови дуже суворі щодо чистоти й навіть не мають операторів присвоєння, " +"таких як ``a=3`` або ``c = a + b``, але важко уникнути всіх побічних " +"ефектів, таких як друк на екрані або запис у файл диска. Іншим прикладом є " +"виклик функції :func:`print` або :func:`time.sleep`, жодна з яких не " +"повертає корисне значення. Обидва викликаються лише через побічні ефекти " +"надсилання тексту на екран або призупинення виконання на секунду." + +msgid "" +"Python programs written in functional style usually won't go to the extreme " +"of avoiding all I/O or all assignments; instead, they'll provide a " +"functional-appearing interface but will use non-functional features " +"internally. For example, the implementation of a function will still use " +"assignments to local variables, but won't modify global variables or have " +"other side effects." +msgstr "" +"Програми на Python, написані у функціональному стилі, зазвичай не йдуть до " +"крайнощів, щоб уникнути всього вводу-виводу або всіх призначень; замість " +"цього вони забезпечуватимуть функціональний інтерфейс, але " +"використовуватимуть нефункціональні функції всередині. Наприклад, реалізація " +"функції все одно використовуватиме призначення локальним змінним, але не " +"змінюватиме глобальні змінні чи матиме інші побічні ефекти." + +msgid "" +"Functional programming can be considered the opposite of object-oriented " +"programming. Objects are little capsules containing some internal state " +"along with a collection of method calls that let you modify this state, and " +"programs consist of making the right set of state changes. Functional " +"programming wants to avoid state changes as much as possible and works with " +"data flowing between functions. In Python you might combine the two " +"approaches by writing functions that take and return instances representing " +"objects in your application (e-mail messages, transactions, etc.)." +msgstr "" +"Функціональне програмування можна вважати протилежністю об'єктно-" +"орієнтованого програмування. Об’єкти — це маленькі капсули, що містять " +"певний внутрішній стан разом із набором викликів методів, які дозволяють " +"змінювати цей стан, а програми складаються із внесення правильних змін " +"стану. Функціональне програмування хоче якомога більше уникати змін стану та " +"працює з потоком даних між функціями. У Python ви можете поєднати два " +"підходи, написавши функції, які приймають і повертають екземпляри, що " +"представляють об’єкти у вашій програмі (повідомлення електронної пошти, " +"транзакції тощо)." + +msgid "" +"Functional design may seem like an odd constraint to work under. Why should " +"you avoid objects and side effects? There are theoretical and practical " +"advantages to the functional style:" +msgstr "" +"Функціональний дизайн може здатися дивним обмеженням для роботи. Чому слід " +"уникати предметів і побічних ефектів? Існують теоретичні та практичні " +"переваги функціонального стилю:" + +msgid "Formal provability." +msgstr "Формальна доказовість." + +msgid "Modularity." +msgstr "Модульність." + +msgid "Composability." +msgstr "Композиційність." + +msgid "Ease of debugging and testing." +msgstr "Простота налагодження та тестування." + +msgid "Formal provability" +msgstr "Формальна доказовість" + +msgid "" +"A theoretical benefit is that it's easier to construct a mathematical proof " +"that a functional program is correct." +msgstr "" +"Теоретична перевага полягає в тому, що легше побудувати математичний доказ " +"правильності функціональної програми." + +msgid "" +"For a long time researchers have been interested in finding ways to " +"mathematically prove programs correct. This is different from testing a " +"program on numerous inputs and concluding that its output is usually " +"correct, or reading a program's source code and concluding that the code " +"looks right; the goal is instead a rigorous proof that a program produces " +"the right result for all possible inputs." +msgstr "" +"Довгий час дослідники були зацікавлені в пошуку способів математичної " +"перевірки правильності програм. Це відрізняється від тестування програми на " +"численних вхідних даних і висновку, що її вихід зазвичай правильний, або " +"читання вихідного коду програми та висновку, що код виглядає правильно; " +"натомість метою є суворий доказ того, що програма дає правильний результат " +"для всіх можливих вхідних даних." + +msgid "" +"The technique used to prove programs correct is to write down " +"**invariants**, properties of the input data and of the program's variables " +"that are always true. For each line of code, you then show that if " +"invariants X and Y are true **before** the line is executed, the slightly " +"different invariants X' and Y' are true **after** the line is executed. " +"This continues until you reach the end of the program, at which point the " +"invariants should match the desired conditions on the program's output." +msgstr "" +"Техніка, яка використовується для підтвердження правильності програм, " +"полягає в записі **інваріантів**, властивостей вхідних даних і змінних " +"програми, які завжди є істинними. Для кожного рядка коду ви потім показуєте, " +"що якщо інваріанти X і Y істинні **до** виконання рядка, дещо інші " +"інваріанти X' і Y' є істинними **після** виконання рядка. Це продовжується, " +"доки ви не досягнете кінця програми, після чого інваріанти повинні " +"відповідати бажаним умовам на виході програми." + +msgid "" +"Functional programming's avoidance of assignments arose because assignments " +"are difficult to handle with this technique; assignments can break " +"invariants that were true before the assignment without producing any new " +"invariants that can be propagated onward." +msgstr "" +"Уникання присвоєння у функціональному програмуванні виникло тому, що " +"присвоєння важко обробляти за допомогою цієї техніки; призначення можуть " +"порушувати інваріанти, які були істинними до призначення, не створюючи " +"жодних нових інваріантів, які можна поширювати далі." + +msgid "" +"Unfortunately, proving programs correct is largely impractical and not " +"relevant to Python software. Even trivial programs require proofs that are " +"several pages long; the proof of correctness for a moderately complicated " +"program would be enormous, and few or none of the programs you use daily " +"(the Python interpreter, your XML parser, your web browser) could be proven " +"correct. Even if you wrote down or generated a proof, there would then be " +"the question of verifying the proof; maybe there's an error in it, and you " +"wrongly believe you've proved the program correct." +msgstr "" +"На жаль, перевірка правильності програм в основному непрактична і не " +"стосується програмного забезпечення Python. Навіть тривіальні програми " +"вимагають доказів довжиною кілька сторінок; докази правильності для помірно " +"складної програми були б величезними, і мало або жодна з програм, якими ви " +"користуєтеся щодня (інтерпретатор Python, ваш аналізатор XML, ваш веб-" +"браузер), може бути доведена правильною. Навіть якщо ви записали або " +"згенерували доказ, тоді виникне питання перевірки доказу; можливо, у ньому є " +"помилка, і ви помилково вважаєте, що довели правильність програми." + +msgid "Modularity" +msgstr "Модульність" + +msgid "" +"A more practical benefit of functional programming is that it forces you to " +"break apart your problem into small pieces. Programs are more modular as a " +"result. It's easier to specify and write a small function that does one " +"thing than a large function that performs a complicated transformation. " +"Small functions are also easier to read and to check for errors." +msgstr "" +"Більш практична перевага функціонального програмування полягає в тому, що " +"воно змушує вас розбивати проблему на дрібні частини. В результаті програми " +"стають більш модульними. Простіше вказати та написати невелику функцію, яка " +"виконує щось одне, ніж велику функцію, яка виконує складне перетворення. " +"Невеликі функції також легше читати та перевіряти на наявність помилок." + +msgid "Ease of debugging and testing" +msgstr "Простота налагодження та тестування" + +msgid "Testing and debugging a functional-style program is easier." +msgstr "Тестування та налагодження програми у функціональному стилі легше." + +msgid "" +"Debugging is simplified because functions are generally small and clearly " +"specified. When a program doesn't work, each function is an interface point " +"where you can check that the data are correct. You can look at the " +"intermediate inputs and outputs to quickly isolate the function that's " +"responsible for a bug." +msgstr "" +"Налагодження спрощене, оскільки функції, як правило, невеликі та чітко " +"визначені. Коли програма не працює, кожна функція є точкою інтерфейсу, де " +"можна перевірити правильність даних. Ви можете переглянути проміжні входи та " +"виходи, щоб швидко виділити функцію, яка є відповідальною за помилку." + +msgid "" +"Testing is easier because each function is a potential subject for a unit " +"test. Functions don't depend on system state that needs to be replicated " +"before running a test; instead you only have to synthesize the right input " +"and then check that the output matches expectations." +msgstr "" +"Тестування легше, тому що кожна функція є потенційним предметом модульного " +"тесту. Функції не залежать від стану системи, який потрібно відтворити перед " +"виконанням тесту; натомість вам потрібно лише синтезувати правильні вхідні " +"дані, а потім перевірити, чи результат відповідає очікуванням." + +msgid "Composability" +msgstr "Композиційність" + +msgid "" +"As you work on a functional-style program, you'll write a number of " +"functions with varying inputs and outputs. Some of these functions will be " +"unavoidably specialized to a particular application, but others will be " +"useful in a wide variety of programs. For example, a function that takes a " +"directory path and returns all the XML files in the directory, or a function " +"that takes a filename and returns its contents, can be applied to many " +"different situations." +msgstr "" +"Працюючи над програмою функціонального стилю, ви напишете ряд функцій із " +"різними входами та виходами. Деякі з цих функцій неминуче будуть " +"спеціалізовані для конкретної програми, але інші будуть корисні в широкому " +"спектрі програм. Наприклад, функцію, яка приймає шлях до каталогу та " +"повертає всі файли XML у каталозі, або функцію, яка приймає ім’я файлу та " +"повертає його вміст, можна застосувати до багатьох різних ситуацій." + +msgid "" +"Over time you'll form a personal library of utilities. Often you'll " +"assemble new programs by arranging existing functions in a new configuration " +"and writing a few functions specialized for the current task." +msgstr "" +"З часом ви сформуєте особисту бібліотеку утиліт. Часто ви збираєте нові " +"програми, організовуючи існуючі функції в новій конфігурації та написавши " +"кілька функцій, спеціалізованих для поточного завдання." + +msgid "Iterators" +msgstr "Ітератори" + +msgid "" +"I'll start by looking at a Python language feature that's an important " +"foundation for writing functional-style programs: iterators." +msgstr "" +"Я почну з вивчення функції мови Python, яка є важливою основою для написання " +"програм у функціональному стилі: ітератори." + +msgid "" +"An iterator is an object representing a stream of data; this object returns " +"the data one element at a time. A Python iterator must support a method " +"called :meth:`~iterator.__next__` that takes no arguments and always returns " +"the next element of the stream. If there are no more elements in the " +"stream, :meth:`~iterator.__next__` must raise the :exc:`StopIteration` " +"exception. Iterators don't have to be finite, though; it's perfectly " +"reasonable to write an iterator that produces an infinite stream of data." +msgstr "" +"Ітератор - це об'єкт, що представляє потік даних; цей об’єкт повертає дані " +"по одному елементу за раз. Ітератор Python має підтримувати метод під " +"назвою :meth:`~iterator.__next__`, який не приймає аргументів і завжди " +"повертає наступний елемент потоку. Якщо в потоці більше немає елементів, :" +"meth:`~iterator.__next__` має викликати виняток :exc:`StopIteration`. Проте " +"ітератори не обов’язково мають бути кінцевими; цілком розумно написати " +"ітератор, який створює нескінченний потік даних." + +msgid "" +"The built-in :func:`iter` function takes an arbitrary object and tries to " +"return an iterator that will return the object's contents or elements, " +"raising :exc:`TypeError` if the object doesn't support iteration. Several " +"of Python's built-in data types support iteration, the most common being " +"lists and dictionaries. An object is called :term:`iterable` if you can get " +"an iterator for it." +msgstr "" +"Вбудована функція :func:`iter` приймає довільний об’єкт і намагається " +"повернути ітератор, який повертатиме вміст або елементи об’єкта, викликаючи :" +"exc:`TypeError`, якщо об’єкт не підтримує ітерацію. Кілька вбудованих типів " +"даних Python підтримують ітерацію, найпоширенішими з яких є списки та " +"словники. Об’єкт називається :term:`iterable`, якщо ви можете отримати для " +"нього ітератор." + +msgid "You can experiment with the iteration interface manually:" +msgstr "Ви можете експериментувати з інтерфейсом ітерації вручну:" + +msgid "" +"Python expects iterable objects in several different contexts, the most " +"important being the :keyword:`for` statement. In the statement ``for X in " +"Y``, Y must be an iterator or some object for which :func:`iter` can create " +"an iterator. These two statements are equivalent::" +msgstr "" +"Python очікує ітерованих об’єктів у кількох різних контекстах, найважливішим " +"з яких є оператор :keyword:`for`. У операторі ``для X в Y`` Y має бути " +"ітератором або деяким об’єктом, для якого :func:`iter` може створити " +"ітератор. Ці два твердження еквівалентні:" + +msgid "" +"for i in iter(obj):\n" +" print(i)\n" +"\n" +"for i in obj:\n" +" print(i)" +msgstr "" + +msgid "" +"Iterators can be materialized as lists or tuples by using the :func:`list` " +"or :func:`tuple` constructor functions:" +msgstr "" +"Ітератори можна матеріалізувати як списки або кортежі за допомогою функцій " +"конструктора :func:`list` або :func:`tuple`:" + +msgid "" +"Sequence unpacking also supports iterators: if you know an iterator will " +"return N elements, you can unpack them into an N-tuple:" +msgstr "" +"Розпакування послідовності також підтримує ітератори: якщо ви знаєте, що " +"ітератор поверне N елементів, ви можете розпакувати їх у N-кортеж:" + +msgid "" +"Built-in functions such as :func:`max` and :func:`min` can take a single " +"iterator argument and will return the largest or smallest element. The " +"``\"in\"`` and ``\"not in\"`` operators also support iterators: ``X in " +"iterator`` is true if X is found in the stream returned by the iterator. " +"You'll run into obvious problems if the iterator is infinite; :func:`max`, :" +"func:`min` will never return, and if the element X never appears in the " +"stream, the ``\"in\"`` and ``\"not in\"`` operators won't return either." +msgstr "" +"Вбудовані функції, такі як :func:`max` і :func:`min`, можуть приймати один " +"аргумент ітератора та повертати найбільший або найменший елемент. Оператори " +"``\"in\"`` і ``\"not in\"`` також підтримують ітератори: ``X в ітераторі`` є " +"істинним, якщо X знайдено в потоці, повернутому ітератором. Ви зіткнетеся з " +"очевидними проблемами, якщо ітератор нескінченний; :func:`max`, :func:`min` " +"ніколи не повертаються, а якщо елемент X ніколи не з’являється в потоці, " +"оператори ``\"in\"`` і ``\"not in\"`` не повертаються або." + +msgid "" +"Note that you can only go forward in an iterator; there's no way to get the " +"previous element, reset the iterator, or make a copy of it. Iterator " +"objects can optionally provide these additional capabilities, but the " +"iterator protocol only specifies the :meth:`~iterator.__next__` method. " +"Functions may therefore consume all of the iterator's output, and if you " +"need to do something different with the same stream, you'll have to create a " +"new iterator." +msgstr "" +"Зауважте, що в ітераторі можна рухатися лише вперед; немає способу отримати " +"попередній елемент, скинути ітератор або зробити його копію. Об’єкти-" +"ітератори можуть додатково надавати ці додаткові можливості, але протокол " +"ітераторів визначає лише метод :meth:`~iterator.__next__`. Тому функції " +"можуть споживати весь вихід ітератора, і якщо вам потрібно зробити щось інше " +"з тим самим потоком, вам доведеться створити новий ітератор." + +msgid "Data Types That Support Iterators" +msgstr "Типи даних, які підтримують ітератори" + +msgid "" +"We've already seen how lists and tuples support iterators. In fact, any " +"Python sequence type, such as strings, will automatically support creation " +"of an iterator." +msgstr "" +"Ми вже бачили, як списки та кортежі підтримують ітератори. Насправді будь-" +"який тип послідовності Python, наприклад рядки, автоматично підтримуватиме " +"створення ітератора." + +msgid "" +"Calling :func:`iter` on a dictionary returns an iterator that will loop over " +"the dictionary's keys::" +msgstr "" +"Виклик :func:`iter` для словника повертає ітератор, який перебиратиме ключі " +"словника::" + +msgid "" +">>> m = {'Jan': 1, 'Feb': 2, 'Mar': 3, 'Apr': 4, 'May': 5, 'Jun': 6,\n" +"... 'Jul': 7, 'Aug': 8, 'Sep': 9, 'Oct': 10, 'Nov': 11, 'Dec': 12}\n" +">>> for key in m:\n" +"... print(key, m[key])\n" +"Jan 1\n" +"Feb 2\n" +"Mar 3\n" +"Apr 4\n" +"May 5\n" +"Jun 6\n" +"Jul 7\n" +"Aug 8\n" +"Sep 9\n" +"Oct 10\n" +"Nov 11\n" +"Dec 12" +msgstr "" + +msgid "" +"Note that starting with Python 3.7, dictionary iteration order is guaranteed " +"to be the same as the insertion order. In earlier versions, the behaviour " +"was unspecified and could vary between implementations." +msgstr "" +"Зауважте, що, починаючи з Python 3.7, порядок ітерацій словника гарантовано " +"збігається з порядком вставки. У попередніх версіях поведінка була " +"невизначеною та могла відрізнятися в різних реалізаціях." + +msgid "" +"Applying :func:`iter` to a dictionary always loops over the keys, but " +"dictionaries have methods that return other iterators. If you want to " +"iterate over values or key/value pairs, you can explicitly call the :meth:" +"`~dict.values` or :meth:`~dict.items` methods to get an appropriate iterator." +msgstr "" +"Застосування :func:`iter` до словника завжди повторює ключі, але словники " +"мають методи, які повертають інші ітератори. Якщо ви хочете перебирати " +"значення або пари ключ/значення, ви можете явно викликати методи :meth:" +"`~dict.values` або :meth:`~dict.items`, щоб отримати відповідний ітератор." + +msgid "" +"The :func:`dict` constructor can accept an iterator that returns a finite " +"stream of ``(key, value)`` tuples:" +msgstr "" +"Конструктор :func:`dict` може приймати ітератор, який повертає кінцевий " +"потік кортежів ``(ключ, значення)``:" + +msgid "" +"Files also support iteration by calling the :meth:`~io.TextIOBase.readline` " +"method until there are no more lines in the file. This means you can read " +"each line of a file like this::" +msgstr "" +"Файли також підтримують ітерацію шляхом виклику методу :meth:`~io.TextIOBase." +"readline`, доки у файлі не залишиться рядків. Це означає, що ви можете " +"читати кожен рядок файлу таким чином:" + +msgid "" +"for line in file:\n" +" # do something for each line\n" +" ..." +msgstr "" + +msgid "" +"Sets can take their contents from an iterable and let you iterate over the " +"set's elements::" +msgstr "" +"Набори можуть брати свій вміст із ітерованого елемента й дозволяти вам " +"перебирати елементи набору:" + +msgid "" +">>> S = {2, 3, 5, 7, 11, 13}\n" +">>> for i in S:\n" +"... print(i)\n" +"2\n" +"3\n" +"5\n" +"7\n" +"11\n" +"13" +msgstr "" + +msgid "Generator expressions and list comprehensions" +msgstr "Генератор виразів і розуміння списків" + +msgid "" +"Two common operations on an iterator's output are 1) performing some " +"operation for every element, 2) selecting a subset of elements that meet " +"some condition. For example, given a list of strings, you might want to " +"strip off trailing whitespace from each line or extract all the strings " +"containing a given substring." +msgstr "" +"Дві загальні операції на виході ітератора: 1) виконання певної операції для " +"кожного елемента, 2) вибір підмножини елементів, які відповідають певній " +"умові. Наприклад, маючи список рядків, ви можете видалити кінцеві пробіли з " +"кожного рядка або витягти всі рядки, що містять певний підрядок." + +msgid "" +"List comprehensions and generator expressions (short form: \"listcomps\" and " +"\"genexps\") are a concise notation for such operations, borrowed from the " +"functional programming language Haskell (https://www.haskell.org/). You can " +"strip all the whitespace from a stream of strings with the following code::" +msgstr "" +"Розуміння списків і вирази генератора (скорочена форма: \"listcomps\" і " +"\"genexps\") є короткою нотацією для таких операцій, запозиченої з " +"функціональної мови програмування Haskell (https://www.haskell.org/). Ви " +"можете видалити всі пробіли з потоку рядків за допомогою такого коду::" + +msgid "" +">>> line_list = [' line 1\\n', 'line 2 \\n', ' \\n', '']\n" +"\n" +">>> # Generator expression -- returns iterator\n" +">>> stripped_iter = (line.strip() for line in line_list)\n" +"\n" +">>> # List comprehension -- returns list\n" +">>> stripped_list = [line.strip() for line in line_list]" +msgstr "" + +msgid "" +"You can select only certain elements by adding an ``\"if\"`` condition::" +msgstr "Ви можете вибрати лише певні елементи, додавши умову ``\"if\"``::" + +msgid "" +">>> stripped_list = [line.strip() for line in line_list\n" +"... if line != \"\"]" +msgstr "" + +msgid "" +"With a list comprehension, you get back a Python list; ``stripped_list`` is " +"a list containing the resulting lines, not an iterator. Generator " +"expressions return an iterator that computes the values as necessary, not " +"needing to materialize all the values at once. This means that list " +"comprehensions aren't useful if you're working with iterators that return an " +"infinite stream or a very large amount of data. Generator expressions are " +"preferable in these situations." +msgstr "" +"З розумінням списку ви отримуєте список Python; ``stripped_list`` – це " +"список, що містить отримані рядки, а не ітератор. Вирази генератора " +"повертають ітератор, який обчислює значення за потреби, не потребуючи " +"матеріалізації всіх значень одночасно. Це означає, що розуміння списку не є " +"корисним, якщо ви працюєте з ітераторами, які повертають нескінченний потік " +"або дуже великий обсяг даних. Вирази-генератори є кращими в цих ситуаціях." + +msgid "" +"Generator expressions are surrounded by parentheses (\"()\") and list " +"comprehensions are surrounded by square brackets (\"[]\"). Generator " +"expressions have the form::" +msgstr "" +"Вирази генератора оточені дужками (\"()\"), а розуміння списків оточені " +"квадратними дужками (\"[]\"). Вирази генератора мають вигляд::" + +msgid "" +"( expression for expr in sequence1\n" +" if condition1\n" +" for expr2 in sequence2\n" +" if condition2\n" +" for expr3 in sequence3\n" +" ...\n" +" if condition3\n" +" for exprN in sequenceN\n" +" if conditionN )" +msgstr "" + +msgid "" +"Again, for a list comprehension only the outside brackets are different " +"(square brackets instead of parentheses)." +msgstr "" +"Знову ж таки, для розуміння списку відрізняються лише зовнішні дужки " +"(квадратні дужки замість дужок)." + +msgid "" +"The elements of the generated output will be the successive values of " +"``expression``. The ``if`` clauses are all optional; if present, " +"``expression`` is only evaluated and added to the result when ``condition`` " +"is true." +msgstr "" +"Елементи згенерованого результату будуть послідовними значеннями ``виразу``. " +"Речення ``if`` є необов'язковими; якщо присутнє, ``вираз`` обчислюється та " +"додається до результату лише тоді, коли ``умова`` є істинною." + +msgid "" +"Generator expressions always have to be written inside parentheses, but the " +"parentheses signalling a function call also count. If you want to create an " +"iterator that will be immediately passed to a function you can write::" +msgstr "" +"Вирази генератора завжди мають бути записані в дужках, але дужки, що " +"сигналізують про виклик функції, також враховуються. Якщо ви хочете створити " +"ітератор, який буде негайно передано функції, ви можете написати::" + +msgid "obj_total = sum(obj.count for obj in list_all_objects())" +msgstr "" + +msgid "" +"The ``for...in`` clauses contain the sequences to be iterated over. The " +"sequences do not have to be the same length, because they are iterated over " +"from left to right, **not** in parallel. For each element in ``sequence1``, " +"``sequence2`` is looped over from the beginning. ``sequence3`` is then " +"looped over for each resulting pair of elements from ``sequence1`` and " +"``sequence2``." +msgstr "" +"Речення ``for...in`` містять послідовності, які потрібно повторити. " +"Послідовності не обов’язково мають бути однакової довжини, оскільки вони " +"повторюються зліва направо, **не** паралельно. Для кожного елемента в " +"``sequence1`` ``sequence2`` повторюється з самого початку. Після цього " +"``sequence3`` виконується в циклі для кожної отриманої пари елементів з " +"``sequence1`` і ``sequence2``." + +msgid "" +"To put it another way, a list comprehension or generator expression is " +"equivalent to the following Python code::" +msgstr "" +"Іншими словами, вираз розуміння списку або генератор еквівалентний такому " +"коду Python::" + +msgid "" +"for expr1 in sequence1:\n" +" if not (condition1):\n" +" continue # Skip this element\n" +" for expr2 in sequence2:\n" +" if not (condition2):\n" +" continue # Skip this element\n" +" ...\n" +" for exprN in sequenceN:\n" +" if not (conditionN):\n" +" continue # Skip this element\n" +"\n" +" # Output the value of\n" +" # the expression." +msgstr "" + +msgid "" +"This means that when there are multiple ``for...in`` clauses but no ``if`` " +"clauses, the length of the resulting output will be equal to the product of " +"the lengths of all the sequences. If you have two lists of length 3, the " +"output list is 9 elements long:" +msgstr "" +"Це означає, що коли є кілька пропозицій ``for...in``, але немає пропозицій " +"``if``, довжина результату буде дорівнювати добутку довжин усіх " +"послідовностей. Якщо у вас є два списки довжиною 3, вихідний список " +"складається з 9 елементів:" + +msgid "" +"To avoid introducing an ambiguity into Python's grammar, if ``expression`` " +"is creating a tuple, it must be surrounded with parentheses. The first list " +"comprehension below is a syntax error, while the second one is correct::" +msgstr "" +"Щоб уникнути неоднозначності в граматиці Python, якщо ``вираз`` створює " +"кортеж, він повинен бути оточений дужками. Перше розуміння списку нижче є " +"синтаксичною помилкою, тоді як друге є правильним:" + +msgid "" +"# Syntax error\n" +"[x, y for x in seq1 for y in seq2]\n" +"# Correct\n" +"[(x, y) for x in seq1 for y in seq2]" +msgstr "" + +msgid "Generators" +msgstr "Генератори" + +msgid "" +"Generators are a special class of functions that simplify the task of " +"writing iterators. Regular functions compute a value and return it, but " +"generators return an iterator that returns a stream of values." +msgstr "" +"Генератори — це спеціальний клас функцій, які спрощують завдання написання " +"ітераторів. Звичайні функції обчислюють значення та повертають його, але " +"генератори повертають ітератор, який повертає потік значень." + +msgid "" +"You're doubtless familiar with how regular function calls work in Python or " +"C. When you call a function, it gets a private namespace where its local " +"variables are created. When the function reaches a ``return`` statement, " +"the local variables are destroyed and the value is returned to the caller. " +"A later call to the same function creates a new private namespace and a " +"fresh set of local variables. But, what if the local variables weren't " +"thrown away on exiting a function? What if you could later resume the " +"function where it left off? This is what generators provide; they can be " +"thought of as resumable functions." +msgstr "" +"Ви, безсумнівно, знайомі з тим, як працюють звичайні виклики функцій у " +"Python або C. Коли ви викликаєте функцію, вона отримує приватний простір " +"імен, де створюються її локальні змінні. Коли функція досягає оператора " +"``return``, локальні змінні знищуються, а значення повертається " +"викликаючому. Пізніший виклик тієї ж функції створює новий приватний простір " +"імен і новий набір локальних змінних. Але що, якби локальні змінні не були " +"викинуті під час виходу з функції? Що, якби ви могли пізніше відновити " +"функцію, де вона була зупинена? Це те, що забезпечують генератори; їх можна " +"розглядати як відновлювані функції." + +msgid "Here's the simplest example of a generator function:" +msgstr "Ось найпростіший приклад функції генератора:" + +msgid "" +"Any function containing a :keyword:`yield` keyword is a generator function; " +"this is detected by Python's :term:`bytecode` compiler which compiles the " +"function specially as a result." +msgstr "" +"Будь-яка функція, що містить ключове слово :keyword:`yield`, є функцією-" +"генератором; це виявляється компілятором :term:`bytecode` Python, який " +"спеціально компілює функцію в результаті." + +msgid "" +"When you call a generator function, it doesn't return a single value; " +"instead it returns a generator object that supports the iterator protocol. " +"On executing the ``yield`` expression, the generator outputs the value of " +"``i``, similar to a ``return`` statement. The big difference between " +"``yield`` and a ``return`` statement is that on reaching a ``yield`` the " +"generator's state of execution is suspended and local variables are " +"preserved. On the next call to the generator's :meth:`~generator.__next__` " +"method, the function will resume executing." +msgstr "" +"Коли ви викликаєте функцію генератора, вона не повертає жодного значення; " +"замість цього він повертає об'єкт генератора, який підтримує протокол " +"ітератора. Під час виконання виразу ``yield`` генератор виводить значення " +"``i``, подібно до оператора ``return``. Велика різниця між оператором " +"``yield`` і оператором ``return`` полягає в тому, що після досягнення " +"``yield`` стан виконання генератора призупиняється, а локальні змінні " +"зберігаються. Під час наступного виклику методу генератора :meth:`~generator." +"__next__` функція відновить виконання." + +msgid "Here's a sample usage of the ``generate_ints()`` generator:" +msgstr "Ось приклад використання генератора ``generate_ints()``:" + +msgid "" +"You could equally write ``for i in generate_ints(5)``, or ``a, b, c = " +"generate_ints(3)``." +msgstr "" +"Так само можна написати ``для i в generate_ints(5)`` або ``a, b, c = " +"generate_ints(3)``." + +msgid "" +"Inside a generator function, ``return value`` causes " +"``StopIteration(value)`` to be raised from the :meth:`~generator.__next__` " +"method. Once this happens, or the bottom of the function is reached, the " +"procession of values ends and the generator cannot yield any further values." +msgstr "" +"Усередині функції-генератора ``повернене значення`` викликає " +"``StopIteration(value)``, яке буде викликано з методу :meth:`~generator." +"__next__`. Як тільки це станеться, або коли функція досягне дна, обробка " +"значень закінчується, і генератор не зможе видавати жодних додаткових " +"значень." + +msgid "" +"You could achieve the effect of generators manually by writing your own " +"class and storing all the local variables of the generator as instance " +"variables. For example, returning a list of integers could be done by " +"setting ``self.count`` to 0, and having the :meth:`~iterator.__next__` " +"method increment ``self.count`` and return it. However, for a moderately " +"complicated generator, writing a corresponding class can be much messier." +msgstr "" +"Ви можете досягти ефекту генераторів вручну, написавши власний клас і " +"зберігши всі локальні змінні генератора як змінні екземпляра. Наприклад, " +"повернути список цілих чисел можна, встановивши ``self.count`` на 0, і " +"дозволивши методу :meth:`~iterator.__next__` збільшити ``self.count`` і " +"повернути його. Однак для помірно складного генератора написання " +"відповідного класу може бути набагато складнішим." + +msgid "" +"The test suite included with Python's library, :source:`Lib/test/" +"test_generators.py`, contains a number of more interesting examples. Here's " +"one generator that implements an in-order traversal of a tree using " +"generators recursively. ::" +msgstr "" +"Набір тестів, що входить до бібліотеки Python, :source:`Lib/test/" +"test_generators.py`, містить низку більш цікавих прикладів. Ось один " +"генератор, який реалізує рекурсивний обхід дерева за допомогою " +"генераторів. ::" + +msgid "" +"# A recursive generator that generates Tree leaves in in-order.\n" +"def inorder(t):\n" +" if t:\n" +" for x in inorder(t.left):\n" +" yield x\n" +"\n" +" yield t.label\n" +"\n" +" for x in inorder(t.right):\n" +" yield x" +msgstr "" + +msgid "" +"Two other examples in ``test_generators.py`` produce solutions for the N-" +"Queens problem (placing N queens on an NxN chess board so that no queen " +"threatens another) and the Knight's Tour (finding a route that takes a " +"knight to every square of an NxN chessboard without visiting any square " +"twice)." +msgstr "" +"Два інших приклади в ``test_generators.py`` створюють рішення для проблеми N-" +"Queens (розміщення N ферзів на NxN шахівниці так, щоб жодна королева не " +"загрожувала іншій) і Knight's Tour (пошук маршруту, який веде лицаря до " +"кожної клітинки). шахової дошки NxN, не відвідуючи жодного поля двічі)." + +msgid "Passing values into a generator" +msgstr "Передача значень у генератор" + +msgid "" +"In Python 2.4 and earlier, generators only produced output. Once a " +"generator's code was invoked to create an iterator, there was no way to pass " +"any new information into the function when its execution is resumed. You " +"could hack together this ability by making the generator look at a global " +"variable or by passing in some mutable object that callers then modify, but " +"these approaches are messy." +msgstr "" +"У Python 2.4 і раніших версіях генератори створювали лише вихідні дані. Як " +"тільки код генератора був викликаний для створення ітератора, не було " +"можливості передати будь-яку нову інформацію у функцію, коли її виконання " +"відновилося. Ви можете об’єднати цю здатність, змусивши генератор дивитися " +"на глобальну змінну або передавши якийсь змінний об’єкт, який потім змінюють " +"абоненти, але ці підходи є безладними." + +msgid "" +"In Python 2.5 there's a simple way to pass values into a generator. :keyword:" +"`yield` became an expression, returning a value that can be assigned to a " +"variable or otherwise operated on::" +msgstr "" +"У Python 2.5 є простий спосіб передачі значень у генератор. :keyword:`yield` " +"став виразом, який повертає значення, яке можна присвоїти змінній або іншим " +"чином оперувати:" + +msgid "val = (yield i)" +msgstr "" + +msgid "" +"I recommend that you **always** put parentheses around a ``yield`` " +"expression when you're doing something with the returned value, as in the " +"above example. The parentheses aren't always necessary, but it's easier to " +"always add them instead of having to remember when they're needed." +msgstr "" +"Я рекомендую вам **завжди** брати дужки навколо виразу ``yield``, коли ви " +"робите щось із повернутим значенням, як у прикладі вище. Дужки не завжди " +"потрібні, але простіше завжди додавати їх замість того, щоб запам’ятовувати, " +"коли вони потрібні." + +msgid "" +"(:pep:`342` explains the exact rules, which are that a ``yield``-expression " +"must always be parenthesized except when it occurs at the top-level " +"expression on the right-hand side of an assignment. This means you can " +"write ``val = yield i`` but have to use parentheses when there's an " +"operation, as in ``val = (yield i) + 12``.)" +msgstr "" +"(:pep:`342` пояснює точні правила, які полягають у тому, що вираз ``yield`` " +"завжди повинен бути взятий у дужки, за винятком випадків, коли він " +"зустрічається у виразі верхнього рівня в правій частині призначення. Це " +"означає, що ви можна написати ``val = yield i``, але потрібно " +"використовувати дужки, коли є операція, як у ``val = (yield i) + 12``.)" + +msgid "" +"Values are sent into a generator by calling its :meth:`send(value) " +"` method. This method resumes the generator's code and the " +"``yield`` expression returns the specified value. If the regular :meth:" +"`~generator.__next__` method is called, the ``yield`` returns ``None``." +msgstr "" +"Значення надсилаються в генератор шляхом виклику його методу :meth:" +"`send(value) `. Цей метод відновлює код генератора, а вираз " +"``yield`` повертає вказане значення. Якщо викликається звичайний метод :meth:" +"`~generator.__next__`, ``yield`` повертає ``None``." + +msgid "" +"Here's a simple counter that increments by 1 and allows changing the value " +"of the internal counter." +msgstr "" +"Ось простий лічильник, який збільшується на 1 і дозволяє змінювати значення " +"внутрішнього лічильника." + +msgid "" +"def counter(maximum):\n" +" i = 0\n" +" while i < maximum:\n" +" val = (yield i)\n" +" # If value provided, change counter\n" +" if val is not None:\n" +" i = val\n" +" else:\n" +" i += 1" +msgstr "" + +msgid "And here's an example of changing the counter:" +msgstr "А ось приклад зміни лічильника:" + +msgid "" +"Because ``yield`` will often be returning ``None``, you should always check " +"for this case. Don't just use its value in expressions unless you're sure " +"that the :meth:`~generator.send` method will be the only method used to " +"resume your generator function." +msgstr "" +"Оскільки ``yield`` часто повертатиме ``None``, ви завжди повинні перевіряти " +"цей випадок. Не просто використовуйте його значення у виразах, якщо ви не " +"впевнені, що метод :meth:`~generator.send` буде єдиним методом, використаним " +"для відновлення вашої функції генератора." + +msgid "" +"In addition to :meth:`~generator.send`, there are two other methods on " +"generators:" +msgstr "Окрім :meth:`~generator.send`, у генераторах є ще два методи:" + +msgid "" +":meth:`throw(value) ` is used to raise an exception inside " +"the generator; the exception is raised by the ``yield`` expression where the " +"generator's execution is paused." +msgstr "" +":meth:`throw(value) ` використовується для створення " +"винятку всередині генератора; виняток викликає вираз ``yield``, де виконання " +"генератора призупинено." + +msgid "" +":meth:`~generator.close` raises a :exc:`GeneratorExit` exception inside the " +"generator to terminate the iteration. On receiving this exception, the " +"generator's code must either raise :exc:`GeneratorExit` or :exc:" +"`StopIteration`; catching the exception and doing anything else is illegal " +"and will trigger a :exc:`RuntimeError`. :meth:`~generator.close` will also " +"be called by Python's garbage collector when the generator is garbage-" +"collected." +msgstr "" +":meth:`~generator.close` викликає виняткову ситуацію :exc:`GeneratorExit` " +"всередині генератора, щоб завершити ітерацію. Отримавши цей виняток, код " +"генератора повинен викликати :exc:`GeneratorExit` або :exc:`StopIteration`; " +"перехоплення винятку та будь-що інше є незаконним і спричинить :exc:" +"`RuntimeError`. :meth:`~generator.close` також буде викликано збирачем " +"сміття Python, коли генератор збирає сміття." + +msgid "" +"If you need to run cleanup code when a :exc:`GeneratorExit` occurs, I " +"suggest using a ``try: ... finally:`` suite instead of catching :exc:" +"`GeneratorExit`." +msgstr "" +"Якщо вам потрібно запустити код очищення, коли виникає :exc:`GeneratorExit`, " +"я пропоную використовувати набір ``try: ... finally:`` замість перехоплення :" +"exc:`GeneratorExit`." + +msgid "" +"The cumulative effect of these changes is to turn generators from one-way " +"producers of information into both producers and consumers." +msgstr "" +"Кумулятивний ефект цих змін полягає в тому, щоб перетворити генераторів з " +"односторонніх виробників інформації на виробників і споживачів." + +msgid "" +"Generators also become **coroutines**, a more generalized form of " +"subroutines. Subroutines are entered at one point and exited at another " +"point (the top of the function, and a ``return`` statement), but coroutines " +"can be entered, exited, and resumed at many different points (the ``yield`` " +"statements)." +msgstr "" +"Генератори також стають **співпрограмами**, більш узагальненою формою " +"підпрограм. Підпрограми вводяться в одній точці та виходять з іншої точки " +"(верхня частина функції та оператор \"return\"), але підпрограми можна " +"входити, виходити та продовжувати в багатьох різних точках (оператори " +"\"yield\" )." + +msgid "Built-in functions" +msgstr "Вбудовані функції" + +msgid "" +"Let's look in more detail at built-in functions often used with iterators." +msgstr "" +"Давайте детальніше розглянемо вбудовані функції, які часто використовуються " +"з ітераторами." + +msgid "" +"Two of Python's built-in functions, :func:`map` and :func:`filter` duplicate " +"the features of generator expressions:" +msgstr "" +"Дві вбудовані функції Python, :func:`map` і :func:`filter` дублюють функції " +"генераторних виразів:" + +msgid "" +":func:`map(f, iterA, iterB, ...) ` returns an iterator over the sequence" +msgstr "" +":func:`map(f, iterA, iterB, ...) ` повертає ітератор у послідовності" + +msgid "" +"``f(iterA[0], iterB[0]), f(iterA[1], iterB[1]), f(iterA[2], iterB[2]), ...``." +msgstr "" +"``f(iterA[0], iterB[0]), f(iterA[1], iterB[1]), f(iterA[2], iterB[2]), ...``." + +msgid "You can of course achieve the same effect with a list comprehension." +msgstr "" +"Звичайно, ви можете досягти такого ж ефекту за допомогою розуміння списку." + +msgid "" +":func:`filter(predicate, iter) ` returns an iterator over all the " +"sequence elements that meet a certain condition, and is similarly duplicated " +"by list comprehensions. A **predicate** is a function that returns the " +"truth value of some condition; for use with :func:`filter`, the predicate " +"must take a single value." +msgstr "" +":func:`filter(predicate, iter) ` повертає ітератор над усіма " +"елементами послідовності, які відповідають певній умові, і подібним чином " +"дублюється за допомогою списків. **Предикат** – це функція, яка повертає " +"значення істинності певної умови; для використання з :func:`filter` предикат " +"має приймати одне значення." + +msgid "This can also be written as a list comprehension:" +msgstr "Це також можна записати як розуміння списку:" + +msgid "" +":func:`enumerate(iter, start=0) ` counts off the elements in the " +"iterable returning 2-tuples containing the count (from *start*) and each " +"element. ::" +msgstr "" +":func:`enumerate(iter, start=0) ` відраховує елементи в " +"ітераційному повертаючому 2-кортежі, що містить кількість (від *start*) і " +"кожен елемент. ::" + +msgid "" +">>> for item in enumerate(['subject', 'verb', 'object']):\n" +"... print(item)\n" +"(0, 'subject')\n" +"(1, 'verb')\n" +"(2, 'object')" +msgstr "" + +msgid "" +":func:`enumerate` is often used when looping through a list and recording " +"the indexes at which certain conditions are met::" +msgstr "" +":func:`enumerate` часто використовується під час циклічного перегляду списку " +"та запису індексів, при яких виконуються певні умови:" + +msgid "" +"f = open('data.txt', 'r')\n" +"for i, line in enumerate(f):\n" +" if line.strip() == '':\n" +" print('Blank line at line #%i' % i)" +msgstr "" + +msgid "" +":func:`sorted(iterable, key=None, reverse=False) ` collects all the " +"elements of the iterable into a list, sorts the list, and returns the sorted " +"result. The *key* and *reverse* arguments are passed through to the " +"constructed list's :meth:`~list.sort` method. ::" +msgstr "" +":func:`sorted(iterable, key=None, reverse=False) ` збирає всі " +"елементи iterable у список, сортує список і повертає відсортований " +"результат. Аргументи *key* і *reverse* передаються до методу :meth:`~list." +"sort` створеного списку. ::" + +msgid "" +">>> import random\n" +">>> # Generate 8 random numbers between [0, 10000)\n" +">>> rand_list = random.sample(range(10000), 8)\n" +">>> rand_list\n" +"[769, 7953, 9828, 6431, 8442, 9878, 6213, 2207]\n" +">>> sorted(rand_list)\n" +"[769, 2207, 6213, 6431, 7953, 8442, 9828, 9878]\n" +">>> sorted(rand_list, reverse=True)\n" +"[9878, 9828, 8442, 7953, 6431, 6213, 2207, 769]" +msgstr "" + +msgid "" +"(For a more detailed discussion of sorting, see the :ref:`sortinghowto`.)" +msgstr "" +"(Для більш детального обговорення сортування див. :ref:`sortinghowto`.)" + +msgid "" +"The :func:`any(iter) ` and :func:`all(iter) ` built-ins look at " +"the truth values of an iterable's contents. :func:`any` returns ``True`` if " +"any element in the iterable is a true value, and :func:`all` returns " +"``True`` if all of the elements are true values:" +msgstr "" +"Вбудовані функції :func:`any(iter) ` і :func:`all(iter) ` " +"переглядають значення істинності вмісту ітерованого елемента. :func:`any` " +"повертає ``True``, якщо будь-який елемент в iterable є істинним значенням, " +"а :func:`all` повертає ``True``, якщо всі елементи є істинними значеннями:" + +msgid "" +":func:`zip(iterA, iterB, ...) ` takes one element from each iterable " +"and returns them in a tuple::" +msgstr "" +":func:`zip(iterA, iterB, ...) ` бере по одному елементу з кожного " +"iterable і повертає їх у кортежі::" + +msgid "" +"zip(['a', 'b', 'c'], (1, 2, 3)) =>\n" +" ('a', 1), ('b', 2), ('c', 3)" +msgstr "" + +msgid "" +"It doesn't construct an in-memory list and exhaust all the input iterators " +"before returning; instead tuples are constructed and returned only if " +"they're requested. (The technical term for this behaviour is `lazy " +"evaluation `__.)" +msgstr "" +"Він не створює список у пам’яті та не вичерпує всі ітератори введення перед " +"поверненням; натомість кортежі створюються та повертаються лише за запитом. " +"(Технічний термін для такої поведінки — `лінива оцінка `__.)" + +msgid "" +"This iterator is intended to be used with iterables that are all of the same " +"length. If the iterables are of different lengths, the resulting stream " +"will be the same length as the shortest iterable. ::" +msgstr "" +"Цей ітератор призначений для використання з ітераторами, які мають однакову " +"довжину. Якщо ітератори мають різну довжину, результуючий потік буде такої ж " +"довжини, як і найкоротший ітератор. ::" + +msgid "" +"zip(['a', 'b'], (1, 2, 3)) =>\n" +" ('a', 1), ('b', 2)" +msgstr "" + +msgid "" +"You should avoid doing this, though, because an element may be taken from " +"the longer iterators and discarded. This means you can't go on to use the " +"iterators further because you risk skipping a discarded element." +msgstr "" +"Однак вам слід уникати цього, оскільки елемент може бути взято з довших " +"ітераторів і відкинуто. Це означає, що ви не можете продовжувати " +"використовувати ітератори, оскільки ризикуєте пропустити відкинутий елемент." + +msgid "The itertools module" +msgstr "Модуль itertools" + +msgid "" +"The :mod:`itertools` module contains a number of commonly used iterators as " +"well as functions for combining several iterators. This section will " +"introduce the module's contents by showing small examples." +msgstr "" + +msgid "The module's functions fall into a few broad classes:" +msgstr "Функції модуля поділяються на кілька широких класів:" + +msgid "Functions that create a new iterator based on an existing iterator." +msgstr "Функції, які створюють новий ітератор на основі існуючого ітератора." + +msgid "Functions for treating an iterator's elements as function arguments." +msgstr "Функції для обробки елементів ітератора як аргументів функції." + +msgid "Functions for selecting portions of an iterator's output." +msgstr "Функції для вибору частин виводу ітератора." + +msgid "A function for grouping an iterator's output." +msgstr "Функція для групування виводу ітератора." + +msgid "Creating new iterators" +msgstr "Створення нових ітераторів" + +msgid "" +":func:`itertools.count(start, step) ` returns an infinite " +"stream of evenly spaced values. You can optionally supply the starting " +"number, which defaults to 0, and the interval between numbers, which " +"defaults to 1::" +msgstr "" +":func:`itertools.count(start, step) ` повертає нескінченний " +"потік рівномірно розподілених значень. Додатково можна вказати початкове " +"число, яке за замовчуванням дорівнює 0, і інтервал між числами, який за " +"замовчуванням дорівнює 1::" + +msgid "" +"itertools.count() =>\n" +" 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ...\n" +"itertools.count(10) =>\n" +" 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, ...\n" +"itertools.count(10, 5) =>\n" +" 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, ..." +msgstr "" + +msgid "" +":func:`itertools.cycle(iter) ` saves a copy of the contents " +"of a provided iterable and returns a new iterator that returns its elements " +"from first to last. The new iterator will repeat these elements " +"infinitely. ::" +msgstr "" +":func:`itertools.cycle(iter) ` зберігає копію вмісту " +"наданого ітератора та повертає новий ітератор, який повертає елементи від " +"першого до останнього. Новий ітератор буде нескінченно повторювати ці " +"елементи. ::" + +msgid "" +"itertools.cycle([1, 2, 3, 4, 5]) =>\n" +" 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, ..." +msgstr "" + +msgid "" +":func:`itertools.repeat(elem, [n]) ` returns the provided " +"element *n* times, or returns the element endlessly if *n* is not " +"provided. ::" +msgstr "" +":func:`itertools.repeat(elem, [n]) ` повертає наданий " +"елемент *n* разів або нескінченно повертає елемент, якщо *n* не надано. ::" + +msgid "" +"itertools.repeat('abc') =>\n" +" abc, abc, abc, abc, abc, abc, abc, abc, abc, abc, ...\n" +"itertools.repeat('abc', 5) =>\n" +" abc, abc, abc, abc, abc" +msgstr "" + +msgid "" +":func:`itertools.chain(iterA, iterB, ...) ` takes an " +"arbitrary number of iterables as input, and returns all the elements of the " +"first iterator, then all the elements of the second, and so on, until all of " +"the iterables have been exhausted. ::" +msgstr "" +":func:`itertools.chain(iterA, iterB, ...) ` приймає " +"довільну кількість ітераторів як вхідні дані та повертає всі елементи " +"першого ітератора, потім усі елементи другого і так далі, доки усі ітерації " +"вичерпано. ::" + +msgid "" +"itertools.chain(['a', 'b', 'c'], (1, 2, 3)) =>\n" +" a, b, c, 1, 2, 3" +msgstr "" + +msgid "" +":func:`itertools.islice(iter, [start], stop, [step]) ` " +"returns a stream that's a slice of the iterator. With a single *stop* " +"argument, it will return the first *stop* elements. If you supply a " +"starting index, you'll get *stop-start* elements, and if you supply a value " +"for *step*, elements will be skipped accordingly. Unlike Python's string " +"and list slicing, you can't use negative values for *start*, *stop*, or " +"*step*. ::" +msgstr "" +":func:`itertools.islice(iter, [start], stop, [step]) ` " +"повертає потік, який є фрагментом ітератора. З одним аргументом *stop* він " +"повертає перші елементи *stop*. Якщо ви вкажете початковий індекс, ви " +"отримаєте елементи *stop-start*, а якщо ви вкажете значення для *step*, " +"елементи будуть відповідно пропущені. На відміну від нарізки рядків і " +"списків Python, ви не можете використовувати від’ємні значення для *start*, " +"*stop* або *step*. ::" + +msgid "" +"itertools.islice(range(10), 8) =>\n" +" 0, 1, 2, 3, 4, 5, 6, 7\n" +"itertools.islice(range(10), 2, 8) =>\n" +" 2, 3, 4, 5, 6, 7\n" +"itertools.islice(range(10), 2, 8, 2) =>\n" +" 2, 4, 6" +msgstr "" + +msgid "" +":func:`itertools.tee(iter, [n]) ` replicates an iterator; it " +"returns *n* independent iterators that will all return the contents of the " +"source iterator. If you don't supply a value for *n*, the default is 2. " +"Replicating iterators requires saving some of the contents of the source " +"iterator, so this can consume significant memory if the iterator is large " +"and one of the new iterators is consumed more than the others. ::" +msgstr "" +":func:`itertools.tee(iter, [n]) ` повторює ітератор; він " +"повертає *n* незалежних ітераторів, які повертатимуть вміст вихідного " +"ітератора. Якщо ви не вкажете значення для *n*, за замовчуванням буде 2. " +"Реплікація ітераторів вимагає збереження частини вмісту вихідного ітератора, " +"тому це може споживати значну кількість пам’яті, якщо ітератор великий і " +"один із нових ітераторів споживається більше ніж інші. ::" + +msgid "" +"itertools.tee( itertools.count() ) =>\n" +" iterA, iterB\n" +"\n" +"where iterA ->\n" +" 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ...\n" +"\n" +"and iterB ->\n" +" 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ..." +msgstr "" + +msgid "Calling functions on elements" +msgstr "Виклик функцій на елементах" + +msgid "" +"The :mod:`operator` module contains a set of functions corresponding to " +"Python's operators. Some examples are :func:`operator.add(a, b) ` (adds two values), :func:`operator.ne(a, b) ` (same as " +"``a != b``), and :func:`operator.attrgetter('id') ` " +"(returns a callable that fetches the ``.id`` attribute)." +msgstr "" +"Модуль :mod:`operator` містить набір функцій, що відповідають операторам " +"Python. Деякі приклади: :func:`operator.add(a, b) ` (додає два " +"значення), :func:`operator.ne(a, b) ` (те саме, що ``a != b``), " +"і :func:`operator.attrgetter('id') ` (повертає виклик, " +"який отримує атрибут ``.id``)." + +msgid "" +":func:`itertools.starmap(func, iter) ` assumes that the " +"iterable will return a stream of tuples, and calls *func* using these tuples " +"as the arguments::" +msgstr "" +":func:`itertools.starmap(func, iter) ` припускає, що " +"iterable поверне потік кортежів, і викликає *func*, використовуючи ці " +"кортежі як аргументи:" + +msgid "" +"itertools.starmap(os.path.join,\n" +" [('/bin', 'python'), ('/usr', 'bin', 'java'),\n" +" ('/usr', 'bin', 'perl'), ('/usr', 'bin', 'ruby')])\n" +"=>\n" +" /bin/python, /usr/bin/java, /usr/bin/perl, /usr/bin/ruby" +msgstr "" + +msgid "Selecting elements" +msgstr "Вибір елементів" + +msgid "" +"Another group of functions chooses a subset of an iterator's elements based " +"on a predicate." +msgstr "" +"Інша група функцій вибирає підмножину елементів ітератора на основі " +"предикату." + +msgid "" +":func:`itertools.filterfalse(predicate, iter) ` is " +"the opposite of :func:`filter`, returning all elements for which the " +"predicate returns false::" +msgstr "" +":func:`itertools.filterfalse(predicate, iter) ` є " +"протилежністю :func:`filter`, повертаючи всі елементи, для яких предикат " +"повертає false::" + +msgid "" +"itertools.filterfalse(is_even, itertools.count()) =>\n" +" 1, 3, 5, 7, 9, 11, 13, 15, ..." +msgstr "" + +msgid "" +":func:`itertools.takewhile(predicate, iter) ` returns " +"elements for as long as the predicate returns true. Once the predicate " +"returns false, the iterator will signal the end of its results. ::" +msgstr "" +":func:`itertools.takewhile(predicate, iter) ` повертає " +"елементи до тих пір, поки предикат повертає true. Як тільки предикат " +"повертає false, ітератор сигналізує про закінчення своїх результатів. ::" + +msgid "" +"def less_than_10(x):\n" +" return x < 10\n" +"\n" +"itertools.takewhile(less_than_10, itertools.count()) =>\n" +" 0, 1, 2, 3, 4, 5, 6, 7, 8, 9\n" +"\n" +"itertools.takewhile(is_even, itertools.count()) =>\n" +" 0" +msgstr "" + +msgid "" +":func:`itertools.dropwhile(predicate, iter) ` discards " +"elements while the predicate returns true, and then returns the rest of the " +"iterable's results. ::" +msgstr "" +":func:`itertools.dropwhile(predicate, iter) ` відкидає " +"елементи, поки предикат повертає true, а потім повертає решту результатів " +"ітерації. ::" + +msgid "" +"itertools.dropwhile(less_than_10, itertools.count()) =>\n" +" 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, ...\n" +"\n" +"itertools.dropwhile(is_even, itertools.count()) =>\n" +" 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ..." +msgstr "" + +msgid "" +":func:`itertools.compress(data, selectors) ` takes two " +"iterators and returns only those elements of *data* for which the " +"corresponding element of *selectors* is true, stopping whenever either one " +"is exhausted::" +msgstr "" +":func:`itertools.compress(data, selectors) ` приймає два " +"ітератори та повертає лише ті елементи *data*, для яких відповідний елемент " +"*selectors* є істинним, зупиняючись щоразу, коли один із них вичерпується::" + +msgid "" +"itertools.compress([1, 2, 3, 4, 5], [True, True, False, False, True]) =>\n" +" 1, 2, 5" +msgstr "" + +msgid "Combinatoric functions" +msgstr "Комбінаторні функції" + +msgid "" +"The :func:`itertools.combinations(iterable, r) ` " +"returns an iterator giving all possible *r*-tuple combinations of the " +"elements contained in *iterable*. ::" +msgstr "" +":func:`itertools.combinations(iterable, r) ` " +"повертає ітератор, що містить усі можливі *r*-кортежні комбінації елементів, " +"що містяться в *iterable*. ::" + +msgid "" +"itertools.combinations([1, 2, 3, 4, 5], 2) =>\n" +" (1, 2), (1, 3), (1, 4), (1, 5),\n" +" (2, 3), (2, 4), (2, 5),\n" +" (3, 4), (3, 5),\n" +" (4, 5)\n" +"\n" +"itertools.combinations([1, 2, 3, 4, 5], 3) =>\n" +" (1, 2, 3), (1, 2, 4), (1, 2, 5), (1, 3, 4), (1, 3, 5), (1, 4, 5),\n" +" (2, 3, 4), (2, 3, 5), (2, 4, 5),\n" +" (3, 4, 5)" +msgstr "" + +msgid "" +"The elements within each tuple remain in the same order as *iterable* " +"returned them. For example, the number 1 is always before 2, 3, 4, or 5 in " +"the examples above. A similar function, :func:`itertools." +"permutations(iterable, r=None) `, removes this " +"constraint on the order, returning all possible arrangements of length *r*::" +msgstr "" +"Елементи в кожному кортежі залишаються в тому самому порядку, у якому їх " +"повернув *iterable*. Наприклад, число 1 завжди стоїть перед 2, 3, 4 або 5 у " +"наведених вище прикладах. Подібна функція, :func:`itertools." +"permutations(iterable, r=None) `, усуває це " +"обмеження на порядок, повертаючи всі можливі розташування довжини *r*::" + +msgid "" +"itertools.permutations([1, 2, 3, 4, 5], 2) =>\n" +" (1, 2), (1, 3), (1, 4), (1, 5),\n" +" (2, 1), (2, 3), (2, 4), (2, 5),\n" +" (3, 1), (3, 2), (3, 4), (3, 5),\n" +" (4, 1), (4, 2), (4, 3), (4, 5),\n" +" (5, 1), (5, 2), (5, 3), (5, 4)\n" +"\n" +"itertools.permutations([1, 2, 3, 4, 5]) =>\n" +" (1, 2, 3, 4, 5), (1, 2, 3, 5, 4), (1, 2, 4, 3, 5),\n" +" ...\n" +" (5, 4, 3, 2, 1)" +msgstr "" + +msgid "" +"If you don't supply a value for *r* the length of the iterable is used, " +"meaning that all the elements are permuted." +msgstr "" +"Якщо ви не вказуєте значення для *r*, використовується довжина ітерованого, " +"що означає, що всі елементи переставлені." + +msgid "" +"Note that these functions produce all of the possible combinations by " +"position and don't require that the contents of *iterable* are unique::" +msgstr "" +"Зауважте, що ці функції створюють усі можливі комбінації за позицією та не " +"вимагають, щоб вміст *iterable* був унікальним::" + +msgid "" +"itertools.permutations('aba', 3) =>\n" +" ('a', 'b', 'a'), ('a', 'a', 'b'), ('b', 'a', 'a'),\n" +" ('b', 'a', 'a'), ('a', 'a', 'b'), ('a', 'b', 'a')" +msgstr "" + +msgid "" +"The identical tuple ``('a', 'a', 'b')`` occurs twice, but the two 'a' " +"strings came from different positions." +msgstr "" +"Ідентичний кортеж ``('a', 'a', 'b')`` зустрічається двічі, але два рядки 'a' " +"походять з різних позицій." + +msgid "" +"The :func:`itertools.combinations_with_replacement(iterable, r) ` function relaxes a different constraint: " +"elements can be repeated within a single tuple. Conceptually an element is " +"selected for the first position of each tuple and then is replaced before " +"the second element is selected. ::" +msgstr "" +"Функція :func:`itertools.combinations_with_replacement(iterable, r) " +"` послаблює інше обмеження: " +"елементи можуть повторюватися в одному кортежі. Концептуально елемент " +"вибирається для першої позиції кожного кортежу, а потім замінюється перед " +"вибором другого елемента. ::" + +msgid "" +"itertools.combinations_with_replacement([1, 2, 3, 4, 5], 2) =>\n" +" (1, 1), (1, 2), (1, 3), (1, 4), (1, 5),\n" +" (2, 2), (2, 3), (2, 4), (2, 5),\n" +" (3, 3), (3, 4), (3, 5),\n" +" (4, 4), (4, 5),\n" +" (5, 5)" +msgstr "" + +msgid "Grouping elements" +msgstr "Групування елементів" + +msgid "" +"The last function I'll discuss, :func:`itertools.groupby(iter, " +"key_func=None) `, is the most complicated. " +"``key_func(elem)`` is a function that can compute a key value for each " +"element returned by the iterable. If you don't supply a key function, the " +"key is simply each element itself." +msgstr "" +"Остання функція, яку я розповім, :func:`itertools.groupby(iter, " +"key_func=None) `, є найскладнішою. ``key_func(elem)`` - " +"це функція, яка може обчислити значення ключа для кожного елемента, " +"повернутого ітерованим. Якщо ви не надаєте ключову функцію, ключем буде " +"просто кожен елемент сам по собі." + +msgid "" +":func:`~itertools.groupby` collects all the consecutive elements from the " +"underlying iterable that have the same key value, and returns a stream of 2-" +"tuples containing a key value and an iterator for the elements with that key." +msgstr "" +":func:`~itertools.groupby` збирає всі послідовні елементи з основного " +"ітератора, які мають однакове значення ключа, і повертає потік 2-кортежів, " +"що містить значення ключа та ітератор для елементів із цим ключем." + +msgid "" +"city_list = [('Decatur', 'AL'), ('Huntsville', 'AL'), ('Selma', 'AL'),\n" +" ('Anchorage', 'AK'), ('Nome', 'AK'),\n" +" ('Flagstaff', 'AZ'), ('Phoenix', 'AZ'), ('Tucson', 'AZ'),\n" +" ...\n" +" ]\n" +"\n" +"def get_state(city_state):\n" +" return city_state[1]\n" +"\n" +"itertools.groupby(city_list, get_state) =>\n" +" ('AL', iterator-1),\n" +" ('AK', iterator-2),\n" +" ('AZ', iterator-3), ...\n" +"\n" +"where\n" +"iterator-1 =>\n" +" ('Decatur', 'AL'), ('Huntsville', 'AL'), ('Selma', 'AL')\n" +"iterator-2 =>\n" +" ('Anchorage', 'AK'), ('Nome', 'AK')\n" +"iterator-3 =>\n" +" ('Flagstaff', 'AZ'), ('Phoenix', 'AZ'), ('Tucson', 'AZ')" +msgstr "" + +msgid "" +":func:`~itertools.groupby` assumes that the underlying iterable's contents " +"will already be sorted based on the key. Note that the returned iterators " +"also use the underlying iterable, so you have to consume the results of " +"iterator-1 before requesting iterator-2 and its corresponding key." +msgstr "" +":func:`~itertools.groupby` припускає, що вміст базового ітератора вже буде " +"відсортовано на основі ключа. Зверніть увагу, що повернуті ітератори також " +"використовують базовий ітератор, тому ви повинні споживати результати " +"ітератора-1 перед запитом ітератора-2 та його відповідного ключа." + +msgid "The functools module" +msgstr "Модуль functools" + +msgid "" +"The :mod:`functools` module contains some higher-order functions. A **higher-" +"order function** takes one or more functions as input and returns a new " +"function. The most useful tool in this module is the :func:`functools." +"partial` function." +msgstr "" + +msgid "" +"For programs written in a functional style, you'll sometimes want to " +"construct variants of existing functions that have some of the parameters " +"filled in. Consider a Python function ``f(a, b, c)``; you may wish to create " +"a new function ``g(b, c)`` that's equivalent to ``f(1, b, c)``; you're " +"filling in a value for one of ``f()``'s parameters. This is called " +"\"partial function application\"." +msgstr "" +"Для програм, написаних у функціональному стилі, ви іноді захочете побудувати " +"варіанти існуючих функцій із заповненими деякими параметрами. Розглянемо " +"функцію Python ``f(a, b, c)``; ви можете створити нову функцію ``g(b, c)``, " +"еквівалентну ``f(1, b, c)``; ви вводите значення для одного з параметрів " +"``f()``. Це називається \"часткове застосування функції\"." + +msgid "" +"The constructor for :func:`~functools.partial` takes the arguments " +"``(function, arg1, arg2, ..., kwarg1=value1, kwarg2=value2)``. The " +"resulting object is callable, so you can just call it to invoke ``function`` " +"with the filled-in arguments." +msgstr "" +"Конструктор для :func:`~functools.partial` приймає аргументи ``(функція, " +"arg1, arg2, ..., kwarg1=value1, kwarg2=value2)``. Отриманий об’єкт можна " +"викликати, тому ви можете просто викликати його, щоб викликати ``функцію`` " +"із заповненими аргументами." + +msgid "Here's a small but realistic example::" +msgstr "Ось маленький, але реалістичний приклад:" + +msgid "" +"import functools\n" +"\n" +"def log(message, subsystem):\n" +" \"\"\"Write the contents of 'message' to the specified subsystem.\"\"\"\n" +" print('%s: %s' % (subsystem, message))\n" +" ...\n" +"\n" +"server_log = functools.partial(log, subsystem='server')\n" +"server_log('Unable to open socket')" +msgstr "" + +msgid "" +":func:`functools.reduce(func, iter, [initial_value]) ` " +"cumulatively performs an operation on all the iterable's elements and, " +"therefore, can't be applied to infinite iterables. *func* must be a function " +"that takes two elements and returns a single value. :func:`functools." +"reduce` takes the first two elements A and B returned by the iterator and " +"calculates ``func(A, B)``. It then requests the third element, C, " +"calculates ``func(func(A, B), C)``, combines this result with the fourth " +"element returned, and continues until the iterable is exhausted. If the " +"iterable returns no values at all, a :exc:`TypeError` exception is raised. " +"If the initial value is supplied, it's used as a starting point and " +"``func(initial_value, A)`` is the first calculation. ::" +msgstr "" +":func:`functools.reduce(func, iter, [initial_value]) ` " +"кумулятивно виконує операцію над усіма елементами iterable і, отже, не може " +"бути застосовано до нескінченних iterables. *func* має бути функцією, яка " +"приймає два елементи та повертає одне значення. :func:`functools.reduce` " +"бере перші два елементи A і B, повернуті ітератором, і обчислює ``func(A, " +"B)``. Потім він запитує третій елемент, C, обчислює ``func(func(A, B), C)``, " +"поєднує цей результат із повернутим четвертим елементом і продовжує роботу, " +"доки не вичерпається ітерація. Якщо ітерація не повертає жодних значень, " +"виникає виняток :exc:`TypeError`. Якщо вказано початкове значення, воно " +"використовується як початкова точка, а ``func(initial_value, A)`` є першим " +"обчисленням. ::" + +msgid "" +">>> import operator, functools\n" +">>> functools.reduce(operator.concat, ['A', 'BB', 'C'])\n" +"'ABBC'\n" +">>> functools.reduce(operator.concat, [])\n" +"Traceback (most recent call last):\n" +" ...\n" +"TypeError: reduce() of empty sequence with no initial value\n" +">>> functools.reduce(operator.mul, [1, 2, 3], 1)\n" +"6\n" +">>> functools.reduce(operator.mul, [], 1)\n" +"1" +msgstr "" + +msgid "" +"If you use :func:`operator.add` with :func:`functools.reduce`, you'll add up " +"all the elements of the iterable. This case is so common that there's a " +"special built-in called :func:`sum` to compute it:" +msgstr "" +"Якщо ви використовуєте :func:`operator.add` з :func:`functools.reduce`, ви " +"додасте всі елементи iterable. Цей випадок настільки поширений, що для його " +"обчислення існує спеціальна вбудована функція під назвою :func:`sum`:" + +msgid "" +"For many uses of :func:`functools.reduce`, though, it can be clearer to just " +"write the obvious :keyword:`for` loop::" +msgstr "" +"Однак для багатьох застосувань :func:`functools.reduce` може бути " +"зрозумілішим просто написати очевидний :keyword:`for` цикл::" + +msgid "" +"import functools\n" +"# Instead of:\n" +"product = functools.reduce(operator.mul, [1, 2, 3], 1)\n" +"\n" +"# You can write:\n" +"product = 1\n" +"for i in [1, 2, 3]:\n" +" product *= i" +msgstr "" + +msgid "" +"A related function is :func:`itertools.accumulate(iterable, func=operator." +"add) `. It performs the same calculation, but instead " +"of returning only the final result, :func:`~itertools.accumulate` returns an " +"iterator that also yields each partial result::" +msgstr "" + +msgid "" +"itertools.accumulate([1, 2, 3, 4, 5]) =>\n" +" 1, 3, 6, 10, 15\n" +"\n" +"itertools.accumulate([1, 2, 3, 4, 5], operator.mul) =>\n" +" 1, 2, 6, 24, 120" +msgstr "" + +msgid "The operator module" +msgstr "Операторський модуль" + +msgid "" +"The :mod:`operator` module was mentioned earlier. It contains a set of " +"functions corresponding to Python's operators. These functions are often " +"useful in functional-style code because they save you from writing trivial " +"functions that perform a single operation." +msgstr "" +"Модуль :mod:`operator` згадувався раніше. Він містить набір функцій, що " +"відповідають операторам Python. Ці функції часто корисні в коді " +"функціонального стилю, оскільки вони позбавляють вас від написання " +"тривіальних функцій, які виконують одну операцію." + +msgid "Some of the functions in this module are:" +msgstr "Деякі з функцій цього модуля:" + +msgid "" +"Math operations: ``add()``, ``sub()``, ``mul()``, ``floordiv()``, " +"``abs()``, ..." +msgstr "" +"Математичні операції: ``add()``, ``sub()``, ``mul()``, ``floordiv()``, " +"``abs()``, ..." + +msgid "Logical operations: ``not_()``, ``truth()``." +msgstr "Логічні операції: ``not_()``, ``truth()``." + +msgid "Bitwise operations: ``and_()``, ``or_()``, ``invert()``." +msgstr "Побітові операції: ``and_()``, ``or_()``, ``invert()``." + +msgid "" +"Comparisons: ``eq()``, ``ne()``, ``lt()``, ``le()``, ``gt()``, and ``ge()``." +msgstr "" +"Порівняння: ``eq()``, ``ne()``, ``lt()``, ``le()``, ``gt()`` і ``ge()`` ." + +msgid "Object identity: ``is_()``, ``is_not()``." +msgstr "Ідентифікація об'єкта: ``is_()``, ``is_not()``." + +msgid "Consult the operator module's documentation for a complete list." +msgstr "" +"Зверніться до документації модуля оператора, щоб отримати повний список." + +msgid "Small functions and the lambda expression" +msgstr "Малі функції та лямбда-вираз" + +msgid "" +"When writing functional-style programs, you'll often need little functions " +"that act as predicates or that combine elements in some way." +msgstr "" +"Під час написання програм у функціональному стилі вам часто знадобляться " +"невеликі функції, які виконують роль предикатів або якимось чином поєднують " +"елементи." + +msgid "" +"If there's a Python built-in or a module function that's suitable, you don't " +"need to define a new function at all::" +msgstr "" +"Якщо є вбудована функція Python або функція модуля, яка підходить, вам " +"взагалі не потрібно визначати нову функцію::" + +msgid "" +"stripped_lines = [line.strip() for line in lines]\n" +"existing_files = filter(os.path.exists, file_list)" +msgstr "" + +msgid "" +"If the function you need doesn't exist, you need to write it. One way to " +"write small functions is to use the :keyword:`lambda` expression. " +"``lambda`` takes a number of parameters and an expression combining these " +"parameters, and creates an anonymous function that returns the value of the " +"expression::" +msgstr "" +"Якщо потрібної вам функції не існує, її потрібно написати. Один із способів " +"написання невеликих функцій — це використання виразу :keyword:`lambda`. " +"``лямбда`` приймає кілька параметрів і вираз, що поєднує ці параметри, і " +"створює анонімну функцію, яка повертає значення виразу::" + +msgid "" +"adder = lambda x, y: x+y\n" +"\n" +"print_assign = lambda name, value: name + '=' + str(value)" +msgstr "" + +msgid "" +"An alternative is to just use the ``def`` statement and define a function in " +"the usual way::" +msgstr "" +"Альтернативою є просто використання оператора ``def`` і визначення функції " +"звичайним способом::" + +msgid "" +"def adder(x, y):\n" +" return x + y\n" +"\n" +"def print_assign(name, value):\n" +" return name + '=' + str(value)" +msgstr "" + +msgid "" +"Which alternative is preferable? That's a style question; my usual course " +"is to avoid using ``lambda``." +msgstr "" +"Яка альтернатива є кращою? Це питання стилю; мій звичайний курс — уникати " +"використання ``лямбда``." + +msgid "" +"One reason for my preference is that ``lambda`` is quite limited in the " +"functions it can define. The result has to be computable as a single " +"expression, which means you can't have multiway ``if... elif... else`` " +"comparisons or ``try... except`` statements. If you try to do too much in a " +"``lambda`` statement, you'll end up with an overly complicated expression " +"that's hard to read. Quick, what's the following code doing? ::" +msgstr "" +"Однією з причин моїх переваг є те, що ``лямбда`` досить обмежена у функціях, " +"які вона може визначати. Результат має бути обчислюваним як один вираз, що " +"означає, що ви не можете мати багатосторонні порівняння ``if... elif... " +"else`` або ``try... osim`` операторів. Якщо ви спробуєте зробити занадто " +"багато в операторі ``лямбда``, ви отримаєте надто складний вираз, який важко " +"прочитати. Швидко, що робить наступний код? ::" + +msgid "" +"import functools\n" +"total = functools.reduce(lambda a, b: (0, a[1] + b[1]), items)[1]" +msgstr "" + +msgid "" +"You can figure it out, but it takes time to disentangle the expression to " +"figure out what's going on. Using a short nested ``def`` statements makes " +"things a little bit better::" +msgstr "" +"Ви можете це зрозуміти, але потрібен час, щоб розібрати вираз, щоб " +"зрозуміти, що відбувається. Використання коротких вкладених операторів " +"``def`` покращує ситуацію:" + +msgid "" +"import functools\n" +"def combine(a, b):\n" +" return 0, a[1] + b[1]\n" +"\n" +"total = functools.reduce(combine, items)[1]" +msgstr "" + +msgid "But it would be best of all if I had simply used a ``for`` loop::" +msgstr "Але було б найкраще, якби я просто використав цикл ``for``::" + +msgid "" +"total = 0\n" +"for a, b in items:\n" +" total += b" +msgstr "" + +msgid "Or the :func:`sum` built-in and a generator expression::" +msgstr "Або вбудований :func:`sum` і вираз генератора::" + +msgid "total = sum(b for a, b in items)" +msgstr "" + +msgid "" +"Many uses of :func:`functools.reduce` are clearer when written as ``for`` " +"loops." +msgstr "" +"Багато способів використання :func:`functools.reduce` зрозуміліші, коли " +"записуються як цикли ``for``." + +msgid "" +"Fredrik Lundh once suggested the following set of rules for refactoring uses " +"of ``lambda``:" +msgstr "" +"Фредрік Лунд одного разу запропонував наступний набір правил для " +"рефакторингу використання ``лямбда``:" + +msgid "Write a lambda function." +msgstr "Напишіть лямбда-функцію." + +msgid "Write a comment explaining what the heck that lambda does." +msgstr "Напишіть коментар, пояснюючи, що в біса робить ця лямбда." + +msgid "" +"Study the comment for a while, and think of a name that captures the essence " +"of the comment." +msgstr "" +"Вивчіть коментар деякий час і придумайте назву, яка б передавала суть " +"коментаря." + +msgid "Convert the lambda to a def statement, using that name." +msgstr "Перетворіть лямбда-вираз на оператор def, використовуючи це ім’я." + +msgid "Remove the comment." +msgstr "Видалити коментар." + +msgid "" +"I really like these rules, but you're free to disagree about whether this " +"lambda-free style is better." +msgstr "" +"Мені дуже подобаються ці правила, але ви можете не погоджуватися щодо того, " +"чи цей стиль без лямбда кращий." + +msgid "Revision History and Acknowledgements" +msgstr "Історія переглядів і подяки" + +msgid "" +"The author would like to thank the following people for offering " +"suggestions, corrections and assistance with various drafts of this article: " +"Ian Bicking, Nick Coghlan, Nick Efford, Raymond Hettinger, Jim Jewett, Mike " +"Krell, Leandro Lameiro, Jussi Salmela, Collin Winter, Blake Winton." +msgstr "" +"Автор хотів би подякувати наступним особам за пропозиції, виправлення та " +"допомогу з різними чернетками цієї статті: Іен Бікінґ, Нік Коглан, Нік " +"Еффорд, Реймонд Геттінгер, Джим Джеветт, Майк Крелл, Леандро Ламейро, Юссі " +"Салмела, Коллін Вінтер, Блейк Вінтон." + +msgid "Version 0.1: posted June 30 2006." +msgstr "Версія 0.1: опубліковано 30 червня 2006 р." + +msgid "Version 0.11: posted July 1 2006. Typo fixes." +msgstr "" +"Версія 0.11: опубліковано 1 липня 2006 р. Виправлення друкарських помилок." + +msgid "" +"Version 0.2: posted July 10 2006. Merged genexp and listcomp sections into " +"one. Typo fixes." +msgstr "" +"Версія 0.2: опубліковано 10 липня 2006 р. Об’єднано розділи genexp і " +"listcomp в один. Виправлення друкарських помилок." + +msgid "" +"Version 0.21: Added more references suggested on the tutor mailing list." +msgstr "" +"Версія 0.21: додано більше посилань, запропонованих у списку розсилки " +"викладачів." + +msgid "" +"Version 0.30: Adds a section on the ``functional`` module written by Collin " +"Winter; adds short section on the operator module; a few other edits." +msgstr "" +"Версія 0.30: додано розділ про ``функціональний`` модуль, написаний Колліном " +"Вінтером; додає короткий розділ про модуль оператора; кілька інших правок." + +msgid "References" +msgstr "Список літератури" + +msgid "General" +msgstr "Загальний" + +msgid "" +"**Structure and Interpretation of Computer Programs**, by Harold Abelson and " +"Gerald Jay Sussman with Julie Sussman. The book can be found at https://" +"mitpress.mit.edu/sicp. In this classic textbook of computer science, " +"chapters 2 and 3 discuss the use of sequences and streams to organize the " +"data flow inside a program. The book uses Scheme for its examples, but many " +"of the design approaches described in these chapters are applicable to " +"functional-style Python code." +msgstr "" + +msgid "" +"https://www.defmacro.org/ramblings/fp.html: A general introduction to " +"functional programming that uses Java examples and has a lengthy historical " +"introduction." +msgstr "" + +msgid "" +"https://en.wikipedia.org/wiki/Functional_programming: General Wikipedia " +"entry describing functional programming." +msgstr "" +"https://en.wikipedia.org/wiki/Functional_programming: загальний запис у " +"Вікіпедії, що описує функціональне програмування." + +msgid "https://en.wikipedia.org/wiki/Coroutine: Entry for coroutines." +msgstr "https://en.wikipedia.org/wiki/Coroutine: Запис для співпрограм." + +msgid "" +"https://en.wikipedia.org/wiki/Partial_application: Entry for the concept of " +"partial function application." +msgstr "" + +msgid "" +"https://en.wikipedia.org/wiki/Currying: Entry for the concept of currying." +msgstr "https://en.wikipedia.org/wiki/Currying: Початок поняття каррі." + +msgid "Python-specific" +msgstr "Специфічний для Python" + +msgid "" +"https://gnosis.cx/TPiP/: The first chapter of David Mertz's book :title-" +"reference:`Text Processing in Python` discusses functional programming for " +"text processing, in the section titled \"Utilizing Higher-Order Functions in " +"Text Processing\"." +msgstr "" + +msgid "" +"Mertz also wrote a 3-part series of articles on functional programming for " +"IBM's DeveloperWorks site; see `part 1 `__, `part 2 `__, and " +"`part 3 `__," +msgstr "" +"Мерц також написав серію статей із 3 частин про функціональне програмування " +"для сайту IBM DeveloperWorks; див. `частина 1 `__, `частина 2 `__ та `частина 3 `__," + +msgid "Python documentation" +msgstr "Документація Python" + +msgid "Documentation for the :mod:`itertools` module." +msgstr "Документація для модуля :mod:`itertools`." + +msgid "Documentation for the :mod:`functools` module." +msgstr "Документація для модуля :mod:`functools`." + +msgid "Documentation for the :mod:`operator` module." +msgstr "Документація для модуля :mod:`operator`." + +msgid ":pep:`289`: \"Generator Expressions\"" +msgstr ":pep:`289`: \"Генератор виразів\"" + +msgid "" +":pep:`342`: \"Coroutines via Enhanced Generators\" describes the new " +"generator features in Python 2.5." +msgstr "" +":pep:`342`: \"Сопрограми через розширені генератори\" описує нові функції " +"генератора в Python 2.5." diff --git a/howto/gdb_helpers.po b/howto/gdb_helpers.po new file mode 100644 index 000000000..76115d9d9 --- /dev/null +++ b/howto/gdb_helpers.po @@ -0,0 +1,706 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2024-02-25 01:11+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Debugging C API extensions and CPython Internals with GDB" +msgstr "" + +msgid "" +"This document explains how the Python GDB extension, ``python-gdb.py``, can " +"be used with the GDB debugger to debug CPython extensions and the CPython " +"interpreter itself." +msgstr "" + +msgid "" +"When debugging low-level problems such as crashes or deadlocks, a low-level " +"debugger, such as GDB, is useful to diagnose and correct the issue. By " +"default, GDB (or any of its front-ends) doesn't support high-level " +"information specific to the CPython interpreter." +msgstr "" + +msgid "" +"The ``python-gdb.py`` extension adds CPython interpreter information to GDB. " +"The extension helps introspect the stack of currently executing Python " +"functions. Given a Python object represented by a :c:expr:`PyObject *` " +"pointer, the extension surfaces the type and value of the object." +msgstr "" + +msgid "" +"Developers who are working on CPython extensions or tinkering with parts of " +"CPython that are written in C can use this document to learn how to use the " +"``python-gdb.py`` extension with GDB." +msgstr "" + +msgid "" +"This document assumes that you are familiar with the basics of GDB and the " +"CPython C API. It consolidates guidance from the `devguide `_ and the `Python wiki `_." +msgstr "" + +msgid "Prerequisites" +msgstr "" + +msgid "You need to have:" +msgstr "" + +msgid "" +"GDB 7 or later. (For earlier versions of GDB, see ``Misc/gdbinit`` in the " +"sources of Python 3.11 or earlier.)" +msgstr "" + +msgid "" +"GDB-compatible debugging information for Python and any extension you are " +"debugging." +msgstr "" + +msgid "The ``python-gdb.py`` extension." +msgstr "" + +msgid "" +"The extension is built with Python, but might be distributed separately or " +"not at all. Below, we include tips for a few common systems as examples. " +"Note that even if the instructions match your system, they might be outdated." +msgstr "" + +msgid "Setup with Python built from source" +msgstr "" + +msgid "" +"When you build CPython from source, debugging information should be " +"available, and the build should add a ``python-gdb.py`` file to the root " +"directory of your repository." +msgstr "" + +msgid "" +"To activate support, you must add the directory containing ``python-gdb.py`` " +"to GDB's \"auto-load-safe-path\". If you haven't done this, recent versions " +"of GDB will print out a warning with instructions on how to do this." +msgstr "" + +msgid "" +"If you do not see instructions for your version of GDB, put this in your " +"configuration file (``~/.gdbinit`` or ``~/.config/gdb/gdbinit``)::" +msgstr "" + +msgid "add-auto-load-safe-path /path/to/cpython" +msgstr "" + +msgid "You can also add multiple paths, separated by ``:``." +msgstr "" + +msgid "Setup for Python from a Linux distro" +msgstr "" + +msgid "" +"Most Linux systems provide debug information for the system Python in a " +"package called ``python-debuginfo``, ``python-dbg`` or similar. For example:" +msgstr "" + +msgid "Fedora:" +msgstr "" + +msgid "" +"sudo dnf install gdb\n" +"sudo dnf debuginfo-install python3" +msgstr "" + +msgid "Ubuntu:" +msgstr "" + +msgid "sudo apt install gdb python3-dbg" +msgstr "" + +msgid "" +"On several recent Linux systems, GDB can download debugging symbols " +"automatically using *debuginfod*. However, this will not install the " +"``python-gdb.py`` extension; you generally do need to install the debug info " +"package separately." +msgstr "" + +msgid "Using the Debug build and Development mode" +msgstr "" + +msgid "For easier debugging, you might want to:" +msgstr "" + +msgid "" +"Use a :ref:`debug build ` of Python. (When building from " +"source, use ``configure --with-pydebug``. On Linux distros, install and run " +"a package like ``python-debug`` or ``python-dbg``, if available.)" +msgstr "" + +msgid "Use the runtime :ref:`development mode ` (``-X dev``)." +msgstr "" + +msgid "" +"Both enable extra assertions and disable some optimizations. Sometimes this " +"hides the bug you are trying to find, but in most cases they make the " +"process easier." +msgstr "" + +msgid "Using the ``python-gdb`` extension" +msgstr "" + +msgid "" +"When the extension is loaded, it provides two main features: pretty printers " +"for Python values, and additional commands." +msgstr "" + +msgid "Pretty-printers" +msgstr "" + +msgid "" +"This is what a GDB backtrace looks like (truncated) when this extension is " +"enabled::" +msgstr "" + +msgid "" +"#0 0x000000000041a6b1 in PyObject_Malloc (nbytes=Cannot access memory at " +"address 0x7fffff7fefe8\n" +") at Objects/obmalloc.c:748\n" +"#1 0x000000000041b7c0 in _PyObject_DebugMallocApi (id=111 'o', nbytes=24) " +"at Objects/obmalloc.c:1445\n" +"#2 0x000000000041b717 in _PyObject_DebugMalloc (nbytes=24) at Objects/" +"obmalloc.c:1412\n" +"#3 0x000000000044060a in _PyUnicode_New (length=11) at Objects/" +"unicodeobject.c:346\n" +"#4 0x00000000004466aa in PyUnicodeUCS2_DecodeUTF8Stateful (s=0x5c2b8d " +"\"__lltrace__\", size=11, errors=0x0, consumed=\n" +" 0x0) at Objects/unicodeobject.c:2531\n" +"#5 0x0000000000446647 in PyUnicodeUCS2_DecodeUTF8 (s=0x5c2b8d " +"\"__lltrace__\", size=11, errors=0x0)\n" +" at Objects/unicodeobject.c:2495\n" +"#6 0x0000000000440d1b in PyUnicodeUCS2_FromStringAndSize (u=0x5c2b8d " +"\"__lltrace__\", size=11)\n" +" at Objects/unicodeobject.c:551\n" +"#7 0x0000000000440d94 in PyUnicodeUCS2_FromString (u=0x5c2b8d " +"\"__lltrace__\") at Objects/unicodeobject.c:569\n" +"#8 0x0000000000584abd in PyDict_GetItemString (v=\n" +" {'Yuck': , '__builtins__': , '__file__': 'Lib/test/crashers/nasty_eq_vs_dict.py', " +"'__package__': None, 'y': , 'dict': {0: 0, 1: " +"1, 2: 2, 3: 3}, '__cached__': None, '__name__': '__main__', 'z': , '__doc__': None}, key=\n" +" 0x5c2b8d \"__lltrace__\") at Objects/dictobject.c:2171" +msgstr "" + +msgid "" +"Notice how the dictionary argument to ``PyDict_GetItemString`` is displayed " +"as its ``repr()``, rather than an opaque ``PyObject *`` pointer." +msgstr "" + +msgid "" +"The extension works by supplying a custom printing routine for values of " +"type ``PyObject *``. If you need to access lower-level details of an " +"object, then cast the value to a pointer of the appropriate type. For " +"example::" +msgstr "" + +msgid "" +"(gdb) p globals\n" +"$1 = {'__builtins__': , '__name__':\n" +"'__main__', 'ctypes': , '__doc__': None,\n" +"'__package__': None}\n" +"\n" +"(gdb) p *(PyDictObject*)globals\n" +"$2 = {ob_refcnt = 3, ob_type = 0x3dbdf85820, ma_fill = 5, ma_used = 5,\n" +"ma_mask = 7, ma_table = 0x63d0f8, ma_lookup = 0x3dbdc7ea70\n" +", ma_smalltable = {{me_hash = 7065186196740147912,\n" +"me_key = '__builtins__', me_value = },\n" +"{me_hash = -368181376027291943, me_key = '__name__',\n" +"me_value ='__main__'}, {me_hash = 0, me_key = 0x0, me_value = 0x0},\n" +"{me_hash = 0, me_key = 0x0, me_value = 0x0},\n" +"{me_hash = -9177857982131165996, me_key = 'ctypes',\n" +"me_value = },\n" +"{me_hash = -8518757509529533123, me_key = '__doc__', me_value = None},\n" +"{me_hash = 0, me_key = 0x0, me_value = 0x0}, {\n" +" me_hash = 6614918939584953775, me_key = '__package__', me_value = None}}}" +msgstr "" + +msgid "" +"Note that the pretty-printers do not actually call ``repr()``. For basic " +"types, they try to match its result closely." +msgstr "" + +msgid "" +"An area that can be confusing is that the custom printer for some types look " +"a lot like GDB's built-in printer for standard types. For example, the " +"pretty-printer for a Python ``int`` (:c:expr:`PyLongObject *`) gives a " +"representation that is not distinguishable from one of a regular machine-" +"level integer::" +msgstr "" + +msgid "" +"(gdb) p some_machine_integer\n" +"$3 = 42\n" +"\n" +"(gdb) p some_python_integer\n" +"$4 = 42" +msgstr "" + +msgid "" +"The internal structure can be revealed with a cast to :c:expr:`PyLongObject " +"*`::" +msgstr "" + +msgid "" +"(gdb) p *(PyLongObject*)some_python_integer\n" +"$5 = {ob_base = {ob_base = {ob_refcnt = 8, ob_type = 0x3dad39f5e0}, ob_size " +"= 1},\n" +"ob_digit = {42}}" +msgstr "" + +msgid "" +"A similar confusion can arise with the ``str`` type, where the output looks " +"a lot like gdb's built-in printer for ``char *``::" +msgstr "" + +msgid "" +"(gdb) p ptr_to_python_str\n" +"$6 = '__builtins__'" +msgstr "" + +msgid "" +"The pretty-printer for ``str`` instances defaults to using single-quotes (as " +"does Python's ``repr`` for strings) whereas the standard printer for ``char " +"*`` values uses double-quotes and contains a hexadecimal address::" +msgstr "" + +msgid "" +"(gdb) p ptr_to_char_star\n" +"$7 = 0x6d72c0 \"hello world\"" +msgstr "" + +msgid "" +"Again, the implementation details can be revealed with a cast to :c:expr:" +"`PyUnicodeObject *`::" +msgstr "" + +msgid "" +"(gdb) p *(PyUnicodeObject*)$6\n" +"$8 = {ob_base = {ob_refcnt = 33, ob_type = 0x3dad3a95a0}, length = 12,\n" +"str = 0x7ffff2128500, hash = 7065186196740147912, state = 1, defenc = 0x0}" +msgstr "" + +msgid "``py-list``" +msgstr "" + +msgid "" +"The extension adds a ``py-list`` command, which lists the Python source code " +"(if any) for the current frame in the selected thread. The current line is " +"marked with a \">\"::" +msgstr "" + +msgid "" +"(gdb) py-list\n" +" 901 if options.profile:\n" +" 902 options.profile = False\n" +" 903 profile_me()\n" +" 904 return\n" +" 905\n" +">906 u = UI()\n" +" 907 if not u.quit:\n" +" 908 try:\n" +" 909 gtk.main()\n" +" 910 except KeyboardInterrupt:\n" +" 911 # properly quit on a keyboard interrupt..." +msgstr "" + +msgid "" +"Use ``py-list START`` to list at a different line number within the Python " +"source, and ``py-list START,END`` to list a specific range of lines within " +"the Python source." +msgstr "" + +msgid "``py-up`` and ``py-down``" +msgstr "" + +msgid "" +"The ``py-up`` and ``py-down`` commands are analogous to GDB's regular ``up`` " +"and ``down`` commands, but try to move at the level of CPython frames, " +"rather than C frames." +msgstr "" + +msgid "" +"GDB is not always able to read the relevant frame information, depending on " +"the optimization level with which CPython was compiled. Internally, the " +"commands look for C frames that are executing the default frame evaluation " +"function (that is, the core bytecode interpreter loop within CPython) and " +"look up the value of the related ``PyFrameObject *``." +msgstr "" + +msgid "They emit the frame number (at the C level) within the thread." +msgstr "" + +msgid "For example::" +msgstr "Наприклад::" + +msgid "" +"(gdb) py-up\n" +"#37 Frame 0x9420b04, for file /usr/lib/python2.6/site-packages/\n" +"gnome_sudoku/main.py, line 906, in start_game ()\n" +" u = UI()\n" +"(gdb) py-up\n" +"#40 Frame 0x948e82c, for file /usr/lib/python2.6/site-packages/\n" +"gnome_sudoku/gnome_sudoku.py, line 22, in start_game(main=)\n" +" main.start_game()\n" +"(gdb) py-up\n" +"Unable to find an older python frame" +msgstr "" + +msgid "so we're at the top of the Python stack." +msgstr "" + +msgid "" +"The frame numbers correspond to those displayed by GDB's standard " +"``backtrace`` command. The command skips C frames which are not executing " +"Python code." +msgstr "" + +msgid "Going back down::" +msgstr "" + +msgid "" +"(gdb) py-down\n" +"#37 Frame 0x9420b04, for file /usr/lib/python2.6/site-packages/gnome_sudoku/" +"main.py, line 906, in start_game ()\n" +" u = UI()\n" +"(gdb) py-down\n" +"#34 (unable to read python frame information)\n" +"(gdb) py-down\n" +"#23 (unable to read python frame information)\n" +"(gdb) py-down\n" +"#19 (unable to read python frame information)\n" +"(gdb) py-down\n" +"#14 Frame 0x99262ac, for file /usr/lib/python2.6/site-packages/gnome_sudoku/" +"game_selector.py, line 201, in run_swallowed_dialog " +"(self=, puzzle=None, saved_games=[{'gsd.auto_fills': 0, 'tracking': {}, " +"'trackers': {}, 'notes': [], 'saved_at': 1270084485, 'game': '7 8 0 0 0 0 0 " +"5 6 0 0 9 0 8 0 1 0 0 0 4 6 0 0 0 0 7 0 6 5 0 0 0 4 7 9 2 0 0 0 9 0 1 0 0 0 " +"3 9 7 6 0 0 0 1 8 0 6 0 0 0 0 2 8 0 0 0 5 0 4 0 6 0 0 2 1 0 0 0 0 0 4 5\\n7 " +"8 0 0 0 0 0 5 6 0 0 9 0 8 0 1 0 0 0 4 6 0 0 0 0 7 0 6 5 1 8 3 4 7 9 2 0 0 0 " +"9 0 1 0 0 0 3 9 7 6 0 0 0 1 8 0 6 0 0 0 0 2 8 0 0 0 5 0 4 0 6 0 0 2 1 0 0 0 " +"0 0 4 5', 'gsd.impossible_hints': 0, 'timer.__absolute_start_time__': , 'gsd.hints': 0, 'timer.active_time': , 'timer.total_time': }], dialog=, saved_game_model=, sudoku_maker=, main_page=0) " +"at remote 0x98fa6e4>, d=)\n" +" gtk.main()\n" +"(gdb) py-down\n" +"#8 (unable to read python frame information)\n" +"(gdb) py-down\n" +"Unable to find a newer python frame" +msgstr "" + +msgid "and we're at the bottom of the Python stack." +msgstr "" + +msgid "" +"Note that in Python 3.12 and newer, the same C stack frame can be used for " +"multiple Python stack frames. This means that ``py-up`` and ``py-down`` may " +"move multiple Python frames at once. For example::" +msgstr "" + +msgid "" +"(gdb) py-up\n" +"#6 Frame 0x7ffff7fb62b0, for file /tmp/rec.py, line 5, in recursive_function " +"(n=0)\n" +" time.sleep(5)\n" +"#6 Frame 0x7ffff7fb6240, for file /tmp/rec.py, line 7, in recursive_function " +"(n=1)\n" +" recursive_function(n-1)\n" +"#6 Frame 0x7ffff7fb61d0, for file /tmp/rec.py, line 7, in recursive_function " +"(n=2)\n" +" recursive_function(n-1)\n" +"#6 Frame 0x7ffff7fb6160, for file /tmp/rec.py, line 7, in recursive_function " +"(n=3)\n" +" recursive_function(n-1)\n" +"#6 Frame 0x7ffff7fb60f0, for file /tmp/rec.py, line 7, in recursive_function " +"(n=4)\n" +" recursive_function(n-1)\n" +"#6 Frame 0x7ffff7fb6080, for file /tmp/rec.py, line 7, in recursive_function " +"(n=5)\n" +" recursive_function(n-1)\n" +"#6 Frame 0x7ffff7fb6020, for file /tmp/rec.py, line 9, in ()\n" +" recursive_function(5)\n" +"(gdb) py-up\n" +"Unable to find an older python frame" +msgstr "" + +msgid "``py-bt``" +msgstr "" + +msgid "" +"The ``py-bt`` command attempts to display a Python-level backtrace of the " +"current thread." +msgstr "" + +msgid "" +"(gdb) py-bt\n" +"#8 (unable to read python frame information)\n" +"#11 Frame 0x9aead74, for file /usr/lib/python2.6/site-packages/gnome_sudoku/" +"dialog_swallower.py, line 48, in run_dialog " +"(self=, main_page=0) " +"at remote 0x98fa6e4>, d=)\n" +" gtk.main()\n" +"#14 Frame 0x99262ac, for file /usr/lib/python2.6/site-packages/gnome_sudoku/" +"game_selector.py, line 201, in run_swallowed_dialog " +"(self=, puzzle=None, saved_games=[{'gsd.auto_fills': 0, 'tracking': {}, " +"'trackers': {}, 'notes': [], 'saved_at': 1270084485, 'game': '7 8 0 0 0 0 0 " +"5 6 0 0 9 0 8 0 1 0 0 0 4 6 0 0 0 0 7 0 6 5 0 0 0 4 7 9 2 0 0 0 9 0 1 0 0 0 " +"3 9 7 6 0 0 0 1 8 0 6 0 0 0 0 2 8 0 0 0 5 0 4 0 6 0 0 2 1 0 0 0 0 0 4 5\\n7 " +"8 0 0 0 0 0 5 6 0 0 9 0 8 0 1 0 0 0 4 6 0 0 0 0 7 0 6 5 1 8 3 4 7 9 2 0 0 0 " +"9 0 1 0 0 0 3 9 7 6 0 0 0 1 8 0 6 0 0 0 0 2 8 0 0 0 5 0 4 0 6 0 0 2 1 0 0 0 " +"0 0 4 5', 'gsd.impossible_hints': 0, 'timer.__absolute_start_time__': , 'gsd.hints': 0, 'timer.active_time': , 'timer.total_time': }], dialog=, saved_game_model=, sudoku_maker=)\n" +" main.start_game()" +msgstr "" + +msgid "" +"The frame numbers correspond to those displayed by GDB's standard " +"``backtrace`` command." +msgstr "" + +msgid "``py-print``" +msgstr "" + +msgid "" +"The ``py-print`` command looks up a Python name and tries to print it. It " +"looks in locals within the current thread, then globals, then finally " +"builtins::" +msgstr "" + +msgid "" +"(gdb) py-print self\n" +"local 'self' = ,\n" +"main_page=0) at remote 0x98fa6e4>\n" +"(gdb) py-print __name__\n" +"global '__name__' = 'gnome_sudoku.dialog_swallower'\n" +"(gdb) py-print len\n" +"builtin 'len' = \n" +"(gdb) py-print scarlet_pimpernel\n" +"'scarlet_pimpernel' not found" +msgstr "" + +msgid "" +"If the current C frame corresponds to multiple Python frames, ``py-print`` " +"only considers the first one." +msgstr "" + +msgid "``py-locals``" +msgstr "" + +msgid "" +"The ``py-locals`` command looks up all Python locals within the current " +"Python frame in the selected thread, and prints their representations::" +msgstr "" + +msgid "" +"(gdb) py-locals\n" +"self = ,\n" +"main_page=0) at remote 0x98fa6e4>\n" +"d = " +msgstr "" + +msgid "" +"If the current C frame corresponds to multiple Python frames, locals from " +"all of them will be shown::" +msgstr "" + +msgid "" +"(gdb) py-locals\n" +"Locals for recursive_function\n" +"n = 0\n" +"Locals for recursive_function\n" +"n = 1\n" +"Locals for recursive_function\n" +"n = 2\n" +"Locals for recursive_function\n" +"n = 3\n" +"Locals for recursive_function\n" +"n = 4\n" +"Locals for recursive_function\n" +"n = 5\n" +"Locals for " +msgstr "" + +msgid "Use with GDB commands" +msgstr "" + +msgid "" +"The extension commands complement GDB's built-in commands. For example, you " +"can use a frame numbers shown by ``py-bt`` with the ``frame`` command to go " +"a specific frame within the selected thread, like this::" +msgstr "" + +msgid "" +"(gdb) py-bt\n" +"(output snipped)\n" +"#68 Frame 0xaa4560, for file Lib/test/regrtest.py, line 1548, in " +"()\n" +" main()\n" +"(gdb) frame 68\n" +"#68 0x00000000004cd1e6 in PyEval_EvalFrameEx (f=Frame 0xaa4560, for file Lib/" +"test/regrtest.py, line 1548, in (), throwflag=0) at Python/ceval." +"c:2665\n" +"2665 x = call_function(&sp, oparg);\n" +"(gdb) py-list\n" +"1543 # Run the tests in a context manager that temporary changes the " +"CWD to a\n" +"1544 # temporary and writable directory. If it's not possible to " +"create or\n" +"1545 # change the CWD, the original CWD will be used. The original " +"CWD is\n" +"1546 # available from test_support.SAVEDCWD.\n" +"1547 with test_support.temp_cwd(TESTCWD, quiet=True):\n" +">1548 main()" +msgstr "" + +msgid "" +"The ``info threads`` command will give you a list of the threads within the " +"process, and you can use the ``thread`` command to select a different one::" +msgstr "" + +msgid "" +"(gdb) info threads\n" +" 105 Thread 0x7fffefa18710 (LWP 10260) sem_wait () at ../nptl/sysdeps/unix/" +"sysv/linux/x86_64/sem_wait.S:86\n" +" 104 Thread 0x7fffdf5fe710 (LWP 10259) sem_wait () at ../nptl/sysdeps/unix/" +"sysv/linux/x86_64/sem_wait.S:86\n" +"* 1 Thread 0x7ffff7fe2700 (LWP 10145) 0x00000038e46d73e3 in select () at ../" +"sysdeps/unix/syscall-template.S:82" +msgstr "" + +msgid "" +"You can use ``thread apply all COMMAND`` or (``t a a COMMAND`` for short) to " +"run a command on all threads. With ``py-bt``, this lets you see what every " +"thread is doing at the Python level::" +msgstr "" + +msgid "" +"(gdb) t a a py-bt\n" +"\n" +"Thread 105 (Thread 0x7fffefa18710 (LWP 10260)):\n" +"#5 Frame 0x7fffd00019d0, for file /home/david/coding/python-svn/Lib/" +"threading.py, line 155, in _acquire_restore " +"(self=<_RLock(_Verbose__verbose=False, _RLock__owner=140737354016512, " +"_RLock__block=, _RLock__count=1) at remote " +"0xd7ff40>, count_owner=(1, 140737213728528), count=1, " +"owner=140737213728528)\n" +" self.__block.acquire()\n" +"#8 Frame 0x7fffac001640, for file /home/david/coding/python-svn/Lib/" +"threading.py, line 269, in wait " +"(self=<_Condition(_Condition__lock=<_RLock(_Verbose__verbose=False, " +"_RLock__owner=140737354016512, _RLock__block=, _RLock__count=1) at remote 0xd7ff40>, acquire=, _is_owned=, " +"_release_save=, release=, _acquire_restore=, " +"_Verbose__verbose=False, _Condition__waiters=[]) at remote 0xd7fd10>, " +"timeout=None, waiter=, saved_state=(1, " +"140737213728528))\n" +" self._acquire_restore(saved_state)\n" +"#12 Frame 0x7fffb8001a10, for file /home/david/coding/python-svn/Lib/test/" +"lock_tests.py, line 348, in f ()\n" +" cond.wait()\n" +"#16 Frame 0x7fffb8001c40, for file /home/david/coding/python-svn/Lib/test/" +"lock_tests.py, line 37, in task (tid=140737213728528)\n" +" f()\n" +"\n" +"Thread 104 (Thread 0x7fffdf5fe710 (LWP 10259)):\n" +"#5 Frame 0x7fffe4001580, for file /home/david/coding/python-svn/Lib/" +"threading.py, line 155, in _acquire_restore " +"(self=<_RLock(_Verbose__verbose=False, _RLock__owner=140737354016512, " +"_RLock__block=, _RLock__count=1) at remote " +"0xd7ff40>, count_owner=(1, 140736940992272), count=1, " +"owner=140736940992272)\n" +" self.__block.acquire()\n" +"#8 Frame 0x7fffc8002090, for file /home/david/coding/python-svn/Lib/" +"threading.py, line 269, in wait " +"(self=<_Condition(_Condition__lock=<_RLock(_Verbose__verbose=False, " +"_RLock__owner=140737354016512, _RLock__block=, _RLock__count=1) at remote 0xd7ff40>, acquire=, _is_owned=, " +"_release_save=, release=, _acquire_restore=, " +"_Verbose__verbose=False, _Condition__waiters=[]) at remote 0xd7fd10>, " +"timeout=None, waiter=, saved_state=(1, " +"140736940992272))\n" +" self._acquire_restore(saved_state)\n" +"#12 Frame 0x7fffac001c90, for file /home/david/coding/python-svn/Lib/test/" +"lock_tests.py, line 348, in f ()\n" +" cond.wait()\n" +"#16 Frame 0x7fffac0011c0, for file /home/david/coding/python-svn/Lib/test/" +"lock_tests.py, line 37, in task (tid=140736940992272)\n" +" f()\n" +"\n" +"Thread 1 (Thread 0x7ffff7fe2700 (LWP 10145)):\n" +"#5 Frame 0xcb5380, for file /home/david/coding/python-svn/Lib/test/" +"lock_tests.py, line 16, in _wait ()\n" +" time.sleep(0.01)\n" +"#8 Frame 0x7fffd00024a0, for file /home/david/coding/python-svn/Lib/test/" +"lock_tests.py, line 378, in _check_notify " +"(self=, skipped=[], _mirrorOutput=False, testsRun=39, " +"buffer=False, _original_stderr=, " +"_stdout_buffer=, " +"_stderr_buffer=, " +"_moduleSetUpFailed=False, expectedFailures=[], errors=[], " +"_previousTestClass=, unexpectedSuccesses=[], " +"failures=[], shouldStop=False, failfast=False) at remote 0xc185a0>, " +"_threads=(0,), _cleanups=[], _type_equality_funcs={: , : " +", : " +", : " +", , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:53+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Python HOWTOs" +msgstr "Python HOWTO" + +msgid "" +"Python HOWTOs are documents that cover a specific topic in-depth. Modeled on " +"the Linux Documentation Project's HOWTO collection, this collection is an " +"effort to foster documentation that's more detailed than the Python Library " +"Reference." +msgstr "" + +msgid "General:" +msgstr "" + +msgid ":ref:`annotations-howto`" +msgstr "" + +msgid ":ref:`argparse-tutorial`" +msgstr "" + +msgid ":ref:`descriptorhowto`" +msgstr "" + +msgid ":ref:`enum-howto`" +msgstr "" + +msgid ":ref:`functional-howto`" +msgstr "" + +msgid ":ref:`ipaddress-howto`" +msgstr "" + +msgid ":ref:`logging-howto`" +msgstr "" + +msgid ":ref:`logging-cookbook`" +msgstr "" + +msgid ":ref:`regex-howto`" +msgstr "" + +msgid ":ref:`sortinghowto`" +msgstr "" + +msgid ":ref:`unicode-howto`" +msgstr "" + +msgid ":ref:`urllib-howto`" +msgstr "" + +msgid "Advanced development:" +msgstr "" + +msgid ":ref:`curses-howto`" +msgstr ":ref:`curses-howto`" + +msgid ":ref:`freethreading-python-howto`" +msgstr "" + +msgid ":ref:`freethreading-extensions-howto`" +msgstr "" + +msgid ":ref:`isolating-extensions-howto`" +msgstr "" + +msgid ":ref:`python_2.3_mro`" +msgstr "" + +msgid ":ref:`socket-howto`" +msgstr "" + +msgid ":ref:`timerfd-howto`" +msgstr "" + +msgid ":ref:`cporting-howto`" +msgstr "" + +msgid "Debugging and profiling:" +msgstr "" + +msgid ":ref:`gdb`" +msgstr "" + +msgid ":ref:`instrumentation`" +msgstr "" + +msgid ":ref:`perf_profiling`" +msgstr "" diff --git a/howto/instrumentation.po b/howto/instrumentation.po new file mode 100644 index 000000000..bac36fcf3 --- /dev/null +++ b/howto/instrumentation.po @@ -0,0 +1,606 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:53+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Instrumenting CPython with DTrace and SystemTap" +msgstr "Інструментування CPython за допомогою DTrace і SystemTap" + +msgid "author" +msgstr "автор" + +msgid "David Malcolm" +msgstr "David Malcolm" + +msgid "Łukasz Langa" +msgstr "Łukasz Langa" + +msgid "" +"DTrace and SystemTap are monitoring tools, each providing a way to inspect " +"what the processes on a computer system are doing. They both use domain-" +"specific languages allowing a user to write scripts which:" +msgstr "" +"DTrace і SystemTap — це інструменти моніторингу, кожен з яких надає спосіб " +"перевірити, що роблять процеси в комп’ютерній системі. Вони обидва " +"використовують доменно-спеціальні мови, що дозволяє користувачеві писати " +"сценарії, які:" + +msgid "filter which processes are to be observed" +msgstr "фільтрувати процеси, які слід спостерігати" + +msgid "gather data from the processes of interest" +msgstr "збирати дані з цікавих процесів" + +msgid "generate reports on the data" +msgstr "створювати звіти за даними" + +msgid "" +"As of Python 3.6, CPython can be built with embedded \"markers\", also known " +"as \"probes\", that can be observed by a DTrace or SystemTap script, making " +"it easier to monitor what the CPython processes on a system are doing." +msgstr "" +"Починаючи з Python 3.6, CPython можна створювати за допомогою вбудованих " +"\"маркерів\", також відомих як \"зонди\", які можна спостерігати за " +"допомогою сценарію DTrace або SystemTap, що полегшує моніторинг того, що " +"роблять процеси CPython у системі." + +msgid "" +"DTrace markers are implementation details of the CPython interpreter. No " +"guarantees are made about probe compatibility between versions of CPython. " +"DTrace scripts can stop working or work incorrectly without warning when " +"changing CPython versions." +msgstr "" +"Маркери DTrace є деталями реалізації інтерпретатора CPython. Жодних гарантій " +"щодо сумісності зондів між версіями CPython не надається. Під час зміни " +"версій CPython сценарії DTrace можуть перестати працювати або працювати " +"неправильно без попередження." + +msgid "Enabling the static markers" +msgstr "Увімкнення статичних маркерів" + +msgid "" +"macOS comes with built-in support for DTrace. On Linux, in order to build " +"CPython with the embedded markers for SystemTap, the SystemTap development " +"tools must be installed." +msgstr "" +"macOS має вбудовану підтримку DTrace. У Linux, щоб створити CPython із " +"вбудованими маркерами для SystemTap, необхідно встановити інструменти " +"розробки SystemTap." + +msgid "On a Linux machine, this can be done via::" +msgstr "На машині Linux це можна зробити за допомогою::" + +msgid "$ yum install systemtap-sdt-devel" +msgstr "" + +msgid "or::" +msgstr "або::" + +msgid "$ sudo apt-get install systemtap-sdt-dev" +msgstr "" + +msgid "" +"CPython must then be :option:`configured with the --with-dtrace option <--" +"with-dtrace>`:" +msgstr "" +"Тоді CPython має бути :option:`налаштований за допомогою параметра --with-" +"dtrace <--with-dtrace>`:" + +msgid "checking for --with-dtrace... yes" +msgstr "" + +msgid "" +"On macOS, you can list available DTrace probes by running a Python process " +"in the background and listing all probes made available by the Python " +"provider::" +msgstr "" +"У macOS ви можете отримати список доступних зондів DTrace, запустивши процес " +"Python у фоновому режимі та перерахувавши всі зонди, доступні постачальником " +"Python:" + +msgid "" +"$ python3.6 -q &\n" +"$ sudo dtrace -l -P python$! # or: dtrace -l -m python3.6\n" +"\n" +" ID PROVIDER MODULE FUNCTION NAME\n" +"29564 python18035 python3.6 _PyEval_EvalFrameDefault " +"function-entry\n" +"29565 python18035 python3.6 dtrace_function_entry " +"function-entry\n" +"29566 python18035 python3.6 _PyEval_EvalFrameDefault " +"function-return\n" +"29567 python18035 python3.6 dtrace_function_return " +"function-return\n" +"29568 python18035 python3.6 collect gc-" +"done\n" +"29569 python18035 python3.6 collect gc-" +"start\n" +"29570 python18035 python3.6 _PyEval_EvalFrameDefault line\n" +"29571 python18035 python3.6 maybe_dtrace_line line" +msgstr "" + +msgid "" +"On Linux, you can verify if the SystemTap static markers are present in the " +"built binary by seeing if it contains a \".note.stapsdt\" section." +msgstr "" +"У Linux ви можете перевірити наявність статичних маркерів SystemTap у " +"вбудованому двійковому файлі, перевіривши, чи містить він розділ \".note." +"stapsdt\"." + +msgid "" +"$ readelf -S ./python | grep .note.stapsdt\n" +"[30] .note.stapsdt NOTE 0000000000000000 00308d78" +msgstr "" + +msgid "" +"If you've built Python as a shared library (with the :option:`--enable-" +"shared` configure option), you need to look instead within the shared " +"library. For example::" +msgstr "" +"Якщо ви створили Python як спільну бібліотеку (з параметром конфігурації :" +"option:`--enable-shared`), вам потрібно натомість шукати в спільній " +"бібліотеці. Наприклад::" + +msgid "" +"$ readelf -S libpython3.3dm.so.1.0 | grep .note.stapsdt\n" +"[29] .note.stapsdt NOTE 0000000000000000 00365b68" +msgstr "" + +msgid "Sufficiently modern readelf can print the metadata::" +msgstr "Досить сучасний readelf може друкувати метадані::" + +msgid "" +"$ readelf -n ./python\n" +"\n" +"Displaying notes found at file offset 0x00000254 with length 0x00000020:\n" +" Owner Data size Description\n" +" GNU 0x00000010 NT_GNU_ABI_TAG (ABI version " +"tag)\n" +" OS: Linux, ABI: 2.6.32\n" +"\n" +"Displaying notes found at file offset 0x00000274 with length 0x00000024:\n" +" Owner Data size Description\n" +" GNU 0x00000014 NT_GNU_BUILD_ID (unique build " +"ID bitstring)\n" +" Build ID: df924a2b08a7e89f6e11251d4602022977af2670\n" +"\n" +"Displaying notes found at file offset 0x002d6c30 with length 0x00000144:\n" +" Owner Data size Description\n" +" stapsdt 0x00000031 NT_STAPSDT (SystemTap probe " +"descriptors)\n" +" Provider: python\n" +" Name: gc__start\n" +" Location: 0x00000000004371c3, Base: 0x0000000000630ce2, Semaphore: " +"0x00000000008d6bf6\n" +" Arguments: -4@%ebx\n" +" stapsdt 0x00000030 NT_STAPSDT (SystemTap probe " +"descriptors)\n" +" Provider: python\n" +" Name: gc__done\n" +" Location: 0x00000000004374e1, Base: 0x0000000000630ce2, Semaphore: " +"0x00000000008d6bf8\n" +" Arguments: -8@%rax\n" +" stapsdt 0x00000045 NT_STAPSDT (SystemTap probe " +"descriptors)\n" +" Provider: python\n" +" Name: function__entry\n" +" Location: 0x000000000053db6c, Base: 0x0000000000630ce2, Semaphore: " +"0x00000000008d6be8\n" +" Arguments: 8@%rbp 8@%r12 -4@%eax\n" +" stapsdt 0x00000046 NT_STAPSDT (SystemTap probe " +"descriptors)\n" +" Provider: python\n" +" Name: function__return\n" +" Location: 0x000000000053dba8, Base: 0x0000000000630ce2, Semaphore: " +"0x00000000008d6bea\n" +" Arguments: 8@%rbp 8@%r12 -4@%eax" +msgstr "" + +msgid "" +"The above metadata contains information for SystemTap describing how it can " +"patch strategically placed machine code instructions to enable the tracing " +"hooks used by a SystemTap script." +msgstr "" + +msgid "Static DTrace probes" +msgstr "Статичні зонди DTrace" + +msgid "" +"The following example DTrace script can be used to show the call/return " +"hierarchy of a Python script, only tracing within the invocation of a " +"function called \"start\". In other words, import-time function invocations " +"are not going to be listed:" +msgstr "" +"Наступний приклад сценарію DTrace можна використовувати, щоб показати " +"ієрархію викликів/повернень сценарію Python, лише відстежуючи в межах " +"виклику функції під назвою \"start\". Іншими словами, виклики функцій під " +"час імпорту не будуть перераховані:" + +msgid "" +"self int indent;\n" +"\n" +"python$target:::function-entry\n" +"/copyinstr(arg1) == \"start\"/\n" +"{\n" +" self->trace = 1;\n" +"}\n" +"\n" +"python$target:::function-entry\n" +"/self->trace/\n" +"{\n" +" printf(\"%d\\t%*s:\", timestamp, 15, probename);\n" +" printf(\"%*s\", self->indent, \"\");\n" +" printf(\"%s:%s:%d\\n\", basename(copyinstr(arg0)), copyinstr(arg1), " +"arg2);\n" +" self->indent++;\n" +"}\n" +"\n" +"python$target:::function-return\n" +"/self->trace/\n" +"{\n" +" self->indent--;\n" +" printf(\"%d\\t%*s:\", timestamp, 15, probename);\n" +" printf(\"%*s\", self->indent, \"\");\n" +" printf(\"%s:%s:%d\\n\", basename(copyinstr(arg0)), copyinstr(arg1), " +"arg2);\n" +"}\n" +"\n" +"python$target:::function-return\n" +"/copyinstr(arg1) == \"start\"/\n" +"{\n" +" self->trace = 0;\n" +"}" +msgstr "" + +msgid "It can be invoked like this::" +msgstr "Його можна викликати так::" + +msgid "$ sudo dtrace -q -s call_stack.d -c \"python3.6 script.py\"" +msgstr "" + +msgid "The output looks like this:" +msgstr "Результат виглядає так:" + +msgid "" +"156641360502280 function-entry:call_stack.py:start:23\n" +"156641360518804 function-entry: call_stack.py:function_1:1\n" +"156641360532797 function-entry: call_stack.py:function_3:9\n" +"156641360546807 function-return: call_stack.py:function_3:10\n" +"156641360563367 function-return: call_stack.py:function_1:2\n" +"156641360578365 function-entry: call_stack.py:function_2:5\n" +"156641360591757 function-entry: call_stack.py:function_1:1\n" +"156641360605556 function-entry: call_stack.py:function_3:9\n" +"156641360617482 function-return: call_stack.py:function_3:10\n" +"156641360629814 function-return: call_stack.py:function_1:2\n" +"156641360642285 function-return: call_stack.py:function_2:6\n" +"156641360656770 function-entry: call_stack.py:function_3:9\n" +"156641360669707 function-return: call_stack.py:function_3:10\n" +"156641360687853 function-entry: call_stack.py:function_4:13\n" +"156641360700719 function-return: call_stack.py:function_4:14\n" +"156641360719640 function-entry: call_stack.py:function_5:18\n" +"156641360732567 function-return: call_stack.py:function_5:21\n" +"156641360747370 function-return:call_stack.py:start:28" +msgstr "" + +msgid "Static SystemTap markers" +msgstr "Статичні маркери SystemTap" + +msgid "" +"The low-level way to use the SystemTap integration is to use the static " +"markers directly. This requires you to explicitly state the binary file " +"containing them." +msgstr "" +"Низькорівневий спосіб використання інтеграції SystemTap полягає в " +"безпосередньому використанні статичних маркерів. Це вимагає, щоб ви явно " +"вказали бінарний файл, який їх містить." + +msgid "" +"For example, this SystemTap script can be used to show the call/return " +"hierarchy of a Python script:" +msgstr "" +"Наприклад, цей сценарій SystemTap можна використовувати, щоб показати " +"ієрархію викликів/повернень сценарію Python:" + +msgid "" +"probe process(\"python\").mark(\"function__entry\") {\n" +" filename = user_string($arg1);\n" +" funcname = user_string($arg2);\n" +" lineno = $arg3;\n" +"\n" +" printf(\"%s => %s in %s:%d\\\\n\",\n" +" thread_indent(1), funcname, filename, lineno);\n" +"}\n" +"\n" +"probe process(\"python\").mark(\"function__return\") {\n" +" filename = user_string($arg1);\n" +" funcname = user_string($arg2);\n" +" lineno = $arg3;\n" +"\n" +" printf(\"%s <= %s in %s:%d\\\\n\",\n" +" thread_indent(-1), funcname, filename, lineno);\n" +"}" +msgstr "" + +msgid "" +"$ stap \\\n" +" show-call-hierarchy.stp \\\n" +" -c \"./python test.py\"" +msgstr "" + +msgid "" +"11408 python(8274): => __contains__ in Lib/_abcoll.py:362\n" +"11414 python(8274): => __getitem__ in Lib/os.py:425\n" +"11418 python(8274): => encode in Lib/os.py:490\n" +"11424 python(8274): <= encode in Lib/os.py:493\n" +"11428 python(8274): <= __getitem__ in Lib/os.py:426\n" +"11433 python(8274): <= __contains__ in Lib/_abcoll.py:366" +msgstr "" + +msgid "where the columns are:" +msgstr "де стовпці:" + +msgid "time in microseconds since start of script" +msgstr "час у мікросекундах з моменту запуску сценарію" + +msgid "name of executable" +msgstr "ім'я виконуваного файлу" + +msgid "PID of process" +msgstr "PID процесу" + +msgid "" +"and the remainder indicates the call/return hierarchy as the script executes." +msgstr "" +"а залишок вказує на ієрархію виклику/повернення під час виконання сценарію." + +msgid "" +"For a :option:`--enable-shared` build of CPython, the markers are contained " +"within the libpython shared library, and the probe's dotted path needs to " +"reflect this. For example, this line from the above example:" +msgstr "" +"Для :option:`--enable-shared` збірки CPython маркери містяться в спільній " +"бібліотеці libpython, і пунктирний шлях зонда повинен це відображати. " +"Наприклад, цей рядок із наведеного вище прикладу:" + +msgid "probe process(\"python\").mark(\"function__entry\") {" +msgstr "" + +msgid "should instead read:" +msgstr "замість цього слід читати:" + +msgid "" +"probe process(\"python\").library(\"libpython3.6dm.so.1.0\")." +"mark(\"function__entry\") {" +msgstr "" + +msgid "(assuming a :ref:`debug build ` of CPython 3.6)" +msgstr "(за умови :ref:`debug build ` CPython 3.6)" + +msgid "Available static markers" +msgstr "Наявні статичні маркери" + +msgid "" +"This marker indicates that execution of a Python function has begun. It is " +"only triggered for pure-Python (bytecode) functions." +msgstr "" +"Цей маркер вказує на те, що почалося виконання функції Python. Він " +"запускається лише для функцій чистого Python (байт-код)." + +msgid "" +"The filename, function name, and line number are provided back to the " +"tracing script as positional arguments, which must be accessed using " +"``$arg1``, ``$arg2``, ``$arg3``:" +msgstr "" +"Ім’я файлу, ім’я функції та номер рядка повертаються до сценарію трасування " +"як позиційні аргументи, до яких потрібно отримати доступ за допомогою " +"``$arg1``, ``$arg2``, ``$arg3``:" + +msgid "" +"``$arg1`` : ``(const char *)`` filename, accessible using " +"``user_string($arg1)``" +msgstr "" +"``$arg1`` : ``(const char *)`` ім'я файлу, доступне за допомогою " +"``user_string($arg1)``" + +msgid "" +"``$arg2`` : ``(const char *)`` function name, accessible using " +"``user_string($arg2)``" +msgstr "" +"``$arg2`` : ``(const char *)`` назва функції, доступна за допомогою " +"``user_string($arg2)``" + +msgid "``$arg3`` : ``int`` line number" +msgstr "``$arg3`` : ``int`` номер рядка" + +msgid "" +"This marker is the converse of :c:func:`!function__entry`, and indicates " +"that execution of a Python function has ended (either via ``return``, or via " +"an exception). It is only triggered for pure-Python (bytecode) functions." +msgstr "" + +msgid "The arguments are the same as for :c:func:`!function__entry`" +msgstr "" + +msgid "" +"This marker indicates a Python line is about to be executed. It is the " +"equivalent of line-by-line tracing with a Python profiler. It is not " +"triggered within C functions." +msgstr "" +"Цей маркер вказує на те, що рядок Python збирається виконати. Це еквівалент " +"построкової трасування за допомогою профайлера Python. Він не запускається у " +"функціях C." + +msgid "The arguments are the same as for :c:func:`!function__entry`." +msgstr "" + +msgid "" +"Fires when the Python interpreter starts a garbage collection cycle. " +"``arg0`` is the generation to scan, like :func:`gc.collect`." +msgstr "" + +msgid "" +"Fires when the Python interpreter finishes a garbage collection cycle. " +"``arg0`` is the number of collected objects." +msgstr "" +"Спрацьовує, коли інтерпретатор Python завершує цикл збирання сміття. " +"``arg0`` - кількість зібраних об'єктів." + +msgid "" +"Fires before :mod:`importlib` attempts to find and load the module. ``arg0`` " +"is the module name." +msgstr "" +"Спрацьовує перед спробою :mod:`importlib` знайти та завантажити модуль. " +"``arg0`` - це назва модуля." + +msgid "" +"Fires after :mod:`importlib`'s find_and_load function is called. ``arg0`` is " +"the module name, ``arg1`` indicates if module was successfully loaded." +msgstr "" +"Спрацьовує після виклику функції find_and_load :mod:`importlib`. ``arg0`` - " +"це назва модуля, ``arg1`` вказує, чи модуль було успішно завантажено." + +msgid "" +"Fires when :func:`sys.audit` or :c:func:`PySys_Audit` is called. ``arg0`` is " +"the event name as C string, ``arg1`` is a :c:type:`PyObject` pointer to a " +"tuple object." +msgstr "" +"Спрацьовує під час виклику :func:`sys.audit` або :c:func:`PySys_Audit`. " +"``arg0`` — це ім’я події у вигляді рядка C, ``arg1`` — це покажчик :c:type:" +"`PyObject` на об’єкт кортежу." + +msgid "SystemTap Tapsets" +msgstr "Системні крани" + +msgid "" +"The higher-level way to use the SystemTap integration is to use a " +"\"tapset\": SystemTap's equivalent of a library, which hides some of the " +"lower-level details of the static markers." +msgstr "" +"Шлях вищого рівня використання інтеграції SystemTap полягає у використанні " +"\"tapset\": еквівалента бібліотеки SystemTap, яка приховує деякі деталі " +"нижчого рівня статичних маркерів." + +msgid "Here is a tapset file, based on a non-shared build of CPython:" +msgstr "Ось файл tapset, заснований на незагальній збірці CPython:" + +msgid "" +"/*\n" +" Provide a higher-level wrapping around the function__entry and\n" +" function__return markers:\n" +" \\*/\n" +"probe python.function.entry = process(\"python\").mark(\"function__entry\")\n" +"{\n" +" filename = user_string($arg1);\n" +" funcname = user_string($arg2);\n" +" lineno = $arg3;\n" +" frameptr = $arg4\n" +"}\n" +"probe python.function.return = process(\"python\")." +"mark(\"function__return\")\n" +"{\n" +" filename = user_string($arg1);\n" +" funcname = user_string($arg2);\n" +" lineno = $arg3;\n" +" frameptr = $arg4\n" +"}" +msgstr "" + +msgid "" +"If this file is installed in SystemTap's tapset directory (e.g. ``/usr/share/" +"systemtap/tapset``), then these additional probepoints become available:" +msgstr "" +"Якщо цей файл встановлено в каталозі tapset SystemTap (наприклад, ``/usr/" +"share/systemtap/tapset``), тоді ці додаткові точки дослідження стають " +"доступними:" + +msgid "" +"This probe point indicates that execution of a Python function has begun. It " +"is only triggered for pure-Python (bytecode) functions." +msgstr "" +"Ця точка тестування вказує на те, що почалося виконання функції Python. Він " +"запускається лише для функцій чистого Python (байт-код)." + +msgid "" +"This probe point is the converse of ``python.function.return``, and " +"indicates that execution of a Python function has ended (either via " +"``return``, or via an exception). It is only triggered for pure-Python " +"(bytecode) functions." +msgstr "" +"Ця точка тестування є протилежністю ``python.function.return`` і вказує, що " +"виконання функції Python завершилося (або через ``return``, або через " +"виняток). Він запускається лише для функцій чистого Python (байт-код)." + +msgid "Examples" +msgstr "Приклади" + +msgid "" +"This SystemTap script uses the tapset above to more cleanly implement the " +"example given above of tracing the Python function-call hierarchy, without " +"needing to directly name the static markers:" +msgstr "" +"Цей сценарій SystemTap використовує наведений вище набір для більш чіткої " +"реалізації наведеного вище прикладу відстеження ієрархії викликів функцій " +"Python, без необхідності безпосередньо називати статичні маркери:" + +msgid "" +"probe python.function.entry\n" +"{\n" +" printf(\"%s => %s in %s:%d\\n\",\n" +" thread_indent(1), funcname, filename, lineno);\n" +"}\n" +"\n" +"probe python.function.return\n" +"{\n" +" printf(\"%s <= %s in %s:%d\\n\",\n" +" thread_indent(-1), funcname, filename, lineno);\n" +"}" +msgstr "" + +msgid "" +"The following script uses the tapset above to provide a top-like view of all " +"running CPython code, showing the top 20 most frequently entered bytecode " +"frames, each second, across the whole system:" +msgstr "" + +msgid "" +"global fn_calls;\n" +"\n" +"probe python.function.entry\n" +"{\n" +" fn_calls[pid(), filename, funcname, lineno] += 1;\n" +"}\n" +"\n" +"probe timer.ms(1000) {\n" +" printf(\"\\033[2J\\033[1;1H\") /* clear screen \\*/\n" +" printf(\"%6s %80s %6s %30s %6s\\n\",\n" +" \"PID\", \"FILENAME\", \"LINE\", \"FUNCTION\", \"CALLS\")\n" +" foreach ([pid, filename, funcname, lineno] in fn_calls- limit 20) {\n" +" printf(\"%6d %80s %6d %30s %6d\\n\",\n" +" pid, filename, lineno, funcname,\n" +" fn_calls[pid, filename, funcname, lineno]);\n" +" }\n" +" delete fn_calls;\n" +"}" +msgstr "" diff --git a/howto/ipaddress.po b/howto/ipaddress.po new file mode 100644 index 000000000..7dc6d299a --- /dev/null +++ b/howto/ipaddress.po @@ -0,0 +1,530 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:53+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "An introduction to the ipaddress module" +msgstr "Знайомство з модулем ipaddress" + +msgid "author" +msgstr "автор" + +msgid "Peter Moody" +msgstr "Peter Moody" + +msgid "Nick Coghlan" +msgstr "Nick Coghlan" + +msgid "Overview" +msgstr "Огляд" + +msgid "" +"This document aims to provide a gentle introduction to the :mod:`ipaddress` " +"module. It is aimed primarily at users that aren't already familiar with IP " +"networking terminology, but may also be useful to network engineers wanting " +"an overview of how :mod:`ipaddress` represents IP network addressing " +"concepts." +msgstr "" +"Цей документ має на меті надати короткий вступ до модуля :mod:`ipaddress`. " +"Він орієнтований насамперед на користувачів, які ще не знайомі з " +"термінологією IP-мереж, але також може бути корисним для мережевих " +"інженерів, які бажають отримати огляд того, як :mod:`ipaddress` представляє " +"концепції адресації IP-мережі." + +msgid "Creating Address/Network/Interface objects" +msgstr "Створення об’єктів Адреса/Мережа/Інтерфейс" + +msgid "" +"Since :mod:`ipaddress` is a module for inspecting and manipulating IP " +"addresses, the first thing you'll want to do is create some objects. You " +"can use :mod:`ipaddress` to create objects from strings and integers." +msgstr "" +"Оскільки :mod:`ipaddress` — це модуль для перевірки та маніпулювання IP-" +"адресами, перше, що ви захочете зробити, це створити кілька об’єктів. Ви " +"можете використовувати :mod:`ipaddress` для створення об’єктів із рядків і " +"цілих чисел." + +msgid "A Note on IP Versions" +msgstr "Примітка щодо версій IP" + +msgid "" +"For readers that aren't particularly familiar with IP addressing, it's " +"important to know that the Internet Protocol (IP) is currently in the " +"process of moving from version 4 of the protocol to version 6. This " +"transition is occurring largely because version 4 of the protocol doesn't " +"provide enough addresses to handle the needs of the whole world, especially " +"given the increasing number of devices with direct connections to the " +"internet." +msgstr "" +"Читачам, які не особливо знайомі з IP-адресацією, важливо знати, що Інтернет-" +"протокол (IP) зараз перебуває в процесі переходу від версії 4 протоколу до " +"версії 6. Цей перехід відбувається головним чином тому, що версія 4 " +"протоколу протокол не надає достатньо адрес для задоволення потреб усього " +"світу, особливо зважаючи на збільшення кількості пристроїв із прямим " +"підключенням до Інтернету." + +msgid "" +"Explaining the details of the differences between the two versions of the " +"protocol is beyond the scope of this introduction, but readers need to at " +"least be aware that these two versions exist, and it will sometimes be " +"necessary to force the use of one version or the other." +msgstr "" +"Пояснення деталей відмінностей між двома версіями протоколу виходить за " +"рамки цього вступу, але читачі повинні принаймні знати, що ці дві версії " +"існують, і іноді буде необхідно примусово використовувати одну версію або " +"інший." + +msgid "IP Host Addresses" +msgstr "IP-адреси хостів" + +msgid "" +"Addresses, often referred to as \"host addresses\" are the most basic unit " +"when working with IP addressing. The simplest way to create addresses is to " +"use the :func:`ipaddress.ip_address` factory function, which automatically " +"determines whether to create an IPv4 or IPv6 address based on the passed in " +"value:" +msgstr "" +"Адреси, які часто називають \"адресами хостів\", є основними одиницями " +"роботи з IP-адресуванням. Найпростішим способом створення адрес є " +"використання фабричної функції :func:`ipaddress.ip_address`, яка автоматично " +"визначає, чи потрібно створити адресу IPv4 чи IPv6 на основі переданого " +"значення:" + +msgid "" +"Addresses can also be created directly from integers. Values that will fit " +"within 32 bits are assumed to be IPv4 addresses::" +msgstr "" +"Адреси також можна створювати безпосередньо з цілих чисел. Припускається, що " +"значення, які вміщуються в 32 біти, є адресами IPv4:" + +msgid "" +">>> ipaddress.ip_address(3221225985)\n" +"IPv4Address('192.0.2.1')\n" +">>> ipaddress.ip_address(42540766411282592856903984951653826561)\n" +"IPv6Address('2001:db8::1')" +msgstr "" + +msgid "" +"To force the use of IPv4 or IPv6 addresses, the relevant classes can be " +"invoked directly. This is particularly useful to force creation of IPv6 " +"addresses for small integers::" +msgstr "" +"Щоб примусово використовувати адреси IPv4 або IPv6, відповідні класи можна " +"викликати безпосередньо. Це особливо корисно для примусового створення адрес " +"IPv6 для малих цілих чисел:" + +msgid "" +">>> ipaddress.ip_address(1)\n" +"IPv4Address('0.0.0.1')\n" +">>> ipaddress.IPv4Address(1)\n" +"IPv4Address('0.0.0.1')\n" +">>> ipaddress.IPv6Address(1)\n" +"IPv6Address('::1')" +msgstr "" + +msgid "Defining Networks" +msgstr "Визначення мереж" + +msgid "" +"Host addresses are usually grouped together into IP networks, so :mod:" +"`ipaddress` provides a way to create, inspect and manipulate network " +"definitions. IP network objects are constructed from strings that define the " +"range of host addresses that are part of that network. The simplest form for " +"that information is a \"network address/network prefix\" pair, where the " +"prefix defines the number of leading bits that are compared to determine " +"whether or not an address is part of the network and the network address " +"defines the expected value of those bits." +msgstr "" +"Адреси хостів зазвичай групуються в IP-мережі, тому :mod:`ipaddress` надає " +"можливість створювати, перевіряти та маніпулювати визначеннями мережі. " +"Об’єкти IP-мережі складаються з рядків, які визначають діапазон адрес " +"хостів, які є частиною цієї мережі. Найпростішою формою цієї інформації є " +"пара \"адреса мережі/префікс мережі\", де префікс визначає кількість " +"початкових бітів, які порівнюються, щоб визначити, чи є адреса частиною " +"мережі, а мережева адреса визначає очікуване значення ці шматочки." + +msgid "" +"As for addresses, a factory function is provided that determines the correct " +"IP version automatically::" +msgstr "" +"Що стосується адрес, передбачена заводська функція, яка автоматично визначає " +"правильну версію IP:" + +msgid "" +">>> ipaddress.ip_network('192.0.2.0/24')\n" +"IPv4Network('192.0.2.0/24')\n" +">>> ipaddress.ip_network('2001:db8::0/96')\n" +"IPv6Network('2001:db8::/96')" +msgstr "" + +msgid "" +"Network objects cannot have any host bits set. The practical effect of this " +"is that ``192.0.2.1/24`` does not describe a network. Such definitions are " +"referred to as interface objects since the ip-on-a-network notation is " +"commonly used to describe network interfaces of a computer on a given " +"network and are described further in the next section." +msgstr "" +"Мережні об’єкти не можуть мати встановлені біти хоста. Практичний ефект " +"цього полягає в тому, що ``192.0.2.1/24`` не описує мережу. Такі визначення " +"називаються об’єктами інтерфейсу, оскільки нотація ip-on-a-network зазвичай " +"використовується для опису мережевих інтерфейсів комп’ютера в даній мережі " +"та описана далі в наступному розділі." + +msgid "" +"By default, attempting to create a network object with host bits set will " +"result in :exc:`ValueError` being raised. To request that the additional " +"bits instead be coerced to zero, the flag ``strict=False`` can be passed to " +"the constructor::" +msgstr "" +"За замовчуванням спроба створити мережевий об’єкт із встановленими бітами " +"хоста призведе до появи :exc:`ValueError`. Щоб запитати, щоб додаткові біти " +"натомість привели до нуля, прапорець ``strict=False`` можна передати " +"конструктору:" + +msgid "" +">>> ipaddress.ip_network('192.0.2.1/24')\n" +"Traceback (most recent call last):\n" +" ...\n" +"ValueError: 192.0.2.1/24 has host bits set\n" +">>> ipaddress.ip_network('192.0.2.1/24', strict=False)\n" +"IPv4Network('192.0.2.0/24')" +msgstr "" + +msgid "" +"While the string form offers significantly more flexibility, networks can " +"also be defined with integers, just like host addresses. In this case, the " +"network is considered to contain only the single address identified by the " +"integer, so the network prefix includes the entire network address::" +msgstr "" +"Хоча рядкова форма забезпечує значно більшу гнучкість, мережі також можна " +"визначати цілими числами, як і адреси хостів. У цьому випадку вважається, що " +"мережа містить лише одну адресу, визначену цілим числом, тому мережевий " +"префікс включає всю мережеву адресу::" + +msgid "" +">>> ipaddress.ip_network(3221225984)\n" +"IPv4Network('192.0.2.0/32')\n" +">>> ipaddress.ip_network(42540766411282592856903984951653826560)\n" +"IPv6Network('2001:db8::/128')" +msgstr "" + +msgid "" +"As with addresses, creation of a particular kind of network can be forced by " +"calling the class constructor directly instead of using the factory function." +msgstr "" +"Як і у випадку з адресами, створення певного типу мережі можна примусово " +"викликати безпосередньо конструктор класу замість використання функції " +"фабрики." + +msgid "Host Interfaces" +msgstr "Інтерфейси хоста" + +msgid "" +"As mentioned just above, if you need to describe an address on a particular " +"network, neither the address nor the network classes are sufficient. " +"Notation like ``192.0.2.1/24`` is commonly used by network engineers and the " +"people who write tools for firewalls and routers as shorthand for \"the host " +"``192.0.2.1`` on the network ``192.0.2.0/24``\", Accordingly, :mod:" +"`ipaddress` provides a set of hybrid classes that associate an address with " +"a particular network. The interface for creation is identical to that for " +"defining network objects, except that the address portion isn't constrained " +"to being a network address." +msgstr "" +"Як згадувалося вище, якщо вам потрібно описати адресу в певній мережі, ні " +"адреси, ні класів мережі недостатньо. Позначення на зразок ``192.0.2.1/24`` " +"зазвичай використовується мережевими інженерами та людьми, які пишуть " +"інструменти для брандмауерів і маршрутизаторів, як скорочення для \"хосту " +"``192.0.2.1`` в мережі ``192.0.2.0/24``\", Відповідно, :mod:`ipaddress` " +"надає набір гібридних класів, які пов’язують адресу з певною мережею. " +"Інтерфейс для створення ідентичний інтерфейсу для визначення мережевих " +"об’єктів, за винятком того, що частина адреси не обмежена мережевою адресою." + +msgid "" +"Integer inputs are accepted (as with networks), and use of a particular IP " +"version can be forced by calling the relevant constructor directly." +msgstr "" +"Цілочисельні введення приймаються (як у випадку з мережами), і використання " +"певної версії IP може бути примусово викликано відповідний конструктор " +"безпосередньо." + +msgid "Inspecting Address/Network/Interface Objects" +msgstr "Перевірка об’єктів адреси/мережі/інтерфейсу" + +msgid "" +"You've gone to the trouble of creating an IPv(4|6)(Address|Network|" +"Interface) object, so you probably want to get information about it. :mod:" +"`ipaddress` tries to make doing this easy and intuitive." +msgstr "" +"Ви потрудилися зі створенням об’єкта IPv(4|6)(Address|Network|Interface), " +"тож, мабуть, хочете отримати інформацію про нього. :mod:`ipaddress` " +"намагається зробити це легким та інтуїтивно зрозумілим." + +msgid "Extracting the IP version::" +msgstr "Витяг версії IP::" + +msgid "" +">>> addr4 = ipaddress.ip_address('192.0.2.1')\n" +">>> addr6 = ipaddress.ip_address('2001:db8::1')\n" +">>> addr6.version\n" +"6\n" +">>> addr4.version\n" +"4" +msgstr "" + +msgid "Obtaining the network from an interface::" +msgstr "Отримання мережі через інтерфейс::" + +msgid "" +">>> host4 = ipaddress.ip_interface('192.0.2.1/24')\n" +">>> host4.network\n" +"IPv4Network('192.0.2.0/24')\n" +">>> host6 = ipaddress.ip_interface('2001:db8::1/96')\n" +">>> host6.network\n" +"IPv6Network('2001:db8::/96')" +msgstr "" + +msgid "Finding out how many individual addresses are in a network::" +msgstr "Дізнатися кількість окремих адрес у мережі:" + +msgid "" +">>> net4 = ipaddress.ip_network('192.0.2.0/24')\n" +">>> net4.num_addresses\n" +"256\n" +">>> net6 = ipaddress.ip_network('2001:db8::0/96')\n" +">>> net6.num_addresses\n" +"4294967296" +msgstr "" + +msgid "Iterating through the \"usable\" addresses on a network::" +msgstr "Перебір \"придатних\" адрес у мережі:" + +msgid "" +">>> net4 = ipaddress.ip_network('192.0.2.0/24')\n" +">>> for x in net4.hosts():\n" +"... print(x)\n" +"192.0.2.1\n" +"192.0.2.2\n" +"192.0.2.3\n" +"192.0.2.4\n" +"...\n" +"192.0.2.252\n" +"192.0.2.253\n" +"192.0.2.254" +msgstr "" + +msgid "" +"Obtaining the netmask (i.e. set bits corresponding to the network prefix) or " +"the hostmask (any bits that are not part of the netmask):" +msgstr "" +"Отримання маски мережі (тобто встановлених бітів, що відповідають префіксу " +"мережі) або маски хоста (будь-яких бітів, які не є частиною маски мережі):" + +msgid "Exploding or compressing the address::" +msgstr "Розкладання або стиснення адреси:" + +msgid "" +">>> addr6.exploded\n" +"'2001:0db8:0000:0000:0000:0000:0000:0001'\n" +">>> addr6.compressed\n" +"'2001:db8::1'\n" +">>> net6.exploded\n" +"'2001:0db8:0000:0000:0000:0000:0000:0000/96'\n" +">>> net6.compressed\n" +"'2001:db8::/96'" +msgstr "" + +msgid "" +"While IPv4 doesn't support explosion or compression, the associated objects " +"still provide the relevant properties so that version neutral code can " +"easily ensure the most concise or most verbose form is used for IPv6 " +"addresses while still correctly handling IPv4 addresses." +msgstr "" +"Незважаючи на те, що IPv4 не підтримує розгортання чи стиснення, пов’язані " +"об’єкти все одно надають відповідні властивості, щоб нейтральний код версії " +"міг легко гарантувати, що для адрес IPv6 використовується найкоротша чи " +"найбільш докладна форма, водночас правильно обробляючи адреси IPv4." + +msgid "Networks as lists of Addresses" +msgstr "Мережі як списки адрес" + +msgid "" +"It's sometimes useful to treat networks as lists. This means it is possible " +"to index them like this::" +msgstr "" +"Іноді корисно розглядати мережі як списки. Це означає, що їх можна " +"індексувати таким чином:" + +msgid "" +">>> net4[1]\n" +"IPv4Address('192.0.2.1')\n" +">>> net4[-1]\n" +"IPv4Address('192.0.2.255')\n" +">>> net6[1]\n" +"IPv6Address('2001:db8::1')\n" +">>> net6[-1]\n" +"IPv6Address('2001:db8::ffff:ffff')" +msgstr "" + +msgid "" +"It also means that network objects lend themselves to using the list " +"membership test syntax like this::" +msgstr "" +"Це також означає, що мережеві об’єкти піддаються використанню синтаксису " +"перевірки членства в списку таким чином:" + +msgid "" +"if address in network:\n" +" # do something" +msgstr "" + +msgid "Containment testing is done efficiently based on the network prefix::" +msgstr "" +"Тестування обмеження виконується ефективно на основі мережевого префікса::" + +msgid "" +">>> addr4 = ipaddress.ip_address('192.0.2.1')\n" +">>> addr4 in ipaddress.ip_network('192.0.2.0/24')\n" +"True\n" +">>> addr4 in ipaddress.ip_network('192.0.3.0/24')\n" +"False" +msgstr "" + +msgid "Comparisons" +msgstr "Порівняння" + +msgid "" +":mod:`ipaddress` provides some simple, hopefully intuitive ways to compare " +"objects, where it makes sense::" +msgstr "" +":mod:`ipaddress` надає кілька простих, сподіваюся, інтуїтивно зрозумілих " +"способів порівняння об’єктів, де це має сенс:" + +msgid "" +">>> ipaddress.ip_address('192.0.2.1') < ipaddress.ip_address('192.0.2.2')\n" +"True" +msgstr "" + +msgid "" +"A :exc:`TypeError` exception is raised if you try to compare objects of " +"different versions or different types." +msgstr "" +"Виняток :exc:`TypeError` виникає, якщо ви намагаєтеся порівняти об’єкти " +"різних версій або різних типів." + +msgid "Using IP Addresses with other modules" +msgstr "Використання IP-адрес з іншими модулями" + +msgid "" +"Other modules that use IP addresses (such as :mod:`socket`) usually won't " +"accept objects from this module directly. Instead, they must be coerced to " +"an integer or string that the other module will accept::" +msgstr "" +"Інші модулі, які використовують IP-адреси (такі як :mod:`socket`), зазвичай " +"не приймають об’єкти з цього модуля безпосередньо. Замість цього вони " +"повинні бути приведені до цілого числа або рядка, який прийме інший модуль:" + +msgid "" +">>> addr4 = ipaddress.ip_address('192.0.2.1')\n" +">>> str(addr4)\n" +"'192.0.2.1'\n" +">>> int(addr4)\n" +"3221225985" +msgstr "" + +msgid "Getting more detail when instance creation fails" +msgstr "Отримання додаткової інформації, коли не вдається створити примірник" + +msgid "" +"When creating address/network/interface objects using the version-agnostic " +"factory functions, any errors will be reported as :exc:`ValueError` with a " +"generic error message that simply says the passed in value was not " +"recognized as an object of that type. The lack of a specific error is " +"because it's necessary to know whether the value is *supposed* to be IPv4 or " +"IPv6 in order to provide more detail on why it has been rejected." +msgstr "" +"Під час створення об’єктів адреси/мережі/інтерфейсу за допомогою функцій " +"фабрики, що не залежать від версії, про будь-які помилки повідомлятиметься " +"як :exc:`ValueError` із загальним повідомленням про помилку, яке просто " +"повідомляє, що передане значення не було розпізнано як об’єкт цього типу. " +"Відсутність конкретної помилки пов’язана з тим, що необхідно знати, чи *має* " +"значення бути IPv4 чи IPv6, щоб надати докладнішу інформацію про те, чому " +"його було відхилено." + +msgid "" +"To support use cases where it is useful to have access to this additional " +"detail, the individual class constructors actually raise the :exc:" +"`ValueError` subclasses :exc:`ipaddress.AddressValueError` and :exc:" +"`ipaddress.NetmaskValueError` to indicate exactly which part of the " +"definition failed to parse correctly." +msgstr "" +"Щоб підтримати випадки використання, де корисно мати доступ до цієї " +"додаткової деталі, окремі конструктори класів фактично створюють підкласи :" +"exc:`ValueError` :exc:`ipaddress.AddressValueError` і :exc:`ipaddress." +"NetmaskValueError`, щоб точно вказати яку частину визначення не вдалося " +"правильно проаналізувати." + +msgid "" +"The error messages are significantly more detailed when using the class " +"constructors directly. For example::" +msgstr "" +"Повідомлення про помилки значно більш детальні при безпосередньому " +"використанні конструкторів класів. Наприклад::" + +msgid "" +">>> ipaddress.ip_address(\"192.168.0.256\")\n" +"Traceback (most recent call last):\n" +" ...\n" +"ValueError: '192.168.0.256' does not appear to be an IPv4 or IPv6 address\n" +">>> ipaddress.IPv4Address(\"192.168.0.256\")\n" +"Traceback (most recent call last):\n" +" ...\n" +"ipaddress.AddressValueError: Octet 256 (> 255) not permitted in " +"'192.168.0.256'\n" +"\n" +">>> ipaddress.ip_network(\"192.168.0.1/64\")\n" +"Traceback (most recent call last):\n" +" ...\n" +"ValueError: '192.168.0.1/64' does not appear to be an IPv4 or IPv6 network\n" +">>> ipaddress.IPv4Network(\"192.168.0.1/64\")\n" +"Traceback (most recent call last):\n" +" ...\n" +"ipaddress.NetmaskValueError: '64' is not a valid netmask" +msgstr "" + +msgid "" +"However, both of the module specific exceptions have :exc:`ValueError` as " +"their parent class, so if you're not concerned with the particular type of " +"error, you can still write code like the following::" +msgstr "" +"Однак обидва винятки, специфічні для модуля, мають :exc:`ValueError` як " +"батьківський клас, тому, якщо вас не хвилює певний тип помилки, ви все одно " +"можете написати наступний код:" + +msgid "" +"try:\n" +" network = ipaddress.IPv4Network(address)\n" +"except ValueError:\n" +" print('address/netmask is invalid for IPv4:', address)" +msgstr "" diff --git a/howto/isolating-extensions.po b/howto/isolating-extensions.po new file mode 100644 index 000000000..4033d5e11 --- /dev/null +++ b/howto/isolating-extensions.po @@ -0,0 +1,790 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2022-11-05 19:48+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Isolating Extension Modules" +msgstr "" + +msgid "Abstract" +msgstr "Анотація" + +msgid "" +"Traditionally, state belonging to Python extension modules was kept in C " +"``static`` variables, which have process-wide scope. This document describes " +"problems of such per-process state and shows a safer way: per-module state." +msgstr "" + +msgid "" +"The document also describes how to switch to per-module state where " +"possible. This transition involves allocating space for that state, " +"potentially switching from static types to heap types, and—perhaps most " +"importantly—accessing per-module state from code." +msgstr "" + +msgid "Who should read this" +msgstr "" + +msgid "" +"This guide is written for maintainers of :ref:`C-API ` " +"extensions who would like to make that extension safer to use in " +"applications where Python itself is used as a library." +msgstr "" + +msgid "Background" +msgstr "Фон" + +msgid "" +"An *interpreter* is the context in which Python code runs. It contains " +"configuration (e.g. the import path) and runtime state (e.g. the set of " +"imported modules)." +msgstr "" + +msgid "" +"Python supports running multiple interpreters in one process. There are two " +"cases to think about—users may run interpreters:" +msgstr "" + +msgid "" +"in sequence, with several :c:func:`Py_InitializeEx`/:c:func:`Py_FinalizeEx` " +"cycles, and" +msgstr "" + +msgid "" +"in parallel, managing \"sub-interpreters\" using :c:func:" +"`Py_NewInterpreter`/:c:func:`Py_EndInterpreter`." +msgstr "" + +msgid "" +"Both cases (and combinations of them) would be most useful when embedding " +"Python within a library. Libraries generally shouldn't make assumptions " +"about the application that uses them, which include assuming a process-wide " +"\"main Python interpreter\"." +msgstr "" + +msgid "" +"Historically, Python extension modules don't handle this use case well. Many " +"extension modules (and even some stdlib modules) use *per-process* global " +"state, because C ``static`` variables are extremely easy to use. Thus, data " +"that should be specific to an interpreter ends up being shared between " +"interpreters. Unless the extension developer is careful, it is very easy to " +"introduce edge cases that lead to crashes when a module is loaded in more " +"than one interpreter in the same process." +msgstr "" + +msgid "" +"Unfortunately, *per-interpreter* state is not easy to achieve. Extension " +"authors tend to not keep multiple interpreters in mind when developing, and " +"it is currently cumbersome to test the behavior." +msgstr "" + +msgid "Enter Per-Module State" +msgstr "" + +msgid "" +"Instead of focusing on per-interpreter state, Python's C API is evolving to " +"better support the more granular *per-module* state. This means that C-level " +"data should be attached to a *module object*. Each interpreter creates its " +"own module object, keeping the data separate. For testing the isolation, " +"multiple module objects corresponding to a single extension can even be " +"loaded in a single interpreter." +msgstr "" + +msgid "" +"Per-module state provides an easy way to think about lifetime and resource " +"ownership: the extension module will initialize when a module object is " +"created, and clean up when it's freed. In this regard, a module is just like " +"any other :c:expr:`PyObject *`; there are no \"on interpreter shutdown\" " +"hooks to think—or forget—about." +msgstr "" + +msgid "" +"Note that there are use cases for different kinds of \"globals\": per-" +"process, per-interpreter, per-thread or per-task state. With per-module " +"state as the default, these are still possible, but you should treat them as " +"exceptional cases: if you need them, you should give them additional care " +"and testing. (Note that this guide does not cover them.)" +msgstr "" + +msgid "Isolated Module Objects" +msgstr "" + +msgid "" +"The key point to keep in mind when developing an extension module is that " +"several module objects can be created from a single shared library. For " +"example:" +msgstr "" + +msgid "" +">>> import sys\n" +">>> import binascii\n" +">>> old_binascii = binascii\n" +">>> del sys.modules['binascii']\n" +">>> import binascii # create a new module object\n" +">>> old_binascii == binascii\n" +"False" +msgstr "" + +msgid "" +"As a rule of thumb, the two modules should be completely independent. All " +"objects and state specific to the module should be encapsulated within the " +"module object, not shared with other module objects, and cleaned up when the " +"module object is deallocated. Since this just is a rule of thumb, exceptions " +"are possible (see `Managing Global State`_), but they will need more thought " +"and attention to edge cases." +msgstr "" + +msgid "" +"While some modules could do with less stringent restrictions, isolated " +"modules make it easier to set clear expectations and guidelines that work " +"across a variety of use cases." +msgstr "" + +msgid "Surprising Edge Cases" +msgstr "" + +msgid "" +"Note that isolated modules do create some surprising edge cases. Most " +"notably, each module object will typically not share its classes and " +"exceptions with other similar modules. Continuing from the `example above " +"`__, note that ``old_binascii.Error`` and " +"``binascii.Error`` are separate objects. In the following code, the " +"exception is *not* caught:" +msgstr "" + +msgid "" +">>> old_binascii.Error == binascii.Error\n" +"False\n" +">>> try:\n" +"... old_binascii.unhexlify(b'qwertyuiop')\n" +"... except binascii.Error:\n" +"... print('boo')\n" +"...\n" +"Traceback (most recent call last):\n" +" File \"\", line 2, in \n" +"binascii.Error: Non-hexadecimal digit found" +msgstr "" + +msgid "" +"This is expected. Notice that pure-Python modules behave the same way: it is " +"a part of how Python works." +msgstr "" + +msgid "" +"The goal is to make extension modules safe at the C level, not to make hacks " +"behave intuitively. Mutating ``sys.modules`` \"manually\" counts as a hack." +msgstr "" + +msgid "Making Modules Safe with Multiple Interpreters" +msgstr "" + +msgid "Managing Global State" +msgstr "" + +msgid "" +"Sometimes, the state associated with a Python module is not specific to that " +"module, but to the entire process (or something else \"more global\" than a " +"module). For example:" +msgstr "" + +msgid "The ``readline`` module manages *the* terminal." +msgstr "" + +msgid "" +"A module running on a circuit board wants to control *the* on-board LED." +msgstr "" + +msgid "" +"In these cases, the Python module should provide *access* to the global " +"state, rather than *own* it. If possible, write the module so that multiple " +"copies of it can access the state independently (along with other libraries, " +"whether for Python or other languages). If that is not possible, consider " +"explicit locking." +msgstr "" + +msgid "" +"If it is necessary to use process-global state, the simplest way to avoid " +"issues with multiple interpreters is to explicitly prevent a module from " +"being loaded more than once per process—see `Opt-Out: Limiting to One Module " +"Object per Process`_." +msgstr "" + +msgid "Managing Per-Module State" +msgstr "" + +msgid "" +"To use per-module state, use :ref:`multi-phase extension module " +"initialization `. This signals that your module " +"supports multiple interpreters correctly." +msgstr "" + +msgid "" +"Set ``PyModuleDef.m_size`` to a positive number to request that many bytes " +"of storage local to the module. Usually, this will be set to the size of " +"some module-specific ``struct``, which can store all of the module's C-level " +"state. In particular, it is where you should put pointers to classes " +"(including exceptions, but excluding static types) and settings (e.g. " +"``csv``'s :py:data:`~csv.field_size_limit`) which the C code needs to " +"function." +msgstr "" + +msgid "" +"Another option is to store state in the module's ``__dict__``, but you must " +"avoid crashing when users modify ``__dict__`` from Python code. This usually " +"means error- and type-checking at the C level, which is easy to get wrong " +"and hard to test sufficiently." +msgstr "" + +msgid "" +"However, if module state is not needed in C code, storing it in ``__dict__`` " +"only is a good idea." +msgstr "" + +msgid "" +"If the module state includes ``PyObject`` pointers, the module object must " +"hold references to those objects and implement the module-level hooks " +"``m_traverse``, ``m_clear`` and ``m_free``. These work like ``tp_traverse``, " +"``tp_clear`` and ``tp_free`` of a class. Adding them will require some work " +"and make the code longer; this is the price for modules which can be " +"unloaded cleanly." +msgstr "" + +msgid "" +"An example of a module with per-module state is currently available as " +"`xxlimited `__; example module initialization shown at the bottom of the file." +msgstr "" + +msgid "Opt-Out: Limiting to One Module Object per Process" +msgstr "" + +msgid "" +"A non-negative ``PyModuleDef.m_size`` signals that a module supports " +"multiple interpreters correctly. If this is not yet the case for your " +"module, you can explicitly make your module loadable only once per process. " +"For example::" +msgstr "" + +msgid "" +"static int loaded = 0;\n" +"\n" +"static int\n" +"exec_module(PyObject* module)\n" +"{\n" +" if (loaded) {\n" +" PyErr_SetString(PyExc_ImportError,\n" +" \"cannot load module more than once per process\");\n" +" return -1;\n" +" }\n" +" loaded = 1;\n" +" // ... rest of initialization\n" +"}" +msgstr "" + +msgid "Module State Access from Functions" +msgstr "" + +msgid "" +"Accessing the state from module-level functions is straightforward. " +"Functions get the module object as their first argument; for extracting the " +"state, you can use ``PyModule_GetState``::" +msgstr "" + +msgid "" +"static PyObject *\n" +"func(PyObject *module, PyObject *args)\n" +"{\n" +" my_struct *state = (my_struct*)PyModule_GetState(module);\n" +" if (state == NULL) {\n" +" return NULL;\n" +" }\n" +" // ... rest of logic\n" +"}" +msgstr "" + +msgid "" +"``PyModule_GetState`` may return ``NULL`` without setting an exception if " +"there is no module state, i.e. ``PyModuleDef.m_size`` was zero. In your own " +"module, you're in control of ``m_size``, so this is easy to prevent." +msgstr "" + +msgid "Heap Types" +msgstr "Типи купи" + +msgid "" +"Traditionally, types defined in C code are *static*; that is, ``static " +"PyTypeObject`` structures defined directly in code and initialized using " +"``PyType_Ready()``." +msgstr "" + +msgid "" +"Such types are necessarily shared across the process. Sharing them between " +"module objects requires paying attention to any state they own or access. To " +"limit the possible issues, static types are immutable at the Python level: " +"for example, you can't set ``str.myattribute = 123``." +msgstr "" + +msgid "" +"Sharing truly immutable objects between interpreters is fine, as long as " +"they don't provide access to mutable objects. However, in CPython, every " +"Python object has a mutable implementation detail: the reference count. " +"Changes to the refcount are guarded by the GIL. Thus, code that shares any " +"Python objects across interpreters implicitly depends on CPython's current, " +"process-wide GIL." +msgstr "" + +msgid "" +"Because they are immutable and process-global, static types cannot access " +"\"their\" module state. If any method of such a type requires access to " +"module state, the type must be converted to a *heap-allocated type*, or " +"*heap type* for short. These correspond more closely to classes created by " +"Python's ``class`` statement." +msgstr "" + +msgid "For new modules, using heap types by default is a good rule of thumb." +msgstr "" + +msgid "Changing Static Types to Heap Types" +msgstr "" + +msgid "" +"Static types can be converted to heap types, but note that the heap type API " +"was not designed for \"lossless\" conversion from static types—that is, " +"creating a type that works exactly like a given static type. So, when " +"rewriting the class definition in a new API, you are likely to " +"unintentionally change a few details (e.g. pickleability or inherited " +"slots). Always test the details that are important to you." +msgstr "" + +msgid "" +"Watch out for the following two points in particular (but note that this is " +"not a comprehensive list):" +msgstr "" + +msgid "" +"Unlike static types, heap type objects are mutable by default. Use the :c:" +"macro:`Py_TPFLAGS_IMMUTABLETYPE` flag to prevent mutability." +msgstr "" + +msgid "" +"Heap types inherit :c:member:`~PyTypeObject.tp_new` by default, so it may " +"become possible to instantiate them from Python code. You can prevent this " +"with the :c:macro:`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag." +msgstr "" + +msgid "Defining Heap Types" +msgstr "" + +msgid "" +"Heap types can be created by filling a :c:struct:`PyType_Spec` structure, a " +"description or \"blueprint\" of a class, and calling :c:func:" +"`PyType_FromModuleAndSpec` to construct a new class object." +msgstr "" + +msgid "" +"Other functions, like :c:func:`PyType_FromSpec`, can also create heap types, " +"but :c:func:`PyType_FromModuleAndSpec` associates the module with the class, " +"allowing access to the module state from methods." +msgstr "" + +msgid "" +"The class should generally be stored in *both* the module state (for safe " +"access from C) and the module's ``__dict__`` (for access from Python code)." +msgstr "" + +msgid "Garbage-Collection Protocol" +msgstr "" + +msgid "" +"Instances of heap types hold a reference to their type. This ensures that " +"the type isn't destroyed before all its instances are, but may result in " +"reference cycles that need to be broken by the garbage collector." +msgstr "" + +msgid "" +"To avoid memory leaks, instances of heap types must implement the garbage " +"collection protocol. That is, heap types should:" +msgstr "" + +msgid "Have the :c:macro:`Py_TPFLAGS_HAVE_GC` flag." +msgstr "" + +msgid "" +"Define a traverse function using ``Py_tp_traverse``, which visits the type " +"(e.g. using ``Py_VISIT(Py_TYPE(self))``)." +msgstr "" + +msgid "" +"Please refer to the documentation of :c:macro:`Py_TPFLAGS_HAVE_GC` and :c:" +"member:`~PyTypeObject.tp_traverse` for additional considerations." +msgstr "" + +msgid "" +"The API for defining heap types grew organically, leaving it somewhat " +"awkward to use in its current state. The following sections will guide you " +"through common issues." +msgstr "" + +msgid "``tp_traverse`` in Python 3.8 and lower" +msgstr "" + +msgid "" +"The requirement to visit the type from ``tp_traverse`` was added in Python " +"3.9. If you support Python 3.8 and lower, the traverse function must *not* " +"visit the type, so it must be more complicated::" +msgstr "" + +msgid "" +"static int my_traverse(PyObject *self, visitproc visit, void *arg)\n" +"{\n" +" if (Py_Version >= 0x03090000) {\n" +" Py_VISIT(Py_TYPE(self));\n" +" }\n" +" return 0;\n" +"}" +msgstr "" + +msgid "" +"Unfortunately, :c:data:`Py_Version` was only added in Python 3.11. As a " +"replacement, use:" +msgstr "" + +msgid ":c:macro:`PY_VERSION_HEX`, if not using the stable ABI, or" +msgstr "" + +msgid "" +":py:data:`sys.version_info` (via :c:func:`PySys_GetObject` and :c:func:" +"`PyArg_ParseTuple`)." +msgstr "" + +msgid "Delegating ``tp_traverse``" +msgstr "" + +msgid "" +"If your traverse function delegates to the :c:member:`~PyTypeObject." +"tp_traverse` of its base class (or another type), ensure that " +"``Py_TYPE(self)`` is visited only once. Note that only heap type are " +"expected to visit the type in ``tp_traverse``." +msgstr "" + +msgid "For example, if your traverse function includes::" +msgstr "" + +msgid "base->tp_traverse(self, visit, arg)" +msgstr "" + +msgid "...and ``base`` may be a static type, then it should also include::" +msgstr "" + +msgid "" +"if (base->tp_flags & Py_TPFLAGS_HEAPTYPE) {\n" +" // a heap type's tp_traverse already visited Py_TYPE(self)\n" +"} else {\n" +" if (Py_Version >= 0x03090000) {\n" +" Py_VISIT(Py_TYPE(self));\n" +" }\n" +"}" +msgstr "" + +msgid "" +"It is not necessary to handle the type's reference count in :c:member:" +"`~PyTypeObject.tp_new` and :c:member:`~PyTypeObject.tp_clear`." +msgstr "" + +msgid "Defining ``tp_dealloc``" +msgstr "" + +msgid "" +"If your type has a custom :c:member:`~PyTypeObject.tp_dealloc` function, it " +"needs to:" +msgstr "" + +msgid "" +"call :c:func:`PyObject_GC_UnTrack` before any fields are invalidated, and" +msgstr "" + +msgid "decrement the reference count of the type." +msgstr "" + +msgid "" +"To keep the type valid while ``tp_free`` is called, the type's refcount " +"needs to be decremented *after* the instance is deallocated. For example::" +msgstr "" + +msgid "" +"static void my_dealloc(PyObject *self)\n" +"{\n" +" PyObject_GC_UnTrack(self);\n" +" ...\n" +" PyTypeObject *type = Py_TYPE(self);\n" +" type->tp_free(self);\n" +" Py_DECREF(type);\n" +"}" +msgstr "" + +msgid "" +"The default ``tp_dealloc`` function does this, so if your type does *not* " +"override ``tp_dealloc`` you don't need to add it." +msgstr "" + +msgid "Not overriding ``tp_free``" +msgstr "" + +msgid "" +"The :c:member:`~PyTypeObject.tp_free` slot of a heap type must be set to :c:" +"func:`PyObject_GC_Del`. This is the default; do not override it." +msgstr "" + +msgid "Avoiding ``PyObject_New``" +msgstr "" + +msgid "GC-tracked objects need to be allocated using GC-aware functions." +msgstr "" + +msgid "If you use use :c:func:`PyObject_New` or :c:func:`PyObject_NewVar`:" +msgstr "" + +msgid "" +"Get and call type's :c:member:`~PyTypeObject.tp_alloc` slot, if possible. " +"That is, replace ``TYPE *o = PyObject_New(TYPE, typeobj)`` with::" +msgstr "" + +msgid "TYPE *o = typeobj->tp_alloc(typeobj, 0);" +msgstr "" + +msgid "" +"Replace ``o = PyObject_NewVar(TYPE, typeobj, size)`` with the same, but use " +"size instead of the 0." +msgstr "" + +msgid "" +"If the above is not possible (e.g. inside a custom ``tp_alloc``), call :c:" +"func:`PyObject_GC_New` or :c:func:`PyObject_GC_NewVar`::" +msgstr "" + +msgid "" +"TYPE *o = PyObject_GC_New(TYPE, typeobj);\n" +"\n" +"TYPE *o = PyObject_GC_NewVar(TYPE, typeobj, size);" +msgstr "" + +msgid "Module State Access from Classes" +msgstr "" + +msgid "" +"If you have a type object defined with :c:func:`PyType_FromModuleAndSpec`, " +"you can call :c:func:`PyType_GetModule` to get the associated module, and " +"then :c:func:`PyModule_GetState` to get the module's state." +msgstr "" + +msgid "" +"To save a some tedious error-handling boilerplate code, you can combine " +"these two steps with :c:func:`PyType_GetModuleState`, resulting in::" +msgstr "" + +msgid "" +"my_struct *state = (my_struct*)PyType_GetModuleState(type);\n" +"if (state == NULL) {\n" +" return NULL;\n" +"}" +msgstr "" + +msgid "Module State Access from Regular Methods" +msgstr "" + +msgid "" +"Accessing the module-level state from methods of a class is somewhat more " +"complicated, but is possible thanks to API introduced in Python 3.9. To get " +"the state, you need to first get the *defining class*, and then get the " +"module state from it." +msgstr "" + +msgid "" +"The largest roadblock is getting *the class a method was defined in*, or " +"that method's \"defining class\" for short. The defining class can have a " +"reference to the module it is part of." +msgstr "" + +msgid "" +"Do not confuse the defining class with ``Py_TYPE(self)``. If the method is " +"called on a *subclass* of your type, ``Py_TYPE(self)`` will refer to that " +"subclass, which may be defined in different module than yours." +msgstr "" + +msgid "" +"The following Python code can illustrate the concept. ``Base." +"get_defining_class`` returns ``Base`` even if ``type(self) == Sub``:" +msgstr "" + +msgid "" +"class Base:\n" +" def get_type_of_self(self):\n" +" return type(self)\n" +"\n" +" def get_defining_class(self):\n" +" return __class__\n" +"\n" +"class Sub(Base):\n" +" pass" +msgstr "" + +msgid "" +"For a method to get its \"defining class\", it must use the :ref:" +"`METH_METHOD | METH_FASTCALL | METH_KEYWORDS ` :c:type:`calling convention ` and the " +"corresponding :c:type:`PyCMethod` signature::" +msgstr "" + +msgid "" +"PyObject *PyCMethod(\n" +" PyObject *self, // object the method was called on\n" +" PyTypeObject *defining_class, // defining class\n" +" PyObject *const *args, // C array of arguments\n" +" Py_ssize_t nargs, // length of \"args\"\n" +" PyObject *kwnames) // NULL, or dict of keyword arguments" +msgstr "" + +msgid "" +"Once you have the defining class, call :c:func:`PyType_GetModuleState` to " +"get the state of its associated module." +msgstr "" + +msgid "For example::" +msgstr "Наприклад::" + +msgid "" +"static PyObject *\n" +"example_method(PyObject *self,\n" +" PyTypeObject *defining_class,\n" +" PyObject *const *args,\n" +" Py_ssize_t nargs,\n" +" PyObject *kwnames)\n" +"{\n" +" my_struct *state = (my_struct*)PyType_GetModuleState(defining_class);\n" +" if (state == NULL) {\n" +" return NULL;\n" +" }\n" +" ... // rest of logic\n" +"}\n" +"\n" +"PyDoc_STRVAR(example_method_doc, \"...\");\n" +"\n" +"static PyMethodDef my_methods[] = {\n" +" {\"example_method\",\n" +" (PyCFunction)(void(*)(void))example_method,\n" +" METH_METHOD|METH_FASTCALL|METH_KEYWORDS,\n" +" example_method_doc}\n" +" {NULL},\n" +"}" +msgstr "" + +msgid "Module State Access from Slot Methods, Getters and Setters" +msgstr "" + +msgid "This is new in Python 3.11." +msgstr "" + +msgid "" +"Slot methods—the fast C equivalents for special methods, such as :c:member:" +"`~PyNumberMethods.nb_add` for :py:attr:`~object.__add__` or :c:member:" +"`~PyTypeObject.tp_new` for initialization—have a very simple API that " +"doesn't allow passing in the defining class, unlike with :c:type:" +"`PyCMethod`. The same goes for getters and setters defined with :c:type:" +"`PyGetSetDef`." +msgstr "" + +msgid "" +"To access the module state in these cases, use the :c:func:" +"`PyType_GetModuleByDef` function, and pass in the module definition. Once " +"you have the module, call :c:func:`PyModule_GetState` to get the state::" +msgstr "" + +msgid "" +"PyObject *module = PyType_GetModuleByDef(Py_TYPE(self), &module_def);\n" +"my_struct *state = (my_struct*)PyModule_GetState(module);\n" +"if (state == NULL) {\n" +" return NULL;\n" +"}" +msgstr "" + +msgid "" +":c:func:`!PyType_GetModuleByDef` works by searching the :term:`method " +"resolution order` (i.e. all superclasses) for the first superclass that has " +"a corresponding module." +msgstr "" + +msgid "" +"In very exotic cases (inheritance chains spanning multiple modules created " +"from the same definition), :c:func:`!PyType_GetModuleByDef` might not return " +"the module of the true defining class. However, it will always return a " +"module with the same definition, ensuring a compatible C memory layout." +msgstr "" + +msgid "Lifetime of the Module State" +msgstr "" + +msgid "" +"When a module object is garbage-collected, its module state is freed. For " +"each pointer to (a part of) the module state, you must hold a reference to " +"the module object." +msgstr "" + +msgid "" +"Usually this is not an issue, because types created with :c:func:" +"`PyType_FromModuleAndSpec`, and their instances, hold a reference to the " +"module. However, you must be careful in reference counting when you " +"reference module state from other places, such as callbacks for external " +"libraries." +msgstr "" + +msgid "Open Issues" +msgstr "" + +msgid "Several issues around per-module state and heap types are still open." +msgstr "" + +msgid "" +"Discussions about improving the situation are best held on the `capi-sig " +"mailing list `__." +msgstr "" + +msgid "Per-Class Scope" +msgstr "" + +msgid "" +"It is currently (as of Python 3.11) not possible to attach state to " +"individual *types* without relying on CPython implementation details (which " +"may change in the future—perhaps, ironically, to allow a proper solution for " +"per-class scope)." +msgstr "" + +msgid "Lossless Conversion to Heap Types" +msgstr "" + +msgid "" +"The heap type API was not designed for \"lossless\" conversion from static " +"types; that is, creating a type that works exactly like a given static type." +msgstr "" diff --git a/howto/logging-cookbook.po b/howto/logging-cookbook.po new file mode 100644 index 000000000..bebbfb557 --- /dev/null +++ b/howto/logging-cookbook.po @@ -0,0 +1,5472 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:53+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Logging Cookbook" +msgstr "\"Книга рецептів\" з логування" + +msgid "Author" +msgstr "Автор" + +msgid "Vinay Sajip " +msgstr "Vinay Sajip " + +msgid "" +"This page contains a number of recipes related to logging, which have been " +"found useful in the past. For links to tutorial and reference information, " +"please see :ref:`cookbook-ref-links`." +msgstr "" + +msgid "Using logging in multiple modules" +msgstr "Використання журналювання в кількох модулях" + +msgid "" +"Multiple calls to ``logging.getLogger('someLogger')`` return a reference to " +"the same logger object. This is true not only within the same module, but " +"also across modules as long as it is in the same Python interpreter " +"process. It is true for references to the same object; additionally, " +"application code can define and configure a parent logger in one module and " +"create (but not configure) a child logger in a separate module, and all " +"logger calls to the child will pass up to the parent. Here is a main " +"module::" +msgstr "" +"Кілька викликів ``logging.getLogger('someLogger')`` повертають посилання на " +"той самий об’єкт журналу. Це вірно не лише в межах одного модуля, але й у " +"всіх модулях, якщо вони знаходяться в одному процесі інтерпретатора Python. " +"Це вірно для посилань на той самий об’єкт; крім того, код програми може " +"визначати та налаштовувати батьківський реєстратор в одному модулі та " +"створювати (але не налаштовувати) дочірній реєстратор в окремому модулі, і " +"всі виклики реєстратора до дочірнього модуля передадуться батьківському. Ось " +"головний модуль::" + +msgid "" +"import logging\n" +"import auxiliary_module\n" +"\n" +"# create logger with 'spam_application'\n" +"logger = logging.getLogger('spam_application')\n" +"logger.setLevel(logging.DEBUG)\n" +"# create file handler which logs even debug messages\n" +"fh = logging.FileHandler('spam.log')\n" +"fh.setLevel(logging.DEBUG)\n" +"# create console handler with a higher log level\n" +"ch = logging.StreamHandler()\n" +"ch.setLevel(logging.ERROR)\n" +"# create formatter and add it to the handlers\n" +"formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - " +"%(message)s')\n" +"fh.setFormatter(formatter)\n" +"ch.setFormatter(formatter)\n" +"# add the handlers to the logger\n" +"logger.addHandler(fh)\n" +"logger.addHandler(ch)\n" +"\n" +"logger.info('creating an instance of auxiliary_module.Auxiliary')\n" +"a = auxiliary_module.Auxiliary()\n" +"logger.info('created an instance of auxiliary_module.Auxiliary')\n" +"logger.info('calling auxiliary_module.Auxiliary.do_something')\n" +"a.do_something()\n" +"logger.info('finished auxiliary_module.Auxiliary.do_something')\n" +"logger.info('calling auxiliary_module.some_function()')\n" +"auxiliary_module.some_function()\n" +"logger.info('done with auxiliary_module.some_function()')" +msgstr "" + +msgid "Here is the auxiliary module::" +msgstr "Ось допоміжний модуль::" + +msgid "" +"import logging\n" +"\n" +"# create logger\n" +"module_logger = logging.getLogger('spam_application.auxiliary')\n" +"\n" +"class Auxiliary:\n" +" def __init__(self):\n" +" self.logger = logging.getLogger('spam_application.auxiliary." +"Auxiliary')\n" +" self.logger.info('creating an instance of Auxiliary')\n" +"\n" +" def do_something(self):\n" +" self.logger.info('doing something')\n" +" a = 1 + 1\n" +" self.logger.info('done doing something')\n" +"\n" +"def some_function():\n" +" module_logger.info('received a call to \"some_function\"')" +msgstr "" + +msgid "The output looks like this:" +msgstr "Результат виглядає так:" + +msgid "" +"2005-03-23 23:47:11,663 - spam_application - INFO -\n" +" creating an instance of auxiliary_module.Auxiliary\n" +"2005-03-23 23:47:11,665 - spam_application.auxiliary.Auxiliary - INFO -\n" +" creating an instance of Auxiliary\n" +"2005-03-23 23:47:11,665 - spam_application - INFO -\n" +" created an instance of auxiliary_module.Auxiliary\n" +"2005-03-23 23:47:11,668 - spam_application - INFO -\n" +" calling auxiliary_module.Auxiliary.do_something\n" +"2005-03-23 23:47:11,668 - spam_application.auxiliary.Auxiliary - INFO -\n" +" doing something\n" +"2005-03-23 23:47:11,669 - spam_application.auxiliary.Auxiliary - INFO -\n" +" done doing something\n" +"2005-03-23 23:47:11,670 - spam_application - INFO -\n" +" finished auxiliary_module.Auxiliary.do_something\n" +"2005-03-23 23:47:11,671 - spam_application - INFO -\n" +" calling auxiliary_module.some_function()\n" +"2005-03-23 23:47:11,672 - spam_application.auxiliary - INFO -\n" +" received a call to 'some_function'\n" +"2005-03-23 23:47:11,673 - spam_application - INFO -\n" +" done with auxiliary_module.some_function()" +msgstr "" + +msgid "Logging from multiple threads" +msgstr "Ведення журналу з кількох потоків" + +msgid "" +"Logging from multiple threads requires no special effort. The following " +"example shows logging from the main (initial) thread and another thread::" +msgstr "" +"Логування з кількох потоків не потребує особливих зусиль. У наступному " +"прикладі показано журналювання з основного (початкового) потоку та іншого " +"потоку::" + +msgid "" +"import logging\n" +"import threading\n" +"import time\n" +"\n" +"def worker(arg):\n" +" while not arg['stop']:\n" +" logging.debug('Hi from myfunc')\n" +" time.sleep(0.5)\n" +"\n" +"def main():\n" +" logging.basicConfig(level=logging.DEBUG, format='%(relativeCreated)6d " +"%(threadName)s %(message)s')\n" +" info = {'stop': False}\n" +" thread = threading.Thread(target=worker, args=(info,))\n" +" thread.start()\n" +" while True:\n" +" try:\n" +" logging.debug('Hello from main')\n" +" time.sleep(0.75)\n" +" except KeyboardInterrupt:\n" +" info['stop'] = True\n" +" break\n" +" thread.join()\n" +"\n" +"if __name__ == '__main__':\n" +" main()" +msgstr "" + +msgid "When run, the script should print something like the following:" +msgstr "Під час запуску сценарій має надрукувати щось на зразок такого:" + +msgid "" +" 0 Thread-1 Hi from myfunc\n" +" 3 MainThread Hello from main\n" +" 505 Thread-1 Hi from myfunc\n" +" 755 MainThread Hello from main\n" +"1007 Thread-1 Hi from myfunc\n" +"1507 MainThread Hello from main\n" +"1508 Thread-1 Hi from myfunc\n" +"2010 Thread-1 Hi from myfunc\n" +"2258 MainThread Hello from main\n" +"2512 Thread-1 Hi from myfunc\n" +"3009 MainThread Hello from main\n" +"3013 Thread-1 Hi from myfunc\n" +"3515 Thread-1 Hi from myfunc\n" +"3761 MainThread Hello from main\n" +"4017 Thread-1 Hi from myfunc\n" +"4513 MainThread Hello from main\n" +"4518 Thread-1 Hi from myfunc" +msgstr "" + +msgid "" +"This shows the logging output interspersed as one might expect. This " +"approach works for more threads than shown here, of course." +msgstr "" +"Це показує результати журналювання, як і можна було очікувати. Звичайно, цей " +"підхід працює для більшої кількості потоків, ніж показано тут." + +msgid "Multiple handlers and formatters" +msgstr "Кілька обробників і форматувальників" + +msgid "" +"Loggers are plain Python objects. The :meth:`~Logger.addHandler` method has " +"no minimum or maximum quota for the number of handlers you may add. " +"Sometimes it will be beneficial for an application to log all messages of " +"all severities to a text file while simultaneously logging errors or above " +"to the console. To set this up, simply configure the appropriate handlers. " +"The logging calls in the application code will remain unchanged. Here is a " +"slight modification to the previous simple module-based configuration " +"example::" +msgstr "" +"Логери — це звичайні об’єкти Python. Метод :meth:`~Logger.addHandler` не має " +"мінімальної або максимальної квоти на кількість обробників, які ви можете " +"додати. Іноді для програми буде корисно реєструвати всі повідомлення будь-" +"якого рівня серйозності в текстовий файл, одночасно реєструючи помилки або " +"вище на консолі. Щоб налаштувати це, просто налаштуйте відповідні обробники. " +"Виклики журналювання в коді програми залишаться незмінними. Ось невелика " +"модифікація попереднього простого прикладу конфігурації на основі модуля:" + +msgid "" +"import logging\n" +"\n" +"logger = logging.getLogger('simple_example')\n" +"logger.setLevel(logging.DEBUG)\n" +"# create file handler which logs even debug messages\n" +"fh = logging.FileHandler('spam.log')\n" +"fh.setLevel(logging.DEBUG)\n" +"# create console handler with a higher log level\n" +"ch = logging.StreamHandler()\n" +"ch.setLevel(logging.ERROR)\n" +"# create formatter and add it to the handlers\n" +"formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - " +"%(message)s')\n" +"ch.setFormatter(formatter)\n" +"fh.setFormatter(formatter)\n" +"# add the handlers to logger\n" +"logger.addHandler(ch)\n" +"logger.addHandler(fh)\n" +"\n" +"# 'application' code\n" +"logger.debug('debug message')\n" +"logger.info('info message')\n" +"logger.warning('warn message')\n" +"logger.error('error message')\n" +"logger.critical('critical message')" +msgstr "" + +msgid "" +"Notice that the 'application' code does not care about multiple handlers. " +"All that changed was the addition and configuration of a new handler named " +"*fh*." +msgstr "" +"Зауважте, що код програми не піклується про декілька обробників. Все, що " +"змінилося, це додавання та налаштування нового обробника під назвою *fh*." + +msgid "" +"The ability to create new handlers with higher- or lower-severity filters " +"can be very helpful when writing and testing an application. Instead of " +"using many ``print`` statements for debugging, use ``logger.debug``: Unlike " +"the print statements, which you will have to delete or comment out later, " +"the logger.debug statements can remain intact in the source code and remain " +"dormant until you need them again. At that time, the only change that needs " +"to happen is to modify the severity level of the logger and/or handler to " +"debug." +msgstr "" +"Можливість створювати нові обробники з фільтрами вищого або нижчого рівня " +"серйозності може бути дуже корисною під час написання та тестування " +"програми. Замість використання багатьох інструкцій ``print`` для " +"налагодження використовуйте ``logger.debug``: на відміну від інструкцій " +"print, які вам доведеться видалити або закоментувати пізніше, інструкції " +"logger.debug можуть залишатися недоторканими у вихідному коді. і залишаються " +"в стані спокою, доки вони вам знову не знадобляться. У той час єдина зміна, " +"яка має відбутися, це змінити рівень серйозності реєстратора та/або " +"обробника для налагодження." + +msgid "Logging to multiple destinations" +msgstr "Реєстрація в кількох пунктах призначення" + +msgid "" +"Let's say you want to log to console and file with different message formats " +"and in differing circumstances. Say you want to log messages with levels of " +"DEBUG and higher to file, and those messages at level INFO and higher to the " +"console. Let's also assume that the file should contain timestamps, but the " +"console messages should not. Here's how you can achieve this::" +msgstr "" +"Припустімо, ви хочете увійти в консоль і файл із різними форматами " +"повідомлень і за різних обставин. Скажімо, ви хочете реєструвати " +"повідомлення з рівнями DEBUG і вище у файл, а ці повідомлення рівня INFO і " +"вище — на консоль. Давайте також припустимо, що файл повинен містити мітки " +"часу, але повідомлення консолі не повинні. Ось як ви можете цього досягти:" + +msgid "" +"import logging\n" +"\n" +"# set up logging to file - see previous section for more details\n" +"logging.basicConfig(level=logging.DEBUG,\n" +" format='%(asctime)s %(name)-12s %(levelname)-8s " +"%(message)s',\n" +" datefmt='%m-%d %H:%M',\n" +" filename='/tmp/myapp.log',\n" +" filemode='w')\n" +"# define a Handler which writes INFO messages or higher to the sys.stderr\n" +"console = logging.StreamHandler()\n" +"console.setLevel(logging.INFO)\n" +"# set a format which is simpler for console use\n" +"formatter = logging.Formatter('%(name)-12s: %(levelname)-8s %(message)s')\n" +"# tell the handler to use this format\n" +"console.setFormatter(formatter)\n" +"# add the handler to the root logger\n" +"logging.getLogger('').addHandler(console)\n" +"\n" +"# Now, we can log to the root logger, or any other logger. First the " +"root...\n" +"logging.info('Jackdaws love my big sphinx of quartz.')\n" +"\n" +"# Now, define a couple of other loggers which might represent areas in your\n" +"# application:\n" +"\n" +"logger1 = logging.getLogger('myapp.area1')\n" +"logger2 = logging.getLogger('myapp.area2')\n" +"\n" +"logger1.debug('Quick zephyrs blow, vexing daft Jim.')\n" +"logger1.info('How quickly daft jumping zebras vex.')\n" +"logger2.warning('Jail zesty vixen who grabbed pay from quack.')\n" +"logger2.error('The five boxing wizards jump quickly.')" +msgstr "" + +msgid "When you run this, on the console you will see" +msgstr "Коли ви запустите це, на консолі ви побачите" + +msgid "" +"root : INFO Jackdaws love my big sphinx of quartz.\n" +"myapp.area1 : INFO How quickly daft jumping zebras vex.\n" +"myapp.area2 : WARNING Jail zesty vixen who grabbed pay from quack.\n" +"myapp.area2 : ERROR The five boxing wizards jump quickly." +msgstr "" + +msgid "and in the file you will see something like" +msgstr "і у файлі ви побачите щось на зразок" + +msgid "" +"10-22 22:19 root INFO Jackdaws love my big sphinx of quartz.\n" +"10-22 22:19 myapp.area1 DEBUG Quick zephyrs blow, vexing daft Jim.\n" +"10-22 22:19 myapp.area1 INFO How quickly daft jumping zebras vex.\n" +"10-22 22:19 myapp.area2 WARNING Jail zesty vixen who grabbed pay from " +"quack.\n" +"10-22 22:19 myapp.area2 ERROR The five boxing wizards jump quickly." +msgstr "" + +msgid "" +"As you can see, the DEBUG message only shows up in the file. The other " +"messages are sent to both destinations." +msgstr "" +"Як бачите, повідомлення DEBUG відображається лише у файлі. Інші повідомлення " +"надсилаються в обидва адресати." + +msgid "" +"This example uses console and file handlers, but you can use any number and " +"combination of handlers you choose." +msgstr "" +"У цьому прикладі використовуються обробники консолі та файлів, але ви можете " +"використовувати будь-яку кількість і комбінацію обробників на свій вибір." + +msgid "" +"Note that the above choice of log filename ``/tmp/myapp.log`` implies use of " +"a standard location for temporary files on POSIX systems. On Windows, you " +"may need to choose a different directory name for the log - just ensure that " +"the directory exists and that you have the permissions to create and update " +"files in it." +msgstr "" + +msgid "Custom handling of levels" +msgstr "" + +msgid "" +"Sometimes, you might want to do something slightly different from the " +"standard handling of levels in handlers, where all levels above a threshold " +"get processed by a handler. To do this, you need to use filters. Let's look " +"at a scenario where you want to arrange things as follows:" +msgstr "" + +msgid "Send messages of severity ``INFO`` and ``WARNING`` to ``sys.stdout``" +msgstr "" + +msgid "Send messages of severity ``ERROR`` and above to ``sys.stderr``" +msgstr "" + +msgid "Send messages of severity ``DEBUG`` and above to file ``app.log``" +msgstr "" + +msgid "Suppose you configure logging with the following JSON:" +msgstr "" + +msgid "" +"{\n" +" \"version\": 1,\n" +" \"disable_existing_loggers\": false,\n" +" \"formatters\": {\n" +" \"simple\": {\n" +" \"format\": \"%(levelname)-8s - %(message)s\"\n" +" }\n" +" },\n" +" \"handlers\": {\n" +" \"stdout\": {\n" +" \"class\": \"logging.StreamHandler\",\n" +" \"level\": \"INFO\",\n" +" \"formatter\": \"simple\",\n" +" \"stream\": \"ext://sys.stdout\"\n" +" },\n" +" \"stderr\": {\n" +" \"class\": \"logging.StreamHandler\",\n" +" \"level\": \"ERROR\",\n" +" \"formatter\": \"simple\",\n" +" \"stream\": \"ext://sys.stderr\"\n" +" },\n" +" \"file\": {\n" +" \"class\": \"logging.FileHandler\",\n" +" \"formatter\": \"simple\",\n" +" \"filename\": \"app.log\",\n" +" \"mode\": \"w\"\n" +" }\n" +" },\n" +" \"root\": {\n" +" \"level\": \"DEBUG\",\n" +" \"handlers\": [\n" +" \"stderr\",\n" +" \"stdout\",\n" +" \"file\"\n" +" ]\n" +" }\n" +"}" +msgstr "" + +msgid "" +"This configuration does *almost* what we want, except that ``sys.stdout`` " +"would show messages of severity ``ERROR`` and only events of this severity " +"and higher will be tracked as well as ``INFO`` and ``WARNING`` messages. To " +"prevent this, we can set up a filter which excludes those messages and add " +"it to the relevant handler. This can be configured by adding a ``filters`` " +"section parallel to ``formatters`` and ``handlers``:" +msgstr "" + +msgid "" +"{\n" +" \"filters\": {\n" +" \"warnings_and_below\": {\n" +" \"()\" : \"__main__.filter_maker\",\n" +" \"level\": \"WARNING\"\n" +" }\n" +" }\n" +"}" +msgstr "" + +msgid "and changing the section on the ``stdout`` handler to add it:" +msgstr "" + +msgid "" +"{\n" +" \"stdout\": {\n" +" \"class\": \"logging.StreamHandler\",\n" +" \"level\": \"INFO\",\n" +" \"formatter\": \"simple\",\n" +" \"stream\": \"ext://sys.stdout\",\n" +" \"filters\": [\"warnings_and_below\"]\n" +" }\n" +"}" +msgstr "" + +msgid "" +"A filter is just a function, so we can define the ``filter_maker`` (a " +"factory function) as follows:" +msgstr "" + +msgid "" +"def filter_maker(level):\n" +" level = getattr(logging, level)\n" +"\n" +" def filter(record):\n" +" return record.levelno <= level\n" +"\n" +" return filter" +msgstr "" + +msgid "" +"This converts the string argument passed in to a numeric level, and returns " +"a function which only returns ``True`` if the level of the passed in record " +"is at or below the specified level. Note that in this example I have defined " +"the ``filter_maker`` in a test script ``main.py`` that I run from the " +"command line, so its module will be ``__main__`` - hence the ``__main__." +"filter_maker`` in the filter configuration. You will need to change that if " +"you define it in a different module." +msgstr "" + +msgid "With the filter added, we can run ``main.py``, which in full is:" +msgstr "" + +msgid "" +"import json\n" +"import logging\n" +"import logging.config\n" +"\n" +"CONFIG = '''\n" +"{\n" +" \"version\": 1,\n" +" \"disable_existing_loggers\": false,\n" +" \"formatters\": {\n" +" \"simple\": {\n" +" \"format\": \"%(levelname)-8s - %(message)s\"\n" +" }\n" +" },\n" +" \"filters\": {\n" +" \"warnings_and_below\": {\n" +" \"()\" : \"__main__.filter_maker\",\n" +" \"level\": \"WARNING\"\n" +" }\n" +" },\n" +" \"handlers\": {\n" +" \"stdout\": {\n" +" \"class\": \"logging.StreamHandler\",\n" +" \"level\": \"INFO\",\n" +" \"formatter\": \"simple\",\n" +" \"stream\": \"ext://sys.stdout\",\n" +" \"filters\": [\"warnings_and_below\"]\n" +" },\n" +" \"stderr\": {\n" +" \"class\": \"logging.StreamHandler\",\n" +" \"level\": \"ERROR\",\n" +" \"formatter\": \"simple\",\n" +" \"stream\": \"ext://sys.stderr\"\n" +" },\n" +" \"file\": {\n" +" \"class\": \"logging.FileHandler\",\n" +" \"formatter\": \"simple\",\n" +" \"filename\": \"app.log\",\n" +" \"mode\": \"w\"\n" +" }\n" +" },\n" +" \"root\": {\n" +" \"level\": \"DEBUG\",\n" +" \"handlers\": [\n" +" \"stderr\",\n" +" \"stdout\",\n" +" \"file\"\n" +" ]\n" +" }\n" +"}\n" +"'''\n" +"\n" +"def filter_maker(level):\n" +" level = getattr(logging, level)\n" +"\n" +" def filter(record):\n" +" return record.levelno <= level\n" +"\n" +" return filter\n" +"\n" +"logging.config.dictConfig(json.loads(CONFIG))\n" +"logging.debug('A DEBUG message')\n" +"logging.info('An INFO message')\n" +"logging.warning('A WARNING message')\n" +"logging.error('An ERROR message')\n" +"logging.critical('A CRITICAL message')" +msgstr "" + +msgid "And after running it like this:" +msgstr "" + +msgid "python main.py 2>stderr.log >stdout.log" +msgstr "" + +msgid "We can see the results are as expected:" +msgstr "" + +msgid "" +"$ more *.log\n" +"::::::::::::::\n" +"app.log\n" +"::::::::::::::\n" +"DEBUG - A DEBUG message\n" +"INFO - An INFO message\n" +"WARNING - A WARNING message\n" +"ERROR - An ERROR message\n" +"CRITICAL - A CRITICAL message\n" +"::::::::::::::\n" +"stderr.log\n" +"::::::::::::::\n" +"ERROR - An ERROR message\n" +"CRITICAL - A CRITICAL message\n" +"::::::::::::::\n" +"stdout.log\n" +"::::::::::::::\n" +"INFO - An INFO message\n" +"WARNING - A WARNING message" +msgstr "" + +msgid "Configuration server example" +msgstr "Приклад конфігурації сервера" + +msgid "Here is an example of a module using the logging configuration server::" +msgstr "Ось приклад модуля, який використовує сервер конфігурації журналу:" + +msgid "" +"import logging\n" +"import logging.config\n" +"import time\n" +"import os\n" +"\n" +"# read initial config file\n" +"logging.config.fileConfig('logging.conf')\n" +"\n" +"# create and start listener on port 9999\n" +"t = logging.config.listen(9999)\n" +"t.start()\n" +"\n" +"logger = logging.getLogger('simpleExample')\n" +"\n" +"try:\n" +" # loop through logging calls to see the difference\n" +" # new configurations make, until Ctrl+C is pressed\n" +" while True:\n" +" logger.debug('debug message')\n" +" logger.info('info message')\n" +" logger.warning('warn message')\n" +" logger.error('error message')\n" +" logger.critical('critical message')\n" +" time.sleep(5)\n" +"except KeyboardInterrupt:\n" +" # cleanup\n" +" logging.config.stopListening()\n" +" t.join()" +msgstr "" + +msgid "" +"And here is a script that takes a filename and sends that file to the " +"server, properly preceded with the binary-encoded length, as the new logging " +"configuration::" +msgstr "" +"А ось сценарій, який приймає ім’я файлу та надсилає цей файл на сервер, " +"належним чином передуючи довжиною у двійковому кодуванні, як нову " +"конфігурацію журналювання::" + +msgid "" +"#!/usr/bin/env python\n" +"import socket, sys, struct\n" +"\n" +"with open(sys.argv[1], 'rb') as f:\n" +" data_to_send = f.read()\n" +"\n" +"HOST = 'localhost'\n" +"PORT = 9999\n" +"s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n" +"print('connecting...')\n" +"s.connect((HOST, PORT))\n" +"print('sending config...')\n" +"s.send(struct.pack('>L', len(data_to_send)))\n" +"s.send(data_to_send)\n" +"s.close()\n" +"print('complete')" +msgstr "" + +msgid "Dealing with handlers that block" +msgstr "Робота з обробниками, які блокують" + +msgid "" +"Sometimes you have to get your logging handlers to do their work without " +"blocking the thread you're logging from. This is common in web applications, " +"though of course it also occurs in other scenarios." +msgstr "" +"Іноді вам потрібно змусити обробників журналу виконувати свою роботу, не " +"блокуючи потік, з якого ви входите. Це поширене явище у веб-додатках, хоча, " +"звичайно, трапляється й в інших сценаріях." + +msgid "" +"A common culprit which demonstrates sluggish behaviour is the :class:" +"`SMTPHandler`: sending emails can take a long time, for a number of reasons " +"outside the developer's control (for example, a poorly performing mail or " +"network infrastructure). But almost any network-based handler can block: " +"Even a :class:`SocketHandler` operation may do a DNS query under the hood " +"which is too slow (and this query can be deep in the socket library code, " +"below the Python layer, and outside your control)." +msgstr "" +"Поширеним винуватцем млявої поведінки є :class:`SMTPHandler`: надсилання " +"електронних листів може тривати багато часу через ряд причин, які не " +"залежать від розробника (наприклад, погана робота пошти чи мережевої " +"інфраструктури). Але майже будь-який мережевий обробник може заблокувати: " +"навіть операція :class:`SocketHandler` може виконати DNS-запит під капотом, " +"який надто повільний (і цей запит може бути глибоко в коді бібліотеки " +"сокетів, нижче рівня Python, і поза вашим контролем)." + +msgid "" +"One solution is to use a two-part approach. For the first part, attach only " +"a :class:`QueueHandler` to those loggers which are accessed from performance-" +"critical threads. They simply write to their queue, which can be sized to a " +"large enough capacity or initialized with no upper bound to their size. The " +"write to the queue will typically be accepted quickly, though you will " +"probably need to catch the :exc:`queue.Full` exception as a precaution in " +"your code. If you are a library developer who has performance-critical " +"threads in their code, be sure to document this (together with a suggestion " +"to attach only ``QueueHandlers`` to your loggers) for the benefit of other " +"developers who will use your code." +msgstr "" +"Одним із рішень є використання підходу з двох частин. Для першої частини " +"додайте лише :class:`QueueHandler` до тих реєстраторів, доступ до яких " +"здійснюється з критичних для продуктивності потоків. Вони просто записують у " +"свою чергу, розмір якої може бути достатньо великим або ініціалізований без " +"верхньої межі їхнього розміру. Запис до черги, як правило, швидко " +"приймається, хоча вам, ймовірно, потрібно буде перехопити виняток :exc:" +"`queue.Full` як запобіжний захід у вашому коді. Якщо ви розробник " +"бібліотеки, у коді якого є критично важливі для продуктивності потоки, " +"обов’язково задокументуйте це (разом із пропозицією приєднати лише " +"``QueueHandlers`` до ваших реєстраторів) на користь інших розробників, які " +"використовуватимуть ваш код." + +msgid "" +"The second part of the solution is :class:`QueueListener`, which has been " +"designed as the counterpart to :class:`QueueHandler`. A :class:" +"`QueueListener` is very simple: it's passed a queue and some handlers, and " +"it fires up an internal thread which listens to its queue for LogRecords " +"sent from ``QueueHandlers`` (or any other source of ``LogRecords``, for that " +"matter). The ``LogRecords`` are removed from the queue and passed to the " +"handlers for processing." +msgstr "" +"Другою частиною рішення є :class:`QueueListener`, який був розроблений як " +"відповідник :class:`QueueHandler`. :class:`QueueListener` дуже простий: він " +"передає чергу та деякі обробники, і запускає внутрішній потік, який " +"прослуховує свою чергу для LogRecords, надісланих з ``QueueHandlers`` (або " +"будь-якого іншого джерела ``LogRecords``, як на те пішло). ``LogRecords`` " +"видаляються з черги та передаються обробникам для обробки." + +msgid "" +"The advantage of having a separate :class:`QueueListener` class is that you " +"can use the same instance to service multiple ``QueueHandlers``. This is " +"more resource-friendly than, say, having threaded versions of the existing " +"handler classes, which would eat up one thread per handler for no particular " +"benefit." +msgstr "" +"Перевага наявності окремого класу :class:`QueueListener` полягає в тому, що " +"ви можете використовувати один екземпляр для обслуговування кількох " +"``QueueHandler``. Це більш дружньо до ресурсів, ніж, скажімо, мати " +"багатопотокові версії існуючих класів обробників, які з’їдають один потік на " +"обробник без особливої користі." + +msgid "An example of using these two classes follows (imports omitted)::" +msgstr "Нижче наведено приклад використання цих двох класів (імпорт опущено):" + +msgid "" +"que = queue.Queue(-1) # no limit on size\n" +"queue_handler = QueueHandler(que)\n" +"handler = logging.StreamHandler()\n" +"listener = QueueListener(que, handler)\n" +"root = logging.getLogger()\n" +"root.addHandler(queue_handler)\n" +"formatter = logging.Formatter('%(threadName)s: %(message)s')\n" +"handler.setFormatter(formatter)\n" +"listener.start()\n" +"# The log output will display the thread which generated\n" +"# the event (the main thread) rather than the internal\n" +"# thread which monitors the internal queue. This is what\n" +"# you want to happen.\n" +"root.warning('Look out!')\n" +"listener.stop()" +msgstr "" + +msgid "which, when run, will produce:" +msgstr "який під час запуску вироблятиме:" + +msgid "MainThread: Look out!" +msgstr "" + +msgid "" +"Although the earlier discussion wasn't specifically talking about async " +"code, but rather about slow logging handlers, it should be noted that when " +"logging from async code, network and even file handlers could lead to " +"problems (blocking the event loop) because some logging is done from :mod:" +"`asyncio` internals. It might be best, if any async code is used in an " +"application, to use the above approach for logging, so that any blocking " +"code runs only in the ``QueueListener`` thread." +msgstr "" + +msgid "" +"Prior to Python 3.5, the :class:`QueueListener` always passed every message " +"received from the queue to every handler it was initialized with. (This was " +"because it was assumed that level filtering was all done on the other side, " +"where the queue is filled.) From 3.5 onwards, this behaviour can be changed " +"by passing a keyword argument ``respect_handler_level=True`` to the " +"listener's constructor. When this is done, the listener compares the level " +"of each message with the handler's level, and only passes a message to a " +"handler if it's appropriate to do so." +msgstr "" +"До Python 3.5 :class:`QueueListener` завжди передавав кожне повідомлення, " +"отримане з черги, кожному обробнику, яким він був ініціалізований. (Це " +"сталося тому, що передбачалося, що фільтрація рівня виконується з іншого " +"боку, де заповнюється черга.) Починаючи з версії 3.5 і далі цю поведінку " +"можна змінити, передавши аргумент ключового слова " +"``respect_handler_level=True`` конструктору слухача . Коли це зроблено, " +"слухач порівнює рівень кожного повідомлення з рівнем обробника та передає " +"повідомлення обробнику, лише якщо це доречно." + +msgid "Sending and receiving logging events across a network" +msgstr "Надсилання та отримання журнальних подій через мережу" + +msgid "" +"Let's say you want to send logging events across a network, and handle them " +"at the receiving end. A simple way of doing this is attaching a :class:" +"`SocketHandler` instance to the root logger at the sending end::" +msgstr "" +"Припустімо, ви хочете надіслати події журналювання через мережу та обробити " +"їх на приймаючому кінці. Простий спосіб зробити це — приєднати екземпляр :" +"class:`SocketHandler` до кореневого реєстратора на стороні надсилання::" + +msgid "" +"import logging, logging.handlers\n" +"\n" +"rootLogger = logging.getLogger('')\n" +"rootLogger.setLevel(logging.DEBUG)\n" +"socketHandler = logging.handlers.SocketHandler('localhost',\n" +" logging.handlers.DEFAULT_TCP_LOGGING_PORT)\n" +"# don't bother with a formatter, since a socket handler sends the event as\n" +"# an unformatted pickle\n" +"rootLogger.addHandler(socketHandler)\n" +"\n" +"# Now, we can log to the root logger, or any other logger. First the " +"root...\n" +"logging.info('Jackdaws love my big sphinx of quartz.')\n" +"\n" +"# Now, define a couple of other loggers which might represent areas in your\n" +"# application:\n" +"\n" +"logger1 = logging.getLogger('myapp.area1')\n" +"logger2 = logging.getLogger('myapp.area2')\n" +"\n" +"logger1.debug('Quick zephyrs blow, vexing daft Jim.')\n" +"logger1.info('How quickly daft jumping zebras vex.')\n" +"logger2.warning('Jail zesty vixen who grabbed pay from quack.')\n" +"logger2.error('The five boxing wizards jump quickly.')" +msgstr "" + +msgid "" +"At the receiving end, you can set up a receiver using the :mod:" +"`socketserver` module. Here is a basic working example::" +msgstr "" +"На стороні приймача ви можете налаштувати приймача за допомогою модуля :mod:" +"`socketserver`. Ось базовий робочий приклад:" + +msgid "" +"import pickle\n" +"import logging\n" +"import logging.handlers\n" +"import socketserver\n" +"import struct\n" +"\n" +"\n" +"class LogRecordStreamHandler(socketserver.StreamRequestHandler):\n" +" \"\"\"Handler for a streaming logging request.\n" +"\n" +" This basically logs the record using whatever logging policy is\n" +" configured locally.\n" +" \"\"\"\n" +"\n" +" def handle(self):\n" +" \"\"\"\n" +" Handle multiple requests - each expected to be a 4-byte length,\n" +" followed by the LogRecord in pickle format. Logs the record\n" +" according to whatever policy is configured locally.\n" +" \"\"\"\n" +" while True:\n" +" chunk = self.connection.recv(4)\n" +" if len(chunk) < 4:\n" +" break\n" +" slen = struct.unpack('>L', chunk)[0]\n" +" chunk = self.connection.recv(slen)\n" +" while len(chunk) < slen:\n" +" chunk = chunk + self.connection.recv(slen - len(chunk))\n" +" obj = self.unPickle(chunk)\n" +" record = logging.makeLogRecord(obj)\n" +" self.handleLogRecord(record)\n" +"\n" +" def unPickle(self, data):\n" +" return pickle.loads(data)\n" +"\n" +" def handleLogRecord(self, record):\n" +" # if a name is specified, we use the named logger rather than the " +"one\n" +" # implied by the record.\n" +" if self.server.logname is not None:\n" +" name = self.server.logname\n" +" else:\n" +" name = record.name\n" +" logger = logging.getLogger(name)\n" +" # N.B. EVERY record gets logged. This is because Logger.handle\n" +" # is normally called AFTER logger-level filtering. If you want\n" +" # to do filtering, do it at the client end to save wasting\n" +" # cycles and network bandwidth!\n" +" logger.handle(record)\n" +"\n" +"class LogRecordSocketReceiver(socketserver.ThreadingTCPServer):\n" +" \"\"\"\n" +" Simple TCP socket-based logging receiver suitable for testing.\n" +" \"\"\"\n" +"\n" +" allow_reuse_address = True\n" +"\n" +" def __init__(self, host='localhost',\n" +" port=logging.handlers.DEFAULT_TCP_LOGGING_PORT,\n" +" handler=LogRecordStreamHandler):\n" +" socketserver.ThreadingTCPServer.__init__(self, (host, port), " +"handler)\n" +" self.abort = 0\n" +" self.timeout = 1\n" +" self.logname = None\n" +"\n" +" def serve_until_stopped(self):\n" +" import select\n" +" abort = 0\n" +" while not abort:\n" +" rd, wr, ex = select.select([self.socket.fileno()],\n" +" [], [],\n" +" self.timeout)\n" +" if rd:\n" +" self.handle_request()\n" +" abort = self.abort\n" +"\n" +"def main():\n" +" logging.basicConfig(\n" +" format='%(relativeCreated)5d %(name)-15s %(levelname)-8s " +"%(message)s')\n" +" tcpserver = LogRecordSocketReceiver()\n" +" print('About to start TCP server...')\n" +" tcpserver.serve_until_stopped()\n" +"\n" +"if __name__ == '__main__':\n" +" main()" +msgstr "" + +msgid "" +"First run the server, and then the client. On the client side, nothing is " +"printed on the console; on the server side, you should see something like:" +msgstr "" +"Спочатку запустіть сервер, а потім клієнт. На стороні клієнта на консолі " +"нічого не друкується; на стороні сервера ви повинні побачити щось на кшталт:" + +msgid "" +"About to start TCP server...\n" +" 59 root INFO Jackdaws love my big sphinx of quartz.\n" +" 59 myapp.area1 DEBUG Quick zephyrs blow, vexing daft Jim.\n" +" 69 myapp.area1 INFO How quickly daft jumping zebras vex.\n" +" 69 myapp.area2 WARNING Jail zesty vixen who grabbed pay from quack.\n" +" 69 myapp.area2 ERROR The five boxing wizards jump quickly." +msgstr "" + +msgid "" +"Note that there are some security issues with pickle in some scenarios. If " +"these affect you, you can use an alternative serialization scheme by " +"overriding the :meth:`~SocketHandler.makePickle` method and implementing " +"your alternative there, as well as adapting the above script to use your " +"alternative serialization." +msgstr "" + +msgid "Running a logging socket listener in production" +msgstr "Запуск прослуховувача сокетів журналювання у виробництві" + +msgid "" +"To run a logging listener in production, you may need to use a process-" +"management tool such as `Supervisor `_. `Here is a " +"Gist `__ which provides the bare-bones files to run " +"the above functionality using Supervisor. It consists of the following files:" +msgstr "" + +msgid "File" +msgstr "" + +msgid "Purpose" +msgstr "призначення" + +msgid ":file:`prepare.sh`" +msgstr "" + +msgid "A Bash script to prepare the environment for testing" +msgstr "" + +msgid ":file:`supervisor.conf`" +msgstr "" + +msgid "" +"The Supervisor configuration file, which has entries for the listener and a " +"multi-process web application" +msgstr "" + +msgid ":file:`ensure_app.sh`" +msgstr "" + +msgid "" +"A Bash script to ensure that Supervisor is running with the above " +"configuration" +msgstr "" + +msgid ":file:`log_listener.py`" +msgstr "" + +msgid "" +"The socket listener program which receives log events and records them to a " +"file" +msgstr "" + +msgid ":file:`main.py`" +msgstr "" + +msgid "" +"A simple web application which performs logging via a socket connected to " +"the listener" +msgstr "" + +msgid ":file:`webapp.json`" +msgstr "" + +msgid "A JSON configuration file for the web application" +msgstr "" + +msgid ":file:`client.py`" +msgstr "" + +msgid "A Python script to exercise the web application" +msgstr "" + +msgid "" +"The web application uses `Gunicorn `_, which is a " +"popular web application server that starts multiple worker processes to " +"handle requests. This example setup shows how the workers can write to the " +"same log file without conflicting with one another --- they all go through " +"the socket listener." +msgstr "" + +msgid "To test these files, do the following in a POSIX environment:" +msgstr "" + +msgid "" +"Download `the Gist `__ as a ZIP archive using the :" +"guilabel:`Download ZIP` button." +msgstr "" + +msgid "Unzip the above files from the archive into a scratch directory." +msgstr "" + +msgid "" +"In the scratch directory, run ``bash prepare.sh`` to get things ready. This " +"creates a :file:`run` subdirectory to contain Supervisor-related and log " +"files, and a :file:`venv` subdirectory to contain a virtual environment into " +"which ``bottle``, ``gunicorn`` and ``supervisor`` are installed." +msgstr "" + +msgid "" +"Run ``bash ensure_app.sh`` to ensure that Supervisor is running with the " +"above configuration." +msgstr "" + +msgid "" +"Run ``venv/bin/python client.py`` to exercise the web application, which " +"will lead to records being written to the log." +msgstr "" + +msgid "" +"Inspect the log files in the :file:`run` subdirectory. You should see the " +"most recent log lines in files matching the pattern :file:`app.log*`. They " +"won't be in any particular order, since they have been handled concurrently " +"by different worker processes in a non-deterministic way." +msgstr "" + +msgid "" +"You can shut down the listener and the web application by running ``venv/bin/" +"supervisorctl -c supervisor.conf shutdown``." +msgstr "" + +msgid "" +"You may need to tweak the configuration files in the unlikely event that the " +"configured ports clash with something else in your test environment." +msgstr "" + +msgid "" +"The default configuration uses a TCP socket on port 9020. You can use a Unix " +"Domain socket instead of a TCP socket by doing the following:" +msgstr "" + +msgid "" +"In :file:`listener.json`, add a ``socket`` key with the path to the domain " +"socket you want to use. If this key is present, the listener listens on the " +"corresponding domain socket and not on a TCP socket (the ``port`` key is " +"ignored)." +msgstr "" + +msgid "" +"In :file:`webapp.json`, change the socket handler configuration dictionary " +"so that the ``host`` value is the path to the domain socket, and set the " +"``port`` value to ``null``." +msgstr "" + +msgid "Adding contextual information to your logging output" +msgstr "Додавання контекстної інформації до вихідних даних журналу" + +msgid "" +"Sometimes you want logging output to contain contextual information in " +"addition to the parameters passed to the logging call. For example, in a " +"networked application, it may be desirable to log client-specific " +"information in the log (e.g. remote client's username, or IP address). " +"Although you could use the *extra* parameter to achieve this, it's not " +"always convenient to pass the information in this way. While it might be " +"tempting to create :class:`Logger` instances on a per-connection basis, this " +"is not a good idea because these instances are not garbage collected. While " +"this is not a problem in practice, when the number of :class:`Logger` " +"instances is dependent on the level of granularity you want to use in " +"logging an application, it could be hard to manage if the number of :class:" +"`Logger` instances becomes effectively unbounded." +msgstr "" +"Іноді потрібно, щоб вихід журналу містив контекстну інформацію на додаток до " +"параметрів, переданих до виклику журналу. Наприклад, у мережевій програмі " +"може бути бажаним реєструвати інформацію про клієнта в журналі (наприклад, " +"ім’я користувача віддаленого клієнта або IP-адресу). Хоча для цього можна " +"використовувати параметр *extra*, не завжди зручно передавати інформацію " +"таким чином. Хоча може виникнути спокуса створити екземпляри :class:`Logger` " +"для кожного з’єднання, це не дуже гарна ідея, оскільки ці екземпляри не " +"збираються для сміття. Хоча це не є проблемою на практиці, коли кількість " +"екземплярів :class:`Logger` залежить від рівня деталізації, який ви хочете " +"використовувати для реєстрації програми, може бути важко керувати кількістю :" +"class:`Екземпляри Logger` стають фактично необмеженими." + +msgid "Using LoggerAdapters to impart contextual information" +msgstr "Використання LoggerAdapters для передачі контекстної інформації" + +msgid "" +"An easy way in which you can pass contextual information to be output along " +"with logging event information is to use the :class:`LoggerAdapter` class. " +"This class is designed to look like a :class:`Logger`, so that you can call :" +"meth:`debug`, :meth:`info`, :meth:`warning`, :meth:`error`, :meth:" +"`exception`, :meth:`critical` and :meth:`log`. These methods have the same " +"signatures as their counterparts in :class:`Logger`, so you can use the two " +"types of instances interchangeably." +msgstr "" +"Простий спосіб, за допомогою якого ви можете передати контекстну інформацію " +"для виведення разом із інформацією про подію журналювання, полягає у " +"використанні класу :class:`LoggerAdapter`. Цей клас розроблено так, щоб " +"виглядати як :class:`Logger`, щоб ви могли викликати :meth:`debug`, :meth:" +"`info`, :meth:`warning`, :meth:`error`, :meth:`exception`, :meth:`critical` " +"і :meth:`log`. Ці методи мають ті самі сигнатури, що й їхні аналоги в :class:" +"`Logger`, тому ви можете використовувати обидва типи екземплярів як " +"взаємозамінні." + +msgid "" +"When you create an instance of :class:`LoggerAdapter`, you pass it a :class:" +"`Logger` instance and a dict-like object which contains your contextual " +"information. When you call one of the logging methods on an instance of :" +"class:`LoggerAdapter`, it delegates the call to the underlying instance of :" +"class:`Logger` passed to its constructor, and arranges to pass the " +"contextual information in the delegated call. Here's a snippet from the code " +"of :class:`LoggerAdapter`::" +msgstr "" +"Коли ви створюєте екземпляр :class:`LoggerAdapter`, ви передаєте йому " +"екземпляр :class:`Logger` і dict-подібний об’єкт, який містить вашу " +"контекстну інформацію. Коли ви викликаєте один із методів журналювання в " +"екземплярі :class:`LoggerAdapter`, він делегує виклик базовому екземпляру :" +"class:`Logger`, який передається його конструктору, і організовує передачу " +"контекстної інформації в делегованому виклику . Ось фрагмент коду :class:" +"`LoggerAdapter`::" + +msgid "" +"def debug(self, msg, /, *args, **kwargs):\n" +" \"\"\"\n" +" Delegate a debug call to the underlying logger, after adding\n" +" contextual information from this adapter instance.\n" +" \"\"\"\n" +" msg, kwargs = self.process(msg, kwargs)\n" +" self.logger.debug(msg, *args, **kwargs)" +msgstr "" + +msgid "" +"The :meth:`~LoggerAdapter.process` method of :class:`LoggerAdapter` is where " +"the contextual information is added to the logging output. It's passed the " +"message and keyword arguments of the logging call, and it passes back " +"(potentially) modified versions of these to use in the call to the " +"underlying logger. The default implementation of this method leaves the " +"message alone, but inserts an 'extra' key in the keyword argument whose " +"value is the dict-like object passed to the constructor. Of course, if you " +"had passed an 'extra' keyword argument in the call to the adapter, it will " +"be silently overwritten." +msgstr "" +"У методі :meth:`~LoggerAdapter.process` :class:`LoggerAdapter` контекстна " +"інформація додається до результатів журналювання. Він передає аргументи " +"повідомлення та ключове слово виклику журналювання, а також повертає " +"(потенційно) модифіковані версії їх для використання у виклику базовому " +"реєстратору. Реалізація цього методу за замовчуванням залишає повідомлення в " +"спокої, але вставляє \"додатковий\" ключ в аргумент ключового слова, " +"значенням якого є dict-подібний об’єкт, переданий конструктору. Звичайно, " +"якщо ви передали \"додатковий\" аргумент ключового слова під час виклику " +"адаптера, він буде мовчки перезаписаний." + +msgid "" +"The advantage of using 'extra' is that the values in the dict-like object " +"are merged into the :class:`LogRecord` instance's __dict__, allowing you to " +"use customized strings with your :class:`Formatter` instances which know " +"about the keys of the dict-like object. If you need a different method, e.g. " +"if you want to prepend or append the contextual information to the message " +"string, you just need to subclass :class:`LoggerAdapter` and override :meth:" +"`~LoggerAdapter.process` to do what you need. Here is a simple example::" +msgstr "" +"Перевага використання \"extra\" полягає в тому, що значення в dict-подібному " +"об’єкті об’єднуються в __dict__ екземпляра :class:`LogRecord`, що дозволяє " +"вам використовувати налаштовані рядки з вашими екземплярами :class:" +"`Formatter`, які знають про ключі диктоподібного об’єкта. Якщо вам потрібен " +"інший метод, напр. якщо ви хочете передати або додати контекстну інформацію " +"до рядка повідомлення, вам просто потрібно створити підклас :class:" +"`LoggerAdapter` і перевизначити :meth:`~LoggerAdapter.process`, щоб зробити " +"те, що вам потрібно. Ось простий приклад::" + +msgid "" +"class CustomAdapter(logging.LoggerAdapter):\n" +" \"\"\"\n" +" This example adapter expects the passed in dict-like object to have a\n" +" 'connid' key, whose value in brackets is prepended to the log message.\n" +" \"\"\"\n" +" def process(self, msg, kwargs):\n" +" return '[%s] %s' % (self.extra['connid'], msg), kwargs" +msgstr "" + +msgid "which you can use like this::" +msgstr "який можна використовувати таким чином::" + +msgid "" +"logger = logging.getLogger(__name__)\n" +"adapter = CustomAdapter(logger, {'connid': some_conn_id})" +msgstr "" + +msgid "" +"Then any events that you log to the adapter will have the value of " +"``some_conn_id`` prepended to the log messages." +msgstr "" +"Тоді будь-які події, які ви реєструєте в адаптері, матимуть значення " +"``some_conn_id`` до повідомлень журналу." + +msgid "Using objects other than dicts to pass contextual information" +msgstr "" +"Використання об’єктів, відмінних від dicts, для передачі контекстної " +"інформації" + +msgid "" +"You don't need to pass an actual dict to a :class:`LoggerAdapter` - you " +"could pass an instance of a class which implements ``__getitem__`` and " +"``__iter__`` so that it looks like a dict to logging. This would be useful " +"if you want to generate values dynamically (whereas the values in a dict " +"would be constant)." +msgstr "" +"Вам не потрібно передавати фактичний dict до :class:`LoggerAdapter` - ви " +"можете передати примірник класу, який реалізує ``__getitem__`` і " +"``__iter__``, щоб він виглядав як dict для журналювання. Це буде корисно, " +"якщо ви хочете генерувати значення динамічно (тоді як значення в dict будуть " +"постійними)." + +msgid "Using Filters to impart contextual information" +msgstr "Використання фільтрів для передачі контекстної інформації" + +msgid "" +"You can also add contextual information to log output using a user-defined :" +"class:`Filter`. ``Filter`` instances are allowed to modify the " +"``LogRecords`` passed to them, including adding additional attributes which " +"can then be output using a suitable format string, or if needed a custom :" +"class:`Formatter`." +msgstr "" +"Ви також можете додати контекстну інформацію до виведення журналу за " +"допомогою визначеного користувачем :class:`Filter`. Екземплярам ``Filter`` " +"дозволено змінювати ``LogRecords``, передані їм, включаючи додавання " +"додаткових атрибутів, які потім можуть бути виведені за допомогою рядка " +"відповідного формату або, якщо необхідно, спеціального :class:`Formatter`." + +msgid "" +"For example in a web application, the request being processed (or at least, " +"the interesting parts of it) can be stored in a threadlocal (:class:" +"`threading.local`) variable, and then accessed from a ``Filter`` to add, " +"say, information from the request - say, the remote IP address and remote " +"user's username - to the ``LogRecord``, using the attribute names 'ip' and " +"'user' as in the ``LoggerAdapter`` example above. In that case, the same " +"format string can be used to get similar output to that shown above. Here's " +"an example script::" +msgstr "" +"Наприклад, у веб-додатку запит, який обробляється (або, принаймні, його " +"цікаві частини) можна зберегти у змінній threadlocal (:class:`threading." +"local`), а потім отримати доступ із ``Фільтра`` щоб додати, скажімо, " +"інформацію із запиту - скажімо, віддалену IP-адресу та ім'я користувача " +"віддаленого користувача - до ``LogRecord``, використовуючи імена атрибутів " +"'ip' і 'user', як у прикладі ``LoggerAdapter`` вище . У цьому випадку можна " +"використати той самий рядок формату, щоб отримати вихід, схожий на показаний " +"вище. Ось приклад сценарію::" + +msgid "" +"import logging\n" +"from random import choice\n" +"\n" +"class ContextFilter(logging.Filter):\n" +" \"\"\"\n" +" This is a filter which injects contextual information into the log.\n" +"\n" +" Rather than use actual contextual information, we just use random\n" +" data in this demo.\n" +" \"\"\"\n" +"\n" +" USERS = ['jim', 'fred', 'sheila']\n" +" IPS = ['123.231.231.123', '127.0.0.1', '192.168.0.1']\n" +"\n" +" def filter(self, record):\n" +"\n" +" record.ip = choice(ContextFilter.IPS)\n" +" record.user = choice(ContextFilter.USERS)\n" +" return True\n" +"\n" +"if __name__ == '__main__':\n" +" levels = (logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR, " +"logging.CRITICAL)\n" +" logging.basicConfig(level=logging.DEBUG,\n" +" format='%(asctime)-15s %(name)-5s %(levelname)-8s " +"IP: %(ip)-15s User: %(user)-8s %(message)s')\n" +" a1 = logging.getLogger('a.b.c')\n" +" a2 = logging.getLogger('d.e.f')\n" +"\n" +" f = ContextFilter()\n" +" a1.addFilter(f)\n" +" a2.addFilter(f)\n" +" a1.debug('A debug message')\n" +" a1.info('An info message with %s', 'some parameters')\n" +" for x in range(10):\n" +" lvl = choice(levels)\n" +" lvlname = logging.getLevelName(lvl)\n" +" a2.log(lvl, 'A message at %s level with %d %s', lvlname, 2, " +"'parameters')" +msgstr "" + +msgid "which, when run, produces something like:" +msgstr "який під час запуску створює щось на зразок:" + +msgid "" +"2010-09-06 22:38:15,292 a.b.c DEBUG IP: 123.231.231.123 User: fred A " +"debug message\n" +"2010-09-06 22:38:15,300 a.b.c INFO IP: 192.168.0.1 User: sheila An " +"info message with some parameters\n" +"2010-09-06 22:38:15,300 d.e.f CRITICAL IP: 127.0.0.1 User: sheila A " +"message at CRITICAL level with 2 parameters\n" +"2010-09-06 22:38:15,300 d.e.f ERROR IP: 127.0.0.1 User: jim A " +"message at ERROR level with 2 parameters\n" +"2010-09-06 22:38:15,300 d.e.f DEBUG IP: 127.0.0.1 User: sheila A " +"message at DEBUG level with 2 parameters\n" +"2010-09-06 22:38:15,300 d.e.f ERROR IP: 123.231.231.123 User: fred A " +"message at ERROR level with 2 parameters\n" +"2010-09-06 22:38:15,300 d.e.f CRITICAL IP: 192.168.0.1 User: jim A " +"message at CRITICAL level with 2 parameters\n" +"2010-09-06 22:38:15,300 d.e.f CRITICAL IP: 127.0.0.1 User: sheila A " +"message at CRITICAL level with 2 parameters\n" +"2010-09-06 22:38:15,300 d.e.f DEBUG IP: 192.168.0.1 User: jim A " +"message at DEBUG level with 2 parameters\n" +"2010-09-06 22:38:15,301 d.e.f ERROR IP: 127.0.0.1 User: sheila A " +"message at ERROR level with 2 parameters\n" +"2010-09-06 22:38:15,301 d.e.f DEBUG IP: 123.231.231.123 User: fred A " +"message at DEBUG level with 2 parameters\n" +"2010-09-06 22:38:15,301 d.e.f INFO IP: 123.231.231.123 User: fred A " +"message at INFO level with 2 parameters" +msgstr "" + +msgid "Use of ``contextvars``" +msgstr "" + +msgid "" +"Since Python 3.7, the :mod:`contextvars` module has provided context-local " +"storage which works for both :mod:`threading` and :mod:`asyncio` processing " +"needs. This type of storage may thus be generally preferable to thread-" +"locals. The following example shows how, in a multi-threaded environment, " +"logs can populated with contextual information such as, for example, request " +"attributes handled by web applications." +msgstr "" + +msgid "" +"For the purposes of illustration, say that you have different web " +"applications, each independent of the other but running in the same Python " +"process and using a library common to them. How can each of these " +"applications have their own log, where all logging messages from the library " +"(and other request processing code) are directed to the appropriate " +"application's log file, while including in the log additional contextual " +"information such as client IP, HTTP request method and client username?" +msgstr "" + +msgid "Let's assume that the library can be simulated by the following code:" +msgstr "" + +msgid "" +"# webapplib.py\n" +"import logging\n" +"import time\n" +"\n" +"logger = logging.getLogger(__name__)\n" +"\n" +"def useful():\n" +" # Just a representative event logged from the library\n" +" logger.debug('Hello from webapplib!')\n" +" # Just sleep for a bit so other threads get to run\n" +" time.sleep(0.01)" +msgstr "" + +msgid "" +"We can simulate the multiple web applications by means of two simple " +"classes, ``Request`` and ``WebApp``. These simulate how real threaded web " +"applications work - each request is handled by a thread:" +msgstr "" + +msgid "" +"# main.py\n" +"import argparse\n" +"from contextvars import ContextVar\n" +"import logging\n" +"import os\n" +"from random import choice\n" +"import threading\n" +"import webapplib\n" +"\n" +"logger = logging.getLogger(__name__)\n" +"root = logging.getLogger()\n" +"root.setLevel(logging.DEBUG)\n" +"\n" +"class Request:\n" +" \"\"\"\n" +" A simple dummy request class which just holds dummy HTTP request " +"method,\n" +" client IP address and client username\n" +" \"\"\"\n" +" def __init__(self, method, ip, user):\n" +" self.method = method\n" +" self.ip = ip\n" +" self.user = user\n" +"\n" +"# A dummy set of requests which will be used in the simulation - we'll just " +"pick\n" +"# from this list randomly. Note that all GET requests are from 192.168.2." +"XXX\n" +"# addresses, whereas POST requests are from 192.16.3.XXX addresses. Three " +"users\n" +"# are represented in the sample requests.\n" +"\n" +"REQUESTS = [\n" +" Request('GET', '192.168.2.20', 'jim'),\n" +" Request('POST', '192.168.3.20', 'fred'),\n" +" Request('GET', '192.168.2.21', 'sheila'),\n" +" Request('POST', '192.168.3.21', 'jim'),\n" +" Request('GET', '192.168.2.22', 'fred'),\n" +" Request('POST', '192.168.3.22', 'sheila'),\n" +"]\n" +"\n" +"# Note that the format string includes references to request context " +"information\n" +"# such as HTTP method, client IP and username\n" +"\n" +"formatter = logging.Formatter('%(threadName)-11s %(appName)s %(name)-9s " +"%(user)-6s %(ip)s %(method)-4s %(message)s')\n" +"\n" +"# Create our context variables. These will be filled at the start of " +"request\n" +"# processing, and used in the logging that happens during that processing\n" +"\n" +"ctx_request = ContextVar('request')\n" +"ctx_appname = ContextVar('appname')\n" +"\n" +"class InjectingFilter(logging.Filter):\n" +" \"\"\"\n" +" A filter which injects context-specific information into logs and " +"ensures\n" +" that only information for a specific webapp is included in its log\n" +" \"\"\"\n" +" def __init__(self, app):\n" +" self.app = app\n" +"\n" +" def filter(self, record):\n" +" request = ctx_request.get()\n" +" record.method = request.method\n" +" record.ip = request.ip\n" +" record.user = request.user\n" +" record.appName = appName = ctx_appname.get()\n" +" return appName == self.app.name\n" +"\n" +"class WebApp:\n" +" \"\"\"\n" +" A dummy web application class which has its own handler and filter for " +"a\n" +" webapp-specific log.\n" +" \"\"\"\n" +" def __init__(self, name):\n" +" self.name = name\n" +" handler = logging.FileHandler(name + '.log', 'w')\n" +" f = InjectingFilter(self)\n" +" handler.setFormatter(formatter)\n" +" handler.addFilter(f)\n" +" root.addHandler(handler)\n" +" self.num_requests = 0\n" +"\n" +" def process_request(self, request):\n" +" \"\"\"\n" +" This is the dummy method for processing a request. It's called on a\n" +" different thread for every request. We store the context information " +"into\n" +" the context vars before doing anything else.\n" +" \"\"\"\n" +" ctx_request.set(request)\n" +" ctx_appname.set(self.name)\n" +" self.num_requests += 1\n" +" logger.debug('Request processing started')\n" +" webapplib.useful()\n" +" logger.debug('Request processing finished')\n" +"\n" +"def main():\n" +" fn = os.path.splitext(os.path.basename(__file__))[0]\n" +" adhf = argparse.ArgumentDefaultsHelpFormatter\n" +" ap = argparse.ArgumentParser(formatter_class=adhf, prog=fn,\n" +" description='Simulate a couple of web '\n" +" 'applications handling some '\n" +" 'requests, showing how request " +"'\n" +" 'context can be used to '\n" +" 'populate logs')\n" +" aa = ap.add_argument\n" +" aa('--count', '-c', type=int, default=100, help='How many requests to " +"simulate')\n" +" options = ap.parse_args()\n" +"\n" +" # Create the dummy webapps and put them in a list which we can use to " +"select\n" +" # from randomly\n" +" app1 = WebApp('app1')\n" +" app2 = WebApp('app2')\n" +" apps = [app1, app2]\n" +" threads = []\n" +" # Add a common handler which will capture all events\n" +" handler = logging.FileHandler('app.log', 'w')\n" +" handler.setFormatter(formatter)\n" +" root.addHandler(handler)\n" +"\n" +" # Generate calls to process requests\n" +" for i in range(options.count):\n" +" try:\n" +" # Pick an app at random and a request for it to process\n" +" app = choice(apps)\n" +" request = choice(REQUESTS)\n" +" # Process the request in its own thread\n" +" t = threading.Thread(target=app.process_request, " +"args=(request,))\n" +" threads.append(t)\n" +" t.start()\n" +" except KeyboardInterrupt:\n" +" break\n" +"\n" +" # Wait for the threads to terminate\n" +" for t in threads:\n" +" t.join()\n" +"\n" +" for app in apps:\n" +" print('%s processed %s requests' % (app.name, app.num_requests))\n" +"\n" +"if __name__ == '__main__':\n" +" main()" +msgstr "" + +msgid "" +"If you run the above, you should find that roughly half the requests go " +"into :file:`app1.log` and the rest into :file:`app2.log`, and the all the " +"requests are logged to :file:`app.log`. Each webapp-specific log will " +"contain only log entries for only that webapp, and the request information " +"will be displayed consistently in the log (i.e. the information in each " +"dummy request will always appear together in a log line). This is " +"illustrated by the following shell output:" +msgstr "" + +msgid "" +"~/logging-contextual-webapp$ python main.py\n" +"app1 processed 51 requests\n" +"app2 processed 49 requests\n" +"~/logging-contextual-webapp$ wc -l *.log\n" +" 153 app1.log\n" +" 147 app2.log\n" +" 300 app.log\n" +" 600 total\n" +"~/logging-contextual-webapp$ head -3 app1.log\n" +"Thread-3 (process_request) app1 __main__ jim 192.168.3.21 POST Request " +"processing started\n" +"Thread-3 (process_request) app1 webapplib jim 192.168.3.21 POST Hello " +"from webapplib!\n" +"Thread-5 (process_request) app1 __main__ jim 192.168.3.21 POST Request " +"processing started\n" +"~/logging-contextual-webapp$ head -3 app2.log\n" +"Thread-1 (process_request) app2 __main__ sheila 192.168.2.21 GET Request " +"processing started\n" +"Thread-1 (process_request) app2 webapplib sheila 192.168.2.21 GET Hello " +"from webapplib!\n" +"Thread-2 (process_request) app2 __main__ jim 192.168.2.20 GET Request " +"processing started\n" +"~/logging-contextual-webapp$ head app.log\n" +"Thread-1 (process_request) app2 __main__ sheila 192.168.2.21 GET Request " +"processing started\n" +"Thread-1 (process_request) app2 webapplib sheila 192.168.2.21 GET Hello " +"from webapplib!\n" +"Thread-2 (process_request) app2 __main__ jim 192.168.2.20 GET Request " +"processing started\n" +"Thread-3 (process_request) app1 __main__ jim 192.168.3.21 POST Request " +"processing started\n" +"Thread-2 (process_request) app2 webapplib jim 192.168.2.20 GET Hello " +"from webapplib!\n" +"Thread-3 (process_request) app1 webapplib jim 192.168.3.21 POST Hello " +"from webapplib!\n" +"Thread-4 (process_request) app2 __main__ fred 192.168.2.22 GET Request " +"processing started\n" +"Thread-5 (process_request) app1 __main__ jim 192.168.3.21 POST Request " +"processing started\n" +"Thread-4 (process_request) app2 webapplib fred 192.168.2.22 GET Hello " +"from webapplib!\n" +"Thread-6 (process_request) app1 __main__ jim 192.168.3.21 POST Request " +"processing started\n" +"~/logging-contextual-webapp$ grep app1 app1.log | wc -l\n" +"153\n" +"~/logging-contextual-webapp$ grep app2 app2.log | wc -l\n" +"147\n" +"~/logging-contextual-webapp$ grep app1 app.log | wc -l\n" +"153\n" +"~/logging-contextual-webapp$ grep app2 app.log | wc -l\n" +"147" +msgstr "" + +msgid "Imparting contextual information in handlers" +msgstr "" + +msgid "" +"Each :class:`~Handler` has its own chain of filters. If you want to add " +"contextual information to a :class:`LogRecord` without leaking it to other " +"handlers, you can use a filter that returns a new :class:`~LogRecord` " +"instead of modifying it in-place, as shown in the following script::" +msgstr "" + +msgid "" +"import copy\n" +"import logging\n" +"\n" +"def filter(record: logging.LogRecord):\n" +" record = copy.copy(record)\n" +" record.user = 'jim'\n" +" return record\n" +"\n" +"if __name__ == '__main__':\n" +" logger = logging.getLogger()\n" +" logger.setLevel(logging.INFO)\n" +" handler = logging.StreamHandler()\n" +" formatter = logging.Formatter('%(message)s from %(user)-8s')\n" +" handler.setFormatter(formatter)\n" +" handler.addFilter(filter)\n" +" logger.addHandler(handler)\n" +"\n" +" logger.info('A log message')" +msgstr "" + +msgid "Logging to a single file from multiple processes" +msgstr "Реєстрація в один файл з кількох процесів" + +msgid "" +"Although logging is thread-safe, and logging to a single file from multiple " +"threads in a single process *is* supported, logging to a single file from " +"*multiple processes* is *not* supported, because there is no standard way to " +"serialize access to a single file across multiple processes in Python. If " +"you need to log to a single file from multiple processes, one way of doing " +"this is to have all the processes log to a :class:`~handlers.SocketHandler`, " +"and have a separate process which implements a socket server which reads " +"from the socket and logs to file. (If you prefer, you can dedicate one " +"thread in one of the existing processes to perform this function.) :ref:" +"`This section ` documents this approach in more detail and " +"includes a working socket receiver which can be used as a starting point for " +"you to adapt in your own applications." +msgstr "" +"Хоча ведення журналу є потокобезпечним і *підтримується* журналювання в один " +"файл із кількох потоків в одному процесі, журналювання в один файл із " +"*кількох процесів *не* підтримується, оскільки немає стандартного способу " +"серіалізації доступу в один файл через кілька процесів у Python. Якщо вам " +"потрібно ввійти до одного файлу з кількох процесів, один із способів зробити " +"це — зареєструвати всі процеси в :class:`~handlers.SocketHandler` і мати " +"окремий процес, який реалізує сервер сокетів, який читає з сокет і журнали в " +"файл. (Якщо ви віддаєте перевагу, ви можете виділити один потік в одному з " +"існуючих процесів для виконання цієї функції.) :ref:`Цей розділ ` документує цей підхід більш детально та містить робочий приймач " +"сокетів, який можна використовувати як відправну точку для адаптації у " +"власних програмах." + +msgid "" +"You could also write your own handler which uses the :class:" +"`~multiprocessing.Lock` class from the :mod:`multiprocessing` module to " +"serialize access to the file from your processes. The stdlib :class:" +"`FileHandler` and subclasses do not make use of :mod:`multiprocessing`." +msgstr "" + +msgid "" +"Alternatively, you can use a ``Queue`` and a :class:`QueueHandler` to send " +"all logging events to one of the processes in your multi-process " +"application. The following example script demonstrates how you can do this; " +"in the example a separate listener process listens for events sent by other " +"processes and logs them according to its own logging configuration. Although " +"the example only demonstrates one way of doing it (for example, you may want " +"to use a listener thread rather than a separate listener process -- the " +"implementation would be analogous) it does allow for completely different " +"logging configurations for the listener and the other processes in your " +"application, and can be used as the basis for code meeting your own specific " +"requirements::" +msgstr "" +"Крім того, ви можете використовувати ``Queue`` і :class:`QueueHandler`, щоб " +"надсилати всі події журналювання до одного з процесів у вашій " +"багатопроцесовій програмі. Наступний приклад сценарію демонструє, як це " +"можна зробити; у прикладі окремий процес слухача прослуховує події, " +"надіслані іншими процесами, і реєструє їх відповідно до власної конфігурації " +"журналювання. Хоча приклад демонструє лише один спосіб зробити це " +"(наприклад, ви можете використовувати потік слухача, а не окремий процес " +"слухача — реалізація буде аналогічною), він дозволяє абсолютно різні " +"конфігурації журналювання для слухача та інших процеси у вашій програмі та " +"можуть бути використані як основа для коду, який відповідає вашим власним " +"вимогам:" + +msgid "" +"# You'll need these imports in your own code\n" +"import logging\n" +"import logging.handlers\n" +"import multiprocessing\n" +"\n" +"# Next two import lines for this demo only\n" +"from random import choice, random\n" +"import time\n" +"\n" +"#\n" +"# Because you'll want to define the logging configurations for listener and " +"workers, the\n" +"# listener and worker process functions take a configurer parameter which is " +"a callable\n" +"# for configuring logging for that process. These functions are also passed " +"the queue,\n" +"# which they use for communication.\n" +"#\n" +"# In practice, you can configure the listener however you want, but note " +"that in this\n" +"# simple example, the listener does not apply level or filter logic to " +"received records.\n" +"# In practice, you would probably want to do this logic in the worker " +"processes, to avoid\n" +"# sending events which would be filtered out between processes.\n" +"#\n" +"# The size of the rotated files is made small so you can see the results " +"easily.\n" +"def listener_configurer():\n" +" root = logging.getLogger()\n" +" h = logging.handlers.RotatingFileHandler('mptest.log', 'a', 300, 10)\n" +" f = logging.Formatter('%(asctime)s %(processName)-10s %(name)s " +"%(levelname)-8s %(message)s')\n" +" h.setFormatter(f)\n" +" root.addHandler(h)\n" +"\n" +"# This is the listener process top-level loop: wait for logging events\n" +"# (LogRecords)on the queue and handle them, quit when you get a None for a\n" +"# LogRecord.\n" +"def listener_process(queue, configurer):\n" +" configurer()\n" +" while True:\n" +" try:\n" +" record = queue.get()\n" +" if record is None: # We send this as a sentinel to tell the " +"listener to quit.\n" +" break\n" +" logger = logging.getLogger(record.name)\n" +" logger.handle(record) # No level or filter logic applied - just " +"do it!\n" +" except Exception:\n" +" import sys, traceback\n" +" print('Whoops! Problem:', file=sys.stderr)\n" +" traceback.print_exc(file=sys.stderr)\n" +"\n" +"# Arrays used for random selections in this demo\n" +"\n" +"LEVELS = [logging.DEBUG, logging.INFO, logging.WARNING,\n" +" logging.ERROR, logging.CRITICAL]\n" +"\n" +"LOGGERS = ['a.b.c', 'd.e.f']\n" +"\n" +"MESSAGES = [\n" +" 'Random message #1',\n" +" 'Random message #2',\n" +" 'Random message #3',\n" +"]\n" +"\n" +"# The worker configuration is done at the start of the worker process run.\n" +"# Note that on Windows you can't rely on fork semantics, so each process\n" +"# will run the logging configuration code when it starts.\n" +"def worker_configurer(queue):\n" +" h = logging.handlers.QueueHandler(queue) # Just the one handler needed\n" +" root = logging.getLogger()\n" +" root.addHandler(h)\n" +" # send all messages, for demo; no other level or filter logic applied.\n" +" root.setLevel(logging.DEBUG)\n" +"\n" +"# This is the worker process top-level loop, which just logs ten events " +"with\n" +"# random intervening delays before terminating.\n" +"# The print messages are just so you know it's doing something!\n" +"def worker_process(queue, configurer):\n" +" configurer(queue)\n" +" name = multiprocessing.current_process().name\n" +" print('Worker started: %s' % name)\n" +" for i in range(10):\n" +" time.sleep(random())\n" +" logger = logging.getLogger(choice(LOGGERS))\n" +" level = choice(LEVELS)\n" +" message = choice(MESSAGES)\n" +" logger.log(level, message)\n" +" print('Worker finished: %s' % name)\n" +"\n" +"# Here's where the demo gets orchestrated. Create the queue, create and " +"start\n" +"# the listener, create ten workers and start them, wait for them to finish,\n" +"# then send a None to the queue to tell the listener to finish.\n" +"def main():\n" +" queue = multiprocessing.Queue(-1)\n" +" listener = multiprocessing.Process(target=listener_process,\n" +" args=(queue, listener_configurer))\n" +" listener.start()\n" +" workers = []\n" +" for i in range(10):\n" +" worker = multiprocessing.Process(target=worker_process,\n" +" args=(queue, worker_configurer))\n" +" workers.append(worker)\n" +" worker.start()\n" +" for w in workers:\n" +" w.join()\n" +" queue.put_nowait(None)\n" +" listener.join()\n" +"\n" +"if __name__ == '__main__':\n" +" main()" +msgstr "" + +msgid "" +"A variant of the above script keeps the logging in the main process, in a " +"separate thread::" +msgstr "" +"Варіант наведеного вище сценарію зберігає журнали в основному процесі в " +"окремому потоці:" + +msgid "" +"import logging\n" +"import logging.config\n" +"import logging.handlers\n" +"from multiprocessing import Process, Queue\n" +"import random\n" +"import threading\n" +"import time\n" +"\n" +"def logger_thread(q):\n" +" while True:\n" +" record = q.get()\n" +" if record is None:\n" +" break\n" +" logger = logging.getLogger(record.name)\n" +" logger.handle(record)\n" +"\n" +"\n" +"def worker_process(q):\n" +" qh = logging.handlers.QueueHandler(q)\n" +" root = logging.getLogger()\n" +" root.setLevel(logging.DEBUG)\n" +" root.addHandler(qh)\n" +" levels = [logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR,\n" +" logging.CRITICAL]\n" +" loggers = ['foo', 'foo.bar', 'foo.bar.baz',\n" +" 'spam', 'spam.ham', 'spam.ham.eggs']\n" +" for i in range(100):\n" +" lvl = random.choice(levels)\n" +" logger = logging.getLogger(random.choice(loggers))\n" +" logger.log(lvl, 'Message no. %d', i)\n" +"\n" +"if __name__ == '__main__':\n" +" q = Queue()\n" +" d = {\n" +" 'version': 1,\n" +" 'formatters': {\n" +" 'detailed': {\n" +" 'class': 'logging.Formatter',\n" +" 'format': '%(asctime)s %(name)-15s %(levelname)-8s " +"%(processName)-10s %(message)s'\n" +" }\n" +" },\n" +" 'handlers': {\n" +" 'console': {\n" +" 'class': 'logging.StreamHandler',\n" +" 'level': 'INFO',\n" +" },\n" +" 'file': {\n" +" 'class': 'logging.FileHandler',\n" +" 'filename': 'mplog.log',\n" +" 'mode': 'w',\n" +" 'formatter': 'detailed',\n" +" },\n" +" 'foofile': {\n" +" 'class': 'logging.FileHandler',\n" +" 'filename': 'mplog-foo.log',\n" +" 'mode': 'w',\n" +" 'formatter': 'detailed',\n" +" },\n" +" 'errors': {\n" +" 'class': 'logging.FileHandler',\n" +" 'filename': 'mplog-errors.log',\n" +" 'mode': 'w',\n" +" 'level': 'ERROR',\n" +" 'formatter': 'detailed',\n" +" },\n" +" },\n" +" 'loggers': {\n" +" 'foo': {\n" +" 'handlers': ['foofile']\n" +" }\n" +" },\n" +" 'root': {\n" +" 'level': 'DEBUG',\n" +" 'handlers': ['console', 'file', 'errors']\n" +" },\n" +" }\n" +" workers = []\n" +" for i in range(5):\n" +" wp = Process(target=worker_process, name='worker %d' % (i + 1), " +"args=(q,))\n" +" workers.append(wp)\n" +" wp.start()\n" +" logging.config.dictConfig(d)\n" +" lp = threading.Thread(target=logger_thread, args=(q,))\n" +" lp.start()\n" +" # At this point, the main process could do some useful work of its own\n" +" # Once it's done that, it can wait for the workers to terminate...\n" +" for wp in workers:\n" +" wp.join()\n" +" # And now tell the logging thread to finish up, too\n" +" q.put(None)\n" +" lp.join()" +msgstr "" + +msgid "" +"This variant shows how you can e.g. apply configuration for particular " +"loggers - e.g. the ``foo`` logger has a special handler which stores all " +"events in the ``foo`` subsystem in a file ``mplog-foo.log``. This will be " +"used by the logging machinery in the main process (even though the logging " +"events are generated in the worker processes) to direct the messages to the " +"appropriate destinations." +msgstr "" +"Цей варіант показує, як ви можете напр. застосувати конфігурацію для певних " +"реєстраторів - напр. Логер ``foo`` має спеціальний обробник, який зберігає " +"всі події в підсистемі ``foo`` у файлі ``mplog-foo.log``. Це " +"використовуватиметься механізмом реєстрації в основному процесі (навіть якщо " +"події журналювання генеруються в робочих процесах), щоб спрямувати " +"повідомлення до відповідних адресатів." + +msgid "Using concurrent.futures.ProcessPoolExecutor" +msgstr "Використання concurrent.futures.ProcessPoolExecutor" + +msgid "" +"If you want to use :class:`concurrent.futures.ProcessPoolExecutor` to start " +"your worker processes, you need to create the queue slightly differently. " +"Instead of" +msgstr "" +"Якщо ви хочете використовувати :class:`concurrent.futures." +"ProcessPoolExecutor` для запуску ваших робочих процесів, вам потрібно " +"створити чергу трохи інакше. Замість" + +msgid "queue = multiprocessing.Queue(-1)" +msgstr "" + +msgid "you should use" +msgstr "ви повинні використовувати" + +msgid "" +"queue = multiprocessing.Manager().Queue(-1) # also works with the examples " +"above" +msgstr "" + +msgid "and you can then replace the worker creation from this::" +msgstr "а потім ви можете замінити робоче створення з цього::" + +msgid "" +"workers = []\n" +"for i in range(10):\n" +" worker = multiprocessing.Process(target=worker_process,\n" +" args=(queue, worker_configurer))\n" +" workers.append(worker)\n" +" worker.start()\n" +"for w in workers:\n" +" w.join()" +msgstr "" + +msgid "to this (remembering to first import :mod:`concurrent.futures`)::" +msgstr "до цього (не забувши спочатку імпортувати :mod:`concurrent.futures`)::" + +msgid "" +"with concurrent.futures.ProcessPoolExecutor(max_workers=10) as executor:\n" +" for i in range(10):\n" +" executor.submit(worker_process, queue, worker_configurer)" +msgstr "" + +msgid "Deploying Web applications using Gunicorn and uWSGI" +msgstr "Розгортання веб-додатків за допомогою Gunicorn і uWSGI" + +msgid "" +"When deploying Web applications using `Gunicorn `_ or " +"`uWSGI `_ (or similar), " +"multiple worker processes are created to handle client requests. In such " +"environments, avoid creating file-based handlers directly in your web " +"application. Instead, use a :class:`SocketHandler` to log from the web " +"application to a listener in a separate process. This can be set up using a " +"process management tool such as Supervisor - see `Running a logging socket " +"listener in production`_ for more details." +msgstr "" +"Під час розгортання веб-програм за допомогою `Gunicorn `_ або `uWSGI `_ (або " +"подібних), для обробки запитів клієнтів створюється кілька робочих процесів. " +"У таких середовищах уникайте створення обробників на основі файлів " +"безпосередньо у вашій веб-програмі. Замість цього використовуйте :class:" +"`SocketHandler`, щоб увійти з веб-програми до слухача в окремому процесі. Це " +"можна налаштувати за допомогою інструменту керування процесами, такого як " +"Supervisor - див. `Running a logging socket listener in production`_ для " +"отримання додаткової інформації." + +msgid "Using file rotation" +msgstr "Використання ротації файлів" + +msgid "" +"Sometimes you want to let a log file grow to a certain size, then open a new " +"file and log to that. You may want to keep a certain number of these files, " +"and when that many files have been created, rotate the files so that the " +"number of files and the size of the files both remain bounded. For this " +"usage pattern, the logging package provides a :class:`RotatingFileHandler`::" +msgstr "" + +msgid "" +"import glob\n" +"import logging\n" +"import logging.handlers\n" +"\n" +"LOG_FILENAME = 'logging_rotatingfile_example.out'\n" +"\n" +"# Set up a specific logger with our desired output level\n" +"my_logger = logging.getLogger('MyLogger')\n" +"my_logger.setLevel(logging.DEBUG)\n" +"\n" +"# Add the log message handler to the logger\n" +"handler = logging.handlers.RotatingFileHandler(\n" +" LOG_FILENAME, maxBytes=20, backupCount=5)\n" +"\n" +"my_logger.addHandler(handler)\n" +"\n" +"# Log some messages\n" +"for i in range(20):\n" +" my_logger.debug('i = %d' % i)\n" +"\n" +"# See what files are created\n" +"logfiles = glob.glob('%s*' % LOG_FILENAME)\n" +"\n" +"for filename in logfiles:\n" +" print(filename)" +msgstr "" + +msgid "" +"The result should be 6 separate files, each with part of the log history for " +"the application:" +msgstr "" +"У результаті повинно вийти 6 окремих файлів, кожен з яких містить частину " +"журналу журналу програми:" + +msgid "" +"logging_rotatingfile_example.out\n" +"logging_rotatingfile_example.out.1\n" +"logging_rotatingfile_example.out.2\n" +"logging_rotatingfile_example.out.3\n" +"logging_rotatingfile_example.out.4\n" +"logging_rotatingfile_example.out.5" +msgstr "" + +msgid "" +"The most current file is always :file:`logging_rotatingfile_example.out`, " +"and each time it reaches the size limit it is renamed with the suffix " +"``.1``. Each of the existing backup files is renamed to increment the suffix " +"(``.1`` becomes ``.2``, etc.) and the ``.6`` file is erased." +msgstr "" +"Найновішим файлом завжди є :file:`logging_rotatingfile_example.out`, і " +"кожного разу, коли він досягає ліміту розміру, він перейменовується з " +"суфіксом ``.1``. Кожен із наявних файлів резервної копії перейменовується, " +"щоб збільшити суфікс (``.1`` стає ``.2`` тощо), а файл ``.6`` видаляється." + +msgid "" +"Obviously this example sets the log length much too small as an extreme " +"example. You would want to set *maxBytes* to an appropriate value." +msgstr "" +"Очевидно, що цей приклад встановлює занадто малу довжину журналу як " +"екстремальний приклад. Вам потрібно встановити відповідне значення " +"*maxBytes*." + +msgid "Use of alternative formatting styles" +msgstr "Використання альтернативних стилів форматування" + +msgid "" +"When logging was added to the Python standard library, the only way of " +"formatting messages with variable content was to use the %-formatting " +"method. Since then, Python has gained two new formatting approaches: :class:" +"`string.Template` (added in Python 2.4) and :meth:`str.format` (added in " +"Python 2.6)." +msgstr "" +"Коли журналювання було додано до стандартної бібліотеки Python, єдиним " +"способом форматування повідомлень зі змінним вмістом було використання " +"методу %-formatting. Відтоді Python отримав два нові підходи до " +"форматування: :class:`string.Template` (доданий у Python 2.4) і :meth:`str." +"format` (доданий у Python 2.6)." + +msgid "" +"Logging (as of 3.2) provides improved support for these two additional " +"formatting styles. The :class:`Formatter` class been enhanced to take an " +"additional, optional keyword parameter named ``style``. This defaults to " +"``'%'``, but other possible values are ``'{'`` and ``'$'``, which correspond " +"to the other two formatting styles. Backwards compatibility is maintained by " +"default (as you would expect), but by explicitly specifying a style " +"parameter, you get the ability to specify format strings which work with :" +"meth:`str.format` or :class:`string.Template`. Here's an example console " +"session to show the possibilities:" +msgstr "" +"Журналування (станом на 3.2) забезпечує покращену підтримку цих двох " +"додаткових стилів форматування. Клас :class:`Formatter` було вдосконалено, " +"щоб прийняти додатковий необов’язковий параметр ключового слова під назвою " +"``style``. За замовчуванням це ``'%'``, але інші можливі значення ``'{'`` і " +"``'$'``, які відповідають двом іншим стилям форматування. Зворотна " +"сумісність підтримується за замовчуванням (як і слід було очікувати), але, " +"явно вказавши параметр стилю, ви отримуєте можливість вказати рядки формату, " +"які працюють із :meth:`str.format` або :class:`string.Template`. Ось приклад " +"сеансу консолі, щоб показати можливості:" + +msgid "" +">>> import logging\n" +">>> root = logging.getLogger()\n" +">>> root.setLevel(logging.DEBUG)\n" +">>> handler = logging.StreamHandler()\n" +">>> bf = logging.Formatter('{asctime} {name} {levelname:8s} {message}',\n" +"... style='{')\n" +">>> handler.setFormatter(bf)\n" +">>> root.addHandler(handler)\n" +">>> logger = logging.getLogger('foo.bar')\n" +">>> logger.debug('This is a DEBUG message')\n" +"2010-10-28 15:11:55,341 foo.bar DEBUG This is a DEBUG message\n" +">>> logger.critical('This is a CRITICAL message')\n" +"2010-10-28 15:12:11,526 foo.bar CRITICAL This is a CRITICAL message\n" +">>> df = logging.Formatter('$asctime $name ${levelname} $message',\n" +"... style='$')\n" +">>> handler.setFormatter(df)\n" +">>> logger.debug('This is a DEBUG message')\n" +"2010-10-28 15:13:06,924 foo.bar DEBUG This is a DEBUG message\n" +">>> logger.critical('This is a CRITICAL message')\n" +"2010-10-28 15:13:11,494 foo.bar CRITICAL This is a CRITICAL message\n" +">>>" +msgstr "" + +msgid "" +"Note that the formatting of logging messages for final output to logs is " +"completely independent of how an individual logging message is constructed. " +"That can still use %-formatting, as shown here::" +msgstr "" +"Зверніть увагу, що форматування повідомлень журналу для остаточного " +"виведення в журнали повністю не залежить від того, як побудовано окреме " +"повідомлення журналу. Це все ще може використовувати %-formatting, як " +"показано тут::" + +msgid "" +">>> logger.error('This is an%s %s %s', 'other,', 'ERROR,', 'message')\n" +"2010-10-28 15:19:29,833 foo.bar ERROR This is another, ERROR, message\n" +">>>" +msgstr "" + +msgid "" +"Logging calls (``logger.debug()``, ``logger.info()`` etc.) only take " +"positional parameters for the actual logging message itself, with keyword " +"parameters used only for determining options for how to handle the actual " +"logging call (e.g. the ``exc_info`` keyword parameter to indicate that " +"traceback information should be logged, or the ``extra`` keyword parameter " +"to indicate additional contextual information to be added to the log). So " +"you cannot directly make logging calls using :meth:`str.format` or :class:" +"`string.Template` syntax, because internally the logging package uses %-" +"formatting to merge the format string and the variable arguments. There " +"would be no changing this while preserving backward compatibility, since all " +"logging calls which are out there in existing code will be using %-format " +"strings." +msgstr "" +"Виклики журналювання (``logger.debug()``, ``logger.info()`` тощо) приймають " +"лише позиційні параметри для самого фактичного повідомлення журналу, а " +"параметри ключових слів використовуються лише для визначення варіантів " +"обробки фактичного виклик журналювання (наприклад, параметр ключового слова " +"``exc_info``, щоб вказати, що слід реєструвати інформацію відстеження, або " +"параметр ключового слова ``extra``, щоб вказати додаткову контекстну " +"інформацію, яку потрібно додати до журналу). Таким чином, ви не можете " +"безпосередньо здійснювати виклики журналювання за допомогою синтаксису :meth:" +"`str.format` або :class:`string.Template`, тому що внутрішньо пакет " +"журналювання використовує %-formatting для об’єднання рядка формату та " +"змінних аргументів. Це не змінюватиметься, зберігаючи зворотну сумісність, " +"оскільки всі виклики журналювання, які присутні в існуючому коді, " +"використовуватимуть рядки %-format." + +msgid "" +"There is, however, a way that you can use {}- and $- formatting to construct " +"your individual log messages. Recall that for a message you can use an " +"arbitrary object as a message format string, and that the logging package " +"will call ``str()`` on that object to get the actual format string. Consider " +"the following two classes::" +msgstr "" +"Однак існує спосіб, за допомогою якого ви можете використовувати " +"форматування {}- і $- для створення ваших індивідуальних повідомлень " +"журналу. Згадайте, що для повідомлення ви можете використовувати довільний " +"об’єкт як рядок формату повідомлення, і що пакет журналювання викличе " +"``str()`` для цього об’єкта, щоб отримати фактичний рядок формату. " +"Розглянемо наступні два класи:" + +msgid "" +"class BraceMessage:\n" +" def __init__(self, fmt, /, *args, **kwargs):\n" +" self.fmt = fmt\n" +" self.args = args\n" +" self.kwargs = kwargs\n" +"\n" +" def __str__(self):\n" +" return self.fmt.format(*self.args, **self.kwargs)\n" +"\n" +"class DollarMessage:\n" +" def __init__(self, fmt, /, **kwargs):\n" +" self.fmt = fmt\n" +" self.kwargs = kwargs\n" +"\n" +" def __str__(self):\n" +" from string import Template\n" +" return Template(self.fmt).substitute(**self.kwargs)" +msgstr "" + +msgid "" +"Either of these can be used in place of a format string, to allow {}- or $-" +"formatting to be used to build the actual \"message\" part which appears in " +"the formatted log output in place of \"%(message)s\" or \"{message}\" or " +"\"$message\". It's a little unwieldy to use the class names whenever you " +"want to log something, but it's quite palatable if you use an alias such as " +"__ (double underscore --- not to be confused with _, the single underscore " +"used as a synonym/alias for :func:`gettext.gettext` or its brethren)." +msgstr "" +"Будь-який із них можна використовувати замість рядка формату, щоб дозволити " +"використовувати {}- або $-форматування для побудови фактичної частини " +"\"повідомлення\", яка з’являється у відформатованому журналі замість " +"\"%(message)s\" або \"{message\". }\" або \"$message\". Трохи громіздко " +"використовувати назви класів, коли ви хочете щось зареєструвати, але це " +"цілком приємно, якщо ви використовуєте псевдонім, наприклад __ (подвійне " +"підкреслення --- не плутати з _, єдине підкреслення, яке використовується як " +"синонім/псевдонім для :func:`gettext.gettext` або його братів)." + +msgid "" +"The above classes are not included in Python, though they're easy enough to " +"copy and paste into your own code. They can be used as follows (assuming " +"that they're declared in a module called ``wherever``):" +msgstr "" +"Наведені вище класи не включені в Python, хоча їх достатньо легко скопіювати " +"та вставити у свій власний код. Їх можна використовувати наступним чином (за " +"умови, що вони оголошені в модулі під назвою ``wherever``):" + +msgid "" +">>> from wherever import BraceMessage as __\n" +">>> print(__('Message with {0} {name}', 2, name='placeholders'))\n" +"Message with 2 placeholders\n" +">>> class Point: pass\n" +"...\n" +">>> p = Point()\n" +">>> p.x = 0.5\n" +">>> p.y = 0.5\n" +">>> print(__('Message with coordinates: ({point.x:.2f}, {point.y:.2f})',\n" +"... point=p))\n" +"Message with coordinates: (0.50, 0.50)\n" +">>> from wherever import DollarMessage as __\n" +">>> print(__('Message with $num $what', num=2, what='placeholders'))\n" +"Message with 2 placeholders\n" +">>>" +msgstr "" + +msgid "" +"While the above examples use ``print()`` to show how the formatting works, " +"you would of course use ``logger.debug()`` or similar to actually log using " +"this approach." +msgstr "" +"У той час як у наведених вище прикладах використовується ``print()``, щоб " +"показати, як працює форматування, ви, звичайно, скористаєтеся ``logger." +"debug()`` або подібним, щоб справді вести журнал за допомогою цього підходу." + +msgid "" +"One thing to note is that you pay no significant performance penalty with " +"this approach: the actual formatting happens not when you make the logging " +"call, but when (and if) the logged message is actually about to be output to " +"a log by a handler. So the only slightly unusual thing which might trip you " +"up is that the parentheses go around the format string and the arguments, " +"not just the format string. That's because the __ notation is just syntax " +"sugar for a constructor call to one of the :samp:`{XXX}Message` classes." +msgstr "" + +msgid "" +"If you prefer, you can use a :class:`LoggerAdapter` to achieve a similar " +"effect to the above, as in the following example::" +msgstr "" +"Якщо ви віддаєте перевагу, ви можете використовувати :class:`LoggerAdapter`, " +"щоб досягти ефекту, подібного до наведеного вище, як у наступному прикладі::" + +msgid "" +"import logging\n" +"\n" +"class Message:\n" +" def __init__(self, fmt, args):\n" +" self.fmt = fmt\n" +" self.args = args\n" +"\n" +" def __str__(self):\n" +" return self.fmt.format(*self.args)\n" +"\n" +"class StyleAdapter(logging.LoggerAdapter):\n" +" def log(self, level, msg, /, *args, stacklevel=1, **kwargs):\n" +" if self.isEnabledFor(level):\n" +" msg, kwargs = self.process(msg, kwargs)\n" +" self.logger.log(level, Message(msg, args), **kwargs,\n" +" stacklevel=stacklevel+1)\n" +"\n" +"logger = StyleAdapter(logging.getLogger(__name__))\n" +"\n" +"def main():\n" +" logger.debug('Hello, {}', 'world!')\n" +"\n" +"if __name__ == '__main__':\n" +" logging.basicConfig(level=logging.DEBUG)\n" +" main()" +msgstr "" + +msgid "" +"The above script should log the message ``Hello, world!`` when run with " +"Python 3.8 or later." +msgstr "" + +msgid "Customizing ``LogRecord``" +msgstr "Налаштування ``LogRecord``" + +msgid "" +"Every logging event is represented by a :class:`LogRecord` instance. When an " +"event is logged and not filtered out by a logger's level, a :class:" +"`LogRecord` is created, populated with information about the event and then " +"passed to the handlers for that logger (and its ancestors, up to and " +"including the logger where further propagation up the hierarchy is " +"disabled). Before Python 3.2, there were only two places where this creation " +"was done:" +msgstr "" +"Кожна подія журналювання представлена екземпляром :class:`LogRecord`. Коли " +"подія реєструється і не відфільтровується на рівні реєстратора, створюється :" +"class:`LogRecord`, заповнюється інформацією про подію, а потім передається " +"обробникам цього реєстратора (і його предків, аж до реєстратора включно). де " +"подальше поширення вгору по ієрархії вимкнено). До Python 3.2 існувало лише " +"два місця, де це було зроблено:" + +msgid "" +":meth:`Logger.makeRecord`, which is called in the normal process of logging " +"an event. This invoked :class:`LogRecord` directly to create an instance." +msgstr "" +":meth:`Logger.makeRecord`, який викликається в звичайному процесі реєстрації " +"події. Це безпосередньо викликало :class:`LogRecord` для створення " +"екземпляра." + +msgid "" +":func:`makeLogRecord`, which is called with a dictionary containing " +"attributes to be added to the LogRecord. This is typically invoked when a " +"suitable dictionary has been received over the network (e.g. in pickle form " +"via a :class:`~handlers.SocketHandler`, or in JSON form via an :class:" +"`~handlers.HTTPHandler`)." +msgstr "" +":func:`makeLogRecord`, який викликається зі словником, що містить атрибути, " +"які потрібно додати до LogRecord. Це зазвичай викликається, коли через " +"мережу отримано відповідний словник (наприклад, у формі pickle через :class:" +"`~handlers.SocketHandler` або у формі JSON через :class:`~handlers." +"HTTPHandler`)." + +msgid "" +"This has usually meant that if you need to do anything special with a :class:" +"`LogRecord`, you've had to do one of the following." +msgstr "" +"Зазвичай це означало, що якщо вам потрібно зробити щось особливе з :class:" +"`LogRecord`, ви повинні зробити одну з наступних дій." + +msgid "" +"Create your own :class:`Logger` subclass, which overrides :meth:`Logger." +"makeRecord`, and set it using :func:`~logging.setLoggerClass` before any " +"loggers that you care about are instantiated." +msgstr "" +"Створіть свій власний підклас :class:`Logger`, який замінює :meth:`Logger." +"makeRecord`, і встановіть його за допомогою :func:`~logging.setLoggerClass` " +"перед створенням будь-яких реєстраторів, які вас цікавлять." + +msgid "" +"Add a :class:`Filter` to a logger or handler, which does the necessary " +"special manipulation you need when its :meth:`~Filter.filter` method is " +"called." +msgstr "" +"Додайте :class:`Filter` до реєстратора або обробника, який виконує необхідні " +"спеціальні маніпуляції, які вам потрібні, коли викликається його метод :meth:" +"`~Filter.filter`." + +msgid "" +"The first approach would be a little unwieldy in the scenario where (say) " +"several different libraries wanted to do different things. Each would " +"attempt to set its own :class:`Logger` subclass, and the one which did this " +"last would win." +msgstr "" +"Перший підхід був би трохи громіздким у сценарії, коли (скажімо) кілька " +"різних бібліотек хотіли б робити різні речі. Кожен намагатиметься встановити " +"власний підклас :class:`Logger`, і виграє той, хто зробить це останнім." + +msgid "" +"The second approach works reasonably well for many cases, but does not allow " +"you to e.g. use a specialized subclass of :class:`LogRecord`. Library " +"developers can set a suitable filter on their loggers, but they would have " +"to remember to do this every time they introduced a new logger (which they " +"would do simply by adding new packages or modules and doing ::" +msgstr "" +"Другий підхід працює досить добре для багатьох випадків, але не дозволяє " +"вам, наприклад, використовувати спеціалізований підклас :class:`LogRecord`. " +"Розробники бібліотек можуть встановити відповідний фільтр для своїх " +"реєстраторів, але вони повинні пам’ятати про це щоразу, коли вводять новий " +"реєстратор (що вони робили б, просто додаючи нові пакунки чи модулі та " +"виконуючи:" + +msgid "logger = logging.getLogger(__name__)" +msgstr "" + +msgid "" +"at module level). It's probably one too many things to think about. " +"Developers could also add the filter to a :class:`~logging.NullHandler` " +"attached to their top-level logger, but this would not be invoked if an " +"application developer attached a handler to a lower-level library logger --- " +"so output from that handler would not reflect the intentions of the library " +"developer." +msgstr "" +"на рівні модуля). Ймовірно, це занадто багато речей, про які варто думати. " +"Розробники також можуть додати фільтр до :class:`~logging.NullHandler`, " +"прикріпленого до їхнього реєстратора верхнього рівня, але це не буде " +"викликано, якщо розробник програми приєднає обробник до реєстратора " +"бібліотеки нижчого рівня --- тому виведіть з цього обробника не " +"відображатиме намірів розробника бібліотеки." + +msgid "" +"In Python 3.2 and later, :class:`~logging.LogRecord` creation is done " +"through a factory, which you can specify. The factory is just a callable you " +"can set with :func:`~logging.setLogRecordFactory`, and interrogate with :" +"func:`~logging.getLogRecordFactory`. The factory is invoked with the same " +"signature as the :class:`~logging.LogRecord` constructor, as :class:" +"`LogRecord` is the default setting for the factory." +msgstr "" +"У Python 3.2 і пізніших версіях створення :class:`~logging.LogRecord` " +"здійснюється через фабрику, яку ви можете вказати. Фабрика — це просто " +"виклик, який можна встановити за допомогою :func:`~logging." +"setLogRecordFactory` і запитати за допомогою :func:`~logging." +"getLogRecordFactory`. Фабрика викликається з тим самим підписом, що й " +"конструктор :class:`~logging.LogRecord`, оскільки :class:`LogRecord` є " +"параметром за замовчуванням для фабрики." + +msgid "" +"This approach allows a custom factory to control all aspects of LogRecord " +"creation. For example, you could return a subclass, or just add some " +"additional attributes to the record once created, using a pattern similar to " +"this::" +msgstr "" +"Цей підхід дозволяє спеціальній фабрикі контролювати всі аспекти створення " +"LogRecord. Наприклад, ви можете повернути підклас або просто додати деякі " +"додаткові атрибути до створеного запису, використовуючи шаблон, подібний до " +"цього:" + +msgid "" +"old_factory = logging.getLogRecordFactory()\n" +"\n" +"def record_factory(*args, **kwargs):\n" +" record = old_factory(*args, **kwargs)\n" +" record.custom_attribute = 0xdecafbad\n" +" return record\n" +"\n" +"logging.setLogRecordFactory(record_factory)" +msgstr "" + +msgid "" +"This pattern allows different libraries to chain factories together, and as " +"long as they don't overwrite each other's attributes or unintentionally " +"overwrite the attributes provided as standard, there should be no surprises. " +"However, it should be borne in mind that each link in the chain adds run-" +"time overhead to all logging operations, and the technique should only be " +"used when the use of a :class:`Filter` does not provide the desired result." +msgstr "" +"Цей шаблон дозволяє різним бібліотекам об’єднувати фабрики разом, і якщо " +"вони не перезаписують атрибути одна одної або ненавмисно перезаписують " +"атрибути, надані як стандартні, не повинно бути сюрпризів. Однак слід мати " +"на увазі, що кожна ланка в ланцюжку додає накладні витрати на час виконання " +"для всіх операцій журналювання, і цю техніку слід використовувати лише тоді, " +"коли використання :class:`Filter` не забезпечує бажаного результату." + +msgid "Subclassing QueueHandler and QueueListener- a ZeroMQ example" +msgstr "" + +msgid "Subclass ``QueueHandler``" +msgstr "" + +msgid "" +"You can use a :class:`QueueHandler` subclass to send messages to other kinds " +"of queues, for example a ZeroMQ 'publish' socket. In the example below,the " +"socket is created separately and passed to the handler (as its 'queue')::" +msgstr "" +"Ви можете використовувати підклас :class:`QueueHandler` для надсилання " +"повідомлень в інші типи черг, наприклад, сокет ZeroMQ 'publish'. У " +"наведеному нижче прикладі сокет створюється окремо та передається обробнику " +"(як його \"черга\"):" + +msgid "" +"import zmq # using pyzmq, the Python binding for ZeroMQ\n" +"import json # for serializing records portably\n" +"\n" +"ctx = zmq.Context()\n" +"sock = zmq.Socket(ctx, zmq.PUB) # or zmq.PUSH, or other suitable value\n" +"sock.bind('tcp://*:5556') # or wherever\n" +"\n" +"class ZeroMQSocketHandler(QueueHandler):\n" +" def enqueue(self, record):\n" +" self.queue.send_json(record.__dict__)\n" +"\n" +"\n" +"handler = ZeroMQSocketHandler(sock)" +msgstr "" + +msgid "" +"Of course there are other ways of organizing this, for example passing in " +"the data needed by the handler to create the socket::" +msgstr "" +"Звичайно, існують інші способи організації цього, наприклад, передача даних, " +"необхідних обробнику для створення сокета::" + +msgid "" +"class ZeroMQSocketHandler(QueueHandler):\n" +" def __init__(self, uri, socktype=zmq.PUB, ctx=None):\n" +" self.ctx = ctx or zmq.Context()\n" +" socket = zmq.Socket(self.ctx, socktype)\n" +" socket.bind(uri)\n" +" super().__init__(socket)\n" +"\n" +" def enqueue(self, record):\n" +" self.queue.send_json(record.__dict__)\n" +"\n" +" def close(self):\n" +" self.queue.close()" +msgstr "" + +msgid "Subclass ``QueueListener``" +msgstr "" + +msgid "" +"You can also subclass :class:`QueueListener` to get messages from other " +"kinds of queues, for example a ZeroMQ 'subscribe' socket. Here's an example::" +msgstr "" +"Ви також можете створити підклас :class:`QueueListener`, щоб отримувати " +"повідомлення з інших типів черг, наприклад, сокет ZeroMQ 'subscribe'. Ось " +"приклад::" + +msgid "" +"class ZeroMQSocketListener(QueueListener):\n" +" def __init__(self, uri, /, *handlers, **kwargs):\n" +" self.ctx = kwargs.get('ctx') or zmq.Context()\n" +" socket = zmq.Socket(self.ctx, zmq.SUB)\n" +" socket.setsockopt_string(zmq.SUBSCRIBE, '') # subscribe to " +"everything\n" +" socket.connect(uri)\n" +" super().__init__(socket, *handlers, **kwargs)\n" +"\n" +" def dequeue(self):\n" +" msg = self.queue.recv_json()\n" +" return logging.makeLogRecord(msg)" +msgstr "" + +msgid "Subclassing QueueHandler and QueueListener- a ``pynng`` example" +msgstr "" + +msgid "" +"In a similar way to the above section, we can implement a listener and " +"handler using :pypi:`pynng`, which is a Python binding to `NNG `_, billed as a spiritual successor to ZeroMQ. The following " +"snippets illustrate -- you can test them in an environment which has " +"``pynng`` installed. Just for variety, we present the listener first." +msgstr "" + +msgid "" +"# listener.py\n" +"import json\n" +"import logging\n" +"import logging.handlers\n" +"\n" +"import pynng\n" +"\n" +"DEFAULT_ADDR = \"tcp://localhost:13232\"\n" +"\n" +"interrupted = False\n" +"\n" +"class NNGSocketListener(logging.handlers.QueueListener):\n" +"\n" +" def __init__(self, uri, /, *handlers, **kwargs):\n" +" # Have a timeout for interruptability, and open a\n" +" # subscriber socket\n" +" socket = pynng.Sub0(listen=uri, recv_timeout=500)\n" +" # The b'' subscription matches all topics\n" +" topics = kwargs.pop('topics', None) or b''\n" +" socket.subscribe(topics)\n" +" # We treat the socket as a queue\n" +" super().__init__(socket, *handlers, **kwargs)\n" +"\n" +" def dequeue(self, block):\n" +" data = None\n" +" # Keep looping while not interrupted and no data received over the\n" +" # socket\n" +" while not interrupted:\n" +" try:\n" +" data = self.queue.recv(block=block)\n" +" break\n" +" except pynng.Timeout:\n" +" pass\n" +" except pynng.Closed: # sometimes happens when you hit Ctrl-C\n" +" break\n" +" if data is None:\n" +" return None\n" +" # Get the logging event sent from a publisher\n" +" event = json.loads(data.decode('utf-8'))\n" +" return logging.makeLogRecord(event)\n" +"\n" +" def enqueue_sentinel(self):\n" +" # Not used in this implementation, as the socket isn't really a\n" +" # queue\n" +" pass\n" +"\n" +"logging.getLogger('pynng').propagate = False\n" +"listener = NNGSocketListener(DEFAULT_ADDR, logging.StreamHandler(), " +"topics=b'')\n" +"listener.start()\n" +"print('Press Ctrl-C to stop.')\n" +"try:\n" +" while True:\n" +" pass\n" +"except KeyboardInterrupt:\n" +" interrupted = True\n" +"finally:\n" +" listener.stop()" +msgstr "" + +msgid "" +"# sender.py\n" +"import json\n" +"import logging\n" +"import logging.handlers\n" +"import time\n" +"import random\n" +"\n" +"import pynng\n" +"\n" +"DEFAULT_ADDR = \"tcp://localhost:13232\"\n" +"\n" +"class NNGSocketHandler(logging.handlers.QueueHandler):\n" +"\n" +" def __init__(self, uri):\n" +" socket = pynng.Pub0(dial=uri, send_timeout=500)\n" +" super().__init__(socket)\n" +"\n" +" def enqueue(self, record):\n" +" # Send the record as UTF-8 encoded JSON\n" +" d = dict(record.__dict__)\n" +" data = json.dumps(d)\n" +" self.queue.send(data.encode('utf-8'))\n" +"\n" +" def close(self):\n" +" self.queue.close()\n" +"\n" +"logging.getLogger('pynng').propagate = False\n" +"handler = NNGSocketHandler(DEFAULT_ADDR)\n" +"# Make sure the process ID is in the output\n" +"logging.basicConfig(level=logging.DEBUG,\n" +" handlers=[logging.StreamHandler(), handler],\n" +" format='%(levelname)-8s %(name)10s %(process)6s " +"%(message)s')\n" +"levels = (logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR,\n" +" logging.CRITICAL)\n" +"logger_names = ('myapp', 'myapp.lib1', 'myapp.lib2')\n" +"msgno = 1\n" +"while True:\n" +" # Just randomly select some loggers and levels and log away\n" +" level = random.choice(levels)\n" +" logger = logging.getLogger(random.choice(logger_names))\n" +" logger.log(level, 'Message no. %5d' % msgno)\n" +" msgno += 1\n" +" delay = random.random() * 2 + 0.5\n" +" time.sleep(delay)" +msgstr "" + +msgid "" +"You can run the above two snippets in separate command shells. If we run the " +"listener in one shell and run the sender in two separate shells, we should " +"see something like the following. In the first sender shell:" +msgstr "" + +msgid "" +"$ python sender.py\n" +"DEBUG myapp 613 Message no. 1\n" +"WARNING myapp.lib2 613 Message no. 2\n" +"CRITICAL myapp.lib2 613 Message no. 3\n" +"WARNING myapp.lib2 613 Message no. 4\n" +"CRITICAL myapp.lib1 613 Message no. 5\n" +"DEBUG myapp 613 Message no. 6\n" +"CRITICAL myapp.lib1 613 Message no. 7\n" +"INFO myapp.lib1 613 Message no. 8\n" +"(and so on)" +msgstr "" + +msgid "In the second sender shell:" +msgstr "" + +msgid "" +"$ python sender.py\n" +"INFO myapp.lib2 657 Message no. 1\n" +"CRITICAL myapp.lib2 657 Message no. 2\n" +"CRITICAL myapp 657 Message no. 3\n" +"CRITICAL myapp.lib1 657 Message no. 4\n" +"INFO myapp.lib1 657 Message no. 5\n" +"WARNING myapp.lib2 657 Message no. 6\n" +"CRITICAL myapp 657 Message no. 7\n" +"DEBUG myapp.lib1 657 Message no. 8\n" +"(and so on)" +msgstr "" + +msgid "In the listener shell:" +msgstr "" + +msgid "" +"$ python listener.py\n" +"Press Ctrl-C to stop.\n" +"DEBUG myapp 613 Message no. 1\n" +"WARNING myapp.lib2 613 Message no. 2\n" +"INFO myapp.lib2 657 Message no. 1\n" +"CRITICAL myapp.lib2 613 Message no. 3\n" +"CRITICAL myapp.lib2 657 Message no. 2\n" +"CRITICAL myapp 657 Message no. 3\n" +"WARNING myapp.lib2 613 Message no. 4\n" +"CRITICAL myapp.lib1 613 Message no. 5\n" +"CRITICAL myapp.lib1 657 Message no. 4\n" +"INFO myapp.lib1 657 Message no. 5\n" +"DEBUG myapp 613 Message no. 6\n" +"WARNING myapp.lib2 657 Message no. 6\n" +"CRITICAL myapp 657 Message no. 7\n" +"CRITICAL myapp.lib1 613 Message no. 7\n" +"INFO myapp.lib1 613 Message no. 8\n" +"DEBUG myapp.lib1 657 Message no. 8\n" +"(and so on)" +msgstr "" + +msgid "" +"As you can see, the logging from the two sender processes is interleaved in " +"the listener's output." +msgstr "" + +msgid "An example dictionary-based configuration" +msgstr "Приклад конфігурації на основі словника" + +msgid "" +"Below is an example of a logging configuration dictionary - it's taken from " +"the `documentation on the Django project `_. This dictionary is passed to :" +"func:`~config.dictConfig` to put the configuration into effect::" +msgstr "" +"Нижче наведено приклад словника конфігурації журналювання — його взято з " +"`документації проекту Django `_. Цей словник передається до :func:" +"`~config.dictConfig` для введення в дію конфігурації::" + +msgid "" +"LOGGING = {\n" +" 'version': 1,\n" +" 'disable_existing_loggers': False,\n" +" 'formatters': {\n" +" 'verbose': {\n" +" 'format': '{levelname} {asctime} {module} {process:d} {thread:d} " +"{message}',\n" +" 'style': '{',\n" +" },\n" +" 'simple': {\n" +" 'format': '{levelname} {message}',\n" +" 'style': '{',\n" +" },\n" +" },\n" +" 'filters': {\n" +" 'special': {\n" +" '()': 'project.logging.SpecialFilter',\n" +" 'foo': 'bar',\n" +" },\n" +" },\n" +" 'handlers': {\n" +" 'console': {\n" +" 'level': 'INFO',\n" +" 'class': 'logging.StreamHandler',\n" +" 'formatter': 'simple',\n" +" },\n" +" 'mail_admins': {\n" +" 'level': 'ERROR',\n" +" 'class': 'django.utils.log.AdminEmailHandler',\n" +" 'filters': ['special']\n" +" }\n" +" },\n" +" 'loggers': {\n" +" 'django': {\n" +" 'handlers': ['console'],\n" +" 'propagate': True,\n" +" },\n" +" 'django.request': {\n" +" 'handlers': ['mail_admins'],\n" +" 'level': 'ERROR',\n" +" 'propagate': False,\n" +" },\n" +" 'myproject.custom': {\n" +" 'handlers': ['console', 'mail_admins'],\n" +" 'level': 'INFO',\n" +" 'filters': ['special']\n" +" }\n" +" }\n" +"}" +msgstr "" + +msgid "" +"For more information about this configuration, you can see the `relevant " +"section `_ of the Django documentation." +msgstr "" +"Для отримання додаткової інформації про цю конфігурацію ви можете " +"переглянути `відповідний розділ `_ документації Django." + +msgid "Using a rotator and namer to customize log rotation processing" +msgstr "" +"Використання ротатора та іменника для налаштування обробки ротації журналу" + +msgid "" +"An example of how you can define a namer and rotator is given in the " +"following runnable script, which shows gzip compression of the log file::" +msgstr "" + +msgid "" +"import gzip\n" +"import logging\n" +"import logging.handlers\n" +"import os\n" +"import shutil\n" +"\n" +"def namer(name):\n" +" return name + \".gz\"\n" +"\n" +"def rotator(source, dest):\n" +" with open(source, 'rb') as f_in:\n" +" with gzip.open(dest, 'wb') as f_out:\n" +" shutil.copyfileobj(f_in, f_out)\n" +" os.remove(source)\n" +"\n" +"\n" +"rh = logging.handlers.RotatingFileHandler('rotated.log', maxBytes=128, " +"backupCount=5)\n" +"rh.rotator = rotator\n" +"rh.namer = namer\n" +"\n" +"root = logging.getLogger()\n" +"root.setLevel(logging.INFO)\n" +"root.addHandler(rh)\n" +"f = logging.Formatter('%(asctime)s %(message)s')\n" +"rh.setFormatter(f)\n" +"for i in range(1000):\n" +" root.info(f'Message no. {i + 1}')" +msgstr "" + +msgid "" +"After running this, you will see six new files, five of which are compressed:" +msgstr "" + +msgid "" +"$ ls rotated.log*\n" +"rotated.log rotated.log.2.gz rotated.log.4.gz\n" +"rotated.log.1.gz rotated.log.3.gz rotated.log.5.gz\n" +"$ zcat rotated.log.1.gz\n" +"2023-01-20 02:28:17,767 Message no. 996\n" +"2023-01-20 02:28:17,767 Message no. 997\n" +"2023-01-20 02:28:17,767 Message no. 998" +msgstr "" + +msgid "A more elaborate multiprocessing example" +msgstr "Більш складний приклад багатопроцесорної обробки" + +msgid "" +"The following working example shows how logging can be used with " +"multiprocessing using configuration files. The configurations are fairly " +"simple, but serve to illustrate how more complex ones could be implemented " +"in a real multiprocessing scenario." +msgstr "" +"Наступний робочий приклад показує, як журналювання можна використовувати з " +"багатопроцесорною обробкою за допомогою файлів конфігурації. Конфігурації " +"досить прості, але служать для ілюстрації того, як більш складні можуть бути " +"реалізовані в реальному багатопроцесорному сценарії." + +msgid "" +"In the example, the main process spawns a listener process and some worker " +"processes. Each of the main process, the listener and the workers have three " +"separate configurations (the workers all share the same configuration). We " +"can see logging in the main process, how the workers log to a QueueHandler " +"and how the listener implements a QueueListener and a more complex logging " +"configuration, and arranges to dispatch events received via the queue to the " +"handlers specified in the configuration. Note that these configurations are " +"purely illustrative, but you should be able to adapt this example to your " +"own scenario." +msgstr "" +"У прикладі головний процес породжує процес слухача та деякі робочі процеси. " +"Кожен із основного процесу, слухача та робочих має три окремі конфігурації " +"(усі робочі мають однакову конфігурацію). Ми можемо побачити реєстрацію в " +"основному процесі, як працівники входять до QueueHandler і як слухач " +"реалізує QueueListener і більш складну конфігурацію журналювання, а також " +"організовує відправку подій, отриманих через чергу, до обробників, указаних " +"у конфігурації. Зауважте, що ці конфігурації є суто ілюстративними, але ви " +"зможете адаптувати цей приклад до власного сценарію." + +msgid "" +"Here's the script - the docstrings and the comments hopefully explain how it " +"works::" +msgstr "" +"Ось сценарій - рядки документації та коментарі, сподіваюся, пояснюють, як це " +"працює::" + +msgid "" +"import logging\n" +"import logging.config\n" +"import logging.handlers\n" +"from multiprocessing import Process, Queue, Event, current_process\n" +"import os\n" +"import random\n" +"import time\n" +"\n" +"class MyHandler:\n" +" \"\"\"\n" +" A simple handler for logging events. It runs in the listener process " +"and\n" +" dispatches events to loggers based on the name in the received record,\n" +" which then get dispatched, by the logging system, to the handlers\n" +" configured for those loggers.\n" +" \"\"\"\n" +"\n" +" def handle(self, record):\n" +" if record.name == \"root\":\n" +" logger = logging.getLogger()\n" +" else:\n" +" logger = logging.getLogger(record.name)\n" +"\n" +" if logger.isEnabledFor(record.levelno):\n" +" # The process name is transformed just to show that it's the " +"listener\n" +" # doing the logging to files and console\n" +" record.processName = '%s (for %s)' % (current_process().name, " +"record.processName)\n" +" logger.handle(record)\n" +"\n" +"def listener_process(q, stop_event, config):\n" +" \"\"\"\n" +" This could be done in the main process, but is just done in a separate\n" +" process for illustrative purposes.\n" +"\n" +" This initialises logging according to the specified configuration,\n" +" starts the listener and waits for the main process to signal completion\n" +" via the event. The listener is then stopped, and the process exits.\n" +" \"\"\"\n" +" logging.config.dictConfig(config)\n" +" listener = logging.handlers.QueueListener(q, MyHandler())\n" +" listener.start()\n" +" if os.name == 'posix':\n" +" # On POSIX, the setup logger will have been configured in the\n" +" # parent process, but should have been disabled following the\n" +" # dictConfig call.\n" +" # On Windows, since fork isn't used, the setup logger won't\n" +" # exist in the child, so it would be created and the message\n" +" # would appear - hence the \"if posix\" clause.\n" +" logger = logging.getLogger('setup')\n" +" logger.critical('Should not appear, because of disabled " +"logger ...')\n" +" stop_event.wait()\n" +" listener.stop()\n" +"\n" +"def worker_process(config):\n" +" \"\"\"\n" +" A number of these are spawned for the purpose of illustration. In\n" +" practice, they could be a heterogeneous bunch of processes rather than\n" +" ones which are identical to each other.\n" +"\n" +" This initialises logging according to the specified configuration,\n" +" and logs a hundred messages with random levels to randomly selected\n" +" loggers.\n" +"\n" +" A small sleep is added to allow other processes a chance to run. This\n" +" is not strictly needed, but it mixes the output from the different\n" +" processes a bit more than if it's left out.\n" +" \"\"\"\n" +" logging.config.dictConfig(config)\n" +" levels = [logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR,\n" +" logging.CRITICAL]\n" +" loggers = ['foo', 'foo.bar', 'foo.bar.baz',\n" +" 'spam', 'spam.ham', 'spam.ham.eggs']\n" +" if os.name == 'posix':\n" +" # On POSIX, the setup logger will have been configured in the\n" +" # parent process, but should have been disabled following the\n" +" # dictConfig call.\n" +" # On Windows, since fork isn't used, the setup logger won't\n" +" # exist in the child, so it would be created and the message\n" +" # would appear - hence the \"if posix\" clause.\n" +" logger = logging.getLogger('setup')\n" +" logger.critical('Should not appear, because of disabled " +"logger ...')\n" +" for i in range(100):\n" +" lvl = random.choice(levels)\n" +" logger = logging.getLogger(random.choice(loggers))\n" +" logger.log(lvl, 'Message no. %d', i)\n" +" time.sleep(0.01)\n" +"\n" +"def main():\n" +" q = Queue()\n" +" # The main process gets a simple configuration which prints to the " +"console.\n" +" config_initial = {\n" +" 'version': 1,\n" +" 'handlers': {\n" +" 'console': {\n" +" 'class': 'logging.StreamHandler',\n" +" 'level': 'INFO'\n" +" }\n" +" },\n" +" 'root': {\n" +" 'handlers': ['console'],\n" +" 'level': 'DEBUG'\n" +" }\n" +" }\n" +" # The worker process configuration is just a QueueHandler attached to " +"the\n" +" # root logger, which allows all messages to be sent to the queue.\n" +" # We disable existing loggers to disable the \"setup\" logger used in " +"the\n" +" # parent process. This is needed on POSIX because the logger will\n" +" # be there in the child following a fork().\n" +" config_worker = {\n" +" 'version': 1,\n" +" 'disable_existing_loggers': True,\n" +" 'handlers': {\n" +" 'queue': {\n" +" 'class': 'logging.handlers.QueueHandler',\n" +" 'queue': q\n" +" }\n" +" },\n" +" 'root': {\n" +" 'handlers': ['queue'],\n" +" 'level': 'DEBUG'\n" +" }\n" +" }\n" +" # The listener process configuration shows that the full flexibility of\n" +" # logging configuration is available to dispatch events to handlers " +"however\n" +" # you want.\n" +" # We disable existing loggers to disable the \"setup\" logger used in " +"the\n" +" # parent process. This is needed on POSIX because the logger will\n" +" # be there in the child following a fork().\n" +" config_listener = {\n" +" 'version': 1,\n" +" 'disable_existing_loggers': True,\n" +" 'formatters': {\n" +" 'detailed': {\n" +" 'class': 'logging.Formatter',\n" +" 'format': '%(asctime)s %(name)-15s %(levelname)-8s " +"%(processName)-10s %(message)s'\n" +" },\n" +" 'simple': {\n" +" 'class': 'logging.Formatter',\n" +" 'format': '%(name)-15s %(levelname)-8s %(processName)-10s " +"%(message)s'\n" +" }\n" +" },\n" +" 'handlers': {\n" +" 'console': {\n" +" 'class': 'logging.StreamHandler',\n" +" 'formatter': 'simple',\n" +" 'level': 'INFO'\n" +" },\n" +" 'file': {\n" +" 'class': 'logging.FileHandler',\n" +" 'filename': 'mplog.log',\n" +" 'mode': 'w',\n" +" 'formatter': 'detailed'\n" +" },\n" +" 'foofile': {\n" +" 'class': 'logging.FileHandler',\n" +" 'filename': 'mplog-foo.log',\n" +" 'mode': 'w',\n" +" 'formatter': 'detailed'\n" +" },\n" +" 'errors': {\n" +" 'class': 'logging.FileHandler',\n" +" 'filename': 'mplog-errors.log',\n" +" 'mode': 'w',\n" +" 'formatter': 'detailed',\n" +" 'level': 'ERROR'\n" +" }\n" +" },\n" +" 'loggers': {\n" +" 'foo': {\n" +" 'handlers': ['foofile']\n" +" }\n" +" },\n" +" 'root': {\n" +" 'handlers': ['console', 'file', 'errors'],\n" +" 'level': 'DEBUG'\n" +" }\n" +" }\n" +" # Log some initial events, just to show that logging in the parent " +"works\n" +" # normally.\n" +" logging.config.dictConfig(config_initial)\n" +" logger = logging.getLogger('setup')\n" +" logger.info('About to create workers ...')\n" +" workers = []\n" +" for i in range(5):\n" +" wp = Process(target=worker_process, name='worker %d' % (i + 1),\n" +" args=(config_worker,))\n" +" workers.append(wp)\n" +" wp.start()\n" +" logger.info('Started worker: %s', wp.name)\n" +" logger.info('About to create listener ...')\n" +" stop_event = Event()\n" +" lp = Process(target=listener_process, name='listener',\n" +" args=(q, stop_event, config_listener))\n" +" lp.start()\n" +" logger.info('Started listener')\n" +" # We now hang around for the workers to finish their work.\n" +" for wp in workers:\n" +" wp.join()\n" +" # Workers all done, listening can now stop.\n" +" # Logging in the parent still works normally.\n" +" logger.info('Telling listener to stop ...')\n" +" stop_event.set()\n" +" lp.join()\n" +" logger.info('All done.')\n" +"\n" +"if __name__ == '__main__':\n" +" main()" +msgstr "" + +msgid "Inserting a BOM into messages sent to a SysLogHandler" +msgstr "Вставлення BOM у повідомлення, надіслані до SysLogHandler" + +msgid "" +":rfc:`5424` requires that a Unicode message be sent to a syslog daemon as a " +"set of bytes which have the following structure: an optional pure-ASCII " +"component, followed by a UTF-8 Byte Order Mark (BOM), followed by Unicode " +"encoded using UTF-8. (See the :rfc:`relevant section of the specification " +"<5424#section-6>`.)" +msgstr "" +":rfc:`5424` вимагає, щоб повідомлення Unicode надсилалося до демона " +"системного журналу як набір байтів із такою структурою: необов’язковий " +"чистий ASCII-компонент, за яким слідує UTF-8 Byte Order Mark (BOM), за яким " +"слідує Юнікод, закодований за допомогою UTF-8. (Див. :rfc:`відповідний " +"розділ специфікації <5424#section-6>`.)" + +msgid "" +"In Python 3.1, code was added to :class:`~logging.handlers.SysLogHandler` to " +"insert a BOM into the message, but unfortunately, it was implemented " +"incorrectly, with the BOM appearing at the beginning of the message and " +"hence not allowing any pure-ASCII component to appear before it." +msgstr "" +"У Python 3.1 до :class:`~logging.handlers.SysLogHandler` було додано код для " +"вставлення BOM у повідомлення, але, на жаль, він був реалізований " +"неправильно, оскільки BOM з’являвся на початку повідомлення, а отже, не " +"дозволяв будь-які компонент pure-ASCII, який з’явиться перед ним." + +msgid "" +"As this behaviour is broken, the incorrect BOM insertion code is being " +"removed from Python 3.2.4 and later. However, it is not being replaced, and " +"if you want to produce :rfc:`5424`-compliant messages which include a BOM, " +"an optional pure-ASCII sequence before it and arbitrary Unicode after it, " +"encoded using UTF-8, then you need to do the following:" +msgstr "" +"Оскільки ця поведінка порушена, неправильний код вставки BOM видаляється з " +"Python 3.2.4 і пізніших версій. Однак його не буде замінено, і якщо ви " +"хочете створювати повідомлення, сумісні з :rfc:`5424`, які включають " +"специфікацію матеріалів, необов’язкову чисту послідовність ASCII перед нею " +"та довільний код Unicode після неї, закодований за допомогою UTF-8, тоді ви " +"потрібно зробити наступне:" + +msgid "" +"Attach a :class:`~logging.Formatter` instance to your :class:`~logging." +"handlers.SysLogHandler` instance, with a format string such as::" +msgstr "" +"Приєднайте екземпляр :class:`~logging.Formatter` до вашого екземпляра :class:" +"`~logging.handlers.SysLogHandler` із рядком форматування, наприклад:" + +msgid "'ASCII section\\ufeffUnicode section'" +msgstr "" + +msgid "" +"The Unicode code point U+FEFF, when encoded using UTF-8, will be encoded as " +"a UTF-8 BOM -- the byte-string ``b'\\xef\\xbb\\xbf'``." +msgstr "" +"Кодова точка Юнікоду U+FEFF, коли вона кодується за допомогою UTF-8, буде " +"закодована як UTF-8 BOM -- рядок байтів ``b'\\xef\\xbb\\xbf``." + +msgid "" +"Replace the ASCII section with whatever placeholders you like, but make sure " +"that the data that appears in there after substitution is always ASCII (that " +"way, it will remain unchanged after UTF-8 encoding)." +msgstr "" +"Замініть розділ ASCII будь-якими заповнювачами, але переконайтеся, що дані, " +"які з’являються в ньому після заміни, завжди мають ASCII (таким чином вони " +"залишаться незмінними після кодування UTF-8)." + +msgid "" +"Replace the Unicode section with whatever placeholders you like; if the data " +"which appears there after substitution contains characters outside the ASCII " +"range, that's fine -- it will be encoded using UTF-8." +msgstr "" +"Замініть розділ Unicode будь-якими заповнювачами; якщо дані, які з’являються " +"там після заміни, містять символи поза діапазоном ASCII, це нормально – вони " +"будуть закодовані за допомогою UTF-8." + +msgid "" +"The formatted message *will* be encoded using UTF-8 encoding by " +"``SysLogHandler``. If you follow the above rules, you should be able to " +"produce :rfc:`5424`-compliant messages. If you don't, logging may not " +"complain, but your messages will not be RFC 5424-compliant, and your syslog " +"daemon may complain." +msgstr "" +"Відформатоване повідомлення *буде* закодовано за допомогою кодування UTF-8 " +"за допомогою ``SysLogHandler``. Якщо ви дотримуєтеся наведених вище правил, " +"ви зможете створювати :rfc:`5424`-сумісні повідомлення. Якщо ви цього не " +"зробите, журналювання може не скаржитися, але ваші повідомлення не будуть " +"сумісними з RFC 5424, і ваш демон системного журналу може скаржитися." + +msgid "Implementing structured logging" +msgstr "Впровадження структурованого журналювання" + +msgid "" +"Although most logging messages are intended for reading by humans, and thus " +"not readily machine-parseable, there might be circumstances where you want " +"to output messages in a structured format which *is* capable of being parsed " +"by a program (without needing complex regular expressions to parse the log " +"message). This is straightforward to achieve using the logging package. " +"There are a number of ways in which this could be achieved, but the " +"following is a simple approach which uses JSON to serialise the event in a " +"machine-parseable manner::" +msgstr "" +"Незважаючи на те, що більшість повідомлень журналу призначені для читання " +"людьми, і тому їх не легко аналізувати машиною, можуть виникнути обставини, " +"коли ви захочете вивести повідомлення у структурованому форматі, який *може* " +"проаналізувати програма (без потреби у складних регулярних виразах). щоб " +"проаналізувати повідомлення журналу). Це легко досягти за допомогою пакета " +"журналювання. Існує кілька способів, за допомогою яких цього можна досягти, " +"але нижче наведено простий підхід, який використовує JSON для серіалізації " +"події машинним способом:" + +msgid "" +"import json\n" +"import logging\n" +"\n" +"class StructuredMessage:\n" +" def __init__(self, message, /, **kwargs):\n" +" self.message = message\n" +" self.kwargs = kwargs\n" +"\n" +" def __str__(self):\n" +" return '%s >>> %s' % (self.message, json.dumps(self.kwargs))\n" +"\n" +"_ = StructuredMessage # optional, to improve readability\n" +"\n" +"logging.basicConfig(level=logging.INFO, format='%(message)s')\n" +"logging.info(_('message 1', foo='bar', bar='baz', num=123, fnum=123.456))" +msgstr "" + +msgid "If the above script is run, it prints:" +msgstr "Якщо наведений вище сценарій запущено, він друкує:" + +msgid "" +"message 1 >>> {\"fnum\": 123.456, \"num\": 123, \"bar\": \"baz\", \"foo\": " +"\"bar\"}" +msgstr "" + +msgid "" +"Note that the order of items might be different according to the version of " +"Python used." +msgstr "" +"Зауважте, що порядок елементів може відрізнятися залежно від версії Python, " +"що використовується." + +msgid "" +"If you need more specialised processing, you can use a custom JSON encoder, " +"as in the following complete example::" +msgstr "" +"Якщо вам потрібна більш спеціалізована обробка, ви можете використовувати " +"спеціальний кодер JSON, як у наступному повному прикладі:" + +msgid "" +"import json\n" +"import logging\n" +"\n" +"\n" +"class Encoder(json.JSONEncoder):\n" +" def default(self, o):\n" +" if isinstance(o, set):\n" +" return tuple(o)\n" +" elif isinstance(o, str):\n" +" return o.encode('unicode_escape').decode('ascii')\n" +" return super().default(o)\n" +"\n" +"class StructuredMessage:\n" +" def __init__(self, message, /, **kwargs):\n" +" self.message = message\n" +" self.kwargs = kwargs\n" +"\n" +" def __str__(self):\n" +" s = Encoder().encode(self.kwargs)\n" +" return '%s >>> %s' % (self.message, s)\n" +"\n" +"_ = StructuredMessage # optional, to improve readability\n" +"\n" +"def main():\n" +" logging.basicConfig(level=logging.INFO, format='%(message)s')\n" +" logging.info(_('message 1', set_value={1, 2, 3}, snowman='\\u2603'))\n" +"\n" +"if __name__ == '__main__':\n" +" main()" +msgstr "" + +msgid "When the above script is run, it prints:" +msgstr "Коли наведений вище сценарій виконується, він друкує:" + +msgid "message 1 >>> {\"snowman\": \"\\u2603\", \"set_value\": [1, 2, 3]}" +msgstr "" + +msgid "Customizing handlers with :func:`dictConfig`" +msgstr "Налаштування обробників за допомогою :func:`dictConfig`" + +msgid "" +"There are times when you want to customize logging handlers in particular " +"ways, and if you use :func:`dictConfig` you may be able to do this without " +"subclassing. As an example, consider that you may want to set the ownership " +"of a log file. On POSIX, this is easily done using :func:`shutil.chown`, but " +"the file handlers in the stdlib don't offer built-in support. You can " +"customize handler creation using a plain function such as::" +msgstr "" +"Бувають випадки, коли ви хочете налаштувати обробники журналу певним чином, " +"і якщо ви використовуєте :func:`dictConfig`, ви можете зробити це без " +"підкласів. Як приклад, подумайте, що ви можете встановити право власності на " +"файл журналу. У POSIX це легко зробити за допомогою :func:`shutil.chown`, " +"але обробники файлів у stdlib не пропонують вбудованої підтримки. Ви можете " +"налаштувати створення обробника за допомогою простої функції, такої як:" + +msgid "" +"def owned_file_handler(filename, mode='a', encoding=None, owner=None):\n" +" if owner:\n" +" if not os.path.exists(filename):\n" +" open(filename, 'a').close()\n" +" shutil.chown(filename, *owner)\n" +" return logging.FileHandler(filename, mode, encoding)" +msgstr "" + +msgid "" +"You can then specify, in a logging configuration passed to :func:" +"`dictConfig`, that a logging handler be created by calling this function::" +msgstr "" +"Потім ви можете вказати в конфігурації журналювання, переданій у :func:" +"`dictConfig`, щоб обробник журналювання було створено шляхом виклику цієї " +"функції::" + +msgid "" +"LOGGING = {\n" +" 'version': 1,\n" +" 'disable_existing_loggers': False,\n" +" 'formatters': {\n" +" 'default': {\n" +" 'format': '%(asctime)s %(levelname)s %(name)s %(message)s'\n" +" },\n" +" },\n" +" 'handlers': {\n" +" 'file':{\n" +" # The values below are popped from this dictionary and\n" +" # used to create the handler, set the handler's level and\n" +" # its formatter.\n" +" '()': owned_file_handler,\n" +" 'level':'DEBUG',\n" +" 'formatter': 'default',\n" +" # The values below are passed to the handler creator callable\n" +" # as keyword arguments.\n" +" 'owner': ['pulse', 'pulse'],\n" +" 'filename': 'chowntest.log',\n" +" 'mode': 'w',\n" +" 'encoding': 'utf-8',\n" +" },\n" +" },\n" +" 'root': {\n" +" 'handlers': ['file'],\n" +" 'level': 'DEBUG',\n" +" },\n" +"}" +msgstr "" + +msgid "" +"In this example I am setting the ownership using the ``pulse`` user and " +"group, just for the purposes of illustration. Putting it together into a " +"working script, ``chowntest.py``::" +msgstr "" +"У цьому прикладі я встановлюю право власності за допомогою користувача та " +"групи ``pulse`` лише для ілюстрації. Об’єднавши це в робочий сценарій, " +"``chowntest.py``::" + +msgid "" +"import logging, logging.config, os, shutil\n" +"\n" +"def owned_file_handler(filename, mode='a', encoding=None, owner=None):\n" +" if owner:\n" +" if not os.path.exists(filename):\n" +" open(filename, 'a').close()\n" +" shutil.chown(filename, *owner)\n" +" return logging.FileHandler(filename, mode, encoding)\n" +"\n" +"LOGGING = {\n" +" 'version': 1,\n" +" 'disable_existing_loggers': False,\n" +" 'formatters': {\n" +" 'default': {\n" +" 'format': '%(asctime)s %(levelname)s %(name)s %(message)s'\n" +" },\n" +" },\n" +" 'handlers': {\n" +" 'file':{\n" +" # The values below are popped from this dictionary and\n" +" # used to create the handler, set the handler's level and\n" +" # its formatter.\n" +" '()': owned_file_handler,\n" +" 'level':'DEBUG',\n" +" 'formatter': 'default',\n" +" # The values below are passed to the handler creator callable\n" +" # as keyword arguments.\n" +" 'owner': ['pulse', 'pulse'],\n" +" 'filename': 'chowntest.log',\n" +" 'mode': 'w',\n" +" 'encoding': 'utf-8',\n" +" },\n" +" },\n" +" 'root': {\n" +" 'handlers': ['file'],\n" +" 'level': 'DEBUG',\n" +" },\n" +"}\n" +"\n" +"logging.config.dictConfig(LOGGING)\n" +"logger = logging.getLogger('mylogger')\n" +"logger.debug('A debug message')" +msgstr "" + +msgid "To run this, you will probably need to run as ``root``:" +msgstr "Щоб запустити це, вам, ймовірно, потрібно буде запустити як ``root``:" + +msgid "" +"$ sudo python3.3 chowntest.py\n" +"$ cat chowntest.log\n" +"2013-11-05 09:34:51,128 DEBUG mylogger A debug message\n" +"$ ls -l chowntest.log\n" +"-rw-r--r-- 1 pulse pulse 55 2013-11-05 09:34 chowntest.log" +msgstr "" + +msgid "" +"Note that this example uses Python 3.3 because that's where :func:`shutil." +"chown` makes an appearance. This approach should work with any Python " +"version that supports :func:`dictConfig` - namely, Python 2.7, 3.2 or later. " +"With pre-3.3 versions, you would need to implement the actual ownership " +"change using e.g. :func:`os.chown`." +msgstr "" +"Зверніть увагу, що в цьому прикладі використовується Python 3.3, тому що " +"саме там з’являється :func:`shutil.chown`. Цей підхід має працювати з будь-" +"якою версією Python, яка підтримує :func:`dictConfig`, а саме з Python 2.7, " +"3.2 або новішою. У версіях до 3.3 вам потрібно було б реалізувати фактичну " +"зміну власності, використовуючи, наприклад, :func:`os.chown`." + +msgid "" +"In practice, the handler-creating function may be in a utility module " +"somewhere in your project. Instead of the line in the configuration::" +msgstr "" +"На практиці функція створення обробника може бути десь у службовому модулі " +"вашого проекту. Замість рядка в конфігурації::" + +msgid "'()': owned_file_handler," +msgstr "" + +msgid "you could use e.g.::" +msgstr "ви можете використовувати, наприклад::" + +msgid "'()': 'ext://project.util.owned_file_handler'," +msgstr "" + +msgid "" +"where ``project.util`` can be replaced with the actual name of the package " +"where the function resides. In the above working script, using ``'ext://" +"__main__.owned_file_handler'`` should work. Here, the actual callable is " +"resolved by :func:`dictConfig` from the ``ext://`` specification." +msgstr "" +"де ``project.util`` можна замінити фактичною назвою пакета, де знаходиться " +"функція. У наведеному вище робочому сценарії використання ``'ext://__main__." +"owned_file_handler`` має працювати. Тут фактичний виклик визначається за " +"допомогою :func:`dictConfig` із специфікації ``ext://``." + +msgid "" +"This example hopefully also points the way to how you could implement other " +"types of file change - e.g. setting specific POSIX permission bits - in the " +"same way, using :func:`os.chmod`." +msgstr "" +"Сподіваємось, цей приклад також вказує шлях до того, як ви можете " +"реалізувати інші типи змін файлів - наприклад. встановлення певних бітів " +"дозволу POSIX - таким же чином, за допомогою :func:`os.chmod`." + +msgid "" +"Of course, the approach could also be extended to types of handler other " +"than a :class:`~logging.FileHandler` - for example, one of the rotating file " +"handlers, or a different type of handler altogether." +msgstr "" +"Звичайно, цей підхід також можна розширити до типів обробників, відмінних " +"від :class:`~logging.FileHandler` - наприклад, одного з обробників файлів, " +"що обертаються, або зовсім іншого типу обробника." + +msgid "Using particular formatting styles throughout your application" +msgstr "Використання певних стилів форматування у вашій програмі" + +msgid "" +"In Python 3.2, the :class:`~logging.Formatter` gained a ``style`` keyword " +"parameter which, while defaulting to ``%`` for backward compatibility, " +"allowed the specification of ``{`` or ``$`` to support the formatting " +"approaches supported by :meth:`str.format` and :class:`string.Template`. " +"Note that this governs the formatting of logging messages for final output " +"to logs, and is completely orthogonal to how an individual logging message " +"is constructed." +msgstr "" +"У Python 3.2 :class:`~logging.Formatter` отримав параметр ключового слова " +"``style``, який, незважаючи на значення за умовчанням ``%`` для зворотної " +"сумісності, дозволяв специфікацію ``{`` або ``$`` для підтримки підходів до " +"форматування, які підтримуються :meth:`str.format` і :class:`string." +"Template`. Зауважте, що це керує форматуванням повідомлень журналу для " +"остаточного виведення в журнали та повністю ортогонально до того, як " +"будується окреме повідомлення журналу." + +msgid "" +"Logging calls (:meth:`~Logger.debug`, :meth:`~Logger.info` etc.) only take " +"positional parameters for the actual logging message itself, with keyword " +"parameters used only for determining options for how to handle the logging " +"call (e.g. the ``exc_info`` keyword parameter to indicate that traceback " +"information should be logged, or the ``extra`` keyword parameter to indicate " +"additional contextual information to be added to the log). So you cannot " +"directly make logging calls using :meth:`str.format` or :class:`string." +"Template` syntax, because internally the logging package uses %-formatting " +"to merge the format string and the variable arguments. There would be no " +"changing this while preserving backward compatibility, since all logging " +"calls which are out there in existing code will be using %-format strings." +msgstr "" + +msgid "" +"There have been suggestions to associate format styles with specific " +"loggers, but that approach also runs into backward compatibility problems " +"because any existing code could be using a given logger name and using %-" +"formatting." +msgstr "" +"Були пропозиції пов’язати стилі формату з певними реєстраторами, але такий " +"підхід також стикається з проблемами зворотної сумісності, оскільки будь-" +"який існуючий код може використовувати дане ім’я реєстратора та " +"використовувати %-formatting." + +msgid "" +"For logging to work interoperably between any third-party libraries and your " +"code, decisions about formatting need to be made at the level of the " +"individual logging call. This opens up a couple of ways in which alternative " +"formatting styles can be accommodated." +msgstr "" +"Щоб журналювання працювало сумісно між будь-якими сторонніми бібліотеками та " +"вашим кодом, рішення щодо форматування потрібно приймати на рівні окремого " +"виклику журналювання. Це відкриває кілька способів використання " +"альтернативних стилів форматування." + +msgid "Using LogRecord factories" +msgstr "Використання фабрик LogRecord" + +msgid "" +"In Python 3.2, along with the :class:`~logging.Formatter` changes mentioned " +"above, the logging package gained the ability to allow users to set their " +"own :class:`LogRecord` subclasses, using the :func:`setLogRecordFactory` " +"function. You can use this to set your own subclass of :class:`LogRecord`, " +"which does the Right Thing by overriding the :meth:`~LogRecord.getMessage` " +"method. The base class implementation of this method is where the ``msg % " +"args`` formatting happens, and where you can substitute your alternate " +"formatting; however, you should be careful to support all formatting styles " +"and allow %-formatting as the default, to ensure interoperability with other " +"code. Care should also be taken to call ``str(self.msg)``, just as the base " +"implementation does." +msgstr "" +"У Python 3.2 разом зі змінами :class:`~logging.Formatter`, згаданими вище, " +"пакет журналювання отримав можливість дозволяти користувачам встановлювати " +"власні підкласи :class:`LogRecord` за допомогою функції :func:" +"`setLogRecordFactory` . Ви можете використовувати це, щоб установити власний " +"підклас :class:`LogRecord`, який робить правильні речі, замінюючи метод :" +"meth:`~LogRecord.getMessage`. Реалізація базового класу цього методу є " +"місцем, де відбувається форматування ``msg % args``, і де ви можете замінити " +"своє альтернативне форматування; однак ви повинні бути обережними, щоб " +"підтримувати всі стилі форматування та дозволити %-formatting як типовий, " +"щоб забезпечити взаємодію з іншим кодом. Слід також подбати про те, щоб " +"викликати ``str(self.msg)``, як це робить базова реалізація." + +msgid "" +"Refer to the reference documentation on :func:`setLogRecordFactory` and :" +"class:`LogRecord` for more information." +msgstr "" +"Зверніться до довідкової документації щодо :func:`setLogRecordFactory` і :" +"class:`LogRecord` для отримання додаткової інформації." + +msgid "Using custom message objects" +msgstr "Використання настроюваних об’єктів повідомлення" + +msgid "" +"There is another, perhaps simpler way that you can use {}- and $- formatting " +"to construct your individual log messages. You may recall (from :ref:" +"`arbitrary-object-messages`) that when logging you can use an arbitrary " +"object as a message format string, and that the logging package will call :" +"func:`str` on that object to get the actual format string. Consider the " +"following two classes::" +msgstr "" +"Існує інший, можливо, простіший спосіб використання форматування {}- і $- " +"для створення індивідуальних повідомлень журналу. Ви можете пам’ятати (з :" +"ref:`arbitrary-object-messages`), що під час журналювання ви можете " +"використовувати довільний об’єкт як рядок формату повідомлення, і що пакет " +"журналювання викличе :func:`str` для цього об’єкта, щоб отримати рядок " +"фактичного формату. Розглянемо наступні два класи:" + +msgid "" +"Either of these can be used in place of a format string, to allow {}- or $-" +"formatting to be used to build the actual \"message\" part which appears in " +"the formatted log output in place of “%(message)s” or “{message}” or " +"“$message”. If you find it a little unwieldy to use the class names whenever " +"you want to log something, you can make it more palatable if you use an " +"alias such as ``M`` or ``_`` for the message (or perhaps ``__``, if you are " +"using ``_`` for localization)." +msgstr "" +"Будь-яке з них можна використовувати замість рядка формату, щоб дозволити " +"використовувати {}- або $-форматування для створення фактичної частини " +"\"повідомлення\", яка з’являється у відформатованому журналі замість " +"\"%(message)s\" або \"{message\". }\" або \"$message\". Якщо вам здається " +"трохи громіздким використовувати імена класів, коли ви хочете щось " +"зареєструвати, ви можете зробити це більш приємним, якщо використаєте " +"псевдонім, наприклад ``M`` або ``_`` для повідомлення (або, можливо ``__``, " +"якщо ви використовуєте ``_`` для локалізації)." + +msgid "" +"Examples of this approach are given below. Firstly, formatting with :meth:" +"`str.format`::" +msgstr "" +"Приклади цього підходу наведені нижче. По-перше, форматування за допомогою :" +"meth:`str.format`::" + +msgid "" +">>> __ = BraceMessage\n" +">>> print(__('Message with {0} {1}', 2, 'placeholders'))\n" +"Message with 2 placeholders\n" +">>> class Point: pass\n" +"...\n" +">>> p = Point()\n" +">>> p.x = 0.5\n" +">>> p.y = 0.5\n" +">>> print(__('Message with coordinates: ({point.x:.2f}, {point.y:.2f})', " +"point=p))\n" +"Message with coordinates: (0.50, 0.50)" +msgstr "" + +msgid "Secondly, formatting with :class:`string.Template`::" +msgstr "По-друге, форматування за допомогою :class:`string.Template`::" + +msgid "" +">>> __ = DollarMessage\n" +">>> print(__('Message with $num $what', num=2, what='placeholders'))\n" +"Message with 2 placeholders\n" +">>>" +msgstr "" + +msgid "" +"One thing to note is that you pay no significant performance penalty with " +"this approach: the actual formatting happens not when you make the logging " +"call, but when (and if) the logged message is actually about to be output to " +"a log by a handler. So the only slightly unusual thing which might trip you " +"up is that the parentheses go around the format string and the arguments, " +"not just the format string. That’s because the __ notation is just syntax " +"sugar for a constructor call to one of the :samp:`{XXX}Message` classes " +"shown above." +msgstr "" + +msgid "Configuring filters with :func:`dictConfig`" +msgstr "Налаштування фільтрів за допомогою :func:`dictConfig`" + +msgid "" +"You *can* configure filters using :func:`~logging.config.dictConfig`, though " +"it might not be obvious at first glance how to do it (hence this recipe). " +"Since :class:`~logging.Filter` is the only filter class included in the " +"standard library, and it is unlikely to cater to many requirements (it's " +"only there as a base class), you will typically need to define your own :" +"class:`~logging.Filter` subclass with an overridden :meth:`~logging.Filter." +"filter` method. To do this, specify the ``()`` key in the configuration " +"dictionary for the filter, specifying a callable which will be used to " +"create the filter (a class is the most obvious, but you can provide any " +"callable which returns a :class:`~logging.Filter` instance). Here is a " +"complete example::" +msgstr "" +"Ви *можете* налаштувати фільтри за допомогою :func:`~logging.config." +"dictConfig`, хоча на перший погляд може бути неочевидно, як це зробити (тому " +"цей рецепт). Оскільки :class:`~logging.Filter` є єдиним класом фільтра, " +"включеним у стандартну бібліотеку, і він навряд чи задовольнить багато вимог " +"(він існує лише як базовий клас), вам зазвичай потрібно буде визначити свій " +"власний Підклас :class:`~logging.Filter` із перевизначеним методом :meth:" +"`~logging.Filter.filter`. Для цього вкажіть ключ ``()`` у словнику " +"конфігурації для фільтра, вказавши виклик, який буде використовуватися для " +"створення фільтра (клас є найбільш очевидним, але ви можете надати будь-який " +"виклик, який повертає :class:`~logging.Filter` екземпляр). Ось повний " +"приклад::" + +msgid "" +"import logging\n" +"import logging.config\n" +"import sys\n" +"\n" +"class MyFilter(logging.Filter):\n" +" def __init__(self, param=None):\n" +" self.param = param\n" +"\n" +" def filter(self, record):\n" +" if self.param is None:\n" +" allow = True\n" +" else:\n" +" allow = self.param not in record.msg\n" +" if allow:\n" +" record.msg = 'changed: ' + record.msg\n" +" return allow\n" +"\n" +"LOGGING = {\n" +" 'version': 1,\n" +" 'filters': {\n" +" 'myfilter': {\n" +" '()': MyFilter,\n" +" 'param': 'noshow',\n" +" }\n" +" },\n" +" 'handlers': {\n" +" 'console': {\n" +" 'class': 'logging.StreamHandler',\n" +" 'filters': ['myfilter']\n" +" }\n" +" },\n" +" 'root': {\n" +" 'level': 'DEBUG',\n" +" 'handlers': ['console']\n" +" },\n" +"}\n" +"\n" +"if __name__ == '__main__':\n" +" logging.config.dictConfig(LOGGING)\n" +" logging.debug('hello')\n" +" logging.debug('hello - noshow')" +msgstr "" + +msgid "" +"This example shows how you can pass configuration data to the callable which " +"constructs the instance, in the form of keyword parameters. When run, the " +"above script will print:" +msgstr "" +"У цьому прикладі показано, як ви можете передати дані конфігурації " +"викликаному, який створює екземпляр, у формі параметрів ключових слів. Під " +"час запуску наведений вище сценарій надрукує:" + +msgid "changed: hello" +msgstr "" + +msgid "which shows that the filter is working as configured." +msgstr "який показує, що фільтр працює, як налаштовано." + +msgid "A couple of extra points to note:" +msgstr "Кілька додаткових моментів, на які варто звернути увагу:" + +msgid "" +"If you can't refer to the callable directly in the configuration (e.g. if it " +"lives in a different module, and you can't import it directly where the " +"configuration dictionary is), you can use the form ``ext://...`` as " +"described in :ref:`logging-config-dict-externalobj`. For example, you could " +"have used the text ``'ext://__main__.MyFilter'`` instead of ``MyFilter`` in " +"the above example." +msgstr "" +"Якщо ви не можете звернутися до викликаного безпосередньо в конфігурації " +"(наприклад, якщо він живе в іншому модулі, і ви не можете імпортувати його " +"безпосередньо туди, де знаходиться словник конфігурації), ви можете " +"використовувати форму ``ext://. ..``, як описано в :ref:`logging-config-dict-" +"externalobj`. Наприклад, у наведеному вище прикладі ви могли використати " +"текст ``'ext://__main__.MyFilter`` замість ``MyFilter``." + +msgid "" +"As well as for filters, this technique can also be used to configure custom " +"handlers and formatters. See :ref:`logging-config-dict-userdef` for more " +"information on how logging supports using user-defined objects in its " +"configuration, and see the other cookbook recipe :ref:`custom-handlers` " +"above." +msgstr "" +"Як і для фільтрів, цю техніку також можна використовувати для налаштування " +"нестандартних обробників і форматувальників. Перегляньте :ref:`logging-" +"config-dict-userdef`, щоб дізнатися більше про те, як ведення журналу " +"підтримує використання визначених користувачем об’єктів у своїй " +"конфігурації, і перегляньте інший рецепт кулінарної книги :ref:`custom-" +"handlers` вище." + +msgid "Customized exception formatting" +msgstr "Індивідуальне форматування винятків" + +msgid "" +"There might be times when you want to do customized exception formatting - " +"for argument's sake, let's say you want exactly one line per logged event, " +"even when exception information is present. You can do this with a custom " +"formatter class, as shown in the following example::" +msgstr "" +"Можуть бути випадки, коли ви захочете зробити налаштоване форматування " +"винятків - заради аргументу, припустімо, що вам потрібен рівно один рядок на " +"зареєстровану подію, навіть якщо присутня інформація про винятки. Ви можете " +"зробити це за допомогою спеціального класу форматера, як показано в " +"наступному прикладі:" + +msgid "" +"import logging\n" +"\n" +"class OneLineExceptionFormatter(logging.Formatter):\n" +" def formatException(self, exc_info):\n" +" \"\"\"\n" +" Format an exception so that it prints on a single line.\n" +" \"\"\"\n" +" result = super().formatException(exc_info)\n" +" return repr(result) # or format into one line however you want to\n" +"\n" +" def format(self, record):\n" +" s = super().format(record)\n" +" if record.exc_text:\n" +" s = s.replace('\\n', '') + '|'\n" +" return s\n" +"\n" +"def configure_logging():\n" +" fh = logging.FileHandler('output.txt', 'w')\n" +" f = OneLineExceptionFormatter('%(asctime)s|%(levelname)s|%(message)s|',\n" +" '%d/%m/%Y %H:%M:%S')\n" +" fh.setFormatter(f)\n" +" root = logging.getLogger()\n" +" root.setLevel(logging.DEBUG)\n" +" root.addHandler(fh)\n" +"\n" +"def main():\n" +" configure_logging()\n" +" logging.info('Sample message')\n" +" try:\n" +" x = 1 / 0\n" +" except ZeroDivisionError as e:\n" +" logging.exception('ZeroDivisionError: %s', e)\n" +"\n" +"if __name__ == '__main__':\n" +" main()" +msgstr "" + +msgid "When run, this produces a file with exactly two lines:" +msgstr "Під час запуску створюється файл із рівно двома рядками:" + +msgid "" +"28/01/2015 07:21:23|INFO|Sample message|\n" +"28/01/2015 07:21:23|ERROR|ZeroDivisionError: integer division or modulo by " +"zero|'Traceback (most recent call last):\\n File \"logtest7.py\", line 30, " +"in main\\n x = 1 / 0\\nZeroDivisionError: integer division or modulo by " +"zero'|" +msgstr "" + +msgid "" +"While the above treatment is simplistic, it points the way to how exception " +"information can be formatted to your liking. The :mod:`traceback` module may " +"be helpful for more specialized needs." +msgstr "" +"Хоча описане вище лікування є спрощеним, воно вказує шлях до того, як " +"інформацію про винятки можна відформатувати на свій смак. Модуль :mod:" +"`traceback` може бути корисним для більш спеціалізованих потреб." + +msgid "Speaking logging messages" +msgstr "Озвучення повідомлень журналу" + +msgid "" +"There might be situations when it is desirable to have logging messages " +"rendered in an audible rather than a visible format. This is easy to do if " +"you have text-to-speech (TTS) functionality available in your system, even " +"if it doesn't have a Python binding. Most TTS systems have a command line " +"program you can run, and this can be invoked from a handler using :mod:" +"`subprocess`. It's assumed here that TTS command line programs won't expect " +"to interact with users or take a long time to complete, and that the " +"frequency of logged messages will be not so high as to swamp the user with " +"messages, and that it's acceptable to have the messages spoken one at a time " +"rather than concurrently, The example implementation below waits for one " +"message to be spoken before the next is processed, and this might cause " +"other handlers to be kept waiting. Here is a short example showing the " +"approach, which assumes that the ``espeak`` TTS package is available::" +msgstr "" +"Можуть бути ситуації, коли бажано, щоб повідомлення журналу відтворювалися в " +"звуковому, а не у видимому форматі. Це легко зробити, якщо у вашій системі " +"доступна функція перетворення тексту в мову (TTS), навіть якщо вона не має " +"прив’язки Python. Більшість систем TTS мають програму командного рядка, яку " +"можна запустити, і її можна викликати з обробника за допомогою :mod:" +"`subprocess`. Тут передбачається, що програми командного рядка TTS не будуть " +"взаємодіяти з користувачами або займати багато часу для виконання, і що " +"частота зареєстрованих повідомлень не буде настільки високою, щоб завалювати " +"користувача повідомленнями, і що прийнятно мати повідомлення промовляються " +"по одному, а не одночасно. Приклад реалізації нижче очікує, поки одне " +"повідомлення буде озвучено перед обробкою наступного, і це може спричинити " +"очікування інших обробників. Ось короткий приклад, який демонструє підхід, " +"який передбачає наявність пакета TTS ``espeak``::" + +msgid "" +"import logging\n" +"import subprocess\n" +"import sys\n" +"\n" +"class TTSHandler(logging.Handler):\n" +" def emit(self, record):\n" +" msg = self.format(record)\n" +" # Speak slowly in a female English voice\n" +" cmd = ['espeak', '-s150', '-ven+f3', msg]\n" +" p = subprocess.Popen(cmd, stdout=subprocess.PIPE,\n" +" stderr=subprocess.STDOUT)\n" +" # wait for the program to finish\n" +" p.communicate()\n" +"\n" +"def configure_logging():\n" +" h = TTSHandler()\n" +" root = logging.getLogger()\n" +" root.addHandler(h)\n" +" # the default formatter just returns the message\n" +" root.setLevel(logging.DEBUG)\n" +"\n" +"def main():\n" +" logging.info('Hello')\n" +" logging.debug('Goodbye')\n" +"\n" +"if __name__ == '__main__':\n" +" configure_logging()\n" +" sys.exit(main())" +msgstr "" + +msgid "" +"When run, this script should say \"Hello\" and then \"Goodbye\" in a female " +"voice." +msgstr "" +"Під час запуску цей скрипт має сказати \"Привіт\", а потім \"До побачення\" " +"жіночим голосом." + +msgid "" +"The above approach can, of course, be adapted to other TTS systems and even " +"other systems altogether which can process messages via external programs " +"run from a command line." +msgstr "" +"Наведений вище підхід, звичайно, можна адаптувати до інших систем TTS і " +"навіть до інших систем взагалі, які можуть обробляти повідомлення через " +"зовнішні програми, що запускаються з командного рядка." + +msgid "Buffering logging messages and outputting them conditionally" +msgstr "Буферизація повідомлень журналу та їх умовне виведення" + +msgid "" +"There might be situations where you want to log messages in a temporary area " +"and only output them if a certain condition occurs. For example, you may " +"want to start logging debug events in a function, and if the function " +"completes without errors, you don't want to clutter the log with the " +"collected debug information, but if there is an error, you want all the " +"debug information to be output as well as the error." +msgstr "" +"Можуть виникнути ситуації, коли потрібно реєструвати повідомлення у " +"тимчасовій області та виводити їх лише у разі виникнення певної умови. " +"Наприклад, ви можете почати реєструвати події налагодження у функції, і якщо " +"функція завершиться без помилок, ви не хочете захаращувати журнал зібраною " +"інформацією про налагодження, але якщо є помилка, ви хочете, щоб усі " +"налагодження інформацію, яку потрібно вивести, а також помилку." + +msgid "" +"Here is an example which shows how you could do this using a decorator for " +"your functions where you want logging to behave this way. It makes use of " +"the :class:`logging.handlers.MemoryHandler`, which allows buffering of " +"logged events until some condition occurs, at which point the buffered " +"events are ``flushed`` - passed to another handler (the ``target`` handler) " +"for processing. By default, the ``MemoryHandler`` flushed when its buffer " +"gets filled up or an event whose level is greater than or equal to a " +"specified threshold is seen. You can use this recipe with a more specialised " +"subclass of ``MemoryHandler`` if you want custom flushing behavior." +msgstr "" +"Ось приклад, який показує, як ви можете зробити це за допомогою декоратора " +"для ваших функцій, де ви хочете, щоб журналювання поводилося таким чином. " +"Він використовує :class:`logging.handlers.MemoryHandler`, який дозволяє " +"буферизувати зареєстровані події, доки не відбудеться певна умова, після " +"чого буферизовані події ``скидаються`` і передаються іншому обробнику " +"(``ціль`` обробник) для обробки. За замовчуванням ``MemoryHandler`` " +"очищується, коли його буфер заповнюється або спостерігається подія, рівень " +"якої перевищує або дорівнює вказаному порогу. Ви можете використовувати цей " +"рецепт із більш спеціалізованим підкласом ``MemoryHandler``, якщо вам " +"потрібна спеціальна поведінка очищення." + +msgid "" +"The example script has a simple function, ``foo``, which just cycles through " +"all the logging levels, writing to ``sys.stderr`` to say what level it's " +"about to log at, and then actually logging a message at that level. You can " +"pass a parameter to ``foo`` which, if true, will log at ERROR and CRITICAL " +"levels - otherwise, it only logs at DEBUG, INFO and WARNING levels." +msgstr "" +"Приклад сценарію має просту функцію, ``foo``, яка просто циклічно перебирає " +"всі рівні журналювання, записуючи в ``sys.stderr``, щоб сказати, на якому " +"рівні він збирається зареєструватися, а потім фактично записує повідомлення " +"на цьому рівень. Ви можете передати параметр у ``foo``, який, якщо істина, " +"буде реєструватися на рівнях ПОМИЛКА та КРИТИЧНИЙ - інакше він реєструватиме " +"лише на рівнях НАЛАШТУВАННЯ, ІНФОРМАЦІЇ та ПОПЕРЕДЖЕННЯ." + +msgid "" +"The script just arranges to decorate ``foo`` with a decorator which will do " +"the conditional logging that's required. The decorator takes a logger as a " +"parameter and attaches a memory handler for the duration of the call to the " +"decorated function. The decorator can be additionally parameterised using a " +"target handler, a level at which flushing should occur, and a capacity for " +"the buffer (number of records buffered). These default to a :class:`~logging." +"StreamHandler` which writes to ``sys.stderr``, ``logging.ERROR`` and ``100`` " +"respectively." +msgstr "" +"Сценарій лише організовує декорування ``foo`` за допомогою декоратора, який " +"виконуватиме необхідне умовне журналювання. Декоратор приймає реєстратор як " +"параметр і приєднує обробник пам’яті на час виклику декорованої функції. " +"Декоратор може бути додатково параметризований за допомогою цільового " +"обробника, рівня, на якому має відбуватися очищення, і ємності для буфера " +"(кількість записів, буферизованих). За умовчанням це :class:`~logging." +"StreamHandler`, який записує в ``sys.stderr``, ``logging.ERROR`` і ``100`` " +"відповідно." + +msgid "Here's the script::" +msgstr "Ось сценарій::" + +msgid "" +"import logging\n" +"from logging.handlers import MemoryHandler\n" +"import sys\n" +"\n" +"logger = logging.getLogger(__name__)\n" +"logger.addHandler(logging.NullHandler())\n" +"\n" +"def log_if_errors(logger, target_handler=None, flush_level=None, " +"capacity=None):\n" +" if target_handler is None:\n" +" target_handler = logging.StreamHandler()\n" +" if flush_level is None:\n" +" flush_level = logging.ERROR\n" +" if capacity is None:\n" +" capacity = 100\n" +" handler = MemoryHandler(capacity, flushLevel=flush_level, " +"target=target_handler)\n" +"\n" +" def decorator(fn):\n" +" def wrapper(*args, **kwargs):\n" +" logger.addHandler(handler)\n" +" try:\n" +" return fn(*args, **kwargs)\n" +" except Exception:\n" +" logger.exception('call failed')\n" +" raise\n" +" finally:\n" +" super(MemoryHandler, handler).flush()\n" +" logger.removeHandler(handler)\n" +" return wrapper\n" +"\n" +" return decorator\n" +"\n" +"def write_line(s):\n" +" sys.stderr.write('%s\\n' % s)\n" +"\n" +"def foo(fail=False):\n" +" write_line('about to log at DEBUG ...')\n" +" logger.debug('Actually logged at DEBUG')\n" +" write_line('about to log at INFO ...')\n" +" logger.info('Actually logged at INFO')\n" +" write_line('about to log at WARNING ...')\n" +" logger.warning('Actually logged at WARNING')\n" +" if fail:\n" +" write_line('about to log at ERROR ...')\n" +" logger.error('Actually logged at ERROR')\n" +" write_line('about to log at CRITICAL ...')\n" +" logger.critical('Actually logged at CRITICAL')\n" +" return fail\n" +"\n" +"decorated_foo = log_if_errors(logger)(foo)\n" +"\n" +"if __name__ == '__main__':\n" +" logger.setLevel(logging.DEBUG)\n" +" write_line('Calling undecorated foo with False')\n" +" assert not foo(False)\n" +" write_line('Calling undecorated foo with True')\n" +" assert foo(True)\n" +" write_line('Calling decorated foo with False')\n" +" assert not decorated_foo(False)\n" +" write_line('Calling decorated foo with True')\n" +" assert decorated_foo(True)" +msgstr "" + +msgid "When this script is run, the following output should be observed:" +msgstr "Під час виконання цього сценарію має спостерігатися такий результат:" + +msgid "" +"Calling undecorated foo with False\n" +"about to log at DEBUG ...\n" +"about to log at INFO ...\n" +"about to log at WARNING ...\n" +"Calling undecorated foo with True\n" +"about to log at DEBUG ...\n" +"about to log at INFO ...\n" +"about to log at WARNING ...\n" +"about to log at ERROR ...\n" +"about to log at CRITICAL ...\n" +"Calling decorated foo with False\n" +"about to log at DEBUG ...\n" +"about to log at INFO ...\n" +"about to log at WARNING ...\n" +"Calling decorated foo with True\n" +"about to log at DEBUG ...\n" +"about to log at INFO ...\n" +"about to log at WARNING ...\n" +"about to log at ERROR ...\n" +"Actually logged at DEBUG\n" +"Actually logged at INFO\n" +"Actually logged at WARNING\n" +"Actually logged at ERROR\n" +"about to log at CRITICAL ...\n" +"Actually logged at CRITICAL" +msgstr "" + +msgid "" +"As you can see, actual logging output only occurs when an event is logged " +"whose severity is ERROR or greater, but in that case, any previous events at " +"lower severities are also logged." +msgstr "" +"Як ви можете бачити, фактичний вихід журналу відбувається лише тоді, коли " +"реєструється подія, серйозність якої дорівнює ПОМИЛКІ або вище, але в цьому " +"випадку також реєструються будь-які попередні події з нижчим рівнем " +"серйозності." + +msgid "You can of course use the conventional means of decoration::" +msgstr "Ви, звичайно, можете використовувати звичайні засоби декору:" + +msgid "" +"@log_if_errors(logger)\n" +"def foo(fail=False):\n" +" ..." +msgstr "" + +msgid "Sending logging messages to email, with buffering" +msgstr "" + +msgid "" +"To illustrate how you can send log messages via email, so that a set number " +"of messages are sent per email, you can subclass :class:`~logging.handlers." +"BufferingHandler`. In the following example, which you can adapt to suit " +"your specific needs, a simple test harness is provided which allows you to " +"run the script with command line arguments specifying what you typically " +"need to send things via SMTP. (Run the downloaded script with the ``-h`` " +"argument to see the required and optional arguments.)" +msgstr "" + +msgid "" +"import logging\n" +"import logging.handlers\n" +"import smtplib\n" +"\n" +"class BufferingSMTPHandler(logging.handlers.BufferingHandler):\n" +" def __init__(self, mailhost, port, username, password, fromaddr, " +"toaddrs,\n" +" subject, capacity):\n" +" logging.handlers.BufferingHandler.__init__(self, capacity)\n" +" self.mailhost = mailhost\n" +" self.mailport = port\n" +" self.username = username\n" +" self.password = password\n" +" self.fromaddr = fromaddr\n" +" if isinstance(toaddrs, str):\n" +" toaddrs = [toaddrs]\n" +" self.toaddrs = toaddrs\n" +" self.subject = subject\n" +" self.setFormatter(logging.Formatter(\"%(asctime)s %(levelname)-5s " +"%(message)s\"))\n" +"\n" +" def flush(self):\n" +" if len(self.buffer) > 0:\n" +" try:\n" +" smtp = smtplib.SMTP(self.mailhost, self.mailport)\n" +" smtp.starttls()\n" +" smtp.login(self.username, self.password)\n" +" msg = \"From: %s\\r\\nTo: %s\\r\\nSubject: %s\\r\\n\\r\\n\" " +"% (self.fromaddr, ','.join(self.toaddrs), self.subject)\n" +" for record in self.buffer:\n" +" s = self.format(record)\n" +" msg = msg + s + \"\\r\\n\"\n" +" smtp.sendmail(self.fromaddr, self.toaddrs, msg)\n" +" smtp.quit()\n" +" except Exception:\n" +" if logging.raiseExceptions:\n" +" raise\n" +" self.buffer = []\n" +"\n" +"if __name__ == '__main__':\n" +" import argparse\n" +"\n" +" ap = argparse.ArgumentParser()\n" +" aa = ap.add_argument\n" +" aa('host', metavar='HOST', help='SMTP server')\n" +" aa('--port', '-p', type=int, default=587, help='SMTP port')\n" +" aa('user', metavar='USER', help='SMTP username')\n" +" aa('password', metavar='PASSWORD', help='SMTP password')\n" +" aa('to', metavar='TO', help='Addressee for emails')\n" +" aa('sender', metavar='SENDER', help='Sender email address')\n" +" aa('--subject', '-s',\n" +" default='Test Logging email from Python logging module (buffering)',\n" +" help='Subject of email')\n" +" options = ap.parse_args()\n" +" logger = logging.getLogger()\n" +" logger.setLevel(logging.DEBUG)\n" +" h = BufferingSMTPHandler(options.host, options.port, options.user,\n" +" options.password, options.sender,\n" +" options.to, options.subject, 10)\n" +" logger.addHandler(h)\n" +" for i in range(102):\n" +" logger.info(\"Info index = %d\", i)\n" +" h.flush()\n" +" h.close()" +msgstr "" + +msgid "" +"If you run this script and your SMTP server is correctly set up, you should " +"find that it sends eleven emails to the addressee you specify. The first ten " +"emails will each have ten log messages, and the eleventh will have two " +"messages. That makes up 102 messages as specified in the script." +msgstr "" + +msgid "Formatting times using UTC (GMT) via configuration" +msgstr "Форматування часу за допомогою UTC (GMT) через налаштування" + +msgid "" +"Sometimes you want to format times using UTC, which can be done using a " +"class such as ``UTCFormatter``, shown below::" +msgstr "" + +msgid "" +"import logging\n" +"import time\n" +"\n" +"class UTCFormatter(logging.Formatter):\n" +" converter = time.gmtime" +msgstr "" + +msgid "" +"and you can then use the ``UTCFormatter`` in your code instead of :class:" +"`~logging.Formatter`. If you want to do that via configuration, you can use " +"the :func:`~logging.config.dictConfig` API with an approach illustrated by " +"the following complete example::" +msgstr "" +"і тоді ви можете використовувати ``UTCFormatter`` у своєму коді замість :" +"class:`~logging.Formatter`. Якщо ви хочете зробити це за допомогою " +"конфігурації, ви можете використовувати :func:`~logging.config.dictConfig` " +"API з підходом, проілюстрованим таким повним прикладом:" + +msgid "" +"import logging\n" +"import logging.config\n" +"import time\n" +"\n" +"class UTCFormatter(logging.Formatter):\n" +" converter = time.gmtime\n" +"\n" +"LOGGING = {\n" +" 'version': 1,\n" +" 'disable_existing_loggers': False,\n" +" 'formatters': {\n" +" 'utc': {\n" +" '()': UTCFormatter,\n" +" 'format': '%(asctime)s %(message)s',\n" +" },\n" +" 'local': {\n" +" 'format': '%(asctime)s %(message)s',\n" +" }\n" +" },\n" +" 'handlers': {\n" +" 'console1': {\n" +" 'class': 'logging.StreamHandler',\n" +" 'formatter': 'utc',\n" +" },\n" +" 'console2': {\n" +" 'class': 'logging.StreamHandler',\n" +" 'formatter': 'local',\n" +" },\n" +" },\n" +" 'root': {\n" +" 'handlers': ['console1', 'console2'],\n" +" }\n" +"}\n" +"\n" +"if __name__ == '__main__':\n" +" logging.config.dictConfig(LOGGING)\n" +" logging.warning('The local time is %s', time.asctime())" +msgstr "" + +msgid "When this script is run, it should print something like:" +msgstr "Коли цей сценарій запускається, він має надрукувати щось на кшталт:" + +msgid "" +"2015-10-17 12:53:29,501 The local time is Sat Oct 17 13:53:29 2015\n" +"2015-10-17 13:53:29,501 The local time is Sat Oct 17 13:53:29 2015" +msgstr "" + +msgid "" +"showing how the time is formatted both as local time and UTC, one for each " +"handler." +msgstr "" +"показує, як час форматується як місцевий час, так і UTC, по одному для " +"кожного обробника." + +msgid "Using a context manager for selective logging" +msgstr "Використання контекстного менеджера для вибіркового журналювання" + +msgid "" +"There are times when it would be useful to temporarily change the logging " +"configuration and revert it back after doing something. For this, a context " +"manager is the most obvious way of saving and restoring the logging context. " +"Here is a simple example of such a context manager, which allows you to " +"optionally change the logging level and add a logging handler purely in the " +"scope of the context manager::" +msgstr "" +"Бувають випадки, коли було б корисно тимчасово змінити конфігурацію " +"журналювання та повернути її назад після певних дій. Для цього менеджер " +"контексту є найбільш очевидним способом збереження та відновлення контексту " +"журналювання. Ось простий приклад такого менеджера контексту, який дозволяє " +"вам за бажанням змінити рівень журналювання та додати обробник журналювання " +"виключно в межах контекстного менеджера::" + +msgid "" +"import logging\n" +"import sys\n" +"\n" +"class LoggingContext:\n" +" def __init__(self, logger, level=None, handler=None, close=True):\n" +" self.logger = logger\n" +" self.level = level\n" +" self.handler = handler\n" +" self.close = close\n" +"\n" +" def __enter__(self):\n" +" if self.level is not None:\n" +" self.old_level = self.logger.level\n" +" self.logger.setLevel(self.level)\n" +" if self.handler:\n" +" self.logger.addHandler(self.handler)\n" +"\n" +" def __exit__(self, et, ev, tb):\n" +" if self.level is not None:\n" +" self.logger.setLevel(self.old_level)\n" +" if self.handler:\n" +" self.logger.removeHandler(self.handler)\n" +" if self.handler and self.close:\n" +" self.handler.close()\n" +" # implicit return of None => don't swallow exceptions" +msgstr "" + +msgid "" +"If you specify a level value, the logger's level is set to that value in the " +"scope of the with block covered by the context manager. If you specify a " +"handler, it is added to the logger on entry to the block and removed on exit " +"from the block. You can also ask the manager to close the handler for you on " +"block exit - you could do this if you don't need the handler any more." +msgstr "" +"Якщо ви вказуєте значення рівня, рівень реєстратора встановлюється на це " +"значення в області блоку with, охопленого менеджером контексту. Якщо ви " +"вкажете обробник, він додається до реєстратора під час входу до блоку та " +"видаляється під час виходу з блоку. Ви також можете попросити менеджера " +"закрити обробник для вас після виходу з блоку - ви можете зробити це, якщо " +"вам більше не потрібен обробник." + +msgid "" +"To illustrate how it works, we can add the following block of code to the " +"above::" +msgstr "" +"Щоб проілюструвати, як це працює, ми можемо додати наступний блок коду до " +"наведеного вище:" + +msgid "" +"if __name__ == '__main__':\n" +" logger = logging.getLogger('foo')\n" +" logger.addHandler(logging.StreamHandler())\n" +" logger.setLevel(logging.INFO)\n" +" logger.info('1. This should appear just once on stderr.')\n" +" logger.debug('2. This should not appear.')\n" +" with LoggingContext(logger, level=logging.DEBUG):\n" +" logger.debug('3. This should appear once on stderr.')\n" +" logger.debug('4. This should not appear.')\n" +" h = logging.StreamHandler(sys.stdout)\n" +" with LoggingContext(logger, level=logging.DEBUG, handler=h, " +"close=True):\n" +" logger.debug('5. This should appear twice - once on stderr and once " +"on stdout.')\n" +" logger.info('6. This should appear just once on stderr.')\n" +" logger.debug('7. This should not appear.')" +msgstr "" + +msgid "" +"We initially set the logger's level to ``INFO``, so message #1 appears and " +"message #2 doesn't. We then change the level to ``DEBUG`` temporarily in the " +"following ``with`` block, and so message #3 appears. After the block exits, " +"the logger's level is restored to ``INFO`` and so message #4 doesn't appear. " +"In the next ``with`` block, we set the level to ``DEBUG`` again but also add " +"a handler writing to ``sys.stdout``. Thus, message #5 appears twice on the " +"console (once via ``stderr`` and once via ``stdout``). After the ``with`` " +"statement's completion, the status is as it was before so message #6 appears " +"(like message #1) whereas message #7 doesn't (just like message #2)." +msgstr "" +"Спочатку ми встановили рівень реєстратора на ``INFO``, тому повідомлення №1 " +"з’являється, а повідомлення №2 ні. Потім ми тимчасово змінюємо рівень на " +"``DEBUG`` у наступному блоці ``with``, і тому з'являється повідомлення №3. " +"Після виходу з блоку рівень реєстратора відновлюється до ``INFO``, тому " +"повідомлення №4 не з’являється. У наступному блоці ``with`` ми знову " +"встановлюємо рівень ``DEBUG``, але також додаємо запис обробника в ``sys." +"stdout``. Таким чином, повідомлення №5 з’являється двічі на консолі (один " +"раз через ``stderr`` і один раз через ``stdout``). Після завершення " +"оператора ``with`` статус залишається таким же, як і раніше, тому " +"повідомлення №6 з’являється (як повідомлення №1), тоді як повідомлення №7 ні " +"(так само, як повідомлення №2)." + +msgid "If we run the resulting script, the result is as follows:" +msgstr "Якщо ми запустимо отриманий сценарій, результат буде таким:" + +msgid "" +"$ python logctx.py\n" +"1. This should appear just once on stderr.\n" +"3. This should appear once on stderr.\n" +"5. This should appear twice - once on stderr and once on stdout.\n" +"5. This should appear twice - once on stderr and once on stdout.\n" +"6. This should appear just once on stderr." +msgstr "" + +msgid "" +"If we run it again, but pipe ``stderr`` to ``/dev/null``, we see the " +"following, which is the only message written to ``stdout``:" +msgstr "" +"Якщо ми запустимо його знову, але передаємо ``stderr`` до ``/dev/null``, ми " +"побачимо наступне, яке є єдиним повідомленням, яке записується в ``stdout``:" + +msgid "" +"$ python logctx.py 2>/dev/null\n" +"5. This should appear twice - once on stderr and once on stdout." +msgstr "" + +msgid "Once again, but piping ``stdout`` to ``/dev/null``, we get:" +msgstr "Ще раз, але передаючи ``stdout`` до ``/dev/null``, ми отримуємо:" + +msgid "" +"$ python logctx.py >/dev/null\n" +"1. This should appear just once on stderr.\n" +"3. This should appear once on stderr.\n" +"5. This should appear twice - once on stderr and once on stdout.\n" +"6. This should appear just once on stderr." +msgstr "" + +msgid "" +"In this case, the message #5 printed to ``stdout`` doesn't appear, as " +"expected." +msgstr "" +"У цьому випадку повідомлення №5, надруковане в ``stdout``, не з'являється, " +"як очікувалося." + +msgid "" +"Of course, the approach described here can be generalised, for example to " +"attach logging filters temporarily. Note that the above code works in Python " +"2 as well as Python 3." +msgstr "" +"Звичайно, описаний тут підхід можна узагальнити, наприклад, тимчасово " +"приєднати фільтри журналювання. Зверніть увагу, що наведений вище код працює " +"як у Python 2, так і в Python 3." + +msgid "A CLI application starter template" +msgstr "Початковий шаблон програми CLI" + +msgid "Here's an example which shows how you can:" +msgstr "Ось приклад, який показує, як можна:" + +msgid "Use a logging level based on command-line arguments" +msgstr "" +"Використовуйте рівень журналювання на основі аргументів командного рядка" + +msgid "" +"Dispatch to multiple subcommands in separate files, all logging at the same " +"level in a consistent way" +msgstr "" +"Відправлення до кількох підкоманд в окремих файлах, усі журнали на одному " +"рівні узгоджено" + +msgid "Make use of simple, minimal configuration" +msgstr "Використовуйте просту мінімальну конфігурацію" + +msgid "" +"Suppose we have a command-line application whose job is to stop, start or " +"restart some services. This could be organised for the purposes of " +"illustration as a file ``app.py`` that is the main script for the " +"application, with individual commands implemented in ``start.py``, ``stop." +"py`` and ``restart.py``. Suppose further that we want to control the " +"verbosity of the application via a command-line argument, defaulting to " +"``logging.INFO``. Here's one way that ``app.py`` could be written::" +msgstr "" +"Припустімо, що у нас є програма командного рядка, завданням якої є зупинка, " +"запуск або перезапуск деяких служб. Для ілюстрації це можна організувати як " +"файл ``app.py``, який є основним сценарієм для програми, з окремими " +"командами, реалізованими в ``start.py``, ``stop.py`` і ``restart.py``. " +"Припустимо далі, що ми хочемо контролювати докладність програми за допомогою " +"аргументу командного рядка, за замовчуванням ``logging.INFO``. Ось один із " +"способів написання ``app.py``:" + +msgid "" +"import argparse\n" +"import importlib\n" +"import logging\n" +"import os\n" +"import sys\n" +"\n" +"def main(args=None):\n" +" scriptname = os.path.basename(__file__)\n" +" parser = argparse.ArgumentParser(scriptname)\n" +" levels = ('DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL')\n" +" parser.add_argument('--log-level', default='INFO', choices=levels)\n" +" subparsers = parser.add_subparsers(dest='command',\n" +" help='Available commands:')\n" +" start_cmd = subparsers.add_parser('start', help='Start a service')\n" +" start_cmd.add_argument('name', metavar='NAME',\n" +" help='Name of service to start')\n" +" stop_cmd = subparsers.add_parser('stop',\n" +" help='Stop one or more services')\n" +" stop_cmd.add_argument('names', metavar='NAME', nargs='+',\n" +" help='Name of service to stop')\n" +" restart_cmd = subparsers.add_parser('restart',\n" +" help='Restart one or more " +"services')\n" +" restart_cmd.add_argument('names', metavar='NAME', nargs='+',\n" +" help='Name of service to restart')\n" +" options = parser.parse_args()\n" +" # the code to dispatch commands could all be in this file. For the " +"purposes\n" +" # of illustration only, we implement each command in a separate module.\n" +" try:\n" +" mod = importlib.import_module(options.command)\n" +" cmd = getattr(mod, 'command')\n" +" except (ImportError, AttributeError):\n" +" print('Unable to find the code for command \\'%s\\'' % options." +"command)\n" +" return 1\n" +" # Could get fancy here and load configuration from file or dictionary\n" +" logging.basicConfig(level=options.log_level,\n" +" format='%(levelname)s %(name)s %(message)s')\n" +" cmd(options)\n" +"\n" +"if __name__ == '__main__':\n" +" sys.exit(main())" +msgstr "" + +msgid "" +"And the ``start``, ``stop`` and ``restart`` commands can be implemented in " +"separate modules, like so for starting::" +msgstr "" +"А команди ``start``, ``stop`` і ``restart`` можна реалізувати в окремих " +"модулях, наприклад, для запуску::" + +msgid "" +"# start.py\n" +"import logging\n" +"\n" +"logger = logging.getLogger(__name__)\n" +"\n" +"def command(options):\n" +" logger.debug('About to start %s', options.name)\n" +" # actually do the command processing here ...\n" +" logger.info('Started the \\'%s\\' service.', options.name)" +msgstr "" + +msgid "and thus for stopping::" +msgstr "і, таким чином, для зупинки::" + +msgid "" +"# stop.py\n" +"import logging\n" +"\n" +"logger = logging.getLogger(__name__)\n" +"\n" +"def command(options):\n" +" n = len(options.names)\n" +" if n == 1:\n" +" plural = ''\n" +" services = '\\'%s\\'' % options.names[0]\n" +" else:\n" +" plural = 's'\n" +" services = ', '.join('\\'%s\\'' % name for name in options.names)\n" +" i = services.rfind(', ')\n" +" services = services[:i] + ' and ' + services[i + 2:]\n" +" logger.debug('About to stop %s', services)\n" +" # actually do the command processing here ...\n" +" logger.info('Stopped the %s service%s.', services, plural)" +msgstr "" + +msgid "and similarly for restarting::" +msgstr "і аналогічно для перезапуску::" + +msgid "" +"# restart.py\n" +"import logging\n" +"\n" +"logger = logging.getLogger(__name__)\n" +"\n" +"def command(options):\n" +" n = len(options.names)\n" +" if n == 1:\n" +" plural = ''\n" +" services = '\\'%s\\'' % options.names[0]\n" +" else:\n" +" plural = 's'\n" +" services = ', '.join('\\'%s\\'' % name for name in options.names)\n" +" i = services.rfind(', ')\n" +" services = services[:i] + ' and ' + services[i + 2:]\n" +" logger.debug('About to restart %s', services)\n" +" # actually do the command processing here ...\n" +" logger.info('Restarted the %s service%s.', services, plural)" +msgstr "" + +msgid "" +"If we run this application with the default log level, we get output like " +"this:" +msgstr "" +"Якщо ми запустимо цю програму з рівнем журналу за замовчуванням, ми " +"отримаємо такий результат:" + +msgid "" +"$ python app.py start foo\n" +"INFO start Started the 'foo' service.\n" +"\n" +"$ python app.py stop foo bar\n" +"INFO stop Stopped the 'foo' and 'bar' services.\n" +"\n" +"$ python app.py restart foo bar baz\n" +"INFO restart Restarted the 'foo', 'bar' and 'baz' services." +msgstr "" + +msgid "" +"The first word is the logging level, and the second word is the module or " +"package name of the place where the event was logged." +msgstr "" +"Перше слово — це рівень журналювання, а друге — ім’я модуля або пакета " +"місця, де було зареєстровано подію." + +msgid "" +"If we change the logging level, then we can change the information sent to " +"the log. For example, if we want more information:" +msgstr "" +"Якщо ми змінимо рівень журналювання, ми зможемо змінити інформацію, яка " +"надсилається до журналу. Наприклад, якщо нам потрібна додаткова інформація:" + +msgid "" +"$ python app.py --log-level DEBUG start foo\n" +"DEBUG start About to start foo\n" +"INFO start Started the 'foo' service.\n" +"\n" +"$ python app.py --log-level DEBUG stop foo bar\n" +"DEBUG stop About to stop 'foo' and 'bar'\n" +"INFO stop Stopped the 'foo' and 'bar' services.\n" +"\n" +"$ python app.py --log-level DEBUG restart foo bar baz\n" +"DEBUG restart About to restart 'foo', 'bar' and 'baz'\n" +"INFO restart Restarted the 'foo', 'bar' and 'baz' services." +msgstr "" + +msgid "And if we want less:" +msgstr "А якщо ми хочемо менше:" + +msgid "" +"$ python app.py --log-level WARNING start foo\n" +"$ python app.py --log-level WARNING stop foo bar\n" +"$ python app.py --log-level WARNING restart foo bar baz" +msgstr "" + +msgid "" +"In this case, the commands don't print anything to the console, since " +"nothing at ``WARNING`` level or above is logged by them." +msgstr "" +"У цьому випадку команди нічого не друкують на консолі, оскільки вони нічого " +"не реєструють на рівні ``ПОПЕРЕДЖЕННЯ`` або вище." + +msgid "A Qt GUI for logging" +msgstr "Графічний інтерфейс Qt для журналювання" + +msgid "" +"A question that comes up from time to time is about how to log to a GUI " +"application. The `Qt `_ framework is a popular cross-" +"platform UI framework with Python bindings using :pypi:`PySide2` or :pypi:" +"`PyQt5` libraries." +msgstr "" + +msgid "" +"The following example shows how to log to a Qt GUI. This introduces a simple " +"``QtHandler`` class which takes a callable, which should be a slot in the " +"main thread that does GUI updates. A worker thread is also created to show " +"how you can log to the GUI from both the UI itself (via a button for manual " +"logging) as well as a worker thread doing work in the background (here, just " +"logging messages at random levels with random short delays in between)." +msgstr "" +"У наступному прикладі показано, як увійти до Qt GUI. Це представляє простий " +"клас ``QtHandler``, який приймає callable, який має бути слотом у головному " +"потоці, який виконує оновлення GUI. Робочий потік також створюється, щоб " +"показати, як ви можете входити в графічний інтерфейс як з самого інтерфейсу " +"користувача (за допомогою кнопки для ручного журналювання), так і з робочого " +"потоку, який виконує роботу у фоновому режимі (тут просто реєструє " +"повідомлення на випадкових рівнях з довільним короткі затримки між ними)." + +msgid "" +"The worker thread is implemented using Qt's ``QThread`` class rather than " +"the :mod:`threading` module, as there are circumstances where one has to use " +"``QThread``, which offers better integration with other ``Qt`` components." +msgstr "" +"Робочий потік реалізовано за допомогою класу ``QThread`` Qt, а не модуля :" +"mod:`threading`, оскільки є обставини, коли потрібно використовувати " +"``QThread``, який забезпечує кращу інтеграцію з іншим ``Qt`` компоненти." + +msgid "" +"The code should work with recent releases of any of ``PySide6``, ``PyQt6``, " +"``PySide2`` or ``PyQt5``. You should be able to adapt the approach to " +"earlier versions of Qt. Please refer to the comments in the code snippet for " +"more detailed information." +msgstr "" + +msgid "" +"import datetime\n" +"import logging\n" +"import random\n" +"import sys\n" +"import time\n" +"\n" +"# Deal with minor differences between different Qt packages\n" +"try:\n" +" from PySide6 import QtCore, QtGui, QtWidgets\n" +" Signal = QtCore.Signal\n" +" Slot = QtCore.Slot\n" +"except ImportError:\n" +" try:\n" +" from PyQt6 import QtCore, QtGui, QtWidgets\n" +" Signal = QtCore.pyqtSignal\n" +" Slot = QtCore.pyqtSlot\n" +" except ImportError:\n" +" try:\n" +" from PySide2 import QtCore, QtGui, QtWidgets\n" +" Signal = QtCore.Signal\n" +" Slot = QtCore.Slot\n" +" except ImportError:\n" +" from PyQt5 import QtCore, QtGui, QtWidgets\n" +" Signal = QtCore.pyqtSignal\n" +" Slot = QtCore.pyqtSlot\n" +"\n" +"logger = logging.getLogger(__name__)\n" +"\n" +"\n" +"#\n" +"# Signals need to be contained in a QObject or subclass in order to be " +"correctly\n" +"# initialized.\n" +"#\n" +"class Signaller(QtCore.QObject):\n" +" signal = Signal(str, logging.LogRecord)\n" +"\n" +"#\n" +"# Output to a Qt GUI is only supposed to happen on the main thread. So, " +"this\n" +"# handler is designed to take a slot function which is set up to run in the " +"main\n" +"# thread. In this example, the function takes a string argument which is a\n" +"# formatted log message, and the log record which generated it. The " +"formatted\n" +"# string is just a convenience - you could format a string for output any " +"way\n" +"# you like in the slot function itself.\n" +"#\n" +"# You specify the slot function to do whatever GUI updates you want. The " +"handler\n" +"# doesn't know or care about specific UI elements.\n" +"#\n" +"class QtHandler(logging.Handler):\n" +" def __init__(self, slotfunc, *args, **kwargs):\n" +" super().__init__(*args, **kwargs)\n" +" self.signaller = Signaller()\n" +" self.signaller.signal.connect(slotfunc)\n" +"\n" +" def emit(self, record):\n" +" s = self.format(record)\n" +" self.signaller.signal.emit(s, record)\n" +"\n" +"#\n" +"# This example uses QThreads, which means that the threads at the Python " +"level\n" +"# are named something like \"Dummy-1\". The function below gets the Qt name " +"of the\n" +"# current thread.\n" +"#\n" +"def ctname():\n" +" return QtCore.QThread.currentThread().objectName()\n" +"\n" +"\n" +"#\n" +"# Used to generate random levels for logging.\n" +"#\n" +"LEVELS = (logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR,\n" +" logging.CRITICAL)\n" +"\n" +"#\n" +"# This worker class represents work that is done in a thread separate to " +"the\n" +"# main thread. The way the thread is kicked off to do work is via a button " +"press\n" +"# that connects to a slot in the worker.\n" +"#\n" +"# Because the default threadName value in the LogRecord isn't much use, we " +"add\n" +"# a qThreadName which contains the QThread name as computed above, and pass " +"that\n" +"# value in an \"extra\" dictionary which is used to update the LogRecord " +"with the\n" +"# QThread name.\n" +"#\n" +"# This example worker just outputs messages sequentially, interspersed with\n" +"# random delays of the order of a few seconds.\n" +"#\n" +"class Worker(QtCore.QObject):\n" +" @Slot()\n" +" def start(self):\n" +" extra = {'qThreadName': ctname() }\n" +" logger.debug('Started work', extra=extra)\n" +" i = 1\n" +" # Let the thread run until interrupted. This allows reasonably " +"clean\n" +" # thread termination.\n" +" while not QtCore.QThread.currentThread().isInterruptionRequested():\n" +" delay = 0.5 + random.random() * 2\n" +" time.sleep(delay)\n" +" try:\n" +" if random.random() < 0.1:\n" +" raise ValueError('Exception raised: %d' % i)\n" +" else:\n" +" level = random.choice(LEVELS)\n" +" logger.log(level, 'Message after delay of %3.1f: %d', " +"delay, i, extra=extra)\n" +" except ValueError as e:\n" +" logger.exception('Failed: %s', e, extra=extra)\n" +" i += 1\n" +"\n" +"#\n" +"# Implement a simple UI for this cookbook example. This contains:\n" +"#\n" +"# * A read-only text edit window which holds formatted log messages\n" +"# * A button to start work and log stuff in a separate thread\n" +"# * A button to log something from the main thread\n" +"# * A button to clear the log window\n" +"#\n" +"class Window(QtWidgets.QWidget):\n" +"\n" +" COLORS = {\n" +" logging.DEBUG: 'black',\n" +" logging.INFO: 'blue',\n" +" logging.WARNING: 'orange',\n" +" logging.ERROR: 'red',\n" +" logging.CRITICAL: 'purple',\n" +" }\n" +"\n" +" def __init__(self, app):\n" +" super().__init__()\n" +" self.app = app\n" +" self.textedit = te = QtWidgets.QPlainTextEdit(self)\n" +" # Set whatever the default monospace font is for the platform\n" +" f = QtGui.QFont('nosuchfont')\n" +" if hasattr(f, 'Monospace'):\n" +" f.setStyleHint(f.Monospace)\n" +" else:\n" +" f.setStyleHint(f.StyleHint.Monospace) # for Qt6\n" +" te.setFont(f)\n" +" te.setReadOnly(True)\n" +" PB = QtWidgets.QPushButton\n" +" self.work_button = PB('Start background work', self)\n" +" self.log_button = PB('Log a message at a random level', self)\n" +" self.clear_button = PB('Clear log window', self)\n" +" self.handler = h = QtHandler(self.update_status)\n" +" # Remember to use qThreadName rather than threadName in the format " +"string.\n" +" fs = '%(asctime)s %(qThreadName)-12s %(levelname)-8s %(message)s'\n" +" formatter = logging.Formatter(fs)\n" +" h.setFormatter(formatter)\n" +" logger.addHandler(h)\n" +" # Set up to terminate the QThread when we exit\n" +" app.aboutToQuit.connect(self.force_quit)\n" +"\n" +" # Lay out all the widgets\n" +" layout = QtWidgets.QVBoxLayout(self)\n" +" layout.addWidget(te)\n" +" layout.addWidget(self.work_button)\n" +" layout.addWidget(self.log_button)\n" +" layout.addWidget(self.clear_button)\n" +" self.setFixedSize(900, 400)\n" +"\n" +" # Connect the non-worker slots and signals\n" +" self.log_button.clicked.connect(self.manual_update)\n" +" self.clear_button.clicked.connect(self.clear_display)\n" +"\n" +" # Start a new worker thread and connect the slots for the worker\n" +" self.start_thread()\n" +" self.work_button.clicked.connect(self.worker.start)\n" +" # Once started, the button should be disabled\n" +" self.work_button.clicked.connect(lambda : self.work_button." +"setEnabled(False))\n" +"\n" +" def start_thread(self):\n" +" self.worker = Worker()\n" +" self.worker_thread = QtCore.QThread()\n" +" self.worker.setObjectName('Worker')\n" +" self.worker_thread.setObjectName('WorkerThread') # for qThreadName\n" +" self.worker.moveToThread(self.worker_thread)\n" +" # This will start an event loop in the worker thread\n" +" self.worker_thread.start()\n" +"\n" +" def kill_thread(self):\n" +" # Just tell the worker to stop, then tell it to quit and wait for " +"that\n" +" # to happen\n" +" self.worker_thread.requestInterruption()\n" +" if self.worker_thread.isRunning():\n" +" self.worker_thread.quit()\n" +" self.worker_thread.wait()\n" +" else:\n" +" print('worker has already exited.')\n" +"\n" +" def force_quit(self):\n" +" # For use when the window is closed\n" +" if self.worker_thread.isRunning():\n" +" self.kill_thread()\n" +"\n" +" # The functions below update the UI and run in the main thread because\n" +" # that's where the slots are set up\n" +"\n" +" @Slot(str, logging.LogRecord)\n" +" def update_status(self, status, record):\n" +" color = self.COLORS.get(record.levelno, 'black')\n" +" s = '
%s
' % (color, status)\n" +" self.textedit.appendHtml(s)\n" +"\n" +" @Slot()\n" +" def manual_update(self):\n" +" # This function uses the formatted message passed in, but also uses\n" +" # information from the record to format the message in an " +"appropriate\n" +" # color according to its severity (level).\n" +" level = random.choice(LEVELS)\n" +" extra = {'qThreadName': ctname() }\n" +" logger.log(level, 'Manually logged!', extra=extra)\n" +"\n" +" @Slot()\n" +" def clear_display(self):\n" +" self.textedit.clear()\n" +"\n" +"\n" +"def main():\n" +" QtCore.QThread.currentThread().setObjectName('MainThread')\n" +" logging.getLogger().setLevel(logging.DEBUG)\n" +" app = QtWidgets.QApplication(sys.argv)\n" +" example = Window(app)\n" +" example.show()\n" +" if hasattr(app, 'exec'):\n" +" rc = app.exec()\n" +" else:\n" +" rc = app.exec_()\n" +" sys.exit(rc)\n" +"\n" +"if __name__=='__main__':\n" +" main()" +msgstr "" + +msgid "Logging to syslog with RFC5424 support" +msgstr "Вхід до системного журналу з підтримкою RFC5424" + +msgid "" +"Although :rfc:`5424` dates from 2009, most syslog servers are configured by " +"default to use the older :rfc:`3164`, which hails from 2001. When " +"``logging`` was added to Python in 2003, it supported the earlier (and only " +"existing) protocol at the time. Since RFC5424 came out, as there has not " +"been widespread deployment of it in syslog servers, the :class:`~logging." +"handlers.SysLogHandler` functionality has not been updated." +msgstr "" + +msgid "" +"RFC 5424 contains some useful features such as support for structured data, " +"and if you need to be able to log to a syslog server with support for it, " +"you can do so with a subclassed handler which looks something like this::" +msgstr "" +"RFC 5424 містить деякі корисні функції, такі як підтримка структурованих " +"даних, і якщо вам потрібно мати можливість увійти на сервер системного " +"журналу з його підтримкою, ви можете зробити це за допомогою обробника " +"підкласів, який виглядає приблизно так:" + +msgid "" +"import datetime\n" +"import logging.handlers\n" +"import re\n" +"import socket\n" +"import time\n" +"\n" +"class SysLogHandler5424(logging.handlers.SysLogHandler):\n" +"\n" +" tz_offset = re.compile(r'([+-]\\d{2})(\\d{2})$')\n" +" escaped = re.compile(r'([\\]\"\\\\])')\n" +"\n" +" def __init__(self, *args, **kwargs):\n" +" self.msgid = kwargs.pop('msgid', None)\n" +" self.appname = kwargs.pop('appname', None)\n" +" super().__init__(*args, **kwargs)\n" +"\n" +" def format(self, record):\n" +" version = 1\n" +" asctime = datetime.datetime.fromtimestamp(record.created)." +"isoformat()\n" +" m = self.tz_offset.match(time.strftime('%z'))\n" +" has_offset = False\n" +" if m and time.timezone:\n" +" hrs, mins = m.groups()\n" +" if int(hrs) or int(mins):\n" +" has_offset = True\n" +" if not has_offset:\n" +" asctime += 'Z'\n" +" else:\n" +" asctime += f'{hrs}:{mins}'\n" +" try:\n" +" hostname = socket.gethostname()\n" +" except Exception:\n" +" hostname = '-'\n" +" appname = self.appname or '-'\n" +" procid = record.process\n" +" msgid = '-'\n" +" msg = super().format(record)\n" +" sdata = '-'\n" +" if hasattr(record, 'structured_data'):\n" +" sd = record.structured_data\n" +" # This should be a dict where the keys are SD-ID and the value " +"is a\n" +" # dict mapping PARAM-NAME to PARAM-VALUE (refer to the RFC for " +"what these\n" +" # mean)\n" +" # There's no error checking here - it's purely for illustration, " +"and you\n" +" # can adapt this code for use in production environments\n" +" parts = []\n" +"\n" +" def replacer(m):\n" +" g = m.groups()\n" +" return '\\\\' + g[0]\n" +"\n" +" for sdid, dv in sd.items():\n" +" part = f'[{sdid}'\n" +" for k, v in dv.items():\n" +" s = str(v)\n" +" s = self.escaped.sub(replacer, s)\n" +" part += f' {k}=\"{s}\"'\n" +" part += ']'\n" +" parts.append(part)\n" +" sdata = ''.join(parts)\n" +" return f'{version} {asctime} {hostname} {appname} {procid} {msgid} " +"{sdata} {msg}'" +msgstr "" + +msgid "" +"You'll need to be familiar with RFC 5424 to fully understand the above code, " +"and it may be that you have slightly different needs (e.g. for how you pass " +"structural data to the log). Nevertheless, the above should be adaptable to " +"your speciric needs. With the above handler, you'd pass structured data " +"using something like this::" +msgstr "" +"Вам потрібно буде ознайомитися з RFC 5424, щоб повністю зрозуміти наведений " +"вище код, і можливо, у вас є дещо інші потреби (наприклад, щодо того, як ви " +"передаєте структурні дані в журнал). Тим не менш, наведене вище має " +"адаптуватися до ваших конкретних потреб. За допомогою наведеного вище " +"обробника ви передаєте структуровані дані, використовуючи щось на зразок " +"цього::" + +msgid "" +"sd = {\n" +" 'foo@12345': {'bar': 'baz', 'baz': 'bozz', 'fizz': r'buzz'},\n" +" 'foo@54321': {'rab': 'baz', 'zab': 'bozz', 'zzif': r'buzz'}\n" +"}\n" +"extra = {'structured_data': sd}\n" +"i = 1\n" +"logger.debug('Message %d', i, extra=extra)" +msgstr "" + +msgid "How to treat a logger like an output stream" +msgstr "" + +msgid "" +"Sometimes, you need to interface to a third-party API which expects a file-" +"like object to write to, but you want to direct the API's output to a " +"logger. You can do this using a class which wraps a logger with a file-like " +"API. Here's a short script illustrating such a class:" +msgstr "" + +msgid "" +"import logging\n" +"\n" +"class LoggerWriter:\n" +" def __init__(self, logger, level):\n" +" self.logger = logger\n" +" self.level = level\n" +"\n" +" def write(self, message):\n" +" if message != '\\n': # avoid printing bare newlines, if you like\n" +" self.logger.log(self.level, message)\n" +"\n" +" def flush(self):\n" +" # doesn't actually do anything, but might be expected of a file-" +"like\n" +" # object - so optional depending on your situation\n" +" pass\n" +"\n" +" def close(self):\n" +" # doesn't actually do anything, but might be expected of a file-" +"like\n" +" # object - so optional depending on your situation. You might want\n" +" # to set a flag so that later calls to write raise an exception\n" +" pass\n" +"\n" +"def main():\n" +" logging.basicConfig(level=logging.DEBUG)\n" +" logger = logging.getLogger('demo')\n" +" info_fp = LoggerWriter(logger, logging.INFO)\n" +" debug_fp = LoggerWriter(logger, logging.DEBUG)\n" +" print('An INFO message', file=info_fp)\n" +" print('A DEBUG message', file=debug_fp)\n" +"\n" +"if __name__ == \"__main__\":\n" +" main()" +msgstr "" + +msgid "When this script is run, it prints" +msgstr "" + +msgid "" +"INFO:demo:An INFO message\n" +"DEBUG:demo:A DEBUG message" +msgstr "" + +msgid "" +"You could also use ``LoggerWriter`` to redirect ``sys.stdout`` and ``sys." +"stderr`` by doing something like this:" +msgstr "" + +msgid "" +"import sys\n" +"\n" +"sys.stdout = LoggerWriter(logger, logging.INFO)\n" +"sys.stderr = LoggerWriter(logger, logging.WARNING)" +msgstr "" + +msgid "" +"You should do this *after* configuring logging for your needs. In the above " +"example, the :func:`~logging.basicConfig` call does this (using the ``sys." +"stderr`` value *before* it is overwritten by a ``LoggerWriter`` instance). " +"Then, you'd get this kind of result:" +msgstr "" + +msgid "" +">>> print('Foo')\n" +"INFO:demo:Foo\n" +">>> print('Bar', file=sys.stderr)\n" +"WARNING:demo:Bar\n" +">>>" +msgstr "" + +msgid "" +"Of course, the examples above show output according to the format used by :" +"func:`~logging.basicConfig`, but you can use a different formatter when you " +"configure logging." +msgstr "" + +msgid "" +"Note that with the above scheme, you are somewhat at the mercy of buffering " +"and the sequence of write calls which you are intercepting. For example, " +"with the definition of ``LoggerWriter`` above, if you have the snippet" +msgstr "" + +msgid "" +"sys.stderr = LoggerWriter(logger, logging.WARNING)\n" +"1 / 0" +msgstr "" + +msgid "then running the script results in" +msgstr "" + +msgid "" +"WARNING:demo:Traceback (most recent call last):\n" +"\n" +"WARNING:demo: File \"/home/runner/cookbook-loggerwriter/test.py\", line 53, " +"in \n" +"\n" +"WARNING:demo:\n" +"WARNING:demo:main()\n" +"WARNING:demo: File \"/home/runner/cookbook-loggerwriter/test.py\", line 49, " +"in main\n" +"\n" +"WARNING:demo:\n" +"WARNING:demo:1 / 0\n" +"WARNING:demo:ZeroDivisionError\n" +"WARNING:demo::\n" +"WARNING:demo:division by zero" +msgstr "" + +msgid "" +"As you can see, this output isn't ideal. That's because the underlying code " +"which writes to ``sys.stderr`` makes multiple writes, each of which results " +"in a separate logged line (for example, the last three lines above). To get " +"around this problem, you need to buffer things and only output log lines " +"when newlines are seen. Let's use a slightly better implementation of " +"``LoggerWriter``:" +msgstr "" + +msgid "" +"class BufferingLoggerWriter(LoggerWriter):\n" +" def __init__(self, logger, level):\n" +" super().__init__(logger, level)\n" +" self.buffer = ''\n" +"\n" +" def write(self, message):\n" +" if '\\n' not in message:\n" +" self.buffer += message\n" +" else:\n" +" parts = message.split('\\n')\n" +" if self.buffer:\n" +" s = self.buffer + parts.pop(0)\n" +" self.logger.log(self.level, s)\n" +" self.buffer = parts.pop()\n" +" for part in parts:\n" +" self.logger.log(self.level, part)" +msgstr "" + +msgid "" +"This just buffers up stuff until a newline is seen, and then logs complete " +"lines. With this approach, you get better output:" +msgstr "" + +msgid "" +"WARNING:demo:Traceback (most recent call last):\n" +"WARNING:demo: File \"/home/runner/cookbook-loggerwriter/main.py\", line 55, " +"in \n" +"WARNING:demo: main()\n" +"WARNING:demo: File \"/home/runner/cookbook-loggerwriter/main.py\", line 52, " +"in main\n" +"WARNING:demo: 1/0\n" +"WARNING:demo:ZeroDivisionError: division by zero" +msgstr "" + +msgid "Patterns to avoid" +msgstr "Шаблони, яких слід уникати" + +msgid "" +"Although the preceding sections have described ways of doing things you " +"might need to do or deal with, it is worth mentioning some usage patterns " +"which are *unhelpful*, and which should therefore be avoided in most cases. " +"The following sections are in no particular order." +msgstr "" +"Незважаючи на те, що в попередніх розділах описано способи виконання речей, " +"які вам можуть знадобитися, варто згадати деякі шаблони використання, які є " +"*некорисними* і яких у більшості випадків слід уникати. Наступні розділи не " +"мають певного порядку." + +msgid "Opening the same log file multiple times" +msgstr "Відкриття одного файлу журналу кілька разів" + +msgid "" +"On Windows, you will generally not be able to open the same file multiple " +"times as this will lead to a \"file is in use by another process\" error. " +"However, on POSIX platforms you'll not get any errors if you open the same " +"file multiple times. This could be done accidentally, for example by:" +msgstr "" +"У Windows зазвичай ви не зможете відкрити один і той же файл кілька разів, " +"оскільки це призведе до помилки \"файл використовується іншим процесом\". " +"Однак на платформах POSIX ви не отримаєте жодних помилок, якщо відкриєте той " +"самий файл кілька разів. Це може бути зроблено випадково, наприклад:" + +msgid "" +"Adding a file handler more than once which references the same file (e.g. by " +"a copy/paste/forget-to-change error)." +msgstr "" +"Додавання обробника файлів більше одного разу, який посилається на той самий " +"файл (наприклад, через помилку копіювання/вставлення/забути змінити)." + +msgid "" +"Opening two files that look different, as they have different names, but are " +"the same because one is a symbolic link to the other." +msgstr "" +"Відкриття двох файлів, які виглядають по-різному, оскільки мають різні " +"назви, але однакові, оскільки один є символічним посиланням на інший." + +msgid "" +"Forking a process, following which both parent and child have a reference to " +"the same file. This might be through use of the :mod:`multiprocessing` " +"module, for example." +msgstr "" +"Розгалуження процесу, після якого і батьківський, і дочірній елементи мають " +"посилання на той самий файл. Це може бути, наприклад, через використання " +"модуля :mod:`multiprocessing`." + +msgid "" +"Opening a file multiple times might *appear* to work most of the time, but " +"can lead to a number of problems in practice:" +msgstr "" +"Багаторазове відкриття файлу може *видаватись* більшу частину часу " +"ефективним, але на практиці це може призвести до ряду проблем:" + +msgid "" +"Logging output can be garbled because multiple threads or processes try to " +"write to the same file. Although logging guards against concurrent use of " +"the same handler instance by multiple threads, there is no such protection " +"if concurrent writes are attempted by two different threads using two " +"different handler instances which happen to point to the same file." +msgstr "" +"Вихід журналу може бути спотвореним, оскільки кілька потоків або процесів " +"намагаються записати в той самий файл. Хоча журналювання захищає від " +"одночасного використання одного екземпляра обробника кількома потоками, " +"такого захисту немає, якщо одночасний запис намагаються виконати два різні " +"потоки, використовуючи два різні екземпляри обробника, які випадково " +"вказують на той самий файл." + +msgid "" +"An attempt to delete a file (e.g. during file rotation) silently fails, " +"because there is another reference pointing to it. This can lead to " +"confusion and wasted debugging time - log entries end up in unexpected " +"places, or are lost altogether. Or a file that was supposed to be moved " +"remains in place, and grows in size unexpectedly despite size-based rotation " +"being supposedly in place." +msgstr "" + +msgid "" +"Use the techniques outlined in :ref:`multiple-processes` to circumvent such " +"issues." +msgstr "" +"Використовуйте методи, описані в :ref:`multiple-processes`, щоб уникнути " +"таких проблем." + +msgid "Using loggers as attributes in a class or passing them as parameters" +msgstr "" +"Використання реєстраторів як атрибутів у класі або передача їх як параметрів" + +msgid "" +"While there might be unusual cases where you'll need to do this, in general " +"there is no point because loggers are singletons. Code can always access a " +"given logger instance by name using ``logging.getLogger(name)``, so passing " +"instances around and holding them as instance attributes is pointless. Note " +"that in other languages such as Java and C#, loggers are often static class " +"attributes. However, this pattern doesn't make sense in Python, where the " +"module (and not the class) is the unit of software decomposition." +msgstr "" +"Хоча можуть бути незвичайні випадки, коли вам знадобиться це зробити, " +"загалом це не має сенсу, оскільки реєстратори є одиночними. Код завжди може " +"отримати доступ до певного екземпляра реєстратора за назвою за допомогою " +"``logging.getLogger(name)``, тому передавати екземпляри та зберігати їх як " +"атрибути екземпляра безглуздо. Зверніть увагу, що в інших мовах, таких як " +"Java і C#, реєстратори часто є статичними атрибутами класу. Однак цей шаблон " +"не має сенсу в Python, де модуль (а не клас) є одиницею декомпозиції " +"програмного забезпечення." + +msgid "" +"Adding handlers other than :class:`~logging.NullHandler` to a logger in a " +"library" +msgstr "" + +msgid "" +"Configuring logging by adding handlers, formatters and filters is the " +"responsibility of the application developer, not the library developer. If " +"you are maintaining a library, ensure that you don't add handlers to any of " +"your loggers other than a :class:`~logging.NullHandler` instance." +msgstr "" +"Налаштування журналювання шляхом додавання обробників, засобів форматування " +"та фільтрів є відповідальністю розробника програми, а не розробника " +"бібліотеки. Якщо ви підтримуєте бібліотеку, переконайтеся, що ви не додаєте " +"обробники до жодного з ваших журналів, крім екземпляра :class:`~logging." +"NullHandler`." + +msgid "Creating a lot of loggers" +msgstr "Створення великої кількості журналів" + +msgid "" +"Loggers are singletons that are never freed during a script execution, and " +"so creating lots of loggers will use up memory which can't then be freed. " +"Rather than create a logger per e.g. file processed or network connection " +"made, use the :ref:`existing mechanisms ` for passing " +"contextual information into your logs and restrict the loggers created to " +"those describing areas within your application (generally modules, but " +"occasionally slightly more fine-grained than that)." +msgstr "" +"Реєстратори — це одиночні елементи, які ніколи не звільняються під час " +"виконання сценарію, тому створення великої кількості реєстраторів буде " +"використовувати пам’ять, яку потім не можна звільнити. Замість створення " +"реєстратора, наприклад, оброблено файл або встановлено мережеве з’єднання, " +"скористайтеся :ref:`існуючими механізмами ` для передачі " +"контекстної інформації у ваші журнали та обмежте реєстратори, створені тими, " +"що описують області у вашій програмі (зазвичай модулі, але іноді трохи більш " +"дрібнозернисті, ніж це) ." + +msgid "Other resources" +msgstr "Інші ресурси" + +msgid "Module :mod:`logging`" +msgstr "Модуль :mod:`logging`" + +msgid "API reference for the logging module." +msgstr "Довідник API для модуля журналювання." + +msgid "Module :mod:`logging.config`" +msgstr "Модуль :mod:`logging.config`" + +msgid "Configuration API for the logging module." +msgstr "API конфігурації для модуля журналювання." + +msgid "Module :mod:`logging.handlers`" +msgstr "Модуль :mod:`logging.handlers`" + +msgid "Useful handlers included with the logging module." +msgstr "Корисні обробники, включені в модуль журналювання." + +msgid ":ref:`Basic Tutorial `" +msgstr ":ref:`Основний посібник `" + +msgid ":ref:`Advanced Tutorial `" +msgstr ":ref:`Розширений посібник `" diff --git a/howto/logging.po b/howto/logging.po new file mode 100644 index 000000000..a7751ef23 --- /dev/null +++ b/howto/logging.po @@ -0,0 +1,1936 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2023 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:53+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2023\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Logging HOWTO" +msgstr "Журнал HOWTO" + +msgid "Author" +msgstr "Автор" + +msgid "Vinay Sajip " +msgstr "Vinay Sajip " + +msgid "" +"This page contains tutorial information. For links to reference information " +"and a logging cookbook, please see :ref:`tutorial-ref-links`." +msgstr "" + +msgid "Basic Logging Tutorial" +msgstr "Підручник з базового журналювання" + +msgid "" +"Logging is a means of tracking events that happen when some software runs. " +"The software's developer adds logging calls to their code to indicate that " +"certain events have occurred. An event is described by a descriptive message " +"which can optionally contain variable data (i.e. data that is potentially " +"different for each occurrence of the event). Events also have an importance " +"which the developer ascribes to the event; the importance can also be called " +"the *level* or *severity*." +msgstr "" +"Ведення журналу — це засіб відстеження подій, які відбуваються під час " +"роботи певного програмного забезпечення. Розробник програмного забезпечення " +"додає до свого коду виклики реєстрації, щоб вказати, що відбулися певні " +"події. Подія описується описовим повідомленням, яке може додатково містити " +"змінні дані (тобто дані, які потенційно відрізняються для кожного випадку " +"події). Події також мають важливість, яку розробник приписує події; " +"важливість також можна назвати *рівнем* або *серйозністю*." + +msgid "When to use logging" +msgstr "Коли використовувати журналювання" + +msgid "" +"You can access logging functionality by creating a logger via ``logger = " +"getLogger(__name__)``, and then calling the logger's :meth:`~Logger.debug`, :" +"meth:`~Logger.info`, :meth:`~Logger.warning`, :meth:`~Logger.error` and :" +"meth:`~Logger.critical` methods. To determine when to use logging, and to " +"see which logger methods to use when, see the table below. It states, for " +"each of a set of common tasks, the best tool to use for that task." +msgstr "" + +msgid "Task you want to perform" +msgstr "Завдання, яке ви хочете виконати" + +msgid "The best tool for the task" +msgstr "Найкращий інструмент для завдання" + +msgid "" +"Display console output for ordinary usage of a command line script or program" +msgstr "" +"Відображення виводу консолі для звичайного використання сценарію або " +"програми командного рядка" + +msgid ":func:`print`" +msgstr ":func:`print`" + +msgid "" +"Report events that occur during normal operation of a program (e.g. for " +"status monitoring or fault investigation)" +msgstr "" +"Повідомлення про події, які відбуваються під час нормальної роботи програми " +"(наприклад, для моніторингу стану або дослідження помилок)" + +msgid "" +"A logger's :meth:`~Logger.info` (or :meth:`~Logger.debug` method for very " +"detailed output for diagnostic purposes)" +msgstr "" + +msgid "Issue a warning regarding a particular runtime event" +msgstr "Видавати попередження щодо певної події виконання" + +msgid "" +":func:`warnings.warn` in library code if the issue is avoidable and the " +"client application should be modified to eliminate the warning" +msgstr "" +":func:`warnings.warn` у коді бібліотеки, якщо проблеми можна уникнути і " +"клієнтську програму слід змінити, щоб усунути попередження" + +msgid "" +"A logger's :meth:`~Logger.warning` method if there is nothing the client " +"application can do about the situation, but the event should still be noted" +msgstr "" + +msgid "Report an error regarding a particular runtime event" +msgstr "Повідомити про помилку щодо певної події виконання" + +msgid "Raise an exception" +msgstr "Викликати виняток" + +msgid "" +"Report suppression of an error without raising an exception (e.g. error " +"handler in a long-running server process)" +msgstr "" +"Повідомити про придушення помилки без виклику винятку (наприклад, обробник " +"помилок у тривалому серверному процесі)" + +msgid "" +"A logger's :meth:`~Logger.error`, :meth:`~Logger.exception` or :meth:" +"`~Logger.critical` method as appropriate for the specific error and " +"application domain" +msgstr "" + +msgid "" +"The logger methods are named after the level or severity of the events they " +"are used to track. The standard levels and their applicability are described " +"below (in increasing order of severity):" +msgstr "" + +msgid "Level" +msgstr "Рівень" + +msgid "When it's used" +msgstr "Коли він використовується" + +msgid "``DEBUG``" +msgstr "``НАЛАШТУВАННЯ``" + +msgid "" +"Detailed information, typically of interest only when diagnosing problems." +msgstr "" +"Детальна інформація, яка зазвичай цікава лише під час діагностики проблем." + +msgid "``INFO``" +msgstr "``ІНФО``" + +msgid "Confirmation that things are working as expected." +msgstr "Підтвердження того, що все працює належним чином." + +msgid "``WARNING``" +msgstr "``ПОПЕРЕДЖЕННЯ``" + +msgid "" +"An indication that something unexpected happened, or indicative of some " +"problem in the near future (e.g. 'disk space low'). The software is still " +"working as expected." +msgstr "" +"Ознака того, що трапилося щось несподіване, або вказує на певну проблему в " +"найближчому майбутньому (наприклад, \"замало місця на диску\"). Програмне " +"забезпечення все ще працює належним чином." + +msgid "``ERROR``" +msgstr "``ПОМИЛКА``" + +msgid "" +"Due to a more serious problem, the software has not been able to perform " +"some function." +msgstr "" +"Через більш серйозну проблему програмне забезпечення не може виконувати " +"деякі функції." + +msgid "``CRITICAL``" +msgstr "``КРИТИЧНО``" + +msgid "" +"A serious error, indicating that the program itself may be unable to " +"continue running." +msgstr "" +"Серйозна помилка, яка вказує на те, що сама програма може не працювати далі." + +msgid "" +"The default level is ``WARNING``, which means that only events of this " +"severity and higher will be tracked, unless the logging package is " +"configured to do otherwise." +msgstr "" + +msgid "" +"Events that are tracked can be handled in different ways. The simplest way " +"of handling tracked events is to print them to the console. Another common " +"way is to write them to a disk file." +msgstr "" +"Події, які відстежуються, можна обробляти різними способами. Найпростіший " +"спосіб обробки відстежуваних подій — роздрукувати їх на консолі. Ще один " +"поширений спосіб - записати їх у файл на диску." + +msgid "A simple example" +msgstr "Простий приклад" + +msgid "A very simple example is::" +msgstr "Дуже простий приклад::" + +msgid "" +"import logging\n" +"logging.warning('Watch out!') # will print a message to the console\n" +"logging.info('I told you so') # will not print anything" +msgstr "" + +msgid "If you type these lines into a script and run it, you'll see:" +msgstr "Якщо ви введете ці рядки в сценарій і запустите його, ви побачите:" + +msgid "WARNING:root:Watch out!" +msgstr "" + +msgid "" +"printed out on the console. The ``INFO`` message doesn't appear because the " +"default level is ``WARNING``. The printed message includes the indication of " +"the level and the description of the event provided in the logging call, i." +"e. 'Watch out!'. The actual output can be formatted quite flexibly if you " +"need that; formatting options will also be explained later." +msgstr "" + +msgid "" +"Notice that in this example, we use functions directly on the ``logging`` " +"module, like ``logging.debug``, rather than creating a logger and calling " +"functions on it. These functions operation on the root logger, but can be " +"useful as they will call :func:`~logging.basicConfig` for you if it has not " +"been called yet, like in this example. In larger programs you'll usually " +"want to control the logging configuration explicitly however - so for that " +"reason as well as others, it's better to create loggers and call their " +"methods." +msgstr "" + +msgid "Logging to a file" +msgstr "Запис у файл" + +msgid "" +"A very common situation is that of recording logging events in a file, so " +"let's look at that next. Be sure to try the following in a newly started " +"Python interpreter, and don't just continue from the session described " +"above::" +msgstr "" + +msgid "" +"import logging\n" +"logger = logging.getLogger(__name__)\n" +"logging.basicConfig(filename='example.log', encoding='utf-8', level=logging." +"DEBUG)\n" +"logger.debug('This message should go to the log file')\n" +"logger.info('So should this')\n" +"logger.warning('And this, too')\n" +"logger.error('And non-ASCII stuff, too, like Øresund and Malmö')" +msgstr "" + +msgid "" +"The *encoding* argument was added. In earlier Python versions, or if not " +"specified, the encoding used is the default value used by :func:`open`. " +"While not shown in the above example, an *errors* argument can also now be " +"passed, which determines how encoding errors are handled. For available " +"values and the default, see the documentation for :func:`open`." +msgstr "" +"Додано аргумент *кодування*. У попередніх версіях Python або, якщо не " +"вказано, використовувалося кодування за замовчуванням, яке використовується :" +"func:`open`. Хоча це не показано в наведеному вище прикладі, тепер також " +"можна передати аргумент *errors*, який визначає, як обробляються помилки " +"кодування. Доступні значення та типові значення дивіться в документації для :" +"func:`open`." + +msgid "" +"And now if we open the file and look at what we have, we should find the log " +"messages:" +msgstr "" +"А тепер, якщо ми відкриємо файл і подивимося, що у нас є, ми повинні знайти " +"повідомлення журналу:" + +msgid "" +"DEBUG:__main__:This message should go to the log file\n" +"INFO:__main__:So should this\n" +"WARNING:__main__:And this, too\n" +"ERROR:__main__:And non-ASCII stuff, too, like Øresund and Malmö" +msgstr "" + +msgid "" +"This example also shows how you can set the logging level which acts as the " +"threshold for tracking. In this case, because we set the threshold to " +"``DEBUG``, all of the messages were printed." +msgstr "" +"У цьому прикладі також показано, як можна встановити рівень журналювання, " +"який діє як порогове значення для відстеження. У цьому випадку, оскільки ми " +"встановили порогове значення ``DEBUG``, усі повідомлення було надруковано." + +msgid "" +"If you want to set the logging level from a command-line option such as:" +msgstr "" +"Якщо ви хочете встановити рівень журналювання за допомогою параметра " +"командного рядка, наприклад:" + +msgid "--log=INFO" +msgstr "" + +msgid "" +"and you have the value of the parameter passed for ``--log`` in some " +"variable *loglevel*, you can use::" +msgstr "" +"і у вас є значення параметра, переданого для ``--log`` у деякій змінній " +"*loglevel*, ви можете використовувати::" + +msgid "getattr(logging, loglevel.upper())" +msgstr "" + +msgid "" +"to get the value which you'll pass to :func:`basicConfig` via the *level* " +"argument. You may want to error check any user input value, perhaps as in " +"the following example::" +msgstr "" +"щоб отримати значення, яке ви передасте :func:`basicConfig` через аргумент " +"*level*. Можливо, ви захочете перевірити помилки будь-якого введеного " +"користувачем значення, можливо, як у наступному прикладі::" + +msgid "" +"# assuming loglevel is bound to the string value obtained from the\n" +"# command line argument. Convert to upper case to allow the user to\n" +"# specify --log=DEBUG or --log=debug\n" +"numeric_level = getattr(logging, loglevel.upper(), None)\n" +"if not isinstance(numeric_level, int):\n" +" raise ValueError('Invalid log level: %s' % loglevel)\n" +"logging.basicConfig(level=numeric_level, ...)" +msgstr "" + +msgid "" +"The call to :func:`basicConfig` should come *before* any calls to a logger's " +"methods such as :meth:`~Logger.debug`, :meth:`~Logger.info`, etc. Otherwise, " +"that logging event may not be handled in the desired manner." +msgstr "" + +msgid "" +"If you run the above script several times, the messages from successive runs " +"are appended to the file *example.log*. If you want each run to start " +"afresh, not remembering the messages from earlier runs, you can specify the " +"*filemode* argument, by changing the call in the above example to::" +msgstr "" +"Якщо ви запустите наведений вище сценарій кілька разів, повідомлення від " +"послідовних запусків буде додано до файлу *example.log*. Якщо ви хочете, щоб " +"кожен запуск починався заново, не запам’ятовуючи повідомлення з попередніх " +"запусків, ви можете вказати аргумент *filemode*, змінивши виклик у прикладі " +"вище на::" + +msgid "" +"logging.basicConfig(filename='example.log', filemode='w', level=logging." +"DEBUG)" +msgstr "" + +msgid "" +"The output will be the same as before, but the log file is no longer " +"appended to, so the messages from earlier runs are lost." +msgstr "" +"Результат буде таким же, як і раніше, але файл журналу більше не додається, " +"тому повідомлення від попередніх запусків буде втрачено." + +msgid "Logging variable data" +msgstr "Журналування змінних даних" + +msgid "" +"To log variable data, use a format string for the event description message " +"and append the variable data as arguments. For example::" +msgstr "" +"Щоб зареєструвати змінні дані, використовуйте рядок формату для повідомлення " +"з описом події та додайте змінні дані як аргументи. Наприклад::" + +msgid "" +"import logging\n" +"logging.warning('%s before you %s', 'Look', 'leap!')" +msgstr "" + +msgid "will display:" +msgstr "буде відображатися:" + +msgid "WARNING:root:Look before you leap!" +msgstr "" + +msgid "" +"As you can see, merging of variable data into the event description message " +"uses the old, %-style of string formatting. This is for backwards " +"compatibility: the logging package pre-dates newer formatting options such " +"as :meth:`str.format` and :class:`string.Template`. These newer formatting " +"options *are* supported, but exploring them is outside the scope of this " +"tutorial: see :ref:`formatting-styles` for more information." +msgstr "" +"Як бачите, об’єднання змінних даних у повідомлення опису події використовує " +"старий, %-style форматування рядків. Це для зворотної сумісності: пакет " +"журналювання передує новішим параметрам форматування, таким як :meth:`str." +"format` і :class:`string.Template`. Ці нові параметри форматування " +"*підтримуються*, але їх вивчення виходить за рамки цього підручника: див. :" +"ref:`formatting-styles` для отримання додаткової інформації." + +msgid "Changing the format of displayed messages" +msgstr "Зміна формату повідомлень, що відображаються" + +msgid "" +"To change the format which is used to display messages, you need to specify " +"the format you want to use::" +msgstr "" +"Щоб змінити формат, який використовується для відображення повідомлень, вам " +"потрібно вказати формат, який ви хочете використовувати:" + +msgid "" +"import logging\n" +"logging.basicConfig(format='%(levelname)s:%(message)s', level=logging." +"DEBUG)\n" +"logging.debug('This message should appear on the console')\n" +"logging.info('So should this')\n" +"logging.warning('And this, too')" +msgstr "" + +msgid "which would print:" +msgstr "який буде друкувати:" + +msgid "" +"DEBUG:This message should appear on the console\n" +"INFO:So should this\n" +"WARNING:And this, too" +msgstr "" + +msgid "" +"Notice that the 'root' which appeared in earlier examples has disappeared. " +"For a full set of things that can appear in format strings, you can refer to " +"the documentation for :ref:`logrecord-attributes`, but for simple usage, you " +"just need the *levelname* (severity), *message* (event description, " +"including variable data) and perhaps to display when the event occurred. " +"This is described in the next section." +msgstr "" +"Зверніть увагу, що \"корінь\", який з’явився в попередніх прикладах, зник. " +"Щоб отримати повний набір речей, які можуть відображатися в рядках формату, " +"ви можете звернутися до документації для :ref:`logrecord-attributes`, але " +"для простого використання вам потрібні лише *levelname* (серйозність), " +"*message* (подія). опис, включаючи змінні дані) і, можливо, для " +"відображення, коли сталася подія. Це описано в наступному розділі." + +msgid "Displaying the date/time in messages" +msgstr "Відображення дати/часу в повідомленнях" + +msgid "" +"To display the date and time of an event, you would place '%(asctime)s' in " +"your format string::" +msgstr "" +"Щоб відобразити дату й час події, потрібно розмістити \"%(asctime)s\" у " +"рядку формату::" + +msgid "" +"import logging\n" +"logging.basicConfig(format='%(asctime)s %(message)s')\n" +"logging.warning('is when this event was logged.')" +msgstr "" + +msgid "which should print something like this:" +msgstr "який має надрукувати щось на зразок цього:" + +msgid "2010-12-12 11:41:42,612 is when this event was logged." +msgstr "" + +msgid "" +"The default format for date/time display (shown above) is like ISO8601 or :" +"rfc:`3339`. If you need more control over the formatting of the date/time, " +"provide a *datefmt* argument to ``basicConfig``, as in this example::" +msgstr "" +"Формат за замовчуванням для відображення дати/часу (показаний вище) такий, " +"як ISO8601 або :rfc:`3339`. Якщо вам потрібен більший контроль над " +"форматуванням дати/часу, надайте аргумент *datefmt* для ``basicConfig``, як " +"у цьому прикладі::" + +msgid "" +"import logging\n" +"logging.basicConfig(format='%(asctime)s %(message)s', datefmt='%m/%d/%Y %I:" +"%M:%S %p')\n" +"logging.warning('is when this event was logged.')" +msgstr "" + +msgid "which would display something like this:" +msgstr "який відображатиме щось на зразок цього:" + +msgid "12/12/2010 11:46:36 AM is when this event was logged." +msgstr "" + +msgid "" +"The format of the *datefmt* argument is the same as supported by :func:`time." +"strftime`." +msgstr "" +"Формат аргументу *datefmt* такий самий, як підтримується :func:`time." +"strftime`." + +msgid "Next Steps" +msgstr "Наступні кроки" + +msgid "" +"That concludes the basic tutorial. It should be enough to get you up and " +"running with logging. There's a lot more that the logging package offers, " +"but to get the best out of it, you'll need to invest a little more of your " +"time in reading the following sections. If you're ready for that, grab some " +"of your favourite beverage and carry on." +msgstr "" +"На цьому основний підручник завершується. Цього має бути достатньо, щоб " +"розпочати роботу з журналюванням. Пакет журналювання пропонує багато іншого, " +"але щоб отримати від нього найкраще, вам потрібно буде витратити трохи " +"більше часу на читання наступних розділів. Якщо ви готові до цього, візьміть " +"свій улюблений напій і продовжуйте." + +msgid "" +"If your logging needs are simple, then use the above examples to incorporate " +"logging into your own scripts, and if you run into problems or don't " +"understand something, please post a question on the comp.lang.python Usenet " +"group (available at https://groups.google.com/g/comp.lang.python) and you " +"should receive help before too long." +msgstr "" + +msgid "" +"Still here? You can carry on reading the next few sections, which provide a " +"slightly more advanced/in-depth tutorial than the basic one above. After " +"that, you can take a look at the :ref:`logging-cookbook`." +msgstr "" +"Досі тут? Ви можете продовжувати читати кілька наступних розділів, які " +"містять дещо більш просунутий/поглиблений підручник, ніж основний вище. " +"Після цього ви можете переглянути :ref:`logging-cookbook`." + +msgid "Advanced Logging Tutorial" +msgstr "Навчальний посібник із розширеного журналювання" + +msgid "" +"The logging library takes a modular approach and offers several categories " +"of components: loggers, handlers, filters, and formatters." +msgstr "" +"Бібліотека журналювання має модульний підхід і пропонує кілька категорій " +"компонентів: журнали, обробники, фільтри та засоби форматування." + +msgid "Loggers expose the interface that application code directly uses." +msgstr "" +"Логери відкривають інтерфейс, який безпосередньо використовує код програми." + +msgid "" +"Handlers send the log records (created by loggers) to the appropriate " +"destination." +msgstr "" +"Обробники надсилають записи журналу (створені реєстраторами) у відповідне " +"місце призначення." + +msgid "" +"Filters provide a finer grained facility for determining which log records " +"to output." +msgstr "" +"Фільтри забезпечують точніші засоби для визначення того, які записи журналу " +"виводити." + +msgid "Formatters specify the layout of log records in the final output." +msgstr "" +"Засоби форматування вказують макет записів журналу в кінцевому виведенні." + +msgid "" +"Log event information is passed between loggers, handlers, filters and " +"formatters in a :class:`LogRecord` instance." +msgstr "" +"Інформація про подію журналу передається між реєстраторами, обробниками, " +"фільтрами та форматувальниками в екземплярі :class:`LogRecord`." + +msgid "" +"Logging is performed by calling methods on instances of the :class:`Logger` " +"class (hereafter called :dfn:`loggers`). Each instance has a name, and they " +"are conceptually arranged in a namespace hierarchy using dots (periods) as " +"separators. For example, a logger named 'scan' is the parent of loggers " +"'scan.text', 'scan.html' and 'scan.pdf'. Logger names can be anything you " +"want, and indicate the area of an application in which a logged message " +"originates." +msgstr "" +"Логування виконується шляхом виклику методів екземплярів класу :class:" +"`Logger` (надалі :dfn:`loggers`). Кожен екземпляр має назву, і вони " +"концептуально впорядковані в ієрархії простору імен із використанням крапок " +"(крапок) як роздільників. Наприклад, реєстратор під назвою \"scan\" є " +"батьківським для реєстраторів \"scan.text\", \"scan.html\" і \"scan.pdf\". " +"Імена реєстратора можуть бути будь-якими, і вони вказують на область " +"програми, з якої походить повідомлення, що реєструється." + +msgid "" +"A good convention to use when naming loggers is to use a module-level " +"logger, in each module which uses logging, named as follows::" +msgstr "" +"Хороша угода для використання під час іменування реєстраторів полягає в " +"тому, щоб використовувати реєстратор на рівні модуля, у кожному модулі, який " +"використовує журналювання, названий таким чином:" + +msgid "logger = logging.getLogger(__name__)" +msgstr "" + +msgid "" +"This means that logger names track the package/module hierarchy, and it's " +"intuitively obvious where events are logged just from the logger name." +msgstr "" +"Це означає, що імена реєстраторів відстежують ієрархію пакетів/модулів, і " +"інтуїтивно зрозуміло, де події реєструються лише з імені реєстратора." + +msgid "" +"The root of the hierarchy of loggers is called the root logger. That's the " +"logger used by the functions :func:`debug`, :func:`info`, :func:`warning`, :" +"func:`error` and :func:`critical`, which just call the same-named method of " +"the root logger. The functions and the methods have the same signatures. The " +"root logger's name is printed as 'root' in the logged output." +msgstr "" +"Корінь ієрархії реєстраторів називається кореневим реєстратором. Це " +"реєстратор, який використовують функції :func:`debug`, :func:`info`, :func:" +"`warning`, :func:`error` і :func:`critical`, які просто викликають " +"одноіменний метод кореневого реєстратора. Функції та методи мають однакові " +"сигнатури. Ім'я кореневого реєстратора друкується як 'root' у зареєстрованих " +"результатах." + +msgid "" +"It is, of course, possible to log messages to different destinations. " +"Support is included in the package for writing log messages to files, HTTP " +"GET/POST locations, email via SMTP, generic sockets, queues, or OS-specific " +"logging mechanisms such as syslog or the Windows NT event log. Destinations " +"are served by :dfn:`handler` classes. You can create your own log " +"destination class if you have special requirements not met by any of the " +"built-in handler classes." +msgstr "" +"Звичайно, можна записувати повідомлення до різних адресатів. У пакет " +"включено підтримку для запису повідомлень журналу у файли, розташування HTTP " +"GET/POST, електронну пошту через SMTP, загальні сокети, черги або специфічні " +"для ОС механізми журналювання, такі як syslog або журнал подій Windows NT. " +"Пункти призначення обслуговуються класами :dfn:`handler`. Ви можете створити " +"власний клас призначення журналу, якщо у вас є особливі вимоги, яких не " +"задовольняє жоден із вбудованих класів обробки." + +msgid "" +"By default, no destination is set for any logging messages. You can specify " +"a destination (such as console or file) by using :func:`basicConfig` as in " +"the tutorial examples. If you call the functions :func:`debug`, :func:" +"`info`, :func:`warning`, :func:`error` and :func:`critical`, they will check " +"to see if no destination is set; and if one is not set, they will set a " +"destination of the console (``sys.stderr``) and a default format for the " +"displayed message before delegating to the root logger to do the actual " +"message output." +msgstr "" +"За замовчуванням адресат не встановлено для будь-яких повідомлень журналу. " +"Ви можете вказати призначення (наприклад, консоль або файл) за допомогою :" +"func:`basicConfig`, як у прикладах підручника. Якщо ви викликаєте функції :" +"func:`debug`, :func:`info`, :func:`warning`, :func:`error` і :func:" +"`critical`, вони перевірять, чи не встановлено місце призначення ; і якщо " +"його не встановлено, вони встановлять призначення консолі (``sys.stderr``) і " +"формат за замовчуванням для відображеного повідомлення перед делегуванням " +"кореневому реєстратору для фактичного виведення повідомлення." + +msgid "The default format set by :func:`basicConfig` for messages is:" +msgstr "Типовий формат, встановлений :func:`basicConfig` для повідомлень:" + +msgid "severity:logger name:message" +msgstr "" + +msgid "" +"You can change this by passing a format string to :func:`basicConfig` with " +"the *format* keyword argument. For all options regarding how a format string " +"is constructed, see :ref:`formatter-objects`." +msgstr "" +"Ви можете змінити це, передавши рядок формату в :func:`basicConfig` з " +"ключовим аргументом *format*. Щоб дізнатися про всі варіанти створення рядка " +"формату, перегляньте :ref:`formatter-objects`." + +msgid "Logging Flow" +msgstr "Потік журналювання" + +msgid "" +"The flow of log event information in loggers and handlers is illustrated in " +"the following diagram." +msgstr "" +"Потік інформації про подію журналу в реєстраторах і обробниках показано на " +"наступній діаграмі." + +msgid "Loggers" +msgstr "Лісоруби" + +msgid "" +":class:`Logger` objects have a threefold job. First, they expose several " +"methods to application code so that applications can log messages at " +"runtime. Second, logger objects determine which log messages to act upon " +"based upon severity (the default filtering facility) or filter objects. " +"Third, logger objects pass along relevant log messages to all interested log " +"handlers." +msgstr "" +"Об’єкти :class:`Logger` виконують потрійну роботу. По-перше, вони надають " +"кілька методів коду програми, щоб програми могли реєструвати повідомлення " +"під час виконання. По-друге, об’єкти реєстратора визначають, з якими " +"повідомленнями журналу діяти, залежно від серйозності (засоби фільтрації за " +"замовчуванням) або об’єктів фільтрації. По-третє, об’єкти журналу передають " +"відповідні повідомлення журналу всім зацікавленим обробникам журналів." + +msgid "" +"The most widely used methods on logger objects fall into two categories: " +"configuration and message sending." +msgstr "" +"Найбільш широко використовувані методи для об’єктів журналу діляться на дві " +"категорії: конфігурація та надсилання повідомлень." + +msgid "These are the most common configuration methods:" +msgstr "Ось найпоширеніші методи налаштування:" + +msgid "" +":meth:`Logger.setLevel` specifies the lowest-severity log message a logger " +"will handle, where debug is the lowest built-in severity level and critical " +"is the highest built-in severity. For example, if the severity level is " +"INFO, the logger will handle only INFO, WARNING, ERROR, and CRITICAL " +"messages and will ignore DEBUG messages." +msgstr "" +":meth:`Logger.setLevel` визначає повідомлення журналу з найнижчим рівнем " +"серйозності, яке обробить реєстратор, де debug — найнижчий вбудований рівень " +"серйозності, а критичний — найвищий вбудований рівень серйозності. " +"Наприклад, якщо рівень серйозності INFO, реєстратор оброблятиме лише " +"повідомлення INFO, WARNING, ERROR і CRITICAL і ігноруватиме повідомлення " +"DEBUG." + +msgid "" +":meth:`Logger.addHandler` and :meth:`Logger.removeHandler` add and remove " +"handler objects from the logger object. Handlers are covered in more detail " +"in :ref:`handler-basic`." +msgstr "" +":meth:`Logger.addHandler` і :meth:`Logger.removeHandler` додають і видаляють " +"об’єкти обробки з об’єкта реєстратора. Обробники описані більш детально в :" +"ref:`handler-basic`." + +msgid "" +":meth:`Logger.addFilter` and :meth:`Logger.removeFilter` add and remove " +"filter objects from the logger object. Filters are covered in more detail " +"in :ref:`filter`." +msgstr "" +":meth:`Logger.addFilter` і :meth:`Logger.removeFilter` додають і видаляють " +"об’єкти фільтрів з об’єкта реєстратора. Фільтри описані більш детально в :" +"ref:`filter`." + +msgid "" +"You don't need to always call these methods on every logger you create. See " +"the last two paragraphs in this section." +msgstr "" +"Вам не потрібно завжди викликати ці методи в кожному створеному вами " +"реєстраторі. Дивіться останні два абзаци цього розділу." + +msgid "" +"With the logger object configured, the following methods create log messages:" +msgstr "" +"Якщо об’єкт журналу налаштовано, такі методи створюють повідомлення журналу:" + +msgid "" +":meth:`Logger.debug`, :meth:`Logger.info`, :meth:`Logger.warning`, :meth:" +"`Logger.error`, and :meth:`Logger.critical` all create log records with a " +"message and a level that corresponds to their respective method names. The " +"message is actually a format string, which may contain the standard string " +"substitution syntax of ``%s``, ``%d``, ``%f``, and so on. The rest of their " +"arguments is a list of objects that correspond with the substitution fields " +"in the message. With regard to ``**kwargs``, the logging methods care only " +"about a keyword of ``exc_info`` and use it to determine whether to log " +"exception information." +msgstr "" +":meth:`Logger.debug`, :meth:`Logger.info`, :meth:`Logger.warning`, :meth:" +"`Logger.error` і :meth:`Logger.critical` створюють записи журналу з " +"повідомлення та рівень, що відповідає їх відповідним назвам методів. " +"Повідомлення фактично є рядком формату, який може містити стандартний " +"синтаксис заміни рядка ``%s``, ``%d``, ``%f`` і так далі. Решта аргументів — " +"це список об’єктів, які відповідають полям підстановки в повідомленні. Щодо " +"``**kwargs``, методи журналювання дбають лише про ключове слово ``exc_info`` " +"і використовують його, щоб визначити, чи потрібно реєструвати інформацію про " +"винятки." + +msgid "" +":meth:`Logger.exception` creates a log message similar to :meth:`Logger." +"error`. The difference is that :meth:`Logger.exception` dumps a stack trace " +"along with it. Call this method only from an exception handler." +msgstr "" +":meth:`Logger.exception` створює повідомлення журналу, подібне до :meth:" +"`Logger.error`. Різниця полягає в тому, що :meth:`Logger.exception` виводить " +"трасування стека разом із ним. Викликайте цей метод лише з обробника " +"винятків." + +msgid "" +":meth:`Logger.log` takes a log level as an explicit argument. This is a " +"little more verbose for logging messages than using the log level " +"convenience methods listed above, but this is how to log at custom log " +"levels." +msgstr "" +":meth:`Logger.log` приймає рівень журналу як явний аргумент. Це трохи " +"докладніше для реєстрації повідомлень, ніж використання зручних методів на " +"рівні журналу, перелічених вище, але це те, як реєструвати на спеціальних " +"рівнях журналу." + +msgid "" +":func:`getLogger` returns a reference to a logger instance with the " +"specified name if it is provided, or ``root`` if not. The names are period-" +"separated hierarchical structures. Multiple calls to :func:`getLogger` with " +"the same name will return a reference to the same logger object. Loggers " +"that are further down in the hierarchical list are children of loggers " +"higher up in the list. For example, given a logger with a name of ``foo``, " +"loggers with names of ``foo.bar``, ``foo.bar.baz``, and ``foo.bam`` are all " +"descendants of ``foo``." +msgstr "" +":func:`getLogger` повертає посилання на екземпляр журналу з указаним іменем, " +"якщо воно надано, або ``root``, якщо ні. Назви є ієрархічними структурами, " +"розділеними на періоди. Кілька викликів :func:`getLogger` з однаковою назвою " +"повертатимуть посилання на той самий об’єкт журналу. Реєстратори, " +"розташовані нижче в ієрархічному списку, є нащадками реєстраторів, " +"розташованих вище в списку. Наприклад, якщо задано реєстратор із іменем " +"``foo``, усі реєстратори з іменами ``foo.bar``, ``foo.bar.baz`` і ``foo." +"bam`` є нащадками ``фу``." + +msgid "" +"Loggers have a concept of *effective level*. If a level is not explicitly " +"set on a logger, the level of its parent is used instead as its effective " +"level. If the parent has no explicit level set, *its* parent is examined, " +"and so on - all ancestors are searched until an explicitly set level is " +"found. The root logger always has an explicit level set (``WARNING`` by " +"default). When deciding whether to process an event, the effective level of " +"the logger is used to determine whether the event is passed to the logger's " +"handlers." +msgstr "" +"Лісоруби мають поняття *ефективного рівня*. Якщо рівень не встановлено явно " +"в реєстраторі, рівень його батьківського елемента використовується замість " +"цього як ефективний рівень. Якщо батьківський елемент не має явно " +"встановленого рівня, перевіряється *його* батьківський елемент, і так далі - " +"шукаються всі предки, доки не буде знайдено явно встановлений рівень. " +"Кореневий реєстратор завжди має чітко встановлений рівень (``ПОПЕРЕДЖЕННЯ`` " +"за замовчуванням). При прийнятті рішення про обробку події ефективний рівень " +"реєстратора використовується для визначення того, чи подія передається " +"обробникам реєстратора." + +msgid "" +"Child loggers propagate messages up to the handlers associated with their " +"ancestor loggers. Because of this, it is unnecessary to define and configure " +"handlers for all the loggers an application uses. It is sufficient to " +"configure handlers for a top-level logger and create child loggers as " +"needed. (You can, however, turn off propagation by setting the *propagate* " +"attribute of a logger to ``False``.)" +msgstr "" +"Дочірні реєстратори поширюють повідомлення до обробників, пов’язаних із " +"їхніми попередніми реєстраторами. Через це немає необхідності визначати та " +"налаштовувати обробники для всіх реєстраторів, які використовує програма. " +"Достатньо налаштувати обробники для реєстратора верхнього рівня та створити " +"дочірні реєстратори за потреби. (Проте ви можете вимкнути розповсюдження, " +"встановивши для атрибута *propagate* реєстратора значення ``False``.)" + +msgid "Handlers" +msgstr "Обробники" + +msgid "" +":class:`~logging.Handler` objects are responsible for dispatching the " +"appropriate log messages (based on the log messages' severity) to the " +"handler's specified destination. :class:`Logger` objects can add zero or " +"more handler objects to themselves with an :meth:`~Logger.addHandler` " +"method. As an example scenario, an application may want to send all log " +"messages to a log file, all log messages of error or higher to stdout, and " +"all messages of critical to an email address. This scenario requires three " +"individual handlers where each handler is responsible for sending messages " +"of a specific severity to a specific location." +msgstr "" +"Об’єкти :class:`~logging.Handler` відповідають за надсилання відповідних " +"повідомлень журналу (залежно від серйозності повідомлень журналу) до " +"вказаного призначення обробника. Об’єкти :class:`Logger` можуть додавати до " +"себе нуль або більше об’єктів обробки за допомогою методу :meth:`~Logger." +"addHandler`. Як приклад сценарію, програма може захотіти надіслати всі " +"повідомлення журналу до файлу журналу, усі повідомлення журналу про помилку " +"або вище до stdout, а всі критичні повідомлення на адресу електронної пошти. " +"Цей сценарій потребує трьох окремих обробників, де кожен обробник відповідає " +"за надсилання повідомлень певного рівня серйозності в певне місце." + +msgid "" +"The standard library includes quite a few handler types (see :ref:`useful-" +"handlers`); the tutorials use mainly :class:`StreamHandler` and :class:" +"`FileHandler` in its examples." +msgstr "" +"Стандартна бібліотека включає досить багато типів обробників (див. :ref:" +"`useful-handlers`); навчальні посібники в основному використовують :class:" +"`StreamHandler` і :class:`FileHandler` у своїх прикладах." + +msgid "" +"There are very few methods in a handler for application developers to " +"concern themselves with. The only handler methods that seem relevant for " +"application developers who are using the built-in handler objects (that is, " +"not creating custom handlers) are the following configuration methods:" +msgstr "" +"У обробнику дуже мало методів, якими можуть зайнятися розробники програм. " +"Єдиними методами обробки, які здаються актуальними для розробників додатків, " +"які використовують вбудовані об’єкти обробки (тобто не створюють спеціальні " +"обробники), є такі методи конфігурації:" + +msgid "" +"The :meth:`~Handler.setLevel` method, just as in logger objects, specifies " +"the lowest severity that will be dispatched to the appropriate destination. " +"Why are there two :meth:`~Handler.setLevel` methods? The level set in the " +"logger determines which severity of messages it will pass to its handlers. " +"The level set in each handler determines which messages that handler will " +"send on." +msgstr "" + +msgid "" +":meth:`~Handler.setFormatter` selects a Formatter object for this handler to " +"use." +msgstr "" +":meth:`~Handler.setFormatter` вибирає об’єкт Formatter для використання цим " +"обробником." + +msgid "" +":meth:`~Handler.addFilter` and :meth:`~Handler.removeFilter` respectively " +"configure and deconfigure filter objects on handlers." +msgstr "" +":meth:`~Handler.addFilter` і :meth:`~Handler.removeFilter` відповідно " +"налаштовують і деконфігурують об’єкти фільтрів на обробниках." + +msgid "" +"Application code should not directly instantiate and use instances of :class:" +"`Handler`. Instead, the :class:`Handler` class is a base class that defines " +"the interface that all handlers should have and establishes some default " +"behavior that child classes can use (or override)." +msgstr "" +"Код програми не повинен безпосередньо створювати та використовувати " +"екземпляри :class:`Handler`. Натомість клас :class:`Handler` є базовим " +"класом, який визначає інтерфейс, який повинні мати всі обробники, і " +"встановлює певну поведінку за замовчуванням, яку дочірні класи можуть " +"використовувати (або замінювати)." + +msgid "Formatters" +msgstr "Форматери" + +msgid "" +"Formatter objects configure the final order, structure, and contents of the " +"log message. Unlike the base :class:`logging.Handler` class, application " +"code may instantiate formatter classes, although you could likely subclass " +"the formatter if your application needs special behavior. The constructor " +"takes three optional arguments -- a message format string, a date format " +"string and a style indicator." +msgstr "" +"Об’єкти форматувальника налаштовують остаточний порядок, структуру та вміст " +"повідомлення журналу. На відміну від базового класу :class:`logging." +"Handler`, код програми може створювати екземпляри класів форматера, хоча ви, " +"ймовірно, можете створити підкласи форматера, якщо ваша програма потребує " +"особливої поведінки. Конструктор приймає три необов'язкові аргументи - рядок " +"формату повідомлення, рядок формату дати та індикатор стилю." + +msgid "" +"If there is no message format string, the default is to use the raw " +"message. If there is no date format string, the default date format is:" +msgstr "" +"Якщо рядок формату повідомлення відсутній, за умовчанням використовується " +"необроблене повідомлення. Якщо рядок формату дати відсутній, стандартний " +"формат дати:" + +msgid "%Y-%m-%d %H:%M:%S" +msgstr "" + +msgid "" +"with the milliseconds tacked on at the end. The ``style`` is one of ``'%'``, " +"``'{'``, or ``'$'``. If one of these is not specified, then ``'%'`` will be " +"used." +msgstr "" + +msgid "" +"If the ``style`` is ``'%'``, the message format string uses ``%()s`` styled string substitution; the possible keys are documented in :" +"ref:`logrecord-attributes`. If the style is ``'{'``, the message format " +"string is assumed to be compatible with :meth:`str.format` (using keyword " +"arguments), while if the style is ``'$'`` then the message format string " +"should conform to what is expected by :meth:`string.Template.substitute`." +msgstr "" + +msgid "Added the ``style`` parameter." +msgstr "Додано параметр ``style``." + +msgid "" +"The following message format string will log the time in a human-readable " +"format, the severity of the message, and the contents of the message, in " +"that order::" +msgstr "" +"Наступний рядок формату повідомлення реєструватиме час у зрозумілому для " +"людини форматі, серйозність повідомлення та вміст повідомлення в такому " +"порядку:" + +msgid "'%(asctime)s - %(levelname)s - %(message)s'" +msgstr "" + +msgid "" +"Formatters use a user-configurable function to convert the creation time of " +"a record to a tuple. By default, :func:`time.localtime` is used; to change " +"this for a particular formatter instance, set the ``converter`` attribute of " +"the instance to a function with the same signature as :func:`time.localtime` " +"or :func:`time.gmtime`. To change it for all formatters, for example if you " +"want all logging times to be shown in GMT, set the ``converter`` attribute " +"in the Formatter class (to ``time.gmtime`` for GMT display)." +msgstr "" +"Форматери використовують настроювану користувачем функцію для перетворення " +"часу створення запису в кортеж. За замовчуванням використовується :func:" +"`time.localtime`; щоб змінити це для певного екземпляра форматера, " +"установіть атрибут ``converter`` екземпляра на функцію з тим самим підписом, " +"що й :func:`time.localtime` або :func:`time.gmtime`. Щоб змінити його для " +"всіх засобів форматування, наприклад, якщо ви хочете, щоб усі часи " +"журналювання відображалися за GMT, установіть атрибут ``converter`` у класі " +"Formatter (на ``time.gmtime`` для відображення GMT)." + +msgid "Configuring Logging" +msgstr "Налаштування журналювання" + +msgid "Programmers can configure logging in three ways:" +msgstr "Програмісти можуть налаштувати журналювання трьома способами:" + +msgid "" +"Creating loggers, handlers, and formatters explicitly using Python code that " +"calls the configuration methods listed above." +msgstr "" +"Створення реєстраторів, обробників і форматувальників явно за допомогою коду " +"Python, який викликає перелічені вище методи конфігурації." + +msgid "" +"Creating a logging config file and reading it using the :func:`fileConfig` " +"function." +msgstr "" +"Створення файлу конфігурації журналу та його читання за допомогою функції :" +"func:`fileConfig`." + +msgid "" +"Creating a dictionary of configuration information and passing it to the :" +"func:`dictConfig` function." +msgstr "" +"Створення словника конфігураційної інформації та передача його функції :func:" +"`dictConfig`." + +msgid "" +"For the reference documentation on the last two options, see :ref:`logging-" +"config-api`. The following example configures a very simple logger, a " +"console handler, and a simple formatter using Python code::" +msgstr "" +"Довідкову документацію щодо останніх двох параметрів див. :ref:`logging-" +"config-api`. У наступному прикладі налаштовується дуже простий реєстратор, " +"обробник консолі та простий засіб форматування за допомогою коду Python::" + +msgid "" +"import logging\n" +"\n" +"# create logger\n" +"logger = logging.getLogger('simple_example')\n" +"logger.setLevel(logging.DEBUG)\n" +"\n" +"# create console handler and set level to debug\n" +"ch = logging.StreamHandler()\n" +"ch.setLevel(logging.DEBUG)\n" +"\n" +"# create formatter\n" +"formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - " +"%(message)s')\n" +"\n" +"# add formatter to ch\n" +"ch.setFormatter(formatter)\n" +"\n" +"# add ch to logger\n" +"logger.addHandler(ch)\n" +"\n" +"# 'application' code\n" +"logger.debug('debug message')\n" +"logger.info('info message')\n" +"logger.warning('warn message')\n" +"logger.error('error message')\n" +"logger.critical('critical message')" +msgstr "" + +msgid "" +"Running this module from the command line produces the following output:" +msgstr "Запуск цього модуля з командного рядка дає такий результат:" + +msgid "" +"$ python simple_logging_module.py\n" +"2005-03-19 15:10:26,618 - simple_example - DEBUG - debug message\n" +"2005-03-19 15:10:26,620 - simple_example - INFO - info message\n" +"2005-03-19 15:10:26,695 - simple_example - WARNING - warn message\n" +"2005-03-19 15:10:26,697 - simple_example - ERROR - error message\n" +"2005-03-19 15:10:26,773 - simple_example - CRITICAL - critical message" +msgstr "" + +msgid "" +"The following Python module creates a logger, handler, and formatter nearly " +"identical to those in the example listed above, with the only difference " +"being the names of the objects::" +msgstr "" +"Наступний модуль Python створює реєстратор, обробник і форматування, майже " +"ідентичні тим, що в наведеному вище прикладі, з тією лише різницею, як імена " +"об’єктів:" + +msgid "" +"import logging\n" +"import logging.config\n" +"\n" +"logging.config.fileConfig('logging.conf')\n" +"\n" +"# create logger\n" +"logger = logging.getLogger('simpleExample')\n" +"\n" +"# 'application' code\n" +"logger.debug('debug message')\n" +"logger.info('info message')\n" +"logger.warning('warn message')\n" +"logger.error('error message')\n" +"logger.critical('critical message')" +msgstr "" + +msgid "Here is the logging.conf file:" +msgstr "Ось файл logging.conf:" + +msgid "" +"[loggers]\n" +"keys=root,simpleExample\n" +"\n" +"[handlers]\n" +"keys=consoleHandler\n" +"\n" +"[formatters]\n" +"keys=simpleFormatter\n" +"\n" +"[logger_root]\n" +"level=DEBUG\n" +"handlers=consoleHandler\n" +"\n" +"[logger_simpleExample]\n" +"level=DEBUG\n" +"handlers=consoleHandler\n" +"qualname=simpleExample\n" +"propagate=0\n" +"\n" +"[handler_consoleHandler]\n" +"class=StreamHandler\n" +"level=DEBUG\n" +"formatter=simpleFormatter\n" +"args=(sys.stdout,)\n" +"\n" +"[formatter_simpleFormatter]\n" +"format=%(asctime)s - %(name)s - %(levelname)s - %(message)s" +msgstr "" + +msgid "" +"The output is nearly identical to that of the non-config-file-based example:" +msgstr "Результат майже ідентичний прикладу без конфігураційного файлу:" + +msgid "" +"$ python simple_logging_config.py\n" +"2005-03-19 15:38:55,977 - simpleExample - DEBUG - debug message\n" +"2005-03-19 15:38:55,979 - simpleExample - INFO - info message\n" +"2005-03-19 15:38:56,054 - simpleExample - WARNING - warn message\n" +"2005-03-19 15:38:56,055 - simpleExample - ERROR - error message\n" +"2005-03-19 15:38:56,130 - simpleExample - CRITICAL - critical message" +msgstr "" + +msgid "" +"You can see that the config file approach has a few advantages over the " +"Python code approach, mainly separation of configuration and code and the " +"ability of noncoders to easily modify the logging properties." +msgstr "" +"Ви бачите, що підхід із конфігураційним файлом має кілька переваг перед " +"підходом до коду Python, головним чином розділення конфігурації та коду та " +"можливість некодерів легко змінювати властивості журналювання." + +msgid "" +"The :func:`fileConfig` function takes a default parameter, " +"``disable_existing_loggers``, which defaults to ``True`` for reasons of " +"backward compatibility. This may or may not be what you want, since it will " +"cause any non-root loggers existing before the :func:`fileConfig` call to be " +"disabled unless they (or an ancestor) are explicitly named in the " +"configuration. Please refer to the reference documentation for more " +"information, and specify ``False`` for this parameter if you wish." +msgstr "" +"Функція :func:`fileConfig` приймає параметр за замовчуванням, " +"``disable_existing_loggers``, який за умовчанням має значення ``True`` з " +"причин зворотної сумісності. Це може бути або не те, що ви хочете, оскільки " +"це призведе до вимкнення будь-яких некореневих реєстраторів, які існують до " +"виклику :func:`fileConfig`, якщо вони (або предок) явно не вказані в " +"конфігурації. Будь ласка, зверніться до довідкової документації для " +"отримання додаткової інформації та вкажіть ``False`` для цього параметра, " +"якщо хочете." + +msgid "" +"The dictionary passed to :func:`dictConfig` can also specify a Boolean value " +"with key ``disable_existing_loggers``, which if not specified explicitly in " +"the dictionary also defaults to being interpreted as ``True``. This leads to " +"the logger-disabling behaviour described above, which may not be what you " +"want - in which case, provide the key explicitly with a value of ``False``." +msgstr "" +"Словник, переданий у :func:`dictConfig`, також може вказати логічне значення " +"з ключем ``disable_existing_loggers``, яке, якщо не вказано явно в словнику, " +"також за умовчанням інтерпретується як ``True``. Це призводить до поведінки " +"вимкнення реєстратора, описаної вище, яка може не відповідати вашим " +"побажанням - у такому випадку вкажіть ключ явно зі значенням ``False``." + +msgid "" +"Note that the class names referenced in config files need to be either " +"relative to the logging module, or absolute values which can be resolved " +"using normal import mechanisms. Thus, you could use either :class:`~logging." +"handlers.WatchedFileHandler` (relative to the logging module) or ``mypackage." +"mymodule.MyHandler`` (for a class defined in package ``mypackage`` and " +"module ``mymodule``, where ``mypackage`` is available on the Python import " +"path)." +msgstr "" +"Зауважте, що назви класів, на які посилаються у конфігураційних файлах, " +"мають бути або відносними до модуля журналювання, або абсолютними " +"значеннями, які можна вирішити за допомогою звичайних механізмів імпорту. " +"Таким чином, ви можете використовувати :class:`~logging.handlers." +"WatchedFileHandler` (щодо модуля журналювання) або ``mypackage.mymodule." +"MyHandler`` (для класу, визначеного в пакунку ``mypackage`` і модулі " +"``mymodule``, де ``mypackage`` доступний на шляху імпорту Python)." + +msgid "" +"In Python 3.2, a new means of configuring logging has been introduced, using " +"dictionaries to hold configuration information. This provides a superset of " +"the functionality of the config-file-based approach outlined above, and is " +"the recommended configuration method for new applications and deployments. " +"Because a Python dictionary is used to hold configuration information, and " +"since you can populate that dictionary using different means, you have more " +"options for configuration. For example, you can use a configuration file in " +"JSON format, or, if you have access to YAML processing functionality, a file " +"in YAML format, to populate the configuration dictionary. Or, of course, you " +"can construct the dictionary in Python code, receive it in pickled form over " +"a socket, or use whatever approach makes sense for your application." +msgstr "" +"У Python 3.2 було введено новий засіб конфігурації журналювання, " +"використовуючи словники для зберігання конфігураційної інформації. Це " +"забезпечує надмножину функціональних можливостей підходу на основі " +"конфігураційного файлу, описаного вище, і є рекомендованим методом " +"конфігурації для нових програм і розгортань. Оскільки словник Python " +"використовується для зберігання конфігураційної інформації, і оскільки ви " +"можете заповнювати цей словник різними засобами, у вас є більше можливостей " +"для конфігурації. Наприклад, ви можете використовувати файл конфігурації у " +"форматі JSON або, якщо у вас є доступ до функцій обробки YAML, файл у " +"форматі YAML, щоб заповнити словник конфігурації. Або, звісно, ви можете " +"побудувати словник у коді Python, отримати його в маринованому вигляді через " +"сокет або використати будь-який підхід, який має сенс для вашої програми." + +msgid "" +"Here's an example of the same configuration as above, in YAML format for the " +"new dictionary-based approach:" +msgstr "" +"Ось приклад тієї ж конфігурації, що й вище, у форматі YAML для нового " +"підходу на основі словника:" + +msgid "" +"version: 1\n" +"formatters:\n" +" simple:\n" +" format: '%(asctime)s - %(name)s - %(levelname)s - %(message)s'\n" +"handlers:\n" +" console:\n" +" class: logging.StreamHandler\n" +" level: DEBUG\n" +" formatter: simple\n" +" stream: ext://sys.stdout\n" +"loggers:\n" +" simpleExample:\n" +" level: DEBUG\n" +" handlers: [console]\n" +" propagate: no\n" +"root:\n" +" level: DEBUG\n" +" handlers: [console]" +msgstr "" + +msgid "" +"For more information about logging using a dictionary, see :ref:`logging-" +"config-api`." +msgstr "" +"Для отримання додаткової інформації про журналювання за допомогою словника " +"див. :ref:`logging-config-api`." + +msgid "What happens if no configuration is provided" +msgstr "Що станеться, якщо конфігурацію не надано" + +msgid "" +"If no logging configuration is provided, it is possible to have a situation " +"where a logging event needs to be output, but no handlers can be found to " +"output the event." +msgstr "" + +msgid "" +"The event is output using a 'handler of last resort', stored in :data:" +"`lastResort`. This internal handler is not associated with any logger, and " +"acts like a :class:`~logging.StreamHandler` which writes the event " +"description message to the current value of ``sys.stderr`` (therefore " +"respecting any redirections which may be in effect). No formatting is done " +"on the message - just the bare event description message is printed. The " +"handler's level is set to ``WARNING``, so all events at this and greater " +"severities will be output." +msgstr "" + +msgid "For versions of Python prior to 3.2, the behaviour is as follows:" +msgstr "Для версій Python до 3.2 поведінка така:" + +msgid "" +"If :data:`raiseExceptions` is ``False`` (production mode), the event is " +"silently dropped." +msgstr "" + +msgid "" +"If :data:`raiseExceptions` is ``True`` (development mode), a message 'No " +"handlers could be found for logger X.Y.Z' is printed once." +msgstr "" + +msgid "" +"To obtain the pre-3.2 behaviour, :data:`lastResort` can be set to ``None``." +msgstr "" + +msgid "Configuring Logging for a Library" +msgstr "Налаштування журналювання для бібліотеки" + +msgid "" +"When developing a library which uses logging, you should take care to " +"document how the library uses logging - for example, the names of loggers " +"used. Some consideration also needs to be given to its logging " +"configuration. If the using application does not use logging, and library " +"code makes logging calls, then (as described in the previous section) events " +"of severity ``WARNING`` and greater will be printed to ``sys.stderr``. This " +"is regarded as the best default behaviour." +msgstr "" +"Розробляючи бібліотеку, яка використовує журналювання, ви повинні подбати " +"про документування того, як бібліотека використовує журналювання - " +"наприклад, імена використовуваних журналів. Певну увагу також слід приділити " +"його конфігурації журналювання. Якщо програма, що використовує, не " +"використовує журналювання, а код бібліотеки здійснює виклики журналювання, " +"тоді (як описано в попередньому розділі) події серйозності ``ПОПЕРЕДЖЕННЯ`` " +"і вище будуть надруковані в ``sys.stderr``. Це вважається найкращою " +"поведінкою за умовчанням." + +msgid "" +"If for some reason you *don't* want these messages printed in the absence of " +"any logging configuration, you can attach a do-nothing handler to the top-" +"level logger for your library. This avoids the message being printed, since " +"a handler will always be found for the library's events: it just doesn't " +"produce any output. If the library user configures logging for application " +"use, presumably that configuration will add some handlers, and if levels are " +"suitably configured then logging calls made in library code will send output " +"to those handlers, as normal." +msgstr "" +"Якщо з якоїсь причини ви *не* хочете, щоб ці повідомлення друкувались за " +"відсутності будь-якої конфігурації журналювання, ви можете приєднати " +"обробник нічого не робити до реєстратора верхнього рівня для вашої " +"бібліотеки. Це дозволяє уникнути друку повідомлення, оскільки для подій " +"бібліотеки завжди буде знайдено обробник: він просто не створює жодних " +"виводів. Якщо користувач бібліотеки налаштовує журналювання для використання " +"програмою, імовірно, ця конфігурація додасть деякі обробники, і якщо рівні " +"налаштовано відповідним чином, виклики журналювання, зроблені в коді " +"бібліотеки, надсилатимуть вихідні дані цим обробникам, як зазвичай." + +msgid "" +"A do-nothing handler is included in the logging package: :class:`~logging." +"NullHandler` (since Python 3.1). An instance of this handler could be added " +"to the top-level logger of the logging namespace used by the library (*if* " +"you want to prevent your library's logged events being output to ``sys." +"stderr`` in the absence of logging configuration). If all logging by a " +"library *foo* is done using loggers with names matching 'foo.x', 'foo.x.y', " +"etc. then the code::" +msgstr "" +"Обробник нічого не робиться включено в пакет журналювання: :class:`~logging." +"NullHandler` (починаючи з Python 3.1). Екземпляр цього обробника можна " +"додати до реєстратора верхнього рівня простору імен журналювання, який " +"використовується бібліотекою (*якщо* ви хочете запобігти виведенню " +"зареєстрованих у бібліотеці подій у ``sys.stderr`` за відсутності " +"конфігурації журналювання ). Якщо все журналювання бібліотекою *foo* " +"здійснюється за допомогою реєстраторів з іменами, що відповідають \"foo.x\", " +"\"foo.x.y\" тощо, тоді код::" + +msgid "" +"import logging\n" +"logging.getLogger('foo').addHandler(logging.NullHandler())" +msgstr "" + +msgid "" +"should have the desired effect. If an organisation produces a number of " +"libraries, then the logger name specified can be 'orgname.foo' rather than " +"just 'foo'." +msgstr "" +"має мати бажаний ефект. Якщо організація виробляє декілька бібліотек, то " +"ім’я реєстратора може бути \"orgname.foo\", а не просто \"foo\"." + +msgid "" +"It is strongly advised that you *do not log to the root logger* in your " +"library. Instead, use a logger with a unique and easily identifiable name, " +"such as the ``__name__`` for your library's top-level package or module. " +"Logging to the root logger will make it difficult or impossible for the " +"application developer to configure the logging verbosity or handlers of your " +"library as they wish." +msgstr "" + +msgid "" +"It is strongly advised that you *do not add any handlers other than* :class:" +"`~logging.NullHandler` *to your library's loggers*. This is because the " +"configuration of handlers is the prerogative of the application developer " +"who uses your library. The application developer knows their target audience " +"and what handlers are most appropriate for their application: if you add " +"handlers 'under the hood', you might well interfere with their ability to " +"carry out unit tests and deliver logs which suit their requirements." +msgstr "" +"Настійно рекомендується *не додавати жодних обробників, окрім* :class:" +"`~logging.NullHandler` *до реєстраторів вашої бібліотеки*. Це пояснюється " +"тим, що конфігурація обробників є прерогативою розробника програми, який " +"використовує вашу бібліотеку. Розробник програми знає свою цільову аудиторію " +"та знає, які обробники найбільше підходять для їхньої програми: якщо ви " +"додасте обробники \"під капотом\", ви цілком можете втрутитися в їх " +"здатність виконувати модульні тести та доставляти журнали, які відповідають " +"їхнім вимогам." + +msgid "Logging Levels" +msgstr "Рівні реєстрації" + +msgid "" +"The numeric values of logging levels are given in the following table. These " +"are primarily of interest if you want to define your own levels, and need " +"them to have specific values relative to the predefined levels. If you " +"define a level with the same numeric value, it overwrites the predefined " +"value; the predefined name is lost." +msgstr "" +"Числові значення рівнів журналювання наведені в наступній таблиці. Це " +"насамперед цікаво, якщо ви бажаєте визначити власні рівні та потребуєте, щоб " +"вони мали певні значення відносно попередньо визначених рівнів. Якщо ви " +"визначаєте рівень з тим самим числовим значенням, він перезаписує попередньо " +"визначене значення; попередньо визначене ім'я втрачено." + +msgid "Numeric value" +msgstr "Числове значення" + +msgid "50" +msgstr "50" + +msgid "40" +msgstr "40" + +msgid "30" +msgstr "30" + +msgid "20" +msgstr "20" + +msgid "10" +msgstr "10" + +msgid "``NOTSET``" +msgstr "``NOTSET``" + +msgid "0" +msgstr "0" + +msgid "" +"Levels can also be associated with loggers, being set either by the " +"developer or through loading a saved logging configuration. When a logging " +"method is called on a logger, the logger compares its own level with the " +"level associated with the method call. If the logger's level is higher than " +"the method call's, no logging message is actually generated. This is the " +"basic mechanism controlling the verbosity of logging output." +msgstr "" +"Рівні також можуть бути пов’язані з реєстраторами, які встановлюються " +"розробником або через завантаження збереженої конфігурації журналювання. " +"Коли в реєстраторі викликається метод ведення журналу, реєстратор порівнює " +"свій власний рівень із рівнем, пов’язаним із викликом методу. Якщо рівень " +"реєстратора вищий, ніж виклик методу, повідомлення журналу фактично не " +"генерується. Це основний механізм, який контролює докладність вихідних даних " +"журналу." + +msgid "" +"Logging messages are encoded as instances of the :class:`~logging.LogRecord` " +"class. When a logger decides to actually log an event, a :class:`~logging." +"LogRecord` instance is created from the logging message." +msgstr "" +"Повідомлення журналу кодуються як екземпляри класу :class:`~logging." +"LogRecord`. Коли реєстратор вирішує фактично зареєструвати подію, екземпляр :" +"class:`~logging.LogRecord` створюється з повідомлення журналу." + +msgid "" +"Logging messages are subjected to a dispatch mechanism through the use of :" +"dfn:`handlers`, which are instances of subclasses of the :class:`Handler` " +"class. Handlers are responsible for ensuring that a logged message (in the " +"form of a :class:`LogRecord`) ends up in a particular location (or set of " +"locations) which is useful for the target audience for that message (such as " +"end users, support desk staff, system administrators, developers). Handlers " +"are passed :class:`LogRecord` instances intended for particular " +"destinations. Each logger can have zero, one or more handlers associated " +"with it (via the :meth:`~Logger.addHandler` method of :class:`Logger`). In " +"addition to any handlers directly associated with a logger, *all handlers " +"associated with all ancestors of the logger* are called to dispatch the " +"message (unless the *propagate* flag for a logger is set to a false value, " +"at which point the passing to ancestor handlers stops)." +msgstr "" +"Повідомлення журналювання підлягають механізму відправлення за допомогою :" +"dfn:`handlers`, які є екземплярами підкласів класу :class:`Handler`. " +"Обробники відповідають за те, щоб зареєстроване повідомлення (у формі :class:" +"`LogRecord`) потрапляло в певне місце (або набір місць), яке є корисним для " +"цільової аудиторії цього повідомлення (наприклад, кінцевих користувачів, " +"співробітники служби підтримки, системні адміністратори, розробники). " +"Обробники передають екземпляри :class:`LogRecord`, призначені для певних " +"місць призначення. Кожен реєстратор може мати нуль, один або більше " +"пов’язаних з ним обробників (через метод :meth:`~Logger.addHandler` :class:" +"`Logger`). На додаток до будь-яких обробників, безпосередньо пов’язаних із " +"реєстратором, *усі обробники, пов’язані з усіма предками реєстратора* " +"викликаються для надсилання повідомлення (якщо прапор *розповсюдження* для " +"реєстратора не має значення false, після чого передача до обробників предків " +"зупиняється)." + +msgid "" +"Just as for loggers, handlers can have levels associated with them. A " +"handler's level acts as a filter in the same way as a logger's level does. " +"If a handler decides to actually dispatch an event, the :meth:`~Handler." +"emit` method is used to send the message to its destination. Most user-" +"defined subclasses of :class:`Handler` will need to override this :meth:" +"`~Handler.emit`." +msgstr "" +"Як і для реєстраторів, обробники можуть мати пов’язані з ними рівні. Рівень " +"обробника діє як фільтр так само, як і рівень реєстратора. Якщо обробник " +"вирішує фактично відправити подію, метод :meth:`~Handler.emit` " +"використовується для надсилання повідомлення до місця призначення. Більшість " +"визначених користувачем підкласів :class:`Handler` повинні замінити цей :" +"meth:`~Handler.emit`." + +msgid "Custom Levels" +msgstr "Спеціальні рівні" + +msgid "" +"Defining your own levels is possible, but should not be necessary, as the " +"existing levels have been chosen on the basis of practical experience. " +"However, if you are convinced that you need custom levels, great care should " +"be exercised when doing this, and it is possibly *a very bad idea to define " +"custom levels if you are developing a library*. That's because if multiple " +"library authors all define their own custom levels, there is a chance that " +"the logging output from such multiple libraries used together will be " +"difficult for the using developer to control and/or interpret, because a " +"given numeric value might mean different things for different libraries." +msgstr "" +"Визначення власних рівнів можливо, але це не обов’язково, оскільки існуючі " +"рівні було обрано на основі практичного досвіду. Однак, якщо ви впевнені, що " +"вам потрібні користувацькі рівні, слід бути дуже обережним, роблячи це, і " +"це, можливо, *дуже погана ідея визначати користувацькі рівні, якщо ви " +"розробляєте бібліотеку*. Це тому, що якщо кілька авторів бібліотек " +"визначають власні власні рівні, існує ймовірність того, що вихід журналу з " +"таких кількох бібліотек, які використовуються разом, розробнику буде важко " +"контролювати та/або інтерпретувати, оскільки дане числове значення може " +"означати різні речі для різних бібліотек." + +msgid "Useful Handlers" +msgstr "Корисні обробники" + +msgid "" +"In addition to the base :class:`Handler` class, many useful subclasses are " +"provided:" +msgstr "" +"Окрім базового класу :class:`Handler`, надається багато корисних підкласів:" + +msgid "" +":class:`StreamHandler` instances send messages to streams (file-like " +"objects)." +msgstr "" +"Екземпляри :class:`StreamHandler` надсилають повідомлення до потоків " +"(файлоподібних об’єктів)." + +msgid ":class:`FileHandler` instances send messages to disk files." +msgstr "" +"Екземпляри :class:`FileHandler` надсилають повідомлення до файлів на диску." + +msgid "" +":class:`~handlers.BaseRotatingHandler` is the base class for handlers that " +"rotate log files at a certain point. It is not meant to be instantiated " +"directly. Instead, use :class:`~handlers.RotatingFileHandler` or :class:" +"`~handlers.TimedRotatingFileHandler`." +msgstr "" +":class:`~handlers.BaseRotatingHandler` — це базовий клас для обробників, які " +"обертають файли журналів у певний момент. Він не призначений для " +"безпосереднього створення екземпляра. Замість цього використовуйте :class:" +"`~handlers.RotatingFileHandler` або :class:`~handlers." +"TimedRotatingFileHandler`." + +msgid "" +":class:`~handlers.RotatingFileHandler` instances send messages to disk " +"files, with support for maximum log file sizes and log file rotation." +msgstr "" +"Екземпляри :class:`~handlers.RotatingFileHandler` надсилають повідомлення до " +"файлів на диску з підтримкою максимального розміру файлу журналу та ротації " +"файлів журналу." + +msgid "" +":class:`~handlers.TimedRotatingFileHandler` instances send messages to disk " +"files, rotating the log file at certain timed intervals." +msgstr "" +":class:`~handlers.TimedRotatingFileHandler` екземпляри надсилають " +"повідомлення до дискових файлів, чергуючи файл журналу через певні проміжки " +"часу." + +msgid "" +":class:`~handlers.SocketHandler` instances send messages to TCP/IP sockets. " +"Since 3.4, Unix domain sockets are also supported." +msgstr "" +"Екземпляри :class:`~handlers.SocketHandler` надсилають повідомлення до " +"сокетів TCP/IP. Починаючи з версії 3.4, також підтримуються доменні сокети " +"Unix." + +msgid "" +":class:`~handlers.DatagramHandler` instances send messages to UDP sockets. " +"Since 3.4, Unix domain sockets are also supported." +msgstr "" +"Екземпляри :class:`~handlers.DatagramHandler` надсилають повідомлення до UDP-" +"сокетів. Починаючи з версії 3.4, також підтримуються доменні сокети Unix." + +msgid "" +":class:`~handlers.SMTPHandler` instances send messages to a designated email " +"address." +msgstr "" +"Екземпляри :class:`~handlers.SMTPHandler` надсилають повідомлення на вказану " +"електронну адресу." + +msgid "" +":class:`~handlers.SysLogHandler` instances send messages to a Unix syslog " +"daemon, possibly on a remote machine." +msgstr "" +"Екземпляри :class:`~handlers.SysLogHandler` надсилають повідомлення до " +"демона системного журналу Unix, можливо, на віддаленій машині." + +msgid "" +":class:`~handlers.NTEventLogHandler` instances send messages to a Windows " +"NT/2000/XP event log." +msgstr "" +"Екземпляри :class:`~handlers.NTEventLogHandler` надсилають повідомлення до " +"журналу подій Windows NT/2000/XP." + +msgid "" +":class:`~handlers.MemoryHandler` instances send messages to a buffer in " +"memory, which is flushed whenever specific criteria are met." +msgstr "" +"Екземпляри :class:`~handlers.MemoryHandler` надсилають повідомлення до " +"буфера в пам’яті, який очищається щоразу, коли виконуються певні критерії." + +msgid "" +":class:`~handlers.HTTPHandler` instances send messages to an HTTP server " +"using either ``GET`` or ``POST`` semantics." +msgstr "" +"Екземпляри :class:`~handlers.HTTPHandler` надсилають повідомлення на сервер " +"HTTP, використовуючи семантику ``GET`` або ``POST``." + +msgid "" +":class:`~handlers.WatchedFileHandler` instances watch the file they are " +"logging to. If the file changes, it is closed and reopened using the file " +"name. This handler is only useful on Unix-like systems; Windows does not " +"support the underlying mechanism used." +msgstr "" +"Екземпляри :class:`~handlers.WatchedFileHandler` спостерігають за файлом, до " +"якого вони входять. Якщо файл змінюється, він закривається та знову " +"відкривається з використанням імені файлу. Цей обробник корисний лише в Unix-" +"подібних системах; Windows не підтримує використовуваний основний механізм." + +msgid "" +":class:`~handlers.QueueHandler` instances send messages to a queue, such as " +"those implemented in the :mod:`queue` or :mod:`multiprocessing` modules." +msgstr "" +"Екземпляри :class:`~handlers.QueueHandler` надсилають повідомлення до черги, " +"як-от реалізовані в модулях :mod:`queue` або :mod:`multiprocessing`." + +msgid "" +":class:`NullHandler` instances do nothing with error messages. They are used " +"by library developers who want to use logging, but want to avoid the 'No " +"handlers could be found for logger *XXX*' message which can be displayed if " +"the library user has not configured logging. See :ref:`library-config` for " +"more information." +msgstr "" + +msgid "The :class:`NullHandler` class." +msgstr "Клас :class:`NullHandler`." + +msgid "The :class:`~handlers.QueueHandler` class." +msgstr "Клас :class:`~handlers.QueueHandler`." + +msgid "" +"The :class:`NullHandler`, :class:`StreamHandler` and :class:`FileHandler` " +"classes are defined in the core logging package. The other handlers are " +"defined in a sub-module, :mod:`logging.handlers`. (There is also another sub-" +"module, :mod:`logging.config`, for configuration functionality.)" +msgstr "" +"Класи :class:`NullHandler`, :class:`StreamHandler` і :class:`FileHandler` " +"визначені в базовому пакеті журналювання. Інші обробники визначені в " +"підмодулі :mod:`logging.handlers`. (Існує також інший підмодуль, :mod:" +"`logging.config`, для функціональних можливостей налаштування.)" + +msgid "" +"Logged messages are formatted for presentation through instances of the :" +"class:`Formatter` class. They are initialized with a format string suitable " +"for use with the % operator and a dictionary." +msgstr "" +"Зареєстровані повідомлення форматуються для представлення через екземпляри " +"класу :class:`Formatter`. Вони ініціалізуються рядком формату, придатним для " +"використання з оператором % і словником." + +msgid "" +"For formatting multiple messages in a batch, instances of :class:" +"`BufferingFormatter` can be used. In addition to the format string (which is " +"applied to each message in the batch), there is provision for header and " +"trailer format strings." +msgstr "" + +msgid "" +"When filtering based on logger level and/or handler level is not enough, " +"instances of :class:`Filter` can be added to both :class:`Logger` and :class:" +"`Handler` instances (through their :meth:`~Handler.addFilter` method). " +"Before deciding to process a message further, both loggers and handlers " +"consult all their filters for permission. If any filter returns a false " +"value, the message is not processed further." +msgstr "" +"Якщо фільтрації на основі рівня реєстратора та/або рівня обробника " +"недостатньо, екземпляри :class:`Filter` можна додати до екземплярів :class:" +"`Logger` і :class:`Handler` (через їх метод :meth:`~Handler.addFilter`). " +"Перш ніж вирішити продовжити обробку повідомлення, і реєстратори, і " +"обробники звертаються до всіх своїх фільтрів для отримання дозволу. Якщо " +"будь-який фільтр повертає хибне значення, повідомлення не обробляється далі." + +msgid "" +"The basic :class:`Filter` functionality allows filtering by specific logger " +"name. If this feature is used, messages sent to the named logger and its " +"children are allowed through the filter, and all others dropped." +msgstr "" +"Основна функція :class:`Filter` дозволяє фільтрувати за певним іменем " +"реєстратора. Якщо використовується ця функція, повідомлення, надіслані до " +"названого реєстратора та його дочірніх елементів, пропускаються через " +"фільтр, а всі інші відкидаються." + +msgid "Exceptions raised during logging" +msgstr "Винятки, які виникають під час реєстрації" + +msgid "" +"The logging package is designed to swallow exceptions which occur while " +"logging in production. This is so that errors which occur while handling " +"logging events - such as logging misconfiguration, network or other similar " +"errors - do not cause the application using logging to terminate prematurely." +msgstr "" +"Пакет журналювання призначений для ковтання винятків, які виникають під час " +"входу в робочу систему. Це зроблено для того, щоб помилки, які виникають під " +"час обробки подій журналювання (наприклад, неправильна конфігурація журналу, " +"мережа чи інші подібні помилки), не призвели до передчасного завершення " +"програми, яка використовує журналювання." + +msgid "" +":class:`SystemExit` and :class:`KeyboardInterrupt` exceptions are never " +"swallowed. Other exceptions which occur during the :meth:`~Handler.emit` " +"method of a :class:`Handler` subclass are passed to its :meth:`~Handler." +"handleError` method." +msgstr "" +"Винятки :class:`SystemExit` і :class:`KeyboardInterrupt` ніколи не " +"проковтуються. Інші винятки, які виникають під час методу :meth:`~Handler." +"emit` підкласу :class:`Handler`, передаються до його методу :meth:`~Handler." +"handleError`." + +msgid "" +"The default implementation of :meth:`~Handler.handleError` in :class:" +"`Handler` checks to see if a module-level variable, :data:`raiseExceptions`, " +"is set. If set, a traceback is printed to :data:`sys.stderr`. If not set, " +"the exception is swallowed." +msgstr "" +"Стандартна реалізація :meth:`~Handler.handleError` в :class:`Handler` " +"перевіряє, чи встановлено змінну рівня модуля, :data:`raiseExceptions`. Якщо " +"встановлено, зворотне відстеження друкується в :data:`sys.stderr`. Якщо не " +"встановлено, виняток проковтується." + +msgid "" +"The default value of :data:`raiseExceptions` is ``True``. This is because " +"during development, you typically want to be notified of any exceptions that " +"occur. It's advised that you set :data:`raiseExceptions` to ``False`` for " +"production usage." +msgstr "" +"Значенням за замовчуванням :data:`raiseExceptions` є ``True``. Це " +"пояснюється тим, що під час розробки ви зазвичай хочете отримувати " +"сповіщення про будь-які винятки, які трапляються. Радимо встановити :data:" +"`raiseExceptions` на ``False`` для використання у робочому режимі." + +msgid "Using arbitrary objects as messages" +msgstr "Використання довільних об’єктів як повідомлень" + +msgid "" +"In the preceding sections and examples, it has been assumed that the message " +"passed when logging the event is a string. However, this is not the only " +"possibility. You can pass an arbitrary object as a message, and its :meth:" +"`~object.__str__` method will be called when the logging system needs to " +"convert it to a string representation. In fact, if you want to, you can " +"avoid computing a string representation altogether - for example, the :class:" +"`~handlers.SocketHandler` emits an event by pickling it and sending it over " +"the wire." +msgstr "" +"У попередніх розділах і прикладах передбачалося, що повідомлення, передане " +"під час реєстрації події, є рядком. Однак це не єдина можливість. Ви можете " +"передати довільний об’єкт як повідомлення, і його метод :meth:`~object." +"__str__` буде викликано, коли системі журналювання потрібно перетворити його " +"на представлення рядка. Насправді, якщо ви хочете, ви можете взагалі " +"уникнути обчислення представлення рядка - наприклад, :class:`~handlers." +"SocketHandler` випромінює подію, вибираючи її та надсилаючи по дроту." + +msgid "Optimization" +msgstr "Оптимізація" + +msgid "" +"Formatting of message arguments is deferred until it cannot be avoided. " +"However, computing the arguments passed to the logging method can also be " +"expensive, and you may want to avoid doing it if the logger will just throw " +"away your event. To decide what to do, you can call the :meth:`~Logger." +"isEnabledFor` method which takes a level argument and returns true if the " +"event would be created by the Logger for that level of call. You can write " +"code like this::" +msgstr "" +"Форматування аргументів повідомлення відкладено, доки його не можна " +"уникнути. Однак обчислення аргументів, переданих до методу журналювання, " +"також може бути дорогим, і ви можете уникнути цього, якщо реєстратор просто " +"відкине вашу подію. Щоб вирішити, що робити, ви можете викликати метод :meth:" +"`~Logger.isEnabledFor`, який приймає аргумент рівня та повертає значення " +"true, якщо подію буде створено реєстратором для цього рівня виклику. Ви " +"можете написати такий код:" + +msgid "" +"if logger.isEnabledFor(logging.DEBUG):\n" +" logger.debug('Message with %s, %s', expensive_func1(),\n" +" expensive_func2())" +msgstr "" + +msgid "" +"so that if the logger's threshold is set above ``DEBUG``, the calls to " +"``expensive_func1`` and ``expensive_func2`` are never made." +msgstr "" + +msgid "" +"In some cases, :meth:`~Logger.isEnabledFor` can itself be more expensive " +"than you'd like (e.g. for deeply nested loggers where an explicit level is " +"only set high up in the logger hierarchy). In such cases (or if you want to " +"avoid calling a method in tight loops), you can cache the result of a call " +"to :meth:`~Logger.isEnabledFor` in a local or instance variable, and use " +"that instead of calling the method each time. Such a cached value would only " +"need to be recomputed when the logging configuration changes dynamically " +"while the application is running (which is not all that common)." +msgstr "" +"У деяких випадках :meth:`~Logger.isEnabledFor` сам по собі може бути " +"дорожчим, ніж вам хотілося б (наприклад, для глибоко вкладених реєстраторів, " +"де явний рівень встановлюється лише високо в ієрархії реєстратора). У таких " +"випадках (або якщо ви хочете уникнути виклику методу в жорстких циклах), ви " +"можете кешувати результат виклику :meth:`~Logger.isEnabledFor` у локальній " +"змінній чи змінній екземпляра та використовувати це замість виклику метод " +"кожного разу. Таке кешоване значення потрібно було б повторно обчислити лише " +"тоді, коли конфігурація журналювання динамічно змінюється під час роботи " +"програми (що не так вже й часто)." + +msgid "" +"There are other optimizations which can be made for specific applications " +"which need more precise control over what logging information is collected. " +"Here's a list of things you can do to avoid processing during logging which " +"you don't need:" +msgstr "" +"Існують інші оптимізації, які можна зробити для конкретних програм, які " +"потребують більш точного контролю над тим, яка інформація журналу " +"збирається. Ось список речей, які ви можете зробити, щоб уникнути обробки " +"під час журналювання, яка вам не потрібна:" + +msgid "What you don't want to collect" +msgstr "Те, що ви не хочете збирати" + +msgid "How to avoid collecting it" +msgstr "Як уникнути його збору" + +msgid "Information about where calls were made from." +msgstr "Інформація про те, звідки дзвонили." + +msgid "" +"Set ``logging._srcfile`` to ``None``. This avoids calling :func:`sys." +"_getframe`, which may help to speed up your code in environments like PyPy " +"(which can't speed up code that uses :func:`sys._getframe`)." +msgstr "" +"Встановіть для ``logging._srcfile`` значення ``None``. Це дозволяє уникнути " +"виклику :func:`sys._getframe`, що може допомогти пришвидшити ваш код у таких " +"середовищах, як PyPy (який не може прискорити код, який використовує :func:" +"`sys._getframe`)." + +msgid "Threading information." +msgstr "Інформація про потоки." + +msgid "Set ``logging.logThreads`` to ``False``." +msgstr "Встановіть для ``logging.logThreads`` значення ``False``." + +msgid "Current process ID (:func:`os.getpid`)" +msgstr "Ідентифікатор поточного процесу (:func:`os.getpid`)" + +msgid "Set ``logging.logProcesses`` to ``False``." +msgstr "Встановіть для ``logging.logProcesses`` значення ``False``." + +msgid "" +"Current process name when using ``multiprocessing`` to manage multiple " +"processes." +msgstr "" +"Поточне ім’я процесу, якщо для керування кількома процесами використовується " +"``багатопроцесорна обробка``." + +msgid "Set ``logging.logMultiprocessing`` to ``False``." +msgstr "Встановіть для ``logging.logMultiprocessing`` значення ``False``." + +msgid "Current :class:`asyncio.Task` name when using ``asyncio``." +msgstr "" + +msgid "Set ``logging.logAsyncioTasks`` to ``False``." +msgstr "" + +msgid "" +"Also note that the core logging module only includes the basic handlers. If " +"you don't import :mod:`logging.handlers` and :mod:`logging.config`, they " +"won't take up any memory." +msgstr "" +"Також зауважте, що основний модуль журналювання включає лише основні " +"обробники. Якщо ви не імпортуєте :mod:`logging.handlers` і :mod:`logging." +"config`, вони не займатимуть жодної пам’яті." + +msgid "Other resources" +msgstr "Інші ресурси" + +msgid "Module :mod:`logging`" +msgstr "Модуль :mod:`logging`" + +msgid "API reference for the logging module." +msgstr "Довідник API для модуля журналювання." + +msgid "Module :mod:`logging.config`" +msgstr "Модуль :mod:`logging.config`" + +msgid "Configuration API for the logging module." +msgstr "API конфігурації для модуля журналювання." + +msgid "Module :mod:`logging.handlers`" +msgstr "Модуль :mod:`logging.handlers`" + +msgid "Useful handlers included with the logging module." +msgstr "Корисні обробники, включені в модуль журналювання." + +msgid ":ref:`A logging cookbook `" +msgstr ":ref:`Кулінарна книга журналювання `" diff --git a/howto/mro.po b/howto/mro.po new file mode 100644 index 000000000..5fe4c1e41 --- /dev/null +++ b/howto/mro.po @@ -0,0 +1,793 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2024-04-19 14:15+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "The Python 2.3 Method Resolution Order" +msgstr "" + +msgid "" +"This is a historical document, provided as an appendix to the official " +"documentation. The Method Resolution Order discussed here was *introduced* " +"in Python 2.3, but it is still used in later versions -- including Python 3." +msgstr "" + +msgid "By `Michele Simionato `__." +msgstr "" + +msgid "Abstract" +msgstr "Анотація" + +msgid "" +"*This document is intended for Python programmers who want to understand the " +"C3 Method Resolution Order used in Python 2.3. Although it is not intended " +"for newbies, it is quite pedagogical with many worked out examples. I am " +"not aware of other publicly available documents with the same scope, " +"therefore it should be useful.*" +msgstr "" + +msgid "Disclaimer:" +msgstr "" + +msgid "" +"*I donate this document to the Python Software Foundation, under the Python " +"2.3 license. As usual in these circumstances, I warn the reader that what " +"follows* should *be correct, but I don't give any warranty. Use it at your " +"own risk and peril!*" +msgstr "" + +msgid "Acknowledgments:" +msgstr "" + +msgid "" +"*All the people of the Python mailing list who sent me their support. Paul " +"Foley who pointed out various imprecisions and made me to add the part on " +"local precedence ordering. David Goodger for help with the formatting in " +"reStructuredText. David Mertz for help with the editing. Finally, Guido van " +"Rossum who enthusiastically added this document to the official Python 2.3 " +"home-page.*" +msgstr "" + +msgid "The beginning" +msgstr "" + +msgid "*Felix qui potuit rerum cognoscere causas* -- Virgilius" +msgstr "" + +msgid "" +"Everything started with a post by Samuele Pedroni to the Python development " +"mailing list [#]_. In his post, Samuele showed that the Python 2.2 method " +"resolution order is not monotonic and he proposed to replace it with the C3 " +"method resolution order. Guido agreed with his arguments and therefore now " +"Python 2.3 uses C3. The C3 method itself has nothing to do with Python, " +"since it was invented by people working on Dylan and it is described in a " +"paper intended for lispers [#]_. The present paper gives a (hopefully) " +"readable discussion of the C3 algorithm for Pythonistas who want to " +"understand the reasons for the change." +msgstr "" + +msgid "" +"First of all, let me point out that what I am going to say only applies to " +"the *new style classes* introduced in Python 2.2: *classic classes* " +"maintain their old method resolution order, depth first and then left to " +"right. Therefore, there is no breaking of old code for classic classes; and " +"even if in principle there could be breaking of code for Python 2.2 new " +"style classes, in practice the cases in which the C3 resolution order " +"differs from the Python 2.2 method resolution order are so rare that no real " +"breaking of code is expected. Therefore:" +msgstr "" + +msgid "*Don't be scared!*" +msgstr "" + +msgid "" +"Moreover, unless you make strong use of multiple inheritance and you have " +"non-trivial hierarchies, you don't need to understand the C3 algorithm, and " +"you can easily skip this paper. On the other hand, if you really want to " +"know how multiple inheritance works, then this paper is for you. The good " +"news is that things are not as complicated as you might expect." +msgstr "" + +msgid "Let me begin with some basic definitions." +msgstr "" + +msgid "" +"Given a class C in a complicated multiple inheritance hierarchy, it is a non-" +"trivial task to specify the order in which methods are overridden, i.e. to " +"specify the order of the ancestors of C." +msgstr "" + +msgid "" +"The list of the ancestors of a class C, including the class itself, ordered " +"from the nearest ancestor to the furthest, is called the class precedence " +"list or the *linearization* of C." +msgstr "" + +msgid "" +"The *Method Resolution Order* (MRO) is the set of rules that construct the " +"linearization. In the Python literature, the idiom \"the MRO of C\" is also " +"used as a synonymous for the linearization of the class C." +msgstr "" + +msgid "" +"For instance, in the case of single inheritance hierarchy, if C is a " +"subclass of C1, and C1 is a subclass of C2, then the linearization of C is " +"simply the list [C, C1 , C2]. However, with multiple inheritance " +"hierarchies, the construction of the linearization is more cumbersome, since " +"it is more difficult to construct a linearization that respects *local " +"precedence ordering* and *monotonicity*." +msgstr "" + +msgid "" +"I will discuss the local precedence ordering later, but I can give the " +"definition of monotonicity here. A MRO is monotonic when the following is " +"true: *if C1 precedes C2 in the linearization of C, then C1 precedes C2 in " +"the linearization of any subclass of C*. Otherwise, the innocuous operation " +"of deriving a new class could change the resolution order of methods, " +"potentially introducing very subtle bugs. Examples where this happens will " +"be shown later." +msgstr "" + +msgid "" +"Not all classes admit a linearization. There are cases, in complicated " +"hierarchies, where it is not possible to derive a class such that its " +"linearization respects all the desired properties." +msgstr "" + +msgid "Here I give an example of this situation. Consider the hierarchy" +msgstr "" + +msgid "" +"which can be represented with the following inheritance graph, where I have " +"denoted with O the ``object`` class, which is the beginning of any hierarchy " +"for new style classes:" +msgstr "" + +msgid "" +" -----------\n" +"| |\n" +"| O |\n" +"| / \\ |\n" +" - X Y /\n" +" | / | /\n" +" | / |/\n" +" A B\n" +" \\ /\n" +" ?" +msgstr "" + +msgid "" +"In this case, it is not possible to derive a new class C from A and B, since " +"X precedes Y in A, but Y precedes X in B, therefore the method resolution " +"order would be ambiguous in C." +msgstr "" + +msgid "" +"Python 2.3 raises an exception in this situation (TypeError: MRO conflict " +"among bases Y, X) forbidding the naive programmer from creating ambiguous " +"hierarchies. Python 2.2 instead does not raise an exception, but chooses an " +"*ad hoc* ordering (CABXYO in this case)." +msgstr "" + +msgid "The C3 Method Resolution Order" +msgstr "" + +msgid "" +"Let me introduce a few simple notations which will be useful for the " +"following discussion. I will use the shortcut notation::" +msgstr "" + +msgid "C1 C2 ... CN" +msgstr "" + +msgid "to indicate the list of classes [C1, C2, ... , CN]." +msgstr "" + +msgid "The *head* of the list is its first element::" +msgstr "" + +msgid "head = C1" +msgstr "" + +msgid "whereas the *tail* is the rest of the list::" +msgstr "" + +msgid "tail = C2 ... CN." +msgstr "" + +msgid "I shall also use the notation::" +msgstr "" + +msgid "C + (C1 C2 ... CN) = C C1 C2 ... CN" +msgstr "" + +msgid "to denote the sum of the lists [C] + [C1, C2, ... ,CN]." +msgstr "" + +msgid "Now I can explain how the MRO works in Python 2.3." +msgstr "" + +msgid "" +"Consider a class C in a multiple inheritance hierarchy, with C inheriting " +"from the base classes B1, B2, ... , BN. We want to compute the " +"linearization L[C] of the class C. The rule is the following:" +msgstr "" + +msgid "" +"*the linearization of C is the sum of C plus the merge of the linearizations " +"of the parents and the list of the parents.*" +msgstr "" + +msgid "In symbolic notation::" +msgstr "" + +msgid "L[C(B1 ... BN)] = C + merge(L[B1] ... L[BN], B1 ... BN)" +msgstr "" + +msgid "" +"In particular, if C is the ``object`` class, which has no parents, the " +"linearization is trivial::" +msgstr "" + +msgid "L[object] = object." +msgstr "" + +msgid "" +"However, in general one has to compute the merge according to the following " +"prescription:" +msgstr "" + +msgid "" +"*take the head of the first list, i.e L[B1][0]; if this head is not in the " +"tail of any of the other lists, then add it to the linearization of C and " +"remove it from the lists in the merge, otherwise look at the head of the " +"next list and take it, if it is a good head. Then repeat the operation " +"until all the class are removed or it is impossible to find good heads. In " +"this case, it is impossible to construct the merge, Python 2.3 will refuse " +"to create the class C and will raise an exception.*" +msgstr "" + +msgid "" +"This prescription ensures that the merge operation *preserves* the ordering, " +"if the ordering can be preserved. On the other hand, if the order cannot be " +"preserved (as in the example of serious order disagreement discussed above) " +"then the merge cannot be computed." +msgstr "" + +msgid "" +"The computation of the merge is trivial if C has only one parent (single " +"inheritance); in this case::" +msgstr "" + +msgid "L[C(B)] = C + merge(L[B],B) = C + L[B]" +msgstr "" + +msgid "" +"However, in the case of multiple inheritance things are more cumbersome and " +"I don't expect you can understand the rule without a couple of examples ;-)" +msgstr "" + +msgid "Examples" +msgstr "Приклади" + +msgid "First example. Consider the following hierarchy:" +msgstr "" + +msgid "In this case the inheritance graph can be drawn as:" +msgstr "" + +msgid "" +" 6\n" +" ---\n" +"Level 3 | O | (more general)\n" +" / --- \\\n" +" / | \\ |\n" +" / | \\ |\n" +" / | \\ |\n" +" --- --- --- |\n" +"Level 2 3 | D | 4| E | | F | 5 |\n" +" --- --- --- |\n" +" \\ \\ _ / | |\n" +" \\ / \\ _ | |\n" +" \\ / \\ | |\n" +" --- --- |\n" +"Level 1 1 | B | | C | 2 |\n" +" --- --- |\n" +" \\ / |\n" +" \\ / \\ /\n" +" ---\n" +"Level 0 0 | A | (more specialized)\n" +" ---" +msgstr "" + +msgid "The linearizations of O,D,E and F are trivial::" +msgstr "" + +msgid "" +"L[O] = O\n" +"L[D] = D O\n" +"L[E] = E O\n" +"L[F] = F O" +msgstr "" + +msgid "The linearization of B can be computed as::" +msgstr "" + +msgid "L[B] = B + merge(DO, EO, DE)" +msgstr "" + +msgid "" +"We see that D is a good head, therefore we take it and we are reduced to " +"compute ``merge(O,EO,E)``. Now O is not a good head, since it is in the " +"tail of the sequence EO. In this case the rule says that we have to skip to " +"the next sequence. Then we see that E is a good head; we take it and we are " +"reduced to compute ``merge(O,O)`` which gives O. Therefore::" +msgstr "" + +msgid "L[B] = B D E O" +msgstr "" + +msgid "Using the same procedure one finds::" +msgstr "" + +msgid "" +"L[C] = C + merge(DO,FO,DF)\n" +" = C + D + merge(O,FO,F)\n" +" = C + D + F + merge(O,O)\n" +" = C D F O" +msgstr "" + +msgid "Now we can compute::" +msgstr "" + +msgid "" +"L[A] = A + merge(BDEO,CDFO,BC)\n" +" = A + B + merge(DEO,CDFO,C)\n" +" = A + B + C + merge(DEO,DFO)\n" +" = A + B + C + D + merge(EO,FO)\n" +" = A + B + C + D + E + merge(O,FO)\n" +" = A + B + C + D + E + F + merge(O,O)\n" +" = A B C D E F O" +msgstr "" + +msgid "" +"In this example, the linearization is ordered in a pretty nice way according " +"to the inheritance level, in the sense that lower levels (i.e. more " +"specialized classes) have higher precedence (see the inheritance graph). " +"However, this is not the general case." +msgstr "" + +msgid "" +"I leave as an exercise for the reader to compute the linearization for my " +"second example:" +msgstr "" + +msgid "" +"The only difference with the previous example is the change B(D,E) --> B(E," +"D); however even such a little modification completely changes the ordering " +"of the hierarchy:" +msgstr "" + +msgid "" +" 6\n" +" ---\n" +"Level 3 | O |\n" +" / --- \\\n" +" / | \\\n" +" / | \\\n" +" / | \\\n" +" --- --- ---\n" +"Level 2 2 | E | 4 | D | | F | 5\n" +" --- --- ---\n" +" \\ / \\ /\n" +" \\ / \\ /\n" +" \\ / \\ /\n" +" --- ---\n" +"Level 1 1 | B | | C | 3\n" +" --- ---\n" +" \\ /\n" +" \\ /\n" +" ---\n" +"Level 0 0 | A |\n" +" ---" +msgstr "" + +msgid "" +"Notice that the class E, which is in the second level of the hierarchy, " +"precedes the class C, which is in the first level of the hierarchy, i.e. E " +"is more specialized than C, even if it is in a higher level." +msgstr "" + +msgid "" +"A lazy programmer can obtain the MRO directly from Python 2.2, since in this " +"case it coincides with the Python 2.3 linearization. It is enough to invoke " +"the :meth:`~type.mro` method of class A:" +msgstr "" + +msgid "" +"Finally, let me consider the example discussed in the first section, " +"involving a serious order disagreement. In this case, it is straightforward " +"to compute the linearizations of O, X, Y, A and B:" +msgstr "" + +msgid "" +"L[O] = 0\n" +"L[X] = X O\n" +"L[Y] = Y O\n" +"L[A] = A X Y O\n" +"L[B] = B Y X O" +msgstr "" + +msgid "" +"However, it is impossible to compute the linearization for a class C that " +"inherits from A and B::" +msgstr "" + +msgid "" +"L[C] = C + merge(AXYO, BYXO, AB)\n" +" = C + A + merge(XYO, BYXO, B)\n" +" = C + A + B + merge(XYO, YXO)" +msgstr "" + +msgid "" +"At this point we cannot merge the lists XYO and YXO, since X is in the tail " +"of YXO whereas Y is in the tail of XYO: therefore there are no good heads " +"and the C3 algorithm stops. Python 2.3 raises an error and refuses to " +"create the class C." +msgstr "" + +msgid "Bad Method Resolution Orders" +msgstr "" + +msgid "" +"A MRO is *bad* when it breaks such fundamental properties as local " +"precedence ordering and monotonicity. In this section, I will show that " +"both the MRO for classic classes and the MRO for new style classes in Python " +"2.2 are bad." +msgstr "" + +msgid "" +"It is easier to start with the local precedence ordering. Consider the " +"following example:" +msgstr "" + +msgid "with inheritance diagram" +msgstr "" + +msgid "" +" O\n" +" |\n" +"(buy spam) F\n" +" | \\\n" +" | E (buy eggs)\n" +" | /\n" +" G\n" +"\n" +" (buy eggs or spam ?)" +msgstr "" + +msgid "" +"We see that class G inherits from F and E, with F *before* E: therefore we " +"would expect the attribute *G.remember2buy* to be inherited by *F." +"remember2buy* and not by *E.remember2buy*: nevertheless Python 2.2 gives" +msgstr "" + +msgid "" +"This is a breaking of local precedence ordering since the order in the local " +"precedence list, i.e. the list of the parents of G, is not preserved in the " +"Python 2.2 linearization of G::" +msgstr "" + +msgid "L[G,P22]= G E F object # F *follows* E" +msgstr "" + +msgid "" +"One could argue that the reason why F follows E in the Python 2.2 " +"linearization is that F is less specialized than E, since F is the " +"superclass of E; nevertheless the breaking of local precedence ordering is " +"quite non-intuitive and error prone. This is particularly true since it is " +"a different from old style classes:" +msgstr "" + +msgid "" +"In this case the MRO is GFEF and the local precedence ordering is preserved." +msgstr "" + +msgid "" +"As a general rule, hierarchies such as the previous one should be avoided, " +"since it is unclear if F should override E or vice-versa. Python 2.3 solves " +"the ambiguity by raising an exception in the creation of class G, " +"effectively stopping the programmer from generating ambiguous hierarchies. " +"The reason for that is that the C3 algorithm fails when the merge::" +msgstr "" + +msgid "merge(FO,EFO,FE)" +msgstr "" + +msgid "" +"cannot be computed, because F is in the tail of EFO and E is in the tail of " +"FE." +msgstr "" + +msgid "" +"The real solution is to design a non-ambiguous hierarchy, i.e. to derive G " +"from E and F (the more specific first) and not from F and E; in this case " +"the MRO is GEF without any doubt." +msgstr "" + +msgid "" +" O\n" +" |\n" +" F (spam)\n" +" / |\n" +"(eggs) E |\n" +" \\ |\n" +" G\n" +" (eggs, no doubt)" +msgstr "" + +msgid "" +"Python 2.3 forces the programmer to write good hierarchies (or, at least, " +"less error-prone ones)." +msgstr "" + +msgid "" +"On a related note, let me point out that the Python 2.3 algorithm is smart " +"enough to recognize obvious mistakes, as the duplication of classes in the " +"list of parents:" +msgstr "" + +msgid "" +"Python 2.2 (both for classic classes and new style classes) in this " +"situation, would not raise any exception." +msgstr "" + +msgid "" +"Finally, I would like to point out two lessons we have learned from this " +"example:" +msgstr "" + +msgid "" +"despite the name, the MRO determines the resolution order of attributes, not " +"only of methods;" +msgstr "" + +msgid "" +"the default food for Pythonistas is spam ! (but you already knew that ;-)" +msgstr "" + +msgid "" +"Having discussed the issue of local precedence ordering, let me now consider " +"the issue of monotonicity. My goal is to show that neither the MRO for " +"classic classes nor that for Python 2.2 new style classes is monotonic." +msgstr "" + +msgid "" +"To prove that the MRO for classic classes is non-monotonic is rather " +"trivial, it is enough to look at the diamond diagram:" +msgstr "" + +msgid "" +" C\n" +" / \\\n" +" / \\\n" +"A B\n" +" \\ /\n" +" \\ /\n" +" D" +msgstr "" + +msgid "One easily discerns the inconsistency::" +msgstr "" + +msgid "" +"L[B,P21] = B C # B precedes C : B's methods win\n" +"L[D,P21] = D A C B C # B follows C : C's methods win!" +msgstr "" + +msgid "" +"On the other hand, there are no problems with the Python 2.2 and 2.3 MROs, " +"they give both::" +msgstr "" + +msgid "L[D] = D A B C" +msgstr "" + +msgid "" +"Guido points out in his essay [#]_ that the classic MRO is not so bad in " +"practice, since one can typically avoids diamonds for classic classes. But " +"all new style classes inherit from ``object``, therefore diamonds are " +"unavoidable and inconsistencies shows up in every multiple inheritance graph." +msgstr "" + +msgid "" +"The MRO of Python 2.2 makes breaking monotonicity difficult, but not " +"impossible. The following example, originally provided by Samuele Pedroni, " +"shows that the MRO of Python 2.2 is non-monotonic:" +msgstr "" + +msgid "" +"Here are the linearizations according to the C3 MRO (the reader should " +"verify these linearizations as an exercise and draw the inheritance " +"diagram ;-) ::" +msgstr "" + +msgid "" +"L[A] = A O\n" +"L[B] = B O\n" +"L[C] = C O\n" +"L[D] = D O\n" +"L[E] = E O\n" +"L[K1]= K1 A B C O\n" +"L[K2]= K2 D B E O\n" +"L[K3]= K3 D A O\n" +"L[Z] = Z K1 K2 K3 D A B C E O" +msgstr "" + +msgid "" +"Python 2.2 gives exactly the same linearizations for A, B, C, D, E, K1, K2 " +"and K3, but a different linearization for Z::" +msgstr "" + +msgid "L[Z,P22] = Z K1 K3 A K2 D B C E O" +msgstr "" + +msgid "" +"It is clear that this linearization is *wrong*, since A comes before D " +"whereas in the linearization of K3 A comes *after* D. In other words, in K3 " +"methods derived by D override methods derived by A, but in Z, which still is " +"a subclass of K3, methods derived by A override methods derived by D! This " +"is a violation of monotonicity. Moreover, the Python 2.2 linearization of Z " +"is also inconsistent with local precedence ordering, since the local " +"precedence list of the class Z is [K1, K2, K3] (K2 precedes K3), whereas in " +"the linearization of Z K2 *follows* K3. These problems explain why the 2.2 " +"rule has been dismissed in favor of the C3 rule." +msgstr "" + +msgid "The end" +msgstr "" + +msgid "" +"This section is for the impatient reader, who skipped all the previous " +"sections and jumped immediately to the end. This section is for the lazy " +"programmer too, who didn't want to exercise her/his brain. Finally, it is " +"for the programmer with some hubris, otherwise s/he would not be reading a " +"paper on the C3 method resolution order in multiple inheritance " +"hierarchies ;-) These three virtues taken all together (and *not* " +"separately) deserve a prize: the prize is a short Python 2.2 script that " +"allows you to compute the 2.3 MRO without risk to your brain. Simply change " +"the last line to play with the various examples I have discussed in this " +"paper.::" +msgstr "" + +msgid "" +"#\n" +"\n" +"\"\"\"C3 algorithm by Samuele Pedroni (with readability enhanced by me)." +"\"\"\"\n" +"\n" +"class __metaclass__(type):\n" +" \"All classes are metamagically modified to be nicely printed\"\n" +" __repr__ = lambda cls: cls.__name__\n" +"\n" +"class ex_2:\n" +" \"Serious order disagreement\" #From Guido\n" +" class O: pass\n" +" class X(O): pass\n" +" class Y(O): pass\n" +" class A(X,Y): pass\n" +" class B(Y,X): pass\n" +" try:\n" +" class Z(A,B): pass #creates Z(A,B) in Python 2.2\n" +" except TypeError:\n" +" pass # Z(A,B) cannot be created in Python 2.3\n" +"\n" +"class ex_5:\n" +" \"My first example\"\n" +" class O: pass\n" +" class F(O): pass\n" +" class E(O): pass\n" +" class D(O): pass\n" +" class C(D,F): pass\n" +" class B(D,E): pass\n" +" class A(B,C): pass\n" +"\n" +"class ex_6:\n" +" \"My second example\"\n" +" class O: pass\n" +" class F(O): pass\n" +" class E(O): pass\n" +" class D(O): pass\n" +" class C(D,F): pass\n" +" class B(E,D): pass\n" +" class A(B,C): pass\n" +"\n" +"class ex_9:\n" +" \"Difference between Python 2.2 MRO and C3\" #From Samuele\n" +" class O: pass\n" +" class A(O): pass\n" +" class B(O): pass\n" +" class C(O): pass\n" +" class D(O): pass\n" +" class E(O): pass\n" +" class K1(A,B,C): pass\n" +" class K2(D,B,E): pass\n" +" class K3(D,A): pass\n" +" class Z(K1,K2,K3): pass\n" +"\n" +"def merge(seqs):\n" +" print '\\n\\nCPL[%s]=%s' % (seqs[0][0],seqs),\n" +" res = []; i=0\n" +" while 1:\n" +" nonemptyseqs=[seq for seq in seqs if seq]\n" +" if not nonemptyseqs: return res\n" +" i+=1; print '\\n',i,'round: candidates...',\n" +" for seq in nonemptyseqs: # find merge candidates among seq heads\n" +" cand = seq[0]; print ' ',cand,\n" +" nothead=[s for s in nonemptyseqs if cand in s[1:]]\n" +" if nothead: cand=None #reject candidate\n" +" else: break\n" +" if not cand: raise \"Inconsistent hierarchy\"\n" +" res.append(cand)\n" +" for seq in nonemptyseqs: # remove cand\n" +" if seq[0] == cand: del seq[0]\n" +"\n" +"def mro(C):\n" +" \"Compute the class precedence list (mro) according to C3\"\n" +" return merge([[C]]+map(mro,C.__bases__)+[list(C.__bases__)])\n" +"\n" +"def print_mro(C):\n" +" print '\\nMRO[%s]=%s' % (C,mro(C))\n" +" print '\\nP22 MRO[%s]=%s' % (C,C.mro())\n" +"\n" +"print_mro(ex_9.Z)\n" +"\n" +"#" +msgstr "" + +msgid "That's all folks," +msgstr "" + +msgid "enjoy !" +msgstr "" + +msgid "Resources" +msgstr "" + +msgid "" +"The thread on python-dev started by Samuele Pedroni: https://mail.python.org/" +"pipermail/python-dev/2002-October/029035.html" +msgstr "" + +msgid "" +"The paper *A Monotonic Superclass Linearization for Dylan*: https://doi." +"org/10.1145/236337.236343" +msgstr "" + +msgid "" +"Guido van Rossum's essay, *Unifying types and classes in Python 2.2*: " +"https://web.archive.org/web/20140210194412/http://www.python.org/download/" +"releases/2.2.2/descrintro" +msgstr "" diff --git a/howto/perf_profiling.po b/howto/perf_profiling.po new file mode 100644 index 000000000..fc9f2eae0 --- /dev/null +++ b/howto/perf_profiling.po @@ -0,0 +1,411 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2023 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2023-05-24 13:07+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2023\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Python support for the Linux ``perf`` profiler" +msgstr "" + +msgid "author" +msgstr "автор" + +msgid "Pablo Galindo" +msgstr "" + +msgid "" +"`The Linux perf profiler `_ is a very powerful " +"tool that allows you to profile and obtain information about the performance " +"of your application. ``perf`` also has a very vibrant ecosystem of tools " +"that aid with the analysis of the data that it produces." +msgstr "" + +msgid "" +"The main problem with using the ``perf`` profiler with Python applications " +"is that ``perf`` only gets information about native symbols, that is, the " +"names of functions and procedures written in C. This means that the names " +"and file names of Python functions in your code will not appear in the " +"output of ``perf``." +msgstr "" + +msgid "" +"Since Python 3.12, the interpreter can run in a special mode that allows " +"Python functions to appear in the output of the ``perf`` profiler. When this " +"mode is enabled, the interpreter will interpose a small piece of code " +"compiled on the fly before the execution of every Python function and it " +"will teach ``perf`` the relationship between this piece of code and the " +"associated Python function using :doc:`perf map files <../c-api/perfmaps>`." +msgstr "" + +msgid "" +"Support for the ``perf`` profiler is currently only available for Linux on " +"select architectures. Check the output of the ``configure`` build step or " +"check the output of ``python -m sysconfig | grep HAVE_PERF_TRAMPOLINE`` to " +"see if your system is supported." +msgstr "" + +msgid "For example, consider the following script:" +msgstr "" + +msgid "" +"def foo(n):\n" +" result = 0\n" +" for _ in range(n):\n" +" result += 1\n" +" return result\n" +"\n" +"def bar(n):\n" +" foo(n)\n" +"\n" +"def baz(n):\n" +" bar(n)\n" +"\n" +"if __name__ == \"__main__\":\n" +" baz(1000000)" +msgstr "" + +msgid "We can run ``perf`` to sample CPU stack traces at 9999 hertz::" +msgstr "" + +msgid "$ perf record -F 9999 -g -o perf.data python my_script.py" +msgstr "" + +msgid "Then we can use ``perf report`` to analyze the data:" +msgstr "" + +msgid "" +"$ perf report --stdio -n -g\n" +"\n" +"# Children Self Samples Command Shared Object Symbol\n" +"# ........ ........ ............ .......... .................. ..........................................\n" +"#\n" +" 91.08% 0.00% 0 python.exe python.exe [.] " +"_start\n" +" |\n" +" ---_start\n" +" |\n" +" --90.71%--__libc_start_main\n" +" Py_BytesMain\n" +" |\n" +" |--56.88%--pymain_run_python.constprop.0\n" +" | |\n" +" | |--56.13%--_PyRun_AnyFileObject\n" +" | | _PyRun_SimpleFileObject\n" +" | | |\n" +" | | |--55.02%--run_mod\n" +" | | | |\n" +" | | | --54.65%--" +"PyEval_EvalCode\n" +" | | | " +"_PyEval_EvalFrameDefault\n" +" | | | " +"PyObject_Vectorcall\n" +" | | | " +"_PyEval_Vector\n" +" | | | " +"_PyEval_EvalFrameDefault\n" +" | | | " +"PyObject_Vectorcall\n" +" | | | " +"_PyEval_Vector\n" +" | | | " +"_PyEval_EvalFrameDefault\n" +" | | | " +"PyObject_Vectorcall\n" +" | | | " +"_PyEval_Vector\n" +" | | | |\n" +" | | | " +"|--51.67%--_PyEval_EvalFrameDefault\n" +" | | | " +"| |\n" +" | | | " +"| |--11.52%--_PyLong_Add\n" +" | | | " +"| | |\n" +" | | | " +"| | |--2.97%--_PyObject_Malloc\n" +"..." +msgstr "" + +msgid "" +"As you can see, the Python functions are not shown in the output, only " +"``_PyEval_EvalFrameDefault`` (the function that evaluates the Python " +"bytecode) shows up. Unfortunately that's not very useful because all Python " +"functions use the same C function to evaluate bytecode so we cannot know " +"which Python function corresponds to which bytecode-evaluating function." +msgstr "" + +msgid "" +"Instead, if we run the same experiment with ``perf`` support enabled we get:" +msgstr "" + +msgid "" +"$ perf report --stdio -n -g\n" +"\n" +"# Children Self Samples Command Shared Object Symbol\n" +"# ........ ........ ............ .......... .................. .....................................................................\n" +"#\n" +" 90.58% 0.36% 1 python.exe python.exe [.] " +"_start\n" +" |\n" +" ---_start\n" +" |\n" +" --89.86%--__libc_start_main\n" +" Py_BytesMain\n" +" |\n" +" |--55.43%--pymain_run_python.constprop.0\n" +" | |\n" +" | |--54.71%--_PyRun_AnyFileObject\n" +" | | _PyRun_SimpleFileObject\n" +" | | |\n" +" | | |--53.62%--run_mod\n" +" | | | |\n" +" | | | --53.26%--" +"PyEval_EvalCode\n" +" | | | py::" +":/src/script.py\n" +" | | | " +"_PyEval_EvalFrameDefault\n" +" | | | " +"PyObject_Vectorcall\n" +" | | | " +"_PyEval_Vector\n" +" | | | py::baz:/" +"src/script.py\n" +" | | | " +"_PyEval_EvalFrameDefault\n" +" | | | " +"PyObject_Vectorcall\n" +" | | | " +"_PyEval_Vector\n" +" | | | py::bar:/" +"src/script.py\n" +" | | | " +"_PyEval_EvalFrameDefault\n" +" | | | " +"PyObject_Vectorcall\n" +" | | | " +"_PyEval_Vector\n" +" | | | py::foo:/" +"src/script.py\n" +" | | | |\n" +" | | | " +"|--51.81%--_PyEval_EvalFrameDefault\n" +" | | | " +"| |\n" +" | | | " +"| |--13.77%--_PyLong_Add\n" +" | | | " +"| | |\n" +" | | | " +"| | |--3.26%--_PyObject_Malloc" +msgstr "" + +msgid "How to enable ``perf`` profiling support" +msgstr "" + +msgid "" +"``perf`` profiling support can be enabled either from the start using the " +"environment variable :envvar:`PYTHONPERFSUPPORT` or the :option:`-X perf <-" +"X>` option, or dynamically using :func:`sys.activate_stack_trampoline` and :" +"func:`sys.deactivate_stack_trampoline`." +msgstr "" + +msgid "" +"The :mod:`!sys` functions take precedence over the :option:`!-X` option, " +"the :option:`!-X` option takes precedence over the environment variable." +msgstr "" + +msgid "Example, using the environment variable::" +msgstr "" + +msgid "" +"$ PYTHONPERFSUPPORT=1 perf record -F 9999 -g -o perf.data python my_script." +"py\n" +"$ perf report -g -i perf.data" +msgstr "" + +msgid "Example, using the :option:`!-X` option::" +msgstr "" + +msgid "" +"$ perf record -F 9999 -g -o perf.data python -X perf my_script.py\n" +"$ perf report -g -i perf.data" +msgstr "" + +msgid "Example, using the :mod:`sys` APIs in file :file:`example.py`:" +msgstr "" + +msgid "" +"import sys\n" +"\n" +"sys.activate_stack_trampoline(\"perf\")\n" +"do_profiled_stuff()\n" +"sys.deactivate_stack_trampoline()\n" +"\n" +"non_profiled_stuff()" +msgstr "" + +msgid "...then::" +msgstr "" + +msgid "" +"$ perf record -F 9999 -g -o perf.data python ./example.py\n" +"$ perf report -g -i perf.data" +msgstr "" + +msgid "How to obtain the best results" +msgstr "" + +msgid "" +"For best results, Python should be compiled with ``CFLAGS=\"-fno-omit-frame-" +"pointer -mno-omit-leaf-frame-pointer\"`` as this allows profilers to unwind " +"using only the frame pointer and not on DWARF debug information. This is " +"because as the code that is interposed to allow ``perf`` support is " +"dynamically generated it doesn't have any DWARF debugging information " +"available." +msgstr "" + +msgid "" +"You can check if your system has been compiled with this flag by running::" +msgstr "" + +msgid "$ python -m sysconfig | grep 'no-omit-frame-pointer'" +msgstr "" + +msgid "" +"If you don't see any output it means that your interpreter has not been " +"compiled with frame pointers and therefore it may not be able to show Python " +"functions in the output of ``perf``." +msgstr "" + +msgid "How to work without frame pointers" +msgstr "" + +msgid "" +"If you are working with a Python interpreter that has been compiled without " +"frame pointers, you can still use the ``perf`` profiler, but the overhead " +"will be a bit higher because Python needs to generate unwinding information " +"for every Python function call on the fly. Additionally, ``perf`` will take " +"more time to process the data because it will need to use the DWARF " +"debugging information to unwind the stack and this is a slow process." +msgstr "" + +msgid "" +"To enable this mode, you can use the environment variable :envvar:" +"`PYTHON_PERF_JIT_SUPPORT` or the :option:`-X perf_jit <-X>` option, which " +"will enable the JIT mode for the ``perf`` profiler." +msgstr "" + +msgid "" +"Due to a bug in the ``perf`` tool, only ``perf`` versions higher than v6.8 " +"will work with the JIT mode. The fix was also backported to the v6.7.2 " +"version of the tool." +msgstr "" + +msgid "" +"Note that when checking the version of the ``perf`` tool (which can be done " +"by running ``perf version``) you must take into account that some distros " +"add some custom version numbers including a ``-`` character. This means " +"that ``perf 6.7-3`` is not necessarily ``perf 6.7.3``." +msgstr "" + +msgid "" +"When using the perf JIT mode, you need an extra step before you can run " +"``perf report``. You need to call the ``perf inject`` command to inject the " +"JIT information into the ``perf.data`` file.::" +msgstr "" + +msgid "" +"$ perf record -F 9999 -g -k 1 --call-graph dwarf -o perf.data python -" +"Xperf_jit my_script.py\n" +"$ perf inject -i perf.data --jit --output perf.jit.data\n" +"$ perf report -g -i perf.jit.data" +msgstr "" + +msgid "or using the environment variable::" +msgstr "" + +msgid "" +"$ PYTHON_PERF_JIT_SUPPORT=1 perf record -F 9999 -g --call-graph dwarf -o " +"perf.data python my_script.py\n" +"$ perf inject -i perf.data --jit --output perf.jit.data\n" +"$ perf report -g -i perf.jit.data" +msgstr "" + +msgid "" +"``perf inject --jit`` command will read ``perf.data``, automatically pick up " +"the perf dump file that Python creates (in ``/tmp/perf-$PID.dump``), and " +"then create ``perf.jit.data`` which merges all the JIT information together. " +"It should also create a lot of ``jitted-XXXX-N.so`` files in the current " +"directory which are ELF images for all the JIT trampolines that were created " +"by Python." +msgstr "" + +msgid "" +"When using ``--call-graph dwarf``, the ``perf`` tool will take snapshots of " +"the stack of the process being profiled and save the information in the " +"``perf.data`` file. By default, the size of the stack dump is 8192 bytes, " +"but you can change the size by passing it after a comma like ``--call-graph " +"dwarf,16384``." +msgstr "" + +msgid "" +"The size of the stack dump is important because if the size is too small " +"``perf`` will not be able to unwind the stack and the output will be " +"incomplete. On the other hand, if the size is too big, then ``perf`` won't " +"be able to sample the process as frequently as it would like as the overhead " +"will be higher." +msgstr "" + +msgid "" +"The stack size is particularly important when profiling Python code compiled " +"with low optimization levels (like ``-O0``), as these builds tend to have " +"larger stack frames. If you are compiling Python with ``-O0`` and not seeing " +"Python functions in your profiling output, try increasing the stack dump " +"size to 65528 bytes (the maximum)::" +msgstr "" + +msgid "" +"$ perf record -F 9999 -g -k 1 --call-graph dwarf,65528 -o perf.data python -" +"Xperf_jit my_script.py" +msgstr "" + +msgid "Different compilation flags can significantly impact stack sizes:" +msgstr "" + +msgid "" +"Builds with ``-O0`` typically have much larger stack frames than those with " +"``-O1`` or higher" +msgstr "" + +msgid "" +"Adding optimizations (``-O1``, ``-O2``, etc.) typically reduces stack size" +msgstr "" + +msgid "" +"Frame pointers (``-fno-omit-frame-pointer``) generally provide more reliable " +"stack unwinding" +msgstr "" diff --git a/howto/pyporting.po b/howto/pyporting.po new file mode 100644 index 000000000..6481199ca --- /dev/null +++ b/howto/pyporting.po @@ -0,0 +1,81 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:53+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "How to port Python 2 Code to Python 3" +msgstr "" + +msgid "author" +msgstr "автор" + +msgid "Brett Cannon" +msgstr "Brett Cannon" + +msgid "" +"Python 2 reached its official end-of-life at the start of 2020. This means " +"that no new bug reports, fixes, or changes will be made to Python 2 - it's " +"no longer supported: see :pep:`373` and `status of Python versions `_." +msgstr "" + +msgid "" +"If you are looking to port an extension module instead of pure Python code, " +"please see :ref:`cporting-howto`." +msgstr "" +"Якщо ви хочете перенести модуль розширення замість чистого коду Python, " +"перегляньте :ref:`cporting-howto`." + +msgid "" +"The archived python-porting_ mailing list may contain some useful guidance." +msgstr "" + +msgid "" +"Since Python 3.11 the original porting guide was discontinued. You can find " +"the old guide in the `archive `_." +msgstr "" + +msgid "Third-party guides" +msgstr "" + +msgid "There are also multiple third-party guides that might be useful:" +msgstr "" + +msgid "`Guide by Fedora `_" +msgstr "" + +msgid "`PyCon 2020 tutorial `_" +msgstr "" + +msgid "" +"`Guide by DigitalOcean `_" +msgstr "" + +msgid "" +"`Guide by ActiveState `_" +msgstr "" diff --git a/howto/regex.po b/howto/regex.po new file mode 100644 index 000000000..68c0c2f59 --- /dev/null +++ b/howto/regex.po @@ -0,0 +1,2639 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2025 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:53+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2025\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Regular Expression HOWTO" +msgstr "Регулярний вираз HOWTO" + +msgid "Author" +msgstr "Автор" + +msgid "A.M. Kuchling " +msgstr "A.M. Kuchling " + +msgid "Abstract" +msgstr "Анотація" + +msgid "" +"This document is an introductory tutorial to using regular expressions in " +"Python with the :mod:`re` module. It provides a gentler introduction than " +"the corresponding section in the Library Reference." +msgstr "" +"Цей документ є вступним посібником із використання регулярних виразів у " +"Python із модулем :mod:`re`. Він містить більш лагідний вступ, ніж " +"відповідний розділ довідника бібліотеки." + +msgid "Introduction" +msgstr "Вступ" + +msgid "" +"Regular expressions (called REs, or regexes, or regex patterns) are " +"essentially a tiny, highly specialized programming language embedded inside " +"Python and made available through the :mod:`re` module. Using this little " +"language, you specify the rules for the set of possible strings that you " +"want to match; this set might contain English sentences, or e-mail " +"addresses, or TeX commands, or anything you like. You can then ask " +"questions such as \"Does this string match the pattern?\", or \"Is there a " +"match for the pattern anywhere in this string?\". You can also use REs to " +"modify a string or to split it apart in various ways." +msgstr "" +"Регулярні вирази (так звані RE, або регулярні вирази, або шаблони регулярних " +"виразів) — це, по суті, крихітна вузькоспеціалізована мова програмування, " +"вбудована в Python і доступна через модуль :mod:`re`. Використовуючи цю " +"маленьку мову, ви визначаєте правила для набору можливих рядків, які ви " +"хочете зіставити; цей набір може містити англійські речення, або адреси " +"електронної пошти, або команди TeX, або будь-що, що вам подобається. Потім " +"ви можете поставити такі запитання, як \"Чи відповідає цей рядок шаблону?\" " +"або \"Чи є відповідність шаблону десь у цьому рядку?\". Ви також можете " +"використовувати RE, щоб змінити рядок або розділити його різними способами." + +msgid "" +"Regular expression patterns are compiled into a series of bytecodes which " +"are then executed by a matching engine written in C. For advanced use, it " +"may be necessary to pay careful attention to how the engine will execute a " +"given RE, and write the RE in a certain way in order to produce bytecode " +"that runs faster. Optimization isn't covered in this document, because it " +"requires that you have a good understanding of the matching engine's " +"internals." +msgstr "" +"Шаблони регулярних виразів компілюються в серію байт-кодів, які потім " +"виконуються механізмом відповідності, написаним мовою C. Для розширеного " +"використання може знадобитися звернути особливу увагу на те, як механізм " +"виконуватиме заданий RE, і записати RE у певним чином, щоб створити байт-" +"код, який працює швидше. Оптимізація не розглядається в цьому документі, " +"оскільки вона вимагає, щоб ви добре розуміли внутрішні механізми " +"відповідності." + +msgid "" +"The regular expression language is relatively small and restricted, so not " +"all possible string processing tasks can be done using regular expressions. " +"There are also tasks that *can* be done with regular expressions, but the " +"expressions turn out to be very complicated. In these cases, you may be " +"better off writing Python code to do the processing; while Python code will " +"be slower than an elaborate regular expression, it will also probably be " +"more understandable." +msgstr "" +"Мова регулярних виразів є відносно невеликою та обмеженою, тому не всі " +"можливі завдання обробки рядків можна виконати за допомогою регулярних " +"виразів. Також є завдання, які *можна* виконувати регулярними виразами, але " +"вирази виявляються дуже складними. У цих випадках вам може бути краще " +"написати код Python для виконання обробки; Хоча код Python буде повільнішим, " +"ніж складний регулярний вираз, він також, ймовірно, буде більш зрозумілим." + +msgid "Simple Patterns" +msgstr "Прості візерунки" + +msgid "" +"We'll start by learning about the simplest possible regular expressions. " +"Since regular expressions are used to operate on strings, we'll begin with " +"the most common task: matching characters." +msgstr "" +"Ми почнемо з вивчення найпростіших регулярних виразів. Оскільки регулярні " +"вирази використовуються для роботи з рядками, ми почнемо з найпоширенішого " +"завдання: зіставлення символів." + +msgid "" +"For a detailed explanation of the computer science underlying regular " +"expressions (deterministic and non-deterministic finite automata), you can " +"refer to almost any textbook on writing compilers." +msgstr "" +"Для детального пояснення інформатики, що лежить в основі регулярних виразів " +"(детермінованих і недетермінованих кінцевих автоматів), ви можете звернутися " +"до майже будь-якого підручника з написання компіляторів." + +msgid "Matching Characters" +msgstr "Відповідні символи" + +msgid "" +"Most letters and characters will simply match themselves. For example, the " +"regular expression ``test`` will match the string ``test`` exactly. (You " +"can enable a case-insensitive mode that would let this RE match ``Test`` or " +"``TEST`` as well; more about this later.)" +msgstr "" +"Більшість літер і символів просто збігаються. Наприклад, регулярний вираз " +"``test`` точно збігатиметься з рядком ``test``. (Ви можете ввімкнути режим " +"без урахування регістру, який дозволив би цьому RE відповідати також " +"``Test`` або ``TEST``; докладніше про це пізніше.)" + +msgid "" +"There are exceptions to this rule; some characters are special :dfn:" +"`metacharacters`, and don't match themselves. Instead, they signal that " +"some out-of-the-ordinary thing should be matched, or they affect other " +"portions of the RE by repeating them or changing their meaning. Much of " +"this document is devoted to discussing various metacharacters and what they " +"do." +msgstr "" +"З цього правила є винятки; деякі символи є спеціальними :dfn:" +"`metacharacters` і не відповідають самі собі. Натомість вони сигналізують " +"про те, що потрібно зіставити щось незвичайне, або впливають на інші частини " +"RE, повторюючи їх або змінюючи їх значення. Велика частина цього документа " +"присвячена обговоренню різних метасимволів і того, що вони роблять." + +msgid "" +"Here's a complete list of the metacharacters; their meanings will be " +"discussed in the rest of this HOWTO." +msgstr "" +"Ось повний список метасимволів; їхнє значення буде обговорено в решті цього " +"HOWTO." + +msgid ". ^ $ * + ? { } [ ] \\ | ( )" +msgstr "" + +msgid "" +"The first metacharacters we'll look at are ``[`` and ``]``. They're used for " +"specifying a character class, which is a set of characters that you wish to " +"match. Characters can be listed individually, or a range of characters can " +"be indicated by giving two characters and separating them by a ``'-'``. For " +"example, ``[abc]`` will match any of the characters ``a``, ``b``, or ``c``; " +"this is the same as ``[a-c]``, which uses a range to express the same set of " +"characters. If you wanted to match only lowercase letters, your RE would be " +"``[a-z]``." +msgstr "" +"Перші метасимволи, які ми розглянемо, це ``[`` і ``]``. Вони " +"використовуються для вказівки класу символів, який є набором символів, які " +"ви хочете зіставити. Символи можна перераховувати окремо або діапазон " +"символів можна вказати двома символами та розділити їх символом ``'-'``. " +"Наприклад, \"[abc]\" відповідатиме будь-якому із символів \"a\", \"b\" або " +"\"c\"; це те саме, що ``[a-c]``, який використовує діапазон для вираження " +"того самого набору символів. Якщо ви хочете зіставити лише малі літери, " +"вашим RE буде ``[a-z]``." + +msgid "" +"Metacharacters (except ``\\``) are not active inside classes. For example, " +"``[akm$]`` will match any of the characters ``'a'``, ``'k'``, ``'m'``, or " +"``'$'``; ``'$'`` is usually a metacharacter, but inside a character class " +"it's stripped of its special nature." +msgstr "" +"Метасимволи (крім ``\\``) неактивні всередині класів. Наприклад, ``[akm$]`` " +"відповідатиме будь-якому із символів ``'a'``, ``'k'``, ``'m'`` або ``'$'``; " +"``'$'`` зазвичай є метасимволом, але всередині класу символів він " +"позбавлений особливої природи." + +msgid "" +"You can match the characters not listed within the class by :dfn:" +"`complementing` the set. This is indicated by including a ``'^'`` as the " +"first character of the class. For example, ``[^5]`` will match any character " +"except ``'5'``. If the caret appears elsewhere in a character class, it " +"does not have special meaning. For example: ``[5^]`` will match either a " +"``'5'`` or a ``'^'``." +msgstr "" +"Ви можете зіставити символи, яких немає в списку в класі, :dfn:" +"`complementing` набір. Це вказується додаванням ``'^'`` як першого символу " +"класу. Наприклад, ``[^5]`` відповідатиме будь-якому символу, крім ``'5'``. " +"Якщо каретка з’являється в іншому місці класу символів, вона не має " +"особливого значення. Наприклад: ``[5^]`` відповідатиме або ``'5''``, або " +"``'^'``." + +msgid "" +"Perhaps the most important metacharacter is the backslash, ``\\``. As in " +"Python string literals, the backslash can be followed by various characters " +"to signal various special sequences. It's also used to escape all the " +"metacharacters so you can still match them in patterns; for example, if you " +"need to match a ``[`` or ``\\``, you can precede them with a backslash to " +"remove their special meaning: ``\\[`` or ``\\\\``." +msgstr "" +"Мабуть, найважливішим метасимволом є зворотна коса риска, ``\\``. Як і в " +"рядкових літералах Python, за зворотною скісною рискою можуть слідувати " +"різні символи, щоб позначити різні спеціальні послідовності. Він також " +"використовується для екранування всіх метасимволів, щоб ви все ще могли " +"зіставляти їх у шаблонах; наприклад, якщо вам потрібно знайти відповідність " +"``[`` або ``\\``, ви можете поставити перед ними зворотну скісну риску, щоб " +"видалити їхнє спеціальне значення: ``\\[`` або ``\\\\``." + +msgid "" +"Some of the special sequences beginning with ``'\\'`` represent predefined " +"sets of characters that are often useful, such as the set of digits, the set " +"of letters, or the set of anything that isn't whitespace." +msgstr "" +"Деякі спеціальні послідовності, що починаються з ``'\\'``, представляють " +"заздалегідь визначені набори символів, які часто є корисними, наприклад " +"набір цифр, набір літер або набір будь-чого, що не є пробілами." + +msgid "" +"Let's take an example: ``\\w`` matches any alphanumeric character. If the " +"regex pattern is expressed in bytes, this is equivalent to the class ``[a-zA-" +"Z0-9_]``. If the regex pattern is a string, ``\\w`` will match all the " +"characters marked as letters in the Unicode database provided by the :mod:" +"`unicodedata` module. You can use the more restricted definition of ``\\w`` " +"in a string pattern by supplying the :const:`re.ASCII` flag when compiling " +"the regular expression." +msgstr "" +"Розглянемо приклад: ``\\w`` відповідає будь-якому буквено-цифровому символу. " +"Якщо шаблон регулярного виразу виражено в байтах, це еквівалентно класу ``[a-" +"zA-Z0-9_]``. Якщо шаблон регулярного виразу є рядком, ``\\w`` відповідатиме " +"всім символам, позначеним як літери в базі даних Unicode, наданій модулем :" +"mod:`unicodedata`. Ви можете використовувати більш обмежене визначення " +"``\\w`` у шаблоні рядка, поставивши прапорець :const:`re.ASCII` під час " +"компіляції регулярного виразу." + +msgid "" +"The following list of special sequences isn't complete. For a complete list " +"of sequences and expanded class definitions for Unicode string patterns, see " +"the last part of :ref:`Regular Expression Syntax ` in the " +"Standard Library reference. In general, the Unicode versions match any " +"character that's in the appropriate category in the Unicode database." +msgstr "" +"Наступний список спеціальних послідовностей не є повним. Щоб отримати повний " +"список послідовностей і розширених визначень класів для шаблонів рядків " +"Unicode, перегляньте останню частину :ref:`Синтаксису регулярного виразу ` у довіднику стандартної бібліотеки. Загалом, версії Unicode " +"відповідають будь-якому символу, який знаходиться у відповідній категорії " +"бази даних Unicode." + +msgid "``\\d``" +msgstr "``\\d``" + +msgid "Matches any decimal digit; this is equivalent to the class ``[0-9]``." +msgstr "" +"Збігається з будь-якою десятковою цифрою; це еквівалентно класу ``[0-9]``." + +msgid "``\\D``" +msgstr "``\\D``" + +msgid "" +"Matches any non-digit character; this is equivalent to the class ``[^0-9]``." +msgstr "" +"Відповідає будь-якому нецифровому символу; це еквівалентно класу ``[^0-9]``." + +msgid "``\\s``" +msgstr "``\\s``" + +msgid "" +"Matches any whitespace character; this is equivalent to the class " +"``[ \\t\\n\\r\\f\\v]``." +msgstr "" +"Відповідає будь-якому пробілу; це еквівалентно класу ``[ \\t\\n\\r\\f\\v]``." + +msgid "``\\S``" +msgstr "``\\S``" + +msgid "" +"Matches any non-whitespace character; this is equivalent to the class ``[^ " +"\\t\\n\\r\\f\\v]``." +msgstr "" +"Відповідає будь-якому непробільному символу; це еквівалентно класу ``[^ " +"\\t\\n\\r\\f\\v]``." + +msgid "``\\w``" +msgstr "``\\w``" + +msgid "" +"Matches any alphanumeric character; this is equivalent to the class ``[a-zA-" +"Z0-9_]``." +msgstr "" +"Відповідає будь-якому буквено-цифровому символу; це еквівалентно класу ``[a-" +"zA-Z0-9_]``." + +msgid "``\\W``" +msgstr "``\\W``" + +msgid "" +"Matches any non-alphanumeric character; this is equivalent to the class " +"``[^a-zA-Z0-9_]``." +msgstr "" +"Відповідає будь-якому небуквено-цифровому символу; це еквівалентно класу " +"``[^a-zA-Z0-9_]``." + +msgid "" +"These sequences can be included inside a character class. For example, " +"``[\\s,.]`` is a character class that will match any whitespace character, " +"or ``','`` or ``'.'``." +msgstr "" +"Ці послідовності можна включити в клас символів. Наприклад, ``[\\s,.]`` — це " +"клас символів, який відповідатиме будь-якому пробілу, або ``',''`` чи " +"``'.''``." + +msgid "" +"The final metacharacter in this section is ``.``. It matches anything " +"except a newline character, and there's an alternate mode (:const:`re." +"DOTALL`) where it will match even a newline. ``.`` is often used where you " +"want to match \"any character\"." +msgstr "" +"Останнім метасимволом у цьому розділі є ``.``. Він відповідає будь-чому, " +"крім символу нового рядка, і є альтернативний режим (:const:`re.DOTALL`), де " +"він відповідатиме навіть новому рядку. ``.`` часто використовується, коли " +"потрібно знайти відповідність \"будь-якому символу\"." + +msgid "Repeating Things" +msgstr "Повторення речей" + +msgid "" +"Being able to match varying sets of characters is the first thing regular " +"expressions can do that isn't already possible with the methods available on " +"strings. However, if that was the only additional capability of regexes, " +"they wouldn't be much of an advance. Another capability is that you can " +"specify that portions of the RE must be repeated a certain number of times." +msgstr "" +"Здатність зіставляти різні набори символів — це перше, що можуть зробити " +"регулярні вирази, що ще не можливо за допомогою методів, доступних для " +"рядків. Однак, якби це була єдина додаткова можливість регулярних виразів, " +"вони не були б великим прогресом. Інша можливість полягає в тому, що ви " +"можете вказати, що частини RE мають повторюватися певну кількість разів." + +msgid "" +"The first metacharacter for repeating things that we'll look at is ``*``. " +"``*`` doesn't match the literal character ``'*'``; instead, it specifies " +"that the previous character can be matched zero or more times, instead of " +"exactly once." +msgstr "" +"Перший метасимвол для повторення речей, які ми розглянемо, це ``*``. ``*`` " +"не відповідає буквальному символу ``'*'``; натомість він визначає, що " +"попередній символ може бути зіставлений нуль або більше разів замість точно " +"одного разу." + +msgid "" +"For example, ``ca*t`` will match ``'ct'`` (0 ``'a'`` characters), ``'cat'`` " +"(1 ``'a'``), ``'caaat'`` (3 ``'a'`` characters), and so forth." +msgstr "" +"Наприклад, ``ca*t`` відповідатиме ``'ct'`` (0 символів ``'a'``), ``'cat'`` " +"(1 ``'a'``), ``'caaat'`` (3 символи ``'a'``) і так далі." + +msgid "" +"Repetitions such as ``*`` are :dfn:`greedy`; when repeating a RE, the " +"matching engine will try to repeat it as many times as possible. If later " +"portions of the pattern don't match, the matching engine will then back up " +"and try again with fewer repetitions." +msgstr "" +"Такі повтори, як ``*`` є :dfn:`greedy`; при повторенні RE механізм пошуку " +"відповідності намагатиметься повторити його якомога більше разів. Якщо " +"пізніші частини шаблону не збігаються, механізм пошуку відповідностей " +"створить резервну копію та спробує знову з меншою кількістю повторень." + +msgid "" +"A step-by-step example will make this more obvious. Let's consider the " +"expression ``a[bcd]*b``. This matches the letter ``'a'``, zero or more " +"letters from the class ``[bcd]``, and finally ends with a ``'b'``. Now " +"imagine matching this RE against the string ``'abcbd'``." +msgstr "" +"Покроковий приклад зробить це більш очевидним. Розглянемо вираз " +"``a[bcd]*b``. Це відповідає літері ``'a'``, нулю або більше літер з класу " +"``[bcd]`` і, нарешті, закінчується ``'b'``. Тепер уявіть, що зіставлення " +"цього RE з рядком ``'abcbd``." + +msgid "Step" +msgstr "Крок" + +msgid "Matched" +msgstr "Збіг" + +msgid "Explanation" +msgstr "Пояснення" + +msgid "1" +msgstr "1" + +msgid "``a``" +msgstr "``a``" + +msgid "The ``a`` in the RE matches." +msgstr "``a`` у RE відповідає." + +msgid "2" +msgstr "2" + +msgid "``abcbd``" +msgstr "``abcbd``" + +msgid "" +"The engine matches ``[bcd]*``, going as far as it can, which is to the end " +"of the string." +msgstr "" +"Механізм збігається з ``[bcd]*``, просуваючись якомога далі, тобто до кінця " +"рядка." + +msgid "3" +msgstr "3" + +msgid "*Failure*" +msgstr "*Невдача*" + +msgid "" +"The engine tries to match ``b``, but the current position is at the end of " +"the string, so it fails." +msgstr "" +"Механізм намагається знайти відповідність ``b``, але поточна позиція " +"знаходиться в кінці рядка, тому це не вдається." + +msgid "4" +msgstr "4" + +msgid "``abcb``" +msgstr "``abcb``" + +msgid "Back up, so that ``[bcd]*`` matches one less character." +msgstr "" +"Зробіть резервну копію, щоб ``[bcd]*`` відповідав на один символ менше." + +msgid "5" +msgstr "5" + +msgid "" +"Try ``b`` again, but the current position is at the last character, which is " +"a ``'d'``." +msgstr "" +"Спробуйте ``b`` ще раз, але поточна позиція знаходиться на останньому " +"символі, який є ``'d'``." + +msgid "6" +msgstr "6" + +msgid "``abc``" +msgstr "``abc``" + +msgid "Back up again, so that ``[bcd]*`` is only matching ``bc``." +msgstr "Знову створіть резервну копію, щоб ``[bcd]*`` відповідало лише ``bc``." + +msgid "" +"Try ``b`` again. This time the character at the current position is " +"``'b'``, so it succeeds." +msgstr "" +"Спробуйте ``b`` знову. Цього разу символом у поточній позиції є ``'b'``, " +"отже, це вдалось." + +msgid "" +"The end of the RE has now been reached, and it has matched ``'abcb'``. This " +"demonstrates how the matching engine goes as far as it can at first, and if " +"no match is found it will then progressively back up and retry the rest of " +"the RE again and again. It will back up until it has tried zero matches for " +"``[bcd]*``, and if that subsequently fails, the engine will conclude that " +"the string doesn't match the RE at all." +msgstr "" +"Кінець RE вже досягнуто, і він відповідає ``'abcb``. Це демонструє, як " +"система пошуку відповідностей спочатку йде так далеко, як тільки може, і " +"якщо відповідності не знайдено, вона поступово створюватиме резервні копії " +"та повторюватиме решту RE знову і знову. Він виконуватиме резервне " +"копіювання, доки не знайде нульових збігів для ``[bcd]*``, і якщо це згодом " +"не вдасться, система зробить висновок, що рядок взагалі не відповідає RE." + +msgid "" +"Another repeating metacharacter is ``+``, which matches one or more times. " +"Pay careful attention to the difference between ``*`` and ``+``; ``*`` " +"matches *zero* or more times, so whatever's being repeated may not be " +"present at all, while ``+`` requires at least *one* occurrence. To use a " +"similar example, ``ca+t`` will match ``'cat'`` (1 ``'a'``), ``'caaat'`` (3 " +"``'a'``\\ s), but won't match ``'ct'``." +msgstr "" +"Ще один повторюваний метасимвол – це ``+``, який збігається один або кілька " +"разів. Зверніть увагу на різницю між ``*`` і ``+``; ``*`` відповідає *нуль* " +"або більше разів, тому все, що повторюється, може взагалі не бути присутнім, " +"тоді як ``+`` вимагає принаймні *одного* входження. Щоб використати подібний " +"приклад, ``ca+t`` відповідатиме ``'cat'`` (1 ``'a'``), ``'caaat'`` (3 " +"``'a'``\\ s), але не відповідатиме ``'ct``." + +msgid "" +"There are two more repeating operators or quantifiers. The question mark " +"character, ``?``, matches either once or zero times; you can think of it as " +"marking something as being optional. For example, ``home-?brew`` matches " +"either ``'homebrew'`` or ``'home-brew'``." +msgstr "" +"Є ще два повторювані оператори або квантори. Знак питання, ``?``, збігається " +"або один раз, або нуль разів; ви можете розглядати це як позначення чогось " +"як необов’язкового. Наприклад, ``home-?brew`` matches either ``'homebrew'`` " +"або ``'home-brew'``." + +msgid "" +"The most complicated quantifier is ``{m,n}``, where *m* and *n* are decimal " +"integers. This quantifier means there must be at least *m* repetitions, and " +"at most *n*. For example, ``a/{1,3}b`` will match ``'a/b'``, ``'a//b'``, " +"and ``'a///b'``. It won't match ``'ab'``, which has no slashes, or ``'a////" +"b'``, which has four." +msgstr "" +"Найскладнішим квантором є ``{m,n}``, де *m* і *n* є десятковими цілими " +"числами. Цей квантор означає, що має бути принаймні *m* повторень і не " +"більше *n*. Наприклад, ``a/{1,3}b`` відповідатиме ``'a/b'``, ``'a//b'``, та " +"``'a///b'``. Він не збігатиметься з ``'ab'``, який не має похилих рисок, або " +"``'a////b'``, який має чотири." + +msgid "" +"You can omit either *m* or *n*; in that case, a reasonable value is assumed " +"for the missing value. Omitting *m* is interpreted as a lower limit of 0, " +"while omitting *n* results in an upper bound of infinity." +msgstr "" +"Ви можете опустити *m* або *n*; у цьому випадку для відсутнього значення " +"приймається розумне значення. Пропуск *m* інтерпретується як нижня межа 0, " +"тоді як пропуск *n* призводить до верхньої межі нескінченності." + +msgid "" +"The simplest case ``{m}`` matches the preceding item exactly *m* times. For " +"example, ``a/{2}b`` will only match ``'a//b'``." +msgstr "" + +msgid "" +"Readers of a reductionist bent may notice that the three other quantifiers " +"can all be expressed using this notation. ``{0,}`` is the same as ``*``, " +"``{1,}`` is equivalent to ``+``, and ``{0,1}`` is the same as ``?``. It's " +"better to use ``*``, ``+``, or ``?`` when you can, simply because they're " +"shorter and easier to read." +msgstr "" +"Редукціоністські читачі можуть помітити, що всі три інші квантори можна " +"виразити за допомогою цієї нотації. ``{0,}`` те саме, що ` ``*``, ``{1,}`` " +"еквівалентно ``+``, and ``{0,1}`` is the same as ``?``. Краще " +"використовувати ``*``, ``+``, або ``?``, коли є така можливість, просто " +"тому, що вони коротші та легші для читання." + +msgid "Using Regular Expressions" +msgstr "Використання регулярних виразів" + +msgid "" +"Now that we've looked at some simple regular expressions, how do we actually " +"use them in Python? The :mod:`re` module provides an interface to the " +"regular expression engine, allowing you to compile REs into objects and then " +"perform matches with them." +msgstr "" +"Тепер, коли ми розглянули деякі прості регулярні вирази, як ми насправді " +"використовуємо їх у Python? Модуль :mod:`re` надає інтерфейс механізму " +"регулярних виразів, дозволяючи вам компілювати RE в об’єкти, а потім " +"виконувати з ними збіги." + +msgid "Compiling Regular Expressions" +msgstr "Компіляція регулярних виразів" + +msgid "" +"Regular expressions are compiled into pattern objects, which have methods " +"for various operations such as searching for pattern matches or performing " +"string substitutions. ::" +msgstr "" +"Регулярні вирази компілюються в об’єкти шаблонів, які мають методи для " +"різноманітних операцій, таких як пошук збігів шаблону або виконання " +"підстановок рядків. ::" + +msgid "" +">>> import re\n" +">>> p = re.compile('ab*')\n" +">>> p\n" +"re.compile('ab*')" +msgstr "" + +msgid "" +":func:`re.compile` also accepts an optional *flags* argument, used to enable " +"various special features and syntax variations. We'll go over the available " +"settings later, but for now a single example will do::" +msgstr "" +":func:`re.compile` також приймає необов’язковий аргумент *flags*, який " +"використовується для ввімкнення різних спеціальних функцій і варіантів " +"синтаксису. Пізніше ми розглянемо доступні параметри, а поки підійде один " +"приклад:" + +msgid ">>> p = re.compile('ab*', re.IGNORECASE)" +msgstr "" + +msgid "" +"The RE is passed to :func:`re.compile` as a string. REs are handled as " +"strings because regular expressions aren't part of the core Python language, " +"and no special syntax was created for expressing them. (There are " +"applications that don't need REs at all, so there's no need to bloat the " +"language specification by including them.) Instead, the :mod:`re` module is " +"simply a C extension module included with Python, just like the :mod:" +"`socket` or :mod:`zlib` modules." +msgstr "" +"RE передається до :func:`re.compile` як рядок. RE обробляються як рядки, " +"оскільки регулярні вирази не є частиною основної мови Python, і для їх " +"вираження не створено спеціального синтаксису. (Існують програми, які " +"взагалі не потребують RE, тому немає потреби роздувати специфікацію мови, " +"включаючи їх.) Натомість модуль :mod:`re` є просто модулем розширення C, що " +"входить до складу Python, як і модулі :mod:`socket` або :mod:`zlib`." + +msgid "" +"Putting REs in strings keeps the Python language simpler, but has one " +"disadvantage which is the topic of the next section." +msgstr "" +"Розміщення RE в рядках робить мову Python простішою, але має один недолік, " +"який є темою наступного розділу." + +msgid "The Backslash Plague" +msgstr "Зворотна коса чума" + +msgid "" +"As stated earlier, regular expressions use the backslash character " +"(``'\\'``) to indicate special forms or to allow special characters to be " +"used without invoking their special meaning. This conflicts with Python's " +"usage of the same character for the same purpose in string literals." +msgstr "" +"Як було сказано раніше, у регулярних виразах використовується символ " +"зворотної косої риски (``'\\'``), щоб позначити спеціальні форми або " +"дозволити використовувати спеціальні символи без виклику їх особливого " +"значення. Це суперечить використанню Python того самого символу для тієї ж " +"мети в рядкових літералах." + +msgid "" +"Let's say you want to write a RE that matches the string ``\\section``, " +"which might be found in a LaTeX file. To figure out what to write in the " +"program code, start with the desired string to be matched. Next, you must " +"escape any backslashes and other metacharacters by preceding them with a " +"backslash, resulting in the string ``\\\\section``. The resulting string " +"that must be passed to :func:`re.compile` must be ``\\\\section``. However, " +"to express this as a Python string literal, both backslashes must be escaped " +"*again*." +msgstr "" +"Припустімо, ви хочете написати RE, який відповідає рядку ``\\section``, який " +"можна знайти у файлі LaTeX. Щоб зрозуміти, що писати в коді програми, " +"почніть із потрібного рядка, який потрібно знайти. Далі ви повинні уникнути " +"будь-яких зворотних похилих рисок та інших метасимволів, поставивши перед " +"ними зворотну похилу риску, що призведе до рядка ``\\\\section``. Отриманий " +"рядок, який потрібно передати в :func:`re.compile`, має бути ``\\" +"\\section``. Однак, щоб виразити це як рядковий літерал Python, обидві " +"зворотні похилі риски потрібно екранувати *знову*." + +msgid "Characters" +msgstr "Персонажі" + +msgid "Stage" +msgstr "етап" + +msgid "``\\section``" +msgstr "``\\розділ``" + +msgid "Text string to be matched" +msgstr "Текстовий рядок, який потрібно знайти" + +msgid "``\\\\section``" +msgstr "``\\\\розділ``" + +msgid "Escaped backslash for :func:`re.compile`" +msgstr "Екранований зворотний слеш для :func:`re.compile`" + +msgid "``\"\\\\\\\\section\"``" +msgstr "``\"\\\\\\\\розділ\"``" + +msgid "Escaped backslashes for a string literal" +msgstr "Екрановані зворотні косі риски для рядкового літералу" + +msgid "" +"In short, to match a literal backslash, one has to write ``'\\\\\\\\'`` as " +"the RE string, because the regular expression must be ``\\\\``, and each " +"backslash must be expressed as ``\\\\`` inside a regular Python string " +"literal. In REs that feature backslashes repeatedly, this leads to lots of " +"repeated backslashes and makes the resulting strings difficult to understand." +msgstr "" +"Коротше кажучи, щоб відповідати буквальному зворотному слешу, потрібно " +"написати ``'\\\\\\\\'`` як рядок RE, тому що регулярний вираз має бути ``\\" +"\\``, а кожен зворотний слеш має бути виражений як ``\\\\`` всередині " +"звичайного рядкового літералу Python. У RE, які неодноразово містять " +"зворотні косі риски, це призводить до великої кількості повторюваних " +"зворотних косих риск і ускладнює розуміння результуючих рядків." + +msgid "" +"The solution is to use Python's raw string notation for regular expressions; " +"backslashes are not handled in any special way in a string literal prefixed " +"with ``'r'``, so ``r\"\\n\"`` is a two-character string containing ``'\\'`` " +"and ``'n'``, while ``\"\\n\"`` is a one-character string containing a " +"newline. Regular expressions will often be written in Python code using this " +"raw string notation." +msgstr "" +"Рішення полягає у використанні необробленої рядкової нотації Python для " +"регулярних виразів; зворотні косі риски не обробляються спеціальним чином у " +"рядковому літералі з префіксом ``'r'``, тому ``r\"\\n\"`` є двосимвольним " +"рядком, що містить ``'\\'`` і ``' n'``, тоді як ``\"\\n\"`` є односимвольним " +"рядком, що містить новий рядок. Регулярні вирази часто записуються в коді " +"Python з використанням цієї необробленої рядкової нотації." + +msgid "" +"In addition, special escape sequences that are valid in regular expressions, " +"but not valid as Python string literals, now result in a :exc:" +"`DeprecationWarning` and will eventually become a :exc:`SyntaxError`, which " +"means the sequences will be invalid if raw string notation or escaping the " +"backslashes isn't used." +msgstr "" +"Крім того, спеціальні керуючі послідовності, дійсні в регулярних виразах, " +"але недійсні як рядкові літерали Python, тепер призводять до :exc:" +"`DeprecationWarning` і згодом стануть :exc:`SyntaxError`, що означає, що " +"послідовності будуть недійсними якщо не використовується необроблений " +"рядковий запис або екранування зворотних скісних риск." + +msgid "Regular String" +msgstr "Звичайний рядок" + +msgid "Raw string" +msgstr "Необроблений рядок" + +msgid "``\"ab*\"``" +msgstr "``\"ab*\"``" + +msgid "``r\"ab*\"``" +msgstr "``r\"ab*\"``" + +msgid "``r\"\\\\section\"``" +msgstr "``r\"\\\\розділ\"``" + +msgid "``\"\\\\w+\\\\s+\\\\1\"``" +msgstr "``\"\\\\w+\\\\s+\\\\1\"``" + +msgid "``r\"\\w+\\s+\\1\"``" +msgstr "``r\"\\w+\\s+\\1\"``" + +msgid "Performing Matches" +msgstr "Виконання матчів" + +msgid "" +"Once you have an object representing a compiled regular expression, what do " +"you do with it? Pattern objects have several methods and attributes. Only " +"the most significant ones will be covered here; consult the :mod:`re` docs " +"for a complete listing." +msgstr "" +"Якщо у вас є об’єкт, що представляє скомпільований регулярний вираз, що ви з " +"ним робите? Об’єкти шаблонів мають кілька методів і атрибутів. Тут будуть " +"розглянуті лише найважливіші з них; зверніться до документів :mod:`re` для " +"отримання повного списку." + +msgid "Method/Attribute" +msgstr "Метод/атрибут" + +msgid "Purpose" +msgstr "призначення" + +msgid "``match()``" +msgstr "``match()``" + +msgid "Determine if the RE matches at the beginning of the string." +msgstr "Визначте, чи відповідає RE на початку рядка." + +msgid "``search()``" +msgstr "``search()``" + +msgid "Scan through a string, looking for any location where this RE matches." +msgstr "Проскануйте рядок, шукаючи будь-яке місце, де цей RE відповідає." + +msgid "``findall()``" +msgstr "``findall()``" + +msgid "Find all substrings where the RE matches, and returns them as a list." +msgstr "" +"Знайти всі підрядки, де відповідає RE, і повернути їх у вигляді списку." + +msgid "``finditer()``" +msgstr "``finditer()``" + +msgid "" +"Find all substrings where the RE matches, and returns them as an :term:" +"`iterator`." +msgstr "" +"Знайти всі підрядки, де відповідає RE, і повернути їх як :term:`iterator`." + +msgid "" +":meth:`~re.Pattern.match` and :meth:`~re.Pattern.search` return ``None`` if " +"no match can be found. If they're successful, a :ref:`match object ` instance is returned, containing information about the match: " +"where it starts and ends, the substring it matched, and more." +msgstr "" +":meth:`~re.Pattern.match` і :meth:`~re.Pattern.search` повертають ``None``, " +"якщо збіг не знайдено. Якщо вони успішні, повертається екземпляр :ref:`match " +"object `, який містить інформацію про збіг: де він " +"починається і закінчується, підрядок, з яким він збігся, тощо." + +msgid "" +"You can learn about this by interactively experimenting with the :mod:`re` " +"module." +msgstr "" +"Ви можете дізнатися про це, інтерактивно поекспериментувавши з модулем :mod:" +"`re`." + +msgid "" +"This HOWTO uses the standard Python interpreter for its examples. First, run " +"the Python interpreter, import the :mod:`re` module, and compile a RE::" +msgstr "" +"Цей HOWTO використовує стандартний інтерпретатор Python для своїх прикладів. " +"Спочатку запустіть інтерпретатор Python, імпортуйте модуль :mod:`re` і " +"скомпілюйте RE::" + +msgid "" +">>> import re\n" +">>> p = re.compile('[a-z]+')\n" +">>> p\n" +"re.compile('[a-z]+')" +msgstr "" + +msgid "" +"Now, you can try matching various strings against the RE ``[a-z]+``. An " +"empty string shouldn't match at all, since ``+`` means 'one or more " +"repetitions'. :meth:`~re.Pattern.match` should return ``None`` in this case, " +"which will cause the interpreter to print no output. You can explicitly " +"print the result of :meth:`!match` to make this clear. ::" +msgstr "" +"Тепер ви можете спробувати зіставити різні рядки з RE ``[a-z]+``. Порожній " +"рядок взагалі не повинен збігатися, оскільки ``+`` означає 'одне або більше " +"повторень'. :meth:`~re.Pattern.match` має повернути ``None`` у цьому " +"випадку, що призведе до того, що інтерпретатор не друкуватиме вихідні дані. " +"Ви можете явно надрукувати результат :meth:`!match`, щоб це було " +"зрозуміло. ::" + +msgid "" +">>> p.match(\"\")\n" +">>> print(p.match(\"\"))\n" +"None" +msgstr "" + +msgid "" +"Now, let's try it on a string that it should match, such as ``tempo``. In " +"this case, :meth:`~re.Pattern.match` will return a :ref:`match object `, so you should store the result in a variable for later use. ::" +msgstr "" +"Тепер давайте спробуємо це на рядку, який має збігатися, наприклад " +"``tempo``. У цьому випадку :meth:`~re.Pattern.match` поверне :ref:`об’єкт " +"відповідності `, тому ви повинні зберегти результат у змінній " +"для подальшого використання. ::" + +msgid "" +">>> m = p.match('tempo')\n" +">>> m\n" +"" +msgstr "" + +msgid "" +"Now you can query the :ref:`match object ` for information " +"about the matching string. Match object instances also have several methods " +"and attributes; the most important ones are:" +msgstr "" +"Тепер ви можете запитати :ref:`match object ` для отримання " +"інформації про відповідний рядок. Екземпляри об’єктів зіставлення також " +"мають кілька методів і атрибутів; найважливіші з них:" + +msgid "``group()``" +msgstr "``group()``" + +msgid "Return the string matched by the RE" +msgstr "Повертає рядок, який відповідає RE" + +msgid "``start()``" +msgstr "``start()``" + +msgid "Return the starting position of the match" +msgstr "Повернути вихідну позицію матчу" + +msgid "``end()``" +msgstr "``end()``" + +msgid "Return the ending position of the match" +msgstr "Повернення кінцевої позиції матчу" + +msgid "``span()``" +msgstr "``span()``" + +msgid "Return a tuple containing the (start, end) positions of the match" +msgstr "Повертає кортеж, що містить (початкову, кінцеву) позиції збігу" + +msgid "Trying these methods will soon clarify their meaning::" +msgstr "Спроба цих методів незабаром прояснить їх значення:" + +msgid "" +">>> m.group()\n" +"'tempo'\n" +">>> m.start(), m.end()\n" +"(0, 5)\n" +">>> m.span()\n" +"(0, 5)" +msgstr "" + +msgid "" +":meth:`~re.Match.group` returns the substring that was matched by the RE. :" +"meth:`~re.Match.start` and :meth:`~re.Match.end` return the starting and " +"ending index of the match. :meth:`~re.Match.span` returns both start and end " +"indexes in a single tuple. Since the :meth:`~re.Pattern.match` method only " +"checks if the RE matches at the start of a string, :meth:`!start` will " +"always be zero. However, the :meth:`~re.Pattern.search` method of patterns " +"scans through the string, so the match may not start at zero in that " +"case. ::" +msgstr "" +":meth:`~re.Match.group` повертає підрядок, який був зіставлений RE. :meth:" +"`~re.Match.start` і :meth:`~re.Match.end` повертають початковий і кінцевий " +"індекси збігу. :meth:`~re.Match.span` повертає початковий і кінцевий індекси " +"в одному кортежі. Оскільки метод :meth:`~re.Pattern.match` лише перевіряє, " +"чи відповідає RE на початку рядка, :meth:`!start` завжди дорівнюватиме нулю. " +"Однак метод шаблонів :meth:`~re.Pattern.search` сканує рядок, тому в цьому " +"випадку збіг може не початися з нуля. ::" + +msgid "" +">>> print(p.match('::: message'))\n" +"None\n" +">>> m = p.search('::: message'); print(m)\n" +"\n" +">>> m.group()\n" +"'message'\n" +">>> m.span()\n" +"(4, 11)" +msgstr "" + +msgid "" +"In actual programs, the most common style is to store the :ref:`match object " +"` in a variable, and then check if it was ``None``. This " +"usually looks like::" +msgstr "" +"У реальних програмах найпоширенішим стилем є збереження :ref:`match object " +"` у змінній, а потім перевірка, чи вона була ``None``. " +"Зазвичай це виглядає так::" + +msgid "" +"p = re.compile( ... )\n" +"m = p.match( 'string goes here' )\n" +"if m:\n" +" print('Match found: ', m.group())\n" +"else:\n" +" print('No match')" +msgstr "" + +msgid "" +"Two pattern methods return all of the matches for a pattern. :meth:`~re." +"Pattern.findall` returns a list of matching strings::" +msgstr "" +"Два методи шаблону повертають усі збіги шаблону. :meth:`~re.Pattern.findall` " +"повертає список відповідних рядків::" + +msgid "" +">>> p = re.compile(r'\\d+')\n" +">>> p.findall('12 drummers drumming, 11 pipers piping, 10 lords a-leaping')\n" +"['12', '11', '10']" +msgstr "" + +msgid "" +"The ``r`` prefix, making the literal a raw string literal, is needed in this " +"example because escape sequences in a normal \"cooked\" string literal that " +"are not recognized by Python, as opposed to regular expressions, now result " +"in a :exc:`DeprecationWarning` and will eventually become a :exc:" +"`SyntaxError`. See :ref:`the-backslash-plague`." +msgstr "" +"Префікс ``r``, який робить літерал необробленим рядковим літералом, потрібен " +"у цьому прикладі, тому що escape-послідовності у звичайному \"вареному\" " +"рядковому літералі, які не розпізнаються Python, на відміну від регулярних " +"виразів, тепер призводять до :exc:`DeprecationWarning` і з часом стане :exc:" +"`SyntaxError`. Дивіться :ref:`the-backslash-plague`." + +msgid "" +":meth:`~re.Pattern.findall` has to create the entire list before it can be " +"returned as the result. The :meth:`~re.Pattern.finditer` method returns a " +"sequence of :ref:`match object ` instances as an :term:" +"`iterator`::" +msgstr "" +":meth:`~re.Pattern.findall` має створити весь список, перш ніж його можна " +"буде повернути як результат. Метод :meth:`~re.Pattern.finditer` повертає " +"послідовність екземплярів :ref:`match object ` як :term:" +"`iterator`::" + +msgid "" +">>> iterator = p.finditer('12 drummers drumming, 11 ... 10 ...')\n" +">>> iterator\n" +"\n" +">>> for match in iterator:\n" +"... print(match.span())\n" +"...\n" +"(0, 2)\n" +"(22, 24)\n" +"(29, 31)" +msgstr "" + +msgid "Module-Level Functions" +msgstr "Функції рівня модуля" + +msgid "" +"You don't have to create a pattern object and call its methods; the :mod:" +"`re` module also provides top-level functions called :func:`~re.match`, :" +"func:`~re.search`, :func:`~re.findall`, :func:`~re.sub`, and so forth. " +"These functions take the same arguments as the corresponding pattern method " +"with the RE string added as the first argument, and still return either " +"``None`` or a :ref:`match object ` instance. ::" +msgstr "" +"Вам не потрібно створювати шаблонний об’єкт і викликати його методи; модуль :" +"mod:`re` також надає функції верхнього рівня під назвою :func:`~re.match`, :" +"func:`~re.search`, :func:`~re.findall`, :func:`~re.sub` і так далі. Ці " +"функції приймають ті самі аргументи, що й відповідний метод шаблону з рядком " +"RE, доданим як перший аргумент, і все одно повертають ``None`` або " +"екземпляр :ref:`match object `. ::" + +msgid "" +">>> print(re.match(r'From\\s+', 'Fromage amk'))\n" +"None\n" +">>> re.match(r'From\\s+', 'From amk Thu May 14 19:12:10 1998')\n" +"" +msgstr "" + +msgid "" +"Under the hood, these functions simply create a pattern object for you and " +"call the appropriate method on it. They also store the compiled object in a " +"cache, so future calls using the same RE won't need to parse the pattern " +"again and again." +msgstr "" +"Під капотом ці функції просто створюють для вас шаблонний об’єкт і " +"викликають для нього відповідний метод. Вони також зберігають скомпільований " +"об’єкт у кеш-пам’яті, тому для майбутніх викликів із використанням того " +"самого RE не потрібно буде аналізувати шаблон знову і знову." + +msgid "" +"Should you use these module-level functions, or should you get the pattern " +"and call its methods yourself? If you're accessing a regex within a loop, " +"pre-compiling it will save a few function calls. Outside of loops, there's " +"not much difference thanks to the internal cache." +msgstr "" +"Ви повинні використовувати ці функції на рівні модуля, чи вам слід отримати " +"шаблон і викликати його методи самостійно? Якщо ви отримуєте доступ до " +"регулярного виразу в циклі, його попередня компіляція заощадить кілька " +"викликів функцій. За межами циклів немає великої різниці завдяки " +"внутрішньому кешу." + +msgid "Compilation Flags" +msgstr "Прапори компіляції" + +msgid "" +"Compilation flags let you modify some aspects of how regular expressions " +"work. Flags are available in the :mod:`re` module under two names, a long " +"name such as :const:`IGNORECASE` and a short, one-letter form such as :const:" +"`I`. (If you're familiar with Perl's pattern modifiers, the one-letter " +"forms use the same letters; the short form of :const:`re.VERBOSE` is :const:" +"`re.X`, for example.) Multiple flags can be specified by bitwise OR-ing " +"them; ``re.I | re.M`` sets both the :const:`I` and :const:`M` flags, for " +"example." +msgstr "" +"Прапори компіляції дозволяють змінювати деякі аспекти роботи регулярних " +"виразів. Прапори доступні в модулі :mod:`re` під двома назвами: довгою " +"назвою, як-от :const:`IGNORECASE`, і короткою однолітерною формою, як-от :" +"const:`I`. (Якщо ви знайомі з модифікаторами шаблонів Perl, однолітерні " +"форми використовують ті самі літери; наприклад, коротка форма :const:`re." +"VERBOSE` це :const:`re.X`.) Кілька прапорів можуть вказувати їх порозрядним " +"АБО; ``re.I | re.M`` встановлює, наприклад, прапорці :const:`I` і :const:`M`." + +msgid "" +"Here's a table of the available flags, followed by a more detailed " +"explanation of each one." +msgstr "" +"Ось таблиця доступних прапорів із більш детальним поясненням кожного з них." + +msgid "Flag" +msgstr "Прапор" + +msgid "Meaning" +msgstr "Значення" + +msgid ":const:`ASCII`, :const:`A`" +msgstr ":const:`ASCII`, :const:`A`" + +msgid "" +"Makes several escapes like ``\\w``, ``\\b``, ``\\s`` and ``\\d`` match only " +"on ASCII characters with the respective property." +msgstr "" +"Декілька символів екранування, як-от ``\\w``, ``\\b``, ``\\s`` і ``\\d``, " +"збігаються лише з символами ASCII з відповідною властивістю." + +msgid ":const:`DOTALL`, :const:`S`" +msgstr ":const:`DOTALL`, :const:`S`" + +msgid "Make ``.`` match any character, including newlines." +msgstr "" +"Зробіть \".\" відповідним будь-якому символу, включно з новими рядками." + +msgid ":const:`IGNORECASE`, :const:`I`" +msgstr ":const:`IGNORECASE`, :const:`I`" + +msgid "Do case-insensitive matches." +msgstr "Збіги без урахування регістру." + +msgid ":const:`LOCALE`, :const:`L`" +msgstr ":const:`LOCALE`, :const:`L`" + +msgid "Do a locale-aware match." +msgstr "Виконайте відповідність з урахуванням локалі." + +msgid ":const:`MULTILINE`, :const:`M`" +msgstr ":const:`MULTILINE`, :const:`M`" + +msgid "Multi-line matching, affecting ``^`` and ``$``." +msgstr "Багаторядкова відповідність, що впливає на ``^`` і ``$``." + +msgid ":const:`VERBOSE`, :const:`X` (for 'extended')" +msgstr ":const:`VERBOSE`, :const:`X` (для \"розширеного\")" + +msgid "" +"Enable verbose REs, which can be organized more cleanly and understandably." +msgstr "" +"Увімкніть докладні RE, які можна організувати більш чітко та зрозуміло." + +msgid "" +"Perform case-insensitive matching; character class and literal strings will " +"match letters by ignoring case. For example, ``[A-Z]`` will match lowercase " +"letters, too. Full Unicode matching also works unless the :const:`ASCII` " +"flag is used to disable non-ASCII matches. When the Unicode patterns ``[a-" +"z]`` or ``[A-Z]`` are used in combination with the :const:`IGNORECASE` flag, " +"they will match the 52 ASCII letters and 4 additional non-ASCII letters: 'İ' " +"(U+0130, Latin capital letter I with dot above), 'ı' (U+0131, Latin small " +"letter dotless i), 'ſ' (U+017F, Latin small letter long s) and 'K' (U+212A, " +"Kelvin sign). ``Spam`` will match ``'Spam'``, ``'spam'``, ``'spAM'``, or " +"``'ſpam'`` (the latter is matched only in Unicode mode). This lowercasing " +"doesn't take the current locale into account; it will if you also set the :" +"const:`LOCALE` flag." +msgstr "" +"Виконуйте зіставлення без урахування регістру; клас символів і літеральні " +"рядки будуть відповідати буквам, ігноруючи регістр. Наприклад, ``[A-Z]`` " +"також відповідатиме малим регістрам. Повна відповідність Unicode також " +"працює, якщо не використовується прапорець :const:`ASCII`, щоб вимкнути " +"збіги, відмінні від ASCII. Коли шаблони Unicode ``[a-z]`` або ``[A-Z]`` " +"використовуються в поєднанні з прапором :const:`IGNORECASE`, вони " +"відповідатимуть 52 літерам ASCII і 4 додатковим літерам, які не належать до " +"ASCII: 'İ ' (U+0130, латинська велика літера I з крапкою вгорі), 'ı' " +"(U+0131, латинська мала літера без крапки), 'ſ' (U+017F, латинська мала " +"літера довге s) і 'K' (U +212A, знак Кельвіна). ``Spam`` відповідатиме " +"``'Spam'``, ``'spam'``, ``'spAM'`` або ``'ſpam'`` (останній збігається лише " +"в режимі Unicode). Цей нижній регістр не враховує поточну мову; це буде, " +"якщо ви також установите прапорець :const:`LOCALE`." + +msgid "" +"Make ``\\w``, ``\\W``, ``\\b``, ``\\B`` and case-insensitive matching " +"dependent on the current locale instead of the Unicode database." +msgstr "" +"Зробіть ``\\w``, ``\\W``, ``\\b``, ``\\B`` і відповідність без урахування " +"регістру залежною від поточної мови замість бази даних Unicode." + +msgid "" +"Locales are a feature of the C library intended to help in writing programs " +"that take account of language differences. For example, if you're " +"processing encoded French text, you'd want to be able to write ``\\w+`` to " +"match words, but ``\\w`` only matches the character class ``[A-Za-z]`` in " +"bytes patterns; it won't match bytes corresponding to ``é`` or ``ç``. If " +"your system is configured properly and a French locale is selected, certain " +"C functions will tell the program that the byte corresponding to ``é`` " +"should also be considered a letter. Setting the :const:`LOCALE` flag when " +"compiling a regular expression will cause the resulting compiled object to " +"use these C functions for ``\\w``; this is slower, but also enables ``\\w+`` " +"to match French words as you'd expect. The use of this flag is discouraged " +"in Python 3 as the locale mechanism is very unreliable, it only handles one " +"\"culture\" at a time, and it only works with 8-bit locales. Unicode " +"matching is already enabled by default in Python 3 for Unicode (str) " +"patterns, and it is able to handle different locales/languages." +msgstr "" +"Локалі — це функція бібліотеки C, призначена для допомоги в написанні " +"програм, які враховують мовні відмінності. Наприклад, якщо ви обробляєте " +"закодований французький текст, ви б хотіли мати можливість писати ``\\w+`` " +"для відповідності слів, але ``\\w`` відповідає лише класу символів ``[A-Za- " +"z]`` у шаблонах байтів; він не співпадатиме з байтами, що відповідають ``é`` " +"або ``ç``. Якщо ваша система налаштована належним чином і вибрано французьку " +"мову, певні функції C повідомлять програмі, що байт, який відповідає ``é``, " +"також слід вважати літерою. Встановлення прапорця :const:`LOCALE` під час " +"компіляції регулярного виразу змусить отриманий скомпільований об’єкт " +"використовувати ці функції C для ``\\w``; це повільніше, але також дозволяє " +"``\\w+`` відповідати французьким словам, як ви очікуєте. Використання цього " +"прапора не рекомендується в Python 3, оскільки механізм локалізації дуже " +"ненадійний, він обробляє лише одну \"культуру\" за раз і працює лише з 8-" +"бітними локалями. Зіставлення Unicode вже ввімкнено за замовчуванням у " +"Python 3 для шаблонів Unicode (str), і він здатний обробляти різні локалі/" +"мови." + +msgid "" +"(``^`` and ``$`` haven't been explained yet; they'll be introduced in " +"section :ref:`more-metacharacters`.)" +msgstr "" +"(``^`` і ``$`` ще не пояснено; їх буде введено в розділі :ref:`more-" +"metacharacters`.)" + +msgid "" +"Usually ``^`` matches only at the beginning of the string, and ``$`` matches " +"only at the end of the string and immediately before the newline (if any) at " +"the end of the string. When this flag is specified, ``^`` matches at the " +"beginning of the string and at the beginning of each line within the string, " +"immediately following each newline. Similarly, the ``$`` metacharacter " +"matches either at the end of the string and at the end of each line " +"(immediately preceding each newline)." +msgstr "" +"Зазвичай ``^`` збігається лише на початку рядка, а ``$`` збігається лише в " +"кінці рядка та безпосередньо перед символом нового рядка (якщо є) у кінці " +"рядка. Якщо вказано цей прапорець, ``^`` збігається на початку рядка та на " +"початку кожного рядка в рядку, відразу після кожного нового рядка. Подібним " +"чином, метасимвол ``$`` збігається або в кінці рядка, і в кінці кожного " +"рядка (безпосередньо перед кожним новим рядком)." + +msgid "" +"Makes the ``'.'`` special character match any character at all, including a " +"newline; without this flag, ``'.'`` will match anything *except* a newline." +msgstr "" +"Робить спеціальний символ ``'.'`` відповідним будь-якому символу взагалі, " +"включно з символом нового рядка; без цього прапорця ``'.'`` відповідатиме " +"будь-чому *крім* нового рядка." + +msgid "" +"Make ``\\w``, ``\\W``, ``\\b``, ``\\B``, ``\\s`` and ``\\S`` perform ASCII-" +"only matching instead of full Unicode matching. This is only meaningful for " +"Unicode patterns, and is ignored for byte patterns." +msgstr "" +"Змусити ``\\w``, ``\\W``, ``\\b``, ``\\B``, ``\\s`` і ``\\S`` виконувати " +"відповідність лише ASCII замість повної Зіставлення Unicode. Це має значення " +"лише для шаблонів Unicode та ігнорується для шаблонів байтів." + +msgid "" +"This flag allows you to write regular expressions that are more readable by " +"granting you more flexibility in how you can format them. When this flag " +"has been specified, whitespace within the RE string is ignored, except when " +"the whitespace is in a character class or preceded by an unescaped " +"backslash; this lets you organize and indent the RE more clearly. This flag " +"also lets you put comments within a RE that will be ignored by the engine; " +"comments are marked by a ``'#'`` that's neither in a character class or " +"preceded by an unescaped backslash." +msgstr "" +"Цей прапорець дозволяє вам писати регулярні вирази, які є більш " +"читабельними, надаючи вам більше гнучкості у тому, як ви можете їх " +"форматувати. Якщо вказано цей прапорець, пробіли в рядку RE ігноруються, за " +"винятком випадків, коли пробіли знаходяться в класі символів або перед ними " +"стоїть неекранована зворотна похила риска; це дозволяє більш чітко " +"організувати та зробити відступи RE. Цей прапор також дозволяє розміщувати " +"коментарі в RE, які ігноруватимуться механізмом; коментарі позначаються " +"символом ``'#'``, якого немає в класі символів або якому передує " +"неекранований зворотний слеш." + +msgid "" +"For example, here's a RE that uses :const:`re.VERBOSE`; see how much easier " +"it is to read? ::" +msgstr "" +"Наприклад, ось RE, який використовує :const:`re.VERBOSE`; бачите, наскільки " +"легше читати? ::" + +msgid "" +"charref = re.compile(r\"\"\"\n" +" &[#] # Start of a numeric entity reference\n" +" (\n" +" 0[0-7]+ # Octal form\n" +" | [0-9]+ # Decimal form\n" +" | x[0-9a-fA-F]+ # Hexadecimal form\n" +" )\n" +" ; # Trailing semicolon\n" +"\"\"\", re.VERBOSE)" +msgstr "" + +msgid "Without the verbose setting, the RE would look like this::" +msgstr "Без параметра verbose RE виглядатиме так:" + +msgid "" +"charref = re.compile(\"&#(0[0-7]+\"\n" +" \"|[0-9]+\"\n" +" \"|x[0-9a-fA-F]+);\")" +msgstr "" + +msgid "" +"In the above example, Python's automatic concatenation of string literals " +"has been used to break up the RE into smaller pieces, but it's still more " +"difficult to understand than the version using :const:`re.VERBOSE`." +msgstr "" +"У наведеному вище прикладі автоматичне об’єднання рядкових літералів Python " +"було використано для розбиття RE на менші частини, але це все ще важче " +"зрозуміти, ніж версію з використанням :const:`re.VERBOSE`." + +msgid "More Pattern Power" +msgstr "Більше потужності шаблону" + +msgid "" +"So far we've only covered a part of the features of regular expressions. In " +"this section, we'll cover some new metacharacters, and how to use groups to " +"retrieve portions of the text that was matched." +msgstr "" +"Поки що ми розглянули лише частину функцій регулярних виразів. У цьому " +"розділі ми розглянемо деякі нові метасимволи, а також те, як використовувати " +"групи для отримання частин тексту, які збігаються." + +msgid "More Metacharacters" +msgstr "Більше метасимволів" + +msgid "" +"There are some metacharacters that we haven't covered yet. Most of them " +"will be covered in this section." +msgstr "" +"Є деякі метасимволи, які ми ще не розглянули. Більшість із них буде " +"розглянуто в цьому розділі." + +msgid "" +"Some of the remaining metacharacters to be discussed are :dfn:`zero-width " +"assertions`. They don't cause the engine to advance through the string; " +"instead, they consume no characters at all, and simply succeed or fail. For " +"example, ``\\b`` is an assertion that the current position is located at a " +"word boundary; the position isn't changed by the ``\\b`` at all. This means " +"that zero-width assertions should never be repeated, because if they match " +"once at a given location, they can obviously be matched an infinite number " +"of times." +msgstr "" +"Деякі метасимволи, які залишилися для обговорення, це :dfn:`затвердження " +"нульової ширини`. Вони не змушують двигун просуватися по струні; натомість " +"вони взагалі не використовують жодних символів і просто досягають успіху або " +"зазнають невдачі. Наприклад, ``\\b`` - це твердження, що поточна позиція " +"розташована на межі слова; позиція взагалі не змінюється ``\\b``. Це " +"означає, що твердження нульової ширини ніколи не повинні повторюватися, " +"оскільки якщо вони збігаються один раз у заданому місці, вони, очевидно, " +"можуть бути зіставлені нескінченну кількість разів." + +msgid "``|``" +msgstr "``|``" + +msgid "" +"Alternation, or the \"or\" operator. If *A* and *B* are regular " +"expressions, ``A|B`` will match any string that matches either *A* or *B*. " +"``|`` has very low precedence in order to make it work reasonably when " +"you're alternating multi-character strings. ``Crow|Servo`` will match either " +"``'Crow'`` or ``'Servo'``, not ``'Cro'``, a ``'w'`` or an ``'S'``, and " +"``'ervo'``." +msgstr "" +"Чергування або оператор \"або\". Якщо *A* і *B* є регулярними виразами, ``A|" +"B`` відповідатиме будь-якому рядку, який відповідає *A* або *B*. ``|`` має " +"дуже низький пріоритет, щоб він працював розумно, коли ви чергуєте " +"багатосимвольні рядки. ``Crow|Servo`` відповідатиме ``'Crow'`` або " +"``'Servo'``, а не ``'Cro'``, ``'w'`` чи ``'S'`` і ``'ervo''``." + +msgid "" +"To match a literal ``'|'``, use ``\\|``, or enclose it inside a character " +"class, as in ``[|]``." +msgstr "" +"Щоб відповідати літералу ``'|'``, використовуйте ``\\|`` або вкладіть його в " +"клас символів, як у ``[|]``." + +msgid "``^``" +msgstr "``^``" + +msgid "" +"Matches at the beginning of lines. Unless the :const:`MULTILINE` flag has " +"been set, this will only match at the beginning of the string. In :const:" +"`MULTILINE` mode, this also matches immediately after each newline within " +"the string." +msgstr "" +"Збіги на початку рядків. Якщо не встановлено прапорець :const:`MULTILINE`, " +"він збігатиметься лише на початку рядка. У режимі :const:`MULTILINE` це " +"також збігається відразу після кожного нового рядка в рядку." + +msgid "" +"For example, if you wish to match the word ``From`` only at the beginning of " +"a line, the RE to use is ``^From``. ::" +msgstr "" +"Наприклад, якщо ви бажаєте зіставити слово ``From`` лише на початку рядка, " +"використовуйте RE ``^From``. ::" + +msgid "" +">>> print(re.search('^From', 'From Here to Eternity'))\n" +"\n" +">>> print(re.search('^From', 'Reciting From Memory'))\n" +"None" +msgstr "" + +msgid "To match a literal ``'^'``, use ``\\^``." +msgstr "Щоб відповідати літералу ``'^'``, використовуйте ``\\^``." + +msgid "``$``" +msgstr "``$``" + +msgid "" +"Matches at the end of a line, which is defined as either the end of the " +"string, or any location followed by a newline character. ::" +msgstr "" +"Збігається в кінці рядка, який визначається як кінець рядка або будь-яке " +"місце, після якого йде символ нового рядка. ::" + +msgid "" +">>> print(re.search('}$', '{block}'))\n" +"\n" +">>> print(re.search('}$', '{block} '))\n" +"None\n" +">>> print(re.search('}$', '{block}\\n'))\n" +"" +msgstr "" + +msgid "" +"To match a literal ``'$'``, use ``\\$`` or enclose it inside a character " +"class, as in ``[$]``." +msgstr "" +"Щоб відповідати літералу ``'$'``, використовуйте ``\\$`` або вкладіть його в " +"клас символів, як у ``[$]``." + +msgid "``\\A``" +msgstr "``\\A``" + +msgid "" +"Matches only at the start of the string. When not in :const:`MULTILINE` " +"mode, ``\\A`` and ``^`` are effectively the same. In :const:`MULTILINE` " +"mode, they're different: ``\\A`` still matches only at the beginning of the " +"string, but ``^`` may match at any location inside the string that follows a " +"newline character." +msgstr "" +"Збігається лише на початку рядка. Якщо не в режимі :const:`MULTILINE`, " +"``\\A`` і ``^`` фактично однакові. У режимі :const:`MULTILINE` вони " +"відрізняються: ``\\A`` все ще збігається лише на початку рядка, але ``^`` " +"може збігатися в будь-якому місці всередині рядка, яке слідує за символом " +"нового рядка." + +msgid "``\\Z``" +msgstr "``\\Z``" + +msgid "Matches only at the end of the string." +msgstr "Збігається лише в кінці рядка." + +msgid "``\\b``" +msgstr "``\\b``" + +msgid "" +"Word boundary. This is a zero-width assertion that matches only at the " +"beginning or end of a word. A word is defined as a sequence of alphanumeric " +"characters, so the end of a word is indicated by whitespace or a non-" +"alphanumeric character." +msgstr "" +"Кордон слова. Це твердження нульової ширини, яке збігається лише на початку " +"або в кінці слова. Слово визначається як послідовність буквено-цифрових " +"символів, тому кінець слова позначається пробілом або неалфавітно-цифровим " +"символом." + +msgid "" +"The following example matches ``class`` only when it's a complete word; it " +"won't match when it's contained inside another word. ::" +msgstr "" +"Наступний приклад відповідає ``класу`` лише тоді, коли це повне слово; воно " +"не збігається, якщо міститься всередині іншого слова. ::" + +msgid "" +">>> p = re.compile(r'\\bclass\\b')\n" +">>> print(p.search('no class at all'))\n" +"\n" +">>> print(p.search('the declassified algorithm'))\n" +"None\n" +">>> print(p.search('one subclass is'))\n" +"None" +msgstr "" + +msgid "" +"There are two subtleties you should remember when using this special " +"sequence. First, this is the worst collision between Python's string " +"literals and regular expression sequences. In Python's string literals, " +"``\\b`` is the backspace character, ASCII value 8. If you're not using raw " +"strings, then Python will convert the ``\\b`` to a backspace, and your RE " +"won't match as you expect it to. The following example looks the same as our " +"previous RE, but omits the ``'r'`` in front of the RE string. ::" +msgstr "" +"Використовуючи цю особливу послідовність, слід пам’ятати про дві тонкощі. По-" +"перше, це найгірша колізія між рядковими літералами Python і послідовностями " +"регулярних виразів. У рядкових літералах Python ``\\b`` є символом " +"повернення, значення ASCII 8. Якщо ви не використовуєте необроблені рядки, " +"тоді Python перетворить ``\\b`` на пропуск, а ваш RE не буде відповідати, як " +"ви очікуєте. Наступний приклад виглядає так само, як наш попередній RE, але " +"опущено ``'r'`` перед рядком RE. ::" + +msgid "" +">>> p = re.compile('\\bclass\\b')\n" +">>> print(p.search('no class at all'))\n" +"None\n" +">>> print(p.search('\\b' + 'class' + '\\b'))\n" +"" +msgstr "" + +msgid "" +"Second, inside a character class, where there's no use for this assertion, " +"``\\b`` represents the backspace character, for compatibility with Python's " +"string literals." +msgstr "" +"По-друге, всередині класу символів, де немає користі для цього твердження, " +"``\\b`` представляє символ зворотного простору для сумісності з рядковими " +"літералами Python." + +msgid "``\\B``" +msgstr "``\\B``" + +msgid "" +"Another zero-width assertion, this is the opposite of ``\\b``, only matching " +"when the current position is not at a word boundary." +msgstr "" +"Інше твердження нульової ширини, це протилежність ``\\b``, збігається лише " +"тоді, коли поточна позиція не знаходиться на межі слова." + +msgid "Grouping" +msgstr "Групування" + +msgid "" +"Frequently you need to obtain more information than just whether the RE " +"matched or not. Regular expressions are often used to dissect strings by " +"writing a RE divided into several subgroups which match different components " +"of interest. For example, an RFC-822 header line is divided into a header " +"name and a value, separated by a ``':'``, like this:" +msgstr "" +"Часто вам потрібно отримати більше інформації, ніж просто відповідність RE " +"чи ні. Регулярні вирази часто використовуються для аналізу рядків шляхом " +"запису RE, розділеного на кілька підгруп, які відповідають різним цікавим " +"компонентам. Наприклад, рядок заголовка RFC-822 розділено на ім’я заголовка " +"та значення, розділені символом ``':'``, ось так:" + +msgid "" +"From: author@example.com\n" +"User-Agent: Thunderbird 1.5.0.9 (X11/20061227)\n" +"MIME-Version: 1.0\n" +"To: editor@example.com" +msgstr "" + +msgid "" +"This can be handled by writing a regular expression which matches an entire " +"header line, and has one group which matches the header name, and another " +"group which matches the header's value." +msgstr "" +"Це можна вирішити, написавши регулярний вираз, який відповідає всьому рядку " +"заголовка та має одну групу, яка відповідає імені заголовка, та іншу групу, " +"яка відповідає значенню заголовка." + +msgid "" +"Groups are marked by the ``'('``, ``')'`` metacharacters. ``'('`` and " +"``')'`` have much the same meaning as they do in mathematical expressions; " +"they group together the expressions contained inside them, and you can " +"repeat the contents of a group with a quantifier, such as ``*``, ``+``, ``?" +"``, or ``{m,n}``. For example, ``(ab)*`` will match zero or more " +"repetitions of ``ab``. ::" +msgstr "" +"Групи позначені метасимволами ``'('`` та ``')'``. ``'('`` і ``')'`` мають " +"майже те саме значення, що й у математичних виразах; вони групують вирази, " +"що містяться в них, і ви можете повторити вміст групи за допомогою квантора, " +"наприклад ``*``, ``+``, ``?``, або ``{m,n}``. Наприклад, ``(ab)*`` " +"відповідатиме нулю або більше повторень ``ab``. ::" + +msgid "" +">>> p = re.compile('(ab)*')\n" +">>> print(p.match('ababababab').span())\n" +"(0, 10)" +msgstr "" + +msgid "" +"Groups indicated with ``'('``, ``')'`` also capture the starting and ending " +"index of the text that they match; this can be retrieved by passing an " +"argument to :meth:`~re.Match.group`, :meth:`~re.Match.start`, :meth:`~re." +"Match.end`, and :meth:`~re.Match.span`. Groups are numbered starting with " +"0. Group 0 is always present; it's the whole RE, so :ref:`match object " +"` methods all have group 0 as their default argument. Later " +"we'll see how to express groups that don't capture the span of text that " +"they match. ::" +msgstr "" +"Групи, позначені ``'('``, ``')'`` також фіксують початковий і кінцевий " +"індекс тексту, якому вони відповідають; це можна отримати, передавши " +"аргумент до :meth:`~re.Match.group`, :meth:`~re.Match.start`, :meth:`~re." +"Match.end` і :meth:`~re.Match.span`. Групи нумеруються, починаючи з 0. Група " +"0 завжди присутня; це весь RE, тому всі методи :ref:`match object ` мають групу 0 як аргумент за замовчуванням. Пізніше ми побачимо, " +"як виражати групи, які не фіксують діапазон тексту, якому вони " +"відповідають. ::" + +msgid "" +">>> p = re.compile('(a)b')\n" +">>> m = p.match('ab')\n" +">>> m.group()\n" +"'ab'\n" +">>> m.group(0)\n" +"'ab'" +msgstr "" + +msgid "" +"Subgroups are numbered from left to right, from 1 upward. Groups can be " +"nested; to determine the number, just count the opening parenthesis " +"characters, going from left to right. ::" +msgstr "" +"Підгрупи нумеруються зліва направо, починаючи з 1 і вище. Групи можуть бути " +"вкладеними; щоб визначити число, просто порахуйте символи відкриваючих " +"дужок, рухаючись зліва направо. ::" + +msgid "" +">>> p = re.compile('(a(b)c)d')\n" +">>> m = p.match('abcd')\n" +">>> m.group(0)\n" +"'abcd'\n" +">>> m.group(1)\n" +"'abc'\n" +">>> m.group(2)\n" +"'b'" +msgstr "" + +msgid "" +":meth:`~re.Match.group` can be passed multiple group numbers at a time, in " +"which case it will return a tuple containing the corresponding values for " +"those groups. ::" +msgstr "" +":meth:`~re.Match.group` можна передати кілька номерів груп одночасно, і в " +"цьому випадку він поверне кортеж, що містить відповідні значення для цих " +"груп. ::" + +msgid "" +">>> m.group(2,1,2)\n" +"('b', 'abc', 'b')" +msgstr "" + +msgid "" +"The :meth:`~re.Match.groups` method returns a tuple containing the strings " +"for all the subgroups, from 1 up to however many there are. ::" +msgstr "" +"Метод :meth:`~re.Match.groups` повертає кортеж, що містить рядки для всіх " +"підгруп, від 1 до будь-якої кількості. ::" + +msgid "" +">>> m.groups()\n" +"('abc', 'b')" +msgstr "" + +msgid "" +"Backreferences in a pattern allow you to specify that the contents of an " +"earlier capturing group must also be found at the current location in the " +"string. For example, ``\\1`` will succeed if the exact contents of group 1 " +"can be found at the current position, and fails otherwise. Remember that " +"Python's string literals also use a backslash followed by numbers to allow " +"including arbitrary characters in a string, so be sure to use a raw string " +"when incorporating backreferences in a RE." +msgstr "" +"Зворотні посилання в шаблоні дозволяють вказати, що вміст попередньої групи " +"захоплення також має бути знайдений у поточному місці в рядку. Наприклад, " +"``\\1`` буде успішним, якщо точний вміст групи 1 можна знайти в поточній " +"позиції, і не вдасться в іншому випадку. Пам’ятайте, що рядкові літерали " +"Python також використовують зворотну скісну риску, за якою слідують числа, " +"щоб дозволити включати довільні символи в рядок, тому обов’язково " +"використовуйте необроблений рядок, коли включаєте зворотні посилання в RE." + +msgid "For example, the following RE detects doubled words in a string. ::" +msgstr "Наприклад, наступний RE виявляє подвоєні слова в рядку. ::" + +msgid "" +">>> p = re.compile(r'\\b(\\w+)\\s+\\1\\b')\n" +">>> p.search('Paris in the the spring').group()\n" +"'the the'" +msgstr "" + +msgid "" +"Backreferences like this aren't often useful for just searching through a " +"string --- there are few text formats which repeat data in this way --- but " +"you'll soon find out that they're *very* useful when performing string " +"substitutions." +msgstr "" +"Подібні зворотні посилання не часто корисні лише для пошуку в рядку --- є " +"кілька текстових форматів, які повторюють дані таким чином --- але незабаром " +"ви зрозумієте, що вони *дуже* корисні під час виконання замін рядків ." + +msgid "Non-capturing and Named Groups" +msgstr "Неперехоплювані та іменовані групи" + +msgid "" +"Elaborate REs may use many groups, both to capture substrings of interest, " +"and to group and structure the RE itself. In complex REs, it becomes " +"difficult to keep track of the group numbers. There are two features which " +"help with this problem. Both of them use a common syntax for regular " +"expression extensions, so we'll look at that first." +msgstr "" +"Розроблені RE можуть використовувати багато груп як для захоплення цікавих " +"підрядків, так і для групування та структурування самого RE. У складних RE " +"стає важко відслідковувати номери груп. Є дві функції, які допомагають " +"вирішити цю проблему. Обидва вони використовують загальний синтаксис для " +"розширень регулярних виразів, тому ми розглянемо це спочатку." + +msgid "" +"Perl 5 is well known for its powerful additions to standard regular " +"expressions. For these new features the Perl developers couldn't choose new " +"single-keystroke metacharacters or new special sequences beginning with " +"``\\`` without making Perl's regular expressions confusingly different from " +"standard REs. If they chose ``&`` as a new metacharacter, for example, old " +"expressions would be assuming that ``&`` was a regular character and " +"wouldn't have escaped it by writing ``\\&`` or ``[&]``." +msgstr "" +"Perl 5 добре відомий своїми потужними доповненнями до стандартних регулярних " +"виразів. Для цих нових можливостей розробники Perl не могли вибрати нові " +"одноклавішні метасимволи або нові спеціальні послідовності, що починаються з " +"``\\``, не зробивши регулярні вирази Perl різко відмінними від стандартних " +"RE. Наприклад, якби вони вибрали ``&`` як новий метасимвол, старі вирази " +"припускали б, що ``&`` був звичайним символом і не міг би уникнути його, " +"написавши ``\\&`` або ``[ &]``." + +msgid "" +"The solution chosen by the Perl developers was to use ``(?...)`` as the " +"extension syntax. ``?`` immediately after a parenthesis was a syntax error " +"because the ``?`` would have nothing to repeat, so this didn't introduce any " +"compatibility problems. The characters immediately after the ``?`` " +"indicate what extension is being used, so ``(?=foo)`` is one thing (a " +"positive lookahead assertion) and ``(?:foo)`` is something else (a non-" +"capturing group containing the subexpression ``foo``)." +msgstr "" +"Рішенням, обраним розробниками Perl, було використання ``(?...)`` як " +"синтаксису розширення. ``?`` відразу після дужок було синтаксичною помилкою, " +"оскільки ``?`` не було б чого повторювати, тому це не створювало жодних " +"проблем із сумісністю. Символи відразу після ``?`` вказують на те, яке " +"розширення використовується, тому ``(?=foo)`` це одне (позитивне твердження " +"попереднього перегляду), а ``(?:foo)`` це щось інше ( група без захоплення, " +"що містить підвираз ``foo``)." + +msgid "" +"Python supports several of Perl's extensions and adds an extension syntax to " +"Perl's extension syntax. If the first character after the question mark is " +"a ``P``, you know that it's an extension that's specific to Python." +msgstr "" +"Python підтримує кілька розширень Perl і додає синтаксис розширення до " +"синтаксису розширення Perl. Якщо першим символом після знака питання є " +"``P``, ви знаєте, що це розширення, специфічне для Python." + +msgid "" +"Now that we've looked at the general extension syntax, we can return to the " +"features that simplify working with groups in complex REs." +msgstr "" +"Тепер, коли ми розглянули загальний синтаксис розширення, ми можемо " +"повернутися до функцій, які спрощують роботу з групами в складних RE." + +msgid "" +"Sometimes you'll want to use a group to denote a part of a regular " +"expression, but aren't interested in retrieving the group's contents. You " +"can make this fact explicit by using a non-capturing group: ``(?:...)``, " +"where you can replace the ``...`` with any other regular expression. ::" +msgstr "" +"Іноді вам потрібно використати групу для позначення частини регулярного " +"виразу, але ви не зацікавлені в отриманні вмісту групи. Ви можете зробити " +"цей факт явним, використовуючи групу без захоплення: ``(?:...)``, де ви " +"можете замінити ``...`` будь-яким іншим регулярним виразом. ::" + +msgid "" +">>> m = re.match(\"([abc])+\", \"abc\")\n" +">>> m.groups()\n" +"('c',)\n" +">>> m = re.match(\"(?:[abc])+\", \"abc\")\n" +">>> m.groups()\n" +"()" +msgstr "" + +msgid "" +"Except for the fact that you can't retrieve the contents of what the group " +"matched, a non-capturing group behaves exactly the same as a capturing " +"group; you can put anything inside it, repeat it with a repetition " +"metacharacter such as ``*``, and nest it within other groups (capturing or " +"non-capturing). ``(?:...)`` is particularly useful when modifying an " +"existing pattern, since you can add new groups without changing how all the " +"other groups are numbered. It should be mentioned that there's no " +"performance difference in searching between capturing and non-capturing " +"groups; neither form is any faster than the other." +msgstr "" +"За винятком того факту, що ви не можете отримати вміст того, що відповідає " +"групі, група без захоплення поводиться точно так само, як група захоплення; " +"ви можете помістити в нього що завгодно, повторити це з метасимволом " +"повторення, таким як ``*``, і вкладати його в інші групи (захоплюючі чи " +"незахоплюючі). ``(?:...)`` особливо корисний під час зміни існуючого " +"шаблону, оскільки ви можете додавати нові групи, не змінюючи спосіб " +"нумерації всіх інших груп. Слід зазначити, що немає різниці в продуктивності " +"пошуку між групами захоплення та групами без захоплення; жодна форма не є " +"швидшою за іншу." + +msgid "" +"A more significant feature is named groups: instead of referring to them by " +"numbers, groups can be referenced by a name." +msgstr "" +"Більш важливою особливістю є іменовані групи: замість того, щоб посилатися " +"на них номерами, на групи можна посилатися за назвою." + +msgid "" +"The syntax for a named group is one of the Python-specific extensions: ``(?" +"P...)``. *name* is, obviously, the name of the group. Named groups " +"behave exactly like capturing groups, and additionally associate a name with " +"a group. The :ref:`match object ` methods that deal with " +"capturing groups all accept either integers that refer to the group by " +"number or strings that contain the desired group's name. Named groups are " +"still given numbers, so you can retrieve information about a group in two " +"ways::" +msgstr "" +"Синтаксис іменованої групи є одним із специфічних для Python розширень: ``(?" +"P ...)``. *name* — це, очевидно, назва групи. Іменовані групи " +"поводяться так само, як групи захоплення, і додатково пов’язують назву з " +"групою. Усі методи :ref:`match object `, які мають справу із " +"захопленням груп, приймають або цілі числа, які посилаються на групу за " +"номером, або рядки, які містять назву потрібної групи. Іменовані групи все " +"ще мають номери, тому ви можете отримати інформацію про групу двома " +"способами:" + +msgid "" +">>> p = re.compile(r'(?P\\b\\w+\\b)')\n" +">>> m = p.search( '(((( Lots of punctuation )))' )\n" +">>> m.group('word')\n" +"'Lots'\n" +">>> m.group(1)\n" +"'Lots'" +msgstr "" + +msgid "" +"Additionally, you can retrieve named groups as a dictionary with :meth:`~re." +"Match.groupdict`::" +msgstr "" +"Крім того, ви можете отримати іменовані групи як словник за допомогою :meth:" +"`~re.Match.groupdict`::" + +msgid "" +">>> m = re.match(r'(?P\\w+) (?P\\w+)', 'Jane Doe')\n" +">>> m.groupdict()\n" +"{'first': 'Jane', 'last': 'Doe'}" +msgstr "" + +msgid "" +"Named groups are handy because they let you use easily remembered names, " +"instead of having to remember numbers. Here's an example RE from the :mod:" +"`imaplib` module::" +msgstr "" +"Іменовані групи зручні, оскільки вони дозволяють використовувати імена, які " +"легко запам’ятовуються, замість того, щоб запам’ятовувати числа. Ось приклад " +"RE з модуля :mod:`imaplib`::" + +msgid "" +"InternalDate = re.compile(r'INTERNALDATE \"'\n" +" r'(?P[ 123][0-9])-(?P[A-Z][a-z][a-z])-'\n" +" r'(?P[0-9][0-9][0-9][0-9])'\n" +" r' (?P[0-9][0-9]):(?P[0-9][0-9]):(?P[0-9][0-9])'\n" +" r' (?P[-+])(?P[0-9][0-9])(?P[0-9][0-9])'\n" +" r'\"')" +msgstr "" + +msgid "" +"It's obviously much easier to retrieve ``m.group('zonem')``, instead of " +"having to remember to retrieve group 9." +msgstr "" +"Очевидно, набагато простіше отримати ``m.group('zonem')``, замість того, щоб " +"пам'ятати, що потрібно отримати групу 9." + +msgid "" +"The syntax for backreferences in an expression such as ``(...)\\1`` refers " +"to the number of the group. There's naturally a variant that uses the group " +"name instead of the number. This is another Python extension: ``(?P=name)`` " +"indicates that the contents of the group called *name* should again be " +"matched at the current point. The regular expression for finding doubled " +"words, ``\\b(\\w+)\\s+\\1\\b`` can also be written as ``\\b(?" +"P\\w+)\\s+(?P=word)\\b``::" +msgstr "" +"Синтаксис зворотних посилань у такому виразі, як ``(...)\\1``, посилається " +"на номер групи. Природно, існує варіант, який використовує назву групи " +"замість номера. Це ще одне розширення Python: ``(?P=name)`` вказує на те, що " +"вміст групи з назвою *name* знову повинен бути зіставлений у поточній точці. " +"Регулярний вираз для пошуку подвоєних слів ``\\b(\\w+)\\s+\\1\\b`` також " +"можна записати як ``\\b(?P\\w+)\\s+(?P=word)\\b``::" + +msgid "" +">>> p = re.compile(r'\\b(?P\\w+)\\s+(?P=word)\\b')\n" +">>> p.search('Paris in the the spring').group()\n" +"'the the'" +msgstr "" + +msgid "Lookahead Assertions" +msgstr "Попередні твердження" + +msgid "" +"Another zero-width assertion is the lookahead assertion. Lookahead " +"assertions are available in both positive and negative form, and look like " +"this:" +msgstr "" +"Іншим твердженням нульової ширини є твердження прогнозу. Попередні " +"твердження доступні як у позитивній, так і в негативній формі та виглядають " +"так:" + +msgid "``(?=...)``" +msgstr "``(?=...)``" + +msgid "" +"Positive lookahead assertion. This succeeds if the contained regular " +"expression, represented here by ``...``, successfully matches at the current " +"location, and fails otherwise. But, once the contained expression has been " +"tried, the matching engine doesn't advance at all; the rest of the pattern " +"is tried right where the assertion started." +msgstr "" +"Позитивне прогнозне твердження. Це виконується успішно, якщо регулярний " +"вираз, представлений тут ``...``, успішно збігається в поточному місці, і не " +"вдається в іншому випадку. Але після спроби виразу, що міститься, механізм " +"пошуку відповідностей взагалі не переходить; решта шаблону пробується там, " +"де почалося твердження." + +msgid "``(?!...)``" +msgstr "``(?!...)``" + +msgid "" +"Negative lookahead assertion. This is the opposite of the positive " +"assertion; it succeeds if the contained expression *doesn't* match at the " +"current position in the string." +msgstr "" +"Негативне прогнозне твердження. Це протилежне до позитивного твердження; це " +"вдається, якщо вираз, що міститься, *не* збігається з поточною позицією в " +"рядку." + +msgid "" +"To make this concrete, let's look at a case where a lookahead is useful. " +"Consider a simple pattern to match a filename and split it apart into a base " +"name and an extension, separated by a ``.``. For example, in ``news.rc``, " +"``news`` is the base name, and ``rc`` is the filename's extension." +msgstr "" +"Щоб зробити це конкретним, давайте подивимося на випадок, де корисний погляд " +"наперед. Розглянемо простий шаблон для відповідності назві файлу та " +"розділення його на базове ім’я та розширення, розділені символом ``.``. " +"Наприклад, у ``news.rc`` ``news`` є базовою назвою, а ``rc`` є розширенням " +"назви файлу." + +msgid "The pattern to match this is quite simple:" +msgstr "Викрійка для цього досить проста:" + +msgid "``.*[.].*$``" +msgstr "``.*[.].*$``" + +msgid "" +"Notice that the ``.`` needs to be treated specially because it's a " +"metacharacter, so it's inside a character class to only match that specific " +"character. Also notice the trailing ``$``; this is added to ensure that all " +"the rest of the string must be included in the extension. This regular " +"expression matches ``foo.bar`` and ``autoexec.bat`` and ``sendmail.cf`` and " +"``printers.conf``." +msgstr "" +"Зауважте, що ``.`` потрібно обробляти спеціально, оскільки це метасимвол, " +"тому він знаходиться всередині класу символів, щоб відповідати лише цьому " +"конкретному символу. Також зверніть увагу на закінчення ``$``; це додається, " +"щоб переконатися, що вся решта рядка повинна бути включена в розширення. Цей " +"регулярний вираз відповідає ``foo.bar`` і ``autoexec.bat``, ``sendmail.cf`` " +"і ``printers.conf``." + +msgid "" +"Now, consider complicating the problem a bit; what if you want to match " +"filenames where the extension is not ``bat``? Some incorrect attempts:" +msgstr "" +"Тепер подумайте про те, щоб трохи ускладнити проблему; що, якщо ви хочете " +"зіставити назви файлів, розширення яких не є ``bat``? Деякі неправильні " +"спроби:" + +msgid "" +"``.*[.][^b].*$`` The first attempt above tries to exclude ``bat`` by " +"requiring that the first character of the extension is not a ``b``. This is " +"wrong, because the pattern also doesn't match ``foo.bar``." +msgstr "" +"``.*[.][^b].*$`` Перша спроба вище намагається виключити ``bat``, вимагаючи, " +"щоб перший символ розширення не був ``b``. Це неправильно, оскільки шаблон " +"також не відповідає ``foo.bar``." + +msgid "``.*[.]([^b]..|.[^a].|..[^t])$``" +msgstr "``.*[.]([^b]..|.[^a].|..[^t])$``" + +msgid "" +"The expression gets messier when you try to patch up the first solution by " +"requiring one of the following cases to match: the first character of the " +"extension isn't ``b``; the second character isn't ``a``; or the third " +"character isn't ``t``. This accepts ``foo.bar`` and rejects ``autoexec." +"bat``, but it requires a three-letter extension and won't accept a filename " +"with a two-letter extension such as ``sendmail.cf``. We'll complicate the " +"pattern again in an effort to fix it." +msgstr "" +"Вираз стає складнішим, коли ви намагаєтеся виправити перше рішення, " +"вимагаючи збігу одного з наступних випадків: перший символ розширення не є " +"``b``; другий символ не є ``a``; або третій символ не є ``t``. Це приймає " +"``foo.bar`` і відхиляє ``autoexec.bat``, але воно вимагає розширення з трьох " +"літер і не приймає ім’я файлу з дволітерним розширенням, наприклад " +"``sendmail.cf``. Ми знову ускладнимо шаблон, намагаючись його виправити." + +msgid "``.*[.]([^b].?.?|.[^a]?.?|..?[^t]?)$``" +msgstr "``.*[.]([^b].?.?|.[^a]?.?|..?[^t]?)$``" + +msgid "" +"In the third attempt, the second and third letters are all made optional in " +"order to allow matching extensions shorter than three characters, such as " +"``sendmail.cf``." +msgstr "" +"Під час третьої спроби друга та третя літери стають необов’язковими, щоб " +"дозволити відповідні розширення коротші за три символи, наприклад ``sendmail." +"cf``." + +msgid "" +"The pattern's getting really complicated now, which makes it hard to read " +"and understand. Worse, if the problem changes and you want to exclude both " +"``bat`` and ``exe`` as extensions, the pattern would get even more " +"complicated and confusing." +msgstr "" +"Зараз шаблон стає дуже складним, тому його важко прочитати та зрозуміти. " +"Гірше того, якщо проблема зміниться і ви захочете виключити і ``bat``, і " +"``exe`` як розширення, шаблон стане ще більш складним і заплутаним." + +msgid "A negative lookahead cuts through all this confusion:" +msgstr "Негативний прогноз прорізає всю цю плутанину:" + +msgid "" +"``.*[.](?!bat$)[^.]*$`` The negative lookahead means: if the expression " +"``bat`` doesn't match at this point, try the rest of the pattern; if " +"``bat$`` does match, the whole pattern will fail. The trailing ``$`` is " +"required to ensure that something like ``sample.batch``, where the extension " +"only starts with ``bat``, will be allowed. The ``[^.]*`` makes sure that " +"the pattern works when there are multiple dots in the filename." +msgstr "" +"``.*[.](?!bat$)[^.]*$`` Негативний перегляд означає: якщо вираз ``bat`` не " +"збігається на цьому етапі, спробуйте решту шаблону; якщо ``bat$`` " +"збігається, весь шаблон буде невдалим. Кінцевий ``$`` потрібен, щоб " +"переконатися, що щось на зразок ``sample.batch``, де розширення починається " +"лише з ``bat``, буде дозволено. ``[^.]*`` гарантує, що шаблон працює, якщо в " +"назві файлу є кілька крапок." + +msgid "" +"Excluding another filename extension is now easy; simply add it as an " +"alternative inside the assertion. The following pattern excludes filenames " +"that end in either ``bat`` or ``exe``:" +msgstr "" +"Виключити інше розширення імені файлу тепер легко; просто додайте його як " +"альтернативу всередину твердження. Наступний шаблон виключає імена файлів, " +"які закінчуються на ``bat`` або ``exe``:" + +msgid "``.*[.](?!bat$|exe$)[^.]*$``" +msgstr "``.*[.](?!bat$|exe$)[^.]*$``" + +msgid "Modifying Strings" +msgstr "Зміна рядків" + +msgid "" +"Up to this point, we've simply performed searches against a static string. " +"Regular expressions are also commonly used to modify strings in various " +"ways, using the following pattern methods:" +msgstr "" +"До цього моменту ми просто виконували пошук у статичному рядку. Регулярні " +"вирази також часто використовуються для зміни рядків різними способами, " +"використовуючи такі методи шаблонів:" + +msgid "``split()``" +msgstr "``split()``" + +msgid "Split the string into a list, splitting it wherever the RE matches" +msgstr "Розділіть рядок на список, розділивши його там, де відповідає RE" + +msgid "``sub()``" +msgstr "``sub()``" + +msgid "" +"Find all substrings where the RE matches, and replace them with a different " +"string" +msgstr "Знайдіть усі підрядки, де відповідає RE, і замініть їх іншим рядком" + +msgid "``subn()``" +msgstr "``subn()``" + +msgid "" +"Does the same thing as :meth:`!sub`, but returns the new string and the " +"number of replacements" +msgstr "" +"Робить те саме, що :meth:`!sub`, але повертає новий рядок і кількість замін" + +msgid "Splitting Strings" +msgstr "Розбиття рядків" + +msgid "" +"The :meth:`~re.Pattern.split` method of a pattern splits a string apart " +"wherever the RE matches, returning a list of the pieces. It's similar to " +"the :meth:`~str.split` method of strings but provides much more generality " +"in the delimiters that you can split by; string :meth:`!split` only supports " +"splitting by whitespace or by a fixed string. As you'd expect, there's a " +"module-level :func:`re.split` function, too." +msgstr "" +"Метод шаблону :meth:`~re.Pattern.split` розділяє рядок на частини, де " +"збігається RE, повертаючи список фрагментів. Він подібний до методу рядків :" +"meth:`~str.split`, але надає набагато більшу загальність роздільників, за " +"якими можна розділяти; string :meth:`!split` підтримує лише поділ за " +"пробілами або за фіксованим рядком. Як і слід було очікувати, також існує " +"функція :func:`re.split` на рівні модуля." + +msgid "" +"Split *string* by the matches of the regular expression. If capturing " +"parentheses are used in the RE, then their contents will also be returned as " +"part of the resulting list. If *maxsplit* is nonzero, at most *maxsplit* " +"splits are performed." +msgstr "" +"Розділити *рядок* за збігами регулярного виразу. Якщо в RE використовуються " +"круглі дужки, їхній вміст також повертатиметься як частина результуючого " +"списку. Якщо *maxsplit* відмінний від нуля, виконується не більше ніж " +"*maxsplit*." + +msgid "" +"You can limit the number of splits made, by passing a value for *maxsplit*. " +"When *maxsplit* is nonzero, at most *maxsplit* splits will be made, and the " +"remainder of the string is returned as the final element of the list. In " +"the following example, the delimiter is any sequence of non-alphanumeric " +"characters. ::" +msgstr "" +"Ви можете обмежити кількість зроблених поділів, передавши значення " +"*maxsplit*. Якщо *maxsplit* відмінний від нуля, буде виконано щонайбільше " +"*maxsplit* розбиття, а залишок рядка повертається як останній елемент " +"списку. У наступному прикладі роздільником є будь-яка послідовність не " +"буквено-цифрових символів. ::" + +msgid "" +">>> p = re.compile(r'\\W+')\n" +">>> p.split('This is a test, short and sweet, of split().')\n" +"['This', 'is', 'a', 'test', 'short', 'and', 'sweet', 'of', 'split', '']\n" +">>> p.split('This is a test, short and sweet, of split().', 3)\n" +"['This', 'is', 'a', 'test, short and sweet, of split().']" +msgstr "" + +msgid "" +"Sometimes you're not only interested in what the text between delimiters is, " +"but also need to know what the delimiter was. If capturing parentheses are " +"used in the RE, then their values are also returned as part of the list. " +"Compare the following calls::" +msgstr "" +"Іноді вам не тільки цікаво, що таке текст між роздільниками, а й потрібно " +"знати, що це за роздільник. Якщо в RE використовуються круглі дужки, їх " +"значення також повертаються як частина списку. Порівняйте наступні виклики:" + +msgid "" +">>> p = re.compile(r'\\W+')\n" +">>> p2 = re.compile(r'(\\W+)')\n" +">>> p.split('This... is a test.')\n" +"['This', 'is', 'a', 'test', '']\n" +">>> p2.split('This... is a test.')\n" +"['This', '... ', 'is', ' ', 'a', ' ', 'test', '.', '']" +msgstr "" + +msgid "" +"The module-level function :func:`re.split` adds the RE to be used as the " +"first argument, but is otherwise the same. ::" +msgstr "" +"Функція рівня модуля :func:`re.split` додає RE, який буде використовуватися " +"як перший аргумент, але в іншому вона така сама. ::" + +msgid "" +">>> re.split(r'[\\W]+', 'Words, words, words.')\n" +"['Words', 'words', 'words', '']\n" +">>> re.split(r'([\\W]+)', 'Words, words, words.')\n" +"['Words', ', ', 'words', ', ', 'words', '.', '']\n" +">>> re.split(r'[\\W]+', 'Words, words, words.', 1)\n" +"['Words', 'words, words.']" +msgstr "" + +msgid "Search and Replace" +msgstr "Пошук і заміна" + +msgid "" +"Another common task is to find all the matches for a pattern, and replace " +"them with a different string. The :meth:`~re.Pattern.sub` method takes a " +"replacement value, which can be either a string or a function, and the " +"string to be processed." +msgstr "" +"Ще одне поширене завдання — знайти всі збіги для шаблону та замінити їх " +"іншим рядком. Метод :meth:`~re.Pattern.sub` приймає значення заміни, яке " +"може бути або рядком, або функцією, і рядок, який потрібно обробити." + +msgid "" +"Returns the string obtained by replacing the leftmost non-overlapping " +"occurrences of the RE in *string* by the replacement *replacement*. If the " +"pattern isn't found, *string* is returned unchanged." +msgstr "" +"Повертає рядок, отриманий шляхом заміни крайніх лівих неперекриваючих " +"входжень RE в *рядку* на заміну *replacement*. Якщо шаблон не знайдено, " +"*рядок* повертається без змін." + +msgid "" +"The optional argument *count* is the maximum number of pattern occurrences " +"to be replaced; *count* must be a non-negative integer. The default value " +"of 0 means to replace all occurrences." +msgstr "" +"Необов’язковий аргумент *count* — це максимальна кількість шаблонів, які " +"потрібно замінити; *count* має бути невід’ємним цілим числом. Значення за " +"замовчуванням 0 означає заміну всіх входжень." + +msgid "" +"Here's a simple example of using the :meth:`~re.Pattern.sub` method. It " +"replaces colour names with the word ``colour``::" +msgstr "" +"Ось простий приклад використання методу :meth:`~re.Pattern.sub`. Він замінює " +"назви кольорів словом ``колір``::" + +msgid "" +">>> p = re.compile('(blue|white|red)')\n" +">>> p.sub('colour', 'blue socks and red shoes')\n" +"'colour socks and colour shoes'\n" +">>> p.sub('colour', 'blue socks and red shoes', count=1)\n" +"'colour socks and red shoes'" +msgstr "" + +msgid "" +"The :meth:`~re.Pattern.subn` method does the same work, but returns a 2-" +"tuple containing the new string value and the number of replacements that " +"were performed::" +msgstr "" +"Метод :meth:`~re.Pattern.subn` виконує ту саму роботу, але повертає 2-" +"кортеж, що містить нове значення рядка та кількість виконаних замін:" + +msgid "" +">>> p = re.compile('(blue|white|red)')\n" +">>> p.subn('colour', 'blue socks and red shoes')\n" +"('colour socks and colour shoes', 2)\n" +">>> p.subn('colour', 'no colours at all')\n" +"('no colours at all', 0)" +msgstr "" + +msgid "" +"Empty matches are replaced only when they're not adjacent to a previous " +"empty match. ::" +msgstr "" +"Порожні збіги замінюються лише тоді, коли вони не суміжні з попереднім " +"порожнім збігом. ::" + +msgid "" +">>> p = re.compile('x*')\n" +">>> p.sub('-', 'abxd')\n" +"'-a-b--d-'" +msgstr "" + +msgid "" +"If *replacement* is a string, any backslash escapes in it are processed. " +"That is, ``\\n`` is converted to a single newline character, ``\\r`` is " +"converted to a carriage return, and so forth. Unknown escapes such as " +"``\\&`` are left alone. Backreferences, such as ``\\6``, are replaced with " +"the substring matched by the corresponding group in the RE. This lets you " +"incorporate portions of the original text in the resulting replacement " +"string." +msgstr "" +"Якщо *replacement* є рядком, будь-які вихідні символи зворотної косої риски " +"в ньому обробляються. Тобто ``\\n`` перетворюється на один символ нового " +"рядка, ``\\r`` перетворюється на повернення каретки і так далі. Невідомі " +"вихідні коди, такі як ``\\&`` залишаються в спокої. Зворотні посилання, такі " +"як ``\\6``, замінюються підрядком, який відповідає відповідній групі в RE. " +"Це дає змогу включати частини вихідного тексту в отриманий рядок заміни." + +msgid "" +"This example matches the word ``section`` followed by a string enclosed in " +"``{``, ``}``, and changes ``section`` to ``subsection``::" +msgstr "" +"Цей приклад відповідає слову ``розділ``, за яким слідує рядок, укладений у " +"``{``, ``}``, і змінює ``розділ`` на ``підрозділ``::" + +msgid "" +">>> p = re.compile('section{ ( [^}]* ) }', re.VERBOSE)\n" +">>> p.sub(r'subsection{\\1}','section{First} section{second}')\n" +"'subsection{First} subsection{second}'" +msgstr "" + +msgid "" +"There's also a syntax for referring to named groups as defined by the ``(?" +"P...)`` syntax. ``\\g`` will use the substring matched by the " +"group named ``name``, and ``\\g`` uses the corresponding group " +"number. ``\\g<2>`` is therefore equivalent to ``\\2``, but isn't ambiguous " +"in a replacement string such as ``\\g<2>0``. (``\\20`` would be interpreted " +"as a reference to group 20, not a reference to group 2 followed by the " +"literal character ``'0'``.) The following substitutions are all equivalent, " +"but use all three variations of the replacement string. ::" +msgstr "" +"Існує також синтаксис для посилань на іменовані групи, як визначено " +"синтаксисом ``(?P ...)``. ``\\g `` використовуватиме підрядок, " +"який відповідає групі з назвою ``name``, а ``\\g `` використовує " +"відповідний номер групи. ``\\g <2>``, отже, еквівалентний ``\\2``, але не є " +"неоднозначним у рядку заміни, такому як ``\\g <2> 0``. (``\\20`` буде " +"інтерпретуватися як посилання на групу 20, а не як посилання на групу 2, за " +"якою йде літеральний символ ``'0''``.) Усі наступні заміни еквівалентні, але " +"використовують усі три варіанти рядок заміни. ::" + +msgid "" +">>> p = re.compile('section{ (?P [^}]* ) }', re.VERBOSE)\n" +">>> p.sub(r'subsection{\\1}','section{First}')\n" +"'subsection{First}'\n" +">>> p.sub(r'subsection{\\g<1>}','section{First}')\n" +"'subsection{First}'\n" +">>> p.sub(r'subsection{\\g}','section{First}')\n" +"'subsection{First}'" +msgstr "" + +msgid "" +"*replacement* can also be a function, which gives you even more control. If " +"*replacement* is a function, the function is called for every non-" +"overlapping occurrence of *pattern*. On each call, the function is passed " +"a :ref:`match object ` argument for the match and can use " +"this information to compute the desired replacement string and return it." +msgstr "" +"*заміна* також може бути функцією, яка дає вам ще більше контролю. Якщо " +"*replacement* є функцією, функція викликається для кожного неперекриваючого " +"входження *pattern*. Під час кожного виклику функції передається аргумент :" +"ref:`match object ` для відповідності, і ця інформація може " +"використовуватися для обчислення потрібного рядка заміни та повернення його." + +msgid "" +"In the following example, the replacement function translates decimals into " +"hexadecimal::" +msgstr "" +"У наступному прикладі функція заміни перетворює десяткові числа в " +"шістнадцяткові:" + +msgid "" +">>> def hexrepl(match):\n" +"... \"Return the hex string for a decimal number\"\n" +"... value = int(match.group())\n" +"... return hex(value)\n" +"...\n" +">>> p = re.compile(r'\\d+')\n" +">>> p.sub(hexrepl, 'Call 65490 for printing, 49152 for user code.')\n" +"'Call 0xffd2 for printing, 0xc000 for user code.'" +msgstr "" + +msgid "" +"When using the module-level :func:`re.sub` function, the pattern is passed " +"as the first argument. The pattern may be provided as an object or as a " +"string; if you need to specify regular expression flags, you must either use " +"a pattern object as the first parameter, or use embedded modifiers in the " +"pattern string, e.g. ``sub(\"(?i)b+\", \"x\", \"bbbb BBBB\")`` returns ``'x " +"x'``." +msgstr "" +"Під час використання функції :func:`re.sub` на рівні модуля шаблон " +"передається як перший аргумент. Шаблон може бути наданий як об'єкт або як " +"рядок; якщо вам потрібно вказати прапорці регулярного виразу, ви повинні або " +"використовувати об’єкт шаблону як перший параметр, або використати вбудовані " +"модифікатори в рядок шаблону, напр. ``sub(\"(?i)b+\", \"x\", \"bbbb " +"BBBB\")`` повертає ``'x x''``." + +msgid "Common Problems" +msgstr "Загальні проблеми" + +msgid "" +"Regular expressions are a powerful tool for some applications, but in some " +"ways their behaviour isn't intuitive and at times they don't behave the way " +"you may expect them to. This section will point out some of the most common " +"pitfalls." +msgstr "" +"Регулярні вирази є потужним інструментом для деяких програм, але в певному " +"сенсі їх поведінка не є інтуїтивно зрозумілою, а іноді вони поводяться не " +"так, як ви від них можете очікувати. У цьому розділі буде вказано на деякі з " +"найпоширеніших пасток." + +msgid "Use String Methods" +msgstr "Використовуйте рядкові методи" + +msgid "" +"Sometimes using the :mod:`re` module is a mistake. If you're matching a " +"fixed string, or a single character class, and you're not using any :mod:" +"`re` features such as the :const:`~re.IGNORECASE` flag, then the full power " +"of regular expressions may not be required. Strings have several methods for " +"performing operations with fixed strings and they're usually much faster, " +"because the implementation is a single small C loop that's been optimized " +"for the purpose, instead of the large, more generalized regular expression " +"engine." +msgstr "" +"Іноді використання модуля :mod:`re` є помилкою. Якщо ви зіставляєте " +"фіксований рядок або одиничний клас символів і не використовуєте жодних " +"функцій :mod:`re`, таких як прапор :const:`~re.IGNORECASE`, тоді повна " +"потужність регулярних виразів може не знадобитися. Рядки мають кілька " +"методів для виконання операцій із фіксованими рядками, і зазвичай вони " +"набагато швидші, оскільки реалізація являє собою один маленький цикл C, " +"оптимізований для цієї мети, замість великого, більш узагальненого механізму " +"регулярних виразів." + +msgid "" +"One example might be replacing a single fixed string with another one; for " +"example, you might replace ``word`` with ``deed``. :func:`re.sub` seems " +"like the function to use for this, but consider the :meth:`~str.replace` " +"method. Note that :meth:`!replace` will also replace ``word`` inside words, " +"turning ``swordfish`` into ``sdeedfish``, but the naive RE ``word`` would " +"have done that, too. (To avoid performing the substitution on parts of " +"words, the pattern would have to be ``\\bword\\b``, in order to require that " +"``word`` have a word boundary on either side. This takes the job beyond :" +"meth:`!replace`'s abilities.)" +msgstr "" +"Одним із прикладів може бути заміна одного фіксованого рядка іншим; " +"наприклад, ви можете замінити ``слово`` на ``справа``. :func:`re.sub` " +"здається функцією для цього, але розгляньте метод :meth:`~str.replace`. " +"Зауважте, що :meth:`!replace` також замінить ``word`` всередині слів, " +"перетворивши ``swordfish`` на ``sdeedfish``, але наївний RE ``word`` також " +"зробив би це. (Щоб уникнути виконання заміни на частинах слів, шаблон має " +"бути ``\\bword\\b``, щоб вимагати, щоб ``слово`` мало межу слова з обох " +"боків. Це виводить роботу за межі :meth:`!replace`.)" + +msgid "" +"Another common task is deleting every occurrence of a single character from " +"a string or replacing it with another single character. You might do this " +"with something like ``re.sub('\\n', ' ', S)``, but :meth:`~str.translate` is " +"capable of doing both tasks and will be faster than any regular expression " +"operation can be." +msgstr "" +"Інше поширене завдання — видалення кожного входження одного символу з рядка " +"або заміна його іншим окремим символом. Ви можете зробити це за допомогою " +"чогось на зразок ``re.sub('\\n', ' ', S)``, але :meth:`~str.translate` " +"здатний виконувати обидва завдання та буде швидшим за будь-який регулярний " +"вираз операція може бути." + +msgid "" +"In short, before turning to the :mod:`re` module, consider whether your " +"problem can be solved with a faster and simpler string method." +msgstr "" +"Коротше кажучи, перш ніж звернутися до модуля :mod:`re`, подумайте, чи можна " +"вирішити вашу проблему швидшим і простішим методом рядка." + +msgid "match() versus search()" +msgstr "match() проти search()" + +msgid "" +"The :func:`~re.match` function only checks if the RE matches at the " +"beginning of the string while :func:`~re.search` will scan forward through " +"the string for a match. It's important to keep this distinction in mind. " +"Remember, :func:`!match` will only report a successful match which will " +"start at 0; if the match wouldn't start at zero, :func:`!match` will *not* " +"report it. ::" +msgstr "" +"Функція :func:`~re.match` лише перевіряє, чи RE збігається на початку рядка, " +"тоді як :func:`~re.search` скануватиме рядок вперед у пошуках відповідності. " +"Важливо пам’ятати про цю відмінність. Пам’ятайте, :func:`!match` " +"повідомлятиме лише про успішний збіг, який розпочнеться з 0; якщо збіг не " +"починається з нуля, :func:`!match` *не* повідомить про це. ::" + +msgid "" +">>> print(re.match('super', 'superstition').span())\n" +"(0, 5)\n" +">>> print(re.match('super', 'insuperable'))\n" +"None" +msgstr "" + +msgid "" +"On the other hand, :func:`~re.search` will scan forward through the string, " +"reporting the first match it finds. ::" +msgstr "" +"З іншого боку, :func:`~re.search` скануватиме рядок вперед, повідомляючи про " +"перший знайдений збіг. ::" + +msgid "" +">>> print(re.search('super', 'superstition').span())\n" +"(0, 5)\n" +">>> print(re.search('super', 'insuperable').span())\n" +"(2, 7)" +msgstr "" + +msgid "" +"Sometimes you'll be tempted to keep using :func:`re.match`, and just add ``." +"*`` to the front of your RE. Resist this temptation and use :func:`re." +"search` instead. The regular expression compiler does some analysis of REs " +"in order to speed up the process of looking for a match. One such analysis " +"figures out what the first character of a match must be; for example, a " +"pattern starting with ``Crow`` must match starting with a ``'C'``. The " +"analysis lets the engine quickly scan through the string looking for the " +"starting character, only trying the full match if a ``'C'`` is found." +msgstr "" +"Іноді у вас виникне спокуса продовжувати використовувати :func:`re.match` і " +"просто додати ``.*`` на початку вашого RE. Утримайтесь від цієї спокуси та " +"використовуйте замість цього :func:`re.search`. Компілятор регулярних " +"виразів виконує деякий аналіз RE, щоб прискорити процес пошуку " +"відповідності. Один такий аналіз визначає, яким повинен бути перший символ " +"відповідності; наприклад, шаблон, що починається з ``Crow``, повинен " +"збігатися з ``'C``. Аналіз дозволяє механізму швидко сканувати рядок у " +"пошуках початкового символу, лише намагаючись знайти повну відповідність, " +"якщо знайдено ``'C'``." + +msgid "" +"Adding ``.*`` defeats this optimization, requiring scanning to the end of " +"the string and then backtracking to find a match for the rest of the RE. " +"Use :func:`re.search` instead." +msgstr "" +"Додавання ``.*`` руйнує цю оптимізацію, вимагаючи сканування до кінця рядка, " +"а потім повернення назад, щоб знайти збіг для решти RE. Натомість " +"використовуйте :func:`re.search`." + +msgid "Greedy versus Non-Greedy" +msgstr "Жадібний проти нежадібного" + +msgid "" +"When repeating a regular expression, as in ``a*``, the resulting action is " +"to consume as much of the pattern as possible. This fact often bites you " +"when you're trying to match a pair of balanced delimiters, such as the angle " +"brackets surrounding an HTML tag. The naive pattern for matching a single " +"HTML tag doesn't work because of the greedy nature of ``.*``. ::" +msgstr "" +"Під час повторення регулярного виразу, як у ``a*``, результуюча дія полягає " +"в споживанні якомога більшої частини шаблону. Цей факт часто кусає вас, коли " +"ви намагаєтеся зіставити пару збалансованих розділювачів, таких як кутові " +"дужки, що оточують тег HTML. Наївний шаблон для відповідності одному тегу " +"HTML не працює через жадібний характер ``.*``. ::" + +msgid "" +">>> s = 'Title'\n" +">>> len(s)\n" +"32\n" +">>> print(re.match('<.*>', s).span())\n" +"(0, 32)\n" +">>> print(re.match('<.*>', s).group())\n" +"Title" +msgstr "" + +msgid "" +"The RE matches the ``'<'`` in ``''``, and the ``.*`` consumes the rest " +"of the string. There's still more left in the RE, though, and the ``>`` " +"can't match at the end of the string, so the regular expression engine has " +"to backtrack character by character until it finds a match for the ``>``. " +"The final match extends from the ``'<'`` in ``''`` to the ``'>'`` in " +"``''``, which isn't what you want." +msgstr "" +"RE відповідає ``'<'`` in ``''``, а ``.*`` займає решту рядка. Однак у " +"RE залишилося ще більше, і ``>`` не може збігатися в кінці рядка, тому " +"система регулярних виразів має відстежувати символ за символом, поки не " +"знайде відповідність ``>``. Фінальний збіг поширюється від ``' <'`` in " +"``' ''`` до ``'>''`` в ``' ''``, що не те, чого ви хочете." + +msgid "" +"In this case, the solution is to use the non-greedy quantifiers ``*?``, ``+?" +"``, ``??``, or ``{m,n}?``, which match as *little* text as possible. In the " +"above example, the ``'>'`` is tried immediately after the first ``'<'`` " +"matches, and when it fails, the engine advances a character at a time, " +"retrying the ``'>'`` at every step. This produces just the right result::" +msgstr "" +"У цьому випадку рішенням є використання нежадібних кванторів ``*?``, ``+?``, " +"``??``, або ``{m,n}?``, які відповідають як *якомога менше* тексту. У " +"наведеному вище прикладі ``'>'`` виконується відразу після перших збігів " +"``'<'``, і коли це не вдається, система пересуває на символ за раз, " +"повторюючи ``'>'`` на кожному кроці. Це дає правильний результат:" + +msgid "" +">>> print(re.match('<.*?>', s).group())\n" +"" +msgstr "" + +msgid "" +"(Note that parsing HTML or XML with regular expressions is painful. Quick-" +"and-dirty patterns will handle common cases, but HTML and XML have special " +"cases that will break the obvious regular expression; by the time you've " +"written a regular expression that handles all of the possible cases, the " +"patterns will be *very* complicated. Use an HTML or XML parser module for " +"such tasks.)" +msgstr "" +"(Зауважте, що синтаксичний аналіз HTML або XML за допомогою регулярних " +"виразів є болючим. Швидкі та брудні шаблони впораються з типовими випадками, " +"але HTML і XML мають особливі випадки, які порушують очевидний регулярний " +"вираз; коли ви напишете регулярний вираз, обробляє всі можливі випадки, " +"шаблони будуть *дуже* складними. Для таких завдань використовуйте модуль " +"аналізатора HTML або XML.)" + +msgid "Using re.VERBOSE" +msgstr "Використання re.VERBOSE" + +msgid "" +"By now you've probably noticed that regular expressions are a very compact " +"notation, but they're not terribly readable. REs of moderate complexity can " +"become lengthy collections of backslashes, parentheses, and metacharacters, " +"making them difficult to read and understand." +msgstr "" +"Наразі ви, напевно, помітили, що регулярні вирази є дуже компактним записом, " +"але їх не дуже добре читати. RE помірної складності можуть перетворитися на " +"довгі набори зворотних скісних риск, круглих дужок і метасимволів, що " +"ускладнює їх читання та розуміння." + +msgid "" +"For such REs, specifying the :const:`re.VERBOSE` flag when compiling the " +"regular expression can be helpful, because it allows you to format the " +"regular expression more clearly." +msgstr "" +"Для таких RE вказівка прапорця :const:`re.VERBOSE` під час компіляції " +"регулярного виразу може бути корисною, оскільки це дозволяє форматувати " +"регулярний вираз більш чітко." + +msgid "" +"The ``re.VERBOSE`` flag has several effects. Whitespace in the regular " +"expression that *isn't* inside a character class is ignored. This means " +"that an expression such as ``dog | cat`` is equivalent to the less readable " +"``dog|cat``, but ``[a b]`` will still match the characters ``'a'``, ``'b'``, " +"or a space. In addition, you can also put comments inside a RE; comments " +"extend from a ``#`` character to the next newline. When used with triple-" +"quoted strings, this enables REs to be formatted more neatly::" +msgstr "" +"Прапор ``re.VERBOSE`` має кілька ефектів. Пробіли в регулярному виразі, яких " +"*не* всередині класу символів, ігноруються. Це означає, що такий вираз, як " +"``собака | cat`` еквівалентний менш читабельному ``dog|cat``, але ``[a b]`` " +"все одно відповідатиме символам ``'a'``, ``'b'`` або пробілу. Крім того, ви " +"також можете розмістити коментарі всередині RE; коментарі поширюються від " +"символу ``#`` до наступного нового рядка. При використанні з рядками в " +"потрійних лапках це дає змогу форматувати RE більш акуратно::" + +msgid "" +"pat = re.compile(r\"\"\"\n" +" \\s* # Skip leading whitespace\n" +" (?P
[^:]+) # Header name\n" +" \\s* : # Whitespace, and a colon\n" +" (?P.*?) # The header's value -- *? used to\n" +" # lose the following trailing whitespace\n" +" \\s*$ # Trailing whitespace to end-of-line\n" +"\"\"\", re.VERBOSE)" +msgstr "" + +msgid "This is far more readable than::" +msgstr "Це набагато читабельніше, ніж:" + +msgid "pat = re.compile(r\"\\s*(?P
[^:]+)\\s*:(?P.*?)\\s*$\")" +msgstr "" + +msgid "Feedback" +msgstr "Зворотній зв'язок" + +msgid "" +"Regular expressions are a complicated topic. Did this document help you " +"understand them? Were there parts that were unclear, or Problems you " +"encountered that weren't covered here? If so, please send suggestions for " +"improvements to the author." +msgstr "" +"Регулярні вирази – це складна тема. Чи допоміг вам цей документ зрозуміти " +"їх? Чи були частини, які були незрозумілими, або проблеми, з якими ви " +"зіткнулися, які не були розглянуті тут? Якщо так, будь ласка, надішліть " +"пропозиції щодо покращення автору." + +msgid "" +"The most complete book on regular expressions is almost certainly Jeffrey " +"Friedl's Mastering Regular Expressions, published by O'Reilly. " +"Unfortunately, it exclusively concentrates on Perl and Java's flavours of " +"regular expressions, and doesn't contain any Python material at all, so it " +"won't be useful as a reference for programming in Python. (The first " +"edition covered Python's now-removed :mod:`!regex` module, which won't help " +"you much.) Consider checking it out from your library." +msgstr "" +"Найповнішою книгою про регулярні вирази майже напевно є \"Опанування " +"регулярних виразів\" Джеффрі Фрідла, опублікована O'Reilly. На жаль, він " +"зосереджений виключно на стилях регулярних виразів Perl і Java і взагалі не " +"містить жодного матеріалу Python, тому він не буде корисним як довідник для " +"програмування на Python. (Перше видання охоплювало видалений модуль Python :" +"mod:`!regex`, який вам не дуже допоможе.) Подумайте про те, щоб перевірити " +"його у своїй бібліотеці." diff --git a/howto/sockets.po b/howto/sockets.po new file mode 100644 index 000000000..5150ee796 --- /dev/null +++ b/howto/sockets.po @@ -0,0 +1,754 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:53+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Socket Programming HOWTO" +msgstr "HOWTO з програмування сокетів" + +msgid "Author" +msgstr "Автор" + +msgid "Gordon McMillan" +msgstr "Gordon McMillan" + +msgid "Abstract" +msgstr "Анотація" + +msgid "" +"Sockets are used nearly everywhere, but are one of the most severely " +"misunderstood technologies around. This is a 10,000 foot overview of " +"sockets. It's not really a tutorial - you'll still have work to do in " +"getting things operational. It doesn't cover the fine points (and there are " +"a lot of them), but I hope it will give you enough background to begin using " +"them decently." +msgstr "" +"Розетки використовуються майже скрізь, але це одна з найбільш неправильно " +"зрозумілих технологій. Це 10 000-футовий огляд розеток. Насправді це не " +"підручник – вам ще доведеться попрацювати, щоб налагодити роботу. Він не " +"охоплює тонкощі (а їх багато), але я сподіваюся, що він дасть вам достатньо " +"інформації, щоб почати ними гідно користуватися." + +msgid "Sockets" +msgstr "Сокети" + +msgid "" +"I'm only going to talk about INET (i.e. IPv4) sockets, but they account for " +"at least 99% of the sockets in use. And I'll only talk about STREAM (i.e. " +"TCP) sockets - unless you really know what you're doing (in which case this " +"HOWTO isn't for you!), you'll get better behavior and performance from a " +"STREAM socket than anything else. I will try to clear up the mystery of what " +"a socket is, as well as some hints on how to work with blocking and non-" +"blocking sockets. But I'll start by talking about blocking sockets. You'll " +"need to know how they work before dealing with non-blocking sockets." +msgstr "" +"Я збираюся говорити лише про сокети INET (тобто IPv4), але на них припадає " +"щонайменше 99% використовуваних сокетів. І я буду говорити лише про сокети " +"STREAM (тобто TCP) - якщо ви дійсно не знаєте, що робите (у цьому випадку це " +"HOWTO не для вас!), ви отримаєте кращу поведінку та продуктивність від " +"сокета STREAM, ніж будь-що інше. Я спробую розкрити таємницю того, що таке " +"сокет, а також дам деякі підказки щодо роботи з блокуючими та неблокуючими " +"сокетами. Але я почну з розмови про блокування сокетів. Вам потрібно знати, " +"як вони працюють, перш ніж мати справу з неблокуючими сокетами." + +msgid "" +"Part of the trouble with understanding these things is that \"socket\" can " +"mean a number of subtly different things, depending on context. So first, " +"let's make a distinction between a \"client\" socket - an endpoint of a " +"conversation, and a \"server\" socket, which is more like a switchboard " +"operator. The client application (your browser, for example) uses \"client\" " +"sockets exclusively; the web server it's talking to uses both \"server\" " +"sockets and \"client\" sockets." +msgstr "" +"Частково проблема з розумінням цих речей полягає в тому, що \"розетка\" може " +"означати декілька дещо різних речей, залежно від контексту. Отже, спочатку " +"давайте розрізнимо \"клієнтський\" сокет — кінцеву точку розмови, і " +"\"серверний\" сокет, який більше схожий на оператора комутатора. Клієнтська " +"програма (наприклад, ваш браузер) використовує виключно \"клієнтські\" " +"сокети; веб-сервер, з яким він спілкується, використовує як \"серверні\" " +"сокети, так і \"клієнтські\" сокети." + +msgid "History" +msgstr "історія" + +msgid "" +"Of the various forms of :abbr:`IPC (Inter Process Communication)`, sockets " +"are by far the most popular. On any given platform, there are likely to be " +"other forms of IPC that are faster, but for cross-platform communication, " +"sockets are about the only game in town." +msgstr "" +"З різних форм :abbr:`IPC (Inter Process Communication)` сокети є, безумовно, " +"найпопулярнішими. На будь-якій платформі, імовірно, існують інші форми IPC, " +"які є швидшими, але для міжплатформного зв’язку сокети – це майже єдина гра " +"в місті." + +msgid "" +"They were invented in Berkeley as part of the BSD flavor of Unix. They " +"spread like wildfire with the internet. With good reason --- the combination " +"of sockets with INET makes talking to arbitrary machines around the world " +"unbelievably easy (at least compared to other schemes)." +msgstr "" +"Вони були винайдені в Берклі як частина різновиду BSD Unix. Вони поширюються " +"з Інтернетом як лісова пожежа. З поважною причиною --- поєднання сокетів з " +"INET робить спілкування з довільними машинами по всьому світу неймовірно " +"легким (принаймні порівняно з іншими схемами)." + +msgid "Creating a Socket" +msgstr "Створення сокета" + +msgid "" +"Roughly speaking, when you clicked on the link that brought you to this " +"page, your browser did something like the following::" +msgstr "" +"Грубо кажучи, коли ви клацали посилання, яке привело вас на цю сторінку, ваш " +"браузер робив щось на зразок наступного:" + +msgid "" +"# create an INET, STREAMing socket\n" +"s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n" +"# now connect to the web server on port 80 - the normal http port\n" +"s.connect((\"www.python.org\", 80))" +msgstr "" + +msgid "" +"When the ``connect`` completes, the socket ``s`` can be used to send in a " +"request for the text of the page. The same socket will read the reply, and " +"then be destroyed. That's right, destroyed. Client sockets are normally only " +"used for one exchange (or a small set of sequential exchanges)." +msgstr "" +"Коли ``connect`` завершиться, сокет ``s`` можна використовувати для " +"надсилання запиту на текст сторінки. Той самий сокет прочитає відповідь, а " +"потім буде знищено. Правильно, знищено. Клієнтські сокети зазвичай " +"використовуються лише для одного обміну (або невеликого набору послідовних " +"обмінів)." + +msgid "" +"What happens in the web server is a bit more complex. First, the web server " +"creates a \"server socket\"::" +msgstr "" +"Те, що відбувається на веб-сервері, дещо складніше. Спочатку веб-сервер " +"створює \"серверний сокет\"::" + +msgid "" +"# create an INET, STREAMing socket\n" +"serversocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n" +"# bind the socket to a public host, and a well-known port\n" +"serversocket.bind((socket.gethostname(), 80))\n" +"# become a server socket\n" +"serversocket.listen(5)" +msgstr "" + +msgid "" +"A couple things to notice: we used ``socket.gethostname()`` so that the " +"socket would be visible to the outside world. If we had used ``s." +"bind(('localhost', 80))`` or ``s.bind(('127.0.0.1', 80))`` we would still " +"have a \"server\" socket, but one that was only visible within the same " +"machine. ``s.bind(('', 80))`` specifies that the socket is reachable by any " +"address the machine happens to have." +msgstr "" +"Кілька речей, які слід зауважити: ми використали ``socket.gethostname()``, " +"щоб сокет був видимий для зовнішнього світу. Якби ми використовували ``s." +"bind(('localhost', 80))`` або ``s.bind(('127.0.0.1', 80))``, ми все одно " +"мали б \"серверний\" сокет, але той, який був видимий лише на одній машині. " +"``s.bind(('', 80))`` вказує, що сокет доступний за будь-якою адресою, яку " +"має машина." + +msgid "" +"A second thing to note: low number ports are usually reserved for \"well " +"known\" services (HTTP, SNMP etc). If you're playing around, use a nice high " +"number (4 digits)." +msgstr "" +"По-друге, на що слід звернути увагу: порти з малими номерами зазвичай " +"зарезервовані для \"добре відомих\" служб (HTTP, SNMP тощо). Якщо ви " +"граєтесь, використовуйте гарне високе число (4 цифри)." + +msgid "" +"Finally, the argument to ``listen`` tells the socket library that we want it " +"to queue up as many as 5 connect requests (the normal max) before refusing " +"outside connections. If the rest of the code is written properly, that " +"should be plenty." +msgstr "" +"Нарешті, аргумент ``listen`` повідомляє бібліотеці сокетів, що ми хочемо " +"поставити в чергу щонайменше 5 запитів на з’єднання (звичайний максимум), " +"перш ніж відхилити зовнішні з’єднання. Якщо решта коду написана належним " +"чином, цього має бути достатньо." + +msgid "" +"Now that we have a \"server\" socket, listening on port 80, we can enter the " +"mainloop of the web server::" +msgstr "" +"Тепер, коли у нас є \"серверний\" сокет, який слухає порт 80, ми можемо " +"увійти в основний цикл веб-сервера:" + +msgid "" +"while True:\n" +" # accept connections from outside\n" +" (clientsocket, address) = serversocket.accept()\n" +" # now do something with the clientsocket\n" +" # in this case, we'll pretend this is a threaded server\n" +" ct = client_thread(clientsocket)\n" +" ct.run()" +msgstr "" + +msgid "" +"There's actually 3 general ways in which this loop could work - dispatching " +"a thread to handle ``clientsocket``, create a new process to handle " +"``clientsocket``, or restructure this app to use non-blocking sockets, and " +"multiplex between our \"server\" socket and any active ``clientsocket``\\ s " +"using ``select``. More about that later. The important thing to understand " +"now is this: this is *all* a \"server\" socket does. It doesn't send any " +"data. It doesn't receive any data. It just produces \"client\" sockets. Each " +"``clientsocket`` is created in response to some *other* \"client\" socket " +"doing a ``connect()`` to the host and port we're bound to. As soon as we've " +"created that ``clientsocket``, we go back to listening for more connections. " +"The two \"clients\" are free to chat it up - they are using some dynamically " +"allocated port which will be recycled when the conversation ends." +msgstr "" +"Насправді існує 3 загальні способи роботи цього циклу: відправка потоку для " +"обробки ``clientsocket``, створення нового процесу для обробки " +"``clientsocket`` або реструктуризація цієї програми для використання " +"неблокуючих сокетів і мультиплексування між нашими \"серверний\" сокет і " +"будь-який активний ``clientocket``\\ з використанням ``select``. Про це " +"пізніше. Зараз важливо розуміти наступне: це *все*, що робить \"серверний\" " +"сокет. Він не надсилає жодних даних. Він не отримує жодних даних. Він просто " +"створює \"клієнтські\" сокети. Кожен ``clientocket`` створюється у відповідь " +"на те, що якийсь *інший* \"клієнтський\" сокет виконує ``connect()`` до " +"хосту та порту, до якого ми прив’язані. Як тільки ми створили цей " +"``clientsocket``, ми повертаємося до прослуховування додаткових з’єднань. " +"Два \"клієнти\" можуть вільно спілкуватися - вони використовують якийсь " +"динамічно виділений порт, який буде повторно використано після завершення " +"розмови." + +msgid "IPC" +msgstr "IPC" + +msgid "" +"If you need fast IPC between two processes on one machine, you should look " +"into pipes or shared memory. If you do decide to use AF_INET sockets, bind " +"the \"server\" socket to ``'localhost'``. On most platforms, this will take " +"a shortcut around a couple of layers of network code and be quite a bit " +"faster." +msgstr "" +"Якщо вам потрібен швидкий IPC між двома процесами на одній машині, вам слід " +"звернути увагу на канали або спільну пам’ять. Якщо ви вирішите " +"використовувати сокети AF_INET, прив’яжіть сокет \"сервер\" до " +"``'localhost'``. На більшості платформ це займе ярлик навколо кількох шарів " +"мережевого коду та буде трохи швидшим." + +msgid "" +"The :mod:`multiprocessing` integrates cross-platform IPC into a higher-level " +"API." +msgstr "" +":mod:`multiprocessing` інтегрує міжплатформенний IPC у API вищого рівня." + +msgid "Using a Socket" +msgstr "Використання сокета" + +msgid "" +"The first thing to note, is that the web browser's \"client\" socket and the " +"web server's \"client\" socket are identical beasts. That is, this is a " +"\"peer to peer\" conversation. Or to put it another way, *as the designer, " +"you will have to decide what the rules of etiquette are for a conversation*. " +"Normally, the ``connect``\\ ing socket starts the conversation, by sending " +"in a request, or perhaps a signon. But that's a design decision - it's not a " +"rule of sockets." +msgstr "" +"Перше, що слід зазначити, це те, що \"клієнтський\" сокет веб-браузера та " +"\"клієнтський\" сокет веб-сервера є ідентичними звірами. Тобто це розмова " +"\"рівний\". Або інакше кажучи, *як дизайнеру, вам доведеться вирішити, які " +"правила етикету для розмови*. Зазвичай сокет ``connect``\\ починає розмову, " +"надсилаючи запит або, можливо, авторизуючись. Але це дизайнерське рішення - " +"це не правило розеток." + +msgid "" +"Now there are two sets of verbs to use for communication. You can use " +"``send`` and ``recv``, or you can transform your client socket into a file-" +"like beast and use ``read`` and ``write``. The latter is the way Java " +"presents its sockets. I'm not going to talk about it here, except to warn " +"you that you need to use ``flush`` on sockets. These are buffered \"files\", " +"and a common mistake is to ``write`` something, and then ``read`` for a " +"reply. Without a ``flush`` in there, you may wait forever for the reply, " +"because the request may still be in your output buffer." +msgstr "" +"Тепер є два набори дієслів для спілкування. Ви можете використовувати " +"``send`` і ``recv``, або ви можете перетворити свій клієнтський сокет на " +"звіра, схожого на файл, і використовувати ``read`` і ``write``. Останнім є " +"те, як Java представляє свої сокети. Я не збираюся говорити про це тут, " +"окрім того, щоб попередити вас, що вам потрібно використовувати " +"``промивання`` для сокетів. Це буферизовані \"файли\", і поширеною помилкою " +"є ``написати`` щось, а потім ``читати`` для відповіді. Без ``скидання`` ви " +"можете вічно чекати відповіді, оскільки запит може все ще перебувати у " +"вашому вихідному буфері." + +msgid "" +"Now we come to the major stumbling block of sockets - ``send`` and ``recv`` " +"operate on the network buffers. They do not necessarily handle all the bytes " +"you hand them (or expect from them), because their major focus is handling " +"the network buffers. In general, they return when the associated network " +"buffers have been filled (``send``) or emptied (``recv``). They then tell " +"you how many bytes they handled. It is *your* responsibility to call them " +"again until your message has been completely dealt with." +msgstr "" +"Тепер ми підходимо до основного каменю спотикання сокетів - ``send`` і " +"``recv`` працюють з мережевими буферами. Вони не обов’язково обробляють усі " +"байти, які ви їм передаєте (або очікуєте від них), тому що їх основна увага " +"приділяється роботі з мережевими буферами. Зазвичай вони повертаються, коли " +"пов’язані мережеві буфери заповнено (``send``) або спустошено (``recv``). " +"Потім вони повідомлять вам, скільки байтів вони обробили. Це *ваш* обов’язок " +"зателефонувати їм знову, доки ваше повідомлення не буде повністю розглянуто." + +msgid "" +"When a ``recv`` returns 0 bytes, it means the other side has closed (or is " +"in the process of closing) the connection. You will not receive any more " +"data on this connection. Ever. You may be able to send data successfully; " +"I'll talk more about this later." +msgstr "" +"Коли ``recv`` повертає 0 байтів, це означає, що інша сторона закрила (або " +"знаходиться в процесі закриття) з’єднання. Ви більше не отримуватимете " +"жодних даних за цим з’єднанням. Коли-небудь. Можливо, ви зможете успішно " +"надіслати дані; Я розповім про це пізніше." + +msgid "" +"A protocol like HTTP uses a socket for only one transfer. The client sends a " +"request, then reads a reply. That's it. The socket is discarded. This means " +"that a client can detect the end of the reply by receiving 0 bytes." +msgstr "" +"Такий протокол, як HTTP, використовує сокет лише для однієї передачі. Клієнт " +"надсилає запит, потім читає відповідь. Це воно. Розетка викидається. Це " +"означає, що клієнт може виявити кінець відповіді, отримавши 0 байтів." + +msgid "" +"But if you plan to reuse your socket for further transfers, you need to " +"realize that *there is no* :abbr:`EOT (End of Transfer)` *on a socket.* I " +"repeat: if a socket ``send`` or ``recv`` returns after handling 0 bytes, the " +"connection has been broken. If the connection has *not* been broken, you " +"may wait on a ``recv`` forever, because the socket will *not* tell you that " +"there's nothing more to read (for now). Now if you think about that a bit, " +"you'll come to realize a fundamental truth of sockets: *messages must either " +"be fixed length* (yuck), *or be delimited* (shrug), *or indicate how long " +"they are* (much better), *or end by shutting down the connection*. The " +"choice is entirely yours, (but some ways are righter than others)." +msgstr "" +"Але якщо ви плануєте повторно використовувати свій сокет для подальших " +"передач, ви повинні розуміти, що *немає* :abbr:`EOT (End of Transfer)` *у " +"сокеті*. Я повторюю: якщо сокет ``надсилає`` або ``recv`` повертає після " +"обробки 0 байт, з'єднання було розірвано. Якщо з’єднання *не* розірвано, ви " +"можете чекати ``recv`` вічно, тому що сокет *не* скаже вам, що більше нічого " +"читати (наразі). Тепер, якщо ви трохи подумаєте про це, ви зрозумієте " +"фундаментальну істину сокетів: *повідомлення мають бути фіксованої довжини* " +"(фу), *або бути розділеними* (знизати плечима), *або вказати їхню довжину* " +"(набагато краще), *або закінчити, вимкнувши з’єднання*. Вибір виключно за " +"вами (але деякі шляхи правильніші за інші)." + +msgid "" +"Assuming you don't want to end the connection, the simplest solution is a " +"fixed length message::" +msgstr "" +"Якщо припустити, що ви не хочете розривати з’єднання, найпростішим рішенням " +"є повідомлення фіксованої довжини::" + +msgid "" +"class MySocket:\n" +" \"\"\"demonstration class only\n" +" - coded for clarity, not efficiency\n" +" \"\"\"\n" +"\n" +" def __init__(self, sock=None):\n" +" if sock is None:\n" +" self.sock = socket.socket(\n" +" socket.AF_INET, socket.SOCK_STREAM)\n" +" else:\n" +" self.sock = sock\n" +"\n" +" def connect(self, host, port):\n" +" self.sock.connect((host, port))\n" +"\n" +" def mysend(self, msg):\n" +" totalsent = 0\n" +" while totalsent < MSGLEN:\n" +" sent = self.sock.send(msg[totalsent:])\n" +" if sent == 0:\n" +" raise RuntimeError(\"socket connection broken\")\n" +" totalsent = totalsent + sent\n" +"\n" +" def myreceive(self):\n" +" chunks = []\n" +" bytes_recd = 0\n" +" while bytes_recd < MSGLEN:\n" +" chunk = self.sock.recv(min(MSGLEN - bytes_recd, 2048))\n" +" if chunk == b'':\n" +" raise RuntimeError(\"socket connection broken\")\n" +" chunks.append(chunk)\n" +" bytes_recd = bytes_recd + len(chunk)\n" +" return b''.join(chunks)" +msgstr "" + +msgid "" +"The sending code here is usable for almost any messaging scheme - in Python " +"you send strings, and you can use ``len()`` to determine its length (even if " +"it has embedded ``\\0`` characters). It's mostly the receiving code that " +"gets more complex. (And in C, it's not much worse, except you can't use " +"``strlen`` if the message has embedded ``\\0``\\ s.)" +msgstr "" +"Код надсилання тут можна використовувати майже для будь-якої схеми обміну " +"повідомленнями - у Python ви надсилаєте рядки, і ви можете використовувати " +"``len()``, щоб визначити його довжину (навіть якщо він містить символи " +"``\\0``). Здебільшого код отримання стає складнішим. (У C це не набагато " +"гірше, за винятком того, що ви не можете використовувати ``strlen``, якщо " +"повідомлення містить ``\\0``\\ s.)" + +msgid "" +"The easiest enhancement is to make the first character of the message an " +"indicator of message type, and have the type determine the length. Now you " +"have two ``recv``\\ s - the first to get (at least) that first character so " +"you can look up the length, and the second in a loop to get the rest. If you " +"decide to go the delimited route, you'll be receiving in some arbitrary " +"chunk size, (4096 or 8192 is frequently a good match for network buffer " +"sizes), and scanning what you've received for a delimiter." +msgstr "" +"Найпростішим удосконаленням є зробити перший символ повідомлення індикатором " +"типу повідомлення, а тип визначати довжину. Тепер у вас є два ``recv``\\ - " +"перший, щоб отримати (принаймні) перший символ, щоб ви могли переглянути " +"довжину, а другий у циклі, щоб отримати решту. Якщо ви вирішите скористатися " +"розмежованим маршрутом, ви отримуватимете довільний розмір фрагмента (4096 " +"або 8192 часто добре підходить для розмірів мережевого буфера) і " +"скануватимете отримане як роздільник." + +msgid "" +"One complication to be aware of: if your conversational protocol allows " +"multiple messages to be sent back to back (without some kind of reply), and " +"you pass ``recv`` an arbitrary chunk size, you may end up reading the start " +"of a following message. You'll need to put that aside and hold onto it, " +"until it's needed." +msgstr "" +"Одна складність, про яку слід пам’ятати: якщо ваш протокол розмови дозволяє " +"надсилати декілька повідомлень один за одним (без відповіді), і ви передаєте " +"``recv`` довільного розміру фрагмента, ви можете завершити читання початку " +"наступне повідомлення. Вам потрібно буде відкласти це вбік і тримати, поки " +"воно не знадобиться." + +msgid "" +"Prefixing the message with its length (say, as 5 numeric characters) gets " +"more complex, because (believe it or not), you may not get all 5 characters " +"in one ``recv``. In playing around, you'll get away with it; but in high " +"network loads, your code will very quickly break unless you use two ``recv`` " +"loops - the first to determine the length, the second to get the data part " +"of the message. Nasty. This is also when you'll discover that ``send`` does " +"not always manage to get rid of everything in one pass. And despite having " +"read this, you will eventually get bit by it!" +msgstr "" +"Додавання до повідомлення довжини (скажімо, 5 цифрових символів) стає " +"складнішим, оскільки (вірте чи ні), ви можете не отримати всі 5 символів в " +"одному ``recv``. Граючись, ви вийдете з рук; але за високого навантаження на " +"мережу ваш код дуже швидко зламається, якщо ви не використовуєте два цикли " +"``recv`` - перший для визначення довжини, другий для отримання частини даних " +"повідомлення. Огидно. Тут також ви побачите, що ``send`` не завжди вдається " +"позбутися всього за один прохід. І, незважаючи на те, що ви прочитали це, ви " +"зрештою розчулитесь!" + +msgid "" +"In the interests of space, building your character, (and preserving my " +"competitive position), these enhancements are left as an exercise for the " +"reader. Lets move on to cleaning up." +msgstr "" +"В інтересах простору, побудови вашого персонажа (і збереження моєї " +"конкурентної позиції), ці вдосконалення залишаються як вправа для читача. " +"Переходимо до прибирання." + +msgid "Binary Data" +msgstr "Двійкові дані" + +msgid "" +"It is perfectly possible to send binary data over a socket. The major " +"problem is that not all machines use the same formats for binary data. For " +"example, `network byte order `_ is big-endian, with the most significant byte " +"first, so a 16 bit integer with the value ``1`` would be the two hex bytes " +"``00 01``. However, most common processors (x86/AMD64, ARM, RISC-V), are " +"little-endian, with the least significant byte first - that same ``1`` would " +"be ``01 00``." +msgstr "" +"Цілком можливо надсилати двійкові дані через сокет. Основна проблема полягає " +"в тому, що не всі машини використовують однакові формати для двійкових " +"даних. Наприклад, `мережевий порядок байтів `_ є старшим байтом, із старшим байтом першим, тому 16-" +"бітове ціле число зі значенням ``1`` буде двома шістнадцятковими байтами " +"``00 01``. Однак більшість поширених процесорів (x86/AMD64, ARM, RISC-V) " +"мають байт від маленького байта з молодшим байтом першим - той самий ``1`` " +"буде ``01 00``." + +msgid "" +"Socket libraries have calls for converting 16 and 32 bit integers - ``ntohl, " +"htonl, ntohs, htons`` where \"n\" means *network* and \"h\" means *host*, " +"\"s\" means *short* and \"l\" means *long*. Where network order is host " +"order, these do nothing, but where the machine is byte-reversed, these swap " +"the bytes around appropriately." +msgstr "" +"Бібліотеки сокетів містять виклики для перетворення 16- та 32-розрядних " +"цілих чисел — ``ntohl, htonl, ntohs, htons``, де \"n\" означає *мережа*, а " +"\"h\" означає *host*, \"s\" означає *short* і \"l\". \" означає *довгий*. " +"Там, де мережевий порядок є порядком хостів, вони нічого не роблять, але " +"там, де машина реверсована, байти міняються місцями належним чином." + +msgid "" +"In these days of 64-bit machines, the ASCII representation of binary data is " +"frequently smaller than the binary representation. That's because a " +"surprising amount of the time, most integers have the value 0, or maybe 1. " +"The string ``\"0\"`` would be two bytes, while a full 64-bit integer would " +"be 8. Of course, this doesn't fit well with fixed-length messages. " +"Decisions, decisions." +msgstr "" +"У наші дні 64-розрядних машин представлення двійкових даних у форматі ASCII " +"часто менше, ніж у двійковому. Це тому, що на диво більшість цілих чисел " +"мають значення 0 або, можливо, 1. Рядок ``\"0\"`` складатиметься з двох " +"байтів, тоді як повне 64-розрядне ціле число буде 8. Звичайно, це не не " +"підходить для повідомлень фіксованої довжини. Рішення, рішення." + +msgid "Disconnecting" +msgstr "Відключення" + +msgid "" +"Strictly speaking, you're supposed to use ``shutdown`` on a socket before " +"you ``close`` it. The ``shutdown`` is an advisory to the socket at the " +"other end. Depending on the argument you pass it, it can mean \"I'm not " +"going to send anymore, but I'll still listen\", or \"I'm not listening, good " +"riddance!\". Most socket libraries, however, are so used to programmers " +"neglecting to use this piece of etiquette that normally a ``close`` is the " +"same as ``shutdown(); close()``. So in most situations, an explicit " +"``shutdown`` is not needed." +msgstr "" +"Власне кажучи, ви повинні використовувати ``shutdown`` для сокета перед тим, " +"як ``закрити`` його. ``вимкнення`` є порадою для розетки на іншому кінці. " +"Залежно від аргументу, який ви передаєте, це може означати \"Я більше не " +"надсилаю, але я все одно вислухаю\", або \"Я не слухаю, ну добре!\". Однак " +"більшість бібліотек сокетів настільки звикли до того, що програмісти " +"нехтують використанням цього правила етикету, що зазвичай ``close`` є таким " +"самим, як ``shutdown(); close()``. Тож у більшості ситуацій явне " +"``вимкнення`` не потрібне." + +msgid "" +"One way to use ``shutdown`` effectively is in an HTTP-like exchange. The " +"client sends a request and then does a ``shutdown(1)``. This tells the " +"server \"This client is done sending, but can still receive.\" The server " +"can detect \"EOF\" by a receive of 0 bytes. It can assume it has the " +"complete request. The server sends a reply. If the ``send`` completes " +"successfully then, indeed, the client was still receiving." +msgstr "" +"Один із способів ефективного використання ``shutdown`` - це HTTP-подібний " +"обмін. Клієнт надсилає запит, а потім виконує ``shutdown(1)``. Це повідомляє " +"серверу: \"Цей клієнт завершив надсилання, але все ще може отримувати\". " +"Сервер може виявити \"EOF\" за отриманням 0 байтів. Він може вважати, що має " +"повний запит. Сервер надсилає відповідь. Якщо ``надсилання`` завершилося " +"успішно, тоді клієнт справді все ще отримував." + +msgid "" +"Python takes the automatic shutdown a step further, and says that when a " +"socket is garbage collected, it will automatically do a ``close`` if it's " +"needed. But relying on this is a very bad habit. If your socket just " +"disappears without doing a ``close``, the socket at the other end may hang " +"indefinitely, thinking you're just being slow. *Please* ``close`` your " +"sockets when you're done." +msgstr "" +"Python робить автоматичне завершення роботи на крок далі, і каже, що коли " +"сокет збирає сміття, він автоматично виконає ``закриття``, якщо це " +"необхідно. Але покладатися на це – дуже погана звичка. Якщо ваш сокет просто " +"зникне, не виконавши ``закриття``, сокет на іншому кінці може зависнути " +"нескінченно, вважаючи, що ви просто повільні. *Будь ласка* ``закрийте`` свої " +"сокети, коли закінчите." + +msgid "When Sockets Die" +msgstr "Коли сокети вмирають" + +msgid "" +"Probably the worst thing about using blocking sockets is what happens when " +"the other side comes down hard (without doing a ``close``). Your socket is " +"likely to hang. TCP is a reliable protocol, and it will wait a long, long " +"time before giving up on a connection. If you're using threads, the entire " +"thread is essentially dead. There's not much you can do about it. As long as " +"you aren't doing something dumb, like holding a lock while doing a blocking " +"read, the thread isn't really consuming much in the way of resources. Do " +"*not* try to kill the thread - part of the reason that threads are more " +"efficient than processes is that they avoid the overhead associated with the " +"automatic recycling of resources. In other words, if you do manage to kill " +"the thread, your whole process is likely to be screwed up." +msgstr "" +"Ймовірно, найгірше у використанні блокування сокетів – це те, що " +"відбувається, коли інша сторона сильно опускається (без виконання " +"``закриття``). Ваша розетка, швидше за все, зависла. TCP є надійним " +"протоколом, і він чекатиме дуже довго, перш ніж відмовитися від з’єднання. " +"Якщо ви використовуєте потоки, весь потік фактично мертвий. З цим мало що " +"можна зробити. Поки ви не робите щось дурне, наприклад, утримуєте блокування " +"під час виконання блокуючого читання, потік насправді не споживає багато " +"ресурсів. *Не* намагайтеся припинити потік – одна з причин того, що потоки " +"ефективніші за процеси, полягає в тому, що вони уникають накладних витрат, " +"пов’язаних з автоматичною переробкою ресурсів. Іншими словами, якщо вам таки " +"вдасться припинити потік, весь ваш процес, швидше за все, буде зіпсовано." + +msgid "Non-blocking Sockets" +msgstr "Неблокуючі сокети" + +msgid "" +"If you've understood the preceding, you already know most of what you need " +"to know about the mechanics of using sockets. You'll still use the same " +"calls, in much the same ways. It's just that, if you do it right, your app " +"will be almost inside-out." +msgstr "" +"Якщо ви зрозуміли попереднє, ви вже знаєте більшість того, що вам потрібно " +"знати про механізми використання розеток. Ви й надалі використовуватимете ті " +"самі дзвінки майже тими самими способами. Просто якщо ви зробите це " +"правильно, ваш додаток буде майже навиворіт." + +msgid "" +"In Python, you use ``socket.setblocking(False)`` to make it non-blocking. In " +"C, it's more complex, (for one thing, you'll need to choose between the BSD " +"flavor ``O_NONBLOCK`` and the almost indistinguishable POSIX flavor " +"``O_NDELAY``, which is completely different from ``TCP_NODELAY``), but it's " +"the exact same idea. You do this after creating the socket, but before using " +"it. (Actually, if you're nuts, you can switch back and forth.)" +msgstr "" +"У Python ви використовуєте ``socket.setblocking(False)``, щоб зробити його " +"неблокуючим. У C це складніше (з одного боку, вам потрібно буде вибирати між " +"варіантом BSD ``O_NONBLOCK`` і майже невідмітним варіантом POSIX " +"``O_NDELAY``, який повністю відрізняється від ``TCP_NODELAY``) , але це та " +"сама ідея. Ви робите це після створення сокета, але перед його " +"використанням. (Насправді, якщо ви божевільні, ви можете перемикатися вперед " +"і назад.)" + +msgid "" +"The major mechanical difference is that ``send``, ``recv``, ``connect`` and " +"``accept`` can return without having done anything. You have (of course) a " +"number of choices. You can check return code and error codes and generally " +"drive yourself crazy. If you don't believe me, try it sometime. Your app " +"will grow large, buggy and suck CPU. So let's skip the brain-dead solutions " +"and do it right." +msgstr "" +"Основна механічна відмінність полягає в тому, що ``send``, ``recv``, " +"``connect`` і ``accept`` можуть повернутися, не зробивши нічого. У вас є " +"(звичайно) кілька варіантів. Можна перевірити код повернення і коди помилок " +"і взагалі звести себе з розуму. Якщо ви мені не вірите, спробуйте якось. " +"Ваша програма буде рости, матиме помилки та завантажуватиме процесор. Тож " +"давайте пропустимо рішення, що призводять до смерті мозку, і зробимо це " +"правильно." + +msgid "Use ``select``." +msgstr "Використовуйте ``вибрати``." + +msgid "" +"In C, coding ``select`` is fairly complex. In Python, it's a piece of cake, " +"but it's close enough to the C version that if you understand ``select`` in " +"Python, you'll have little trouble with it in C::" +msgstr "" +"У C кодування ``select`` є досить складним. У Python це непросто, але він " +"досить близький до версії C, тому якщо ви розумієте ``select`` у Python, у " +"вас не буде проблем з цим у C::" + +msgid "" +"ready_to_read, ready_to_write, in_error = \\\n" +" select.select(\n" +" potential_readers,\n" +" potential_writers,\n" +" potential_errs,\n" +" timeout)" +msgstr "" + +msgid "" +"You pass ``select`` three lists: the first contains all sockets that you " +"might want to try reading; the second all the sockets you might want to try " +"writing to, and the last (normally left empty) those that you want to check " +"for errors. You should note that a socket can go into more than one list. " +"The ``select`` call is blocking, but you can give it a timeout. This is " +"generally a sensible thing to do - give it a nice long timeout (say a " +"minute) unless you have good reason to do otherwise." +msgstr "" +"Ви передаєте ``select`` три списки: перший містить усі сокети, які ви можете " +"спробувати прочитати; другий – усі сокети, до яких ви можете спробувати " +"записати, а останній (зазвичай залишають порожнім) ті, які ви хочете " +"перевірити на наявність помилок. Зверніть увагу, що сокет може входити до " +"кількох списків. Виклик ``select`` блокується, але ви можете дати йому тайм-" +"аут. Загалом це розумна річ — дайте гарний довгий тайм-аут (скажімо, " +"хвилину), якщо у вас немає вагомих причин для цього." + +msgid "" +"In return, you will get three lists. They contain the sockets that are " +"actually readable, writable and in error. Each of these lists is a subset " +"(possibly empty) of the corresponding list you passed in." +msgstr "" +"Натомість ви отримаєте три списки. Вони містять сокети, які фактично " +"доступні для читання, запису та помилок. Кожен із цих списків є підмножиною " +"(можливо, порожньою) відповідного списку, який ви передали." + +msgid "" +"If a socket is in the output readable list, you can be as-close-to-certain-" +"as-we-ever-get-in-this-business that a ``recv`` on that socket will return " +"*something*. Same idea for the writable list. You'll be able to send " +"*something*. Maybe not all you want to, but *something* is better than " +"nothing. (Actually, any reasonably healthy socket will return as writable - " +"it just means outbound network buffer space is available.)" +msgstr "" +"Якщо сокет є у вихідному списку доступних для читання, ви можете бути " +"настільки ж близькі до впевненості, що ``recv`` для цього сокета поверне " +"*щось*. Така сама ідея для списку доступного для запису. Ви зможете " +"надіслати *щось*. Можливо, не все, що ви хочете, але *щось* краще, ніж " +"нічого. (Насправді, будь-який досить справний сокет повернеться як доступний " +"для запису - це просто означає, що вихідний мережевий буфер доступний.)" + +msgid "" +"If you have a \"server\" socket, put it in the potential_readers list. If it " +"comes out in the readable list, your ``accept`` will (almost certainly) " +"work. If you have created a new socket to ``connect`` to someone else, put " +"it in the potential_writers list. If it shows up in the writable list, you " +"have a decent chance that it has connected." +msgstr "" +"Якщо у вас є \"серверний\" сокет, додайте його до списку potencial_readers. " +"Якщо він з’явиться у списку доступних для читання, ваш ``accept`` (майже " +"напевно) спрацює. Якщо ви створили новий сокет для ``з’єднання`` з кимось " +"іншим, додайте його до списку potencijal_writers. Якщо він відображається у " +"списку доступних для запису, у вас є пристойний шанс, що він підключився." + +msgid "" +"Actually, ``select`` can be handy even with blocking sockets. It's one way " +"of determining whether you will block - the socket returns as readable when " +"there's something in the buffers. However, this still doesn't help with the " +"problem of determining whether the other end is done, or just busy with " +"something else." +msgstr "" +"Фактично, ``select`` може бути зручним навіть з блокуванням сокетів. Це один " +"із способів визначити, чи будете ви блокувати – сокет повертається як " +"читабельний, коли щось є в буферах. Однак це все ще не допомагає вирішити " +"проблему визначення того, чи інший кінець готовий, чи він просто зайнятий " +"чимось іншим." + +msgid "" +"**Portability alert**: On Unix, ``select`` works both with the sockets and " +"files. Don't try this on Windows. On Windows, ``select`` works with sockets " +"only. Also note that in C, many of the more advanced socket options are done " +"differently on Windows. In fact, on Windows I usually use threads (which " +"work very, very well) with my sockets." +msgstr "" +"**Попередження про переносимість**: в Unix ``select`` працює як з сокетами, " +"так і з файлами. Не пробуйте це на Windows. У Windows ``select`` працює лише " +"з сокетами. Також зауважте, що в C багато розширені параметри сокетів " +"виконуються інакше у Windows. Фактично, у Windows я зазвичай використовую " +"потоки (які дуже, дуже добре працюють) зі своїми сокетами." diff --git a/howto/sorting.po b/howto/sorting.po new file mode 100644 index 000000000..453af4c5a --- /dev/null +++ b/howto/sorting.po @@ -0,0 +1,543 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2023 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:53+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2023\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Sorting Techniques" +msgstr "" + +msgid "Author" +msgstr "Автор" + +msgid "Andrew Dalke and Raymond Hettinger" +msgstr "Andrew Dalke та Raymond Hettinger" + +msgid "" +"Python lists have a built-in :meth:`list.sort` method that modifies the list " +"in-place. There is also a :func:`sorted` built-in function that builds a " +"new sorted list from an iterable." +msgstr "" +"Списки Python мають вбудований метод :meth:`list.sort`, який змінює список " +"на місці. Існує також вбудована функція :func:`sorted`, яка створює новий " +"відсортований список із ітерованого." + +msgid "" +"In this document, we explore the various techniques for sorting data using " +"Python." +msgstr "" +"У цьому документі ми досліджуємо різні техніки сортування даних за допомогою " +"Python." + +msgid "Sorting Basics" +msgstr "Основи сортування" + +msgid "" +"A simple ascending sort is very easy: just call the :func:`sorted` function. " +"It returns a new sorted list:" +msgstr "" +"Просте сортування за зростанням дуже просте: просто викличте функцію :func:" +"`sorted`. Він повертає новий відсортований список:" + +msgid "" +">>> sorted([5, 2, 3, 1, 4])\n" +"[1, 2, 3, 4, 5]" +msgstr "" + +msgid "" +"You can also use the :meth:`list.sort` method. It modifies the list in-place " +"(and returns ``None`` to avoid confusion). Usually it's less convenient " +"than :func:`sorted` - but if you don't need the original list, it's slightly " +"more efficient." +msgstr "" +"Ви також можете використовувати метод :meth:`list.sort`. Він змінює список " +"на місці (і повертає ``None``, щоб уникнути плутанини). Зазвичай це менш " +"зручно, ніж :func:`sorted`, але якщо вам не потрібен оригінальний список, це " +"трохи ефективніше." + +msgid "" +">>> a = [5, 2, 3, 1, 4]\n" +">>> a.sort()\n" +">>> a\n" +"[1, 2, 3, 4, 5]" +msgstr "" + +msgid "" +"Another difference is that the :meth:`list.sort` method is only defined for " +"lists. In contrast, the :func:`sorted` function accepts any iterable." +msgstr "" +"Ще одна відмінність полягає в тому, що метод :meth:`list.sort` визначено " +"лише для списків. На відміну від цього, функція :func:`sorted` приймає будь-" +"яку ітерацію." + +msgid "" +">>> sorted({1: 'D', 2: 'B', 3: 'B', 4: 'E', 5: 'A'})\n" +"[1, 2, 3, 4, 5]" +msgstr "" + +msgid "Key Functions" +msgstr "Ключові функції" + +msgid "" +"Both :meth:`list.sort` and :func:`sorted` have a *key* parameter to specify " +"a function (or other callable) to be called on each list element prior to " +"making comparisons." +msgstr "" +"І :meth:`list.sort`, і :func:`sorted` мають параметр *key* для вказівки " +"функції (або іншого виклику), яка буде викликана для кожного елемента списку " +"перед проведенням порівнянь." + +msgid "For example, here's a case-insensitive string comparison:" +msgstr "Наприклад, ось порівняння рядків без урахування регістру:" + +msgid "" +">>> sorted(\"This is a test string from Andrew\".split(), key=str.casefold)\n" +"['a', 'Andrew', 'from', 'is', 'string', 'test', 'This']" +msgstr "" + +msgid "" +"The value of the *key* parameter should be a function (or other callable) " +"that takes a single argument and returns a key to use for sorting purposes. " +"This technique is fast because the key function is called exactly once for " +"each input record." +msgstr "" +"Значення параметра *key* має бути функцією (або іншою можливістю виклику), " +"яка приймає один аргумент і повертає ключ для використання в цілях " +"сортування. Ця техніка є швидкою, оскільки ключова функція викликається " +"рівно один раз для кожного вхідного запису." + +msgid "" +"A common pattern is to sort complex objects using some of the object's " +"indices as keys. For example:" +msgstr "" +"Загальним шаблоном є сортування складних об’єктів за допомогою деяких " +"індексів об’єктів як ключів. Наприклад:" + +msgid "" +">>> student_tuples = [\n" +"... ('john', 'A', 15),\n" +"... ('jane', 'B', 12),\n" +"... ('dave', 'B', 10),\n" +"... ]\n" +">>> sorted(student_tuples, key=lambda student: student[2]) # sort by age\n" +"[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]" +msgstr "" + +msgid "" +"The same technique works for objects with named attributes. For example:" +msgstr "" +"Така ж техніка працює для об’єктів з іменованими атрибутами. Наприклад:" + +msgid "" +">>> class Student:\n" +"... def __init__(self, name, grade, age):\n" +"... self.name = name\n" +"... self.grade = grade\n" +"... self.age = age\n" +"... def __repr__(self):\n" +"... return repr((self.name, self.grade, self.age))\n" +"\n" +">>> student_objects = [\n" +"... Student('john', 'A', 15),\n" +"... Student('jane', 'B', 12),\n" +"... Student('dave', 'B', 10),\n" +"... ]\n" +">>> sorted(student_objects, key=lambda student: student.age) # sort by " +"age\n" +"[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]" +msgstr "" + +msgid "" +"Objects with named attributes can be made by a regular class as shown above, " +"or they can be instances of :class:`~dataclasses.dataclass` or a :term:" +"`named tuple`." +msgstr "" + +msgid "Operator Module Functions and Partial Function Evaluation" +msgstr "" + +msgid "" +"The :term:`key function` patterns shown above are very common, so Python " +"provides convenience functions to make accessor functions easier and faster. " +"The :mod:`operator` module has :func:`~operator.itemgetter`, :func:" +"`~operator.attrgetter`, and a :func:`~operator.methodcaller` function." +msgstr "" + +msgid "Using those functions, the above examples become simpler and faster:" +msgstr "" +"Використовуючи ці функції, наведені вище приклади стають простішими та " +"швидшими:" + +msgid "" +">>> from operator import itemgetter, attrgetter\n" +"\n" +">>> sorted(student_tuples, key=itemgetter(2))\n" +"[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]\n" +"\n" +">>> sorted(student_objects, key=attrgetter('age'))\n" +"[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]" +msgstr "" + +msgid "" +"The operator module functions allow multiple levels of sorting. For example, " +"to sort by *grade* then by *age*:" +msgstr "" +"Функції модуля оператора дозволяють сортувати кілька рівнів. Наприклад, щоб " +"відсортувати за *класом*, а потім за *віком*:" + +msgid "" +">>> sorted(student_tuples, key=itemgetter(1,2))\n" +"[('john', 'A', 15), ('dave', 'B', 10), ('jane', 'B', 12)]\n" +"\n" +">>> sorted(student_objects, key=attrgetter('grade', 'age'))\n" +"[('john', 'A', 15), ('dave', 'B', 10), ('jane', 'B', 12)]" +msgstr "" + +msgid "" +"The :mod:`functools` module provides another helpful tool for making key-" +"functions. The :func:`~functools.partial` function can reduce the `arity " +"`_ of a multi-argument function making " +"it suitable for use as a key-function." +msgstr "" + +msgid "" +">>> from functools import partial\n" +">>> from unicodedata import normalize\n" +"\n" +">>> names = 'Zoë Åbjørn Núñez Élana Zeke Abe Nubia Eloise'.split()\n" +"\n" +">>> sorted(names, key=partial(normalize, 'NFD'))\n" +"['Abe', 'Åbjørn', 'Eloise', 'Élana', 'Nubia', 'Núñez', 'Zeke', 'Zoë']\n" +"\n" +">>> sorted(names, key=partial(normalize, 'NFC'))\n" +"['Abe', 'Eloise', 'Nubia', 'Núñez', 'Zeke', 'Zoë', 'Åbjørn', 'Élana']" +msgstr "" + +msgid "Ascending and Descending" +msgstr "Висхідний і спадний" + +msgid "" +"Both :meth:`list.sort` and :func:`sorted` accept a *reverse* parameter with " +"a boolean value. This is used to flag descending sorts. For example, to get " +"the student data in reverse *age* order:" +msgstr "" +"І :meth:`list.sort`, і :func:`sorted` приймають параметр *reverse* із " +"логічним значенням. Це використовується для позначення сортування за " +"спаданням. Наприклад, щоб отримати дані про студентів у зворотному порядку " +"*віку*:" + +msgid "" +">>> sorted(student_tuples, key=itemgetter(2), reverse=True)\n" +"[('john', 'A', 15), ('jane', 'B', 12), ('dave', 'B', 10)]\n" +"\n" +">>> sorted(student_objects, key=attrgetter('age'), reverse=True)\n" +"[('john', 'A', 15), ('jane', 'B', 12), ('dave', 'B', 10)]" +msgstr "" + +msgid "Sort Stability and Complex Sorts" +msgstr "Стійкість сортування та складні сорти" + +msgid "" +"Sorts are guaranteed to be `stable `_\\. That means that when multiple records have " +"the same key, their original order is preserved." +msgstr "" +"Сортування гарантовано буде `стабільним `_\\. Це означає, що коли кілька записів мають " +"однаковий ключ, їхній початковий порядок зберігається." + +msgid "" +">>> data = [('red', 1), ('blue', 1), ('red', 2), ('blue', 2)]\n" +">>> sorted(data, key=itemgetter(0))\n" +"[('blue', 1), ('blue', 2), ('red', 1), ('red', 2)]" +msgstr "" + +msgid "" +"Notice how the two records for *blue* retain their original order so that " +"``('blue', 1)`` is guaranteed to precede ``('blue', 2)``." +msgstr "" +"Зверніть увагу, як два записи для *blue* зберігають свій початковий порядок, " +"тому ``('blue', 1)`` гарантовано передує ``('blue', 2)``." + +msgid "" +"This wonderful property lets you build complex sorts in a series of sorting " +"steps. For example, to sort the student data by descending *grade* and then " +"ascending *age*, do the *age* sort first and then sort again using *grade*:" +msgstr "" +"Ця чудова властивість дозволяє вам створювати складні сорти за допомогою " +"серії кроків сортування. Наприклад, щоб відсортувати дані студента за " +"зменшенням *оцінки*, а потім за зростанням *віку*, спочатку виконайте " +"сортування за *віком*, а потім знову за допомогою *оцінки*:" + +msgid "" +">>> s = sorted(student_objects, key=attrgetter('age')) # sort on " +"secondary key\n" +">>> sorted(s, key=attrgetter('grade'), reverse=True) # now sort on " +"primary key, descending\n" +"[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]" +msgstr "" + +msgid "" +"This can be abstracted out into a wrapper function that can take a list and " +"tuples of field and order to sort them on multiple passes." +msgstr "" +"Це можна абстрагувати у функцію-обгортку, яка може брати список і кортежі " +"полів і впорядковувати їх, щоб сортувати їх за кілька проходів." + +msgid "" +">>> def multisort(xs, specs):\n" +"... for key, reverse in reversed(specs):\n" +"... xs.sort(key=attrgetter(key), reverse=reverse)\n" +"... return xs\n" +"\n" +">>> multisort(list(student_objects), (('grade', True), ('age', False)))\n" +"[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]" +msgstr "" + +msgid "" +"The `Timsort `_ algorithm used in " +"Python does multiple sorts efficiently because it can take advantage of any " +"ordering already present in a dataset." +msgstr "" +"Алгоритм `Timsort `_, що " +"використовується в Python, ефективно виконує багаторазове сортування, " +"оскільки він може використовувати будь-яке впорядкування, яке вже є в наборі " +"даних." + +msgid "Decorate-Sort-Undecorate" +msgstr "" + +msgid "This idiom is called Decorate-Sort-Undecorate after its three steps:" +msgstr "Ця ідіома називається Decorate-Sort-Undecorate після трьох кроків:" + +msgid "" +"First, the initial list is decorated with new values that control the sort " +"order." +msgstr "" +"По-перше, початковий список прикрашається новими значеннями, які контролюють " +"порядок сортування." + +msgid "Second, the decorated list is sorted." +msgstr "По-друге, оформлений список сортується." + +msgid "" +"Finally, the decorations are removed, creating a list that contains only the " +"initial values in the new order." +msgstr "" +"Нарешті, декорації видаляються, створюючи список, який містить лише " +"початкові значення в новому порядку." + +msgid "" +"For example, to sort the student data by *grade* using the DSU approach:" +msgstr "" +"Наприклад, щоб відсортувати дані студента за *класом* за допомогою підходу " +"DSU:" + +msgid "" +">>> decorated = [(student.grade, i, student) for i, student in " +"enumerate(student_objects)]\n" +">>> decorated.sort()\n" +">>> [student for grade, i, student in decorated] # undecorate\n" +"[('john', 'A', 15), ('jane', 'B', 12), ('dave', 'B', 10)]" +msgstr "" + +msgid "" +"This idiom works because tuples are compared lexicographically; the first " +"items are compared; if they are the same then the second items are compared, " +"and so on." +msgstr "" +"Ця ідіома працює, тому що кортежі порівнюються лексикографічно; порівнюються " +"перші предмети; якщо вони однакові, то порівнюються другі елементи і так " +"далі." + +msgid "" +"It is not strictly necessary in all cases to include the index *i* in the " +"decorated list, but including it gives two benefits:" +msgstr "" +"Не обов’язково в усіх випадках включати індекс *i* в оформлений список, але " +"це дає дві переваги:" + +msgid "" +"The sort is stable -- if two items have the same key, their order will be " +"preserved in the sorted list." +msgstr "" +"Сортування є стабільним — якщо два елементи мають однаковий ключ, їхній " +"порядок буде збережено у відсортованому списку." + +msgid "" +"The original items do not have to be comparable because the ordering of the " +"decorated tuples will be determined by at most the first two items. So for " +"example the original list could contain complex numbers which cannot be " +"sorted directly." +msgstr "" +"Оригінальні елементи не обов’язково мають бути порівнянними, тому що порядок " +"оформлених кортежів визначатиметься щонайбільше першими двома елементами. " +"Так, наприклад, вихідний список може містити комплексні числа, які неможливо " +"відсортувати безпосередньо." + +msgid "" +"Another name for this idiom is `Schwartzian transform `_\\, after Randal L. Schwartz, who " +"popularized it among Perl programmers." +msgstr "" +"Інша назва цієї ідіоми — `перетворення Шварца `_\\, на честь Рендала Л. Шварца, який популяризував " +"її серед програмістів на Perl." + +msgid "" +"Now that Python sorting provides key-functions, this technique is not often " +"needed." +msgstr "" +"Тепер, коли сортування Python надає ключові функції, ця техніка не часто " +"потрібна." + +msgid "Comparison Functions" +msgstr "" + +msgid "" +"Unlike key functions that return an absolute value for sorting, a comparison " +"function computes the relative ordering for two inputs." +msgstr "" + +msgid "" +"For example, a `balance scale `_ compares two samples giving a " +"relative ordering: lighter, equal, or heavier. Likewise, a comparison " +"function such as ``cmp(a, b)`` will return a negative value for less-than, " +"zero if the inputs are equal, or a positive value for greater-than." +msgstr "" + +msgid "" +"It is common to encounter comparison functions when translating algorithms " +"from other languages. Also, some libraries provide comparison functions as " +"part of their API. For example, :func:`locale.strcoll` is a comparison " +"function." +msgstr "" + +msgid "" +"To accommodate those situations, Python provides :class:`functools." +"cmp_to_key` to wrap the comparison function to make it usable as a key " +"function::" +msgstr "" + +msgid "sorted(words, key=cmp_to_key(strcoll)) # locale-aware sort order" +msgstr "" + +msgid "Odds and Ends" +msgstr "Обривки" + +msgid "" +"For locale aware sorting, use :func:`locale.strxfrm` for a key function or :" +"func:`locale.strcoll` for a comparison function. This is necessary because " +"\"alphabetical\" sort orderings can vary across cultures even if the " +"underlying alphabet is the same." +msgstr "" + +msgid "" +"The *reverse* parameter still maintains sort stability (so that records with " +"equal keys retain the original order). Interestingly, that effect can be " +"simulated without the parameter by using the builtin :func:`reversed` " +"function twice:" +msgstr "" +"Параметр *reverse* усе ще підтримує стабільність сортування (щоб записи з " +"однаковими ключами зберігали вихідний порядок). Цікаво, що цей ефект можна " +"моделювати без параметра, використовуючи двічі вбудовану функцію :func:" +"`reversed`:" + +msgid "" +">>> data = [('red', 1), ('blue', 1), ('red', 2), ('blue', 2)]\n" +">>> standard_way = sorted(data, key=itemgetter(0), reverse=True)\n" +">>> double_reversed = list(reversed(sorted(reversed(data), " +"key=itemgetter(0))))\n" +">>> assert standard_way == double_reversed\n" +">>> standard_way\n" +"[('red', 1), ('red', 2), ('blue', 1), ('blue', 2)]" +msgstr "" + +msgid "" +"The sort routines use ``<`` when making comparisons between two objects. So, " +"it is easy to add a standard sort order to a class by defining an :meth:" +"`~object.__lt__` method:" +msgstr "" + +msgid "" +">>> Student.__lt__ = lambda self, other: self.age < other.age\n" +">>> sorted(student_objects)\n" +"[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]" +msgstr "" + +msgid "" +"However, note that ``<`` can fall back to using :meth:`~object.__gt__` if :" +"meth:`~object.__lt__` is not implemented (see :func:`object.__lt__` for " +"details on the mechanics). To avoid surprises, :pep:`8` recommends that all " +"six comparison methods be implemented. The :func:`~functools.total_ordering` " +"decorator is provided to make that task easier." +msgstr "" + +msgid "" +"Key functions need not depend directly on the objects being sorted. A key " +"function can also access external resources. For instance, if the student " +"grades are stored in a dictionary, they can be used to sort a separate list " +"of student names:" +msgstr "" +"Ключові функції не повинні безпосередньо залежати від об’єктів, які " +"сортуються. Ключова функція також може отримувати доступ до зовнішніх " +"ресурсів. Наприклад, якщо оцінки студентів зберігаються в словнику, їх можна " +"використовувати для сортування окремого списку імен студентів:" + +msgid "" +">>> students = ['dave', 'john', 'jane']\n" +">>> newgrades = {'john': 'F', 'jane':'A', 'dave': 'C'}\n" +">>> sorted(students, key=newgrades.__getitem__)\n" +"['jane', 'dave', 'john']" +msgstr "" + +msgid "Partial Sorts" +msgstr "" + +msgid "" +"Some applications require only some of the data to be ordered. The standard " +"library provides several tools that do less work than a full sort:" +msgstr "" + +msgid "" +":func:`min` and :func:`max` return the smallest and largest values, " +"respectively. These functions make a single pass over the input data and " +"require almost no auxiliary memory." +msgstr "" + +msgid "" +":func:`heapq.nsmallest` and :func:`heapq.nlargest` return the *n* smallest " +"and largest values, respectively. These functions make a single pass over " +"the data keeping only *n* elements in memory at a time. For values of *n* " +"that are small relative to the number of inputs, these functions make far " +"fewer comparisons than a full sort." +msgstr "" + +msgid "" +":func:`heapq.heappush` and :func:`heapq.heappop` create and maintain a " +"partially sorted arrangement of data that keeps the smallest element at " +"position ``0``. These functions are suitable for implementing priority " +"queues which are commonly used for task scheduling." +msgstr "" diff --git a/howto/timerfd.po b/howto/timerfd.po new file mode 100644 index 000000000..3c06d1b30 --- /dev/null +++ b/howto/timerfd.po @@ -0,0 +1,281 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2024-05-11 01:08+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "timer file descriptor HOWTO" +msgstr "" + +msgid "Release" +msgstr "Реліз" + +msgid "1.13" +msgstr "" + +msgid "" +"This HOWTO discusses Python's support for the linux timer file descriptor." +msgstr "" + +msgid "Examples" +msgstr "Приклади" + +msgid "" +"The following example shows how to use a timer file descriptor to execute a " +"function twice a second:" +msgstr "" + +msgid "" +"# Practical scripts should use really use a non-blocking timer,\n" +"# we use a blocking timer here for simplicity.\n" +"import os, time\n" +"\n" +"# Create the timer file descriptor\n" +"fd = os.timerfd_create(time.CLOCK_REALTIME)\n" +"\n" +"# Start the timer in 1 second, with an interval of half a second\n" +"os.timerfd_settime(fd, initial=1, interval=0.5)\n" +"\n" +"try:\n" +" # Process timer events four times.\n" +" for _ in range(4):\n" +" # read() will block until the timer expires\n" +" _ = os.read(fd, 8)\n" +" print(\"Timer expired\")\n" +"finally:\n" +" # Remember to close the timer file descriptor!\n" +" os.close(fd)" +msgstr "" + +msgid "" +"To avoid the precision loss caused by the :class:`float` type, timer file " +"descriptors allow specifying initial expiration and interval in integer " +"nanoseconds with ``_ns`` variants of the functions." +msgstr "" + +msgid "" +"This example shows how :func:`~select.epoll` can be used with timer file " +"descriptors to wait until the file descriptor is ready for reading:" +msgstr "" + +msgid "" +"import os, time, select, socket, sys\n" +"\n" +"# Create an epoll object\n" +"ep = select.epoll()\n" +"\n" +"# In this example, use loopback address to send \"stop\" command to the " +"server.\n" +"#\n" +"# $ telnet 127.0.0.1 1234\n" +"# Trying 127.0.0.1...\n" +"# Connected to 127.0.0.1.\n" +"# Escape character is '^]'.\n" +"# stop\n" +"# Connection closed by foreign host.\n" +"#\n" +"sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n" +"sock.bind((\"127.0.0.1\", 1234))\n" +"sock.setblocking(False)\n" +"sock.listen(1)\n" +"ep.register(sock, select.EPOLLIN)\n" +"\n" +"# Create timer file descriptors in non-blocking mode.\n" +"num = 3\n" +"fds = []\n" +"for _ in range(num):\n" +" fd = os.timerfd_create(time.CLOCK_REALTIME, flags=os.TFD_NONBLOCK)\n" +" fds.append(fd)\n" +" # Register the timer file descriptor for read events\n" +" ep.register(fd, select.EPOLLIN)\n" +"\n" +"# Start the timer with os.timerfd_settime_ns() in nanoseconds.\n" +"# Timer 1 fires every 0.25 seconds; timer 2 every 0.5 seconds; etc\n" +"for i, fd in enumerate(fds, start=1):\n" +" one_sec_in_nsec = 10**9\n" +" i = i * one_sec_in_nsec\n" +" os.timerfd_settime_ns(fd, initial=i//4, interval=i//4)\n" +"\n" +"timeout = 3\n" +"try:\n" +" conn = None\n" +" is_active = True\n" +" while is_active:\n" +" # Wait for the timer to expire for 3 seconds.\n" +" # epoll.poll() returns a list of (fd, event) pairs.\n" +" # fd is a file descriptor.\n" +" # sock and conn[=returned value of socket.accept()] are socket " +"objects, not file descriptors.\n" +" # So use sock.fileno() and conn.fileno() to get the file " +"descriptors.\n" +" events = ep.poll(timeout)\n" +"\n" +" # If more than one timer file descriptors are ready for reading at " +"once,\n" +" # epoll.poll() returns a list of (fd, event) pairs.\n" +" #\n" +" # In this example settings,\n" +" # 1st timer fires every 0.25 seconds in 0.25 seconds. (0.25, 0.5, " +"0.75, 1.0, ...)\n" +" # 2nd timer every 0.5 seconds in 0.5 seconds. (0.5, 1.0, 1.5, " +"2.0, ...)\n" +" # 3rd timer every 0.75 seconds in 0.75 seconds. (0.75, 1.5, 2.25, " +"3.0, ...)\n" +" #\n" +" # In 0.25 seconds, only 1st timer fires.\n" +" # In 0.5 seconds, 1st timer and 2nd timer fires at once.\n" +" # In 0.75 seconds, 1st timer and 3rd timer fires at once.\n" +" # In 1.5 seconds, 1st timer, 2nd timer and 3rd timer fires at " +"once.\n" +" #\n" +" # If a timer file descriptor is signaled more than once since\n" +" # the last os.read() call, os.read() returns the number of signaled\n" +" # as host order of class bytes.\n" +" print(f\"Signaled events={events}\")\n" +" for fd, event in events:\n" +" if event & select.EPOLLIN:\n" +" if fd == sock.fileno():\n" +" # Check if there is a connection request.\n" +" print(f\"Accepting connection {fd}\")\n" +" conn, addr = sock.accept()\n" +" conn.setblocking(False)\n" +" print(f\"Accepted connection {conn} from {addr}\")\n" +" ep.register(conn, select.EPOLLIN)\n" +" elif conn and fd == conn.fileno():\n" +" # Check if there is data to read.\n" +" print(f\"Reading data {fd}\")\n" +" data = conn.recv(1024)\n" +" if data:\n" +" # You should catch UnicodeDecodeError exception for " +"safety.\n" +" cmd = data.decode()\n" +" if cmd.startswith(\"stop\"):\n" +" print(f\"Stopping server\")\n" +" is_active = False\n" +" else:\n" +" print(f\"Unknown command: {cmd}\")\n" +" else:\n" +" # No more data, close connection\n" +" print(f\"Closing connection {fd}\")\n" +" ep.unregister(conn)\n" +" conn.close()\n" +" conn = None\n" +" elif fd in fds:\n" +" print(f\"Reading timer {fd}\")\n" +" count = int.from_bytes(os.read(fd, 8), byteorder=sys." +"byteorder)\n" +" print(f\"Timer {fds.index(fd) + 1} expired {count} " +"times\")\n" +" else:\n" +" print(f\"Unknown file descriptor {fd}\")\n" +"finally:\n" +" for fd in fds:\n" +" ep.unregister(fd)\n" +" os.close(fd)\n" +" ep.close()" +msgstr "" + +msgid "" +"This example shows how :func:`~select.select` can be used with timer file " +"descriptors to wait until the file descriptor is ready for reading:" +msgstr "" + +msgid "" +"import os, time, select, socket, sys\n" +"\n" +"# In this example, use loopback address to send \"stop\" command to the " +"server.\n" +"#\n" +"# $ telnet 127.0.0.1 1234\n" +"# Trying 127.0.0.1...\n" +"# Connected to 127.0.0.1.\n" +"# Escape character is '^]'.\n" +"# stop\n" +"# Connection closed by foreign host.\n" +"#\n" +"sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n" +"sock.bind((\"127.0.0.1\", 1234))\n" +"sock.setblocking(False)\n" +"sock.listen(1)\n" +"\n" +"# Create timer file descriptors in non-blocking mode.\n" +"num = 3\n" +"fds = [os.timerfd_create(time.CLOCK_REALTIME, flags=os.TFD_NONBLOCK)\n" +" for _ in range(num)]\n" +"select_fds = fds + [sock]\n" +"\n" +"# Start the timers with os.timerfd_settime() in seconds.\n" +"# Timer 1 fires every 0.25 seconds; timer 2 every 0.5 seconds; etc\n" +"for i, fd in enumerate(fds, start=1):\n" +" os.timerfd_settime(fd, initial=i/4, interval=i/4)\n" +"\n" +"timeout = 3\n" +"try:\n" +" conn = None\n" +" is_active = True\n" +" while is_active:\n" +" # Wait for the timer to expire for 3 seconds.\n" +" # select.select() returns a list of file descriptors or objects.\n" +" rfd, wfd, xfd = select.select(select_fds, select_fds, select_fds, " +"timeout)\n" +" for fd in rfd:\n" +" if fd == sock:\n" +" # Check if there is a connection request.\n" +" print(f\"Accepting connection {fd}\")\n" +" conn, addr = sock.accept()\n" +" conn.setblocking(False)\n" +" print(f\"Accepted connection {conn} from {addr}\")\n" +" select_fds.append(conn)\n" +" elif conn and fd == conn:\n" +" # Check if there is data to read.\n" +" print(f\"Reading data {fd}\")\n" +" data = conn.recv(1024)\n" +" if data:\n" +" # You should catch UnicodeDecodeError exception for " +"safety.\n" +" cmd = data.decode()\n" +" if cmd.startswith(\"stop\"):\n" +" print(f\"Stopping server\")\n" +" is_active = False\n" +" else:\n" +" print(f\"Unknown command: {cmd}\")\n" +" else:\n" +" # No more data, close connection\n" +" print(f\"Closing connection {fd}\")\n" +" select_fds.remove(conn)\n" +" conn.close()\n" +" conn = None\n" +" elif fd in fds:\n" +" print(f\"Reading timer {fd}\")\n" +" count = int.from_bytes(os.read(fd, 8), byteorder=sys." +"byteorder)\n" +" print(f\"Timer {fds.index(fd) + 1} expired {count} times\")\n" +" else:\n" +" print(f\"Unknown file descriptor {fd}\")\n" +"finally:\n" +" for fd in fds:\n" +" os.close(fd)\n" +" sock.close()\n" +" sock = None" +msgstr "" diff --git a/howto/unicode.po b/howto/unicode.po new file mode 100644 index 000000000..eb4174ddc --- /dev/null +++ b/howto/unicode.po @@ -0,0 +1,1348 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:53+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Unicode HOWTO" +msgstr "Юнікод HOWTO" + +msgid "Release" +msgstr "Реліз" + +msgid "1.12" +msgstr "1.12" + +msgid "" +"This HOWTO discusses Python's support for the Unicode specification for " +"representing textual data, and explains various problems that people " +"commonly encounter when trying to work with Unicode." +msgstr "" +"Цей HOWTO обговорює підтримку Python специфікації Unicode для представлення " +"текстових даних і пояснює різні проблеми, з якими люди зазвичай стикаються, " +"намагаючись працювати з Unicode." + +msgid "Introduction to Unicode" +msgstr "Знайомство з Unicode" + +msgid "Definitions" +msgstr "визначення" + +msgid "" +"Today's programs need to be able to handle a wide variety of characters. " +"Applications are often internationalized to display messages and output in a " +"variety of user-selectable languages; the same program might need to output " +"an error message in English, French, Japanese, Hebrew, or Russian. Web " +"content can be written in any of these languages and can also include a " +"variety of emoji symbols. Python's string type uses the Unicode Standard for " +"representing characters, which lets Python programs work with all these " +"different possible characters." +msgstr "" +"Сучасні програми повинні вміти працювати з великою різноманітністю символів. " +"Програми часто інтернаціоналізовані для відображення повідомлень і виведення " +"різними мовами, які вибирає користувач; та сама програма може вивести " +"повідомлення про помилку англійською, французькою, японською, івритом або " +"російською. Веб-вміст може бути написаний будь-якою з цих мов, а також може " +"включати різні символи емодзі. Рядковий тип Python використовує стандарт " +"Unicode для представлення символів, що дозволяє програмам Python працювати з " +"усіма цими різними можливими символами." + +msgid "" +"Unicode (https://www.unicode.org/) is a specification that aims to list " +"every character used by human languages and give each character its own " +"unique code. The Unicode specifications are continually revised and updated " +"to add new languages and symbols." +msgstr "" +"Юнікод (https://www.unicode.org/) — це специфікація, метою якої є перелік " +"усіх символів, які використовуються людськими мовами, і надання кожному " +"символу власного унікального коду. Специфікації Unicode постійно " +"переглядаються й оновлюються для додавання нових мов і символів." + +msgid "" +"A **character** is the smallest possible component of a text. 'A', 'B', " +"'C', etc., are all different characters. So are 'È' and 'Í'. Characters " +"vary depending on the language or context you're talking about. For " +"example, there's a character for \"Roman Numeral One\", 'Ⅰ', that's separate " +"from the uppercase letter 'I'. They'll usually look the same, but these are " +"two different characters that have different meanings." +msgstr "" +"**Символ** - це найменша можлива складова тексту. \"A\", \"B\", \"C\" тощо — " +"це різні символи. Так само \"È\" і \"Í\". Символи відрізняються залежно від " +"мови чи контексту, про який ви говорите. Наприклад, для \"римської цифри " +"один\" є символ \"Ⅰ\", який стоїть окремо від великої літери \"I\". Зазвичай " +"вони виглядають однаково, але це два різні символи, які мають різні значення." + +msgid "" +"The Unicode standard describes how characters are represented by **code " +"points**. A code point value is an integer in the range 0 to 0x10FFFF " +"(about 1.1 million values, the `actual number assigned `_ is less than that). In the standard and in " +"this document, a code point is written using the notation ``U+265E`` to mean " +"the character with value ``0x265e`` (9,822 in decimal)." +msgstr "" +"Стандарт Unicode описує, як символи представлені **кодовими точками**. " +"Значення кодової точки є цілим числом у діапазоні від 0 до 0x10FFFF " +"(приблизно 1,1 мільйона значень, `фактичний номер, призначений `_ менше цього). У стандарті та в цьому " +"документі кодова точка записується з використанням позначення ``U+265E``, " +"щоб означати символ зі значенням ``0x265e`` (9822 у десятковому)." + +msgid "" +"The Unicode standard contains a lot of tables listing characters and their " +"corresponding code points:" +msgstr "" +"Стандарт Unicode містить багато таблиць зі списком символів і відповідних їм " +"кодових точок:" + +msgid "" +"0061 'a'; LATIN SMALL LETTER A\n" +"0062 'b'; LATIN SMALL LETTER B\n" +"0063 'c'; LATIN SMALL LETTER C\n" +"...\n" +"007B '{'; LEFT CURLY BRACKET\n" +"...\n" +"2167 'Ⅷ'; ROMAN NUMERAL EIGHT\n" +"2168 'Ⅸ'; ROMAN NUMERAL NINE\n" +"...\n" +"265E '♞'; BLACK CHESS KNIGHT\n" +"265F '♟'; BLACK CHESS PAWN\n" +"...\n" +"1F600 '😀'; GRINNING FACE\n" +"1F609 '😉'; WINKING FACE\n" +"..." +msgstr "" + +msgid "" +"Strictly, these definitions imply that it's meaningless to say 'this is " +"character ``U+265E``'. ``U+265E`` is a code point, which represents some " +"particular character; in this case, it represents the character 'BLACK CHESS " +"KNIGHT', '♞'. In informal contexts, this distinction between code points " +"and characters will sometimes be forgotten." +msgstr "" +"Власне, ці визначення означають, що немає сенсу говорити \"це символ " +"``U+265E``\". ``U+265E`` - це кодова точка, яка представляє певний символ; у " +"цьому випадку він представляє персонаж \"ЧОРНИЙ ШАХОВИЙ ЛИКАР\", \"♞\". У " +"неофіційному контексті ця відмінність між кодовими точками та символами " +"іноді забувається." + +msgid "" +"A character is represented on a screen or on paper by a set of graphical " +"elements that's called a **glyph**. The glyph for an uppercase A, for " +"example, is two diagonal strokes and a horizontal stroke, though the exact " +"details will depend on the font being used. Most Python code doesn't need " +"to worry about glyphs; figuring out the correct glyph to display is " +"generally the job of a GUI toolkit or a terminal's font renderer." +msgstr "" +"Символ представлений на екрані чи папері набором графічних елементів, який " +"називається **гліфом**. Наприклад, гліф для великої літери A складається з " +"двох діагональних штрихів і горизонтального штриха, хоча точні деталі " +"залежатимуть від використовуваного шрифту. Для більшості кодів Python не " +"потрібно турбуватися про гліфи; визначення правильного гліфа для " +"відображення, як правило, є завданням інструментарію графічного інтерфейсу " +"користувача або засобу обробки шрифтів терміналу." + +msgid "Encodings" +msgstr "Кодування" + +msgid "" +"To summarize the previous section: a Unicode string is a sequence of code " +"points, which are numbers from 0 through ``0x10FFFF`` (1,114,111 decimal). " +"This sequence of code points needs to be represented in memory as a set of " +"**code units**, and **code units** are then mapped to 8-bit bytes. The " +"rules for translating a Unicode string into a sequence of bytes are called a " +"**character encoding**, or just an **encoding**." +msgstr "" +"Підсумовуючи попередній розділ: рядок Unicode – це послідовність кодових " +"точок, які є числами від 0 до ``0x10FFFF`` (1 114 111 десяткових). Цю " +"послідовність кодових точок потрібно представити в пам’яті як набір " +"**кодових одиниць**, а **кодові одиниці** потім відображаються на 8-бітні " +"байти. Правила перетворення рядка Unicode у послідовність байтів називаються " +"**кодуванням символів** або просто **кодуванням**." + +msgid "" +"The first encoding you might think of is using 32-bit integers as the code " +"unit, and then using the CPU's representation of 32-bit integers. In this " +"representation, the string \"Python\" might look like this:" +msgstr "" +"Перше кодування, про яке ви можете подумати, це використання 32-розрядних " +"цілих чисел як одиниці коду, а потім використання представлення ЦП 32-" +"розрядних цілих чисел. У цьому представленні рядок \"Python\" може виглядати " +"так:" + +msgid "" +" P y t h o n\n" +"0x50 00 00 00 79 00 00 00 74 00 00 00 68 00 00 00 6f 00 00 00 6e 00 00 00\n" +" 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23" +msgstr "" + +msgid "" +"This representation is straightforward but using it presents a number of " +"problems." +msgstr "Це представлення є простим, але його використання створює ряд проблем." + +msgid "It's not portable; different processors order the bytes differently." +msgstr "Він не портативний; різні процесори впорядковують байти по-різному." + +msgid "" +"It's very wasteful of space. In most texts, the majority of the code points " +"are less than 127, or less than 255, so a lot of space is occupied by " +"``0x00`` bytes. The above string takes 24 bytes compared to the 6 bytes " +"needed for an ASCII representation. Increased RAM usage doesn't matter too " +"much (desktop computers have gigabytes of RAM, and strings aren't usually " +"that large), but expanding our usage of disk and network bandwidth by a " +"factor of 4 is intolerable." +msgstr "" +"Це дуже марнотратно. У більшості текстів більшість кодових точок менше ніж " +"127 або менше ніж 255, тому багато місця займають байти ``0x00``. Наведений " +"вище рядок займає 24 байти порівняно з 6 байтами, необхідними для " +"представлення ASCII. Збільшення використання оперативної пам’яті не має " +"великого значення (настільні комп’ютери мають гігабайти оперативної пам’яті, " +"а рядки зазвичай не такі великі), але розширення використання дискової та " +"мережевої пропускної здатності в 4 рази неприпустимо." + +msgid "" +"It's not compatible with existing C functions such as ``strlen()``, so a new " +"family of wide string functions would need to be used." +msgstr "" +"Вона не сумісна з існуючими функціями C, такими як ``strlen()``, тому " +"потрібно буде використовувати нове сімейство широких рядкових функцій." + +msgid "" +"Therefore this encoding isn't used very much, and people instead choose " +"other encodings that are more efficient and convenient, such as UTF-8." +msgstr "" +"Тому це кодування використовується не дуже часто, і люди натомість обирають " +"інші кодування, які є більш ефективними та зручними, наприклад UTF-8." + +msgid "" +"UTF-8 is one of the most commonly used encodings, and Python often defaults " +"to using it. UTF stands for \"Unicode Transformation Format\", and the '8' " +"means that 8-bit values are used in the encoding. (There are also UTF-16 " +"and UTF-32 encodings, but they are less frequently used than UTF-8.) UTF-8 " +"uses the following rules:" +msgstr "" +"UTF-8 є одним із найпоширеніших кодувань, і Python часто використовує його " +"за замовчуванням. UTF означає \"формат перетворення Юнікоду\", а \"8\" " +"означає, що в кодуванні використовуються 8-бітні значення. (Існують також " +"кодування UTF-16 і UTF-32, але вони використовуються рідше, ніж UTF-8.) " +"UTF-8 використовує такі правила:" + +msgid "" +"If the code point is < 128, it's represented by the corresponding byte value." +msgstr "" +"Якщо кодова точка < 128, вона представлена відповідним значенням байта." + +msgid "" +"If the code point is >= 128, it's turned into a sequence of two, three, or " +"four bytes, where each byte of the sequence is between 128 and 255." +msgstr "" +"Якщо кодова точка >= 128, вона перетворюється на послідовність з двох, трьох " +"або чотирьох байтів, де кожен байт послідовності знаходиться між 128 і 255." + +msgid "UTF-8 has several convenient properties:" +msgstr "UTF-8 має кілька зручних властивостей:" + +msgid "It can handle any Unicode code point." +msgstr "Він може обробляти будь-який код Unicode." + +msgid "" +"A Unicode string is turned into a sequence of bytes that contains embedded " +"zero bytes only where they represent the null character (U+0000). This means " +"that UTF-8 strings can be processed by C functions such as ``strcpy()`` and " +"sent through protocols that can't handle zero bytes for anything other than " +"end-of-string markers." +msgstr "" +"Рядок Unicode перетворюється на послідовність байтів, яка містить вбудовані " +"нульові байти лише там, де вони представляють нульовий символ (U+0000). Це " +"означає, що рядки UTF-8 можуть оброблятися такими функціями C, як " +"``strcpy()`` і надсилатися через протоколи, які не можуть обробляти нульові " +"байти для будь-чого, крім маркерів кінця рядка." + +msgid "A string of ASCII text is also valid UTF-8 text." +msgstr "Рядок тексту ASCII також є дійсним текстом UTF-8." + +msgid "" +"UTF-8 is fairly compact; the majority of commonly used characters can be " +"represented with one or two bytes." +msgstr "" +"UTF-8 є досить компактним; більшість часто використовуваних символів можуть " +"бути представлені одним або двома байтами." + +msgid "" +"If bytes are corrupted or lost, it's possible to determine the start of the " +"next UTF-8-encoded code point and resynchronize. It's also unlikely that " +"random 8-bit data will look like valid UTF-8." +msgstr "" +"Якщо байти пошкоджені або втрачені, можна визначити початок наступної " +"кодової точки кодування UTF-8 і повторно синхронізувати. Також малоймовірно, " +"що випадкові 8-бітні дані виглядатимуть як дійсний UTF-8." + +msgid "" +"UTF-8 is a byte oriented encoding. The encoding specifies that each " +"character is represented by a specific sequence of one or more bytes. This " +"avoids the byte-ordering issues that can occur with integer and word " +"oriented encodings, like UTF-16 and UTF-32, where the sequence of bytes " +"varies depending on the hardware on which the string was encoded." +msgstr "" +"UTF-8 — це байтове кодування. Кодування вказує, що кожен символ " +"представляється певною послідовністю з одного або кількох байтів. Це " +"дозволяє уникнути проблем із упорядкуванням байтів, які можуть виникнути з " +"кодуваннями, орієнтованими на ціле чи слово, наприклад UTF-16 і UTF-32, де " +"послідовність байтів змінюється залежно від апаратного забезпечення, на " +"якому було закодовано рядок." + +msgid "References" +msgstr "Список літератури" + +msgid "" +"The `Unicode Consortium site `_ has character " +"charts, a glossary, and PDF versions of the Unicode specification. Be " +"prepared for some difficult reading. `A chronology `_ of the origin and development of Unicode is also available on " +"the site." +msgstr "" +"На сайті `Unicode Consortium `_ є таблиці символів, " +"глосарій і PDF-версії специфікації Unicode. Будьте готові до важкого " +"читання. `Хронологія `_ походження та " +"розвитку Unicode також доступна на сайті." + +msgid "" +"On the Computerphile Youtube channel, Tom Scott briefly `discusses the " +"history of Unicode and UTF-8 `_ " +"(9 minutes 36 seconds)." +msgstr "" +"На Youtube-каналі Computerphile Том Скотт коротко `обговорює історію Unicode " +"та UTF-8 `_ (9 хвилин 36 " +"секунд)." + +msgid "" +"To help understand the standard, Jukka Korpela has written `an introductory " +"guide `_ to reading the Unicode " +"character tables." +msgstr "" + +msgid "" +"Another `good introductory article `_ was " +"written by Joel Spolsky. If this introduction didn't make things clear to " +"you, you should try reading this alternate article before continuing." +msgstr "" +"Ще одну `хорошу вступну статтю `_ написав Джоел Спольскі. " +"Якщо цей вступ не прояснив вам щось, спробуйте прочитати цю альтернативну " +"статтю, перш ніж продовжити." + +msgid "" +"Wikipedia entries are often helpful; see the entries for \"`character " +"encoding `_\" and `UTF-8 " +"`_, for example." +msgstr "" +"Записи у Вікіпедії часто є корисними; дивіться, наприклад, записи для " +"\"`кодування символів `_\" " +"і `UTF-8 `_." + +msgid "Python's Unicode Support" +msgstr "Підтримка Unicode в Python" + +msgid "" +"Now that you've learned the rudiments of Unicode, we can look at Python's " +"Unicode features." +msgstr "" +"Тепер, коли ви вивчили основи Юнікоду, ми можемо розглянути особливості " +"Юнікоду Python." + +msgid "The String Type" +msgstr "Тип рядка" + +msgid "" +"Since Python 3.0, the language's :class:`str` type contains Unicode " +"characters, meaning any string created using ``\"unicode rocks!\"``, " +"``'unicode rocks!'``, or the triple-quoted string syntax is stored as " +"Unicode." +msgstr "" +"Починаючи з Python 3.0, тип :class:`str` мови містить символи Unicode, тобто " +"будь-який рядок, створений за допомогою ``\"unicode rocks!\"``, ``'unicode " +"rocks!'`` або синтаксис рядка в потрійних лапках зберігається як Unicode." + +msgid "" +"The default encoding for Python source code is UTF-8, so you can simply " +"include a Unicode character in a string literal::" +msgstr "" +"Кодуванням за замовчуванням для вихідного коду Python є UTF-8, тому ви " +"можете просто включити символ Юнікоду в рядковий літерал::" + +msgid "" +"try:\n" +" with open('/tmp/input.txt', 'r') as f:\n" +" ...\n" +"except OSError:\n" +" # 'File not found' error message.\n" +" print(\"Fichier non trouvé\")" +msgstr "" + +msgid "" +"Side note: Python 3 also supports using Unicode characters in identifiers::" +msgstr "" +"Примітка: Python 3 також підтримує використання символів Unicode в " +"ідентифікаторах:" + +msgid "" +"répertoire = \"/tmp/records.log\"\n" +"with open(répertoire, \"w\") as f:\n" +" f.write(\"test\\n\")" +msgstr "" + +msgid "" +"If you can't enter a particular character in your editor or want to keep the " +"source code ASCII-only for some reason, you can also use escape sequences in " +"string literals. (Depending on your system, you may see the actual capital-" +"delta glyph instead of a \\u escape.) ::" +msgstr "" +"Якщо ви не можете ввести певний символ у своєму редакторі або з якоїсь " +"причини хочете зберегти вихідний код лише ASCII, ви також можете використати " +"керуючі послідовності в рядкових літералах. (Залежно від вашої системи, ви " +"можете побачити справжній гліф великої дельти замість символу \\u.) ::" + +msgid "" +">>> \"\\N{GREEK CAPITAL LETTER DELTA}\" # Using the character name\n" +"'\\u0394'\n" +">>> \"\\u0394\" # Using a 16-bit hex value\n" +"'\\u0394'\n" +">>> \"\\U00000394\" # Using a 32-bit hex value\n" +"'\\u0394'" +msgstr "" + +msgid "" +"In addition, one can create a string using the :func:`~bytes.decode` method " +"of :class:`bytes`. This method takes an *encoding* argument, such as " +"``UTF-8``, and optionally an *errors* argument." +msgstr "" +"Крім того, можна створити рядок за допомогою методу :func:`~bytes.decode` :" +"class:`bytes`. Цей метод приймає аргумент *кодування*, такий як ``UTF-8``, і " +"необов’язково аргумент *помилки*." + +msgid "" +"The *errors* argument specifies the response when the input string can't be " +"converted according to the encoding's rules. Legal values for this argument " +"are ``'strict'`` (raise a :exc:`UnicodeDecodeError` exception), " +"``'replace'`` (use ``U+FFFD``, ``REPLACEMENT CHARACTER``), ``'ignore'`` " +"(just leave the character out of the Unicode result), or " +"``'backslashreplace'`` (inserts a ``\\xNN`` escape sequence). The following " +"examples show the differences::" +msgstr "" +"Аргумент *errors* визначає відповідь, коли вхідний рядок не можна " +"перетворити відповідно до правил кодування. Допустимі значення для цього " +"аргументу: ``'strict'`` (викликає виняток :exc:`UnicodeDecodeError`), " +"``'replace`` (використовуйте ``U+FFFD``, ``REPLACEMENT CHARACTER``), " +"``'ignore'`` (просто залиште символ поза результатом Юнікоду) або " +"``'backslashreplace'`` (вставляє керуючу послідовність ``\\xNN``). Наступні " +"приклади показують відмінності:" + +msgid "" +">>> b'\\x80abc'.decode(\"utf-8\", \"strict\")\n" +"Traceback (most recent call last):\n" +" ...\n" +"UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0:\n" +" invalid start byte\n" +">>> b'\\x80abc'.decode(\"utf-8\", \"replace\")\n" +"'\\ufffdabc'\n" +">>> b'\\x80abc'.decode(\"utf-8\", \"backslashreplace\")\n" +"'\\\\x80abc'\n" +">>> b'\\x80abc'.decode(\"utf-8\", \"ignore\")\n" +"'abc'" +msgstr "" + +msgid "" +"Encodings are specified as strings containing the encoding's name. Python " +"comes with roughly 100 different encodings; see the Python Library Reference " +"at :ref:`standard-encodings` for a list. Some encodings have multiple " +"names; for example, ``'latin-1'``, ``'iso_8859_1'`` and ``'8859``' are all " +"synonyms for the same encoding." +msgstr "" +"Кодування вказуються як рядки, що містять назву кодування. Python " +"поставляється з приблизно 100 різними кодуваннями; перегляньте список у " +"Довіднику з бібліотеки Python за адресою :ref:`standard-encodings`. Деякі " +"кодування мають кілька імен; наприклад, \"latin-1\", \"iso_8859_1\" і " +"\"8859\" є синонімами одного кодування." + +msgid "" +"One-character Unicode strings can also be created with the :func:`chr` built-" +"in function, which takes integers and returns a Unicode string of length 1 " +"that contains the corresponding code point. The reverse operation is the " +"built-in :func:`ord` function that takes a one-character Unicode string and " +"returns the code point value::" +msgstr "" +"Односимвольні рядки Unicode також можна створити за допомогою вбудованої " +"функції :func:`chr`, яка приймає цілі числа та повертає рядок Unicode " +"довжиною 1, який містить відповідну кодову точку. Зворотною операцією є " +"вбудована функція :func:`ord`, яка приймає односимвольний рядок Юнікод і " +"повертає значення кодової точки::" + +msgid "" +">>> chr(57344)\n" +"'\\ue000'\n" +">>> ord('\\ue000')\n" +"57344" +msgstr "" + +msgid "Converting to Bytes" +msgstr "Перетворення в байти" + +msgid "" +"The opposite method of :meth:`bytes.decode` is :meth:`str.encode`, which " +"returns a :class:`bytes` representation of the Unicode string, encoded in " +"the requested *encoding*." +msgstr "" +"Протилежним методом :meth:`bytes.decode` є :meth:`str.encode`, який " +"повертає :class:`bytes` представлення рядка Юнікод, закодованого в " +"потрібному *кодуванні*." + +msgid "" +"The *errors* parameter is the same as the parameter of the :meth:`~bytes." +"decode` method but supports a few more possible handlers. As well as " +"``'strict'``, ``'ignore'``, and ``'replace'`` (which in this case inserts a " +"question mark instead of the unencodable character), there is also " +"``'xmlcharrefreplace'`` (inserts an XML character reference), " +"``backslashreplace`` (inserts a ``\\uNNNN`` escape sequence) and " +"``namereplace`` (inserts a ``\\N{...}`` escape sequence)." +msgstr "" +"Параметр *errors* такий самий, як і параметр методу :meth:`~bytes.decode`, " +"але підтримує кілька інших можливих обробників. Крім ``'strict'``, " +"``'ignore'`` і ``'replace'`` (який у цьому випадку вставляє знак питання " +"замість некодованого символу), є також ``'xmlcharrefreplace \"`` (вставляє " +"посилання на символ XML), ``backslashreplace`` (вставляє керуючу " +"послідовність ``\\uNNNN``) і ``namereplace`` (вставляє керуючу послідовність " +"``\\N{...}`` )." + +msgid "The following example shows the different results::" +msgstr "У наступному прикладі показано різні результати:" + +msgid "" +">>> u = chr(40960) + 'abcd' + chr(1972)\n" +">>> u.encode('utf-8')\n" +"b'\\xea\\x80\\x80abcd\\xde\\xb4'\n" +">>> u.encode('ascii')\n" +"Traceback (most recent call last):\n" +" ...\n" +"UnicodeEncodeError: 'ascii' codec can't encode character '\\ua000' in\n" +" position 0: ordinal not in range(128)\n" +">>> u.encode('ascii', 'ignore')\n" +"b'abcd'\n" +">>> u.encode('ascii', 'replace')\n" +"b'?abcd?'\n" +">>> u.encode('ascii', 'xmlcharrefreplace')\n" +"b'ꀀabcd޴'\n" +">>> u.encode('ascii', 'backslashreplace')\n" +"b'\\\\ua000abcd\\\\u07b4'\n" +">>> u.encode('ascii', 'namereplace')\n" +"b'\\\\N{YI SYLLABLE IT}abcd\\\\u07b4'" +msgstr "" + +msgid "" +"The low-level routines for registering and accessing the available encodings " +"are found in the :mod:`codecs` module. Implementing new encodings also " +"requires understanding the :mod:`codecs` module. However, the encoding and " +"decoding functions returned by this module are usually more low-level than " +"is comfortable, and writing new encodings is a specialized task, so the " +"module won't be covered in this HOWTO." +msgstr "" +"Процедури низького рівня для реєстрації та доступу до доступних кодувань " +"можна знайти в модулі :mod:`codecs`. Реалізація нових кодувань також вимагає " +"розуміння модуля :mod:`codecs`. Однак функції кодування та декодування, які " +"повертає цей модуль, зазвичай нижчі, ніж зручно, а написання нових кодувань " +"є спеціальним завданням, тому цей модуль не розглядатиметься в цьому HOWTO." + +msgid "Unicode Literals in Python Source Code" +msgstr "Літерали Unicode у вихідному коді Python" + +msgid "" +"In Python source code, specific Unicode code points can be written using the " +"``\\u`` escape sequence, which is followed by four hex digits giving the " +"code point. The ``\\U`` escape sequence is similar, but expects eight hex " +"digits, not four::" +msgstr "" +"У вихідному коді Python певні кодові точки Unicode можна записати за " +"допомогою escape-послідовності ``\\u``, за якою йдуть чотири шістнадцяткові " +"цифри, що вказують кодову точку. Екран-послідовність ``\\U`` схожа, але " +"передбачає вісім шістнадцяткових цифр, а не чотири:" + +msgid "" +">>> s = \"a\\xac\\u1234\\u20ac\\U00008000\"\n" +"... # ^^^^ two-digit hex escape\n" +"... # ^^^^^^ four-digit Unicode escape\n" +"... # ^^^^^^^^^^ eight-digit Unicode escape\n" +">>> [ord(c) for c in s]\n" +"[97, 172, 4660, 8364, 32768]" +msgstr "" + +msgid "" +"Using escape sequences for code points greater than 127 is fine in small " +"doses, but becomes an annoyance if you're using many accented characters, as " +"you would in a program with messages in French or some other accent-using " +"language. You can also assemble strings using the :func:`chr` built-in " +"function, but this is even more tedious." +msgstr "" +"Використання керуючих послідовностей для кодових точок більше 127 добре в " +"невеликих дозах, але стає неприємним, якщо ви використовуєте багато символів " +"з акцентами, як це було б у програмі з повідомленнями французькою або іншою " +"мовою, що використовує акценти. Ви також можете збирати рядки за допомогою " +"вбудованої функції :func:`chr`, але це ще більше стомлює." + +msgid "" +"Ideally, you'd want to be able to write literals in your language's natural " +"encoding. You could then edit Python source code with your favorite editor " +"which would display the accented characters naturally, and have the right " +"characters used at runtime." +msgstr "" +"В ідеалі ви хотіли б мати можливість писати літерали в природному кодуванні " +"вашої мови. Потім ви можете відредагувати вихідний код Python за допомогою " +"свого улюбленого редактора, який природним чином відображатиме символи з " +"акцентами та використовуватиме правильні символи під час виконання." + +msgid "" +"Python supports writing source code in UTF-8 by default, but you can use " +"almost any encoding if you declare the encoding being used. This is done by " +"including a special comment as either the first or second line of the source " +"file::" +msgstr "" +"Python за замовчуванням підтримує написання вихідного коду в UTF-8, але ви " +"можете використовувати майже будь-яке кодування, якщо ви оголосите " +"кодування, яке використовується. Це робиться шляхом додавання спеціального " +"коментаря як першого або другого рядка вихідного файлу::" + +msgid "" +"#!/usr/bin/env python\n" +"# -*- coding: latin-1 -*-\n" +"\n" +"u = 'abcdé'\n" +"print(ord(u[-1]))" +msgstr "" + +msgid "" +"The syntax is inspired by Emacs's notation for specifying variables local to " +"a file. Emacs supports many different variables, but Python only supports " +"'coding'. The ``-*-`` symbols indicate to Emacs that the comment is " +"special; they have no significance to Python but are a convention. Python " +"looks for ``coding: name`` or ``coding=name`` in the comment." +msgstr "" +"Синтаксис натхненний нотацією Emacs для визначення змінних, локальних для " +"файлу. Emacs підтримує багато різних змінних, але Python підтримує лише " +"\"кодування\". Символи ``-*-`` вказують Emacs, що коментар є особливим; вони " +"не мають значення для Python, але є умовністю. Python шукає ``coding: name`` " +"або ``coding=name`` у коментарі." + +msgid "" +"If you don't include such a comment, the default encoding used will be UTF-8 " +"as already mentioned. See also :pep:`263` for more information." +msgstr "" +"Якщо ви не включите такий коментар, використовуваним кодуванням за " +"умовчанням буде UTF-8, як уже згадувалося. Дивіться також :pep:`263` для " +"отримання додаткової інформації." + +msgid "Unicode Properties" +msgstr "Властивості Unicode" + +msgid "" +"The Unicode specification includes a database of information about code " +"points. For each defined code point, the information includes the " +"character's name, its category, the numeric value if applicable (for " +"characters representing numeric concepts such as the Roman numerals, " +"fractions such as one-third and four-fifths, etc.). There are also display-" +"related properties, such as how to use the code point in bidirectional text." +msgstr "" +"Специфікація Unicode включає базу даних інформації про кодові точки. Для " +"кожної визначеної кодової точки інформація включає ім’я символу, його " +"категорію, числове значення, якщо це застосовно (для символів, що " +"представляють числові поняття, такі як римські цифри, дроби, такі як одна " +"третина та чотири п’ятих тощо). Існують також властивості, пов’язані з " +"відображенням, наприклад, як використовувати кодову точку в двонаправленому " +"тексті." + +msgid "" +"The following program displays some information about several characters, " +"and prints the numeric value of one particular character::" +msgstr "" +"Наступна програма відображає деяку інформацію про кілька символів і друкує " +"числове значення одного конкретного символу:" + +msgid "" +"import unicodedata\n" +"\n" +"u = chr(233) + chr(0x0bf2) + chr(3972) + chr(6000) + chr(13231)\n" +"\n" +"for i, c in enumerate(u):\n" +" print(i, '%04x' % ord(c), unicodedata.category(c), end=\" \")\n" +" print(unicodedata.name(c))\n" +"\n" +"# Get numeric value of second character\n" +"print(unicodedata.numeric(u[1]))" +msgstr "" + +msgid "When run, this prints:" +msgstr "Під час запуску це друкує:" + +msgid "" +"0 00e9 Ll LATIN SMALL LETTER E WITH ACUTE\n" +"1 0bf2 No TAMIL NUMBER ONE THOUSAND\n" +"2 0f84 Mn TIBETAN MARK HALANTA\n" +"3 1770 Lo TAGBANWA LETTER SA\n" +"4 33af So SQUARE RAD OVER S SQUARED\n" +"1000.0" +msgstr "" + +msgid "" +"The category codes are abbreviations describing the nature of the character. " +"These are grouped into categories such as \"Letter\", \"Number\", " +"\"Punctuation\", or \"Symbol\", which in turn are broken up into " +"subcategories. To take the codes from the above output, ``'Ll'`` means " +"'Letter, lowercase', ``'No'`` means \"Number, other\", ``'Mn'`` is \"Mark, " +"nonspacing\", and ``'So'`` is \"Symbol, other\". See `the General Category " +"Values section of the Unicode Character Database documentation `_ for a list of category " +"codes." +msgstr "" +"Коди категорій — це абревіатури, що описують характер персонажа. Вони " +"згруповані в такі категорії, як \"Літера\", \"Цифра\", \"Пунктуація\" або " +"\"Символ\", які, у свою чергу, розбиті на підкатегорії. Щоб взяти коди з " +"наведеного вище виводу, ``'Ll'`` означає 'Літера, нижній регістр', ``'Ні'`` " +"означає \"Число, інше\", ``'Mn'`` це \"Позначка, без пробілів\" , а ``'So'`` " +"це \"Символ, інше\". Перегляньте `розділ Загальні значення категорій " +"документації бази даних символів Unicode `_, щоб отримати список кодів категорій." + +msgid "Comparing Strings" +msgstr "Порівняння рядків" + +msgid "" +"Unicode adds some complication to comparing strings, because the same set of " +"characters can be represented by different sequences of code points. For " +"example, a letter like 'ê' can be represented as a single code point U+00EA, " +"or as U+0065 U+0302, which is the code point for 'e' followed by a code " +"point for 'COMBINING CIRCUMFLEX ACCENT'. These will produce the same output " +"when printed, but one is a string of length 1 and the other is of length 2." +msgstr "" +"Юнікод ускладнює порівняння рядків, тому що той самий набір символів може " +"бути представлений різними послідовностями кодових точок. Наприклад, така " +"літера, як \"ê\", може бути представлена як одна кодова точка U+00EA або як " +"U+0065 U+0302, яка є кодовою точкою для \"e\", за якою йде кодова точка для " +"\"COMBINING CIRCUMFLEX ACCENT\". . Вони створюватимуть той самий результат " +"під час друку, але один буде рядком довжини 1, а інший – довжиною 2." + +msgid "" +"One tool for a case-insensitive comparison is the :meth:`~str.casefold` " +"string method that converts a string to a case-insensitive form following an " +"algorithm described by the Unicode Standard. This algorithm has special " +"handling for characters such as the German letter 'ß' (code point U+00DF), " +"which becomes the pair of lowercase letters 'ss'." +msgstr "" +"Одним із інструментів для порівняння без урахування регістру є метод рядка :" +"meth:`~str.casefold`, який перетворює рядок у форму без урахування регістру " +"відповідно до алгоритму, описаного стандартом Unicode. Цей алгоритм має " +"особливу обробку таких символів, як німецька літера \"ß\" (кодовий знак " +"U+00DF), яка стає парою малих літер \"ss\"." + +msgid "" +">>> street = 'Gürzenichstraße'\n" +">>> street.casefold()\n" +"'gürzenichstrasse'" +msgstr "" + +msgid "" +"A second tool is the :mod:`unicodedata` module's :func:`~unicodedata." +"normalize` function that converts strings to one of several normal forms, " +"where letters followed by a combining character are replaced with single " +"characters. :func:`~unicodedata.normalize` can be used to perform string " +"comparisons that won't falsely report inequality if two strings use " +"combining characters differently:" +msgstr "" + +msgid "" +"import unicodedata\n" +"\n" +"def compare_strs(s1, s2):\n" +" def NFD(s):\n" +" return unicodedata.normalize('NFD', s)\n" +"\n" +" return NFD(s1) == NFD(s2)\n" +"\n" +"single_char = 'ê'\n" +"multiple_chars = '\\N{LATIN SMALL LETTER E}\\N{COMBINING CIRCUMFLEX " +"ACCENT}'\n" +"print('length of first string=', len(single_char))\n" +"print('length of second string=', len(multiple_chars))\n" +"print(compare_strs(single_char, multiple_chars))" +msgstr "" + +msgid "When run, this outputs:" +msgstr "Під час запуску це виводить:" + +msgid "" +"$ python compare-strs.py\n" +"length of first string= 1\n" +"length of second string= 2\n" +"True" +msgstr "" + +msgid "" +"The first argument to the :func:`~unicodedata.normalize` function is a " +"string giving the desired normalization form, which can be one of 'NFC', " +"'NFKC', 'NFD', and 'NFKD'." +msgstr "" +"Першим аргументом функції :func:`~unicodedata.normalize` є рядок, що надає " +"бажану форму нормалізації, яка може бути однією з \"NFC\", \"NFKC\", \"NFD\" " +"і \"NFKD\"." + +msgid "The Unicode Standard also specifies how to do caseless comparisons::" +msgstr "Стандарт Unicode також визначає, як робити порівняння без регістру:" + +msgid "" +"import unicodedata\n" +"\n" +"def compare_caseless(s1, s2):\n" +" def NFD(s):\n" +" return unicodedata.normalize('NFD', s)\n" +"\n" +" return NFD(NFD(s1).casefold()) == NFD(NFD(s2).casefold())\n" +"\n" +"# Example usage\n" +"single_char = 'ê'\n" +"multiple_chars = '\\N{LATIN CAPITAL LETTER E}\\N{COMBINING CIRCUMFLEX " +"ACCENT}'\n" +"\n" +"print(compare_caseless(single_char, multiple_chars))" +msgstr "" + +msgid "" +"This will print ``True``. (Why is :func:`!NFD` invoked twice? Because " +"there are a few characters that make :meth:`~str.casefold` return a non-" +"normalized string, so the result needs to be normalized again. See section " +"3.13 of the Unicode Standard for a discussion and an example.)" +msgstr "" + +msgid "Unicode Regular Expressions" +msgstr "Регулярні вирази Unicode" + +msgid "" +"The regular expressions supported by the :mod:`re` module can be provided " +"either as bytes or strings. Some of the special character sequences such as " +"``\\d`` and ``\\w`` have different meanings depending on whether the pattern " +"is supplied as bytes or a string. For example, ``\\d`` will match the " +"characters ``[0-9]`` in bytes but in strings will match any character that's " +"in the ``'Nd'`` category." +msgstr "" +"Регулярні вирази, які підтримує модуль :mod:`re`, можуть бути надані у " +"вигляді байтів або рядків. Деякі послідовності спеціальних символів, " +"наприклад ``\\d`` і ``\\w``, мають різні значення залежно від того, чи " +"надається шаблон у вигляді байтів чи рядка. Наприклад, ``\\d`` відповідатиме " +"символам ``[0-9]`` у байтах, але в рядках відповідатиме будь-якому символу " +"категорії ``'Nd'``." + +msgid "" +"The string in this example has the number 57 written in both Thai and Arabic " +"numerals::" +msgstr "" +"Рядок у цьому прикладі містить число 57, написане тайськими та арабськими " +"цифрами:" + +msgid "" +"import re\n" +"p = re.compile(r'\\d+')\n" +"\n" +"s = \"Over \\u0e55\\u0e57 57 flavours\"\n" +"m = p.search(s)\n" +"print(repr(m.group()))" +msgstr "" + +msgid "" +"When executed, ``\\d+`` will match the Thai numerals and print them out. If " +"you supply the :const:`re.ASCII` flag to :func:`~re.compile`, ``\\d+`` will " +"match the substring \"57\" instead." +msgstr "" +"Після виконання ``\\d+`` відповідатиме тайським цифрам і виводитиме їх. Якщо " +"ви додасте прапорець :const:`re.ASCII` до :func:`~re.compile`, ``\\d+`` " +"натомість відповідатиме підрядку \"57\"." + +msgid "" +"Similarly, ``\\w`` matches a wide variety of Unicode characters but only " +"``[a-zA-Z0-9_]`` in bytes or if :const:`re.ASCII` is supplied, and ``\\s`` " +"will match either Unicode whitespace characters or ``[ \\t\\n\\r\\f\\v]``." +msgstr "" +"Аналогічно, ``\\w`` відповідає широкому спектру символів Юнікоду, але лише " +"``[a-zA-Z0-9_]`` в байтах або якщо надано :const:`re.ASCII`, і ``\\s`` " +"відповідатиме або пробілам Unicode, або ``[ \\t\\n\\r\\f\\v]``." + +msgid "Some good alternative discussions of Python's Unicode support are:" +msgstr "Деякі хороші альтернативні обговорення підтримки Unicode в Python:" + +msgid "" +"`Processing Text Files in Python 3 `_, by Nick Coghlan." +msgstr "" + +msgid "" +"`Pragmatic Unicode `_, a PyCon " +"2012 presentation by Ned Batchelder." +msgstr "" +"`Pragmatic Unicode `_, " +"презентація PyCon 2012 Неда Батчелдера." + +msgid "" +"The :class:`str` type is described in the Python library reference at :ref:" +"`textseq`." +msgstr "" +"Тип :class:`str` описано в довідці про бібліотеку Python за адресою :ref:" +"`textseq`." + +msgid "The documentation for the :mod:`unicodedata` module." +msgstr "Документація для модуля :mod:`unicodedata`." + +msgid "The documentation for the :mod:`codecs` module." +msgstr "Документація для модуля :mod:`codecs`." + +msgid "" +"Marc-André Lemburg gave `a presentation titled \"Python and Unicode\" (PDF " +"slides) `_ at " +"EuroPython 2002. The slides are an excellent overview of the design of " +"Python 2's Unicode features (where the Unicode string type is called " +"``unicode`` and literals start with ``u``)." +msgstr "" +"Марк-Андре Лембург провів `презентацію під назвою \"Python і Юнікод\" (PDF-" +"слайди) `_ на " +"EuroPython 2002. Слайди є чудовим оглядом дизайну функцій Юнікоду Python 2 " +"(де тип рядка Юнікод називається ``unicode`` і літерали починаються з ``u``)." + +msgid "Reading and Writing Unicode Data" +msgstr "Читання та запис даних Unicode" + +msgid "" +"Once you've written some code that works with Unicode data, the next problem " +"is input/output. How do you get Unicode strings into your program, and how " +"do you convert Unicode into a form suitable for storage or transmission?" +msgstr "" +"Після того, як ви написали код, який працює з даними Unicode, наступною " +"проблемою є введення/виведення. Як отримати рядки Unicode у вашій програмі " +"та як перетворити Unicode у форму, придатну для зберігання чи передачі?" + +msgid "" +"It's possible that you may not need to do anything depending on your input " +"sources and output destinations; you should check whether the libraries used " +"in your application support Unicode natively. XML parsers often return " +"Unicode data, for example. Many relational databases also support Unicode-" +"valued columns and can return Unicode values from an SQL query." +msgstr "" +"Цілком можливо, що вам може не знадобитися нічого робити залежно від ваших " +"джерел введення та призначення виводу; вам слід перевірити, чи бібліотеки, " +"які використовуються у вашій програмі, підтримують Unicode. Синтаксичні " +"аналізатори XML часто повертають, наприклад, дані Unicode. Багато реляційних " +"баз даних також підтримують стовпці зі значеннями Юнікод і можуть повертати " +"значення Юнікод із запиту SQL." + +msgid "" +"Unicode data is usually converted to a particular encoding before it gets " +"written to disk or sent over a socket. It's possible to do all the work " +"yourself: open a file, read an 8-bit bytes object from it, and convert the " +"bytes with ``bytes.decode(encoding)``. However, the manual approach is not " +"recommended." +msgstr "" +"Дані Unicode зазвичай перетворюються в певне кодування перед записом на диск " +"або надсиланням через сокет. Можна виконати всю роботу самостійно: відкрити " +"файл, прочитати з нього 8-бітний об’єкт bytes і перетворити байти за " +"допомогою ``bytes.decode(encoding)``. Однак ручний підхід не рекомендується." + +msgid "" +"One problem is the multi-byte nature of encodings; one Unicode character can " +"be represented by several bytes. If you want to read the file in arbitrary-" +"sized chunks (say, 1024 or 4096 bytes), you need to write error-handling " +"code to catch the case where only part of the bytes encoding a single " +"Unicode character are read at the end of a chunk. One solution would be to " +"read the entire file into memory and then perform the decoding, but that " +"prevents you from working with files that are extremely large; if you need " +"to read a 2 GiB file, you need 2 GiB of RAM. (More, really, since for at " +"least a moment you'd need to have both the encoded string and its Unicode " +"version in memory.)" +msgstr "" +"Однією з проблем є багатобайтова природа кодувань; один символ Unicode може " +"бути представлений кількома байтами. Якщо ви хочете прочитати файл " +"фрагментами довільного розміру (скажімо, 1024 або 4096 байтів), вам потрібно " +"написати код обробки помилок, щоб уловити випадок, коли лише частина байтів, " +"що кодують один символ Unicode, читається в кінці шматок. Одним із рішень " +"було б прочитати весь файл у пам’ять, а потім виконати декодування, але це " +"заважає вам працювати з файлами, які є надзвичайно великими; якщо вам " +"потрібно прочитати файл розміром 2 ГБ, вам знадобиться 2 ГБ оперативної " +"пам’яті. (Насправді більше, оскільки принаймні на мить вам знадобиться мати " +"в пам’яті як закодований рядок, так і його версію Unicode.)" + +msgid "" +"The solution would be to use the low-level decoding interface to catch the " +"case of partial coding sequences. The work of implementing this has already " +"been done for you: the built-in :func:`open` function can return a file-like " +"object that assumes the file's contents are in a specified encoding and " +"accepts Unicode parameters for methods such as :meth:`~io.TextIOBase.read` " +"and :meth:`~io.TextIOBase.write`. This works through :func:`open`\\'s " +"*encoding* and *errors* parameters which are interpreted just like those in :" +"meth:`str.encode` and :meth:`bytes.decode`." +msgstr "" +"Рішення полягало б у використанні інтерфейсу декодування низького рівня для " +"виявлення випадків часткових послідовностей кодування. Роботу над " +"реалізацією цього вже виконано за вас: вбудована функція :func:`open` може " +"повертати файлоподібний об’єкт, який припускає, що вміст файлу знаходиться у " +"вказаному кодуванні та приймає параметри Unicode для таких методів, як :meth:" +"`~io.TextIOBase.read` і :meth:`~io.TextIOBase.write`. Це працює через " +"параметри *encoding* і *errors* :func:`open`\\, які інтерпретуються так " +"само, як ті, що в :meth:`str.encode` і :meth:`bytes.decode`." + +msgid "Reading Unicode from a file is therefore simple::" +msgstr "Тому читання Unicode з файлу просте:" + +msgid "" +"with open('unicode.txt', encoding='utf-8') as f:\n" +" for line in f:\n" +" print(repr(line))" +msgstr "" + +msgid "" +"It's also possible to open files in update mode, allowing both reading and " +"writing::" +msgstr "" +"Також можна відкривати файли в режимі оновлення, дозволяючи як читання, так " +"і запис:" + +msgid "" +"with open('test', encoding='utf-8', mode='w+') as f:\n" +" f.write('\\u4500 blah blah blah\\n')\n" +" f.seek(0)\n" +" print(repr(f.readline()[:1]))" +msgstr "" + +msgid "" +"The Unicode character ``U+FEFF`` is used as a byte-order mark (BOM), and is " +"often written as the first character of a file in order to assist with " +"autodetection of the file's byte ordering. Some encodings, such as UTF-16, " +"expect a BOM to be present at the start of a file; when such an encoding is " +"used, the BOM will be automatically written as the first character and will " +"be silently dropped when the file is read. There are variants of these " +"encodings, such as 'utf-16-le' and 'utf-16-be' for little-endian and big-" +"endian encodings, that specify one particular byte ordering and don't skip " +"the BOM." +msgstr "" +"Символ Unicode ``U+FEFF`` використовується як позначка порядку байтів (BOM) " +"і часто записується як перший символ файлу, щоб допомогти автоматично " +"визначити порядок байтів у файлі. Деякі кодування, такі як UTF-16, очікують " +"наявності BOM на початку файлу; коли використовується таке кодування, " +"специфікація буде автоматично записана як перший символ і буде мовчки " +"відкинута під час читання файлу. Існують варіанти цих кодувань, наприклад " +"\"utf-16-le\" і \"utf-16-be\" для кодувань little-endian і big-endian, які " +"вказують один конкретний порядок байтів і не пропускають BOM." + +msgid "" +"In some areas, it is also convention to use a \"BOM\" at the start of UTF-8 " +"encoded files; the name is misleading since UTF-8 is not byte-order " +"dependent. The mark simply announces that the file is encoded in UTF-8. For " +"reading such files, use the 'utf-8-sig' codec to automatically skip the mark " +"if present." +msgstr "" +"У деяких регіонах також прийнято використовувати \"BOM\" на початку файлів у " +"кодуванні UTF-8; назва вводить в оману, оскільки UTF-8 не залежить від " +"порядку байтів. Позначка просто повідомляє, що файл закодовано в UTF-8. Для " +"читання таких файлів використовуйте кодек \"utf-8-sig\", щоб автоматично " +"пропускати позначку, якщо вона є." + +msgid "Unicode filenames" +msgstr "Імена файлів у кодуванні Unicode" + +msgid "" +"Most of the operating systems in common use today support filenames that " +"contain arbitrary Unicode characters. Usually this is implemented by " +"converting the Unicode string into some encoding that varies depending on " +"the system. Today Python is converging on using UTF-8: Python on MacOS has " +"used UTF-8 for several versions, and Python 3.6 switched to using UTF-8 on " +"Windows as well. On Unix systems, there will only be a :term:`filesystem " +"encoding `. if you've set the " +"``LANG`` or ``LC_CTYPE`` environment variables; if you haven't, the default " +"encoding is again UTF-8." +msgstr "" +"Більшість операційних систем, які сьогодні широко використовуються, " +"підтримують імена файлів, які містять довільні символи Unicode. Зазвичай це " +"реалізується шляхом перетворення рядка Unicode у кодування, яке змінюється " +"залежно від системи. Сьогодні Python наближається до використання UTF-8: " +"Python на MacOS використовував UTF-8 для кількох версій, а Python 3.6 також " +"перейшов на використання UTF-8 у Windows. У системах Unix буде лише :term:" +"`кодування файлової системи `. якщо " +"ви встановили змінні середовища ``LANG`` або ``LC_CTYPE``; якщо ви цього не " +"зробили, стандартним кодуванням знову є UTF-8." + +msgid "" +"The :func:`sys.getfilesystemencoding` function returns the encoding to use " +"on your current system, in case you want to do the encoding manually, but " +"there's not much reason to bother. When opening a file for reading or " +"writing, you can usually just provide the Unicode string as the filename, " +"and it will be automatically converted to the right encoding for you::" +msgstr "" +"Функція :func:`sys.getfilesystemencoding` повертає кодування для " +"використання у вашій поточній системі, якщо ви хочете зробити кодування " +"вручну, але немає особливих причин турбуватися. Відкриваючи файл для читання " +"або запису, ви зазвичай можете просто вказати рядок Юнікод як ім’я файлу, і " +"він буде автоматично перетворений у правильне для вас кодування::" + +msgid "" +"filename = 'filename\\u4500abc'\n" +"with open(filename, 'w') as f:\n" +" f.write('blah\\n')" +msgstr "" + +msgid "" +"Functions in the :mod:`os` module such as :func:`os.stat` will also accept " +"Unicode filenames." +msgstr "" +"Функції в модулі :mod:`os`, такі як :func:`os.stat`, також прийматимуть " +"імена файлів у кодуванні Unicode." + +msgid "" +"The :func:`os.listdir` function returns filenames, which raises an issue: " +"should it return the Unicode version of filenames, or should it return bytes " +"containing the encoded versions? :func:`os.listdir` can do both, depending " +"on whether you provided the directory path as bytes or a Unicode string. If " +"you pass a Unicode string as the path, filenames will be decoded using the " +"filesystem's encoding and a list of Unicode strings will be returned, while " +"passing a byte path will return the filenames as bytes. For example, " +"assuming the default :term:`filesystem encoding ` is UTF-8, running the following program::" +msgstr "" +"Функція :func:`os.listdir` повертає імена файлів, що викликає проблему: чи " +"має вона повертати версію імен файлів у кодуванні Unicode, чи має повертати " +"байти, що містять закодовані версії? :func:`os.listdir` може робити і те, і " +"інше, залежно від того, чи вказали ви шлях до каталогу у байтах чи рядку " +"Unicode. Якщо ви передасте рядок Unicode як шлях, назви файлів буде " +"розшифровано з використанням кодування файлової системи, і буде повернено " +"список рядків Unicode, тоді як передача байтового шляху поверне назви файлів " +"як байти. Наприклад, припустивши, що типовим :term:`кодуванням файлової " +"системи ` є UTF-8, запустіть таку " +"програму::" + +msgid "" +"fn = 'filename\\u4500abc'\n" +"f = open(fn, 'w')\n" +"f.close()\n" +"\n" +"import os\n" +"print(os.listdir(b'.'))\n" +"print(os.listdir('.'))" +msgstr "" + +msgid "will produce the following output:" +msgstr "виведе наступний результат:" + +msgid "" +"$ python listdir-test.py\n" +"[b'filename\\xe4\\x94\\x80abc', ...]\n" +"['filename\\u4500abc', ...]" +msgstr "" + +msgid "" +"The first list contains UTF-8-encoded filenames, and the second list " +"contains the Unicode versions." +msgstr "" +"Перший список містить імена файлів у кодуванні UTF-8, а другий список " +"містить версії Unicode." + +msgid "" +"Note that on most occasions, you should can just stick with using Unicode " +"with these APIs. The bytes APIs should only be used on systems where " +"undecodable file names can be present; that's pretty much only Unix systems " +"now." +msgstr "" +"Зверніть увагу, що в більшості випадків ви можете просто використовувати " +"Unicode з цими API. API байтів слід використовувати лише в системах, де " +"можуть бути присутні імена файлів, що не розшифровуються; зараз це майже " +"лише системи Unix." + +msgid "Tips for Writing Unicode-aware Programs" +msgstr "Поради щодо написання програм, що підтримують Unicode" + +msgid "" +"This section provides some suggestions on writing software that deals with " +"Unicode." +msgstr "" +"У цьому розділі надано деякі поради щодо написання програмного забезпечення, " +"яке працює з Unicode." + +msgid "The most important tip is:" +msgstr "Найважливіша порада:" + +msgid "" +"Software should only work with Unicode strings internally, decoding the " +"input data as soon as possible and encoding the output only at the end." +msgstr "" +"Програмне забезпечення повинно працювати лише з внутрішніми рядками Unicode, " +"декодуючи вхідні дані якнайшвидше та кодуючи вихід лише в кінці." + +msgid "" +"If you attempt to write processing functions that accept both Unicode and " +"byte strings, you will find your program vulnerable to bugs wherever you " +"combine the two different kinds of strings. There is no automatic encoding " +"or decoding: if you do e.g. ``str + bytes``, a :exc:`TypeError` will be " +"raised." +msgstr "" +"Якщо ви спробуєте написати функції обробки, які приймають як Юнікод, так і " +"байтові рядки, ви побачите, що ваша програма вразлива до помилок, коли б ви " +"не поєднували два різних типи рядків. Немає автоматичного кодування або " +"декодування: якщо ви робите, напр. ``str + bytes``, буде викликано :exc:" +"`TypeError`." + +msgid "" +"When using data coming from a web browser or some other untrusted source, a " +"common technique is to check for illegal characters in a string before using " +"the string in a generated command line or storing it in a database. If " +"you're doing this, be careful to check the decoded string, not the encoded " +"bytes data; some encodings may have interesting properties, such as not " +"being bijective or not being fully ASCII-compatible. This is especially " +"true if the input data also specifies the encoding, since the attacker can " +"then choose a clever way to hide malicious text in the encoded bytestream." +msgstr "" +"Під час використання даних, що надходять із веб-браузера чи іншого " +"ненадійного джерела, поширеною технікою є перевірка рядка на недозволені " +"символи перед використанням рядка в створеному командному рядку або " +"збереженням його в базі даних. Якщо ви робите це, будьте обережні, щоб " +"перевірити декодований рядок, а не закодовані дані байтів; деякі кодування " +"можуть мати цікаві властивості, такі як небіективність або неповна ASCII-" +"сумісність. Це особливо вірно, якщо вхідні дані також визначають кодування, " +"оскільки зловмисник може вибрати розумний спосіб приховати шкідливий текст у " +"закодованому байтовому потоці." + +msgid "Converting Between File Encodings" +msgstr "Перетворення між кодуваннями файлів" + +msgid "" +"The :class:`~codecs.StreamRecoder` class can transparently convert between " +"encodings, taking a stream that returns data in encoding #1 and behaving " +"like a stream returning data in encoding #2." +msgstr "" +"Клас :class:`~codecs.StreamRecoder` може прозоро конвертувати між " +"кодуваннями, приймаючи потік, який повертає дані в кодуванні №1, і " +"поводитися як потік, який повертає дані в кодуванні №2." + +msgid "" +"For example, if you have an input file *f* that's in Latin-1, you can wrap " +"it with a :class:`~codecs.StreamRecoder` to return bytes encoded in UTF-8::" +msgstr "" +"Наприклад, якщо у вас є вхідний файл *f*, написаний мовою Latin-1, ви можете " +"обернути його :class:`~codecs.StreamRecoder`, щоб повернути байти, " +"закодовані в UTF-8::" + +msgid "" +"new_f = codecs.StreamRecoder(f,\n" +" # en/decoder: used by read() to encode its results and\n" +" # by write() to decode its input.\n" +" codecs.getencoder('utf-8'), codecs.getdecoder('utf-8'),\n" +"\n" +" # reader/writer: used to read and write to the stream.\n" +" codecs.getreader('latin-1'), codecs.getwriter('latin-1') )" +msgstr "" + +msgid "Files in an Unknown Encoding" +msgstr "Файли в невідомому кодуванні" + +msgid "" +"What can you do if you need to make a change to a file, but don't know the " +"file's encoding? If you know the encoding is ASCII-compatible and only want " +"to examine or modify the ASCII parts, you can open the file with the " +"``surrogateescape`` error handler::" +msgstr "" +"Що робити, якщо вам потрібно внести зміни у файл, але ви не знаєте кодування " +"файлу? Якщо ви знаєте, що кодування сумісне з ASCII, і хочете перевірити або " +"змінити лише частини ASCII, ви можете відкрити файл за допомогою обробника " +"помилок ``surrogateescape``::" + +msgid "" +"with open(fname, 'r', encoding=\"ascii\", errors=\"surrogateescape\") as f:\n" +" data = f.read()\n" +"\n" +"# make changes to the string 'data'\n" +"\n" +"with open(fname + '.new', 'w',\n" +" encoding=\"ascii\", errors=\"surrogateescape\") as f:\n" +" f.write(data)" +msgstr "" + +msgid "" +"The ``surrogateescape`` error handler will decode any non-ASCII bytes as " +"code points in a special range running from U+DC80 to U+DCFF. These code " +"points will then turn back into the same bytes when the ``surrogateescape`` " +"error handler is used to encode the data and write it back out." +msgstr "" +"Обробник помилок ``surrogateescape`` декодує будь-які байти, відмінні від " +"ASCII, як кодові точки в спеціальному діапазоні від U+DC80 до U+DCFF. Потім " +"ці кодові точки знову перетворюються на ті самі байти, коли обробник помилок " +"``surrogateescape`` використовується для кодування даних і їх зворотного " +"запису." + +msgid "" +"One section of `Mastering Python 3 Input/Output `_, a PyCon 2010 talk by David " +"Beazley, discusses text processing and binary data handling." +msgstr "" + +msgid "" +"The `PDF slides for Marc-André Lemburg's presentation \"Writing Unicode-" +"aware Applications in Python\" `_ discuss questions of " +"character encodings as well as how to internationalize and localize an " +"application. These slides cover Python 2.x only." +msgstr "" +"У `PDF-слайдах для презентації Марка-Андре Лембурга \"Написання програм, що " +"підтримують Unicode на Python\" `_ обговорюються питання " +"кодування символів, а також те, як інтернаціоналізувати та локалізувати " +"програму. Ці слайди стосуються лише Python 2.x." + +msgid "" +"`The Guts of Unicode in Python `_ is a PyCon 2013 talk by Benjamin Peterson that " +"discusses the internal Unicode representation in Python 3.3." +msgstr "" + +msgid "Acknowledgements" +msgstr "Подяки" + +msgid "" +"The initial draft of this document was written by Andrew Kuchling. It has " +"since been revised further by Alexander Belopolsky, Georg Brandl, Andrew " +"Kuchling, and Ezio Melotti." +msgstr "" +"Початковий проект цього документа був написаний Ендрю Кухлінгом. Відтоді він " +"був додатково переглянут Олександром Бєлопольським, Георгом Брандлом, Ендрю " +"Кухлінгом та Еціо Мелотті." + +msgid "" +"Thanks to the following people who have noted errors or offered suggestions " +"on this article: Éric Araujo, Nicholas Bastin, Nick Coghlan, Marius " +"Gedminas, Kent Johnson, Ken Krugler, Marc-André Lemburg, Martin von Löwis, " +"Terry J. Reedy, Serhiy Storchaka, Eryk Sun, Chad Whitacre, Graham Wideman." +msgstr "" +"Дякуємо таким людям, які помітили помилки або надали пропозиції щодо цієї " +"статті: Ерік Араухо, Ніколас Бастін, Нік Коглан, Маріус Гедмінас, Кент " +"Джонсон, Кен Круглер, Марк-Андре Лембург, Мартін фон Льовіс, Террі Дж. Ріді, " +"Сергій Сторчака , Ерік Сан, Чад Вітакр, Грем Уайдмен." diff --git a/howto/urllib2.po b/howto/urllib2.po new file mode 100644 index 000000000..3e3f95eb1 --- /dev/null +++ b/howto/urllib2.po @@ -0,0 +1,934 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:53+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "HOWTO Fetch Internet Resources Using The urllib Package" +msgstr "HOWTO Отримати Інтернет-ресурси за допомогою пакета urllib" + +msgid "Author" +msgstr "Автор" + +msgid "`Michael Foord `_" +msgstr "" + +msgid "Introduction" +msgstr "вступ" + +msgid "" +"You may also find useful the following article on fetching web resources " +"with Python:" +msgstr "" +"Вам також може бути корисною наступна стаття про отримання веб-ресурсів за " +"допомогою Python:" + +msgid "" +"`Basic Authentication `_" +msgstr "" + +msgid "A tutorial on *Basic Authentication*, with examples in Python." +msgstr "Посібник із *базової автентифікації* з прикладами на Python." + +msgid "" +"**urllib.request** is a Python module for fetching URLs (Uniform Resource " +"Locators). It offers a very simple interface, in the form of the *urlopen* " +"function. This is capable of fetching URLs using a variety of different " +"protocols. It also offers a slightly more complex interface for handling " +"common situations - like basic authentication, cookies, proxies and so on. " +"These are provided by objects called handlers and openers." +msgstr "" +"**urllib.request** — це модуль Python для отримання URL-адрес (уніфікованих " +"покажчиків ресурсів). Він пропонує дуже простий інтерфейс у формі функції " +"*urlopen*. Це здатне отримувати URL-адреси за допомогою різних протоколів. " +"Він також пропонує дещо складніший інтерфейс для обробки поширених ситуацій, " +"таких як базова автентифікація, файли cookie, проксі тощо. Вони " +"забезпечуються об’єктами, які називаються обробниками та відкривачами." + +msgid "" +"urllib.request supports fetching URLs for many \"URL schemes\" (identified " +"by the string before the ``\":\"`` in URL - for example ``\"ftp\"`` is the " +"URL scheme of ``\"ftp://python.org/\"``) using their associated network " +"protocols (e.g. FTP, HTTP). This tutorial focuses on the most common case, " +"HTTP." +msgstr "" +"urllib.request підтримує отримання URL-адрес для багатьох \"схем URL-адрес\" " +"(визначених рядком перед ``\":\"`` в URL-адресі - наприклад, ``\"ftp\"`` є " +"схемою URL-адреси ``\"ftp:// python.org/\"``), використовуючи відповідні " +"мережеві протоколи (наприклад, FTP, HTTP). Цей підручник присвячено " +"найпоширенішому випадку, HTTP." + +msgid "" +"For straightforward situations *urlopen* is very easy to use. But as soon as " +"you encounter errors or non-trivial cases when opening HTTP URLs, you will " +"need some understanding of the HyperText Transfer Protocol. The most " +"comprehensive and authoritative reference to HTTP is :rfc:`2616`. This is a " +"technical document and not intended to be easy to read. This HOWTO aims to " +"illustrate using *urllib*, with enough detail about HTTP to help you " +"through. It is not intended to replace the :mod:`urllib.request` docs, but " +"is supplementary to them." +msgstr "" +"Для простих ситуацій *urlopen* дуже простий у використанні. Але як тільки ви " +"зіткнетеся з помилками або нетривіальними випадками під час відкриття URL-" +"адрес HTTP, вам знадобиться деяке розуміння протоколу передачі гіпертексту. " +"Найбільш повним і авторитетним посиланням на HTTP є :rfc:`2616`. Це " +"технічний документ, який не призначений для легкого читання. Цей HOWTO має " +"на меті проілюструвати використання *urllib* з достатньою кількістю деталей " +"про HTTP, щоб допомогти вам у цьому. Він не призначений для заміни " +"документів :mod:`urllib.request`, а є доповненням до них." + +msgid "Fetching URLs" +msgstr "Отримання URL-адрес" + +msgid "The simplest way to use urllib.request is as follows::" +msgstr "Найпростіший спосіб використання urllib.request такий:" + +msgid "" +"import urllib.request\n" +"with urllib.request.urlopen('http://python.org/') as response:\n" +" html = response.read()" +msgstr "" + +msgid "" +"If you wish to retrieve a resource via URL and store it in a temporary " +"location, you can do so via the :func:`shutil.copyfileobj` and :func:" +"`tempfile.NamedTemporaryFile` functions::" +msgstr "" +"Якщо ви бажаєте отримати ресурс через URL-адресу та зберегти його у " +"тимчасовому місці, ви можете зробити це за допомогою функцій :func:`shutil." +"copyfileobj` і :func:`tempfile.NamedTemporaryFile`::" + +msgid "" +"import shutil\n" +"import tempfile\n" +"import urllib.request\n" +"\n" +"with urllib.request.urlopen('http://python.org/') as response:\n" +" with tempfile.NamedTemporaryFile(delete=False) as tmp_file:\n" +" shutil.copyfileobj(response, tmp_file)\n" +"\n" +"with open(tmp_file.name) as html:\n" +" pass" +msgstr "" + +msgid "" +"Many uses of urllib will be that simple (note that instead of an 'http:' URL " +"we could have used a URL starting with 'ftp:', 'file:', etc.). However, " +"it's the purpose of this tutorial to explain the more complicated cases, " +"concentrating on HTTP." +msgstr "" +"У багатьох випадках використання urllib буде таким простим (зауважте, що " +"замість URL-адреси \"http:\" ми могли б використовувати URL-адресу, яка " +"починається з \"ftp:\", \"file:\" тощо). Однак мета цього підручника — " +"пояснити складніші випадки, зосереджуючись на HTTP." + +msgid "" +"HTTP is based on requests and responses - the client makes requests and " +"servers send responses. urllib.request mirrors this with a ``Request`` " +"object which represents the HTTP request you are making. In its simplest " +"form you create a Request object that specifies the URL you want to fetch. " +"Calling ``urlopen`` with this Request object returns a response object for " +"the URL requested. This response is a file-like object, which means you can " +"for example call ``.read()`` on the response::" +msgstr "" +"HTTP базується на запитах і відповідях - клієнт робить запити, а сервери " +"надсилають відповіді. urllib.request відображає це за допомогою об’єкта " +"``Request``, який представляє HTTP-запит, який ви робите. У найпростішій " +"формі ви створюєте об’єкт Request, який визначає URL-адресу, яку ви хочете " +"отримати. Виклик ``urlopen`` із цим об’єктом Request повертає об’єкт " +"відповіді для запитуваної URL-адреси. Ця відповідь є файлоподібним об’єктом, " +"що означає, що ви можете, наприклад, викликати ``.read()`` у відповіді::" + +msgid "" +"import urllib.request\n" +"\n" +"req = urllib.request.Request('http://python.org/')\n" +"with urllib.request.urlopen(req) as response:\n" +" the_page = response.read()" +msgstr "" + +msgid "" +"Note that urllib.request makes use of the same Request interface to handle " +"all URL schemes. For example, you can make an FTP request like so::" +msgstr "" +"Зауважте, що urllib.request використовує той самий інтерфейс Request для " +"обробки всіх схем URL-адрес. Наприклад, ви можете зробити FTP-запит так:" + +msgid "req = urllib.request.Request('ftp://example.com/')" +msgstr "" + +msgid "" +"In the case of HTTP, there are two extra things that Request objects allow " +"you to do: First, you can pass data to be sent to the server. Second, you " +"can pass extra information (\"metadata\") *about* the data or about the " +"request itself, to the server - this information is sent as HTTP " +"\"headers\". Let's look at each of these in turn." +msgstr "" +"У випадку HTTP об’єкти Request дозволяють робити дві додаткові речі: по-" +"перше, ви можете передавати дані для надсилання на сервер. По-друге, ви " +"можете передати на сервер додаткову інформацію (\"метадані\") *про* дані або " +"про сам запит — ця інформація надсилається як \"заголовки\" HTTP. Давайте по " +"черзі розглянемо кожен із них." + +msgid "Data" +msgstr "Дані" + +msgid "" +"Sometimes you want to send data to a URL (often the URL will refer to a CGI " +"(Common Gateway Interface) script or other web application). With HTTP, this " +"is often done using what's known as a **POST** request. This is often what " +"your browser does when you submit a HTML form that you filled in on the web. " +"Not all POSTs have to come from forms: you can use a POST to transmit " +"arbitrary data to your own application. In the common case of HTML forms, " +"the data needs to be encoded in a standard way, and then passed to the " +"Request object as the ``data`` argument. The encoding is done using a " +"function from the :mod:`urllib.parse` library. ::" +msgstr "" +"Іноді потрібно надіслати дані за URL-адресою (часто URL-адреса " +"посилатиметься на сценарій CGI (Common Gateway Interface) або іншу веб-" +"програму). За допомогою HTTP це часто робиться за допомогою так званого " +"запиту **POST**. Це часто робить ваш браузер, коли ви надсилаєте форму HTML, " +"яку ви заповнили в Інтернеті. Не всі повідомлення POST мають надходити з " +"форм: ви можете використовувати POST для передачі довільних даних у власну " +"програму. У звичайному випадку форм HTML дані потрібно закодувати " +"стандартним способом, а потім передати в об’єкт Request як аргумент " +"``data``. Кодування виконується за допомогою функції з бібліотеки :mod:" +"`urllib.parse`. ::" + +msgid "" +"import urllib.parse\n" +"import urllib.request\n" +"\n" +"url = 'http://www.someserver.com/cgi-bin/register.cgi'\n" +"values = {'name' : 'Michael Foord',\n" +" 'location' : 'Northampton',\n" +" 'language' : 'Python' }\n" +"\n" +"data = urllib.parse.urlencode(values)\n" +"data = data.encode('ascii') # data should be bytes\n" +"req = urllib.request.Request(url, data)\n" +"with urllib.request.urlopen(req) as response:\n" +" the_page = response.read()" +msgstr "" + +msgid "" +"Note that other encodings are sometimes required (e.g. for file upload from " +"HTML forms - see `HTML Specification, Form Submission `_ for more details)." +msgstr "" +"Зауважте, що іноді потрібні інші кодування (наприклад, для завантаження " +"файлів із форм HTML – див. `Специфікація HTML, Подання форми `_ для отримання додаткової " +"інформації)." + +msgid "" +"If you do not pass the ``data`` argument, urllib uses a **GET** request. One " +"way in which GET and POST requests differ is that POST requests often have " +"\"side-effects\": they change the state of the system in some way (for " +"example by placing an order with the website for a hundredweight of tinned " +"spam to be delivered to your door). Though the HTTP standard makes it clear " +"that POSTs are intended to *always* cause side-effects, and GET requests " +"*never* to cause side-effects, nothing prevents a GET request from having " +"side-effects, nor a POST requests from having no side-effects. Data can also " +"be passed in an HTTP GET request by encoding it in the URL itself." +msgstr "" +"Якщо ви не передаєте аргумент ``data``, urllib використовує запит **GET**. " +"Запити GET і POST відрізняються тим, що запити POST часто мають \"побічні " +"ефекти\": вони певним чином змінюють стан системи (наприклад, розміщуючи на " +"веб-сайті замовлення на доставку сотень консервованого спаму). до ваших " +"дверей). Хоча стандарт HTTP чітко визначає, що POST призначені *завжди* " +"спричиняти побічні ефекти, а запити GET *ніколи* не спричиняти побічних " +"ефектів, ніщо не заважає запитам GET мати побічні ефекти, а запитам POST — " +"не мати побічних ефектів. побічні ефекти. Дані також можна передати в запиті " +"HTTP GET, закодувавши їх у самій URL-адресі." + +msgid "This is done as follows::" +msgstr "Це робиться наступним чином:" + +msgid "" +">>> import urllib.request\n" +">>> import urllib.parse\n" +">>> data = {}\n" +">>> data['name'] = 'Somebody Here'\n" +">>> data['location'] = 'Northampton'\n" +">>> data['language'] = 'Python'\n" +">>> url_values = urllib.parse.urlencode(data)\n" +">>> print(url_values) # The order may differ from below.\n" +"name=Somebody+Here&language=Python&location=Northampton\n" +">>> url = 'http://www.example.com/example.cgi'\n" +">>> full_url = url + '?' + url_values\n" +">>> data = urllib.request.urlopen(full_url)" +msgstr "" + +msgid "" +"Notice that the full URL is created by adding a ``?`` to the URL, followed " +"by the encoded values." +msgstr "" +"Зауважте, що повна URL-адреса створюється шляхом додавання ``?`` до URL-" +"адреси, а потім закодованих значень." + +msgid "Headers" +msgstr "Заголовки" + +msgid "" +"We'll discuss here one particular HTTP header, to illustrate how to add " +"headers to your HTTP request." +msgstr "" +"Ми обговоримо тут один конкретний HTTP-заголовок, щоб проілюструвати, як " +"додати заголовки до вашого HTTP-запиту." + +msgid "" +"Some websites [#]_ dislike being browsed by programs, or send different " +"versions to different browsers [#]_. By default urllib identifies itself as " +"``Python-urllib/x.y`` (where ``x`` and ``y`` are the major and minor version " +"numbers of the Python release, e.g. ``Python-urllib/2.5``), which may " +"confuse the site, or just plain not work. The way a browser identifies " +"itself is through the ``User-Agent`` header [#]_. When you create a Request " +"object you can pass a dictionary of headers in. The following example makes " +"the same request as above, but identifies itself as a version of Internet " +"Explorer [#]_. ::" +msgstr "" +"Деяким веб-сайтам [#]_ не подобається, коли їх переглядають програми, або " +"вони надсилають різні версії в різні браузери [#]_. За замовчуванням urllib " +"ідентифікує себе як ``Python-urllib/x.y`` (де ``x`` і ``y`` — номер основної " +"та другорядної версій випуску Python, наприклад ``Python-urllib/2.5`` ), що " +"може заплутати сайт або просто не працювати. Браузер ідентифікує себе через " +"заголовок ``User-Agent`` [#]_. Коли ви створюєте об’єкт Request, ви можете " +"передати словник заголовків. Наступний приклад робить той самий запит, що й " +"вище, але ідентифікує себе як версію Internet Explorer [#]_. ::" + +msgid "" +"import urllib.parse\n" +"import urllib.request\n" +"\n" +"url = 'http://www.someserver.com/cgi-bin/register.cgi'\n" +"user_agent = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64)'\n" +"values = {'name': 'Michael Foord',\n" +" 'location': 'Northampton',\n" +" 'language': 'Python' }\n" +"headers = {'User-Agent': user_agent}\n" +"\n" +"data = urllib.parse.urlencode(values)\n" +"data = data.encode('ascii')\n" +"req = urllib.request.Request(url, data, headers)\n" +"with urllib.request.urlopen(req) as response:\n" +" the_page = response.read()" +msgstr "" + +msgid "" +"The response also has two useful methods. See the section on `info and " +"geturl`_ which comes after we have a look at what happens when things go " +"wrong." +msgstr "" +"Відповідь також має два корисні методи. Перегляньте розділ про `info та " +"geturl`_, який йде після того, як ми подивимося, що відбувається, коли щось " +"йде не так." + +msgid "Handling Exceptions" +msgstr "Обробка винятків" + +msgid "" +"*urlopen* raises :exc:`~urllib.error.URLError` when it cannot handle a " +"response (though as usual with Python APIs, built-in exceptions such as :exc:" +"`ValueError`, :exc:`TypeError` etc. may also be raised)." +msgstr "" + +msgid "" +":exc:`~urllib.error.HTTPError` is the subclass of :exc:`~urllib.error." +"URLError` raised in the specific case of HTTP URLs." +msgstr "" + +msgid "The exception classes are exported from the :mod:`urllib.error` module." +msgstr "Класи винятків експортуються з модуля :mod:`urllib.error`." + +msgid "URLError" +msgstr "URLError" + +msgid "" +"Often, URLError is raised because there is no network connection (no route " +"to the specified server), or the specified server doesn't exist. In this " +"case, the exception raised will have a 'reason' attribute, which is a tuple " +"containing an error code and a text error message." +msgstr "" +"Часто URLError виникає через відсутність підключення до мережі (немає " +"маршруту до вказаного сервера) або вказаний сервер не існує. У цьому випадку " +"викликаний виняток матиме атрибут \"причина\", який є кортежем, що містить " +"код помилки та текстове повідомлення про помилку." + +msgid "e.g. ::" +msgstr "напр. ::" + +msgid "" +">>> req = urllib.request.Request('http://www.pretend_server.org')\n" +">>> try: urllib.request.urlopen(req)\n" +"... except urllib.error.URLError as e:\n" +"... print(e.reason)\n" +"...\n" +"(4, 'getaddrinfo failed')" +msgstr "" + +msgid "HTTPError" +msgstr "HTTPError" + +msgid "" +"Every HTTP response from the server contains a numeric \"status code\". " +"Sometimes the status code indicates that the server is unable to fulfil the " +"request. The default handlers will handle some of these responses for you " +"(for example, if the response is a \"redirection\" that requests the client " +"fetch the document from a different URL, urllib will handle that for you). " +"For those it can't handle, urlopen will raise an :exc:`~urllib.error." +"HTTPError`. Typical errors include '404' (page not found), '403' (request " +"forbidden), and '401' (authentication required)." +msgstr "" + +msgid "" +"See section 10 of :rfc:`2616` for a reference on all the HTTP error codes." +msgstr "" +"Перегляньте розділ 10 :rfc:`2616` для довідки про всі коди помилок HTTP." + +msgid "" +"The :exc:`~urllib.error.HTTPError` instance raised will have an integer " +"'code' attribute, which corresponds to the error sent by the server." +msgstr "" + +msgid "Error Codes" +msgstr "Коди помилок" + +msgid "" +"Because the default handlers handle redirects (codes in the 300 range), and " +"codes in the 100--299 range indicate success, you will usually only see " +"error codes in the 400--599 range." +msgstr "" +"Оскільки обробники за замовчуванням обробляють переспрямування (коди в " +"діапазоні 300), а коди в діапазоні 100--299 вказують на успіх, зазвичай ви " +"побачите коди помилок лише в діапазоні 400--599." + +msgid "" +":attr:`http.server.BaseHTTPRequestHandler.responses` is a useful dictionary " +"of response codes in that shows all the response codes used by :rfc:`2616`. " +"The dictionary is reproduced here for convenience ::" +msgstr "" +":attr:`http.server.BaseHTTPRequestHandler.responses` — це корисний словник " +"кодів відповідей, який показує всі коди відповідей, які використовує :rfc:" +"`2616`. Для зручності словник наведено тут ::" + +msgid "" +"# Table mapping response codes to messages; entries have the\n" +"# form {code: (shortmessage, longmessage)}.\n" +"responses = {\n" +" 100: ('Continue', 'Request received, please continue'),\n" +" 101: ('Switching Protocols',\n" +" 'Switching to new protocol; obey Upgrade header'),\n" +"\n" +" 200: ('OK', 'Request fulfilled, document follows'),\n" +" 201: ('Created', 'Document created, URL follows'),\n" +" 202: ('Accepted',\n" +" 'Request accepted, processing continues off-line'),\n" +" 203: ('Non-Authoritative Information', 'Request fulfilled from cache'),\n" +" 204: ('No Content', 'Request fulfilled, nothing follows'),\n" +" 205: ('Reset Content', 'Clear input form for further input.'),\n" +" 206: ('Partial Content', 'Partial content follows.'),\n" +"\n" +" 300: ('Multiple Choices',\n" +" 'Object has several resources -- see URI list'),\n" +" 301: ('Moved Permanently', 'Object moved permanently -- see URI list'),\n" +" 302: ('Found', 'Object moved temporarily -- see URI list'),\n" +" 303: ('See Other', 'Object moved -- see Method and URL list'),\n" +" 304: ('Not Modified',\n" +" 'Document has not changed since given time'),\n" +" 305: ('Use Proxy',\n" +" 'You must use proxy specified in Location to access this '\n" +" 'resource.'),\n" +" 307: ('Temporary Redirect',\n" +" 'Object moved temporarily -- see URI list'),\n" +"\n" +" 400: ('Bad Request',\n" +" 'Bad request syntax or unsupported method'),\n" +" 401: ('Unauthorized',\n" +" 'No permission -- see authorization schemes'),\n" +" 402: ('Payment Required',\n" +" 'No payment -- see charging schemes'),\n" +" 403: ('Forbidden',\n" +" 'Request forbidden -- authorization will not help'),\n" +" 404: ('Not Found', 'Nothing matches the given URI'),\n" +" 405: ('Method Not Allowed',\n" +" 'Specified method is invalid for this server.'),\n" +" 406: ('Not Acceptable', 'URI not available in preferred format.'),\n" +" 407: ('Proxy Authentication Required', 'You must authenticate with '\n" +" 'this proxy before proceeding.'),\n" +" 408: ('Request Timeout', 'Request timed out; try again later.'),\n" +" 409: ('Conflict', 'Request conflict.'),\n" +" 410: ('Gone',\n" +" 'URI no longer exists and has been permanently removed.'),\n" +" 411: ('Length Required', 'Client must specify Content-Length.'),\n" +" 412: ('Precondition Failed', 'Precondition in headers is false.'),\n" +" 413: ('Request Entity Too Large', 'Entity is too large.'),\n" +" 414: ('Request-URI Too Long', 'URI is too long.'),\n" +" 415: ('Unsupported Media Type', 'Entity body in unsupported format.'),\n" +" 416: ('Requested Range Not Satisfiable',\n" +" 'Cannot satisfy request range.'),\n" +" 417: ('Expectation Failed',\n" +" 'Expect condition could not be satisfied.'),\n" +"\n" +" 500: ('Internal Server Error', 'Server got itself in trouble'),\n" +" 501: ('Not Implemented',\n" +" 'Server does not support this operation'),\n" +" 502: ('Bad Gateway', 'Invalid responses from another server/proxy.'),\n" +" 503: ('Service Unavailable',\n" +" 'The server cannot process the request due to a high load'),\n" +" 504: ('Gateway Timeout',\n" +" 'The gateway server did not receive a timely response'),\n" +" 505: ('HTTP Version Not Supported', 'Cannot fulfill request.'),\n" +" }" +msgstr "" + +msgid "" +"When an error is raised the server responds by returning an HTTP error code " +"*and* an error page. You can use the :exc:`~urllib.error.HTTPError` instance " +"as a response on the page returned. This means that as well as the code " +"attribute, it also has read, geturl, and info, methods as returned by the " +"``urllib.response`` module::" +msgstr "" + +msgid "" +">>> req = urllib.request.Request('http://www.python.org/fish.html')\n" +">>> try:\n" +"... urllib.request.urlopen(req)\n" +"... except urllib.error.HTTPError as e:\n" +"... print(e.code)\n" +"... print(e.read())\n" +"...\n" +"404\n" +"b'\\n\\n\\nPage Not Found\\n\n" +" ..." +msgstr "" + +msgid "Wrapping it Up" +msgstr "Загортання" + +msgid "" +"So if you want to be prepared for :exc:`~urllib.error.HTTPError` *or* :exc:" +"`~urllib.error.URLError` there are two basic approaches. I prefer the second " +"approach." +msgstr "" + +msgid "Number 1" +msgstr "Номер 1" + +msgid "" +"from urllib.request import Request, urlopen\n" +"from urllib.error import URLError, HTTPError\n" +"req = Request(someurl)\n" +"try:\n" +" response = urlopen(req)\n" +"except HTTPError as e:\n" +" print('The server couldn\\'t fulfill the request.')\n" +" print('Error code: ', e.code)\n" +"except URLError as e:\n" +" print('We failed to reach a server.')\n" +" print('Reason: ', e.reason)\n" +"else:\n" +" # everything is fine" +msgstr "" + +msgid "" +"The ``except HTTPError`` *must* come first, otherwise ``except URLError`` " +"will *also* catch an :exc:`~urllib.error.HTTPError`." +msgstr "" + +msgid "Number 2" +msgstr "Номер 2" + +msgid "" +"from urllib.request import Request, urlopen\n" +"from urllib.error import URLError\n" +"req = Request(someurl)\n" +"try:\n" +" response = urlopen(req)\n" +"except URLError as e:\n" +" if hasattr(e, 'reason'):\n" +" print('We failed to reach a server.')\n" +" print('Reason: ', e.reason)\n" +" elif hasattr(e, 'code'):\n" +" print('The server couldn\\'t fulfill the request.')\n" +" print('Error code: ', e.code)\n" +"else:\n" +" # everything is fine" +msgstr "" + +msgid "info and geturl" +msgstr "інформація та geturl" + +msgid "" +"The response returned by urlopen (or the :exc:`~urllib.error.HTTPError` " +"instance) has two useful methods :meth:`!info` and :meth:`!geturl` and is " +"defined in the module :mod:`urllib.response`." +msgstr "" + +msgid "" +"**geturl** - this returns the real URL of the page fetched. This is useful " +"because ``urlopen`` (or the opener object used) may have followed a " +"redirect. The URL of the page fetched may not be the same as the URL " +"requested." +msgstr "" +"**geturl** - повертає справжню URL-адресу отриманої сторінки. Це корисно, " +"оскільки ``urlopen`` (або використаний об’єкт відкриття) міг слідувати за " +"перенаправленням. URL-адреса отриманої сторінки може не збігатися з " +"запитуваною URL-адресою." + +msgid "" +"**info** - this returns a dictionary-like object that describes the page " +"fetched, particularly the headers sent by the server. It is currently an :" +"class:`http.client.HTTPMessage` instance." +msgstr "" +"**info** - це повертає об’єкт, схожий на словник, який описує отриману " +"сторінку, зокрема заголовки, надіслані сервером. Зараз це екземпляр :class:" +"`http.client.HTTPMessage`." + +msgid "" +"Typical headers include 'Content-length', 'Content-type', and so on. See the " +"`Quick Reference to HTTP Headers `_ for a " +"useful listing of HTTP headers with brief explanations of their meaning and " +"use." +msgstr "" + +msgid "Openers and Handlers" +msgstr "Відкривачки та обробники" + +msgid "" +"When you fetch a URL you use an opener (an instance of the perhaps " +"confusingly named :class:`urllib.request.OpenerDirector`). Normally we have " +"been using the default opener - via ``urlopen`` - but you can create custom " +"openers. Openers use handlers. All the \"heavy lifting\" is done by the " +"handlers. Each handler knows how to open URLs for a particular URL scheme " +"(http, ftp, etc.), or how to handle an aspect of URL opening, for example " +"HTTP redirections or HTTP cookies." +msgstr "" + +msgid "" +"You will want to create openers if you want to fetch URLs with specific " +"handlers installed, for example to get an opener that handles cookies, or to " +"get an opener that does not handle redirections." +msgstr "" +"Ви захочете створити відкривачі, якщо хочете отримати URL-адреси з " +"установленими певними обробниками, наприклад, щоб отримати відкривач, який " +"обробляє файли cookie, або щоб отримати відкривач, який не обробляє " +"переспрямування." + +msgid "" +"To create an opener, instantiate an ``OpenerDirector``, and then call ``." +"add_handler(some_handler_instance)`` repeatedly." +msgstr "" +"Щоб створити відкривач, створіть екземпляр ``OpenerDirector``, а потім " +"кілька разів викличте ``.add_handler(some_handler_instance)``." + +msgid "" +"Alternatively, you can use ``build_opener``, which is a convenience function " +"for creating opener objects with a single function call. ``build_opener`` " +"adds several handlers by default, but provides a quick way to add more and/" +"or override the default handlers." +msgstr "" +"Крім того, ви можете використовувати ``build_opener``, яка є зручною " +"функцією для створення відкриваючих об’єктів за допомогою одного виклику " +"функції. ``build_opener`` додає кілька обробників за замовчуванням, але " +"забезпечує швидкий спосіб додати більше та/або замінити обробники за " +"замовчуванням." + +msgid "" +"Other sorts of handlers you might want to can handle proxies, " +"authentication, and other common but slightly specialised situations." +msgstr "" +"Інші типи обробників, які вам можуть знадобитися, можуть обробляти проксі, " +"автентифікацію та інші типові, але трохи спеціалізовані ситуації." + +msgid "" +"``install_opener`` can be used to make an ``opener`` object the (global) " +"default opener. This means that calls to ``urlopen`` will use the opener you " +"have installed." +msgstr "" +"``install_opener`` можна використовувати, щоб зробити об’єкт ``opener`` " +"(глобальним) відкривачем за замовчуванням. Це означає, що виклики " +"``urlopen`` використовуватимуть встановлений вами відкривач." + +msgid "" +"Opener objects have an ``open`` method, which can be called directly to " +"fetch urls in the same way as the ``urlopen`` function: there's no need to " +"call ``install_opener``, except as a convenience." +msgstr "" +"Об’єкти Opener мають метод ``open``, який можна викликати безпосередньо для " +"отримання URL-адрес так само, як і функцію ``urlopen``: немає необхідності " +"викликати ``install_opener``, окрім як для зручності." + +msgid "Basic Authentication" +msgstr "Базова автентифікація" + +msgid "" +"To illustrate creating and installing a handler we will use the " +"``HTTPBasicAuthHandler``. For a more detailed discussion of this subject -- " +"including an explanation of how Basic Authentication works - see the `Basic " +"Authentication Tutorial `__." +msgstr "" + +msgid "" +"When authentication is required, the server sends a header (as well as the " +"401 error code) requesting authentication. This specifies the " +"authentication scheme and a 'realm'. The header looks like: ``WWW-" +"Authenticate: SCHEME realm=\"REALM\"``." +msgstr "" +"Коли потрібна автентифікація, сервер надсилає заголовок (а також код помилки " +"401) із запитом на автентифікацію. Це визначає схему автентифікації та " +"\"сферу\". Заголовок виглядає так: ``WWW-Authenticate: SCHEME " +"realm=\"REALM\"``." + +msgid "e.g." +msgstr "напр." + +msgid "WWW-Authenticate: Basic realm=\"cPanel Users\"" +msgstr "" + +msgid "" +"The client should then retry the request with the appropriate name and " +"password for the realm included as a header in the request. This is 'basic " +"authentication'. In order to simplify this process we can create an instance " +"of ``HTTPBasicAuthHandler`` and an opener to use this handler." +msgstr "" +"Потім клієнт повинен повторити запит із відповідним іменем і паролем для " +"області, включеними як заголовок запиту. Це \"базова автентифікація\". Щоб " +"спростити цей процес, ми можемо створити екземпляр ``HTTPBasicAuthHandler`` " +"і засіб відкриття для використання цього обробника." + +msgid "" +"The ``HTTPBasicAuthHandler`` uses an object called a password manager to " +"handle the mapping of URLs and realms to passwords and usernames. If you " +"know what the realm is (from the authentication header sent by the server), " +"then you can use a ``HTTPPasswordMgr``. Frequently one doesn't care what the " +"realm is. In that case, it is convenient to use " +"``HTTPPasswordMgrWithDefaultRealm``. This allows you to specify a default " +"username and password for a URL. This will be supplied in the absence of you " +"providing an alternative combination for a specific realm. We indicate this " +"by providing ``None`` as the realm argument to the ``add_password`` method." +msgstr "" +"``HTTPBasicAuthHandler`` використовує об’єкт під назвою менеджер паролів для " +"обробки зіставлення URL-адрес і областей з паролями та іменами користувачів. " +"Якщо ви знаєте, що таке область (із заголовка автентифікації, надісланого " +"сервером), ви можете використовувати ``HTTPPasswordMgr``. Часто байдуже, що " +"таке царство. У такому випадку зручно використовувати " +"``HTTPPasswordMgrWithDefaultRealm``. Це дозволяє вказати ім’я користувача та " +"пароль за умовчанням для URL-адреси. Це буде надано, якщо ви не надасте " +"альтернативну комбінацію для певного царства. Ми вказуємо на це, надаючи " +"``None`` як аргумент області для методу ``add_password``." + +msgid "" +"The top-level URL is the first URL that requires authentication. URLs " +"\"deeper\" than the URL you pass to .add_password() will also match. ::" +msgstr "" +"URL-адреса верхнього рівня – це перша URL-адреса, яка вимагає " +"автентифікації. URL-адреси, \"глибші\" за URL-адресу, яку ви передаєте в ." +"add_password(), також відповідатимуть. ::" + +msgid "" +"# create a password manager\n" +"password_mgr = urllib.request.HTTPPasswordMgrWithDefaultRealm()\n" +"\n" +"# Add the username and password.\n" +"# If we knew the realm, we could use it instead of None.\n" +"top_level_url = \"http://example.com/foo/\"\n" +"password_mgr.add_password(None, top_level_url, username, password)\n" +"\n" +"handler = urllib.request.HTTPBasicAuthHandler(password_mgr)\n" +"\n" +"# create \"opener\" (OpenerDirector instance)\n" +"opener = urllib.request.build_opener(handler)\n" +"\n" +"# use the opener to fetch a URL\n" +"opener.open(a_url)\n" +"\n" +"# Install the opener.\n" +"# Now all calls to urllib.request.urlopen use our opener.\n" +"urllib.request.install_opener(opener)" +msgstr "" + +msgid "" +"In the above example we only supplied our ``HTTPBasicAuthHandler`` to " +"``build_opener``. By default openers have the handlers for normal situations " +"-- ``ProxyHandler`` (if a proxy setting such as an :envvar:`!http_proxy` " +"environment variable is set), ``UnknownHandler``, ``HTTPHandler``, " +"``HTTPDefaultErrorHandler``, ``HTTPRedirectHandler``, ``FTPHandler``, " +"``FileHandler``, ``DataHandler``, ``HTTPErrorProcessor``." +msgstr "" + +msgid "" +"``top_level_url`` is in fact *either* a full URL (including the 'http:' " +"scheme component and the hostname and optionally the port number) e.g. " +"``\"http://example.com/\"`` *or* an \"authority\" (i.e. the hostname, " +"optionally including the port number) e.g. ``\"example.com\"`` or " +"``\"example.com:8080\"`` (the latter example includes a port number). The " +"authority, if present, must NOT contain the \"userinfo\" component - for " +"example ``\"joe:password@example.com\"`` is not correct." +msgstr "" +"``top_level_url`` насправді є *або* повною URL-адресою (включно з " +"компонентом схеми 'http:' та ім'ям хоста та, необов'язково, номером порту), " +"напр. ``\"http://example.com/\"`` *або* \"орган\" (тобто ім’я хоста, " +"необов’язково включаючи номер порту), наприклад. ``\"example.com\"`` або " +"``\"example.com:8080\"`` (останній приклад містить номер порту). " +"Повноваження, якщо вони присутні, НЕ повинні містити компонент \"userinfo\" " +"- наприклад, ``\"joe:password@example.com\"`` є неправильним." + +msgid "Proxies" +msgstr "Проксі" + +msgid "" +"**urllib** will auto-detect your proxy settings and use those. This is " +"through the ``ProxyHandler``, which is part of the normal handler chain when " +"a proxy setting is detected. Normally that's a good thing, but there are " +"occasions when it may not be helpful [#]_. One way to do this is to setup " +"our own ``ProxyHandler``, with no proxies defined. This is done using " +"similar steps to setting up a `Basic Authentication`_ handler: ::" +msgstr "" +"**urllib** автоматично визначить ваші налаштування проксі та використає їх. " +"Це відбувається через ``ProxyHandler``, який є частиною звичайного ланцюжка " +"обробників, коли виявляється налаштування проксі. Зазвичай це добре, але " +"бувають випадки, коли це може бути некорисним [#]_. Один із способів зробити " +"це — налаштувати наш власний ``ProxyHandler`` без визначених проксі. Це " +"робиться за допомогою подібних кроків до налаштування обробника `Basic " +"Authentication`_: ::" + +msgid "" +">>> proxy_support = urllib.request.ProxyHandler({})\n" +">>> opener = urllib.request.build_opener(proxy_support)\n" +">>> urllib.request.install_opener(opener)" +msgstr "" + +msgid "" +"Currently ``urllib.request`` *does not* support fetching of ``https`` " +"locations through a proxy. However, this can be enabled by extending urllib." +"request as shown in the recipe [#]_." +msgstr "" +"Наразі ``urllib.request`` *не* підтримує отримання адрес ``https`` через " +"проксі. Однак це можна ввімкнути, розширивши urllib.request, як показано в " +"рецепті [#]_." + +msgid "" +"``HTTP_PROXY`` will be ignored if a variable ``REQUEST_METHOD`` is set; see " +"the documentation on :func:`~urllib.request.getproxies`." +msgstr "" +"``HTTP_PROXY`` ігноруватиметься, якщо встановлено змінну ``REQUEST_METHOD``; " +"перегляньте документацію на :func:`~urllib.request.getproxies`." + +msgid "Sockets and Layers" +msgstr "Розетки та шари" + +msgid "" +"The Python support for fetching resources from the web is layered. urllib " +"uses the :mod:`http.client` library, which in turn uses the socket library." +msgstr "" +"Підтримка Python для отримання ресурсів з Інтернету є багаторівневою. urllib " +"використовує бібліотеку :mod:`http.client`, яка, у свою чергу, використовує " +"бібліотеку сокетів." + +msgid "" +"As of Python 2.3 you can specify how long a socket should wait for a " +"response before timing out. This can be useful in applications which have to " +"fetch web pages. By default the socket module has *no timeout* and can hang. " +"Currently, the socket timeout is not exposed at the http.client or urllib." +"request levels. However, you can set the default timeout globally for all " +"sockets using ::" +msgstr "" +"Починаючи з Python 2.3, ви можете вказати, як довго сокет повинен чекати " +"відповіді перед закінченням часу очікування. Це може бути корисним у " +"програмах, які мають отримати веб-сторінки. За замовчуванням модуль сокета " +"*не має часу очікування* і може зависати. Наразі час очікування сокета не " +"розкривається на рівнях http.client або urllib.request. Однак ви можете " +"глобально встановити тайм-аут за замовчуванням для всіх сокетів за " +"допомогою ::" + +msgid "" +"import socket\n" +"import urllib.request\n" +"\n" +"# timeout in seconds\n" +"timeout = 10\n" +"socket.setdefaulttimeout(timeout)\n" +"\n" +"# this call to urllib.request.urlopen now uses the default timeout\n" +"# we have set in the socket module\n" +"req = urllib.request.Request('http://www.voidspace.org.uk')\n" +"response = urllib.request.urlopen(req)" +msgstr "" + +msgid "Footnotes" +msgstr "Виноски" + +msgid "This document was reviewed and revised by John Lee." +msgstr "Цей документ переглянув і відредагував Джон Лі." + +msgid "Google for example." +msgstr "Google наприклад." + +msgid "" +"Browser sniffing is a very bad practice for website design - building sites " +"using web standards is much more sensible. Unfortunately a lot of sites " +"still send different versions to different browsers." +msgstr "" +"Перегляд веб-переглядача є дуже поганою практикою для дизайну веб-сайтів - " +"створювати сайти за допомогою веб-стандартів набагато розумніше. На жаль, " +"багато сайтів досі надсилають різні версії в різні браузери." + +msgid "" +"The user agent for MSIE 6 is *'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT " +"5.1; SV1; .NET CLR 1.1.4322)'*" +msgstr "" +"Агентом користувача для MSIE 6 є *\"Mozilla/4.0 (сумісний; MSIE 6.0; Windows " +"NT 5.1; SV1; .NET CLR 1.1.4322)\"*" + +msgid "" +"For details of more HTTP request headers, see `Quick Reference to HTTP " +"Headers`_." +msgstr "" +"Додаткову інформацію про заголовки HTTP-запитів див. у розділі `Короткий " +"довідник із заголовками HTTP`_." + +msgid "" +"In my case I have to use a proxy to access the internet at work. If you " +"attempt to fetch *localhost* URLs through this proxy it blocks them. IE is " +"set to use the proxy, which urllib picks up on. In order to test scripts " +"with a localhost server, I have to prevent urllib from using the proxy." +msgstr "" +"У моєму випадку мені доводиться використовувати проксі для доступу до " +"Інтернету на роботі. Якщо ви намагаєтесь отримати URL-адреси *localhost* " +"через цей проксі, він блокує їх. IE налаштовано на використання проксі, який " +"підбирає urllib. Щоб перевірити сценарії на локальному сервері, я повинен " +"заборонити urllib використовувати проксі." + +msgid "" +"urllib opener for SSL proxy (CONNECT method): `ASPN Cookbook Recipe `_." +msgstr "" diff --git a/installing/index.po b/installing/index.po new file mode 100644 index 000000000..2dc6f835c --- /dev/null +++ b/installing/index.po @@ -0,0 +1,429 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:54+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Installing Python Modules" +msgstr "Встановлення модулів Python" + +msgid "Email" +msgstr "Електронна пошта" + +msgid "distutils-sig@python.org" +msgstr "distutils-sig@python.org" + +msgid "" +"As a popular open source development project, Python has an active " +"supporting community of contributors and users that also make their software " +"available for other Python developers to use under open source license terms." +msgstr "" +"Як популярний проект розробки з відкритим кодом, Python має активну " +"спільноту учасників і користувачів, які також надають своє програмне " +"забезпечення іншим розробникам Python для використання на умовах ліцензії з " +"відкритим кодом." + +msgid "" +"This allows Python users to share and collaborate effectively, benefiting " +"from the solutions others have already created to common (and sometimes even " +"rare!) problems, as well as potentially contributing their own solutions to " +"the common pool." +msgstr "" +"Це дозволяє користувачам Python ефективно ділитися та співпрацювати, " +"отримуючи вигоду від рішень, які інші вже створили для поширених (а іноді " +"навіть рідкісних!) проблем, а також потенційно вносячи власні рішення в " +"загальний пул." + +msgid "" +"This guide covers the installation part of the process. For a guide to " +"creating and sharing your own Python projects, refer to the `Python " +"packaging user guide`_." +msgstr "" + +msgid "" +"For corporate and other institutional users, be aware that many " +"organisations have their own policies around using and contributing to open " +"source software. Please take such policies into account when making use of " +"the distribution and installation tools provided with Python." +msgstr "" +"Для корпоративних та інших інституційних користувачів пам’ятайте, що багато " +"організацій мають власні політики щодо використання програмного забезпечення " +"з відкритим вихідним кодом і надання допомоги в ньому. Будь ласка, візьміть " +"до уваги ці правила під час використання інструментів розповсюдження та " +"встановлення, які надаються разом з Python." + +msgid "Key terms" +msgstr "Ключові терміни" + +msgid "" +"``pip`` is the preferred installer program. Starting with Python 3.4, it is " +"included by default with the Python binary installers." +msgstr "" +"``pip`` є кращою програмою встановлення. Починаючи з Python 3.4, він " +"включено за замовчуванням у бінарні інсталятори Python." + +msgid "" +"A *virtual environment* is a semi-isolated Python environment that allows " +"packages to be installed for use by a particular application, rather than " +"being installed system wide." +msgstr "" +"*Віртуальне середовище* — це напівізольоване середовище Python, яке дозволяє " +"встановлювати пакети для використання певною програмою, а не встановлювати в " +"системі." + +msgid "" +"``venv`` is the standard tool for creating virtual environments, and has " +"been part of Python since Python 3.3. Starting with Python 3.4, it defaults " +"to installing ``pip`` into all created virtual environments." +msgstr "" +"``venv`` є стандартним інструментом для створення віртуальних середовищ і є " +"частиною Python з Python 3.3. Починаючи з Python 3.4, за замовчуванням " +"``pip`` встановлюється в усі створені віртуальні середовища." + +msgid "" +"``virtualenv`` is a third party alternative (and predecessor) to ``venv``. " +"It allows virtual environments to be used on versions of Python prior to " +"3.4, which either don't provide ``venv`` at all, or aren't able to " +"automatically install ``pip`` into created environments." +msgstr "" +"``virtualenv`` є сторонньою альтернативою (і попередником) ``venv``. Він " +"дозволяє використовувати віртуальні середовища у версіях Python до 3.4, які " +"або взагалі не забезпечують ``venv``, або не можуть автоматично " +"встановлювати ``pip`` у створені середовища." + +msgid "" +"The `Python Package Index `__ is a public repository of " +"open source licensed packages made available for use by other Python users." +msgstr "" +"`Python Package Index `__ є загальнодоступним сховищем " +"ліцензованих пакетів з відкритим вихідним кодом, доступним для використання " +"іншими користувачами Python." + +msgid "" +"the `Python Packaging Authority `__ is the group of " +"developers and documentation authors responsible for the maintenance and " +"evolution of the standard packaging tools and the associated metadata and " +"file format standards. They maintain a variety of tools, documentation, and " +"issue trackers on `GitHub `__." +msgstr "" + +msgid "" +"``distutils`` is the original build and distribution system first added to " +"the Python standard library in 1998. While direct use of ``distutils`` is " +"being phased out, it still laid the foundation for the current packaging and " +"distribution infrastructure, and it not only remains part of the standard " +"library, but its name lives on in other ways (such as the name of the " +"mailing list used to coordinate Python packaging standards development)." +msgstr "" +"``distutils`` — це оригінальна система збірки та розповсюдження, яка вперше " +"була додана до стандартної бібліотеки Python у 1998 році. Хоча пряме " +"використання ``distutils`` поступово припиняється, воно все одно заклало " +"основу для поточної інфраструктури пакування та розповсюдження, а також він " +"не тільки залишається частиною стандартної бібліотеки, але й продовжує жити " +"іншим чином (наприклад, назва списку розсилки, який використовується для " +"координації розробки стандартів пакування Python)." + +msgid "" +"The use of ``venv`` is now recommended for creating virtual environments." +msgstr "" +"Тепер для створення віртуальних середовищ рекомендується використовувати " +"``venv``." + +msgid "" +"`Python Packaging User Guide: Creating and using virtual environments " +"`__" +msgstr "" +"`Посібник користувача з пакування Python: Створення та використання " +"віртуальних середовищ `__" + +msgid "Basic usage" +msgstr "Базове використання" + +msgid "" +"The standard packaging tools are all designed to be used from the command " +"line." +msgstr "" +"Усі стандартні інструменти пакування призначені для використання з " +"командного рядка." + +msgid "" +"The following command will install the latest version of a module and its " +"dependencies from the Python Package Index::" +msgstr "" +"Наступна команда встановить останню версію модуля та його залежності з " +"індексу пакетів Python::" + +msgid "python -m pip install SomePackage" +msgstr "" + +msgid "" +"For POSIX users (including macOS and Linux users), the examples in this " +"guide assume the use of a :term:`virtual environment`." +msgstr "" +"Для користувачів POSIX (включаючи користувачів macOS і Linux) приклади в " +"цьому посібнику передбачають використання :term:`virtual environment`." + +msgid "" +"For Windows users, the examples in this guide assume that the option to " +"adjust the system PATH environment variable was selected when installing " +"Python." +msgstr "" +"Для користувачів Windows приклади в цьому посібнику припускають, що під час " +"інсталяції Python було вибрано параметр налаштування системної змінної " +"середовища PATH." + +msgid "" +"It's also possible to specify an exact or minimum version directly on the " +"command line. When using comparator operators such as ``>``, ``<`` or some " +"other special character which get interpreted by shell, the package name and " +"the version should be enclosed within double quotes::" +msgstr "" +"Також можна вказати точну або мінімальну версію безпосередньо в командному " +"рядку. У разі використання таких операторів порівняння, як ``>``, ``<`` або " +"будь-який інший спеціальний символ, який інтерпретується командною " +"оболонкою, назву пакета та версію слід брати в подвійні лапки::" + +msgid "" +"python -m pip install SomePackage==1.0.4 # specific version\n" +"python -m pip install \"SomePackage>=1.0.4\" # minimum version" +msgstr "" + +msgid "" +"Normally, if a suitable module is already installed, attempting to install " +"it again will have no effect. Upgrading existing modules must be requested " +"explicitly::" +msgstr "" +"Зазвичай, якщо відповідний модуль уже встановлено, повторна спроба " +"встановити його не матиме ефекту. Оновлення існуючих модулів має надаватися " +"в явному вигляді:" + +msgid "python -m pip install --upgrade SomePackage" +msgstr "" + +msgid "" +"More information and resources regarding ``pip`` and its capabilities can be " +"found in the `Python Packaging User Guide `__." +msgstr "" +"Більше інформації та ресурсів щодо ``pip`` і його можливостей можна знайти в " +"`Посібнику користувача з пакування Python `__." + +msgid "" +"Creation of virtual environments is done through the :mod:`venv` module. " +"Installing packages into an active virtual environment uses the commands " +"shown above." +msgstr "" +"Створення віртуальних середовищ здійснюється за допомогою модуля :mod:" +"`venv`. Для встановлення пакетів у активне віртуальне середовище " +"використовуються команди, наведені вище." + +msgid "" +"`Python Packaging User Guide: Installing Python Distribution Packages " +"`__" +msgstr "" +"`Посібник користувача з пакування Python: встановлення пакетів " +"розповсюдження Python `__" + +msgid "How do I ...?" +msgstr "Як мені ...?" + +msgid "These are quick answers or links for some common tasks." +msgstr "Це короткі відповіді або посилання для деяких типових завдань." + +msgid "... install ``pip`` in versions of Python prior to Python 3.4?" +msgstr "... встановити ``pip`` у версіях Python до Python 3.4?" + +msgid "" +"Python only started bundling ``pip`` with Python 3.4. For earlier versions, " +"``pip`` needs to be \"bootstrapped\" as described in the Python Packaging " +"User Guide." +msgstr "" +"Python почав об’єднувати ``pip`` лише з Python 3.4. Для попередніх версій " +"``pip`` потрібно \"завантажити\", як описано в посібнику користувача з " +"пакування Python." + +msgid "" +"`Python Packaging User Guide: Requirements for Installing Packages `__" +msgstr "" +"`Посібник користувача з пакування Python: Вимоги до встановлення пакетів " +"`__" + +msgid "... install packages just for the current user?" +msgstr "... встановити пакети лише для поточного користувача?" + +msgid "" +"Passing the ``--user`` option to ``python -m pip install`` will install a " +"package just for the current user, rather than for all users of the system." +msgstr "" +"Передача параметра ``--user`` до ``python -m pip install`` встановить пакет " +"лише для поточного користувача, а не для всіх користувачів системи." + +msgid "... install scientific Python packages?" +msgstr "... встановити наукові пакети Python?" + +msgid "" +"A number of scientific Python packages have complex binary dependencies, and " +"aren't currently easy to install using ``pip`` directly. At this point in " +"time, it will often be easier for users to install these packages by `other " +"means `__ rather than attempting to " +"install them with ``pip``." +msgstr "" +"Кілька наукових пакетів Python мають складні бінарні залежності, і наразі їх " +"непросто встановити безпосередньо за допомогою ``pip``. На даний момент " +"користувачам буде простіше встановити ці пакунки `іншими засобами `__, ніж намагатися встановити їх за допомогою " +"``pip``." + +msgid "" +"`Python Packaging User Guide: Installing Scientific Packages `__" +msgstr "" +"`Посібник користувача з пакування Python: встановлення наукових пакетів " +"`__" + +msgid "... work with multiple versions of Python installed in parallel?" +msgstr "... працювати з кількома версіями Python, встановленими паралельно?" + +msgid "" +"On Linux, macOS, and other POSIX systems, use the versioned Python commands " +"in combination with the ``-m`` switch to run the appropriate copy of " +"``pip``::" +msgstr "" +"У Linux, macOS та інших системах POSIX використовуйте версії команд Python у " +"поєднанні з перемикачем ``-m``, щоб запустити відповідну копію ``pip``::" + +msgid "" +"python2 -m pip install SomePackage # default Python 2\n" +"python2.7 -m pip install SomePackage # specifically Python 2.7\n" +"python3 -m pip install SomePackage # default Python 3\n" +"python3.4 -m pip install SomePackage # specifically Python 3.4" +msgstr "" + +msgid "Appropriately versioned ``pip`` commands may also be available." +msgstr "Також можуть бути доступні команди ``pip`` з відповідними версіями." + +msgid "" +"On Windows, use the ``py`` Python launcher in combination with the ``-m`` " +"switch::" +msgstr "" +"У Windows використовуйте засіб запуску Python ``py`` у поєднанні з " +"перемикачем ``-m``::" + +msgid "" +"py -2 -m pip install SomePackage # default Python 2\n" +"py -2.7 -m pip install SomePackage # specifically Python 2.7\n" +"py -3 -m pip install SomePackage # default Python 3\n" +"py -3.4 -m pip install SomePackage # specifically Python 3.4" +msgstr "" + +msgid "Common installation issues" +msgstr "Поширені проблеми встановлення" + +msgid "Installing into the system Python on Linux" +msgstr "Встановлення в систему Python на Linux" + +msgid "" +"On Linux systems, a Python installation will typically be included as part " +"of the distribution. Installing into this Python installation requires root " +"access to the system, and may interfere with the operation of the system " +"package manager and other components of the system if a component is " +"unexpectedly upgraded using ``pip``." +msgstr "" +"У системах Linux інсталяція Python зазвичай буде включена як частина " +"дистрибутива. Встановлення в цю установку Python вимагає кореневого доступу " +"до системи та може заважати роботі системного менеджера пакунків та інших " +"компонентів системи, якщо компонент неочікувано оновлено за допомогою " +"``pip``." + +msgid "" +"On such systems, it is often better to use a virtual environment or a per-" +"user installation when installing packages with ``pip``." +msgstr "" +"У таких системах часто краще використовувати віртуальне середовище або " +"інсталяцію для кожного користувача під час інсталяції пакетів за допомогою " +"``pip``." + +msgid "Pip not installed" +msgstr "Pip не встановлено" + +msgid "" +"It is possible that ``pip`` does not get installed by default. One potential " +"fix is::" +msgstr "" +"Можливо, ``pip`` не встановлюється за замовчуванням. Одним з потенційних " +"виправлень є:" + +msgid "python -m ensurepip --default-pip" +msgstr "" + +msgid "" +"There are also additional resources for `installing pip. `__" +msgstr "" + +msgid "Installing binary extensions" +msgstr "Встановлення бінарних розширень" + +msgid "" +"Python has typically relied heavily on source based distribution, with end " +"users being expected to compile extension modules from source as part of the " +"installation process." +msgstr "" +"Python, як правило, значною мірою покладається на дистрибутив на основі " +"вихідного коду, причому очікується, що кінцеві користувачі збиратимуть " +"модулі розширення з вихідного коду як частину процесу встановлення." + +msgid "" +"With the introduction of support for the binary ``wheel`` format, and the " +"ability to publish wheels for at least Windows and macOS through the Python " +"Package Index, this problem is expected to diminish over time, as users are " +"more regularly able to install pre-built extensions rather than needing to " +"build them themselves." +msgstr "" +"Із запровадженням підтримки двійкового формату ``wheel`` і можливістю " +"публікувати колеса принаймні для Windows і macOS через індекс пакетів " +"Python, очікується, що ця проблема з часом зменшиться, оскільки користувачі " +"зможуть більш регулярно встановлювати готові розширення, а не створювати їх " +"самостійно." + +msgid "" +"Some of the solutions for installing `scientific software `__ that are not yet available as pre-built ``wheel`` " +"files may also help with obtaining other binary extensions without needing " +"to build them locally." +msgstr "" +"Деякі з рішень для встановлення `наукового програмного забезпечення `__, які ще не доступні у вигляді попередньо " +"зібраних файлів ``wheel``, також можуть допомогти отримати інші двійкові " +"розширення без необхідності створювати їх локально." + +msgid "" +"`Python Packaging User Guide: Binary Extensions `__" +msgstr "" +"`Посібник користувача з пакування Python: двійкові розширення `__" diff --git a/library/__future__.po b/library/__future__.po new file mode 100644 index 000000000..d07bd787a --- /dev/null +++ b/library/__future__.po @@ -0,0 +1,279 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:54+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!__future__` --- Future statement definitions" +msgstr "" + +msgid "**Source code:** :source:`Lib/__future__.py`" +msgstr "**Вихідний код:** :source:`Lib/__future__.py`" + +msgid "" +"Imports of the form ``from __future__ import feature`` are called :ref:" +"`future statements `. These are special-cased by the Python compiler " +"to allow the use of new Python features in modules containing the future " +"statement before the release in which the feature becomes standard." +msgstr "" + +msgid "" +"While these future statements are given additional special meaning by the " +"Python compiler, they are still executed like any other import statement and " +"the :mod:`__future__` exists and is handled by the import system the same " +"way any other Python module would be. This design serves three purposes:" +msgstr "" + +msgid "" +"To avoid confusing existing tools that analyze import statements and expect " +"to find the modules they're importing." +msgstr "" +"Щоб не плутати існуючі інструменти, які аналізують оператори імпорту та " +"очікують знайти модулі, які вони імпортують." + +msgid "" +"To document when incompatible changes were introduced, and when they will be " +"--- or were --- made mandatory. This is a form of executable documentation, " +"and can be inspected programmatically via importing :mod:`__future__` and " +"examining its contents." +msgstr "" +"Щоб задокументувати, коли були внесені несумісні зміни, і коли вони будуть " +"--- або були --- зроблені обов'язковими. Це форма виконуваної документації, " +"яку можна перевірити програмним шляхом, імпортувавши :mod:`__future__` і " +"перевіривши його вміст." + +msgid "" +"To ensure that :ref:`future statements ` run under releases prior to " +"Python 2.1 at least yield runtime exceptions (the import of :mod:" +"`__future__` will fail, because there was no module of that name prior to " +"2.1)." +msgstr "" + +msgid "Module Contents" +msgstr "Зміст модуля" + +msgid "" +"No feature description will ever be deleted from :mod:`__future__`. Since " +"its introduction in Python 2.1 the following features have found their way " +"into the language using this mechanism:" +msgstr "" +"Жоден опис функції ніколи не буде видалено з :mod:`__future__`. З моменту " +"появи в Python 2.1 наступні функції знайшли шлях до мови за допомогою цього " +"механізму:" + +msgid "feature" +msgstr "функція" + +msgid "optional in" +msgstr "факультативно в" + +msgid "mandatory in" +msgstr "обов'язкове в" + +msgid "effect" +msgstr "ефект" + +msgid "nested_scopes" +msgstr "вкладені_області" + +msgid "2.1.0b1" +msgstr "2.1.0b1" + +msgid "2.2" +msgstr "2.2" + +msgid ":pep:`227`: *Statically Nested Scopes*" +msgstr ":pep:`227`: *Статично вкладені області*" + +msgid "generators" +msgstr "генератори" + +msgid "2.2.0a1" +msgstr "2.2.0a1" + +msgid "2.3" +msgstr "2.3" + +msgid ":pep:`255`: *Simple Generators*" +msgstr ":pep:`255`: *Прості генератори*" + +msgid "division" +msgstr "поділ" + +msgid "2.2.0a2" +msgstr "2.2.0a2" + +msgid "3.0" +msgstr "3.0" + +msgid ":pep:`238`: *Changing the Division Operator*" +msgstr ":pep:`238`: *Зміна оператора ділення*" + +msgid "absolute_import" +msgstr "абсолютний_імпорт" + +msgid "2.5.0a1" +msgstr "2.5.0a1" + +msgid ":pep:`328`: *Imports: Multi-Line and Absolute/Relative*" +msgstr ":pep:`328`: *Імпорт: багаторядковий і абсолютний/відносний*" + +msgid "with_statement" +msgstr "with_statement" + +msgid "2.6" +msgstr "2.6" + +msgid ":pep:`343`: *The \"with\" Statement*" +msgstr ":pep:`343`: *Заява \"з\"*" + +msgid "print_function" +msgstr "функція друку" + +msgid "2.6.0a2" +msgstr "2.6.0a2" + +msgid ":pep:`3105`: *Make print a function*" +msgstr ":pep:`3105`: *Зробити функцію друку*" + +msgid "unicode_literals" +msgstr "unicode_literals" + +msgid ":pep:`3112`: *Bytes literals in Python 3000*" +msgstr ":pep:`3112`: *Байтові літерали в Python 3000*" + +msgid "generator_stop" +msgstr "generator_stop" + +msgid "3.5.0b1" +msgstr "3.5.0b1" + +msgid "3.7" +msgstr "3.7" + +msgid ":pep:`479`: *StopIteration handling inside generators*" +msgstr ":pep:`479`: *Обробка StopIteration всередині генераторів*" + +msgid "annotations" +msgstr "анотації" + +msgid "3.7.0b1" +msgstr "3.7.0b1" + +msgid "TBD [1]_" +msgstr "Уточнюється [1]_" + +msgid ":pep:`563`: *Postponed evaluation of annotations*" +msgstr ":pep:`563`: *Відкладена оцінка анотацій*" + +msgid "Each statement in :file:`__future__.py` is of the form::" +msgstr "Кожен оператор у :file:`__future__.py` має форму::" + +msgid "" +"FeatureName = _Feature(OptionalRelease, MandatoryRelease,\n" +" CompilerFlag)" +msgstr "" + +msgid "" +"where, normally, *OptionalRelease* is less than *MandatoryRelease*, and both " +"are 5-tuples of the same form as :data:`sys.version_info`::" +msgstr "" +"де, як правило, *OptionalRelease* менше ніж *MandatoryRelease*, і обидва є 5-" +"кортежами тієї самої форми, що й :data:`sys.version_info`::" + +msgid "" +"(PY_MAJOR_VERSION, # the 2 in 2.1.0a3; an int\n" +" PY_MINOR_VERSION, # the 1; an int\n" +" PY_MICRO_VERSION, # the 0; an int\n" +" PY_RELEASE_LEVEL, # \"alpha\", \"beta\", \"candidate\" or \"final\"; " +"string\n" +" PY_RELEASE_SERIAL # the 3; an int\n" +")" +msgstr "" + +msgid "" +"*OptionalRelease* records the first release in which the feature was " +"accepted." +msgstr "" +"*OptionalRelease* записує перший випуск, у якому цю функцію було прийнято." + +msgid "" +"In the case of a *MandatoryRelease* that has not yet occurred, " +"*MandatoryRelease* predicts the release in which the feature will become " +"part of the language." +msgstr "" +"У випадку *MandatoryRelease*, який ще не відбувся, *MandatoryRelease* " +"передбачає випуск, у якому ця функція стане частиною мови." + +msgid "" +"Else *MandatoryRelease* records when the feature became part of the " +"language; in releases at or after that, modules no longer need a future " +"statement to use the feature in question, but may continue to use such " +"imports." +msgstr "" +"Інакше *MandatoryRelease* записує, коли функція стала частиною мови; у " +"випусках на цьому або після цього модулям більше не потрібен майбутній " +"оператор для використання відповідної функції, але вони можуть продовжувати " +"використовувати такий імпорт." + +msgid "" +"*MandatoryRelease* may also be ``None``, meaning that a planned feature got " +"dropped or that it is not yet decided." +msgstr "" + +msgid "" +"*CompilerFlag* is the (bitfield) flag that should be passed in the fourth " +"argument to the built-in function :func:`compile` to enable the feature in " +"dynamically compiled code. This flag is stored in the :attr:`_Feature." +"compiler_flag` attribute on :class:`_Feature` instances." +msgstr "" + +msgid "" +"``from __future__ import annotations`` was previously scheduled to become " +"mandatory in Python 3.10, but the Python Steering Council twice decided to " +"delay the change (`announcement for Python 3.10 `__; `announcement for Python 3.11 `__). No " +"final decision has been made yet. See also :pep:`563` and :pep:`649`." +msgstr "" +"``from __future__ import annotations`` раніше було заплановано, щоб стати " +"обов’язковим у Python 3.10, але Керівна рада Python двічі вирішила відкласти " +"цю зміну (`оголошення для Python 3.10 `__; " +"`оголошення для Python 3.11 `__). Остаточне " +"рішення ще не прийнято. Дивіться також :pep:`563` і :pep:`649`." + +msgid ":ref:`future`" +msgstr ":ref:`future`" + +msgid "How the compiler treats future imports." +msgstr "Як компілятор обробляє майбутні імпорти." + +msgid ":pep:`236` - Back to the __future__" +msgstr ":pep:`236` - Назад у __future__" + +msgid "The original proposal for the __future__ mechanism." +msgstr "Оригінальна пропозиція щодо механізму __future__." diff --git a/library/__main__.po b/library/__main__.po new file mode 100644 index 000000000..a5dd3ba2f --- /dev/null +++ b/library/__main__.po @@ -0,0 +1,585 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:54+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!__main__` --- Top-level code environment" +msgstr "" + +msgid "" +"In Python, the special name ``__main__`` is used for two important " +"constructs:" +msgstr "" +"У Python спеціальна назва ``__main__`` використовується для двох важливих " +"конструкцій:" + +msgid "" +"the name of the top-level environment of the program, which can be checked " +"using the ``__name__ == '__main__'`` expression; and" +msgstr "" +"ім'я середовища верхнього рівня програми, яке можна перевірити за допомогою " +"виразу ``__name__ == '__main__'``; і" + +msgid "the ``__main__.py`` file in Python packages." +msgstr "файл ``__main__.py`` в пакетах Python." + +msgid "" +"Both of these mechanisms are related to Python modules; how users interact " +"with them and how they interact with each other. They are explained in " +"detail below. If you're new to Python modules, see the tutorial section :" +"ref:`tut-modules` for an introduction." +msgstr "" +"Обидва ці механізми пов’язані з модулями Python; як користувачі взаємодіють " +"з ними та як вони взаємодіють один з одним. Вони детально пояснюються нижче. " +"Якщо ви новачок у роботі з модулями Python, ознайомтеся з розділом " +"посібника :ref:`tut-modules`." + +msgid "``__name__ == '__main__'``" +msgstr "``__name__ == '__main__''``" + +msgid "" +"When a Python module or package is imported, ``__name__`` is set to the " +"module's name. Usually, this is the name of the Python file itself without " +"the ``.py`` extension::" +msgstr "" +"Коли імпортується модуль або пакет Python, ``__name__`` встановлюється на " +"ім’я модуля. Зазвичай це назва самого файлу Python без розширення ``.py``::" + +msgid "" +">>> import configparser\n" +">>> configparser.__name__\n" +"'configparser'" +msgstr "" + +msgid "" +"If the file is part of a package, ``__name__`` will also include the parent " +"package's path::" +msgstr "" +"Якщо файл є частиною пакета, ``__name__`` також включатиме шлях до " +"батьківського пакета::" + +msgid "" +">>> from concurrent.futures import process\n" +">>> process.__name__\n" +"'concurrent.futures.process'" +msgstr "" + +msgid "" +"However, if the module is executed in the top-level code environment, its " +"``__name__`` is set to the string ``'__main__'``." +msgstr "" +"Однак, якщо модуль виконується в кодовому середовищі верхнього рівня, його " +"``__name__`` встановлюється на рядок ``'__main__'``." + +msgid "What is the \"top-level code environment\"?" +msgstr "Що таке \"середовище коду верхнього рівня\"?" + +msgid "" +"``__main__`` is the name of the environment where top-level code is run. " +"\"Top-level code\" is the first user-specified Python module that starts " +"running. It's \"top-level\" because it imports all other modules that the " +"program needs. Sometimes \"top-level code\" is called an *entry point* to " +"the application." +msgstr "" +"``__main__`` — це назва середовища, де виконується код верхнього рівня. " +"\"Код верхнього рівня\" — це перший зазначений користувачем модуль Python, " +"який запускається. Це \"верхній рівень\", тому що він імпортує всі інші " +"модулі, які потрібні програмі. Іноді \"код верхнього рівня\" називають " +"*точкою входу* до програми." + +msgid "The top-level code environment can be:" +msgstr "Кодове середовище верхнього рівня може бути:" + +msgid "the scope of an interactive prompt::" +msgstr "область дії інтерактивної підказки:" + +msgid "" +">>> __name__\n" +"'__main__'" +msgstr "" + +msgid "the Python module passed to the Python interpreter as a file argument:" +msgstr "модуль Python передається інтерпретатору Python як аргумент файлу:" + +msgid "" +"$ python helloworld.py\n" +"Hello, world!" +msgstr "" + +msgid "" +"the Python module or package passed to the Python interpreter with the :" +"option:`-m` argument:" +msgstr "" +"модуль або пакет Python передається інтерпретатору Python з аргументом :" +"option:`-m`:" + +msgid "" +"$ python -m tarfile\n" +"usage: tarfile.py [-h] [-v] (...)" +msgstr "" + +msgid "Python code read by the Python interpreter from standard input:" +msgstr "" +"Код Python, який читається інтерпретатором Python зі стандартного введення:" + +msgid "" +"$ echo \"import this\" | python\n" +"The Zen of Python, by Tim Peters\n" +"\n" +"Beautiful is better than ugly.\n" +"Explicit is better than implicit.\n" +"..." +msgstr "" + +msgid "" +"Python code passed to the Python interpreter with the :option:`-c` argument:" +msgstr "" +"Код Python передається інтерпретатору Python з аргументом :option:`-c`:" + +msgid "" +"$ python -c \"import this\"\n" +"The Zen of Python, by Tim Peters\n" +"\n" +"Beautiful is better than ugly.\n" +"Explicit is better than implicit.\n" +"..." +msgstr "" + +msgid "" +"In each of these situations, the top-level module's ``__name__`` is set to " +"``'__main__'``." +msgstr "" +"У кожній із цих ситуацій ``__name__`` модуля верхнього рівня встановлено на " +"``'__main__'``." + +msgid "" +"As a result, a module can discover whether or not it is running in the top-" +"level environment by checking its own ``__name__``, which allows a common " +"idiom for conditionally executing code when the module is not initialized " +"from an import statement::" +msgstr "" +"Як наслідок, модуль може виявити, чи працює він у середовищі верхнього " +"рівня, перевіряючи власне ``__name__``, що дозволяє загальну ідіому для " +"умовного виконання коду, коли модуль не ініціалізовано оператором імпорту: :" + +msgid "" +"if __name__ == '__main__':\n" +" # Execute when the module is not initialized from an import statement.\n" +" ..." +msgstr "" + +msgid "" +"For a more detailed look at how ``__name__`` is set in all situations, see " +"the tutorial section :ref:`tut-modules`." +msgstr "" +"Для більш детального ознайомлення з тим, як ``__name__`` встановлюється в " +"усіх ситуаціях, перегляньте розділ підручника :ref:`tut-modules`." + +msgid "Idiomatic Usage" +msgstr "Ідіоматичне використання" + +msgid "" +"Some modules contain code that is intended for script use only, like parsing " +"command-line arguments or fetching data from standard input. If a module " +"like this was imported from a different module, for example to unit test it, " +"the script code would unintentionally execute as well." +msgstr "" +"Деякі модулі містять код, призначений лише для використання сценарієм, як-от " +"аналіз аргументів командного рядка або отримання даних зі стандартного " +"введення. Якщо подібний модуль було імпортовано з іншого модуля, наприклад, " +"для модульного тестування, код сценарію також буде ненавмисно виконано." + +msgid "" +"This is where using the ``if __name__ == '__main__'`` code block comes in " +"handy. Code within this block won't run unless the module is executed in the " +"top-level environment." +msgstr "" +"Тут стане в нагоді використання блоку коду ``if __name__ == '__main__''``. " +"Код у цьому блоці не працюватиме, якщо модуль не буде виконано в середовищі " +"верхнього рівня." + +msgid "" +"Putting as few statements as possible in the block below ``if __name__ == " +"'__main__'`` can improve code clarity and correctness. Most often, a " +"function named ``main`` encapsulates the program's primary behavior::" +msgstr "" + +msgid "" +"# echo.py\n" +"\n" +"import shlex\n" +"import sys\n" +"\n" +"def echo(phrase: str) -> None:\n" +" \"\"\"A dummy wrapper around print.\"\"\"\n" +" # for demonstration purposes, you can imagine that there is some\n" +" # valuable and reusable logic inside this function\n" +" print(phrase)\n" +"\n" +"def main() -> int:\n" +" \"\"\"Echo the input arguments to standard output\"\"\"\n" +" phrase = shlex.join(sys.argv)\n" +" echo(phrase)\n" +" return 0\n" +"\n" +"if __name__ == '__main__':\n" +" sys.exit(main()) # next section explains the use of sys.exit" +msgstr "" + +msgid "" +"Note that if the module didn't encapsulate code inside the ``main`` function " +"but instead put it directly within the ``if __name__ == '__main__'`` block, " +"the ``phrase`` variable would be global to the entire module. This is error-" +"prone as other functions within the module could be unintentionally using " +"the global variable instead of a local name. A ``main`` function solves " +"this problem." +msgstr "" +"Зауважте, що якби модуль не інкапсулював код у функцію ``main``, а поміщав " +"його безпосередньо в блок ``if __name__ == '__main__'``, змінна ``phrase`` " +"буде глобальною для весь модуль. Це загрожує помилками, оскільки інші " +"функції в модулі можуть ненавмисно використовувати глобальну змінну замість " +"локального імені. Функція ``main`` вирішує цю проблему." + +msgid "" +"Using a ``main`` function has the added benefit of the ``echo`` function " +"itself being isolated and importable elsewhere. When ``echo.py`` is " +"imported, the ``echo`` and ``main`` functions will be defined, but neither " +"of them will be called, because ``__name__ != '__main__'``." +msgstr "" +"Використання функції ``main`` має додаткову перевагу в тому, що сама функція " +"``echo`` є ізольованою та її можна імпортувати в інше місце. Коли " +"імпортується ``echo.py``, функції ``echo`` і ``main`` будуть визначені, але " +"жодна з них не буде викликана, оскільки ``__name__ != '__main__'``." + +msgid "Packaging Considerations" +msgstr "Зауваження щодо упаковки" + +msgid "" +"``main`` functions are often used to create command-line tools by specifying " +"them as entry points for console scripts. When this is done, `pip `_ inserts the function call into a template script, where the " +"return value of ``main`` is passed into :func:`sys.exit`. For example::" +msgstr "" +"Функції ``main`` часто використовуються для створення інструментів " +"командного рядка, вказуючи їх як точки входу для сценаріїв консолі. Коли це " +"зроблено, `pip `_ вставляє виклик функції в сценарій " +"шаблону, де повернуте значення ``main`` передається в :func:`sys.exit`. " +"Наприклад::" + +msgid "sys.exit(main())" +msgstr "" + +msgid "" +"Since the call to ``main`` is wrapped in :func:`sys.exit`, the expectation " +"is that your function will return some value acceptable as an input to :func:" +"`sys.exit`; typically, an integer or ``None`` (which is implicitly returned " +"if your function does not have a return statement)." +msgstr "" +"Оскільки виклик ``main`` загорнутий у :func:`sys.exit`, очікується, що ваша " +"функція поверне деяке значення, прийнятне як вхідні дані для :func:`sys." +"exit`; як правило, ціле число або ``None`` (що неявно повертається, якщо " +"ваша функція не має оператора return)." + +msgid "" +"By proactively following this convention ourselves, our module will have the " +"same behavior when run directly (i.e. ``python echo.py``) as it will have if " +"we later package it as a console script entry-point in a pip-installable " +"package." +msgstr "" + +msgid "" +"In particular, be careful about returning strings from your ``main`` " +"function. :func:`sys.exit` will interpret a string argument as a failure " +"message, so your program will have an exit code of ``1``, indicating " +"failure, and the string will be written to :data:`sys.stderr`. The ``echo." +"py`` example from earlier exemplifies using the ``sys.exit(main())`` " +"convention." +msgstr "" +"Зокрема, будьте обережні щодо повернення рядків з вашої функції ``main``. :" +"func:`sys.exit` інтерпретує рядковий аргумент як повідомлення про помилку, " +"тому ваша програма матиме код виходу ``1``, що вказує на помилку, і рядок " +"буде записано в :data:`sys.stderr`. Приклад ``echo.py`` з попереднього " +"прикладу використання угоди ``sys.exit(main())``." + +msgid "" +"`Python Packaging User Guide `_ contains a " +"collection of tutorials and references on how to distribute and install " +"Python packages with modern tools." +msgstr "" +"`Посібник користувача з пакування Python `_ " +"містить колекцію посібників і довідок про те, як розповсюджувати та " +"встановлювати пакунки Python за допомогою сучасних інструментів." + +msgid "``__main__.py`` in Python Packages" +msgstr "``__main__.py`` в пакетах Python" + +msgid "" +"If you are not familiar with Python packages, see section :ref:`tut-" +"packages` of the tutorial. Most commonly, the ``__main__.py`` file is used " +"to provide a command-line interface for a package. Consider the following " +"hypothetical package, \"bandclass\":" +msgstr "" +"Якщо ви не знайомі з пакетами Python, перегляньте розділ :ref:`tut-packages` " +"підручника. Найчастіше файл ``__main__.py`` використовується для " +"забезпечення інтерфейсу командного рядка для пакета. Розглянемо наступний " +"гіпотетичний пакет, \"bandclass\":" + +msgid "" +"bandclass\n" +" ├── __init__.py\n" +" ├── __main__.py\n" +" └── student.py" +msgstr "" + +msgid "" +"``__main__.py`` will be executed when the package itself is invoked directly " +"from the command line using the :option:`-m` flag. For example:" +msgstr "" +"``__main__.py`` буде виконано, коли сам пакет викликається безпосередньо з " +"командного рядка за допомогою прапорця :option:`-m`. Наприклад:" + +msgid "$ python -m bandclass" +msgstr "" + +msgid "" +"This command will cause ``__main__.py`` to run. How you utilize this " +"mechanism will depend on the nature of the package you are writing, but in " +"this hypothetical case, it might make sense to allow the teacher to search " +"for students::" +msgstr "" +"Ця команда призведе до запуску ``__main__.py``. Те, як ви використовуєте цей " +"механізм, залежатиме від характеру пакету, який ви пишете, але в цьому " +"гіпотетичному випадку може мати сенс дозволити вчителю шукати учнів:" + +msgid "" +"# bandclass/__main__.py\n" +"\n" +"import sys\n" +"from .student import search_students\n" +"\n" +"student_name = sys.argv[1] if len(sys.argv) >= 2 else ''\n" +"print(f'Found student: {search_students(student_name)}')" +msgstr "" + +msgid "" +"Note that ``from .student import search_students`` is an example of a " +"relative import. This import style can be used when referencing modules " +"within a package. For more details, see :ref:`intra-package-references` in " +"the :ref:`tut-modules` section of the tutorial." +msgstr "" +"Зауважте, що ``from .student import search_students`` є прикладом відносного " +"імпорту. Цей стиль імпорту можна використовувати під час посилань на модулі " +"в пакеті. Для отримання додаткової інформації перегляньте :ref:`intra-" +"package-references` у розділі :ref:`tut-modules` підручника." + +msgid "" +"The content of ``__main__.py`` typically isn't fenced with an ``if __name__ " +"== '__main__'`` block. Instead, those files are kept short and import " +"functions to execute from other modules. Those other modules can then be " +"easily unit-tested and are properly reusable." +msgstr "" + +msgid "" +"If used, an ``if __name__ == '__main__'`` block will still work as expected " +"for a ``__main__.py`` file within a package, because its ``__name__`` " +"attribute will include the package's path if imported::" +msgstr "" +"Якщо використовується, блок ``if __name__ == '__main__'`` все одно " +"працюватиме належним чином для файлу ``__main__.py`` у пакеті, тому що його " +"атрибут ``__name__`` включатиме шлях до пакета, якщо імпортовано ::" + +msgid "" +">>> import asyncio.__main__\n" +">>> asyncio.__main__.__name__\n" +"'asyncio.__main__'" +msgstr "" + +msgid "" +"This won't work for ``__main__.py`` files in the root directory of a ``." +"zip`` file though. Hence, for consistency, a minimal ``__main__.py`` " +"without a ``__name__`` check is preferred." +msgstr "" + +msgid "" +"See :mod:`venv` for an example of a package with a minimal ``__main__.py`` " +"in the standard library. It doesn't contain a ``if __name__ == '__main__'`` " +"block. You can invoke it with ``python -m venv [directory]``." +msgstr "" + +msgid "" +"See :mod:`runpy` for more details on the :option:`-m` flag to the " +"interpreter executable." +msgstr "" +"Перегляньте :mod:`runpy` для отримання додаткової інформації про прапорець :" +"option:`-m` для виконуваного файлу інтерпретатора." + +msgid "" +"See :mod:`zipapp` for how to run applications packaged as *.zip* files. In " +"this case Python looks for a ``__main__.py`` file in the root directory of " +"the archive." +msgstr "" +"Перегляньте :mod:`zipapp`, щоб дізнатися, як запускати програми, упаковані у " +"файли *.zip*. У цьому випадку Python шукає файл ``__main__.py`` в кореневому " +"каталозі архіву." + +msgid "``import __main__``" +msgstr "``імпорт __main__``" + +msgid "" +"Regardless of which module a Python program was started with, other modules " +"running within that same program can import the top-level environment's " +"scope (:term:`namespace`) by importing the ``__main__`` module. This " +"doesn't import a ``__main__.py`` file but rather whichever module that " +"received the special name ``'__main__'``." +msgstr "" +"Незалежно від того, з якого модуля була запущена програма Python, інші " +"модулі, що працюють у цій же програмі, можуть імпортувати область верхнього " +"рівня середовища (:term:`namespace`), імпортуючи модуль ``__main__``. Це " +"імпортує не файл ``__main__.py``, а будь-який модуль, який отримав " +"спеціальну назву ``'__main__'``." + +msgid "Here is an example module that consumes the ``__main__`` namespace::" +msgstr "Ось приклад модуля, який використовує простір імен ``__main__``::" + +msgid "" +"# namely.py\n" +"\n" +"import __main__\n" +"\n" +"def did_user_define_their_name():\n" +" return 'my_name' in dir(__main__)\n" +"\n" +"def print_user_name():\n" +" if not did_user_define_their_name():\n" +" raise ValueError('Define the variable `my_name`!')\n" +"\n" +" if '__file__' in dir(__main__):\n" +" print(__main__.my_name, \"found in file\", __main__.__file__)\n" +" else:\n" +" print(__main__.my_name)" +msgstr "" + +msgid "Example usage of this module could be as follows::" +msgstr "Приклад використання цього модуля може бути наступним:" + +msgid "" +"# start.py\n" +"\n" +"import sys\n" +"\n" +"from namely import print_user_name\n" +"\n" +"# my_name = \"Dinsdale\"\n" +"\n" +"def main():\n" +" try:\n" +" print_user_name()\n" +" except ValueError as ve:\n" +" return str(ve)\n" +"\n" +"if __name__ == \"__main__\":\n" +" sys.exit(main())" +msgstr "" + +msgid "Now, if we started our program, the result would look like this:" +msgstr "Тепер, якби ми запустили нашу програму, результат виглядав би так:" + +msgid "" +"$ python start.py\n" +"Define the variable `my_name`!" +msgstr "" + +msgid "" +"The exit code of the program would be 1, indicating an error. Uncommenting " +"the line with ``my_name = \"Dinsdale\"`` fixes the program and now it exits " +"with status code 0, indicating success:" +msgstr "" +"Код виходу програми буде 1, що вказуватиме на помилку. Розкоментування рядка " +"``my_name = \"Dinsdale\"`` виправляє програму, і тепер вона завершує роботу " +"з кодом статусу 0, що вказує на успіх:" + +msgid "" +"$ python start.py\n" +"Dinsdale found in file /path/to/start.py" +msgstr "" + +msgid "" +"Note that importing ``__main__`` doesn't cause any issues with " +"unintentionally running top-level code meant for script use which is put in " +"the ``if __name__ == \"__main__\"`` block of the ``start`` module. Why does " +"this work?" +msgstr "" +"Зауважте, що імпорт ``__main__`` не викликає жодних проблем із ненавмисним " +"запуском коду верхнього рівня, призначеного для використання сценарію, який " +"розміщено в ``if __name__ == \"__main__\"`` блоку ``start`` модуля . Чому це " +"працює?" + +msgid "" +"Python inserts an empty ``__main__`` module in :data:`sys.modules` at " +"interpreter startup, and populates it by running top-level code. In our " +"example this is the ``start`` module which runs line by line and imports " +"``namely``. In turn, ``namely`` imports ``__main__`` (which is really " +"``start``). That's an import cycle! Fortunately, since the partially " +"populated ``__main__`` module is present in :data:`sys.modules`, Python " +"passes that to ``namely``. See :ref:`Special considerations for __main__ " +"` in the import system's reference for details on how " +"this works." +msgstr "" + +msgid "" +"The Python REPL is another example of a \"top-level environment\", so " +"anything defined in the REPL becomes part of the ``__main__`` scope::" +msgstr "" +"Python REPL є ще одним прикладом \"середовища верхнього рівня\", тому все, " +"що визначено в REPL, стає частиною області ``__main__``::" + +msgid "" +">>> import namely\n" +">>> namely.did_user_define_their_name()\n" +"False\n" +">>> namely.print_user_name()\n" +"Traceback (most recent call last):\n" +"...\n" +"ValueError: Define the variable `my_name`!\n" +">>> my_name = 'Jabberwocky'\n" +">>> namely.did_user_define_their_name()\n" +"True\n" +">>> namely.print_user_name()\n" +"Jabberwocky" +msgstr "" + +msgid "" +"Note that in this case the ``__main__`` scope doesn't contain a ``__file__`` " +"attribute as it's interactive." +msgstr "" +"Зауважте, що в цьому випадку область ``__main__`` не містить атрибут " +"``__file__``, оскільки вона інтерактивна." + +msgid "" +"The ``__main__`` scope is used in the implementation of :mod:`pdb` and :mod:" +"`rlcompleter`." +msgstr "" +"Область ``__main__`` використовується в реалізації :mod:`pdb` і :mod:" +"`rlcompleter`." diff --git a/library/_thread.po b/library/_thread.po new file mode 100644 index 000000000..10876a95b --- /dev/null +++ b/library/_thread.po @@ -0,0 +1,349 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2023 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:54+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2023\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!_thread` --- Low-level threading API" +msgstr "" + +msgid "" +"This module provides low-level primitives for working with multiple threads " +"(also called :dfn:`light-weight processes` or :dfn:`tasks`) --- multiple " +"threads of control sharing their global data space. For synchronization, " +"simple locks (also called :dfn:`mutexes` or :dfn:`binary semaphores`) are " +"provided. The :mod:`threading` module provides an easier to use and higher-" +"level threading API built on top of this module." +msgstr "" +"Цей модуль надає низькорівневі примітиви для роботи з кількома потоками " +"(також званими :dfn:`light-weight processes` або :dfn:`tasks`) --- кілька " +"потоків управління спільно використовують свій глобальний простір даних. Для " +"синхронізації передбачені прості блокування (також звані :dfn:`mutexes` або :" +"dfn:`binary semaphores`). Модуль :mod:`threading` надає більш простий у " +"використанні та високорівневий потоковий API, побудований на основі цього " +"модуля." + +msgid "This module used to be optional, it is now always available." +msgstr "Раніше цей модуль був необов’язковим, тепер він доступний завжди." + +msgid "This module defines the following constants and functions:" +msgstr "Цей модуль визначає такі константи та функції:" + +msgid "Raised on thread-specific errors." +msgstr "Виникає через помилки потоку." + +msgid "This is now a synonym of the built-in :exc:`RuntimeError`." +msgstr "Тепер це синонім вбудованої :exc:`RuntimeError`." + +msgid "This is the type of lock objects." +msgstr "Це тип об'єктів блокування." + +msgid "" +"Start a new thread and return its identifier. The thread executes the " +"function *function* with the argument list *args* (which must be a tuple). " +"The optional *kwargs* argument specifies a dictionary of keyword arguments." +msgstr "" +"Створіть новий потік і поверніть його ідентифікатор. Потік виконує функцію " +"*function* зі списком аргументів *args* (який має бути кортежем). " +"Необов'язковий аргумент *kwargs* визначає словник ключових аргументів." + +msgid "When the function returns, the thread silently exits." +msgstr "Коли функція повертається, потік мовчки виходить." + +msgid "" +"When the function terminates with an unhandled exception, :func:`sys." +"unraisablehook` is called to handle the exception. The *object* attribute of " +"the hook argument is *function*. By default, a stack trace is printed and " +"then the thread exits (but other threads continue to run)." +msgstr "" +"Коли функція завершується з необробленим винятком, :func:`sys." +"unraisablehook` викликається для обробки винятку. Атрибутом *object* " +"аргументу hook є *function*. За замовчуванням трасування стека друкується, а " +"потім потік завершується (але інші потоки продовжують працювати)." + +msgid "" +"When the function raises a :exc:`SystemExit` exception, it is silently " +"ignored." +msgstr "" +"Коли функція викликає виняткову ситуацію :exc:`SystemExit`, вона мовчки " +"ігнорується." + +msgid "" +"Raises an :ref:`auditing event ` ``_thread.start_new_thread`` with " +"arguments ``function``, ``args``, ``kwargs``." +msgstr "" + +msgid ":func:`sys.unraisablehook` is now used to handle unhandled exceptions." +msgstr "" +":func:`sys.unraisablehook` тепер використовується для обробки необроблених " +"винятків." + +msgid "" +"Simulate the effect of a signal arriving in the main thread. A thread can " +"use this function to interrupt the main thread, though there is no guarantee " +"that the interruption will happen immediately." +msgstr "" +"Імітуйте ефект сигналу, що надходить у головний потік. Потік може " +"використовувати цю функцію для переривання основного потоку, хоча немає " +"гарантії, що переривання відбудеться негайно." + +msgid "" +"If given, *signum* is the number of the signal to simulate. If *signum* is " +"not given, :const:`signal.SIGINT` is simulated." +msgstr "" + +msgid "" +"If the given signal isn't handled by Python (it was set to :const:`signal." +"SIG_DFL` or :const:`signal.SIG_IGN`), this function does nothing." +msgstr "" + +msgid "The *signum* argument is added to customize the signal number." +msgstr "Аргумент *signum* додається для налаштування номера сигналу." + +msgid "" +"This does not emit the corresponding signal but schedules a call to the " +"associated handler (if it exists). If you want to truly emit the signal, " +"use :func:`signal.raise_signal`." +msgstr "" +"Це не випромінює відповідний сигнал, але планує виклик пов’язаного обробника " +"(якщо він існує). Якщо ви хочете справді випромінювати сигнал, " +"використовуйте :func:`signal.raise_signal`." + +msgid "" +"Raise the :exc:`SystemExit` exception. When not caught, this will cause the " +"thread to exit silently." +msgstr "" +"Підніміть виняток :exc:`SystemExit`. Якщо не буде спіймано, це призведе до " +"тихого виходу потоку." + +msgid "" +"Return a new lock object. Methods of locks are described below. The lock " +"is initially unlocked." +msgstr "" +"Повернути новий об’єкт блокування. Способи блокування описані нижче. Замок " +"спочатку розблокований." + +msgid "" +"Return the 'thread identifier' of the current thread. This is a nonzero " +"integer. Its value has no direct meaning; it is intended as a magic cookie " +"to be used e.g. to index a dictionary of thread-specific data. Thread " +"identifiers may be recycled when a thread exits and another thread is " +"created." +msgstr "" +"Повертає \"ідентифікатор потоку\" поточного потоку. Це ненульове ціле число. " +"Його значення не має прямого значення; воно призначене як магічне печиво, " +"яке можна використовувати, наприклад. щоб індексувати словник даних, що " +"стосуються потоку. Ідентифікатори потоку можуть бути перероблені, коли потік " +"завершується та створюється інший." + +msgid "" +"Return the native integral Thread ID of the current thread assigned by the " +"kernel. This is a non-negative integer. Its value may be used to uniquely " +"identify this particular thread system-wide (until the thread terminates, " +"after which the value may be recycled by the OS)." +msgstr "" +"Повертає власний інтегральний ідентифікатор потоку поточного потоку, " +"призначеного ядром. Це невід’ємне ціле число. Його значення може " +"використовуватися для однозначної ідентифікації цього конкретного потоку в " +"системі (до завершення роботи потоку, після чого значення може бути повторно " +"використано ОС)." + +msgid "Availability" +msgstr "" + +msgid "Added support for GNU/kFreeBSD." +msgstr "" + +msgid "" +"Return the thread stack size used when creating new threads. The optional " +"*size* argument specifies the stack size to be used for subsequently created " +"threads, and must be 0 (use platform or configured default) or a positive " +"integer value of at least 32,768 (32 KiB). If *size* is not specified, 0 is " +"used. If changing the thread stack size is unsupported, a :exc:" +"`RuntimeError` is raised. If the specified stack size is invalid, a :exc:" +"`ValueError` is raised and the stack size is unmodified. 32 KiB is " +"currently the minimum supported stack size value to guarantee sufficient " +"stack space for the interpreter itself. Note that some platforms may have " +"particular restrictions on values for the stack size, such as requiring a " +"minimum stack size > 32 KiB or requiring allocation in multiples of the " +"system memory page size - platform documentation should be referred to for " +"more information (4 KiB pages are common; using multiples of 4096 for the " +"stack size is the suggested approach in the absence of more specific " +"information)." +msgstr "" +"Повертає розмір стека потоків, який використовувався під час створення нових " +"потоків. Необов’язковий аргумент *size* визначає розмір стека, який буде " +"використовуватися для згодом створених потоків, і має дорівнювати 0 " +"(використовувати платформу або налаштоване за замовчуванням) або додатне " +"ціле значення принаймні 32 768 (32 КіБ). Якщо *size* не вказано, " +"використовується 0. Якщо зміна розміру стека потоку не підтримується, " +"виникає :exc:`RuntimeError`. Якщо вказаний розмір стека недійсний, виникає " +"помилка :exc:`ValueError` і розмір стека не змінюється. 32 КіБ наразі є " +"мінімальним підтримуваним значенням розміру стеку, щоб гарантувати достатній " +"простір стеку для самого інтерпретатора. Зауважте, що деякі платформи можуть " +"мати певні обмеження щодо значень розміру стека, як-от вимагати мінімальний " +"розмір стека > 32 КБ або вимагати виділення кратного розміру сторінки " +"системної пам’яті – для отримання додаткової інформації слід звернутися до " +"документації платформи (сторінки 4 КБ є поширеними; використання кратних " +"4096 для розміру стека є запропонованим підходом за відсутності більш " +"конкретної інформації)." + +msgid "Unix platforms with POSIX threads support." +msgstr "" + +msgid "" +"The maximum value allowed for the *timeout* parameter of :meth:`Lock.acquire " +"`. Specifying a timeout greater than this value will " +"raise an :exc:`OverflowError`." +msgstr "" + +msgid "Lock objects have the following methods:" +msgstr "Об’єкти блокування мають такі методи:" + +msgid "" +"Without any optional argument, this method acquires the lock " +"unconditionally, if necessary waiting until it is released by another thread " +"(only one thread at a time can acquire a lock --- that's their reason for " +"existence)." +msgstr "" +"Без будь-яких необов’язкових аргументів цей метод отримує блокування " +"безумовно, за необхідності чекаючи, поки його не буде звільнено іншим " +"потоком (лише один потік за раз може отримати блокування --- це причина " +"їхнього існування)." + +msgid "" +"If the *blocking* argument is present, the action depends on its value: if " +"it is false, the lock is only acquired if it can be acquired immediately " +"without waiting, while if it is true, the lock is acquired unconditionally " +"as above." +msgstr "" + +msgid "" +"If the floating-point *timeout* argument is present and positive, it " +"specifies the maximum wait time in seconds before returning. A negative " +"*timeout* argument specifies an unbounded wait. You cannot specify a " +"*timeout* if *blocking* is false." +msgstr "" + +msgid "" +"The return value is ``True`` if the lock is acquired successfully, ``False`` " +"if not." +msgstr "" +"Поверненим значенням є ``True``, якщо блокування отримано успішно, " +"``False``, якщо ні." + +msgid "The *timeout* parameter is new." +msgstr "Параметр *timeout* є новим." + +msgid "Lock acquires can now be interrupted by signals on POSIX." +msgstr "Отримання блокування тепер може бути перервано сигналами на POSIX." + +msgid "" +"Releases the lock. The lock must have been acquired earlier, but not " +"necessarily by the same thread." +msgstr "" +"Звільняє замок. Замок повинен бути придбаний раніше, але не обов'язково за " +"тією ж ниткою." + +msgid "" +"Return the status of the lock: ``True`` if it has been acquired by some " +"thread, ``False`` if not." +msgstr "" +"Повертає статус блокування: ``True``, якщо його було отримано якимось " +"потоком, ``False``, якщо ні." + +msgid "" +"In addition to these methods, lock objects can also be used via the :keyword:" +"`with` statement, e.g.::" +msgstr "" +"Окрім цих методів, об’єкти блокування також можна використовувати за " +"допомогою оператора :keyword:`with`, наприклад::" + +msgid "" +"import _thread\n" +"\n" +"a_lock = _thread.allocate_lock()\n" +"\n" +"with a_lock:\n" +" print(\"a_lock is locked while this executes\")" +msgstr "" + +msgid "**Caveats:**" +msgstr "**Застереження:**" + +msgid "" +"Interrupts always go to the main thread (the :exc:`KeyboardInterrupt` " +"exception will be received by that thread.)" +msgstr "" + +msgid "" +"Calling :func:`sys.exit` or raising the :exc:`SystemExit` exception is " +"equivalent to calling :func:`_thread.exit`." +msgstr "" +"Виклик :func:`sys.exit` або підвищення винятку :exc:`SystemExit` " +"еквівалентний виклику :func:`_thread.exit`." + +msgid "" +"It is platform-dependent whether the :meth:`~threading.Lock.acquire` method " +"on a lock can be interrupted (so that the :exc:`KeyboardInterrupt` exception " +"will happen immediately, rather than only after the lock has been acquired " +"or the operation has timed out). It can be interrupted on POSIX, but not on " +"Windows." +msgstr "" + +msgid "" +"When the main thread exits, it is system defined whether the other threads " +"survive. On most systems, they are killed without executing :keyword:" +"`try` ... :keyword:`finally` clauses or executing object destructors." +msgstr "" +"Коли основний потік виходить, система визначає, чи виживуть інші потоки. У " +"більшості систем вони припиняються без виконання пропозицій :keyword:" +"`try` ... :keyword:`finally` або виконання деструкторів об’єктів." + +msgid "light-weight processes" +msgstr "" + +msgid "processes, light-weight" +msgstr "" + +msgid "binary semaphores" +msgstr "" + +msgid "semaphores, binary" +msgstr "" + +msgid "pthreads" +msgstr "" + +msgid "threads" +msgstr "" + +msgid "POSIX" +msgstr "POSIX" + +msgid "module" +msgstr "модуль" + +msgid "signal" +msgstr "сигнал" diff --git a/library/abc.po b/library/abc.po new file mode 100644 index 000000000..2e4ec0eca --- /dev/null +++ b/library/abc.po @@ -0,0 +1,490 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-04 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:54+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!abc` --- Abstract Base Classes" +msgstr "" + +msgid "**Source code:** :source:`Lib/abc.py`" +msgstr "**Вихідний код:** :source:`Lib/abc.py`" + +msgid "" +"This module provides the infrastructure for defining :term:`abstract base " +"classes ` (ABCs) in Python, as outlined in :pep:`3119`; " +"see the PEP for why this was added to Python. (See also :pep:`3141` and the :" +"mod:`numbers` module regarding a type hierarchy for numbers based on ABCs.)" +msgstr "" +"Цей модуль забезпечує інфраструктуру для визначення :term:`абстрактних " +"базових класів ` (ABC) у Python, як описано в :pep:" +"`3119`; див. PEP, чому це було додано до Python. (Див. також :pep:`3141` і " +"модуль :mod:`numbers` щодо ієрархії типів для чисел на основі ABC.)" + +msgid "" +"The :mod:`collections` module has some concrete classes that derive from " +"ABCs; these can, of course, be further derived. In addition, the :mod:" +"`collections.abc` submodule has some ABCs that can be used to test whether a " +"class or instance provides a particular interface, for example, if it is :" +"term:`hashable` or if it is a :term:`mapping`." +msgstr "" + +msgid "" +"This module provides the metaclass :class:`ABCMeta` for defining ABCs and a " +"helper class :class:`ABC` to alternatively define ABCs through inheritance:" +msgstr "" +"Цей модуль надає метаклас :class:`ABCMeta` для визначення ABC і допоміжний " +"клас :class:`ABC` для альтернативного визначення ABC через успадкування:" + +msgid "" +"A helper class that has :class:`ABCMeta` as its metaclass. With this class, " +"an abstract base class can be created by simply deriving from :class:`!ABC` " +"avoiding sometimes confusing metaclass usage, for example::" +msgstr "" + +msgid "" +"from abc import ABC\n" +"\n" +"class MyABC(ABC):\n" +" pass" +msgstr "" + +msgid "" +"Note that the type of :class:`!ABC` is still :class:`ABCMeta`, therefore " +"inheriting from :class:`!ABC` requires the usual precautions regarding " +"metaclass usage, as multiple inheritance may lead to metaclass conflicts. " +"One may also define an abstract base class by passing the metaclass keyword " +"and using :class:`!ABCMeta` directly, for example::" +msgstr "" + +msgid "" +"from abc import ABCMeta\n" +"\n" +"class MyABC(metaclass=ABCMeta):\n" +" pass" +msgstr "" + +msgid "Metaclass for defining Abstract Base Classes (ABCs)." +msgstr "Метаклас для визначення абстрактних базових класів (ABC)." + +msgid "" +"Use this metaclass to create an ABC. An ABC can be subclassed directly, and " +"then acts as a mix-in class. You can also register unrelated concrete " +"classes (even built-in classes) and unrelated ABCs as \"virtual subclasses\" " +"-- these and their descendants will be considered subclasses of the " +"registering ABC by the built-in :func:`issubclass` function, but the " +"registering ABC won't show up in their MRO (Method Resolution Order) nor " +"will method implementations defined by the registering ABC be callable (not " +"even via :func:`super`). [#]_" +msgstr "" +"Використовуйте цей метаклас для створення ABC. ABC може бути безпосередньо " +"підкласом, а потім діяти як змішаний клас. Ви також можете зареєструвати " +"непов’язані конкретні класи (навіть вбудовані) і непов’язані ABC як " +"\"віртуальні підкласи\" — ці та їхні нащадки вважатимуться підкласами " +"реєструючого ABC вбудованою функцією :func:`issubclass`, але реєструючий ABC " +"не відображатиметься в їхньому MRO (Method Resolution Order), а також " +"реалізації методів, визначені реєструючим ABC, не можна буде викликати " +"(навіть через :func:`super`). [#]_" + +msgid "" +"Classes created with a metaclass of :class:`!ABCMeta` have the following " +"method:" +msgstr "" + +msgid "" +"Register *subclass* as a \"virtual subclass\" of this ABC. For example::" +msgstr "" +"Зареєструйте *підклас* як \"віртуальний підклас\" цього ABC. Наприклад::" + +msgid "" +"from abc import ABC\n" +"\n" +"class MyABC(ABC):\n" +" pass\n" +"\n" +"MyABC.register(tuple)\n" +"\n" +"assert issubclass(tuple, MyABC)\n" +"assert isinstance((), MyABC)" +msgstr "" + +msgid "Returns the registered subclass, to allow usage as a class decorator." +msgstr "" +"Повертає зареєстрований підклас, щоб дозволити використання як декоратор " +"класу." + +msgid "" +"To detect calls to :meth:`!register`, you can use the :func:" +"`get_cache_token` function." +msgstr "" + +msgid "You can also override this method in an abstract base class:" +msgstr "Ви також можете перевизначити цей метод в абстрактному базовому класі:" + +msgid "(Must be defined as a class method.)" +msgstr "(Повинен бути визначений як метод класу.)" + +msgid "" +"Check whether *subclass* is considered a subclass of this ABC. This means " +"that you can customize the behavior of :func:`issubclass` further without " +"the need to call :meth:`register` on every class you want to consider a " +"subclass of the ABC. (This class method is called from the :meth:`~type." +"__subclasscheck__` method of the ABC.)" +msgstr "" + +msgid "" +"This method should return ``True``, ``False`` or :data:`NotImplemented`. If " +"it returns ``True``, the *subclass* is considered a subclass of this ABC. If " +"it returns ``False``, the *subclass* is not considered a subclass of this " +"ABC, even if it would normally be one. If it returns :data:`!" +"NotImplemented`, the subclass check is continued with the usual mechanism." +msgstr "" + +msgid "" +"For a demonstration of these concepts, look at this example ABC definition::" +msgstr "" +"Для демонстрації цих концепцій подивіться на цей приклад визначення ABC:" + +msgid "" +"class Foo:\n" +" def __getitem__(self, index):\n" +" ...\n" +" def __len__(self):\n" +" ...\n" +" def get_iterator(self):\n" +" return iter(self)\n" +"\n" +"class MyIterable(ABC):\n" +"\n" +" @abstractmethod\n" +" def __iter__(self):\n" +" while False:\n" +" yield None\n" +"\n" +" def get_iterator(self):\n" +" return self.__iter__()\n" +"\n" +" @classmethod\n" +" def __subclasshook__(cls, C):\n" +" if cls is MyIterable:\n" +" if any(\"__iter__\" in B.__dict__ for B in C.__mro__):\n" +" return True\n" +" return NotImplemented\n" +"\n" +"MyIterable.register(Foo)" +msgstr "" + +msgid "" +"The ABC ``MyIterable`` defines the standard iterable method, :meth:`~object." +"__iter__`, as an abstract method. The implementation given here can still " +"be called from subclasses. The :meth:`!get_iterator` method is also part of " +"the ``MyIterable`` abstract base class, but it does not have to be " +"overridden in non-abstract derived classes." +msgstr "" + +msgid "" +"The :meth:`__subclasshook__` class method defined here says that any class " +"that has an :meth:`~object.__iter__` method in its :attr:`~object.__dict__` " +"(or in that of one of its base classes, accessed via the :attr:`~type." +"__mro__` list) is considered a ``MyIterable`` too." +msgstr "" + +msgid "" +"Finally, the last line makes ``Foo`` a virtual subclass of ``MyIterable``, " +"even though it does not define an :meth:`~object.__iter__` method (it uses " +"the old-style iterable protocol, defined in terms of :meth:`~object.__len__` " +"and :meth:`~object.__getitem__`). Note that this will not make " +"``get_iterator`` available as a method of ``Foo``, so it is provided " +"separately." +msgstr "" + +msgid "The :mod:`!abc` module also provides the following decorator:" +msgstr "" + +msgid "A decorator indicating abstract methods." +msgstr "Декоратор, що вказує на абстрактні методи." + +msgid "" +"Using this decorator requires that the class's metaclass is :class:`ABCMeta` " +"or is derived from it. A class that has a metaclass derived from :class:`!" +"ABCMeta` cannot be instantiated unless all of its abstract methods and " +"properties are overridden. The abstract methods can be called using any of " +"the normal 'super' call mechanisms. :func:`!abstractmethod` may be used to " +"declare abstract methods for properties and descriptors." +msgstr "" + +msgid "" +"Dynamically adding abstract methods to a class, or attempting to modify the " +"abstraction status of a method or class once it is created, are only " +"supported using the :func:`update_abstractmethods` function. The :func:`!" +"abstractmethod` only affects subclasses derived using regular inheritance; " +"\"virtual subclasses\" registered with the ABC's :meth:`~ABCMeta.register` " +"method are not affected." +msgstr "" + +msgid "" +"When :func:`!abstractmethod` is applied in combination with other method " +"descriptors, it should be applied as the innermost decorator, as shown in " +"the following usage examples::" +msgstr "" + +msgid "" +"class C(ABC):\n" +" @abstractmethod\n" +" def my_abstract_method(self, arg1):\n" +" ...\n" +" @classmethod\n" +" @abstractmethod\n" +" def my_abstract_classmethod(cls, arg2):\n" +" ...\n" +" @staticmethod\n" +" @abstractmethod\n" +" def my_abstract_staticmethod(arg3):\n" +" ...\n" +"\n" +" @property\n" +" @abstractmethod\n" +" def my_abstract_property(self):\n" +" ...\n" +" @my_abstract_property.setter\n" +" @abstractmethod\n" +" def my_abstract_property(self, val):\n" +" ...\n" +"\n" +" @abstractmethod\n" +" def _get_x(self):\n" +" ...\n" +" @abstractmethod\n" +" def _set_x(self, val):\n" +" ...\n" +" x = property(_get_x, _set_x)" +msgstr "" + +msgid "" +"In order to correctly interoperate with the abstract base class machinery, " +"the descriptor must identify itself as abstract using :attr:`!" +"__isabstractmethod__`. In general, this attribute should be ``True`` if any " +"of the methods used to compose the descriptor are abstract. For example, " +"Python's built-in :class:`property` does the equivalent of::" +msgstr "" + +msgid "" +"class Descriptor:\n" +" ...\n" +" @property\n" +" def __isabstractmethod__(self):\n" +" return any(getattr(f, '__isabstractmethod__', False) for\n" +" f in (self._fget, self._fset, self._fdel))" +msgstr "" + +msgid "" +"Unlike Java abstract methods, these abstract methods may have an " +"implementation. This implementation can be called via the :func:`super` " +"mechanism from the class that overrides it. This could be useful as an end-" +"point for a super-call in a framework that uses cooperative multiple-" +"inheritance." +msgstr "" +"На відміну від абстрактних методів Java, ці абстрактні методи можуть мати " +"реалізацію. Цю реалізацію можна викликати через механізм :func:`super` з " +"класу, який її замінює. Це може бути корисним як кінцева точка для " +"супервиклику в структурі, яка використовує кооперативне множинне " +"успадкування." + +msgid "The :mod:`!abc` module also supports the following legacy decorators:" +msgstr "" + +msgid "" +"It is now possible to use :class:`classmethod` with :func:`abstractmethod`, " +"making this decorator redundant." +msgstr "" +"Тепер можна використовувати :class:`classmethod` з :func:`abstractmethod`, " +"що робить цей декоратор зайвим." + +msgid "" +"A subclass of the built-in :func:`classmethod`, indicating an abstract " +"classmethod. Otherwise it is similar to :func:`abstractmethod`." +msgstr "" +"Підклас вбудованого :func:`classmethod`, що вказує на абстрактний метод " +"класу. В іншому він схожий на :func:`abstractmethod`." + +msgid "" +"This special case is deprecated, as the :func:`classmethod` decorator is now " +"correctly identified as abstract when applied to an abstract method::" +msgstr "" +"Цей спеціальний випадок застарів, оскільки декоратор :func:`classmethod` " +"тепер правильно ідентифікується як абстрактний, коли застосовується до " +"абстрактного методу::" + +msgid "" +"class C(ABC):\n" +" @classmethod\n" +" @abstractmethod\n" +" def my_abstract_classmethod(cls, arg):\n" +" ..." +msgstr "" + +msgid "" +"It is now possible to use :class:`staticmethod` with :func:`abstractmethod`, " +"making this decorator redundant." +msgstr "" +"Тепер можна використовувати :class:`staticmethod` з :func:`abstractmethod`, " +"що робить цей декоратор зайвим." + +msgid "" +"A subclass of the built-in :func:`staticmethod`, indicating an abstract " +"staticmethod. Otherwise it is similar to :func:`abstractmethod`." +msgstr "" +"Підклас вбудованого :func:`staticmethod`, що вказує на абстрактний статичний " +"метод. В іншому він схожий на :func:`abstractmethod`." + +msgid "" +"This special case is deprecated, as the :func:`staticmethod` decorator is " +"now correctly identified as abstract when applied to an abstract method::" +msgstr "" +"Цей окремий випадок застарів, оскільки декоратор :func:`staticmethod` тепер " +"правильно ідентифікується як абстрактний, коли застосовується до " +"абстрактного методу::" + +msgid "" +"class C(ABC):\n" +" @staticmethod\n" +" @abstractmethod\n" +" def my_abstract_staticmethod(arg):\n" +" ..." +msgstr "" + +msgid "" +"It is now possible to use :class:`property`, :meth:`property.getter`, :meth:" +"`property.setter` and :meth:`property.deleter` with :func:`abstractmethod`, " +"making this decorator redundant." +msgstr "" +"Тепер можна використовувати :class:`property`, :meth:`property.getter`, :" +"meth:`property.setter` і :meth:`property.deleter` з :func:`abstractmethod`, " +"створюючи цей декоратор надлишковий." + +msgid "" +"A subclass of the built-in :func:`property`, indicating an abstract property." +msgstr "" +"Підклас вбудованої :func:`property`, що вказує на абстрактну властивість." + +msgid "" +"This special case is deprecated, as the :func:`property` decorator is now " +"correctly identified as abstract when applied to an abstract method::" +msgstr "" +"Цей окремий випадок застарів, оскільки декоратор :func:`property` тепер " +"правильно ідентифікується як абстрактний, коли застосовується до " +"абстрактного методу::" + +msgid "" +"class C(ABC):\n" +" @property\n" +" @abstractmethod\n" +" def my_abstract_property(self):\n" +" ..." +msgstr "" + +msgid "" +"The above example defines a read-only property; you can also define a read-" +"write abstract property by appropriately marking one or more of the " +"underlying methods as abstract::" +msgstr "" +"Наведений вище приклад визначає властивість лише для читання; ви також " +"можете визначити абстрактну властивість читання-запису, відповідним чином " +"позначивши один або більше основних методів як абстрактні:" + +msgid "" +"class C(ABC):\n" +" @property\n" +" def x(self):\n" +" ...\n" +"\n" +" @x.setter\n" +" @abstractmethod\n" +" def x(self, val):\n" +" ..." +msgstr "" + +msgid "" +"If only some components are abstract, only those components need to be " +"updated to create a concrete property in a subclass::" +msgstr "" +"Якщо лише деякі компоненти є абстрактними, лише ці компоненти потрібно " +"оновити, щоб створити конкретну властивість у підкласі::" + +msgid "" +"class D(C):\n" +" @C.x.setter\n" +" def x(self, val):\n" +" ..." +msgstr "" + +msgid "The :mod:`!abc` module also provides the following functions:" +msgstr "" + +msgid "Returns the current abstract base class cache token." +msgstr "Повертає поточний маркер кешу абстрактного базового класу." + +msgid "" +"The token is an opaque object (that supports equality testing) identifying " +"the current version of the abstract base class cache for virtual subclasses. " +"The token changes with every call to :meth:`ABCMeta.register` on any ABC." +msgstr "" +"Маркер — це непрозорий об’єкт (який підтримує перевірку рівності), що " +"ідентифікує поточну версію кешу абстрактного базового класу для віртуальних " +"підкласів. Маркер змінюється з кожним викликом :meth:`ABCMeta.register` на " +"будь-якому ABC." + +msgid "" +"A function to recalculate an abstract class's abstraction status. This " +"function should be called if a class's abstract methods have been " +"implemented or changed after it was created. Usually, this function should " +"be called from within a class decorator." +msgstr "" +"Функція для повторного обчислення статусу абстракції абстрактного класу. Цю " +"функцію слід викликати, якщо абстрактні методи класу були реалізовані або " +"змінені після його створення. Зазвичай цю функцію слід викликати з " +"декоратора класу." + +msgid "Returns *cls*, to allow usage as a class decorator." +msgstr "Повертає *cls*, щоб дозволити використання як декоратора класу." + +msgid "If *cls* is not an instance of :class:`ABCMeta`, does nothing." +msgstr "Якщо *cls* не є екземпляром :class:`ABCMeta`, нічого не робить." + +msgid "" +"This function assumes that *cls*'s superclasses are already updated. It does " +"not update any subclasses." +msgstr "" +"Ця функція передбачає, що суперкласи *cls* вже оновлені. Він не оновлює " +"жодних підкласів." + +msgid "Footnotes" +msgstr "Виноски" + +msgid "" +"C++ programmers should note that Python's virtual base class concept is not " +"the same as C++'s." +msgstr "" +"Програмісти на C++ повинні мати на увазі, що концепція віртуального базового " +"класу Python не збігається з концепцією C++." diff --git a/library/aifc.po b/library/aifc.po new file mode 100644 index 000000000..d48d254f4 --- /dev/null +++ b/library/aifc.po @@ -0,0 +1,36 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2024-11-19 01:02+0000\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!aifc` --- Read and write AIFF and AIFC files" +msgstr "" + +msgid "" +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." +msgstr "" + +msgid "" +"The last version of Python that provided the :mod:`!aifc` module was `Python " +"3.12 `_." +msgstr "" diff --git a/library/allos.po b/library/allos.po new file mode 100644 index 000000000..44f151ff7 --- /dev/null +++ b/library/allos.po @@ -0,0 +1,42 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:54+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Generic Operating System Services" +msgstr "Загальні служби операційної системи" + +msgid "" +"The modules described in this chapter provide interfaces to operating system " +"features that are available on (almost) all operating systems, such as files " +"and a clock. The interfaces are generally modeled after the Unix or C " +"interfaces, but they are available on most other systems as well. Here's an " +"overview:" +msgstr "" +"Модулі, описані в цьому розділі, забезпечують інтерфейси для функцій " +"операційної системи, які доступні (майже) у всіх операційних системах, " +"наприклад файли та годинник. Інтерфейси, як правило, моделюються за " +"інтерфейсами Unix або C, але вони також доступні в більшості інших систем. " +"Ось огляд:" diff --git a/library/archiving.po b/library/archiving.po new file mode 100644 index 000000000..d4643cec6 --- /dev/null +++ b/library/archiving.po @@ -0,0 +1,40 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:54+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Data Compression and Archiving" +msgstr "Стиснення та архівування даних" + +msgid "" +"The modules described in this chapter support data compression with the " +"zlib, gzip, bzip2 and lzma algorithms, and the creation of ZIP- and tar-" +"format archives. See also :ref:`archiving-operations` provided by the :mod:" +"`shutil` module." +msgstr "" +"Модулі, описані в цьому розділі, підтримують стиснення даних за допомогою " +"алгоритмів zlib, gzip, bzip2 і lzma, а також створення архівів у форматах " +"ZIP і tar. Дивіться також :ref:`archiving-operations`, надані модулем :mod:" +"`shutil`." diff --git a/library/argparse.po b/library/argparse.po new file mode 100644 index 000000000..cdc62774a --- /dev/null +++ b/library/argparse.po @@ -0,0 +1,2992 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:54+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "" +":mod:`!argparse` --- Parser for command-line options, arguments and " +"subcommands" +msgstr "" + +msgid "**Source code:** :source:`Lib/argparse.py`" +msgstr "**Вихідний код:** :source:`Lib/argparse.py`" + +msgid "" +"While :mod:`argparse` is the default recommended standard library module for " +"implementing basic command line applications, authors with more exacting " +"requirements for exactly how their command line applications behave may find " +"it doesn't provide the necessary level of control. Refer to :ref:`choosing-" +"an-argument-parser` for alternatives to consider when ``argparse`` doesn't " +"support behaviors that the application requires (such as entirely disabling " +"support for interspersed options and positional arguments, or accepting " +"option parameter values that start with ``-`` even when they correspond to " +"another defined option)." +msgstr "" + +msgid "Tutorial" +msgstr "Підручник" + +msgid "" +"This page contains the API reference information. For a more gentle " +"introduction to Python command-line parsing, have a look at the :ref:" +"`argparse tutorial `." +msgstr "" +"Ця сторінка містить довідкову інформацію про API. Для більш обережного " +"ознайомлення з розбором командного рядка Python перегляньте :ref:`argparse " +"tutorial `." + +msgid "" +"The :mod:`!argparse` module makes it easy to write user-friendly command-" +"line interfaces. The program defines what arguments it requires, and :mod:`!" +"argparse` will figure out how to parse those out of :data:`sys.argv`. The :" +"mod:`!argparse` module also automatically generates help and usage " +"messages. The module will also issue errors when users give the program " +"invalid arguments." +msgstr "" + +msgid "" +"The :mod:`!argparse` module's support for command-line interfaces is built " +"around an instance of :class:`argparse.ArgumentParser`. It is a container " +"for argument specifications and has options that apply to the parser as " +"whole::" +msgstr "" + +msgid "" +"parser = argparse.ArgumentParser(\n" +" prog='ProgramName',\n" +" description='What the program does',\n" +" epilog='Text at the bottom of help')" +msgstr "" + +msgid "" +"The :meth:`ArgumentParser.add_argument` method attaches individual argument " +"specifications to the parser. It supports positional arguments, options " +"that accept values, and on/off flags::" +msgstr "" + +msgid "" +"parser.add_argument('filename') # positional argument\n" +"parser.add_argument('-c', '--count') # option that takes a value\n" +"parser.add_argument('-v', '--verbose',\n" +" action='store_true') # on/off flag" +msgstr "" + +msgid "" +"The :meth:`ArgumentParser.parse_args` method runs the parser and places the " +"extracted data in a :class:`argparse.Namespace` object::" +msgstr "" + +msgid "" +"args = parser.parse_args()\n" +"print(args.filename, args.count, args.verbose)" +msgstr "" + +msgid "" +"If you're looking for a guide about how to upgrade :mod:`optparse` code to :" +"mod:`!argparse`, see :ref:`Upgrading Optparse Code `." +msgstr "" + +msgid "ArgumentParser objects" +msgstr "Об’єкти ArgumentParser" + +msgid "" +"Create a new :class:`ArgumentParser` object. All parameters should be passed " +"as keyword arguments. Each parameter has its own more detailed description " +"below, but in short they are:" +msgstr "" +"Створіть новий об’єкт :class:`ArgumentParser`. Усі параметри слід передати " +"як аргументи ключового слова. Кожен параметр має власний більш детальний " +"опис нижче, але коротко вони:" + +msgid "" +"prog_ - The name of the program (default: ``os.path.basename(sys.argv[0])``)" +msgstr "" +"prog_ - назва програми (за замовчуванням: ``os.path.basename(sys.argv[0])``)" + +msgid "" +"usage_ - The string describing the program usage (default: generated from " +"arguments added to parser)" +msgstr "" +"usage_ - рядок, що описує використання програми (за замовчуванням: " +"генерується з аргументів, доданих до аналізатора)" + +msgid "" +"description_ - Text to display before the argument help (by default, no text)" +msgstr "" + +msgid "epilog_ - Text to display after the argument help (by default, no text)" +msgstr "" + +msgid "" +"parents_ - A list of :class:`ArgumentParser` objects whose arguments should " +"also be included" +msgstr "" +"Parents_ - список об'єктів :class:`ArgumentParser`, аргументи яких також " +"мають бути включені" + +msgid "formatter_class_ - A class for customizing the help output" +msgstr "formatter_class_ - клас для налаштування виведення довідки" + +msgid "" +"prefix_chars_ - The set of characters that prefix optional arguments " +"(default: '-')" +msgstr "" +"prefix_chars_ - набір символів, які є префіксом необов'язкових аргументів " +"(за замовчуванням: '-')" + +msgid "" +"fromfile_prefix_chars_ - The set of characters that prefix files from which " +"additional arguments should be read (default: ``None``)" +msgstr "" +"fromfile_prefix_chars_ - набір символів, які є префіксами файлів, з яких " +"слід читати додаткові аргументи (за замовчуванням: ``None``)" + +msgid "" +"argument_default_ - The global default value for arguments (default: " +"``None``)" +msgstr "" +"argument_default_ - глобальне значення за замовчуванням для аргументів (за " +"замовчуванням: ``None``)" + +msgid "" +"conflict_handler_ - The strategy for resolving conflicting optionals " +"(usually unnecessary)" +msgstr "" +"конфлікт_обробник_ - стратегія вирішення конфліктних опцій (зазвичай " +"непотрібних)" + +msgid "" +"add_help_ - Add a ``-h/--help`` option to the parser (default: ``True``)" +msgstr "" +"add_help_ - додає опцію ``-h/--help`` до аналізатора (за замовчуванням: " +"``True``)" + +msgid "" +"allow_abbrev_ - Allows long options to be abbreviated if the abbreviation is " +"unambiguous. (default: ``True``)" +msgstr "" +"allow_abbrev_ - Дозволяє скорочувати довгі параметри, якщо скорочення є " +"однозначним. (за замовчуванням: ``True``)" + +msgid "" +"exit_on_error_ - Determines whether or not :class:`!ArgumentParser` exits " +"with error info when an error occurs. (default: ``True``)" +msgstr "" + +msgid "*allow_abbrev* parameter was added." +msgstr "Додано параметр *allow_abbrev*." + +msgid "" +"In previous versions, *allow_abbrev* also disabled grouping of short flags " +"such as ``-vv`` to mean ``-v -v``." +msgstr "" +"У попередніх версіях *allow_abbrev* також вимикав групування коротких " +"прапорців, таких як ``-vv``, щоб означати ``-v -v``." + +msgid "*exit_on_error* parameter was added." +msgstr "Додано параметр *exit_on_error*." + +msgid "The following sections describe how each of these are used." +msgstr "У наступних розділах описано, як використовується кожен із них." + +msgid "prog" +msgstr "прог" + +msgid "" +"By default, :class:`ArgumentParser` calculates the name of the program to " +"display in help messages depending on the way the Python interpreter was run:" +msgstr "" + +msgid "" +"The :func:`base name ` of ``sys.argv[0]`` if a file was " +"passed as argument." +msgstr "" + +msgid "" +"The Python interpreter name followed by ``sys.argv[0]`` if a directory or a " +"zipfile was passed as argument." +msgstr "" + +msgid "" +"The Python interpreter name followed by ``-m`` followed by the module or " +"package name if the :option:`-m` option was used." +msgstr "" + +msgid "" +"This default is almost always desirable because it will make the help " +"messages match the string that was used to invoke the program on the command " +"line. However, to change this default behavior, another value can be " +"supplied using the ``prog=`` argument to :class:`ArgumentParser`::" +msgstr "" + +msgid "" +">>> parser = argparse.ArgumentParser(prog='myprogram')\n" +">>> parser.print_help()\n" +"usage: myprogram [-h]\n" +"\n" +"options:\n" +" -h, --help show this help message and exit" +msgstr "" + +msgid "" +"Note that the program name, whether determined from ``sys.argv[0]`` or from " +"the ``prog=`` argument, is available to help messages using the ``%(prog)s`` " +"format specifier." +msgstr "" +"Зауважте, що ім’я програми, незалежно від того, чи визначається з ``sys." +"argv[0]`` або з ``prog=`` аргументу, доступне для довідкових повідомлень за " +"допомогою специфікатора формату ``%(prog)s``." + +msgid "" +">>> parser = argparse.ArgumentParser(prog='myprogram')\n" +">>> parser.add_argument('--foo', help='foo of the %(prog)s program')\n" +">>> parser.print_help()\n" +"usage: myprogram [-h] [--foo FOO]\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" --foo FOO foo of the myprogram program" +msgstr "" + +msgid "usage" +msgstr "використання" + +msgid "" +"By default, :class:`ArgumentParser` calculates the usage message from the " +"arguments it contains. The default message can be overridden with the " +"``usage=`` keyword argument::" +msgstr "" + +msgid "" +">>> parser = argparse.ArgumentParser(prog='PROG', usage='%(prog)s " +"[options]')\n" +">>> parser.add_argument('--foo', nargs='?', help='foo help')\n" +">>> parser.add_argument('bar', nargs='+', help='bar help')\n" +">>> parser.print_help()\n" +"usage: PROG [options]\n" +"\n" +"positional arguments:\n" +" bar bar help\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" --foo [FOO] foo help" +msgstr "" + +msgid "" +"The ``%(prog)s`` format specifier is available to fill in the program name " +"in your usage messages." +msgstr "" +"Специфікатор формату ``%(prog)s`` доступний для заповнення назви програми у " +"ваших повідомленнях про використання." + +msgid "description" +msgstr "опис" + +msgid "" +"Most calls to the :class:`ArgumentParser` constructor will use the " +"``description=`` keyword argument. This argument gives a brief description " +"of what the program does and how it works. In help messages, the " +"description is displayed between the command-line usage string and the help " +"messages for the various arguments." +msgstr "" + +msgid "" +"By default, the description will be line-wrapped so that it fits within the " +"given space. To change this behavior, see the formatter_class_ argument." +msgstr "" +"За замовчуванням опис буде перенесено на рядок, щоб він поміщався в заданий " +"простір. Щоб змінити цю поведінку, перегляньте аргумент formatter_class_." + +msgid "epilog" +msgstr "епілог" + +msgid "" +"Some programs like to display additional description of the program after " +"the description of the arguments. Such text can be specified using the " +"``epilog=`` argument to :class:`ArgumentParser`::" +msgstr "" +"Деякі програми люблять відображати додатковий опис програми після опису " +"аргументів. Такий текст можна вказати за допомогою аргументу ``epilog=`` " +"для :class:`ArgumentParser`::" + +msgid "" +">>> parser = argparse.ArgumentParser(\n" +"... description='A foo that bars',\n" +"... epilog=\"And that's how you'd foo a bar\")\n" +">>> parser.print_help()\n" +"usage: argparse.py [-h]\n" +"\n" +"A foo that bars\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +"\n" +"And that's how you'd foo a bar" +msgstr "" + +msgid "" +"As with the description_ argument, the ``epilog=`` text is by default line-" +"wrapped, but this behavior can be adjusted with the formatter_class_ " +"argument to :class:`ArgumentParser`." +msgstr "" +"Як і в випадку з аргументом description_, текст ``epilog=`` за замовчуванням " +"переносить рядки, але цю поведінку можна налаштувати за допомогою аргументу " +"formatter_class_ на :class:`ArgumentParser`." + +msgid "parents" +msgstr "батьки" + +msgid "" +"Sometimes, several parsers share a common set of arguments. Rather than " +"repeating the definitions of these arguments, a single parser with all the " +"shared arguments and passed to ``parents=`` argument to :class:" +"`ArgumentParser` can be used. The ``parents=`` argument takes a list of :" +"class:`ArgumentParser` objects, collects all the positional and optional " +"actions from them, and adds these actions to the :class:`ArgumentParser` " +"object being constructed::" +msgstr "" +"Іноді кілька аналізаторів використовують загальний набір аргументів. Замість " +"того, щоб повторювати визначення цих аргументів, можна використати єдиний " +"синтаксичний аналізатор із усіма спільними аргументами та переданим " +"аргументом ``parents=`` для :class:`ArgumentParser`. Аргумент ``parents=`` " +"бере список об’єктів :class:`ArgumentParser`, збирає всі позиційні та " +"необов’язкові дії з них і додає ці дії до об’єкта :class:`ArgumentParser`, " +"який створюється::" + +msgid "" +">>> parent_parser = argparse.ArgumentParser(add_help=False)\n" +">>> parent_parser.add_argument('--parent', type=int)\n" +"\n" +">>> foo_parser = argparse.ArgumentParser(parents=[parent_parser])\n" +">>> foo_parser.add_argument('foo')\n" +">>> foo_parser.parse_args(['--parent', '2', 'XXX'])\n" +"Namespace(foo='XXX', parent=2)\n" +"\n" +">>> bar_parser = argparse.ArgumentParser(parents=[parent_parser])\n" +">>> bar_parser.add_argument('--bar')\n" +">>> bar_parser.parse_args(['--bar', 'YYY'])\n" +"Namespace(bar='YYY', parent=None)" +msgstr "" + +msgid "" +"Note that most parent parsers will specify ``add_help=False``. Otherwise, " +"the :class:`ArgumentParser` will see two ``-h/--help`` options (one in the " +"parent and one in the child) and raise an error." +msgstr "" +"Зауважте, що більшість батьківських аналізаторів вказуватимуть " +"``add_help=False``. Інакше :class:`ArgumentParser` побачить два параметри ``-" +"h/--help`` (один у батьківському і один у дочірньому) і викличе помилку." + +msgid "" +"You must fully initialize the parsers before passing them via ``parents=``. " +"If you change the parent parsers after the child parser, those changes will " +"not be reflected in the child." +msgstr "" +"Ви повинні повністю ініціалізувати аналізатори перед тим, як передавати їх " +"через ``parents=``. Якщо ви змінюєте батьківські аналізатори після " +"дочірнього, ці зміни не відображатимуться в дочірньому." + +msgid "formatter_class" +msgstr "formatter_class" + +msgid "" +":class:`ArgumentParser` objects allow the help formatting to be customized " +"by specifying an alternate formatting class. Currently, there are four such " +"classes:" +msgstr "" +"Об’єкти :class:`ArgumentParser` дозволяють налаштувати форматування довідки " +"шляхом визначення альтернативного класу форматування. На даний момент існує " +"чотири таких класи:" + +msgid "" +":class:`RawDescriptionHelpFormatter` and :class:`RawTextHelpFormatter` give " +"more control over how textual descriptions are displayed. By default, :class:" +"`ArgumentParser` objects line-wrap the description_ and epilog_ texts in " +"command-line help messages::" +msgstr "" +":class:`RawDescriptionHelpFormatter` і :class:`RawTextHelpFormatter` дають " +"більше контролю над тим, як відображаються текстові описи. За замовчуванням " +"об’єкти :class:`ArgumentParser` переносять тексти description_ і epilog_ у " +"довідкові повідомлення командного рядка:" + +msgid "" +">>> parser = argparse.ArgumentParser(\n" +"... prog='PROG',\n" +"... description='''this description\n" +"... was indented weird\n" +"... but that is okay''',\n" +"... epilog='''\n" +"... likewise for this epilog whose whitespace will\n" +"... be cleaned up and whose words will be wrapped\n" +"... across a couple lines''')\n" +">>> parser.print_help()\n" +"usage: PROG [-h]\n" +"\n" +"this description was indented weird but that is okay\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +"\n" +"likewise for this epilog whose whitespace will be cleaned up and whose " +"words\n" +"will be wrapped across a couple lines" +msgstr "" + +msgid "" +"Passing :class:`RawDescriptionHelpFormatter` as ``formatter_class=`` " +"indicates that description_ and epilog_ are already correctly formatted and " +"should not be line-wrapped::" +msgstr "" +"Передача :class:`RawDescriptionHelpFormatter` як ``formatter_class=`` вказує " +"на те, що description_ і epilog_ вже правильно відформатовані і не повинні " +"бути перенесені в рядок::" + +msgid "" +">>> parser = argparse.ArgumentParser(\n" +"... prog='PROG',\n" +"... formatter_class=argparse.RawDescriptionHelpFormatter,\n" +"... description=textwrap.dedent('''\\\n" +"... Please do not mess up this text!\n" +"... --------------------------------\n" +"... I have indented it\n" +"... exactly the way\n" +"... I want it\n" +"... '''))\n" +">>> parser.print_help()\n" +"usage: PROG [-h]\n" +"\n" +"Please do not mess up this text!\n" +"--------------------------------\n" +" I have indented it\n" +" exactly the way\n" +" I want it\n" +"\n" +"options:\n" +" -h, --help show this help message and exit" +msgstr "" + +msgid "" +":class:`RawTextHelpFormatter` maintains whitespace for all sorts of help " +"text, including argument descriptions. However, multiple newlines are " +"replaced with one. If you wish to preserve multiple blank lines, add spaces " +"between the newlines." +msgstr "" + +msgid "" +":class:`ArgumentDefaultsHelpFormatter` automatically adds information about " +"default values to each of the argument help messages::" +msgstr "" +":class:`ArgumentDefaultsHelpFormatter` автоматично додає інформацію про " +"значення за замовчуванням до кожного довідкового повідомлення аргументу::" + +msgid "" +">>> parser = argparse.ArgumentParser(\n" +"... prog='PROG',\n" +"... formatter_class=argparse.ArgumentDefaultsHelpFormatter)\n" +">>> parser.add_argument('--foo', type=int, default=42, help='FOO!')\n" +">>> parser.add_argument('bar', nargs='*', default=[1, 2, 3], help='BAR!')\n" +">>> parser.print_help()\n" +"usage: PROG [-h] [--foo FOO] [bar ...]\n" +"\n" +"positional arguments:\n" +" bar BAR! (default: [1, 2, 3])\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" --foo FOO FOO! (default: 42)" +msgstr "" + +msgid "" +":class:`MetavarTypeHelpFormatter` uses the name of the type_ argument for " +"each argument as the display name for its values (rather than using the " +"dest_ as the regular formatter does)::" +msgstr "" +":class:`MetavarTypeHelpFormatter` використовує ім’я аргументу type_ для " +"кожного аргументу як відображуване ім’я для його значень (замість " +"використання dest_, як це робить звичайний засіб форматування):" + +msgid "" +">>> parser = argparse.ArgumentParser(\n" +"... prog='PROG',\n" +"... formatter_class=argparse.MetavarTypeHelpFormatter)\n" +">>> parser.add_argument('--foo', type=int)\n" +">>> parser.add_argument('bar', type=float)\n" +">>> parser.print_help()\n" +"usage: PROG [-h] [--foo int] float\n" +"\n" +"positional arguments:\n" +" float\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" --foo int" +msgstr "" + +msgid "prefix_chars" +msgstr "prefix_chars" + +msgid "" +"Most command-line options will use ``-`` as the prefix, e.g. ``-f/--foo``. " +"Parsers that need to support different or additional prefix characters, e.g. " +"for options like ``+f`` or ``/foo``, may specify them using the " +"``prefix_chars=`` argument to the :class:`ArgumentParser` constructor::" +msgstr "" + +msgid "" +">>> parser = argparse.ArgumentParser(prog='PROG', prefix_chars='-+')\n" +">>> parser.add_argument('+f')\n" +">>> parser.add_argument('++bar')\n" +">>> parser.parse_args('+f X ++bar Y'.split())\n" +"Namespace(bar='Y', f='X')" +msgstr "" + +msgid "" +"The ``prefix_chars=`` argument defaults to ``'-'``. Supplying a set of " +"characters that does not include ``-`` will cause ``-f/--foo`` options to be " +"disallowed." +msgstr "" +"Аргумент ``prefix_chars=`` за умовчанням має значення ``'-'``. Якщо вказати " +"набір символів, який не містить ``-``, параметри ``-f/--foo`` будуть " +"заборонені." + +msgid "fromfile_prefix_chars" +msgstr "fromfile_prefix_chars" + +msgid "" +"Sometimes, when dealing with a particularly long argument list, it may make " +"sense to keep the list of arguments in a file rather than typing it out at " +"the command line. If the ``fromfile_prefix_chars=`` argument is given to " +"the :class:`ArgumentParser` constructor, then arguments that start with any " +"of the specified characters will be treated as files, and will be replaced " +"by the arguments they contain. For example::" +msgstr "" + +msgid "" +">>> with open('args.txt', 'w', encoding=sys.getfilesystemencoding()) as fp:\n" +"... fp.write('-f\\nbar')\n" +"...\n" +">>> parser = argparse.ArgumentParser(fromfile_prefix_chars='@')\n" +">>> parser.add_argument('-f')\n" +">>> parser.parse_args(['-f', 'foo', '@args.txt'])\n" +"Namespace(f='bar')" +msgstr "" + +msgid "" +"Arguments read from a file must by default be one per line (but see also :" +"meth:`~ArgumentParser.convert_arg_line_to_args`) and are treated as if they " +"were in the same place as the original file referencing argument on the " +"command line. So in the example above, the expression ``['-f', 'foo', " +"'@args.txt']`` is considered equivalent to the expression ``['-f', 'foo', '-" +"f', 'bar']``." +msgstr "" +"Аргументи, зчитані з файлу, за замовчуванням мають бути по одному на рядок " +"(але дивіться також :meth:`~ArgumentParser.convert_arg_line_to_args`) і " +"обробляються так, ніби вони знаходяться в тому самому місці, що й вихідний " +"аргумент посилання на файл у командному рядку. Отже, у наведеному вище " +"прикладі вираз ``['-f', 'foo', '@args.txt']`` вважається еквівалентним " +"виразу ``['-f', 'foo', '-f ', 'бар']``." + +msgid "" +":class:`ArgumentParser` uses :term:`filesystem encoding and error handler` " +"to read the file containing arguments." +msgstr "" + +msgid "" +"The ``fromfile_prefix_chars=`` argument defaults to ``None``, meaning that " +"arguments will never be treated as file references." +msgstr "" +"Аргумент ``fromfile_prefix_chars=`` за умовчанням має значення ``None``, що " +"означає, що аргументи ніколи не розглядатимуться як посилання на файли." + +msgid "" +":class:`ArgumentParser` changed encoding and errors to read arguments files " +"from default (e.g. :func:`locale.getpreferredencoding(False) ` and ``\"strict\"``) to the :term:`filesystem encoding " +"and error handler`. Arguments file should be encoded in UTF-8 instead of " +"ANSI Codepage on Windows." +msgstr "" + +msgid "argument_default" +msgstr "аргумент_за замовчуванням" + +msgid "" +"Generally, argument defaults are specified either by passing a default to :" +"meth:`~ArgumentParser.add_argument` or by calling the :meth:`~ArgumentParser." +"set_defaults` methods with a specific set of name-value pairs. Sometimes " +"however, it may be useful to specify a single parser-wide default for " +"arguments. This can be accomplished by passing the ``argument_default=`` " +"keyword argument to :class:`ArgumentParser`. For example, to globally " +"suppress attribute creation on :meth:`~ArgumentParser.parse_args` calls, we " +"supply ``argument_default=SUPPRESS``::" +msgstr "" +"Як правило, параметри за замовчуванням вказуються або передачею значення за " +"замовчуванням :meth:`~ArgumentParser.add_argument`, або викликом методів :" +"meth:`~ArgumentParser.set_defaults` із певним набором пар ім’я-значення. " +"Іноді, однак, може бути корисно вказати єдине значення за замовчуванням для " +"параметрів аналізатора. Це можна зробити, передавши аргумент ключового слова " +"``argument_default=`` до :class:`ArgumentParser`. Наприклад, щоб глобально " +"заборонити створення атрибутів у викликах :meth:`~ArgumentParser." +"parse_args`, ми надаємо ``argument_default=SUPPRESS``::" + +msgid "" +">>> parser = argparse.ArgumentParser(argument_default=argparse.SUPPRESS)\n" +">>> parser.add_argument('--foo')\n" +">>> parser.add_argument('bar', nargs='?')\n" +">>> parser.parse_args(['--foo', '1', 'BAR'])\n" +"Namespace(bar='BAR', foo='1')\n" +">>> parser.parse_args([])\n" +"Namespace()" +msgstr "" + +msgid "allow_abbrev" +msgstr "дозволити_скорочене" + +msgid "" +"Normally, when you pass an argument list to the :meth:`~ArgumentParser." +"parse_args` method of an :class:`ArgumentParser`, it :ref:`recognizes " +"abbreviations ` of long options." +msgstr "" +"Зазвичай, коли ви передаєте список аргументів у метод :meth:`~ArgumentParser." +"parse_args` :class:`ArgumentParser`, він :ref:`розпізнає абревіатури ` довгих параметрів." + +msgid "This feature can be disabled by setting ``allow_abbrev`` to ``False``::" +msgstr "" +"Цю функцію можна вимкнути, встановивши для параметра ``allow_abbrev`` " +"значення ``False``::" + +msgid "" +">>> parser = argparse.ArgumentParser(prog='PROG', allow_abbrev=False)\n" +">>> parser.add_argument('--foobar', action='store_true')\n" +">>> parser.add_argument('--foonley', action='store_false')\n" +">>> parser.parse_args(['--foon'])\n" +"usage: PROG [-h] [--foobar] [--foonley]\n" +"PROG: error: unrecognized arguments: --foon" +msgstr "" + +msgid "conflict_handler" +msgstr "обробник_конфлікту" + +msgid "" +":class:`ArgumentParser` objects do not allow two actions with the same " +"option string. By default, :class:`ArgumentParser` objects raise an " +"exception if an attempt is made to create an argument with an option string " +"that is already in use::" +msgstr "" +"Об’єкти :class:`ArgumentParser` не дозволяють дві дії з однаковим рядком " +"параметрів. За замовчуванням об’єкти :class:`ArgumentParser` викликають " +"виняток, якщо робиться спроба створити аргумент із рядком параметрів, який " +"уже використовується:" + +msgid "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('-f', '--foo', help='old foo help')\n" +">>> parser.add_argument('--foo', help='new foo help')\n" +"Traceback (most recent call last):\n" +" ..\n" +"ArgumentError: argument --foo: conflicting option string(s): --foo" +msgstr "" + +msgid "" +"Sometimes (e.g. when using parents_) it may be useful to simply override any " +"older arguments with the same option string. To get this behavior, the " +"value ``'resolve'`` can be supplied to the ``conflict_handler=`` argument " +"of :class:`ArgumentParser`::" +msgstr "" +"Іноді (наприклад, під час використання батьків_) може бути корисним просто " +"замінити будь-які старіші аргументи тим самим рядком параметрів. Щоб " +"отримати таку поведінку, значення ``'resolve'`` можна надати аргументу " +"``conflict_handler=`` :class:`ArgumentParser`::" + +msgid "" +">>> parser = argparse.ArgumentParser(prog='PROG', " +"conflict_handler='resolve')\n" +">>> parser.add_argument('-f', '--foo', help='old foo help')\n" +">>> parser.add_argument('--foo', help='new foo help')\n" +">>> parser.print_help()\n" +"usage: PROG [-h] [-f FOO] [--foo FOO]\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" -f FOO old foo help\n" +" --foo FOO new foo help" +msgstr "" + +msgid "" +"Note that :class:`ArgumentParser` objects only remove an action if all of " +"its option strings are overridden. So, in the example above, the old ``-f/--" +"foo`` action is retained as the ``-f`` action, because only the ``--foo`` " +"option string was overridden." +msgstr "" +"Зауважте, що об’єкти :class:`ArgumentParser` видаляють дію лише в тому " +"випадку, якщо перевизначено всі рядки параметрів. Отже, у наведеному вище " +"прикладі стара дія ``-f/--foo`` зберігається як дія ``-f``, тому що було " +"замінено лише рядок опції ``--foo``." + +msgid "add_help" +msgstr "add_help" + +msgid "" +"By default, :class:`ArgumentParser` objects add an option which simply " +"displays the parser's help message. If ``-h`` or ``--help`` is supplied at " +"the command line, the :class:`!ArgumentParser` help will be printed." +msgstr "" + +msgid "" +"Occasionally, it may be useful to disable the addition of this help option. " +"This can be achieved by passing ``False`` as the ``add_help=`` argument to :" +"class:`ArgumentParser`::" +msgstr "" +"Іноді може бути корисним вимкнути додавання цієї опції довідки. Цього можна " +"досягти, передавши ``False`` як аргумент ``add_help=`` до :class:" +"`ArgumentParser`::" + +msgid "" +">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" +">>> parser.add_argument('--foo', help='foo help')\n" +">>> parser.print_help()\n" +"usage: PROG [--foo FOO]\n" +"\n" +"options:\n" +" --foo FOO foo help" +msgstr "" + +msgid "" +"The help option is typically ``-h/--help``. The exception to this is if the " +"``prefix_chars=`` is specified and does not include ``-``, in which case ``-" +"h`` and ``--help`` are not valid options. In this case, the first character " +"in ``prefix_chars`` is used to prefix the help options::" +msgstr "" +"Параметром довідки зазвичай є ``-h/--help``. Винятком є те, що " +"``prefix_chars=`` указано і не містить ``-``, у цьому випадку ``-h`` і ``--" +"help`` не є дійсними параметрами. У цьому випадку перший символ у " +"``prefix_chars`` використовується для префіксу параметрів довідки::" + +msgid "" +">>> parser = argparse.ArgumentParser(prog='PROG', prefix_chars='+/')\n" +">>> parser.print_help()\n" +"usage: PROG [+h]\n" +"\n" +"options:\n" +" +h, ++help show this help message and exit" +msgstr "" + +msgid "exit_on_error" +msgstr "exit_on_error" + +msgid "" +"Normally, when you pass an invalid argument list to the :meth:" +"`~ArgumentParser.parse_args` method of an :class:`ArgumentParser`, it will " +"print a *message* to :data:`sys.stderr` and exit with a status code of 2." +msgstr "" + +msgid "" +"If the user would like to catch errors manually, the feature can be enabled " +"by setting ``exit_on_error`` to ``False``::" +msgstr "" +"Якщо користувач хоче виловлювати помилки вручну, цю функцію можна ввімкнути, " +"встановивши для ``exit_on_error`` значення ``False``::" + +msgid "" +">>> parser = argparse.ArgumentParser(exit_on_error=False)\n" +">>> parser.add_argument('--integers', type=int)\n" +"_StoreAction(option_strings=['--integers'], dest='integers', nargs=None, " +"const=None, default=None, type=, choices=None, help=None, " +"metavar=None)\n" +">>> try:\n" +"... parser.parse_args('--integers a'.split())\n" +"... except argparse.ArgumentError:\n" +"... print('Catching an argumentError')\n" +"...\n" +"Catching an argumentError" +msgstr "" + +msgid "The add_argument() method" +msgstr "Метод add_argument()." + +msgid "" +"Define how a single command-line argument should be parsed. Each parameter " +"has its own more detailed description below, but in short they are:" +msgstr "" +"Визначте, як слід аналізувати один аргумент командного рядка. Кожен параметр " +"має власний більш детальний опис нижче, але коротко вони:" + +msgid "" +"`name or flags`_ - Either a name or a list of option strings, e.g. ``'foo'`` " +"or ``'-f', '--foo'``." +msgstr "" + +msgid "" +"action_ - The basic type of action to be taken when this argument is " +"encountered at the command line." +msgstr "" +"action_ - основний тип дії, яку потрібно виконати, коли цей аргумент " +"зустрічається в командному рядку." + +msgid "nargs_ - The number of command-line arguments that should be consumed." +msgstr "" +"nargs_ – кількість аргументів командного рядка, які мають бути використані." + +msgid "" +"const_ - A constant value required by some action_ and nargs_ selections." +msgstr "" +"const_ – постійне значення, необхідне для вибору деяких action_ і nargs_." + +msgid "" +"default_ - The value produced if the argument is absent from the command " +"line and if it is absent from the namespace object." +msgstr "" +"default_ – значення, створене, якщо аргумент відсутній у командному рядку та " +"якщо він відсутній в об’єкті простору імен." + +msgid "" +"type_ - The type to which the command-line argument should be converted." +msgstr "type_ – тип, до якого потрібно перетворити аргумент командного рядка." + +msgid "choices_ - A sequence of the allowable values for the argument." +msgstr "" + +msgid "" +"required_ - Whether or not the command-line option may be omitted (optionals " +"only)." +msgstr "" +"required_ – чи можна пропустити параметр командного рядка (тільки " +"необов’язковий)." + +msgid "help_ - A brief description of what the argument does." +msgstr "help_ - короткий опис того, що робить аргумент." + +msgid "metavar_ - A name for the argument in usage messages." +msgstr "metavar_ – назва аргументу в повідомленнях про використання." + +msgid "" +"dest_ - The name of the attribute to be added to the object returned by :" +"meth:`parse_args`." +msgstr "" +"dest_ – ім’я атрибута, який буде додано до об’єкта, повернутого :meth:" +"`parse_args`." + +msgid "deprecated_ - Whether or not use of the argument is deprecated." +msgstr "" + +msgid "name or flags" +msgstr "назву чи прапори" + +msgid "" +"The :meth:`~ArgumentParser.add_argument` method must know whether an " +"optional argument, like ``-f`` or ``--foo``, or a positional argument, like " +"a list of filenames, is expected. The first arguments passed to :meth:" +"`~ArgumentParser.add_argument` must therefore be either a series of flags, " +"or a simple argument name." +msgstr "" + +msgid "For example, an optional argument could be created like::" +msgstr "" + +msgid ">>> parser.add_argument('-f', '--foo')" +msgstr "" + +msgid "while a positional argument could be created like::" +msgstr "тоді як позиційний аргумент може бути створений таким чином::" + +msgid ">>> parser.add_argument('bar')" +msgstr "" + +msgid "" +"When :meth:`~ArgumentParser.parse_args` is called, optional arguments will " +"be identified by the ``-`` prefix, and the remaining arguments will be " +"assumed to be positional::" +msgstr "" +"Під час виклику :meth:`~ArgumentParser.parse_args` необов’язкові аргументи " +"ідентифікуються префіксом ``-``, а решта аргументів вважатиметься " +"позиційними:" + +msgid "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('-f', '--foo')\n" +">>> parser.add_argument('bar')\n" +">>> parser.parse_args(['BAR'])\n" +"Namespace(bar='BAR', foo=None)\n" +">>> parser.parse_args(['BAR', '--foo', 'FOO'])\n" +"Namespace(bar='BAR', foo='FOO')\n" +">>> parser.parse_args(['--foo', 'FOO'])\n" +"usage: PROG [-h] [-f FOO] bar\n" +"PROG: error: the following arguments are required: bar" +msgstr "" + +msgid "action" +msgstr "дію" + +msgid "" +":class:`ArgumentParser` objects associate command-line arguments with " +"actions. These actions can do just about anything with the command-line " +"arguments associated with them, though most actions simply add an attribute " +"to the object returned by :meth:`~ArgumentParser.parse_args`. The " +"``action`` keyword argument specifies how the command-line arguments should " +"be handled. The supplied actions are:" +msgstr "" +"Об’єкти :class:`ArgumentParser` пов’язують аргументи командного рядка з " +"діями. Ці дії можуть робити що завгодно з пов’язаними з ними аргументами " +"командного рядка, хоча більшість дій просто додають атрибут до об’єкта, який " +"повертає :meth:`~ArgumentParser.parse_args`. Аргумент ключового слова " +"``action`` визначає, як слід обробляти аргументи командного рядка. Надані " +"дії:" + +msgid "" +"``'store'`` - This just stores the argument's value. This is the default " +"action." +msgstr "" + +msgid "" +"``'store_const'`` - This stores the value specified by the const_ keyword " +"argument; note that the const_ keyword argument defaults to ``None``. The " +"``'store_const'`` action is most commonly used with optional arguments that " +"specify some sort of flag. For example::" +msgstr "" + +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', action='store_const', const=42)\n" +">>> parser.parse_args(['--foo'])\n" +"Namespace(foo=42)" +msgstr "" + +msgid "" +"``'store_true'`` and ``'store_false'`` - These are special cases of " +"``'store_const'`` used for storing the values ``True`` and ``False`` " +"respectively. In addition, they create default values of ``False`` and " +"``True`` respectively::" +msgstr "" + +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', action='store_true')\n" +">>> parser.add_argument('--bar', action='store_false')\n" +">>> parser.add_argument('--baz', action='store_false')\n" +">>> parser.parse_args('--foo --bar'.split())\n" +"Namespace(foo=True, bar=False, baz=True)" +msgstr "" + +msgid "" +"``'append'`` - This stores a list, and appends each argument value to the " +"list. It is useful to allow an option to be specified multiple times. If the " +"default value is non-empty, the default elements will be present in the " +"parsed value for the option, with any values from the command line appended " +"after those default values. Example usage::" +msgstr "" + +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', action='append')\n" +">>> parser.parse_args('--foo 1 --foo 2'.split())\n" +"Namespace(foo=['1', '2'])" +msgstr "" + +msgid "" +"``'append_const'`` - This stores a list, and appends the value specified by " +"the const_ keyword argument to the list; note that the const_ keyword " +"argument defaults to ``None``. The ``'append_const'`` action is typically " +"useful when multiple arguments need to store constants to the same list. For " +"example::" +msgstr "" + +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--str', dest='types', action='append_const', " +"const=str)\n" +">>> parser.add_argument('--int', dest='types', action='append_const', " +"const=int)\n" +">>> parser.parse_args('--str --int'.split())\n" +"Namespace(types=[, ])" +msgstr "" + +msgid "" +"``'extend'`` - This stores a list and appends each item from the multi-value " +"argument list to it. The ``'extend'`` action is typically used with the " +"nargs_ keyword argument value ``'+'`` or ``'*'``. Note that when nargs_ is " +"``None`` (the default) or ``'?'``, each character of the argument string " +"will be appended to the list. Example usage::" +msgstr "" + +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument(\"--foo\", action=\"extend\", nargs=\"+\", " +"type=str)\n" +">>> parser.parse_args([\"--foo\", \"f1\", \"--foo\", \"f2\", \"f3\", " +"\"f4\"])\n" +"Namespace(foo=['f1', 'f2', 'f3', 'f4'])" +msgstr "" + +msgid "" +"``'count'`` - This counts the number of times a keyword argument occurs. For " +"example, this is useful for increasing verbosity levels::" +msgstr "" +"``'count'`` – підраховує кількість разів, коли виникає аргумент ключового " +"слова. Наприклад, це корисно для збільшення рівнів докладності:" + +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--verbose', '-v', action='count', default=0)\n" +">>> parser.parse_args(['-vvv'])\n" +"Namespace(verbose=3)" +msgstr "" + +msgid "Note, the *default* will be ``None`` unless explicitly set to *0*." +msgstr "" +"Зауважте, *за замовчуванням* буде ``None``, якщо явно не встановлено *0*." + +msgid "" +"``'help'`` - This prints a complete help message for all the options in the " +"current parser and then exits. By default a help action is automatically " +"added to the parser. See :class:`ArgumentParser` for details of how the " +"output is created." +msgstr "" +"``'help'`` - друкує повне повідомлення довідки для всіх параметрів у " +"поточному парсері, а потім завершує роботу. За замовчуванням дія довідки " +"автоматично додається до аналізатора. Дивіться :class:`ArgumentParser` для " +"детальної інформації про те, як створюється вихід." + +msgid "" +"``'version'`` - This expects a ``version=`` keyword argument in the :meth:" +"`~ArgumentParser.add_argument` call, and prints version information and " +"exits when invoked::" +msgstr "" +"``'version'`` – очікується ключовий аргумент ``version=`` у виклику :meth:" +"`~ArgumentParser.add_argument`, друкується інформація про версію та " +"завершується після виклику::" + +msgid "" +">>> import argparse\n" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('--version', action='version', version='%(prog)s " +"2.0')\n" +">>> parser.parse_args(['--version'])\n" +"PROG 2.0" +msgstr "" + +msgid "" +"Only actions that consume command-line arguments (e.g. ``'store'``, " +"``'append'`` or ``'extend'``) can be used with positional arguments." +msgstr "" + +msgid "" +"You may also specify an arbitrary action by passing an :class:`Action` " +"subclass or other object that implements the same interface. The :class:`!" +"BooleanOptionalAction` is available in :mod:`!argparse` and adds support for " +"boolean actions such as ``--foo`` and ``--no-foo``::" +msgstr "" + +msgid "" +">>> import argparse\n" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', action=argparse.BooleanOptionalAction)\n" +">>> parser.parse_args(['--no-foo'])\n" +"Namespace(foo=False)" +msgstr "" + +msgid "" +"The recommended way to create a custom action is to extend :class:`Action`, " +"overriding the :meth:`!__call__` method and optionally the :meth:`!__init__` " +"and :meth:`!format_usage` methods. You can also register custom actions " +"using the :meth:`~ArgumentParser.register` method and reference them by " +"their registered name." +msgstr "" + +msgid "An example of a custom action::" +msgstr "Приклад спеціальної дії::" + +msgid "" +">>> class FooAction(argparse.Action):\n" +"... def __init__(self, option_strings, dest, nargs=None, **kwargs):\n" +"... if nargs is not None:\n" +"... raise ValueError(\"nargs not allowed\")\n" +"... super().__init__(option_strings, dest, **kwargs)\n" +"... def __call__(self, parser, namespace, values, option_string=None):\n" +"... print('%r %r %r' % (namespace, values, option_string))\n" +"... setattr(namespace, self.dest, values)\n" +"...\n" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', action=FooAction)\n" +">>> parser.add_argument('bar', action=FooAction)\n" +">>> args = parser.parse_args('1 --foo 2'.split())\n" +"Namespace(bar=None, foo=None) '1' None\n" +"Namespace(bar='1', foo=None) '2' '--foo'\n" +">>> args\n" +"Namespace(bar='1', foo='2')" +msgstr "" + +msgid "For more details, see :class:`Action`." +msgstr "Для отримання додаткової інформації див. :class:`Action`." + +msgid "nargs" +msgstr "наргс" + +msgid "" +":class:`ArgumentParser` objects usually associate a single command-line " +"argument with a single action to be taken. The ``nargs`` keyword argument " +"associates a different number of command-line arguments with a single " +"action. See also :ref:`specifying-ambiguous-arguments`. The supported values " +"are:" +msgstr "" + +msgid "" +"``N`` (an integer). ``N`` arguments from the command line will be gathered " +"together into a list. For example::" +msgstr "" +"``N`` (ціле число). ``N`` аргументів з командного рядка буде зібрано разом у " +"список. Наприклад::" + +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', nargs=2)\n" +">>> parser.add_argument('bar', nargs=1)\n" +">>> parser.parse_args('c --foo a b'.split())\n" +"Namespace(bar=['c'], foo=['a', 'b'])" +msgstr "" + +msgid "" +"Note that ``nargs=1`` produces a list of one item. This is different from " +"the default, in which the item is produced by itself." +msgstr "" +"Зауважте, що ``nargs=1`` створює список з одного елемента. Це відрізняється " +"від типового, коли елемент створюється сам по собі." + +msgid "" +"``'?'``. One argument will be consumed from the command line if possible, " +"and produced as a single item. If no command-line argument is present, the " +"value from default_ will be produced. Note that for optional arguments, " +"there is an additional case - the option string is present but not followed " +"by a command-line argument. In this case the value from const_ will be " +"produced. Some examples to illustrate this::" +msgstr "" +"``'?'``. Один аргумент буде використано з командного рядка, якщо це можливо, " +"і створено як окремий елемент. Якщо аргумент командного рядка відсутній, " +"буде отримано значення з default_. Зауважте, що для необов’язкових " +"аргументів існує додатковий випадок – рядок параметрів присутній, але не " +"слідує за аргументом командного рядка. У цьому випадку буде отримано " +"значення з const_. Деякі приклади для ілюстрації:" + +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', nargs='?', const='c', default='d')\n" +">>> parser.add_argument('bar', nargs='?', default='d')\n" +">>> parser.parse_args(['XX', '--foo', 'YY'])\n" +"Namespace(bar='XX', foo='YY')\n" +">>> parser.parse_args(['XX', '--foo'])\n" +"Namespace(bar='XX', foo='c')\n" +">>> parser.parse_args([])\n" +"Namespace(bar='d', foo='d')" +msgstr "" + +msgid "" +"One of the more common uses of ``nargs='?'`` is to allow optional input and " +"output files::" +msgstr "" +"Одне з найпоширеніших застосувань ``nargs='?''`` — дозволити додаткові файли " +"введення та виведення:" + +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('infile', nargs='?', type=argparse.FileType('r'),\n" +"... default=sys.stdin)\n" +">>> parser.add_argument('outfile', nargs='?', type=argparse.FileType('w'),\n" +"... default=sys.stdout)\n" +">>> parser.parse_args(['input.txt', 'output.txt'])\n" +"Namespace(infile=<_io.TextIOWrapper name='input.txt' encoding='UTF-8'>,\n" +" outfile=<_io.TextIOWrapper name='output.txt' encoding='UTF-8'>)\n" +">>> parser.parse_args([])\n" +"Namespace(infile=<_io.TextIOWrapper name='' encoding='UTF-8'>,\n" +" outfile=<_io.TextIOWrapper name='' encoding='UTF-8'>)" +msgstr "" + +msgid "" +"``'*'``. All command-line arguments present are gathered into a list. Note " +"that it generally doesn't make much sense to have more than one positional " +"argument with ``nargs='*'``, but multiple optional arguments with " +"``nargs='*'`` is possible. For example::" +msgstr "" +"``'*'``. Усі присутні аргументи командного рядка збираються у список. " +"Зауважте, що зазвичай не має сенсу мати більше одного позиційного аргументу " +"з ``nargs='*'``, але кілька необов'язкових аргументів з ``nargs='*'`` " +"можливі. Наприклад::" + +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', nargs='*')\n" +">>> parser.add_argument('--bar', nargs='*')\n" +">>> parser.add_argument('baz', nargs='*')\n" +">>> parser.parse_args('a b --foo x y --bar 1 2'.split())\n" +"Namespace(bar=['1', '2'], baz=['a', 'b'], foo=['x', 'y'])" +msgstr "" + +msgid "" +"``'+'``. Just like ``'*'``, all command-line args present are gathered into " +"a list. Additionally, an error message will be generated if there wasn't at " +"least one command-line argument present. For example::" +msgstr "" +"``'+'``. Подібно до ``'*'``, усі наявні аргументи командного рядка " +"збираються в список. Крім того, буде створено повідомлення про помилку, якщо " +"не було принаймні одного аргументу командного рядка. Наприклад::" + +msgid "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('foo', nargs='+')\n" +">>> parser.parse_args(['a', 'b'])\n" +"Namespace(foo=['a', 'b'])\n" +">>> parser.parse_args([])\n" +"usage: PROG [-h] foo [foo ...]\n" +"PROG: error: the following arguments are required: foo" +msgstr "" + +msgid "" +"If the ``nargs`` keyword argument is not provided, the number of arguments " +"consumed is determined by the action_. Generally this means a single " +"command-line argument will be consumed and a single item (not a list) will " +"be produced. Actions that do not consume command-line arguments (e.g. " +"``'store_const'``) set ``nargs=0``." +msgstr "" + +msgid "const" +msgstr "конст" + +msgid "" +"The ``const`` argument of :meth:`~ArgumentParser.add_argument` is used to " +"hold constant values that are not read from the command line but are " +"required for the various :class:`ArgumentParser` actions. The two most " +"common uses of it are:" +msgstr "" +"Аргумент ``const`` :meth:`~ArgumentParser.add_argument` використовується для " +"зберігання постійних значень, які не читаються з командного рядка, але " +"потрібні для різних дій :class:`ArgumentParser`. Два найпоширеніші його " +"використання:" + +msgid "" +"When :meth:`~ArgumentParser.add_argument` is called with " +"``action='store_const'`` or ``action='append_const'``. These actions add " +"the ``const`` value to one of the attributes of the object returned by :meth:" +"`~ArgumentParser.parse_args`. See the action_ description for examples. If " +"``const`` is not provided to :meth:`~ArgumentParser.add_argument`, it will " +"receive a default value of ``None``." +msgstr "" + +msgid "" +"When :meth:`~ArgumentParser.add_argument` is called with option strings " +"(like ``-f`` or ``--foo``) and ``nargs='?'``. This creates an optional " +"argument that can be followed by zero or one command-line arguments. When " +"parsing the command line, if the option string is encountered with no " +"command-line argument following it, the value of ``const`` will be assumed " +"to be ``None`` instead. See the nargs_ description for examples." +msgstr "" + +msgid "" +"``const=None`` by default, including when ``action='append_const'`` or " +"``action='store_const'``." +msgstr "" + +msgid "default" +msgstr "за замовчуванням" + +msgid "" +"All optional arguments and some positional arguments may be omitted at the " +"command line. The ``default`` keyword argument of :meth:`~ArgumentParser." +"add_argument`, whose value defaults to ``None``, specifies what value should " +"be used if the command-line argument is not present. For optional arguments, " +"the ``default`` value is used when the option string was not present at the " +"command line::" +msgstr "" +"Усі додаткові аргументи та деякі позиційні аргументи можна пропустити в " +"командному рядку. Аргумент ключового слова ``default`` :meth:" +"`~ArgumentParser.add_argument`, значення якого за замовчуванням ``None``, " +"визначає, яке значення слід використовувати, якщо аргумент командного рядка " +"відсутній. Для необов’язкових аргументів використовується значення ``за " +"замовчуванням``, якщо рядок параметрів відсутній у командному рядку::" + +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', default=42)\n" +">>> parser.parse_args(['--foo', '2'])\n" +"Namespace(foo='2')\n" +">>> parser.parse_args([])\n" +"Namespace(foo=42)" +msgstr "" + +msgid "" +"If the target namespace already has an attribute set, the action *default* " +"will not overwrite it::" +msgstr "" + +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', default=42)\n" +">>> parser.parse_args([], namespace=argparse.Namespace(foo=101))\n" +"Namespace(foo=101)" +msgstr "" + +msgid "" +"If the ``default`` value is a string, the parser parses the value as if it " +"were a command-line argument. In particular, the parser applies any type_ " +"conversion argument, if provided, before setting the attribute on the :class:" +"`Namespace` return value. Otherwise, the parser uses the value as is::" +msgstr "" +"Якщо значенням ``default`` є рядок, синтаксичний аналізатор аналізує " +"значення так, ніби це аргумент командного рядка. Зокрема, синтаксичний " +"аналізатор застосовує будь-який аргумент перетворення type_, якщо він " +"надається, перед встановленням атрибута для значення, що повертається :class:" +"`Namespace`. В іншому випадку аналізатор використовує значення як є::" + +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--length', default='10', type=int)\n" +">>> parser.add_argument('--width', default=10.5, type=int)\n" +">>> parser.parse_args()\n" +"Namespace(length=10, width=10.5)" +msgstr "" + +msgid "" +"For positional arguments with nargs_ equal to ``?`` or ``*``, the " +"``default`` value is used when no command-line argument was present::" +msgstr "" +"Для позиційних аргументів, у яких nargs_ дорівнює ``?`` або ``*``, значення " +"``default`` використовується, якщо аргумент командного рядка відсутній:" + +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('foo', nargs='?', default=42)\n" +">>> parser.parse_args(['a'])\n" +"Namespace(foo='a')\n" +">>> parser.parse_args([])\n" +"Namespace(foo=42)" +msgstr "" + +msgid "" +"For required_ arguments, the ``default`` value is ignored. For example, this " +"applies to positional arguments with nargs_ values other than ``?`` or " +"``*``, or optional arguments marked as ``required=True``." +msgstr "" + +msgid "" +"Providing ``default=argparse.SUPPRESS`` causes no attribute to be added if " +"the command-line argument was not present::" +msgstr "" +"Якщо вказати ``default=argparse.SUPPRESS``, атрибут не буде додано, якщо " +"аргумент командного рядка відсутній:" + +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', default=argparse.SUPPRESS)\n" +">>> parser.parse_args([])\n" +"Namespace()\n" +">>> parser.parse_args(['--foo', '1'])\n" +"Namespace(foo='1')" +msgstr "" + +msgid "type" +msgstr "типу" + +msgid "" +"By default, the parser reads command-line arguments in as simple strings. " +"However, quite often the command-line string should instead be interpreted " +"as another type, such as a :class:`float` or :class:`int`. The ``type`` " +"keyword for :meth:`~ArgumentParser.add_argument` allows any necessary type-" +"checking and type conversions to be performed." +msgstr "" +"За замовчуванням аналізатор читає аргументи командного рядка як прості " +"рядки. Однак досить часто рядок командного рядка слід інтерпретувати як " +"інший тип, наприклад :class:`float` або :class:`int`. Ключове слово ``type`` " +"для :meth:`~ArgumentParser.add_argument` дозволяє виконувати будь-які " +"необхідні перевірки типів і перетворення типів." + +msgid "" +"If the type_ keyword is used with the default_ keyword, the type converter " +"is only applied if the default is a string." +msgstr "" +"Якщо ключове слово type_ використовується з ключовим словом default_, " +"конвертер типів застосовується, лише якщо значенням за замовчуванням є рядок." + +msgid "" +"The argument to ``type`` can be a callable that accepts a single string or " +"the name of a registered type (see :meth:`~ArgumentParser.register`) If the " +"function raises :exc:`ArgumentTypeError`, :exc:`TypeError`, or :exc:" +"`ValueError`, the exception is caught and a nicely formatted error message " +"is displayed. Other exception types are not handled." +msgstr "" + +msgid "Common built-in types and functions can be used as type converters:" +msgstr "" +"Загальні вбудовані типи та функції можна використовувати як перетворювачі " +"типів:" + +msgid "" +"import argparse\n" +"import pathlib\n" +"\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument('count', type=int)\n" +"parser.add_argument('distance', type=float)\n" +"parser.add_argument('street', type=ascii)\n" +"parser.add_argument('code_point', type=ord)\n" +"parser.add_argument('dest_file', type=argparse.FileType('w', " +"encoding='latin-1'))\n" +"parser.add_argument('datapath', type=pathlib.Path)" +msgstr "" + +msgid "User defined functions can be used as well:" +msgstr "Також можна використовувати визначені користувачем функції:" + +msgid "" +">>> def hyphenated(string):\n" +"... return '-'.join([word[:4] for word in string.casefold().split()])\n" +"...\n" +">>> parser = argparse.ArgumentParser()\n" +">>> _ = parser.add_argument('short_title', type=hyphenated)\n" +">>> parser.parse_args(['\"The Tale of Two Cities\"'])\n" +"Namespace(short_title='\"the-tale-of-two-citi')" +msgstr "" + +msgid "" +"The :func:`bool` function is not recommended as a type converter. All it " +"does is convert empty strings to ``False`` and non-empty strings to " +"``True``. This is usually not what is desired." +msgstr "" +"Функцію :func:`bool` не рекомендується використовувати як перетворювач " +"типів. Усе, що він робить, це перетворює порожні рядки на ``False``, а " +"непорожні рядки — на ``True``. Зазвичай це не те, чого хочеться." + +msgid "" +"In general, the ``type`` keyword is a convenience that should only be used " +"for simple conversions that can only raise one of the three supported " +"exceptions. Anything with more interesting error-handling or resource " +"management should be done downstream after the arguments are parsed." +msgstr "" +"Загалом, ключове слово ``type`` є зручним, і його слід використовувати лише " +"для простих перетворень, які можуть викликати лише одне з трьох " +"підтримуваних винятків. Усе, що має більш цікаву обробку помилок або " +"керування ресурсами, має бути зроблено нижче за течією після аналізу " +"аргументів." + +msgid "" +"For example, JSON or YAML conversions have complex error cases that require " +"better reporting than can be given by the ``type`` keyword. A :exc:`~json." +"JSONDecodeError` would not be well formatted and a :exc:`FileNotFoundError` " +"exception would not be handled at all." +msgstr "" + +msgid "" +"Even :class:`~argparse.FileType` has its limitations for use with the " +"``type`` keyword. If one argument uses :class:`~argparse.FileType` and then " +"a subsequent argument fails, an error is reported but the file is not " +"automatically closed. In this case, it would be better to wait until after " +"the parser has run and then use the :keyword:`with`-statement to manage the " +"files." +msgstr "" + +msgid "" +"For type checkers that simply check against a fixed set of values, consider " +"using the choices_ keyword instead." +msgstr "" +"Для засобів перевірки типів, які просто перевіряють фіксований набір " +"значень, подумайте про використання ключового слова choices_." + +msgid "choices" +msgstr "вибір" + +msgid "" +"Some command-line arguments should be selected from a restricted set of " +"values. These can be handled by passing a sequence object as the *choices* " +"keyword argument to :meth:`~ArgumentParser.add_argument`. When the command " +"line is parsed, argument values will be checked, and an error message will " +"be displayed if the argument was not one of the acceptable values::" +msgstr "" + +msgid "" +">>> parser = argparse.ArgumentParser(prog='game.py')\n" +">>> parser.add_argument('move', choices=['rock', 'paper', 'scissors'])\n" +">>> parser.parse_args(['rock'])\n" +"Namespace(move='rock')\n" +">>> parser.parse_args(['fire'])\n" +"usage: game.py [-h] {rock,paper,scissors}\n" +"game.py: error: argument move: invalid choice: 'fire' (choose from 'rock',\n" +"'paper', 'scissors')" +msgstr "" + +msgid "" +"Note that inclusion in the *choices* sequence is checked after any type_ " +"conversions have been performed, so the type of the objects in the *choices* " +"sequence should match the type_ specified." +msgstr "" + +msgid "" +"Any sequence can be passed as the *choices* value, so :class:`list` " +"objects, :class:`tuple` objects, and custom sequences are all supported." +msgstr "" + +msgid "" +"Use of :class:`enum.Enum` is not recommended because it is difficult to " +"control its appearance in usage, help, and error messages." +msgstr "" +"Використання :class:`enum.Enum` не рекомендується, оскільки важко " +"контролювати його появу в повідомленнях про використання, довідці та " +"помилках." + +msgid "" +"Formatted choices override the default *metavar* which is normally derived " +"from *dest*. This is usually what you want because the user never sees the " +"*dest* parameter. If this display isn't desirable (perhaps because there " +"are many choices), just specify an explicit metavar_." +msgstr "" + +msgid "required" +msgstr "вимагається" + +msgid "" +"In general, the :mod:`!argparse` module assumes that flags like ``-f`` and " +"``--bar`` indicate *optional* arguments, which can always be omitted at the " +"command line. To make an option *required*, ``True`` can be specified for " +"the ``required=`` keyword argument to :meth:`~ArgumentParser.add_argument`::" +msgstr "" + +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', required=True)\n" +">>> parser.parse_args(['--foo', 'BAR'])\n" +"Namespace(foo='BAR')\n" +">>> parser.parse_args([])\n" +"usage: [-h] --foo FOO\n" +": error: the following arguments are required: --foo" +msgstr "" + +msgid "" +"As the example shows, if an option is marked as ``required``, :meth:" +"`~ArgumentParser.parse_args` will report an error if that option is not " +"present at the command line." +msgstr "" +"Як показує приклад, якщо параметр позначено як ``required``, :meth:" +"`~ArgumentParser.parse_args` повідомить про помилку, якщо цей параметр " +"відсутній у командному рядку." + +msgid "" +"Required options are generally considered bad form because users expect " +"*options* to be *optional*, and thus they should be avoided when possible." +msgstr "" +"Обов’язкові параметри зазвичай вважаються поганим тоном, оскільки " +"користувачі очікують, що *параметри* будуть *необов’язковими*, тому їх слід " +"уникати, коли це можливо." + +msgid "help" +msgstr "допомогти" + +msgid "" +"The ``help`` value is a string containing a brief description of the " +"argument. When a user requests help (usually by using ``-h`` or ``--help`` " +"at the command line), these ``help`` descriptions will be displayed with " +"each argument." +msgstr "" + +msgid "" +"The ``help`` strings can include various format specifiers to avoid " +"repetition of things like the program name or the argument default_. The " +"available specifiers include the program name, ``%(prog)s`` and most keyword " +"arguments to :meth:`~ArgumentParser.add_argument`, e.g. ``%(default)s``, " +"``%(type)s``, etc.::" +msgstr "" +"Рядки ``help`` можуть містити різні специфікатори формату, щоб уникнути " +"повторення таких речей, як назва програми або аргумент default_. Доступні " +"специфікатори включають назву програми, ``%(prog)s`` та більшість ключових " +"аргументів для :meth:`~ArgumentParser.add_argument`, напр. ``%(default)s``, " +"``%(type)s`` тощо::" + +msgid "" +">>> parser = argparse.ArgumentParser(prog='frobble')\n" +">>> parser.add_argument('bar', nargs='?', type=int, default=42,\n" +"... help='the bar to %(prog)s (default: %(default)s)')\n" +">>> parser.print_help()\n" +"usage: frobble [-h] [bar]\n" +"\n" +"positional arguments:\n" +" bar the bar to frobble (default: 42)\n" +"\n" +"options:\n" +" -h, --help show this help message and exit" +msgstr "" + +msgid "" +"As the help string supports %-formatting, if you want a literal ``%`` to " +"appear in the help string, you must escape it as ``%%``." +msgstr "" +"Оскільки рядок довідки підтримує %-formatting, якщо ви хочете, щоб літерал " +"``%`` з’явився в рядку довідки, ви повинні екранувати його як ``%%``." + +msgid "" +":mod:`!argparse` supports silencing the help entry for certain options, by " +"setting the ``help`` value to ``argparse.SUPPRESS``::" +msgstr "" + +msgid "" +">>> parser = argparse.ArgumentParser(prog='frobble')\n" +">>> parser.add_argument('--foo', help=argparse.SUPPRESS)\n" +">>> parser.print_help()\n" +"usage: frobble [-h]\n" +"\n" +"options:\n" +" -h, --help show this help message and exit" +msgstr "" + +msgid "metavar" +msgstr "метавар" + +msgid "" +"When :class:`ArgumentParser` generates help messages, it needs some way to " +"refer to each expected argument. By default, :class:`!ArgumentParser` " +"objects use the dest_ value as the \"name\" of each object. By default, for " +"positional argument actions, the dest_ value is used directly, and for " +"optional argument actions, the dest_ value is uppercased. So, a single " +"positional argument with ``dest='bar'`` will be referred to as ``bar``. A " +"single optional argument ``--foo`` that should be followed by a single " +"command-line argument will be referred to as ``FOO``. An example::" +msgstr "" + +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo')\n" +">>> parser.add_argument('bar')\n" +">>> parser.parse_args('X --foo Y'.split())\n" +"Namespace(bar='X', foo='Y')\n" +">>> parser.print_help()\n" +"usage: [-h] [--foo FOO] bar\n" +"\n" +"positional arguments:\n" +" bar\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" --foo FOO" +msgstr "" + +msgid "An alternative name can be specified with ``metavar``::" +msgstr "Альтернативну назву можна вказати за допомогою ``metavar``::" + +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', metavar='YYY')\n" +">>> parser.add_argument('bar', metavar='XXX')\n" +">>> parser.parse_args('X --foo Y'.split())\n" +"Namespace(bar='X', foo='Y')\n" +">>> parser.print_help()\n" +"usage: [-h] [--foo YYY] XXX\n" +"\n" +"positional arguments:\n" +" XXX\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" --foo YYY" +msgstr "" + +msgid "" +"Note that ``metavar`` only changes the *displayed* name - the name of the " +"attribute on the :meth:`~ArgumentParser.parse_args` object is still " +"determined by the dest_ value." +msgstr "" +"Зауважте, що ``metavar`` змінює лише *відображене* ім’я – ім’я атрибута " +"об’єкта :meth:`~ArgumentParser.parse_args` все ще визначається значенням " +"dest_." + +msgid "" +"Different values of ``nargs`` may cause the metavar to be used multiple " +"times. Providing a tuple to ``metavar`` specifies a different display for " +"each of the arguments::" +msgstr "" +"Різні значення ``nargs`` можуть спричинити багаторазове використання " +"метаперемінної. Надання кортежу для ``metavar`` визначає інше відображення " +"для кожного з аргументів::" + +msgid "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('-x', nargs=2)\n" +">>> parser.add_argument('--foo', nargs=2, metavar=('bar', 'baz'))\n" +">>> parser.print_help()\n" +"usage: PROG [-h] [-x X X] [--foo bar baz]\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" -x X X\n" +" --foo bar baz" +msgstr "" + +msgid "dest" +msgstr "дест" + +msgid "" +"Most :class:`ArgumentParser` actions add some value as an attribute of the " +"object returned by :meth:`~ArgumentParser.parse_args`. The name of this " +"attribute is determined by the ``dest`` keyword argument of :meth:" +"`~ArgumentParser.add_argument`. For positional argument actions, ``dest`` " +"is normally supplied as the first argument to :meth:`~ArgumentParser." +"add_argument`::" +msgstr "" +"Більшість дій :class:`ArgumentParser` додають певне значення як атрибут " +"об’єкта, який повертає :meth:`~ArgumentParser.parse_args`. Ім’я цього " +"атрибута визначається ключовим аргументом ``dest`` :meth:`~ArgumentParser." +"add_argument`. Для дій позиційного аргументу ``dest`` зазвичай надається як " +"перший аргумент :meth:`~ArgumentParser.add_argument`::" + +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('bar')\n" +">>> parser.parse_args(['XXX'])\n" +"Namespace(bar='XXX')" +msgstr "" + +msgid "" +"For optional argument actions, the value of ``dest`` is normally inferred " +"from the option strings. :class:`ArgumentParser` generates the value of " +"``dest`` by taking the first long option string and stripping away the " +"initial ``--`` string. If no long option strings were supplied, ``dest`` " +"will be derived from the first short option string by stripping the initial " +"``-`` character. Any internal ``-`` characters will be converted to ``_`` " +"characters to make sure the string is a valid attribute name. The examples " +"below illustrate this behavior::" +msgstr "" +"Для необов’язкових дій аргументів значення ``dest`` зазвичай виводиться з " +"рядків параметрів. :class:`ArgumentParser` генерує значення ``dest``, беручи " +"перший довгий рядок параметрів і видаляючи початковий рядок ``--``. Якщо не " +"було надано довгих рядків параметрів, ``dest`` буде отримано з першого " +"короткого рядка параметрів шляхом видалення початкового символу ``-``. Усі " +"внутрішні символи \"-\" буде перетворено на символи \"_\", щоб переконатися, " +"що рядок є дійсною назвою атрибута. Наведені нижче приклади ілюструють цю " +"поведінку:" + +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('-f', '--foo-bar', '--foo')\n" +">>> parser.add_argument('-x', '-y')\n" +">>> parser.parse_args('-f 1 -x 2'.split())\n" +"Namespace(foo_bar='1', x='2')\n" +">>> parser.parse_args('--foo 1 -y 2'.split())\n" +"Namespace(foo_bar='1', x='2')" +msgstr "" + +msgid "``dest`` allows a custom attribute name to be provided::" +msgstr "``dest`` дозволяє надати ім'я спеціального атрибута:" + +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', dest='bar')\n" +">>> parser.parse_args('--foo XXX'.split())\n" +"Namespace(bar='XXX')" +msgstr "" + +msgid "deprecated" +msgstr "" + +msgid "" +"During a project's lifetime, some arguments may need to be removed from the " +"command line. Before removing them, you should inform your users that the " +"arguments are deprecated and will be removed. The ``deprecated`` keyword " +"argument of :meth:`~ArgumentParser.add_argument`, which defaults to " +"``False``, specifies if the argument is deprecated and will be removed in " +"the future. For arguments, if ``deprecated`` is ``True``, then a warning " +"will be printed to :data:`sys.stderr` when the argument is used::" +msgstr "" + +msgid "" +">>> import argparse\n" +">>> parser = argparse.ArgumentParser(prog='snake.py')\n" +">>> parser.add_argument('--legs', default=0, type=int, deprecated=True)\n" +">>> parser.parse_args([])\n" +"Namespace(legs=0)\n" +">>> parser.parse_args(['--legs', '4'])\n" +"snake.py: warning: option '--legs' is deprecated\n" +"Namespace(legs=4)" +msgstr "" + +msgid "Action classes" +msgstr "Класи дії" + +msgid "" +":class:`!Action` classes implement the Action API, a callable which returns " +"a callable which processes arguments from the command-line. Any object which " +"follows this API may be passed as the ``action`` parameter to :meth:" +"`~ArgumentParser.add_argument`." +msgstr "" + +msgid "" +":class:`!Action` objects are used by an :class:`ArgumentParser` to represent " +"the information needed to parse a single argument from one or more strings " +"from the command line. The :class:`!Action` class must accept the two " +"positional arguments plus any keyword arguments passed to :meth:" +"`ArgumentParser.add_argument` except for the ``action`` itself." +msgstr "" + +msgid "" +"Instances of :class:`!Action` (or return value of any callable to the " +"``action`` parameter) should have attributes :attr:`!dest`, :attr:`!" +"option_strings`, :attr:`!default`, :attr:`!type`, :attr:`!required`, :attr:`!" +"help`, etc. defined. The easiest way to ensure these attributes are defined " +"is to call :meth:`!Action.__init__`." +msgstr "" + +msgid "" +":class:`!Action` instances should be callable, so subclasses must override " +"the :meth:`!__call__` method, which should accept four parameters:" +msgstr "" + +msgid "" +"*parser* - The :class:`ArgumentParser` object which contains this action." +msgstr "" + +msgid "" +"*namespace* - The :class:`Namespace` object that will be returned by :meth:" +"`~ArgumentParser.parse_args`. Most actions add an attribute to this object " +"using :func:`setattr`." +msgstr "" + +msgid "" +"*values* - The associated command-line arguments, with any type conversions " +"applied. Type conversions are specified with the type_ keyword argument to :" +"meth:`~ArgumentParser.add_argument`." +msgstr "" + +msgid "" +"*option_string* - The option string that was used to invoke this action. The " +"``option_string`` argument is optional, and will be absent if the action is " +"associated with a positional argument." +msgstr "" + +msgid "" +"The :meth:`!__call__` method may perform arbitrary actions, but will " +"typically set attributes on the ``namespace`` based on ``dest`` and " +"``values``." +msgstr "" + +msgid "" +":class:`!Action` subclasses can define a :meth:`!format_usage` method that " +"takes no argument and return a string which will be used when printing the " +"usage of the program. If such method is not provided, a sensible default " +"will be used." +msgstr "" + +msgid "The parse_args() method" +msgstr "Метод parse_args()." + +msgid "" +"Convert argument strings to objects and assign them as attributes of the " +"namespace. Return the populated namespace." +msgstr "" +"Перетворіть рядки аргументів на об’єкти та призначте їх як атрибути простору " +"імен. Повернути заповнений простір імен." + +msgid "" +"Previous calls to :meth:`add_argument` determine exactly what objects are " +"created and how they are assigned. See the documentation for :meth:`!" +"add_argument` for details." +msgstr "" + +msgid "" +"args_ - List of strings to parse. The default is taken from :data:`sys." +"argv`." +msgstr "" +"args_ - список рядків для аналізу. Типове значення взято з :data:`sys.argv`." + +msgid "" +"namespace_ - An object to take the attributes. The default is a new empty :" +"class:`Namespace` object." +msgstr "" +"namespace_ – об’єкт для отримання атрибутів. Типовим є новий порожній " +"об’єкт :class:`Namespace`." + +msgid "Option value syntax" +msgstr "Синтаксис значення опції" + +msgid "" +"The :meth:`~ArgumentParser.parse_args` method supports several ways of " +"specifying the value of an option (if it takes one). In the simplest case, " +"the option and its value are passed as two separate arguments::" +msgstr "" +"Метод :meth:`~ArgumentParser.parse_args` підтримує кілька способів " +"визначення значення параметра (якщо воно приймається). У найпростішому " +"випадку параметр і його значення передаються як два окремих аргументи:" + +msgid "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('-x')\n" +">>> parser.add_argument('--foo')\n" +">>> parser.parse_args(['-x', 'X'])\n" +"Namespace(foo=None, x='X')\n" +">>> parser.parse_args(['--foo', 'FOO'])\n" +"Namespace(foo='FOO', x=None)" +msgstr "" + +msgid "" +"For long options (options with names longer than a single character), the " +"option and value can also be passed as a single command-line argument, using " +"``=`` to separate them::" +msgstr "" +"Для довгих параметрів (параметрів з іменами, довшими за один символ), " +"параметр і значення також можна передати як один аргумент командного рядка, " +"використовуючи ``=``, щоб розділити їх::" + +msgid "" +">>> parser.parse_args(['--foo=FOO'])\n" +"Namespace(foo='FOO', x=None)" +msgstr "" + +msgid "" +"For short options (options only one character long), the option and its " +"value can be concatenated::" +msgstr "" +"Для коротких опцій (опції лише з одного символу) опцію та її значення можна " +"об’єднати:" + +msgid "" +">>> parser.parse_args(['-xX'])\n" +"Namespace(foo=None, x='X')" +msgstr "" + +msgid "" +"Several short options can be joined together, using only a single ``-`` " +"prefix, as long as only the last option (or none of them) requires a value::" +msgstr "" +"Кілька коротких опцій можна об’єднати разом, використовуючи лише один " +"префікс ``-``, якщо тільки остання опція (або жодна з них) вимагає значення::" + +msgid "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('-x', action='store_true')\n" +">>> parser.add_argument('-y', action='store_true')\n" +">>> parser.add_argument('-z')\n" +">>> parser.parse_args(['-xyzZ'])\n" +"Namespace(x=True, y=True, z='Z')" +msgstr "" + +msgid "Invalid arguments" +msgstr "Недійсні аргументи" + +msgid "" +"While parsing the command line, :meth:`~ArgumentParser.parse_args` checks " +"for a variety of errors, including ambiguous options, invalid types, invalid " +"options, wrong number of positional arguments, etc. When it encounters such " +"an error, it exits and prints the error along with a usage message::" +msgstr "" +"Під час аналізу командного рядка :meth:`~ArgumentParser.parse_args` " +"перевіряє наявність різноманітних помилок, включаючи неоднозначні параметри, " +"недійсні типи, недійсні параметри, неправильну кількість позиційних " +"аргументів тощо. Коли він стикається з такою помилкою, він виходить і друкує " +"помилку разом із повідомленням про використання::" + +msgid "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('--foo', type=int)\n" +">>> parser.add_argument('bar', nargs='?')\n" +"\n" +">>> # invalid type\n" +">>> parser.parse_args(['--foo', 'spam'])\n" +"usage: PROG [-h] [--foo FOO] [bar]\n" +"PROG: error: argument --foo: invalid int value: 'spam'\n" +"\n" +">>> # invalid option\n" +">>> parser.parse_args(['--bar'])\n" +"usage: PROG [-h] [--foo FOO] [bar]\n" +"PROG: error: no such option: --bar\n" +"\n" +">>> # wrong number of arguments\n" +">>> parser.parse_args(['spam', 'badger'])\n" +"usage: PROG [-h] [--foo FOO] [bar]\n" +"PROG: error: extra arguments found: badger" +msgstr "" + +msgid "Arguments containing ``-``" +msgstr "Аргументи, що містять ``-``" + +msgid "" +"The :meth:`~ArgumentParser.parse_args` method attempts to give errors " +"whenever the user has clearly made a mistake, but some situations are " +"inherently ambiguous. For example, the command-line argument ``-1`` could " +"either be an attempt to specify an option or an attempt to provide a " +"positional argument. The :meth:`~ArgumentParser.parse_args` method is " +"cautious here: positional arguments may only begin with ``-`` if they look " +"like negative numbers and there are no options in the parser that look like " +"negative numbers::" +msgstr "" +"Метод :meth:`~ArgumentParser.parse_args` намагається видавати помилки " +"щоразу, коли користувач явно зробив помилку, але деякі ситуації за своєю " +"суттю неоднозначні. Наприклад, аргумент командного рядка \"-1\" може бути " +"або спробою вказати параметр, або спробою надати позиційний аргумент. Метод :" +"meth:`~ArgumentParser.parse_args` тут обережний: позиційні аргументи можуть " +"починатися лише з ``-``, якщо вони виглядають як від’ємні числа, і в " +"аналізаторі немає параметрів, які виглядають як від’ємні числа:" + +msgid "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('-x')\n" +">>> parser.add_argument('foo', nargs='?')\n" +"\n" +">>> # no negative number options, so -1 is a positional argument\n" +">>> parser.parse_args(['-x', '-1'])\n" +"Namespace(foo=None, x='-1')\n" +"\n" +">>> # no negative number options, so -1 and -5 are positional arguments\n" +">>> parser.parse_args(['-x', '-1', '-5'])\n" +"Namespace(foo='-5', x='-1')\n" +"\n" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('-1', dest='one')\n" +">>> parser.add_argument('foo', nargs='?')\n" +"\n" +">>> # negative number options present, so -1 is an option\n" +">>> parser.parse_args(['-1', 'X'])\n" +"Namespace(foo=None, one='X')\n" +"\n" +">>> # negative number options present, so -2 is an option\n" +">>> parser.parse_args(['-2'])\n" +"usage: PROG [-h] [-1 ONE] [foo]\n" +"PROG: error: no such option: -2\n" +"\n" +">>> # negative number options present, so both -1s are options\n" +">>> parser.parse_args(['-1', '-1'])\n" +"usage: PROG [-h] [-1 ONE] [foo]\n" +"PROG: error: argument -1: expected one argument" +msgstr "" + +msgid "" +"If you have positional arguments that must begin with ``-`` and don't look " +"like negative numbers, you can insert the pseudo-argument ``'--'`` which " +"tells :meth:`~ArgumentParser.parse_args` that everything after that is a " +"positional argument::" +msgstr "" +"Якщо у вас є позиційні аргументи, які повинні починатися з ``-`` і не " +"виглядати як від’ємні числа, ви можете вставити псевдоаргумент ``''--'``, " +"який повідомляє :meth:`~ArgumentParser.parse_args`, що все після цього є " +"позиційним аргументом::" + +msgid "" +">>> parser.parse_args(['--', '-f'])\n" +"Namespace(foo='-f', one=None)" +msgstr "" + +msgid "" +"See also :ref:`the argparse howto on ambiguous arguments ` for more details." +msgstr "" + +msgid "Argument abbreviations (prefix matching)" +msgstr "Скорочення аргументів (відповідність префіксу)" + +msgid "" +"The :meth:`~ArgumentParser.parse_args` method :ref:`by default " +"` allows long options to be abbreviated to a prefix, if the " +"abbreviation is unambiguous (the prefix matches a unique option)::" +msgstr "" +"Метод :meth:`~ArgumentParser.parse_args` :ref:`за замовчуванням " +"` дозволяє скорочувати довгі параметри до префікса, якщо " +"скорочення є однозначним (префікс відповідає унікальному параметру)::" + +msgid "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('-bacon')\n" +">>> parser.add_argument('-badger')\n" +">>> parser.parse_args('-bac MMM'.split())\n" +"Namespace(bacon='MMM', badger=None)\n" +">>> parser.parse_args('-bad WOOD'.split())\n" +"Namespace(bacon=None, badger='WOOD')\n" +">>> parser.parse_args('-ba BA'.split())\n" +"usage: PROG [-h] [-bacon BACON] [-badger BADGER]\n" +"PROG: error: ambiguous option: -ba could match -badger, -bacon" +msgstr "" + +msgid "" +"An error is produced for arguments that could produce more than one options. " +"This feature can be disabled by setting :ref:`allow_abbrev` to ``False``." +msgstr "" +"Помилка створюється для аргументів, які можуть давати більше одного " +"варіанту. Цю функцію можна вимкнути, встановивши для :ref:`allow_abbrev` " +"значення ``False``." + +msgid "Beyond ``sys.argv``" +msgstr "За межами ``sys.argv``" + +msgid "" +"Sometimes it may be useful to have an :class:`ArgumentParser` parse " +"arguments other than those of :data:`sys.argv`. This can be accomplished by " +"passing a list of strings to :meth:`~ArgumentParser.parse_args`. This is " +"useful for testing at the interactive prompt::" +msgstr "" + +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument(\n" +"... 'integers', metavar='int', type=int, choices=range(10),\n" +"... nargs='+', help='an integer in the range 0..9')\n" +">>> parser.add_argument(\n" +"... '--sum', dest='accumulate', action='store_const', const=sum,\n" +"... default=max, help='sum the integers (default: find the max)')\n" +">>> parser.parse_args(['1', '2', '3', '4'])\n" +"Namespace(accumulate=, integers=[1, 2, 3, 4])\n" +">>> parser.parse_args(['1', '2', '3', '4', '--sum'])\n" +"Namespace(accumulate=, integers=[1, 2, 3, 4])" +msgstr "" + +msgid "The Namespace object" +msgstr "Об'єкт простору імен" + +msgid "" +"Simple class used by default by :meth:`~ArgumentParser.parse_args` to create " +"an object holding attributes and return it." +msgstr "" +"Простий клас, який за замовчуванням використовується :meth:`~ArgumentParser." +"parse_args` для створення об’єкта з атрибутами та повернення його." + +msgid "" +"This class is deliberately simple, just an :class:`object` subclass with a " +"readable string representation. If you prefer to have dict-like view of the " +"attributes, you can use the standard Python idiom, :func:`vars`::" +msgstr "" +"Цей клас навмисне простий, просто підклас :class:`object` із читабельним " +"представленням рядка. Якщо ви віддаєте перевагу перегляду атрибутів у " +"форматі dict, ви можете використовувати стандартну ідіому Python :func:" +"`vars`::" + +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo')\n" +">>> args = parser.parse_args(['--foo', 'BAR'])\n" +">>> vars(args)\n" +"{'foo': 'BAR'}" +msgstr "" + +msgid "" +"It may also be useful to have an :class:`ArgumentParser` assign attributes " +"to an already existing object, rather than a new :class:`Namespace` object. " +"This can be achieved by specifying the ``namespace=`` keyword argument::" +msgstr "" +"Також може бути корисним, щоб :class:`ArgumentParser` призначав атрибути вже " +"існуючому об’єкту, а не новому об’єкту :class:`Namespace`. Цього можна " +"досягти, вказавши аргумент ключового слова ``namespace=``::" + +msgid "" +">>> class C:\n" +"... pass\n" +"...\n" +">>> c = C()\n" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo')\n" +">>> parser.parse_args(args=['--foo', 'BAR'], namespace=c)\n" +">>> c.foo\n" +"'BAR'" +msgstr "" + +msgid "Other utilities" +msgstr "Інші комунальні послуги" + +msgid "Sub-commands" +msgstr "Підкоманди" + +msgid "" +"Many programs split up their functionality into a number of subcommands, for " +"example, the ``svn`` program can invoke subcommands like ``svn checkout``, " +"``svn update``, and ``svn commit``. Splitting up functionality this way can " +"be a particularly good idea when a program performs several different " +"functions which require different kinds of command-line arguments. :class:" +"`ArgumentParser` supports the creation of such subcommands with the :meth:`!" +"add_subparsers` method. The :meth:`!add_subparsers` method is normally " +"called with no arguments and returns a special action object. This object " +"has a single method, :meth:`~_SubParsersAction.add_parser`, which takes a " +"command name and any :class:`!ArgumentParser` constructor arguments, and " +"returns an :class:`!ArgumentParser` object that can be modified as usual." +msgstr "" + +msgid "Description of parameters:" +msgstr "Опис параметрів:" + +msgid "" +"*title* - title for the sub-parser group in help output; by default " +"\"subcommands\" if description is provided, otherwise uses title for " +"positional arguments" +msgstr "" + +msgid "" +"*description* - description for the sub-parser group in help output, by " +"default ``None``" +msgstr "" + +msgid "" +"*prog* - usage information that will be displayed with sub-command help, by " +"default the name of the program and any positional arguments before the " +"subparser argument" +msgstr "" + +msgid "" +"*parser_class* - class which will be used to create sub-parser instances, by " +"default the class of the current parser (e.g. :class:`ArgumentParser`)" +msgstr "" + +msgid "" +"action_ - the basic type of action to be taken when this argument is " +"encountered at the command line" +msgstr "" +"action_ - основний тип дії, яка виконується, коли цей аргумент зустрічається " +"в командному рядку" + +msgid "" +"dest_ - name of the attribute under which sub-command name will be stored; " +"by default ``None`` and no value is stored" +msgstr "" +"dest_ - ім'я атрибута, під яким буде зберігатися ім'я підкоманди; за " +"замовчуванням ``None`` і жодне значення не зберігається" + +msgid "" +"required_ - Whether or not a subcommand must be provided, by default " +"``False`` (added in 3.7)" +msgstr "" +"required_ - чи потрібно надавати підкоманду, за замовчуванням ``False`` " +"(додано в 3.7)" + +msgid "help_ - help for sub-parser group in help output, by default ``None``" +msgstr "" +"help_ - довідка для групи суб-парсера у виведенні довідки, за замовчуванням " +"``None``" + +msgid "" +"metavar_ - string presenting available subcommands in help; by default it is " +"``None`` and presents subcommands in form {cmd1, cmd2, ..}" +msgstr "" + +msgid "Some example usage::" +msgstr "Деякі приклади використання::" + +msgid "" +">>> # create the top-level parser\n" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('--foo', action='store_true', help='foo help')\n" +">>> subparsers = parser.add_subparsers(help='subcommand help')\n" +">>>\n" +">>> # create the parser for the \"a\" command\n" +">>> parser_a = subparsers.add_parser('a', help='a help')\n" +">>> parser_a.add_argument('bar', type=int, help='bar help')\n" +">>>\n" +">>> # create the parser for the \"b\" command\n" +">>> parser_b = subparsers.add_parser('b', help='b help')\n" +">>> parser_b.add_argument('--baz', choices=('X', 'Y', 'Z'), help='baz " +"help')\n" +">>>\n" +">>> # parse some argument lists\n" +">>> parser.parse_args(['a', '12'])\n" +"Namespace(bar=12, foo=False)\n" +">>> parser.parse_args(['--foo', 'b', '--baz', 'Z'])\n" +"Namespace(baz='Z', foo=True)" +msgstr "" + +msgid "" +"Note that the object returned by :meth:`parse_args` will only contain " +"attributes for the main parser and the subparser that was selected by the " +"command line (and not any other subparsers). So in the example above, when " +"the ``a`` command is specified, only the ``foo`` and ``bar`` attributes are " +"present, and when the ``b`` command is specified, only the ``foo`` and " +"``baz`` attributes are present." +msgstr "" +"Зауважте, що об’єкт, який повертає :meth:`parse_args`, міститиме лише " +"атрибути для головного синтаксичного аналізатора та підпарсера, вибраного " +"командним рядком (а не будь-яких інших підпарсерів). Отже, у прикладі вище, " +"коли вказано команду ``a``, присутні лише атрибути ``foo`` і ``bar``, а коли " +"вказано команду ``b``, лише наявні атрибути ``foo`` і ``baz``." + +msgid "" +"Similarly, when a help message is requested from a subparser, only the help " +"for that particular parser will be printed. The help message will not " +"include parent parser or sibling parser messages. (A help message for each " +"subparser command, however, can be given by supplying the ``help=`` argument " +"to :meth:`~_SubParsersAction.add_parser` as above.)" +msgstr "" + +msgid "" +">>> parser.parse_args(['--help'])\n" +"usage: PROG [-h] [--foo] {a,b} ...\n" +"\n" +"positional arguments:\n" +" {a,b} subcommand help\n" +" a a help\n" +" b b help\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" --foo foo help\n" +"\n" +">>> parser.parse_args(['a', '--help'])\n" +"usage: PROG a [-h] bar\n" +"\n" +"positional arguments:\n" +" bar bar help\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +"\n" +">>> parser.parse_args(['b', '--help'])\n" +"usage: PROG b [-h] [--baz {X,Y,Z}]\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" --baz {X,Y,Z} baz help" +msgstr "" + +msgid "" +"The :meth:`add_subparsers` method also supports ``title`` and " +"``description`` keyword arguments. When either is present, the subparser's " +"commands will appear in their own group in the help output. For example::" +msgstr "" +"Метод :meth:`add_subparsers` також підтримує ключові аргументи ``title`` і " +"``description``. Якщо будь-який з них присутній, команди субпарсера " +"відображатимуться у власній групі у виведенні довідки. Наприклад::" + +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> subparsers = parser.add_subparsers(title='subcommands',\n" +"... description='valid subcommands',\n" +"... help='additional help')\n" +">>> subparsers.add_parser('foo')\n" +">>> subparsers.add_parser('bar')\n" +">>> parser.parse_args(['-h'])\n" +"usage: [-h] {foo,bar} ...\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +"\n" +"subcommands:\n" +" valid subcommands\n" +"\n" +" {foo,bar} additional help" +msgstr "" + +msgid "" +"Furthermore, :meth:`~_SubParsersAction.add_parser` supports an additional " +"*aliases* argument, which allows multiple strings to refer to the same " +"subparser. This example, like ``svn``, aliases ``co`` as a shorthand for " +"``checkout``::" +msgstr "" + +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> subparsers = parser.add_subparsers()\n" +">>> checkout = subparsers.add_parser('checkout', aliases=['co'])\n" +">>> checkout.add_argument('foo')\n" +">>> parser.parse_args(['co', 'bar'])\n" +"Namespace(foo='bar')" +msgstr "" + +msgid "" +":meth:`~_SubParsersAction.add_parser` supports also an additional " +"*deprecated* argument, which allows to deprecate the subparser." +msgstr "" + +msgid "" +"One particularly effective way of handling subcommands is to combine the use " +"of the :meth:`add_subparsers` method with calls to :meth:`set_defaults` so " +"that each subparser knows which Python function it should execute. For " +"example::" +msgstr "" + +msgid "" +">>> # subcommand functions\n" +">>> def foo(args):\n" +"... print(args.x * args.y)\n" +"...\n" +">>> def bar(args):\n" +"... print('((%s))' % args.z)\n" +"...\n" +">>> # create the top-level parser\n" +">>> parser = argparse.ArgumentParser()\n" +">>> subparsers = parser.add_subparsers(required=True)\n" +">>>\n" +">>> # create the parser for the \"foo\" command\n" +">>> parser_foo = subparsers.add_parser('foo')\n" +">>> parser_foo.add_argument('-x', type=int, default=1)\n" +">>> parser_foo.add_argument('y', type=float)\n" +">>> parser_foo.set_defaults(func=foo)\n" +">>>\n" +">>> # create the parser for the \"bar\" command\n" +">>> parser_bar = subparsers.add_parser('bar')\n" +">>> parser_bar.add_argument('z')\n" +">>> parser_bar.set_defaults(func=bar)\n" +">>>\n" +">>> # parse the args and call whatever function was selected\n" +">>> args = parser.parse_args('foo 1 -x 2'.split())\n" +">>> args.func(args)\n" +"2.0\n" +">>>\n" +">>> # parse the args and call whatever function was selected\n" +">>> args = parser.parse_args('bar XYZYX'.split())\n" +">>> args.func(args)\n" +"((XYZYX))" +msgstr "" + +msgid "" +"This way, you can let :meth:`parse_args` do the job of calling the " +"appropriate function after argument parsing is complete. Associating " +"functions with actions like this is typically the easiest way to handle the " +"different actions for each of your subparsers. However, if it is necessary " +"to check the name of the subparser that was invoked, the ``dest`` keyword " +"argument to the :meth:`add_subparsers` call will work::" +msgstr "" +"Таким чином, ви можете дозволити :meth:`parse_args` виконати роботу з " +"виклику відповідної функції після завершення аналізу аргументу. Пов’язування " +"функцій із подібними діями зазвичай є найпростішим способом обробки різних " +"дій для кожного з ваших підпарсерів. Однак, якщо необхідно перевірити ім’я " +"викликаного субпарсера, аргумент ключового слова ``dest`` для виклику :meth:" +"`add_subparsers` буде працювати:" + +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> subparsers = parser.add_subparsers(dest='subparser_name')\n" +">>> subparser1 = subparsers.add_parser('1')\n" +">>> subparser1.add_argument('-x')\n" +">>> subparser2 = subparsers.add_parser('2')\n" +">>> subparser2.add_argument('y')\n" +">>> parser.parse_args(['2', 'frobble'])\n" +"Namespace(subparser_name='2', y='frobble')" +msgstr "" + +msgid "New *required* keyword-only parameter." +msgstr "" + +msgid "FileType objects" +msgstr "Об'єкти FileType" + +msgid "" +"The :class:`FileType` factory creates objects that can be passed to the type " +"argument of :meth:`ArgumentParser.add_argument`. Arguments that have :class:" +"`FileType` objects as their type will open command-line arguments as files " +"with the requested modes, buffer sizes, encodings and error handling (see " +"the :func:`open` function for more details)::" +msgstr "" +"Фабрика :class:`FileType` створює об’єкти, які можна передати в аргумент " +"типу :meth:`ArgumentParser.add_argument`. Аргументи, які мають тип об’єктів :" +"class:`FileType`, відкриватимуть аргументи командного рядка як файли з " +"потрібними режимами, розмірами буфера, кодуванням і обробкою помилок " +"(додаткову інформацію див. у функції :func:`open`)::" + +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--raw', type=argparse.FileType('wb', 0))\n" +">>> parser.add_argument('out', type=argparse.FileType('w', " +"encoding='UTF-8'))\n" +">>> parser.parse_args(['--raw', 'raw.dat', 'file.txt'])\n" +"Namespace(out=<_io.TextIOWrapper name='file.txt' mode='w' encoding='UTF-8'>, " +"raw=<_io.FileIO name='raw.dat' mode='wb'>)" +msgstr "" + +msgid "" +"FileType objects understand the pseudo-argument ``'-'`` and automatically " +"convert this into :data:`sys.stdin` for readable :class:`FileType` objects " +"and :data:`sys.stdout` for writable :class:`FileType` objects::" +msgstr "" + +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('infile', type=argparse.FileType('r'))\n" +">>> parser.parse_args(['-'])\n" +"Namespace(infile=<_io.TextIOWrapper name='' encoding='UTF-8'>)" +msgstr "" + +msgid "Added the *encodings* and *errors* parameters." +msgstr "" + +msgid "Argument groups" +msgstr "Групи аргументів" + +msgid "" +"By default, :class:`ArgumentParser` groups command-line arguments into " +"\"positional arguments\" and \"options\" when displaying help messages. When " +"there is a better conceptual grouping of arguments than this default one, " +"appropriate groups can be created using the :meth:`!add_argument_group` " +"method::" +msgstr "" + +msgid "" +">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" +">>> group = parser.add_argument_group('group')\n" +">>> group.add_argument('--foo', help='foo help')\n" +">>> group.add_argument('bar', help='bar help')\n" +">>> parser.print_help()\n" +"usage: PROG [--foo FOO] bar\n" +"\n" +"group:\n" +" bar bar help\n" +" --foo FOO foo help" +msgstr "" + +msgid "" +"The :meth:`add_argument_group` method returns an argument group object which " +"has an :meth:`~ArgumentParser.add_argument` method just like a regular :" +"class:`ArgumentParser`. When an argument is added to the group, the parser " +"treats it just like a normal argument, but displays the argument in a " +"separate group for help messages. The :meth:`!add_argument_group` method " +"accepts *title* and *description* arguments which can be used to customize " +"this display::" +msgstr "" + +msgid "" +">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" +">>> group1 = parser.add_argument_group('group1', 'group1 description')\n" +">>> group1.add_argument('foo', help='foo help')\n" +">>> group2 = parser.add_argument_group('group2', 'group2 description')\n" +">>> group2.add_argument('--bar', help='bar help')\n" +">>> parser.print_help()\n" +"usage: PROG [--bar BAR] foo\n" +"\n" +"group1:\n" +" group1 description\n" +"\n" +" foo foo help\n" +"\n" +"group2:\n" +" group2 description\n" +"\n" +" --bar BAR bar help" +msgstr "" + +msgid "" +"The optional, keyword-only parameters argument_default_ and " +"conflict_handler_ allow for finer-grained control of the behavior of the " +"argument group. These parameters have the same meaning as in the :class:" +"`ArgumentParser` constructor, but apply specifically to the argument group " +"rather than the entire parser." +msgstr "" + +msgid "" +"Note that any arguments not in your user-defined groups will end up back in " +"the usual \"positional arguments\" and \"optional arguments\" sections." +msgstr "" +"Зверніть увагу, що будь-які аргументи, які не входять до визначених " +"користувачем груп, повертаються до звичайних розділів \"позиційні " +"аргументи\" та \"необов’язкові аргументи\"." + +msgid "" +"Calling :meth:`add_argument_group` on an argument group is deprecated. This " +"feature was never supported and does not always work correctly. The function " +"exists on the API by accident through inheritance and will be removed in the " +"future." +msgstr "" + +msgid "Mutual exclusion" +msgstr "Взаємне виключення" + +msgid "" +"Create a mutually exclusive group. :mod:`!argparse` will make sure that only " +"one of the arguments in the mutually exclusive group was present on the " +"command line::" +msgstr "" + +msgid "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> group = parser.add_mutually_exclusive_group()\n" +">>> group.add_argument('--foo', action='store_true')\n" +">>> group.add_argument('--bar', action='store_false')\n" +">>> parser.parse_args(['--foo'])\n" +"Namespace(bar=True, foo=True)\n" +">>> parser.parse_args(['--bar'])\n" +"Namespace(bar=False, foo=False)\n" +">>> parser.parse_args(['--foo', '--bar'])\n" +"usage: PROG [-h] [--foo | --bar]\n" +"PROG: error: argument --bar: not allowed with argument --foo" +msgstr "" + +msgid "" +"The :meth:`add_mutually_exclusive_group` method also accepts a *required* " +"argument, to indicate that at least one of the mutually exclusive arguments " +"is required::" +msgstr "" +"Метод :meth:`add_mutually_exclusive_group` також приймає *обов’язковий* " +"аргумент, щоб вказати, що потрібен принаймні один із взаємовиключних " +"аргументів:" + +msgid "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> group = parser.add_mutually_exclusive_group(required=True)\n" +">>> group.add_argument('--foo', action='store_true')\n" +">>> group.add_argument('--bar', action='store_false')\n" +">>> parser.parse_args([])\n" +"usage: PROG [-h] (--foo | --bar)\n" +"PROG: error: one of the arguments --foo --bar is required" +msgstr "" + +msgid "" +"Note that currently mutually exclusive argument groups do not support the " +"*title* and *description* arguments of :meth:`~ArgumentParser." +"add_argument_group`. However, a mutually exclusive group can be added to an " +"argument group that has a title and description. For example::" +msgstr "" + +msgid "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> group = parser.add_argument_group('Group title', 'Group description')\n" +">>> exclusive_group = group.add_mutually_exclusive_group(required=True)\n" +">>> exclusive_group.add_argument('--foo', help='foo help')\n" +">>> exclusive_group.add_argument('--bar', help='bar help')\n" +">>> parser.print_help()\n" +"usage: PROG [-h] (--foo FOO | --bar BAR)\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +"\n" +"Group title:\n" +" Group description\n" +"\n" +" --foo FOO foo help\n" +" --bar BAR bar help" +msgstr "" + +msgid "" +"Calling :meth:`add_argument_group` or :meth:`add_mutually_exclusive_group` " +"on a mutually exclusive group is deprecated. These features were never " +"supported and do not always work correctly. The functions exist on the API " +"by accident through inheritance and will be removed in the future." +msgstr "" + +msgid "Parser defaults" +msgstr "Параметри аналізатора за замовчуванням" + +msgid "" +"Most of the time, the attributes of the object returned by :meth:" +"`parse_args` will be fully determined by inspecting the command-line " +"arguments and the argument actions. :meth:`set_defaults` allows some " +"additional attributes that are determined without any inspection of the " +"command line to be added::" +msgstr "" +"У більшості випадків атрибути об’єкта, які повертає :meth:`parse_args`, " +"будуть повністю визначені шляхом перевірки аргументів командного рядка та " +"дій аргументів. :meth:`set_defaults` дозволяє додавати деякі додаткові " +"атрибути, які визначаються без перевірки командного рядка:" + +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('foo', type=int)\n" +">>> parser.set_defaults(bar=42, baz='badger')\n" +">>> parser.parse_args(['736'])\n" +"Namespace(bar=42, baz='badger', foo=736)" +msgstr "" + +msgid "" +"Note that parser-level defaults always override argument-level defaults::" +msgstr "" +"Зверніть увагу, що значення за замовчуванням на рівні аналізатора завжди " +"перекривають значення за замовчуванням на рівні аргументів::" + +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', default='bar')\n" +">>> parser.set_defaults(foo='spam')\n" +">>> parser.parse_args([])\n" +"Namespace(foo='spam')" +msgstr "" + +msgid "" +"Parser-level defaults can be particularly useful when working with multiple " +"parsers. See the :meth:`~ArgumentParser.add_subparsers` method for an " +"example of this type." +msgstr "" +"Значення за замовчуванням на рівні парсера можуть бути особливо корисними " +"під час роботи з декількома парсерами. Перегляньте метод :meth:" +"`~ArgumentParser.add_subparsers` для прикладу цього типу." + +msgid "" +"Get the default value for a namespace attribute, as set by either :meth:" +"`~ArgumentParser.add_argument` or by :meth:`~ArgumentParser.set_defaults`::" +msgstr "" +"Отримати значення за замовчуванням для атрибута простору імен, встановлене " +"або :meth:`~ArgumentParser.add_argument`, або :meth:`~ArgumentParser." +"set_defaults`::" + +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', default='badger')\n" +">>> parser.get_default('foo')\n" +"'badger'" +msgstr "" + +msgid "Printing help" +msgstr "Друк довідки" + +msgid "" +"In most typical applications, :meth:`~ArgumentParser.parse_args` will take " +"care of formatting and printing any usage or error messages. However, " +"several formatting methods are available:" +msgstr "" +"У більшості типових програм :meth:`~ArgumentParser.parse_args` подбає про " +"форматування та друк будь-яких повідомлень про використання чи помилки. " +"Однак доступно кілька методів форматування:" + +msgid "" +"Print a brief description of how the :class:`ArgumentParser` should be " +"invoked on the command line. If *file* is ``None``, :data:`sys.stdout` is " +"assumed." +msgstr "" +"Надрукуйте короткий опис того, як :class:`ArgumentParser` слід викликати в " +"командному рядку. Якщо *file* має значення ``None``, передбачається :data:" +"`sys.stdout`." + +msgid "" +"Print a help message, including the program usage and information about the " +"arguments registered with the :class:`ArgumentParser`. If *file* is " +"``None``, :data:`sys.stdout` is assumed." +msgstr "" +"Надрукуйте довідкове повідомлення, включно з використанням програми та " +"інформацією про аргументи, зареєстровані в :class:`ArgumentParser`. Якщо " +"*file* має значення ``None``, передбачається :data:`sys.stdout`." + +msgid "" +"There are also variants of these methods that simply return a string instead " +"of printing it:" +msgstr "" +"Існують також варіанти цих методів, які просто повертають рядок замість " +"того, щоб друкувати його:" + +msgid "" +"Return a string containing a brief description of how the :class:" +"`ArgumentParser` should be invoked on the command line." +msgstr "" +"Повертає рядок, що містить короткий опис того, як :class:`ArgumentParser` " +"слід викликати в командному рядку." + +msgid "" +"Return a string containing a help message, including the program usage and " +"information about the arguments registered with the :class:`ArgumentParser`." +msgstr "" +"Повертає рядок, що містить довідкове повідомлення, включаючи використання " +"програми та інформацію про аргументи, зареєстровані в :class:" +"`ArgumentParser`." + +msgid "Partial parsing" +msgstr "Частковий розбір" + +msgid "" +"Sometimes a script may only parse a few of the command-line arguments, " +"passing the remaining arguments on to another script or program. In these " +"cases, the :meth:`~ArgumentParser.parse_known_args` method can be useful. " +"It works much like :meth:`~ArgumentParser.parse_args` except that it does " +"not produce an error when extra arguments are present. Instead, it returns " +"a two item tuple containing the populated namespace and the list of " +"remaining argument strings." +msgstr "" +"Іноді сценарій може аналізувати лише кілька аргументів командного рядка, " +"передаючи решту аргументів іншому сценарію чи програмі. У цих випадках може " +"бути корисним метод :meth:`~ArgumentParser.parse_known_args`. Він працює так " +"само, як :meth:`~ArgumentParser.parse_args`, за винятком того, що не створює " +"помилки, коли присутні додаткові аргументи. Замість цього він повертає " +"кортеж із двома елементами, що містить заповнений простір імен і список " +"решти рядків аргументів." + +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', action='store_true')\n" +">>> parser.add_argument('bar')\n" +">>> parser.parse_known_args(['--foo', '--badger', 'BAR', 'spam'])\n" +"(Namespace(bar='BAR', foo=True), ['--badger', 'spam'])" +msgstr "" + +msgid "" +":ref:`Prefix matching ` rules apply to :meth:" +"`~ArgumentParser.parse_known_args`. The parser may consume an option even if " +"it's just a prefix of one of its known options, instead of leaving it in the " +"remaining arguments list." +msgstr "" + +msgid "Customizing file parsing" +msgstr "Налаштування аналізу файлів" + +msgid "" +"Arguments that are read from a file (see the *fromfile_prefix_chars* keyword " +"argument to the :class:`ArgumentParser` constructor) are read one argument " +"per line. :meth:`convert_arg_line_to_args` can be overridden for fancier " +"reading." +msgstr "" +"Аргументи, які зчитуються з файлу (див. аргумент ключового слова " +"*fromfile_prefix_chars* конструктора :class:`ArgumentParser`), зчитуються по " +"одному аргументу на рядок. :meth:`convert_arg_line_to_args` можна замінити " +"для кращого читання." + +msgid "" +"This method takes a single argument *arg_line* which is a string read from " +"the argument file. It returns a list of arguments parsed from this string. " +"The method is called once per line read from the argument file, in order." +msgstr "" +"Цей метод приймає один аргумент *arg_line*, який є рядком, прочитаним з " +"файлу аргументів. Він повертає список аргументів, розібраних із цього рядка. " +"Метод викликається один раз на рядок, який читається з файлу аргументів, по " +"порядку." + +msgid "" +"A useful override of this method is one that treats each space-separated " +"word as an argument. The following example demonstrates how to do this::" +msgstr "" +"Корисною заміною цього методу є те, що розглядає кожне розділене пробілом " +"слово як аргумент. Наступний приклад демонструє, як це зробити:" + +msgid "" +"class MyArgumentParser(argparse.ArgumentParser):\n" +" def convert_arg_line_to_args(self, arg_line):\n" +" return arg_line.split()" +msgstr "" + +msgid "Exiting methods" +msgstr "Методи виходу" + +msgid "" +"This method terminates the program, exiting with the specified *status* and, " +"if given, it prints a *message* to :data:`sys.stderr` before that. The user " +"can override this method to handle these steps differently::" +msgstr "" + +msgid "" +"class ErrorCatchingArgumentParser(argparse.ArgumentParser):\n" +" def exit(self, status=0, message=None):\n" +" if status:\n" +" raise Exception(f'Exiting because of an error: {message}')\n" +" exit(status)" +msgstr "" + +msgid "" +"This method prints a usage message, including the *message*, to :data:`sys." +"stderr` and terminates the program with a status code of 2." +msgstr "" + +msgid "Intermixed parsing" +msgstr "Змішаний розбір" + +msgid "" +"A number of Unix commands allow the user to intermix optional arguments with " +"positional arguments. The :meth:`~ArgumentParser.parse_intermixed_args` " +"and :meth:`~ArgumentParser.parse_known_intermixed_args` methods support this " +"parsing style." +msgstr "" +"Ряд команд Unix дозволяє користувачеві змішувати додаткові аргументи з " +"позиційними. Методи :meth:`~ArgumentParser.parse_intermixed_args` і :meth:" +"`~ArgumentParser.parse_known_intermixed_args` підтримують цей стиль аналізу." + +msgid "" +"These parsers do not support all the :mod:`!argparse` features, and will " +"raise exceptions if unsupported features are used. In particular, " +"subparsers, and mutually exclusive groups that include both optionals and " +"positionals are not supported." +msgstr "" + +msgid "" +"The following example shows the difference between :meth:`~ArgumentParser." +"parse_known_args` and :meth:`~ArgumentParser.parse_intermixed_args`: the " +"former returns ``['2', '3']`` as unparsed arguments, while the latter " +"collects all the positionals into ``rest``. ::" +msgstr "" +"У наступному прикладі показано різницю між :meth:`~ArgumentParser." +"parse_known_args` і :meth:`~ArgumentParser.parse_intermixed_args`: перший " +"повертає ``['2', '3']`` як нерозібрані аргументи, а другий збирає всі " +"позиційні елементи в ``rest``. ::" + +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo')\n" +">>> parser.add_argument('cmd')\n" +">>> parser.add_argument('rest', nargs='*', type=int)\n" +">>> parser.parse_known_args('doit 1 --foo bar 2 3'.split())\n" +"(Namespace(cmd='doit', foo='bar', rest=[1]), ['2', '3'])\n" +">>> parser.parse_intermixed_args('doit 1 --foo bar 2 3'.split())\n" +"Namespace(cmd='doit', foo='bar', rest=[1, 2, 3])" +msgstr "" + +msgid "" +":meth:`~ArgumentParser.parse_known_intermixed_args` returns a two item tuple " +"containing the populated namespace and the list of remaining argument " +"strings. :meth:`~ArgumentParser.parse_intermixed_args` raises an error if " +"there are any remaining unparsed argument strings." +msgstr "" +":meth:`~ArgumentParser.parse_known_intermixed_args` повертає кортеж із двома " +"елементами, що містить заповнений простір імен і список решти рядків " +"аргументів. :meth:`~ArgumentParser.parse_intermixed_args` викликає помилку, " +"якщо залишилися нерозібрані рядки аргументів." + +msgid "Registering custom types or actions" +msgstr "" + +msgid "" +"Sometimes it's desirable to use a custom string in error messages to provide " +"more user-friendly output. In these cases, :meth:`!register` can be used to " +"register custom actions or types with a parser and allow you to reference " +"the type by their registered name instead of their callable name." +msgstr "" + +msgid "" +"The :meth:`!register` method accepts three arguments - a *registry_name*, " +"specifying the internal registry where the object will be stored (e.g., " +"``action``, ``type``), *value*, which is the key under which the object will " +"be registered, and object, the callable to be registered." +msgstr "" + +msgid "" +"The following example shows how to register a custom type with a parser::" +msgstr "" + +msgid "" +">>> import argparse\n" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.register('type', 'hexadecimal integer', lambda s: int(s, 16))\n" +">>> parser.add_argument('--foo', type='hexadecimal integer')\n" +"_StoreAction(option_strings=['--foo'], dest='foo', nargs=None, const=None, " +"default=None, type='hexadecimal integer', choices=None, required=False, " +"help=None, metavar=None, deprecated=False)\n" +">>> parser.parse_args(['--foo', '0xFA'])\n" +"Namespace(foo=250)\n" +">>> parser.parse_args(['--foo', '1.2'])\n" +"usage: PROG [-h] [--foo FOO]\n" +"PROG: error: argument --foo: invalid 'hexadecimal integer' value: '1.2'" +msgstr "" + +msgid "Exceptions" +msgstr "Винятки" + +msgid "An error from creating or using an argument (optional or positional)." +msgstr "" + +msgid "" +"The string value of this exception is the message, augmented with " +"information about the argument that caused it." +msgstr "" + +msgid "" +"Raised when something goes wrong converting a command line string to a type." +msgstr "" + +msgid "Guides and Tutorials" +msgstr "Посібники та підручники" + +msgid "? (question mark)" +msgstr "? (знак питання)" + +msgid "in argparse module" +msgstr "" + +msgid "* (asterisk)" +msgstr "* (зірочка)" + +msgid "+ (plus)" +msgstr "" diff --git a/library/array.po b/library/array.po new file mode 100644 index 000000000..3d6f575a2 --- /dev/null +++ b/library/array.po @@ -0,0 +1,414 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:54+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!array` --- Efficient arrays of numeric values" +msgstr "" + +msgid "" +"This module defines an object type which can compactly represent an array of " +"basic values: characters, integers, floating-point numbers. Arrays are " +"sequence types and behave very much like lists, except that the type of " +"objects stored in them is constrained. The type is specified at object " +"creation time by using a :dfn:`type code`, which is a single character. The " +"following type codes are defined:" +msgstr "" + +msgid "Type code" +msgstr "Введіть код" + +msgid "C Type" +msgstr "C Тип" + +msgid "Python Type" +msgstr "Тип Python" + +msgid "Minimum size in bytes" +msgstr "Мінімальний розмір у байтах" + +msgid "Notes" +msgstr "Примітки" + +msgid "``'b'``" +msgstr "``'b''``" + +msgid "signed char" +msgstr "підписаний символ" + +msgid "int" +msgstr "внутр" + +msgid "1" +msgstr "1" + +msgid "``'B'``" +msgstr "``'B'``" + +msgid "unsigned char" +msgstr "беззнаковий символ" + +msgid "``'u'``" +msgstr "``'u''``" + +msgid "wchar_t" +msgstr "wchar_t" + +msgid "Unicode character" +msgstr "символ Unicode" + +msgid "2" +msgstr "2" + +msgid "\\(1)" +msgstr "\\(1)" + +msgid "``'w'``" +msgstr "``'w'``" + +msgid "Py_UCS4" +msgstr "" + +msgid "4" +msgstr "4" + +msgid "``'h'``" +msgstr "``'h''``" + +msgid "signed short" +msgstr "підписаний короткий" + +msgid "``'H'``" +msgstr "``'H''``" + +msgid "unsigned short" +msgstr "непідписаний короткий" + +msgid "``'i'``" +msgstr "``'я''``" + +msgid "signed int" +msgstr "підписаний внутр" + +msgid "``'I'``" +msgstr "``'Я''``" + +msgid "unsigned int" +msgstr "unsigned int" + +msgid "``'l'``" +msgstr "``'l'``" + +msgid "signed long" +msgstr "підписаний довго" + +msgid "``'L'``" +msgstr "``'L'``" + +msgid "unsigned long" +msgstr "беззнаковий довгий" + +msgid "``'q'``" +msgstr "``'q''``" + +msgid "signed long long" +msgstr "підписаний довгий довгий" + +msgid "8" +msgstr "8" + +msgid "``'Q'``" +msgstr "``'Q''``" + +msgid "unsigned long long" +msgstr "без знака довгий довгий" + +msgid "``'f'``" +msgstr "``'f''``" + +msgid "float" +msgstr "плавати" + +msgid "``'d'``" +msgstr "``'d''``" + +msgid "double" +msgstr "подвійний" + +msgid "Notes:" +msgstr "Примітки:" + +msgid "It can be 16 bits or 32 bits depending on the platform." +msgstr "Це може бути 16 або 32 біти залежно від платформи." + +msgid "" +"``array('u')`` now uses :c:type:`wchar_t` as C type instead of deprecated " +"``Py_UNICODE``. This change doesn't affect its behavior because " +"``Py_UNICODE`` is alias of :c:type:`wchar_t` since Python 3.3." +msgstr "" + +msgid "Please migrate to ``'w'`` typecode." +msgstr "" + +msgid "" +"The actual representation of values is determined by the machine " +"architecture (strictly speaking, by the C implementation). The actual size " +"can be accessed through the :attr:`array.itemsize` attribute." +msgstr "" + +msgid "The module defines the following item:" +msgstr "" + +msgid "A string with all available type codes." +msgstr "Рядок із усіма доступними кодами типів." + +msgid "The module defines the following type:" +msgstr "Модуль визначає наступний тип:" + +msgid "" +"A new array whose items are restricted by *typecode*, and initialized from " +"the optional *initializer* value, which must be a :class:`bytes` or :class:" +"`bytearray` object, a Unicode string, or iterable over elements of the " +"appropriate type." +msgstr "" + +msgid "" +"If given a :class:`bytes` or :class:`bytearray` object, the initializer is " +"passed to the new array's :meth:`frombytes` method; if given a Unicode " +"string, the initializer is passed to the :meth:`fromunicode` method; " +"otherwise, the initializer's iterator is passed to the :meth:`extend` method " +"to add initial items to the array." +msgstr "" + +msgid "" +"Array objects support the ordinary sequence operations of indexing, slicing, " +"concatenation, and multiplication. When using slice assignment, the " +"assigned value must be an array object with the same type code; in all other " +"cases, :exc:`TypeError` is raised. Array objects also implement the buffer " +"interface, and may be used wherever :term:`bytes-like objects ` are supported." +msgstr "" +"Об’єкти-масиви підтримують звичайні операції послідовності індексування, " +"нарізки, конкатенації та множення. Якщо використовується призначення " +"фрагментів, призначене значення має бути об’єктом масиву з таким же кодом " +"типу; у всіх інших випадках виникає :exc:`TypeError`. Об’єкти-масиви також " +"реалізують інтерфейс буфера, і їх можна використовувати скрізь, де " +"підтримуються :term:`байтоподібні об’єкти `." + +msgid "" +"Raises an :ref:`auditing event ` ``array.__new__`` with arguments " +"``typecode``, ``initializer``." +msgstr "" +"Викликає :ref:`подію аудиту ` ``array.__new__`` з аргументами " +"``typecode``, ``initializer``." + +msgid "The typecode character used to create the array." +msgstr "Символ коду типу, який використовується для створення масиву." + +msgid "The length in bytes of one array item in the internal representation." +msgstr "Довжина в байтах одного елемента масиву у внутрішньому представленні." + +msgid "Append a new item with value *x* to the end of the array." +msgstr "Додайте новий елемент зі значенням *x* у кінець масиву." + +msgid "" +"Return a tuple ``(address, length)`` giving the current memory address and " +"the length in elements of the buffer used to hold array's contents. The " +"size of the memory buffer in bytes can be computed as ``array.buffer_info()" +"[1] * array.itemsize``. This is occasionally useful when working with low-" +"level (and inherently unsafe) I/O interfaces that require memory addresses, " +"such as certain :c:func:`!ioctl` operations. The returned numbers are valid " +"as long as the array exists and no length-changing operations are applied to " +"it." +msgstr "" + +msgid "" +"When using array objects from code written in C or C++ (the only way to " +"effectively make use of this information), it makes more sense to use the " +"buffer interface supported by array objects. This method is maintained for " +"backward compatibility and should be avoided in new code. The buffer " +"interface is documented in :ref:`bufferobjects`." +msgstr "" +"При використанні об’єктів масиву з коду, написаного на C або C++ (єдиний " +"спосіб ефективного використання цієї інформації), має сенс використовувати " +"інтерфейс буфера, який підтримується об’єктами масиву. Цей метод " +"підтримується для зворотної сумісності, і його слід уникати в новому коді. " +"Інтерфейс буфера задокументовано в :ref:`bufferobjects`." + +msgid "" +"\"Byteswap\" all items of the array. This is only supported for values " +"which are 1, 2, 4, or 8 bytes in size; for other types of values, :exc:" +"`RuntimeError` is raised. It is useful when reading data from a file " +"written on a machine with a different byte order." +msgstr "" +"\"Побайтувати\" всі елементи масиву. Це підтримується лише для значень " +"розміром 1, 2, 4 або 8 байтів; для інших типів значень виникає :exc:" +"`RuntimeError`. Це корисно під час читання даних із файлу, записаного на " +"машині з іншим порядком байтів." + +msgid "Return the number of occurrences of *x* in the array." +msgstr "Повертає кількість входжень *x* в масиві." + +msgid "" +"Append items from *iterable* to the end of the array. If *iterable* is " +"another array, it must have *exactly* the same type code; if not, :exc:" +"`TypeError` will be raised. If *iterable* is not an array, it must be " +"iterable and its elements must be the right type to be appended to the array." +msgstr "" +"Додайте елементи з *iterable* у кінець масиву. Якщо *iterable* є іншим " +"масивом, він повинен мати *точно* той самий код типу; якщо ні, буде " +"викликано :exc:`TypeError`. Якщо *iterable* не є масивом, він має бути " +"повторюваним, а його елементи мають мати правильний тип для додавання до " +"масиву." + +msgid "" +"Appends items from the :term:`bytes-like object`, interpreting its content " +"as an array of machine values (as if it had been read from a file using the :" +"meth:`fromfile` method)." +msgstr "" + +msgid ":meth:`!fromstring` is renamed to :meth:`frombytes` for clarity." +msgstr "" + +msgid "" +"Read *n* items (as machine values) from the :term:`file object` *f* and " +"append them to the end of the array. If less than *n* items are available, :" +"exc:`EOFError` is raised, but the items that were available are still " +"inserted into the array." +msgstr "" +"Прочитайте *n* елементів (як машинні значення) з :term:`file object` *f* і " +"додайте їх у кінець масиву. Якщо доступно менше *n* елементів, виникає :exc:" +"`EOFError`, але доступні елементи все одно вставляються в масив." + +msgid "" +"Append items from the list. This is equivalent to ``for x in list: a." +"append(x)`` except that if there is a type error, the array is unchanged." +msgstr "" +"Додавання елементів зі списку. Це еквівалентно ``для x у списку: a." +"append(x)`` за винятком того, що якщо є помилка типу, масив не змінюється." + +msgid "" +"Extends this array with data from the given Unicode string. The array must " +"have type code ``'u'`` or ``'w'``; otherwise a :exc:`ValueError` is raised. " +"Use ``array.frombytes(unicodestring.encode(enc))`` to append Unicode data to " +"an array of some other type." +msgstr "" + +msgid "" +"Return the smallest *i* such that *i* is the index of the first occurrence " +"of *x* in the array. The optional arguments *start* and *stop* can be " +"specified to search for *x* within a subsection of the array. Raise :exc:" +"`ValueError` if *x* is not found." +msgstr "" +"Повертає найменше *i* таке, що *i* є індексом першого входження *x* в " +"масиві. Для пошуку *x* у підрозділі масиву можна вказати необов’язкові " +"аргументи *start* і *stop*. Викликати :exc:`ValueError`, якщо *x* не " +"знайдено." + +msgid "Added optional *start* and *stop* parameters." +msgstr "Додано додаткові параметри *start* і *stop*." + +msgid "" +"Insert a new item with value *x* in the array before position *i*. Negative " +"values are treated as being relative to the end of the array." +msgstr "" +"Вставте новий елемент зі значенням *x* в масив перед позицією *i*. Від’ємні " +"значення розглядаються як відносні до кінця масиву." + +msgid "" +"Removes the item with the index *i* from the array and returns it. The " +"optional argument defaults to ``-1``, so that by default the last item is " +"removed and returned." +msgstr "" +"Вилучає з масиву елемент з індексом *i* і повертає його. Необов’язковий " +"аргумент за умовчанням має значення ``-1``, тому за замовчуванням останній " +"елемент видаляється та повертається." + +msgid "Remove the first occurrence of *x* from the array." +msgstr "Видаліть перше входження *x* з масиву." + +msgid "Remove all elements from the array." +msgstr "" + +msgid "Reverse the order of the items in the array." +msgstr "Змінити порядок елементів у масиві." + +msgid "" +"Convert the array to an array of machine values and return the bytes " +"representation (the same sequence of bytes that would be written to a file " +"by the :meth:`tofile` method.)" +msgstr "" +"Перетворіть масив на масив машинних значень і поверніть представлення байтів " +"(та сама послідовність байтів, яка була б записана у файл за допомогою " +"методу :meth:`tofile`)." + +msgid ":meth:`!tostring` is renamed to :meth:`tobytes` for clarity." +msgstr "" + +msgid "Write all items (as machine values) to the :term:`file object` *f*." +msgstr "Запишіть усі елементи (як машинні значення) в :term:`file object` *f*." + +msgid "Convert the array to an ordinary list with the same items." +msgstr "Перетворіть масив на звичайний список з тими самими елементами." + +msgid "" +"Convert the array to a Unicode string. The array must have a type ``'u'`` " +"or ``'w'``; otherwise a :exc:`ValueError` is raised. Use ``array.tobytes()." +"decode(enc)`` to obtain a Unicode string from an array of some other type." +msgstr "" + +msgid "" +"The string representation of array objects has the form ``array(typecode, " +"initializer)``. The *initializer* is omitted if the array is empty, " +"otherwise it is a Unicode string if the *typecode* is ``'u'`` or ``'w'``, " +"otherwise it is a list of numbers. The string representation is guaranteed " +"to be able to be converted back to an array with the same type and value " +"using :func:`eval`, so long as the :class:`~array.array` class has been " +"imported using ``from array import array``. Variables ``inf`` and ``nan`` " +"must also be defined if it contains corresponding floating-point values. " +"Examples::" +msgstr "" + +msgid "" +"array('l')\n" +"array('w', 'hello \\u2641')\n" +"array('l', [1, 2, 3, 4, 5])\n" +"array('d', [1.0, 2.0, 3.14, -inf, nan])" +msgstr "" + +msgid "Module :mod:`struct`" +msgstr "Модуль :mod:`struct`" + +msgid "Packing and unpacking of heterogeneous binary data." +msgstr "Упаковка та розпакування різнорідних двійкових даних." + +msgid "`NumPy `_" +msgstr "`NumPy `_" + +msgid "The NumPy package defines another array type." +msgstr "Пакет NumPy визначає інший тип масиву." + +msgid "arrays" +msgstr "" diff --git a/library/ast.po b/library/ast.po new file mode 100644 index 000000000..a75c5578f --- /dev/null +++ b/library/ast.po @@ -0,0 +1,3080 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:54+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!ast` --- Abstract Syntax Trees" +msgstr "" + +msgid "**Source code:** :source:`Lib/ast.py`" +msgstr "**Вихідний код:** :source:`Lib/ast.py`" + +msgid "" +"The :mod:`ast` module helps Python applications to process trees of the " +"Python abstract syntax grammar. The abstract syntax itself might change " +"with each Python release; this module helps to find out programmatically " +"what the current grammar looks like." +msgstr "" +"Модуль :mod:`ast` допомагає програмам Python обробляти дерева граматики " +"абстрактного синтаксису Python. Сам абстрактний синтаксис може змінюватися з " +"кожним випуском Python; цей модуль допомагає програмно дізнатися, як " +"виглядає поточна граматика." + +msgid "" +"An abstract syntax tree can be generated by passing :data:`ast." +"PyCF_ONLY_AST` as a flag to the :func:`compile` built-in function, or using " +"the :func:`parse` helper provided in this module. The result will be a tree " +"of objects whose classes all inherit from :class:`ast.AST`. An abstract " +"syntax tree can be compiled into a Python code object using the built-in :" +"func:`compile` function." +msgstr "" +"Абстрактне синтаксичне дерево можна створити, передавши :data:`ast." +"PyCF_ONLY_AST` як прапорець вбудованій функції :func:`compile` або " +"використовуючи помічник :func:`parse`, наданий у цьому модулі. Результатом " +"буде дерево об’єктів, усі класи яких успадковуються від :class:`ast.AST`. " +"Абстрактне синтаксичне дерево можна скомпілювати в об’єкт коду Python за " +"допомогою вбудованої функції :func:`compile`." + +msgid "Abstract Grammar" +msgstr "Абстрактна граматика" + +msgid "The abstract grammar is currently defined as follows:" +msgstr "Наразі абстрактна граматика визначається наступним чином:" + +msgid "" +"-- ASDL's 4 builtin types are:\n" +"-- identifier, int, string, constant\n" +"\n" +"module Python\n" +"{\n" +" mod = Module(stmt* body, type_ignore* type_ignores)\n" +" | Interactive(stmt* body)\n" +" | Expression(expr body)\n" +" | FunctionType(expr* argtypes, expr returns)\n" +"\n" +" stmt = FunctionDef(identifier name, arguments args,\n" +" stmt* body, expr* decorator_list, expr? returns,\n" +" string? type_comment, type_param* type_params)\n" +" | AsyncFunctionDef(identifier name, arguments args,\n" +" stmt* body, expr* decorator_list, expr? " +"returns,\n" +" string? type_comment, type_param* type_params)\n" +"\n" +" | ClassDef(identifier name,\n" +" expr* bases,\n" +" keyword* keywords,\n" +" stmt* body,\n" +" expr* decorator_list,\n" +" type_param* type_params)\n" +" | Return(expr? value)\n" +"\n" +" | Delete(expr* targets)\n" +" | Assign(expr* targets, expr value, string? type_comment)\n" +" | TypeAlias(expr name, type_param* type_params, expr value)\n" +" | AugAssign(expr target, operator op, expr value)\n" +" -- 'simple' indicates that we annotate simple name without parens\n" +" | AnnAssign(expr target, expr annotation, expr? value, int " +"simple)\n" +"\n" +" -- use 'orelse' because else is a keyword in target languages\n" +" | For(expr target, expr iter, stmt* body, stmt* orelse, string? " +"type_comment)\n" +" | AsyncFor(expr target, expr iter, stmt* body, stmt* orelse, " +"string? type_comment)\n" +" | While(expr test, stmt* body, stmt* orelse)\n" +" | If(expr test, stmt* body, stmt* orelse)\n" +" | With(withitem* items, stmt* body, string? type_comment)\n" +" | AsyncWith(withitem* items, stmt* body, string? type_comment)\n" +"\n" +" | Match(expr subject, match_case* cases)\n" +"\n" +" | Raise(expr? exc, expr? cause)\n" +" | Try(stmt* body, excepthandler* handlers, stmt* orelse, stmt* " +"finalbody)\n" +" | TryStar(stmt* body, excepthandler* handlers, stmt* orelse, stmt* " +"finalbody)\n" +" | Assert(expr test, expr? msg)\n" +"\n" +" | Import(alias* names)\n" +" | ImportFrom(identifier? module, alias* names, int? level)\n" +"\n" +" | Global(identifier* names)\n" +" | Nonlocal(identifier* names)\n" +" | Expr(expr value)\n" +" | Pass | Break | Continue\n" +"\n" +" -- col_offset is the byte offset in the utf8 string the parser " +"uses\n" +" attributes (int lineno, int col_offset, int? end_lineno, int? " +"end_col_offset)\n" +"\n" +" -- BoolOp() can use left & right?\n" +" expr = BoolOp(boolop op, expr* values)\n" +" | NamedExpr(expr target, expr value)\n" +" | BinOp(expr left, operator op, expr right)\n" +" | UnaryOp(unaryop op, expr operand)\n" +" | Lambda(arguments args, expr body)\n" +" | IfExp(expr test, expr body, expr orelse)\n" +" | Dict(expr* keys, expr* values)\n" +" | Set(expr* elts)\n" +" | ListComp(expr elt, comprehension* generators)\n" +" | SetComp(expr elt, comprehension* generators)\n" +" | DictComp(expr key, expr value, comprehension* generators)\n" +" | GeneratorExp(expr elt, comprehension* generators)\n" +" -- the grammar constrains where yield expressions can occur\n" +" | Await(expr value)\n" +" | Yield(expr? value)\n" +" | YieldFrom(expr value)\n" +" -- need sequences for compare to distinguish between\n" +" -- x < 4 < 3 and (x < 4) < 3\n" +" | Compare(expr left, cmpop* ops, expr* comparators)\n" +" | Call(expr func, expr* args, keyword* keywords)\n" +" | FormattedValue(expr value, int conversion, expr? format_spec)\n" +" | JoinedStr(expr* values)\n" +" | Constant(constant value, string? kind)\n" +"\n" +" -- the following expression can appear in assignment context\n" +" | Attribute(expr value, identifier attr, expr_context ctx)\n" +" | Subscript(expr value, expr slice, expr_context ctx)\n" +" | Starred(expr value, expr_context ctx)\n" +" | Name(identifier id, expr_context ctx)\n" +" | List(expr* elts, expr_context ctx)\n" +" | Tuple(expr* elts, expr_context ctx)\n" +"\n" +" -- can appear only in Subscript\n" +" | Slice(expr? lower, expr? upper, expr? step)\n" +"\n" +" -- col_offset is the byte offset in the utf8 string the parser " +"uses\n" +" attributes (int lineno, int col_offset, int? end_lineno, int? " +"end_col_offset)\n" +"\n" +" expr_context = Load | Store | Del\n" +"\n" +" boolop = And | Or\n" +"\n" +" operator = Add | Sub | Mult | MatMult | Div | Mod | Pow | LShift\n" +" | RShift | BitOr | BitXor | BitAnd | FloorDiv\n" +"\n" +" unaryop = Invert | Not | UAdd | USub\n" +"\n" +" cmpop = Eq | NotEq | Lt | LtE | Gt | GtE | Is | IsNot | In | NotIn\n" +"\n" +" comprehension = (expr target, expr iter, expr* ifs, int is_async)\n" +"\n" +" excepthandler = ExceptHandler(expr? type, identifier? name, stmt* body)\n" +" attributes (int lineno, int col_offset, int? end_lineno, " +"int? end_col_offset)\n" +"\n" +" arguments = (arg* posonlyargs, arg* args, arg? vararg, arg* kwonlyargs,\n" +" expr* kw_defaults, arg? kwarg, expr* defaults)\n" +"\n" +" arg = (identifier arg, expr? annotation, string? type_comment)\n" +" attributes (int lineno, int col_offset, int? end_lineno, int? " +"end_col_offset)\n" +"\n" +" -- keyword arguments supplied to call (NULL identifier for **kwargs)\n" +" keyword = (identifier? arg, expr value)\n" +" attributes (int lineno, int col_offset, int? end_lineno, int? " +"end_col_offset)\n" +"\n" +" -- import name with optional 'as' alias.\n" +" alias = (identifier name, identifier? asname)\n" +" attributes (int lineno, int col_offset, int? end_lineno, int? " +"end_col_offset)\n" +"\n" +" withitem = (expr context_expr, expr? optional_vars)\n" +"\n" +" match_case = (pattern pattern, expr? guard, stmt* body)\n" +"\n" +" pattern = MatchValue(expr value)\n" +" | MatchSingleton(constant value)\n" +" | MatchSequence(pattern* patterns)\n" +" | MatchMapping(expr* keys, pattern* patterns, identifier? rest)\n" +" | MatchClass(expr cls, pattern* patterns, identifier* kwd_attrs, " +"pattern* kwd_patterns)\n" +"\n" +" | MatchStar(identifier? name)\n" +" -- The optional \"rest\" MatchMapping parameter handles " +"capturing extra mapping keys\n" +"\n" +" | MatchAs(pattern? pattern, identifier? name)\n" +" | MatchOr(pattern* patterns)\n" +"\n" +" attributes (int lineno, int col_offset, int end_lineno, int " +"end_col_offset)\n" +"\n" +" type_ignore = TypeIgnore(int lineno, string tag)\n" +"\n" +" type_param = TypeVar(identifier name, expr? bound, expr? default_value)\n" +" | ParamSpec(identifier name, expr? default_value)\n" +" | TypeVarTuple(identifier name, expr? default_value)\n" +" attributes (int lineno, int col_offset, int end_lineno, int " +"end_col_offset)\n" +"}\n" +msgstr "" + +msgid "Node classes" +msgstr "Класи вузлів" + +msgid "" +"This is the base of all AST node classes. The actual node classes are " +"derived from the :file:`Parser/Python.asdl` file, which is reproduced :ref:" +"`above `. They are defined in the :mod:`!_ast` C module " +"and re-exported in :mod:`ast`." +msgstr "" + +msgid "" +"There is one class defined for each left-hand side symbol in the abstract " +"grammar (for example, :class:`ast.stmt` or :class:`ast.expr`). In addition, " +"there is one class defined for each constructor on the right-hand side; " +"these classes inherit from the classes for the left-hand side trees. For " +"example, :class:`ast.BinOp` inherits from :class:`ast.expr`. For production " +"rules with alternatives (aka \"sums\"), the left-hand side class is " +"abstract: only instances of specific constructor nodes are ever created." +msgstr "" +"Для кожного лівого символу в абстрактній граматиці визначено один клас " +"(наприклад, :class:`ast.stmt` або :class:`ast.expr`). Крім того, є один " +"клас, визначений для кожного конструктора в правій частині; ці класи " +"успадковують класи для лівих дерев. Наприклад, :class:`ast.BinOp` " +"успадковується від :class:`ast.expr`. Для виробничих правил з альтернативами " +"(він же \"суми\") лівий клас є абстрактним: створюються лише екземпляри " +"конкретних вузлів конструктора." + +msgid "" +"Each concrete class has an attribute :attr:`!_fields` which gives the names " +"of all child nodes." +msgstr "" + +msgid "" +"Each instance of a concrete class has one attribute for each child node, of " +"the type as defined in the grammar. For example, :class:`ast.BinOp` " +"instances have an attribute :attr:`left` of type :class:`ast.expr`." +msgstr "" +"Кожен екземпляр конкретного класу має один атрибут для кожного дочірнього " +"вузла типу, визначеного в граматиці. Наприклад, екземпляри :class:`ast." +"BinOp` мають атрибут :attr:`left` типу :class:`ast.expr`." + +msgid "" +"If these attributes are marked as optional in the grammar (using a question " +"mark), the value might be ``None``. If the attributes can have zero-or-more " +"values (marked with an asterisk), the values are represented as Python " +"lists. All possible attributes must be present and have valid values when " +"compiling an AST with :func:`compile`." +msgstr "" +"Якщо ці атрибути позначені як необов’язкові в граматиці (використовуючи знак " +"питання), значенням може бути ``None``. Якщо атрибути можуть мати нуль або " +"більше значень (позначених зірочкою), значення представлені у вигляді " +"списків Python. Під час компіляції AST за допомогою :func:`compile` усі " +"можливі атрибути повинні бути присутніми та мати дійсні значення." + +msgid "" +"The :attr:`!_field_types` attribute on each concrete class is a dictionary " +"mapping field names (as also listed in :attr:`_fields`) to their types." +msgstr "" + +msgid "" +">>> ast.TypeVar._field_types\n" +"{'name': , 'bound': ast.expr | None, 'default_value': ast.expr " +"| None}" +msgstr "" + +msgid "" +"Instances of :class:`ast.expr` and :class:`ast.stmt` subclasses have :attr:" +"`lineno`, :attr:`col_offset`, :attr:`end_lineno`, and :attr:`end_col_offset` " +"attributes. The :attr:`lineno` and :attr:`end_lineno` are the first and " +"last line numbers of source text span (1-indexed so the first line is line " +"1) and the :attr:`col_offset` and :attr:`end_col_offset` are the " +"corresponding UTF-8 byte offsets of the first and last tokens that generated " +"the node. The UTF-8 offset is recorded because the parser uses UTF-8 " +"internally." +msgstr "" +"Екземпляри підкласів :class:`ast.expr` і :class:`ast.stmt` мають атрибути :" +"attr:`lineno`, :attr:`col_offset`, :attr:`end_lineno` і :attr:" +"`end_col_offset` . :attr:`lineno` і :attr:`end_lineno` — це номери першого й " +"останнього рядків вихідного текстового діапазону (з індексом 1, тому перший " +"рядок — рядок 1), а також :attr:`col_offset` і :attr:`end_col_offset` — це " +"відповідні зміщення байтів UTF-8 для першого й останнього маркерів, які " +"створили вузол. Зсув UTF-8 записується, оскільки аналізатор використовує " +"UTF-8 внутрішньо." + +msgid "" +"Note that the end positions are not required by the compiler and are " +"therefore optional. The end offset is *after* the last symbol, for example " +"one can get the source segment of a one-line expression node using " +"``source_line[node.col_offset : node.end_col_offset]``." +msgstr "" +"Зауважте, що кінцеві позиції не потрібні компілятору і тому є " +"необов’язковими. Кінцеве зміщення вказується *після* останнього символу, " +"наприклад, можна отримати вихідний сегмент вузла однорядкового виразу за " +"допомогою ``source_line[node.col_offset : node.end_col_offset]``." + +msgid "" +"The constructor of a class :class:`ast.T` parses its arguments as follows:" +msgstr "" +"Конструктор класу :class:`ast.T` аналізує його аргументи наступним чином:" + +msgid "" +"If there are positional arguments, there must be as many as there are items " +"in :attr:`T._fields`; they will be assigned as attributes of these names." +msgstr "" +"Якщо є позиційні аргументи, їх має бути стільки, скільки елементів у :attr:" +"`T._fields`; вони будуть призначені як атрибути цих імен." + +msgid "" +"If there are keyword arguments, they will set the attributes of the same " +"names to the given values." +msgstr "" +"Якщо є ключові аргументи, вони встановлять атрибути з однаковими іменами на " +"задані значення." + +msgid "" +"For example, to create and populate an :class:`ast.UnaryOp` node, you could " +"use ::" +msgstr "" +"Наприклад, щоб створити та заповнити вузол :class:`ast.UnaryOp`, ви можете " +"використати ::" + +msgid "" +"node = ast.UnaryOp(ast.USub(), ast.Constant(5, lineno=0, col_offset=0),\n" +" lineno=0, col_offset=0)" +msgstr "" + +msgid "" +"If a field that is optional in the grammar is omitted from the constructor, " +"it defaults to ``None``. If a list field is omitted, it defaults to the " +"empty list. If a field of type :class:`!ast.expr_context` is omitted, it " +"defaults to :class:`Load() `. If any other field is omitted, a :" +"exc:`DeprecationWarning` is raised and the AST node will not have this " +"field. In Python 3.15, this condition will raise an error." +msgstr "" + +msgid "Class :class:`ast.Constant` is now used for all constants." +msgstr "Клас :class:`ast.Constant` тепер використовується для всіх констант." + +msgid "" +"Simple indices are represented by their value, extended slices are " +"represented as tuples." +msgstr "" +"Прості індекси представлені їх значеннями, розширені зрізи представлені у " +"вигляді кортежів." + +msgid "" +"Old classes :class:`!ast.Num`, :class:`!ast.Str`, :class:`!ast.Bytes`, :" +"class:`!ast.NameConstant` and :class:`!ast.Ellipsis` are still available, " +"but they will be removed in future Python releases. In the meantime, " +"instantiating them will return an instance of a different class." +msgstr "" + +msgid "" +"Old classes :class:`!ast.Index` and :class:`!ast.ExtSlice` are still " +"available, but they will be removed in future Python releases. In the " +"meantime, instantiating them will return an instance of a different class." +msgstr "" + +msgid "" +"Previous versions of Python allowed the creation of AST nodes that were " +"missing required fields. Similarly, AST node constructors allowed arbitrary " +"keyword arguments that were set as attributes of the AST node, even if they " +"did not match any of the fields of the AST node. This behavior is deprecated " +"and will be removed in Python 3.15." +msgstr "" + +msgid "" +"The descriptions of the specific node classes displayed here were initially " +"adapted from the fantastic `Green Tree Snakes `__ project and all its contributors." +msgstr "" +"Описи конкретних класів вузлів, відображені тут, спочатку були адаптовані з " +"фантастичного проекту `Green Tree Snakes `__ та всіх його учасників." + +msgid "Root nodes" +msgstr "" + +msgid "" +"A Python module, as with :ref:`file input `. Node type generated " +"by :func:`ast.parse` in the default ``\"exec\"`` *mode*." +msgstr "" + +msgid "``body`` is a :class:`list` of the module's :ref:`ast-statements`." +msgstr "" + +msgid "" +"``type_ignores`` is a :class:`list` of the module's type ignore comments; " +"see :func:`ast.parse` for more details." +msgstr "" + +msgid "" +">>> print(ast.dump(ast.parse('x = 1'), indent=4))\n" +"Module(\n" +" body=[\n" +" Assign(\n" +" targets=[\n" +" Name(id='x', ctx=Store())],\n" +" value=Constant(value=1))])" +msgstr "" + +msgid "" +"A single Python :ref:`expression input `. Node type " +"generated by :func:`ast.parse` when *mode* is ``\"eval\"``." +msgstr "" + +msgid "" +"``body`` is a single node, one of the :ref:`expression types `." +msgstr "" + +msgid "" +">>> print(ast.dump(ast.parse('123', mode='eval'), indent=4))\n" +"Expression(\n" +" body=Constant(value=123))" +msgstr "" + +msgid "" +"A single :ref:`interactive input `, like in :ref:`tut-interac`. " +"Node type generated by :func:`ast.parse` when *mode* is ``\"single\"``." +msgstr "" + +msgid "``body`` is a :class:`list` of :ref:`statement nodes `." +msgstr "" + +msgid "" +">>> print(ast.dump(ast.parse('x = 1; y = 2', mode='single'), indent=4))\n" +"Interactive(\n" +" body=[\n" +" Assign(\n" +" targets=[\n" +" Name(id='x', ctx=Store())],\n" +" value=Constant(value=1)),\n" +" Assign(\n" +" targets=[\n" +" Name(id='y', ctx=Store())],\n" +" value=Constant(value=2))])" +msgstr "" + +msgid "" +"A representation of an old-style type comments for functions, as Python " +"versions prior to 3.5 didn't support :pep:`484` annotations. Node type " +"generated by :func:`ast.parse` when *mode* is ``\"func_type\"``." +msgstr "" + +msgid "Such type comments would look like this::" +msgstr "" + +msgid "" +"def sum_two_number(a, b):\n" +" # type: (int, int) -> int\n" +" return a + b" +msgstr "" + +msgid "" +"``argtypes`` is a :class:`list` of :ref:`expression nodes `." +msgstr "" + +msgid "``returns`` is a single :ref:`expression node `." +msgstr "" + +msgid "" +">>> print(ast.dump(ast.parse('(int, str) -> List[int]', mode='func_type'), " +"indent=4))\n" +"FunctionType(\n" +" argtypes=[\n" +" Name(id='int', ctx=Load()),\n" +" Name(id='str', ctx=Load())],\n" +" returns=Subscript(\n" +" value=Name(id='List', ctx=Load()),\n" +" slice=Name(id='int', ctx=Load()),\n" +" ctx=Load()))" +msgstr "" + +msgid "Literals" +msgstr "Літерали" + +msgid "" +"A constant value. The ``value`` attribute of the ``Constant`` literal " +"contains the Python object it represents. The values represented can be " +"simple types such as a number, string or ``None``, but also immutable " +"container types (tuples and frozensets) if all of their elements are " +"constant." +msgstr "" +"Постійне значення. Атрибут ``value`` літералу ``Constant`` містить об’єкт " +"Python, який він представляє. Представлені значення можуть бути простими " +"типами, такими як число, рядок або ``None``, а також незмінними типами " +"контейнерів (кортежі та заморожені набори), якщо всі їхні елементи постійні." + +msgid "" +"Node representing a single formatting field in an f-string. If the string " +"contains a single formatting field and nothing else the node can be isolated " +"otherwise it appears in :class:`JoinedStr`." +msgstr "" +"Вузол, що представляє одне поле форматування в f-рядку. Якщо рядок містить " +"одне поле форматування та нічого іншого, вузол можна ізолювати, інакше він " +"з’являється в :class:`JoinedStr`." + +msgid "" +"``value`` is any expression node (such as a literal, a variable, or a " +"function call)." +msgstr "" +"``значення`` - будь-який вузол виразу (наприклад, літерал, змінна або виклик " +"функції)." + +msgid "``conversion`` is an integer:" +msgstr "``перетворення`` є цілим числом:" + +msgid "-1: no formatting" +msgstr "-1: без форматування" + +msgid "115: ``!s`` string formatting" +msgstr "115: форматування рядка ``!s``" + +msgid "114: ``!r`` repr formatting" +msgstr "114: форматування ``!r`` repr" + +msgid "97: ``!a`` ascii formatting" +msgstr "97: ``!a`` форматування ascii" + +msgid "" +"``format_spec`` is a :class:`JoinedStr` node representing the formatting of " +"the value, or ``None`` if no format was specified. Both ``conversion`` and " +"``format_spec`` can be set at the same time." +msgstr "" +"``format_spec`` — це вузол :class:`JoinedStr`, який представляє форматування " +"значення, або ``None``, якщо формат не вказано. І ``conversion``, і " +"``format_spec`` можна встановити одночасно." + +msgid "" +"An f-string, comprising a series of :class:`FormattedValue` and :class:" +"`Constant` nodes." +msgstr "" +"F-рядок, що містить ряд вузлів :class:`FormattedValue` і :class:`Constant`." + +msgid "" +">>> print(ast.dump(ast.parse('f\"sin({a}) is {sin(a):.3}\"', mode='eval'), " +"indent=4))\n" +"Expression(\n" +" body=JoinedStr(\n" +" values=[\n" +" Constant(value='sin('),\n" +" FormattedValue(\n" +" value=Name(id='a', ctx=Load()),\n" +" conversion=-1),\n" +" Constant(value=') is '),\n" +" FormattedValue(\n" +" value=Call(\n" +" func=Name(id='sin', ctx=Load()),\n" +" args=[\n" +" Name(id='a', ctx=Load())]),\n" +" conversion=-1,\n" +" format_spec=JoinedStr(\n" +" values=[\n" +" Constant(value='.3')]))]))" +msgstr "" + +msgid "" +"A list or tuple. ``elts`` holds a list of nodes representing the elements. " +"``ctx`` is :class:`Store` if the container is an assignment target (i.e. " +"``(x,y)=something``), and :class:`Load` otherwise." +msgstr "" +"Список або кортеж. ``elts`` містить список вузлів, що представляють " +"елементи. ``ctx`` є :class:`Store`, якщо контейнер є метою призначення " +"(тобто ``(x,y)=something``), і :class:`Load` інакше." + +msgid "" +">>> print(ast.dump(ast.parse('[1, 2, 3]', mode='eval'), indent=4))\n" +"Expression(\n" +" body=List(\n" +" elts=[\n" +" Constant(value=1),\n" +" Constant(value=2),\n" +" Constant(value=3)],\n" +" ctx=Load()))\n" +">>> print(ast.dump(ast.parse('(1, 2, 3)', mode='eval'), indent=4))\n" +"Expression(\n" +" body=Tuple(\n" +" elts=[\n" +" Constant(value=1),\n" +" Constant(value=2),\n" +" Constant(value=3)],\n" +" ctx=Load()))" +msgstr "" + +msgid "A set. ``elts`` holds a list of nodes representing the set's elements." +msgstr "" +"Набір. ``elts`` містить список вузлів, що представляють елементи набору." + +msgid "" +">>> print(ast.dump(ast.parse('{1, 2, 3}', mode='eval'), indent=4))\n" +"Expression(\n" +" body=Set(\n" +" elts=[\n" +" Constant(value=1),\n" +" Constant(value=2),\n" +" Constant(value=3)]))" +msgstr "" + +msgid "" +"A dictionary. ``keys`` and ``values`` hold lists of nodes representing the " +"keys and the values respectively, in matching order (what would be returned " +"when calling :code:`dictionary.keys()` and :code:`dictionary.values()`)." +msgstr "" +"Словник. ``keys`` і ``values`` містять списки вузлів, що представляють ключі " +"та значення відповідно, у відповідному порядку (те, що буде повернуто під " +"час виклику :code:`dictionary.keys()` і :code:`dictionary. значення()`)." + +msgid "" +"When doing dictionary unpacking using dictionary literals the expression to " +"be expanded goes in the ``values`` list, with a ``None`` at the " +"corresponding position in ``keys``." +msgstr "" +"Під час розпакування словника за допомогою словникових літералів вираз, який " +"потрібно розгорнути, потрапляє до списку ``значень`` із ``None`` у " +"відповідній позиції ``ключів``." + +msgid "" +">>> print(ast.dump(ast.parse('{\"a\":1, **d}', mode='eval'), indent=4))\n" +"Expression(\n" +" body=Dict(\n" +" keys=[\n" +" Constant(value='a'),\n" +" None],\n" +" values=[\n" +" Constant(value=1),\n" +" Name(id='d', ctx=Load())]))" +msgstr "" + +msgid "Variables" +msgstr "Змінні" + +msgid "" +"A variable name. ``id`` holds the name as a string, and ``ctx`` is one of " +"the following types." +msgstr "" +"Ім'я змінної. ``id`` містить назву як рядок, а ``ctx`` є одним із наступних " +"типів." + +msgid "" +"Variable references can be used to load the value of a variable, to assign a " +"new value to it, or to delete it. Variable references are given a context to " +"distinguish these cases." +msgstr "" +"Посилання на змінні можна використовувати, щоб завантажити значення змінної, " +"призначити їй нове значення або видалити її. Посиланням на змінні надається " +"контекст, щоб розрізняти ці випадки." + +msgid "" +">>> print(ast.dump(ast.parse('a'), indent=4))\n" +"Module(\n" +" body=[\n" +" Expr(\n" +" value=Name(id='a', ctx=Load()))])\n" +"\n" +">>> print(ast.dump(ast.parse('a = 1'), indent=4))\n" +"Module(\n" +" body=[\n" +" Assign(\n" +" targets=[\n" +" Name(id='a', ctx=Store())],\n" +" value=Constant(value=1))])\n" +"\n" +">>> print(ast.dump(ast.parse('del a'), indent=4))\n" +"Module(\n" +" body=[\n" +" Delete(\n" +" targets=[\n" +" Name(id='a', ctx=Del())])])" +msgstr "" + +msgid "" +"A ``*var`` variable reference. ``value`` holds the variable, typically a :" +"class:`Name` node. This type must be used when building a :class:`Call` node " +"with ``*args``." +msgstr "" +"Посилання на змінну ``*var``. ``value`` містить змінну, як правило, вузол :" +"class:`Name`. Цей тип необхідно використовувати під час створення вузла :" +"class:`Call` з ``*args``." + +msgid "" +">>> print(ast.dump(ast.parse('a, *b = it'), indent=4))\n" +"Module(\n" +" body=[\n" +" Assign(\n" +" targets=[\n" +" Tuple(\n" +" elts=[\n" +" Name(id='a', ctx=Store()),\n" +" Starred(\n" +" value=Name(id='b', ctx=Store()),\n" +" ctx=Store())],\n" +" ctx=Store())],\n" +" value=Name(id='it', ctx=Load()))])" +msgstr "" + +msgid "Expressions" +msgstr "Вирази" + +msgid "" +"When an expression, such as a function call, appears as a statement by " +"itself with its return value not used or stored, it is wrapped in this " +"container. ``value`` holds one of the other nodes in this section, a :class:" +"`Constant`, a :class:`Name`, a :class:`Lambda`, a :class:`Yield` or :class:" +"`YieldFrom` node." +msgstr "" +"Коли вираз, як-от виклик функції, з’являється як окремий оператор із " +"невикористаним або збереженим значенням, що повертається, його загортають у " +"цей контейнер. ``value`` містить один із інших вузлів у цьому розділі, :" +"class:`Constant`, :class:`Name`, :class:`Lambda`, :class:`Yield` або :class:" +"`YieldFrom`." + +msgid "" +">>> print(ast.dump(ast.parse('-a'), indent=4))\n" +"Module(\n" +" body=[\n" +" Expr(\n" +" value=UnaryOp(\n" +" op=USub(),\n" +" operand=Name(id='a', ctx=Load())))])" +msgstr "" + +msgid "" +"A unary operation. ``op`` is the operator, and ``operand`` any expression " +"node." +msgstr "" +"Унарна операція. ``op`` є оператором, а ``operand`` будь-яким вузлом виразу." + +msgid "" +"Unary operator tokens. :class:`Not` is the ``not`` keyword, :class:`Invert` " +"is the ``~`` operator." +msgstr "" +"Унарні маркери оператора. :class:`Not` - це ключове слово ``not``, :class:" +"`Invert` - це оператор ``~``." + +msgid "" +">>> print(ast.dump(ast.parse('not x', mode='eval'), indent=4))\n" +"Expression(\n" +" body=UnaryOp(\n" +" op=Not(),\n" +" operand=Name(id='x', ctx=Load())))" +msgstr "" + +msgid "" +"A binary operation (like addition or division). ``op`` is the operator, and " +"``left`` and ``right`` are any expression nodes." +msgstr "" +"Двійкова операція (наприклад, додавання або ділення). ``op`` є оператором, " +"``left`` і ``right`` є будь-якими вузлами виразу." + +msgid "" +">>> print(ast.dump(ast.parse('x + y', mode='eval'), indent=4))\n" +"Expression(\n" +" body=BinOp(\n" +" left=Name(id='x', ctx=Load()),\n" +" op=Add(),\n" +" right=Name(id='y', ctx=Load())))" +msgstr "" + +msgid "Binary operator tokens." +msgstr "Бінарні операторські токени." + +msgid "" +"A boolean operation, 'or' or 'and'. ``op`` is :class:`Or` or :class:`And`. " +"``values`` are the values involved. Consecutive operations with the same " +"operator, such as ``a or b or c``, are collapsed into one node with several " +"values." +msgstr "" +"Логічна операція \"або\" або \"і\". ``op`` - це :class:`Or` або :class:" +"`And`. ``values`` - це значення, які беруть участь. Послідовні операції з " +"тим самим оператором, наприклад ``a або b або c``, згортаються в один вузол " +"з кількома значеннями." + +msgid "This doesn't include ``not``, which is a :class:`UnaryOp`." +msgstr "Це не включає ``not``, який є :class:`UnaryOp`." + +msgid "" +">>> print(ast.dump(ast.parse('x or y', mode='eval'), indent=4))\n" +"Expression(\n" +" body=BoolOp(\n" +" op=Or(),\n" +" values=[\n" +" Name(id='x', ctx=Load()),\n" +" Name(id='y', ctx=Load())]))" +msgstr "" + +msgid "Boolean operator tokens." +msgstr "Логічні операторні маркери." + +msgid "" +"A comparison of two or more values. ``left`` is the first value in the " +"comparison, ``ops`` the list of operators, and ``comparators`` the list of " +"values after the first element in the comparison." +msgstr "" +"Порівняння двох чи більше значень. ``left`` - це перше значення в " +"порівнянні, ``ops`` - список операторів, ``comparators`` - список значень " +"після першого елемента в порівнянні." + +msgid "" +">>> print(ast.dump(ast.parse('1 <= a < 10', mode='eval'), indent=4))\n" +"Expression(\n" +" body=Compare(\n" +" left=Constant(value=1),\n" +" ops=[\n" +" LtE(),\n" +" Lt()],\n" +" comparators=[\n" +" Name(id='a', ctx=Load()),\n" +" Constant(value=10)]))" +msgstr "" + +msgid "Comparison operator tokens." +msgstr "Лексими операторів порівняння." + +msgid "" +"A function call. ``func`` is the function, which will often be a :class:" +"`Name` or :class:`Attribute` object. Of the arguments:" +msgstr "" +"Виклик функції. ``func`` – це функція, яка часто буде об’єктом :class:`Name` " +"або :class:`Attribute`. З аргументів:" + +msgid "``args`` holds a list of the arguments passed by position." +msgstr "``args`` містить список аргументів, переданих за позицією." + +msgid "" +"``keywords`` holds a list of :class:`.keyword` objects representing " +"arguments passed by keyword." +msgstr "" + +msgid "" +"The ``args`` and ``keywords`` arguments are optional and default to empty " +"lists." +msgstr "" + +msgid "" +">>> print(ast.dump(ast.parse('func(a, b=c, *d, **e)', mode='eval'), " +"indent=4))\n" +"Expression(\n" +" body=Call(\n" +" func=Name(id='func', ctx=Load()),\n" +" args=[\n" +" Name(id='a', ctx=Load()),\n" +" Starred(\n" +" value=Name(id='d', ctx=Load()),\n" +" ctx=Load())],\n" +" keywords=[\n" +" keyword(\n" +" arg='b',\n" +" value=Name(id='c', ctx=Load())),\n" +" keyword(\n" +" value=Name(id='e', ctx=Load()))]))" +msgstr "" + +msgid "" +"A keyword argument to a function call or class definition. ``arg`` is a raw " +"string of the parameter name, ``value`` is a node to pass in." +msgstr "" +"Аргумент ключового слова для виклику функції або визначення класу. ``arg`` — " +"це необроблений рядок назви параметра, ``value`` — це вузол для передачі." + +msgid "" +"An expression such as ``a if b else c``. Each field holds a single node, so " +"in the following example, all three are :class:`Name` nodes." +msgstr "" +"Вираз на зразок \"a if b else c\". Кожне поле містить один вузол, тому в " +"наступному прикладі всі три є вузлами :class:`Name`." + +msgid "" +">>> print(ast.dump(ast.parse('a if b else c', mode='eval'), indent=4))\n" +"Expression(\n" +" body=IfExp(\n" +" test=Name(id='b', ctx=Load()),\n" +" body=Name(id='a', ctx=Load()),\n" +" orelse=Name(id='c', ctx=Load())))" +msgstr "" + +msgid "" +"Attribute access, e.g. ``d.keys``. ``value`` is a node, typically a :class:" +"`Name`. ``attr`` is a bare string giving the name of the attribute, and " +"``ctx`` is :class:`Load`, :class:`Store` or :class:`Del` according to how " +"the attribute is acted on." +msgstr "" +"Доступ до атрибутів, напр. ``d.keys``. ``value`` - це вузол, як правило, :" +"class:`Name`. ``attr`` — це чистий рядок, що дає назву атрибуту, а ``ctx`` — " +"це :class:`Load`, :class:`Store` або :class:`Del` відповідно до того, як діє " +"атрибут на." + +msgid "" +">>> print(ast.dump(ast.parse('snake.colour', mode='eval'), indent=4))\n" +"Expression(\n" +" body=Attribute(\n" +" value=Name(id='snake', ctx=Load()),\n" +" attr='colour',\n" +" ctx=Load()))" +msgstr "" + +msgid "" +"A named expression. This AST node is produced by the assignment expressions " +"operator (also known as the walrus operator). As opposed to the :class:" +"`Assign` node in which the first argument can be multiple nodes, in this " +"case both ``target`` and ``value`` must be single nodes." +msgstr "" +"Іменований вираз. Цей вузол AST створюється оператором виразів присвоєння " +"(також відомим як оператор моржа). На відміну від вузла :class:`Assign`, у " +"якому першим аргументом може бути кілька вузлів, у цьому випадку як " +"``target``, так і ``value`` мають бути окремими вузлами." + +msgid "" +">>> print(ast.dump(ast.parse('(x := 4)', mode='eval'), indent=4))\n" +"Expression(\n" +" body=NamedExpr(\n" +" target=Name(id='x', ctx=Store()),\n" +" value=Constant(value=4)))" +msgstr "" + +msgid "Subscripting" +msgstr "Підписка" + +msgid "" +"A subscript, such as ``l[1]``. ``value`` is the subscripted object (usually " +"sequence or mapping). ``slice`` is an index, slice or key. It can be a :" +"class:`Tuple` and contain a :class:`Slice`. ``ctx`` is :class:`Load`, :class:" +"`Store` or :class:`Del` according to the action performed with the subscript." +msgstr "" +"Нижній індекс, наприклад \"l[1]\". ``значення`` - це об'єкт з індексом " +"(зазвичай послідовність або відображення). ``slice`` - це індекс, зріз або " +"ключ. Це може бути :class:`Tuple` і містити :class:`Slice`. ``ctx`` - це :" +"class:`Load`, :class:`Store` або :class:`Del` відповідно до дії, виконаної з " +"нижнім індексом." + +msgid "" +">>> print(ast.dump(ast.parse('l[1:2, 3]', mode='eval'), indent=4))\n" +"Expression(\n" +" body=Subscript(\n" +" value=Name(id='l', ctx=Load()),\n" +" slice=Tuple(\n" +" elts=[\n" +" Slice(\n" +" lower=Constant(value=1),\n" +" upper=Constant(value=2)),\n" +" Constant(value=3)],\n" +" ctx=Load()),\n" +" ctx=Load()))" +msgstr "" + +msgid "" +"Regular slicing (on the form ``lower:upper`` or ``lower:upper:step``). Can " +"occur only inside the *slice* field of :class:`Subscript`, either directly " +"or as an element of :class:`Tuple`." +msgstr "" +"Звичайна нарізка (за формою ``lower:upper`` або ``lower:upper:step``). Може " +"зустрічатися лише всередині поля *slice* :class:`Subscript`, або " +"безпосередньо, або як елемент :class:`Tuple`." + +msgid "" +">>> print(ast.dump(ast.parse('l[1:2]', mode='eval'), indent=4))\n" +"Expression(\n" +" body=Subscript(\n" +" value=Name(id='l', ctx=Load()),\n" +" slice=Slice(\n" +" lower=Constant(value=1),\n" +" upper=Constant(value=2)),\n" +" ctx=Load()))" +msgstr "" + +msgid "Comprehensions" +msgstr "Осягнення" + +msgid "" +"List and set comprehensions, generator expressions, and dictionary " +"comprehensions. ``elt`` (or ``key`` and ``value``) is a single node " +"representing the part that will be evaluated for each item." +msgstr "" +"Список і набір розуміння, генератор виразів і словник розуміння. ``elt`` " +"(або ``key`` і ``value``) — це один вузол, що представляє частину, яка буде " +"оцінюватися для кожного елемента." + +msgid "``generators`` is a list of :class:`comprehension` nodes." +msgstr "``generators`` - це список вузлів :class:`comprehension`." + +msgid "" +">>> print(ast.dump(\n" +"... ast.parse('[x for x in numbers]', mode='eval'),\n" +"... indent=4,\n" +"... ))\n" +"Expression(\n" +" body=ListComp(\n" +" elt=Name(id='x', ctx=Load()),\n" +" generators=[\n" +" comprehension(\n" +" target=Name(id='x', ctx=Store()),\n" +" iter=Name(id='numbers', ctx=Load()),\n" +" is_async=0)]))\n" +">>> print(ast.dump(\n" +"... ast.parse('{x: x**2 for x in numbers}', mode='eval'),\n" +"... indent=4,\n" +"... ))\n" +"Expression(\n" +" body=DictComp(\n" +" key=Name(id='x', ctx=Load()),\n" +" value=BinOp(\n" +" left=Name(id='x', ctx=Load()),\n" +" op=Pow(),\n" +" right=Constant(value=2)),\n" +" generators=[\n" +" comprehension(\n" +" target=Name(id='x', ctx=Store()),\n" +" iter=Name(id='numbers', ctx=Load()),\n" +" is_async=0)]))\n" +">>> print(ast.dump(\n" +"... ast.parse('{x for x in numbers}', mode='eval'),\n" +"... indent=4,\n" +"... ))\n" +"Expression(\n" +" body=SetComp(\n" +" elt=Name(id='x', ctx=Load()),\n" +" generators=[\n" +" comprehension(\n" +" target=Name(id='x', ctx=Store()),\n" +" iter=Name(id='numbers', ctx=Load()),\n" +" is_async=0)]))" +msgstr "" + +msgid "" +"One ``for`` clause in a comprehension. ``target`` is the reference to use " +"for each element - typically a :class:`Name` or :class:`Tuple` node. " +"``iter`` is the object to iterate over. ``ifs`` is a list of test " +"expressions: each ``for`` clause can have multiple ``ifs``." +msgstr "" +"Одне речення ``за`` для розуміння. ``target`` - це посилання для " +"використання для кожного елемента - зазвичай :class:`Name` або :class:" +"`Tuple` вузол. ``iter`` - це об'єкт для повторення. ``ifs`` — це список " +"перевірочних виразів: кожен пункт ``for`` може мати кілька ``ifs``." + +msgid "" +"``is_async`` indicates a comprehension is asynchronous (using an ``async " +"for`` instead of ``for``). The value is an integer (0 or 1)." +msgstr "" +"``is_async`` вказує, що розуміння є асинхронним (використовуючи ``async " +"for`` замість ``for``). Значення є цілим числом (0 або 1)." + +msgid "" +">>> print(ast.dump(ast.parse('[ord(c) for line in file for c in line]', " +"mode='eval'),\n" +"... indent=4)) # Multiple comprehensions in one.\n" +"Expression(\n" +" body=ListComp(\n" +" elt=Call(\n" +" func=Name(id='ord', ctx=Load()),\n" +" args=[\n" +" Name(id='c', ctx=Load())]),\n" +" generators=[\n" +" comprehension(\n" +" target=Name(id='line', ctx=Store()),\n" +" iter=Name(id='file', ctx=Load()),\n" +" is_async=0),\n" +" comprehension(\n" +" target=Name(id='c', ctx=Store()),\n" +" iter=Name(id='line', ctx=Load()),\n" +" is_async=0)]))\n" +"\n" +">>> print(ast.dump(ast.parse('(n**2 for n in it if n>5 if n<10)', " +"mode='eval'),\n" +"... indent=4)) # generator comprehension\n" +"Expression(\n" +" body=GeneratorExp(\n" +" elt=BinOp(\n" +" left=Name(id='n', ctx=Load()),\n" +" op=Pow(),\n" +" right=Constant(value=2)),\n" +" generators=[\n" +" comprehension(\n" +" target=Name(id='n', ctx=Store()),\n" +" iter=Name(id='it', ctx=Load()),\n" +" ifs=[\n" +" Compare(\n" +" left=Name(id='n', ctx=Load()),\n" +" ops=[\n" +" Gt()],\n" +" comparators=[\n" +" Constant(value=5)]),\n" +" Compare(\n" +" left=Name(id='n', ctx=Load()),\n" +" ops=[\n" +" Lt()],\n" +" comparators=[\n" +" Constant(value=10)])],\n" +" is_async=0)]))\n" +"\n" +">>> print(ast.dump(ast.parse('[i async for i in soc]', mode='eval'),\n" +"... indent=4)) # Async comprehension\n" +"Expression(\n" +" body=ListComp(\n" +" elt=Name(id='i', ctx=Load()),\n" +" generators=[\n" +" comprehension(\n" +" target=Name(id='i', ctx=Store()),\n" +" iter=Name(id='soc', ctx=Load()),\n" +" is_async=1)]))" +msgstr "" + +msgid "Statements" +msgstr "Заяви" + +msgid "" +"An assignment. ``targets`` is a list of nodes, and ``value`` is a single " +"node." +msgstr "Доручення. ``targets`` — це список вузлів, а ``value`` — один вузол." + +msgid "" +"Multiple nodes in ``targets`` represents assigning the same value to each. " +"Unpacking is represented by putting a :class:`Tuple` or :class:`List` within " +"``targets``." +msgstr "" +"Кілька вузлів у ``цілях`` представляють призначення однакового значення " +"кожному. Розпакування представлено розміщенням :class:`Tuple` або :class:" +"`List` у ``targets``." + +msgid "" +"``type_comment`` is an optional string with the type annotation as a comment." +msgstr "" +"``type_comment`` – необов’язковий рядок із анотацією типу як коментаря." + +msgid "" +">>> print(ast.dump(ast.parse('a = b = 1'), indent=4)) # Multiple assignment\n" +"Module(\n" +" body=[\n" +" Assign(\n" +" targets=[\n" +" Name(id='a', ctx=Store()),\n" +" Name(id='b', ctx=Store())],\n" +" value=Constant(value=1))])\n" +"\n" +">>> print(ast.dump(ast.parse('a,b = c'), indent=4)) # Unpacking\n" +"Module(\n" +" body=[\n" +" Assign(\n" +" targets=[\n" +" Tuple(\n" +" elts=[\n" +" Name(id='a', ctx=Store()),\n" +" Name(id='b', ctx=Store())],\n" +" ctx=Store())],\n" +" value=Name(id='c', ctx=Load()))])" +msgstr "" + +msgid "" +"An assignment with a type annotation. ``target`` is a single node and can be " +"a :class:`Name`, an :class:`Attribute` or a :class:`Subscript`. " +"``annotation`` is the annotation, such as a :class:`Constant` or :class:" +"`Name` node. ``value`` is a single optional node." +msgstr "" + +msgid "" +"``simple`` is always either 0 (indicating a \"complex\" target) or 1 " +"(indicating a \"simple\" target). A \"simple\" target consists solely of a :" +"class:`Name` node that does not appear between parentheses; all other " +"targets are considered complex. Only simple targets appear in the :attr:" +"`~object.__annotations__` dictionary of modules and classes." +msgstr "" + +msgid "" +">>> print(ast.dump(ast.parse('c: int'), indent=4))\n" +"Module(\n" +" body=[\n" +" AnnAssign(\n" +" target=Name(id='c', ctx=Store()),\n" +" annotation=Name(id='int', ctx=Load()),\n" +" simple=1)])\n" +"\n" +">>> print(ast.dump(ast.parse('(a): int = 1'), indent=4)) # Annotation with " +"parenthesis\n" +"Module(\n" +" body=[\n" +" AnnAssign(\n" +" target=Name(id='a', ctx=Store()),\n" +" annotation=Name(id='int', ctx=Load()),\n" +" value=Constant(value=1),\n" +" simple=0)])\n" +"\n" +">>> print(ast.dump(ast.parse('a.b: int'), indent=4)) # Attribute annotation\n" +"Module(\n" +" body=[\n" +" AnnAssign(\n" +" target=Attribute(\n" +" value=Name(id='a', ctx=Load()),\n" +" attr='b',\n" +" ctx=Store()),\n" +" annotation=Name(id='int', ctx=Load()),\n" +" simple=0)])\n" +"\n" +">>> print(ast.dump(ast.parse('a[1]: int'), indent=4)) # Subscript " +"annotation\n" +"Module(\n" +" body=[\n" +" AnnAssign(\n" +" target=Subscript(\n" +" value=Name(id='a', ctx=Load()),\n" +" slice=Constant(value=1),\n" +" ctx=Store()),\n" +" annotation=Name(id='int', ctx=Load()),\n" +" simple=0)])" +msgstr "" + +msgid "" +"Augmented assignment, such as ``a += 1``. In the following example, " +"``target`` is a :class:`Name` node for ``x`` (with the :class:`Store` " +"context), ``op`` is :class:`Add`, and ``value`` is a :class:`Constant` with " +"value for 1." +msgstr "" +"Доповнене присвоювання, наприклад ``a += 1``. У наступному прикладі " +"``target`` є вузлом :class:`Name` для ``x`` (з контекстом :class:`Store`), " +"``op`` це :class:`Add`, а ``значення`` є :class:`Constant` зі значенням 1." + +msgid "" +"The ``target`` attribute cannot be of class :class:`Tuple` or :class:`List`, " +"unlike the targets of :class:`Assign`." +msgstr "" +"Атрибут ``target`` не може належати до класу :class:`Tuple` або :class:" +"`List`, на відміну від цілей :class:`Assign`." + +msgid "" +">>> print(ast.dump(ast.parse('x += 2'), indent=4))\n" +"Module(\n" +" body=[\n" +" AugAssign(\n" +" target=Name(id='x', ctx=Store()),\n" +" op=Add(),\n" +" value=Constant(value=2))])" +msgstr "" + +msgid "" +"A ``raise`` statement. ``exc`` is the exception object to be raised, " +"normally a :class:`Call` or :class:`Name`, or ``None`` for a standalone " +"``raise``. ``cause`` is the optional part for ``y`` in ``raise x from y``." +msgstr "" +"Оператор ``raise``. ``exc`` — це об’єкт винятку, який потрібно викликати, " +"зазвичай це :class:`Call` або :class:`Name`, або ``None`` для окремого " +"``raise``. ``cause`` є необов’язковою частиною для ``y`` у ``raise x from " +"y``." + +msgid "" +">>> print(ast.dump(ast.parse('raise x from y'), indent=4))\n" +"Module(\n" +" body=[\n" +" Raise(\n" +" exc=Name(id='x', ctx=Load()),\n" +" cause=Name(id='y', ctx=Load()))])" +msgstr "" + +msgid "" +"An assertion. ``test`` holds the condition, such as a :class:`Compare` node. " +"``msg`` holds the failure message." +msgstr "" +"Твердження. ``test`` містить умову, як-от вузол :class:`Compare`. ``msg`` " +"містить повідомлення про помилку." + +msgid "" +">>> print(ast.dump(ast.parse('assert x,y'), indent=4))\n" +"Module(\n" +" body=[\n" +" Assert(\n" +" test=Name(id='x', ctx=Load()),\n" +" msg=Name(id='y', ctx=Load()))])" +msgstr "" + +msgid "" +"Represents a ``del`` statement. ``targets`` is a list of nodes, such as :" +"class:`Name`, :class:`Attribute` or :class:`Subscript` nodes." +msgstr "" +"Представляє оператор ``del``. ``targets`` – це список вузлів, наприклад " +"вузли :class:`Name`, :class:`Attribute` або :class:`Subscript`." + +msgid "" +">>> print(ast.dump(ast.parse('del x,y,z'), indent=4))\n" +"Module(\n" +" body=[\n" +" Delete(\n" +" targets=[\n" +" Name(id='x', ctx=Del()),\n" +" Name(id='y', ctx=Del()),\n" +" Name(id='z', ctx=Del())])])" +msgstr "" + +msgid "A ``pass`` statement." +msgstr "Заява ``pass``." + +msgid "" +">>> print(ast.dump(ast.parse('pass'), indent=4))\n" +"Module(\n" +" body=[\n" +" Pass()])" +msgstr "" + +msgid "" +"A :ref:`type alias ` created through the :keyword:`type` " +"statement. ``name`` is the name of the alias, ``type_params`` is a list of :" +"ref:`type parameters `, and ``value`` is the value of the " +"type alias." +msgstr "" + +msgid "" +">>> print(ast.dump(ast.parse('type Alias = int'), indent=4))\n" +"Module(\n" +" body=[\n" +" TypeAlias(\n" +" name=Name(id='Alias', ctx=Store()),\n" +" value=Name(id='int', ctx=Load()))])" +msgstr "" + +msgid "" +"Other statements which are only applicable inside functions or loops are " +"described in other sections." +msgstr "" +"Інші оператори, які застосовуються лише всередині функцій або циклів, " +"описані в інших розділах." + +msgid "Imports" +msgstr "Імпорт" + +msgid "An import statement. ``names`` is a list of :class:`alias` nodes." +msgstr "Заява про імпорт. ``names`` - це список вузлів :class:`alias`." + +msgid "" +">>> print(ast.dump(ast.parse('import x,y,z'), indent=4))\n" +"Module(\n" +" body=[\n" +" Import(\n" +" names=[\n" +" alias(name='x'),\n" +" alias(name='y'),\n" +" alias(name='z')])])" +msgstr "" + +msgid "" +"Represents ``from x import y``. ``module`` is a raw string of the 'from' " +"name, without any leading dots, or ``None`` for statements such as ``from . " +"import foo``. ``level`` is an integer holding the level of the relative " +"import (0 means absolute import)." +msgstr "" +"Представляє ``from x import y``. ``module`` — це необроблений рядок назви " +"'from' без будь-яких крапок на початку або ``None`` для операторів, таких як " +"``from . імпортувати foo``. ``level`` — це ціле число, що містить рівень " +"відносного імпорту (0 означає абсолютний імпорт)." + +msgid "" +">>> print(ast.dump(ast.parse('from y import x,y,z'), indent=4))\n" +"Module(\n" +" body=[\n" +" ImportFrom(\n" +" module='y',\n" +" names=[\n" +" alias(name='x'),\n" +" alias(name='y'),\n" +" alias(name='z')],\n" +" level=0)])" +msgstr "" + +msgid "" +"Both parameters are raw strings of the names. ``asname`` can be ``None`` if " +"the regular name is to be used." +msgstr "" +"Обидва параметри є необробленими рядками імен. ``asname`` може бути " +"``None``, якщо має використовуватися звичайна назва." + +msgid "" +">>> print(ast.dump(ast.parse('from ..foo.bar import a as b, c'), indent=4))\n" +"Module(\n" +" body=[\n" +" ImportFrom(\n" +" module='foo.bar',\n" +" names=[\n" +" alias(name='a', asname='b'),\n" +" alias(name='c')],\n" +" level=2)])" +msgstr "" + +msgid "Control flow" +msgstr "Контроль потоку" + +msgid "" +"Optional clauses such as ``else`` are stored as an empty list if they're not " +"present." +msgstr "" +"Необов’язкові пропозиції, такі як ``else``, зберігаються як порожній список, " +"якщо їх немає." + +msgid "" +"An ``if`` statement. ``test`` holds a single node, such as a :class:" +"`Compare` node. ``body`` and ``orelse`` each hold a list of nodes." +msgstr "" +"Оператор ``if``. ``test`` містить один вузол, наприклад вузол :class:" +"`Compare`. ``body`` і ``orelse`` містять список вузлів." + +msgid "" +"``elif`` clauses don't have a special representation in the AST, but rather " +"appear as extra :class:`If` nodes within the ``orelse`` section of the " +"previous one." +msgstr "" +"Речення ``elif`` не мають спеціального представлення в AST, а радше " +"з’являються як додаткові вузли :class:`If` у розділі ``orelse`` попереднього." + +msgid "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... if x:\n" +"... ...\n" +"... elif y:\n" +"... ...\n" +"... else:\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" If(\n" +" test=Name(id='x', ctx=Load()),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))],\n" +" orelse=[\n" +" If(\n" +" test=Name(id='y', ctx=Load()),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))],\n" +" orelse=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])])" +msgstr "" + +msgid "" +"A ``for`` loop. ``target`` holds the variable(s) the loop assigns to, as a " +"single :class:`Name`, :class:`Tuple`, :class:`List`, :class:`Attribute` or :" +"class:`Subscript` node. ``iter`` holds the item to be looped over, again as " +"a single node. ``body`` and ``orelse`` contain lists of nodes to execute. " +"Those in ``orelse`` are executed if the loop finishes normally, rather than " +"via a ``break`` statement." +msgstr "" + +msgid "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... for x in y:\n" +"... ...\n" +"... else:\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" For(\n" +" target=Name(id='x', ctx=Store()),\n" +" iter=Name(id='y', ctx=Load()),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))],\n" +" orelse=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])" +msgstr "" + +msgid "" +"A ``while`` loop. ``test`` holds the condition, such as a :class:`Compare` " +"node." +msgstr "Цикл ``while``. ``test`` містить умову, як-от вузол :class:`Compare`." + +msgid "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... while x:\n" +"... ...\n" +"... else:\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" While(\n" +" test=Name(id='x', ctx=Load()),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))],\n" +" orelse=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])" +msgstr "" + +msgid "The ``break`` and ``continue`` statements." +msgstr "Оператори ``break`` і ``continue``." + +msgid "" +">>> print(ast.dump(ast.parse(\"\"\"\\\n" +"... for a in b:\n" +"... if a > 5:\n" +"... break\n" +"... else:\n" +"... continue\n" +"...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" For(\n" +" target=Name(id='a', ctx=Store()),\n" +" iter=Name(id='b', ctx=Load()),\n" +" body=[\n" +" If(\n" +" test=Compare(\n" +" left=Name(id='a', ctx=Load()),\n" +" ops=[\n" +" Gt()],\n" +" comparators=[\n" +" Constant(value=5)]),\n" +" body=[\n" +" Break()],\n" +" orelse=[\n" +" Continue()])])])" +msgstr "" + +msgid "" +"``try`` blocks. All attributes are list of nodes to execute, except for " +"``handlers``, which is a list of :class:`ExceptHandler` nodes." +msgstr "" +"блоки ``try``. Усі атрибути є списком вузлів для виконання, за винятком " +"``обробників``, який є списком :class:`ExceptHandler` вузлів." + +msgid "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... try:\n" +"... ...\n" +"... except Exception:\n" +"... ...\n" +"... except OtherException as e:\n" +"... ...\n" +"... else:\n" +"... ...\n" +"... finally:\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" Try(\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))],\n" +" handlers=[\n" +" ExceptHandler(\n" +" type=Name(id='Exception', ctx=Load()),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))]),\n" +" ExceptHandler(\n" +" type=Name(id='OtherException', ctx=Load()),\n" +" name='e',\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])],\n" +" orelse=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))],\n" +" finalbody=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])" +msgstr "" + +msgid "" +"``try`` blocks which are followed by ``except*`` clauses. The attributes are " +"the same as for :class:`Try` but the :class:`ExceptHandler` nodes in " +"``handlers`` are interpreted as ``except*`` blocks rather then ``except``." +msgstr "" + +msgid "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... try:\n" +"... ...\n" +"... except* Exception:\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" TryStar(\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))],\n" +" handlers=[\n" +" ExceptHandler(\n" +" type=Name(id='Exception', ctx=Load()),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])])" +msgstr "" + +msgid "" +"A single ``except`` clause. ``type`` is the exception type it will match, " +"typically a :class:`Name` node (or ``None`` for a catch-all ``except:`` " +"clause). ``name`` is a raw string for the name to hold the exception, or " +"``None`` if the clause doesn't have ``as foo``. ``body`` is a list of nodes." +msgstr "" +"Єдине речення ``крім``. ``type`` — це тип винятку, якому він відповідатиме, " +"як правило, вузол :class:`Name` (або ``None`` для речення catch-all ``except:" +"``). ``name`` — це необроблений рядок для імені, який містить виняток, або " +"``None``, якщо в пропозиції немає ``as foo``. ``body`` - це список вузлів." + +msgid "" +">>> print(ast.dump(ast.parse(\"\"\"\\\n" +"... try:\n" +"... a + 1\n" +"... except TypeError:\n" +"... pass\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" Try(\n" +" body=[\n" +" Expr(\n" +" value=BinOp(\n" +" left=Name(id='a', ctx=Load()),\n" +" op=Add(),\n" +" right=Constant(value=1)))],\n" +" handlers=[\n" +" ExceptHandler(\n" +" type=Name(id='TypeError', ctx=Load()),\n" +" body=[\n" +" Pass()])])])" +msgstr "" + +msgid "" +"A ``with`` block. ``items`` is a list of :class:`withitem` nodes " +"representing the context managers, and ``body`` is the indented block inside " +"the context." +msgstr "" +"Блок ``with``. ``items`` — це список вузлів :class:`withitem`, що " +"представляють контекстні менеджери, а ``body`` — блок із відступом усередині " +"контексту." + +msgid "" +"A single context manager in a ``with`` block. ``context_expr`` is the " +"context manager, often a :class:`Call` node. ``optional_vars`` is a :class:" +"`Name`, :class:`Tuple` or :class:`List` for the ``as foo`` part, or ``None`` " +"if that isn't used." +msgstr "" +"Єдиний контекстний менеджер у блоці ``with``. ``context_expr`` - це менеджер " +"контексту, часто вузол :class:`Call`. ``optional_vars`` — це :class:`Name`, :" +"class:`Tuple` або :class:`List` для частини ``as foo``, або ``None``, якщо " +"вона не використовується." + +msgid "" +">>> print(ast.dump(ast.parse(\"\"\"\\\n" +"... with a as b, c as d:\n" +"... something(b, d)\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" With(\n" +" items=[\n" +" withitem(\n" +" context_expr=Name(id='a', ctx=Load()),\n" +" optional_vars=Name(id='b', ctx=Store())),\n" +" withitem(\n" +" context_expr=Name(id='c', ctx=Load()),\n" +" optional_vars=Name(id='d', ctx=Store()))],\n" +" body=[\n" +" Expr(\n" +" value=Call(\n" +" func=Name(id='something', ctx=Load()),\n" +" args=[\n" +" Name(id='b', ctx=Load()),\n" +" Name(id='d', ctx=Load())]))])])" +msgstr "" + +msgid "Pattern matching" +msgstr "Зіставлення шаблону" + +msgid "" +"A ``match`` statement. ``subject`` holds the subject of the match (the " +"object that is being matched against the cases) and ``cases`` contains an " +"iterable of :class:`match_case` nodes with the different cases." +msgstr "" +"Оператор ``збігу``. ``subject`` містить предмет відповідності (об’єкт, який " +"зіставляється з регістрами), а ``cases`` містить ітерацію вузлів :class:" +"`match_case` з різними регістрами." + +msgid "" +"A single case pattern in a ``match`` statement. ``pattern`` contains the " +"match pattern that the subject will be matched against. Note that the :class:" +"`AST` nodes produced for patterns differ from those produced for " +"expressions, even when they share the same syntax." +msgstr "" +"Шаблон одного регістру в операторі ``match``. ``шаблон`` містить шаблон " +"відповідності, з яким буде зіставлятися предмет. Зверніть увагу, що вузли :" +"class:`AST`, створені для шаблонів, відрізняються від вузлів, створених для " +"виразів, навіть якщо вони мають однаковий синтаксис." + +msgid "" +"The ``guard`` attribute contains an expression that will be evaluated if the " +"pattern matches the subject." +msgstr "" +"Атрибут ``guard`` містить вираз, який буде оцінено, якщо шаблон відповідає " +"темі." + +msgid "" +"``body`` contains a list of nodes to execute if the pattern matches and the " +"result of evaluating the guard expression is true." +msgstr "" +"``body`` містить список вузлів для виконання, якщо шаблон збігається і " +"результат оцінки виразу guard є істинним." + +msgid "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... match x:\n" +"... case [x] if x>0:\n" +"... ...\n" +"... case tuple():\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" Match(\n" +" subject=Name(id='x', ctx=Load()),\n" +" cases=[\n" +" match_case(\n" +" pattern=MatchSequence(\n" +" patterns=[\n" +" MatchAs(name='x')]),\n" +" guard=Compare(\n" +" left=Name(id='x', ctx=Load()),\n" +" ops=[\n" +" Gt()],\n" +" comparators=[\n" +" Constant(value=0)]),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))]),\n" +" match_case(\n" +" pattern=MatchClass(\n" +" cls=Name(id='tuple', ctx=Load())),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])])" +msgstr "" + +msgid "" +"A match literal or value pattern that compares by equality. ``value`` is an " +"expression node. Permitted value nodes are restricted as described in the " +"match statement documentation. This pattern succeeds if the match subject is " +"equal to the evaluated value." +msgstr "" +"Літерал відповідності або шаблон значення, який порівнює за рівністю. " +"``значення`` є вузлом виразу. Дозволені вузли значень обмежені, як описано в " +"документації оператора відповідності. Цей шаблон успішно працює, якщо " +"суб’єкт відповідності дорівнює оцінюваному значенню." + +msgid "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... match x:\n" +"... case \"Relevant\":\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" Match(\n" +" subject=Name(id='x', ctx=Load()),\n" +" cases=[\n" +" match_case(\n" +" pattern=MatchValue(\n" +" value=Constant(value='Relevant')),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])])" +msgstr "" + +msgid "" +"A match literal pattern that compares by identity. ``value`` is the " +"singleton to be compared against: ``None``, ``True``, or ``False``. This " +"pattern succeeds if the match subject is the given constant." +msgstr "" +"Зразок буквального збігу, який порівнює за ідентичністю. ``value`` — це " +"синглтон, з яким слід порівнювати: ``None``, ``True`` або ``False``. Цей " +"шаблон успішний, якщо суб’єкт відповідності є заданою константою." + +msgid "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... match x:\n" +"... case None:\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" Match(\n" +" subject=Name(id='x', ctx=Load()),\n" +" cases=[\n" +" match_case(\n" +" pattern=MatchSingleton(value=None),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])])" +msgstr "" + +msgid "" +"A match sequence pattern. ``patterns`` contains the patterns to be matched " +"against the subject elements if the subject is a sequence. Matches a " +"variable length sequence if one of the subpatterns is a ``MatchStar`` node, " +"otherwise matches a fixed length sequence." +msgstr "" +"Шаблон послідовності відповідності. ``patterns`` містить шаблони, які " +"потрібно зіставити з елементами теми, якщо тема є послідовністю. Відповідає " +"послідовності змінної довжини, якщо один із підшаблонів є вузлом " +"``MatchStar``, інакше відповідає послідовності фіксованої довжини." + +msgid "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... match x:\n" +"... case [1, 2]:\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" Match(\n" +" subject=Name(id='x', ctx=Load()),\n" +" cases=[\n" +" match_case(\n" +" pattern=MatchSequence(\n" +" patterns=[\n" +" MatchValue(\n" +" value=Constant(value=1)),\n" +" MatchValue(\n" +" value=Constant(value=2))]),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])])" +msgstr "" + +msgid "" +"Matches the rest of the sequence in a variable length match sequence " +"pattern. If ``name`` is not ``None``, a list containing the remaining " +"sequence elements is bound to that name if the overall sequence pattern is " +"successful." +msgstr "" +"Збігається з рештою послідовності в шаблоні послідовності відповідності " +"змінної довжини. Якщо ``name`` не ``None``, список, що містить решту " +"елементів послідовності, прив’язується до цього імені, якщо загальний шаблон " +"послідовності успішний." + +msgid "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... match x:\n" +"... case [1, 2, *rest]:\n" +"... ...\n" +"... case [*_]:\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" Match(\n" +" subject=Name(id='x', ctx=Load()),\n" +" cases=[\n" +" match_case(\n" +" pattern=MatchSequence(\n" +" patterns=[\n" +" MatchValue(\n" +" value=Constant(value=1)),\n" +" MatchValue(\n" +" value=Constant(value=2)),\n" +" MatchStar(name='rest')]),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))]),\n" +" match_case(\n" +" pattern=MatchSequence(\n" +" patterns=[\n" +" MatchStar()]),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])])" +msgstr "" + +msgid "" +"A match mapping pattern. ``keys`` is a sequence of expression nodes. " +"``patterns`` is a corresponding sequence of pattern nodes. ``rest`` is an " +"optional name that can be specified to capture the remaining mapping " +"elements. Permitted key expressions are restricted as described in the match " +"statement documentation." +msgstr "" +"Шаблон відображення відповідності. ``ключі`` - це послідовність вузлів " +"експресії. ``паттерни`` - це відповідна послідовність вузлів шаблону. " +"``rest`` - це необов'язкове ім'я, яке можна вказати для захоплення решти " +"елементів відображення. Дозволені ключові вирази обмежені, як описано в " +"документації оператора відповідності." + +msgid "" +"This pattern succeeds if the subject is a mapping, all evaluated key " +"expressions are present in the mapping, and the value corresponding to each " +"key matches the corresponding subpattern. If ``rest`` is not ``None``, a " +"dict containing the remaining mapping elements is bound to that name if the " +"overall mapping pattern is successful." +msgstr "" +"Цей шаблон виконується успішно, якщо суб’єктом є відображення, усі оцінені " +"ключові вирази присутні у відображенні, а значення, що відповідає кожному " +"ключу, відповідає відповідному підшаблону. Якщо ``rest`` не є ``None``, " +"dict, що містить решту елементів відображення, прив’язується до цього імені, " +"якщо загальний шаблон відображення успішний." + +msgid "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... match x:\n" +"... case {1: _, 2: _}:\n" +"... ...\n" +"... case {**rest}:\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" Match(\n" +" subject=Name(id='x', ctx=Load()),\n" +" cases=[\n" +" match_case(\n" +" pattern=MatchMapping(\n" +" keys=[\n" +" Constant(value=1),\n" +" Constant(value=2)],\n" +" patterns=[\n" +" MatchAs(),\n" +" MatchAs()]),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))]),\n" +" match_case(\n" +" pattern=MatchMapping(rest='rest'),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])])" +msgstr "" + +msgid "" +"A match class pattern. ``cls`` is an expression giving the nominal class to " +"be matched. ``patterns`` is a sequence of pattern nodes to be matched " +"against the class defined sequence of pattern matching attributes. " +"``kwd_attrs`` is a sequence of additional attributes to be matched " +"(specified as keyword arguments in the class pattern), ``kwd_patterns`` are " +"the corresponding patterns (specified as keyword values in the class " +"pattern)." +msgstr "" +"Шаблон класу відповідності. ``cls`` - це вираз, який дає номінальний клас, " +"який потрібно знайти. ``шаблони`` - це послідовність вузлів шаблону, які " +"потрібно зіставити з визначеною класом послідовністю атрибутів відповідності " +"шаблону. ``kwd_attrs`` — це послідовність додаткових атрибутів, які потрібно " +"зіставити (зазначені як аргументи ключових слів у шаблоні класу), " +"``kwd_patterns`` — це відповідні шаблони (зазначені як значення ключових " +"слів у шаблоні класу)." + +msgid "" +"This pattern succeeds if the subject is an instance of the nominated class, " +"all positional patterns match the corresponding class-defined attributes, " +"and any specified keyword attributes match their corresponding pattern." +msgstr "" +"Цей шаблон успішний, якщо суб’єкт є екземпляром призначеного класу, усі " +"позиційні шаблони відповідають відповідним атрибутам, визначеним класом, і " +"будь-які вказані атрибути ключового слова відповідають своєму відповідному " +"шаблону." + +msgid "" +"Note: classes may define a property that returns self in order to match a " +"pattern node against the instance being matched. Several builtin types are " +"also matched that way, as described in the match statement documentation." +msgstr "" +"Примітка: класи можуть визначати властивість, яка повертає self, щоб " +"зіставити вузол шаблону з екземпляром, який відповідає. Кілька вбудованих " +"типів також зіставляються таким чином, як описано в документації оператора " +"збігу." + +msgid "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... match x:\n" +"... case Point2D(0, 0):\n" +"... ...\n" +"... case Point3D(x=0, y=0, z=0):\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" Match(\n" +" subject=Name(id='x', ctx=Load()),\n" +" cases=[\n" +" match_case(\n" +" pattern=MatchClass(\n" +" cls=Name(id='Point2D', ctx=Load()),\n" +" patterns=[\n" +" MatchValue(\n" +" value=Constant(value=0)),\n" +" MatchValue(\n" +" value=Constant(value=0))]),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))]),\n" +" match_case(\n" +" pattern=MatchClass(\n" +" cls=Name(id='Point3D', ctx=Load()),\n" +" kwd_attrs=[\n" +" 'x',\n" +" 'y',\n" +" 'z'],\n" +" kwd_patterns=[\n" +" MatchValue(\n" +" value=Constant(value=0)),\n" +" MatchValue(\n" +" value=Constant(value=0)),\n" +" MatchValue(\n" +" value=Constant(value=0))]),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])])" +msgstr "" + +msgid "" +"A match \"as-pattern\", capture pattern or wildcard pattern. ``pattern`` " +"contains the match pattern that the subject will be matched against. If the " +"pattern is ``None``, the node represents a capture pattern (i.e a bare name) " +"and will always succeed." +msgstr "" +"Збіг \"як шаблон\", шаблон захоплення або шаблон підстановки. ``шаблон`` " +"містить шаблон відповідності, з яким буде зіставлятися предмет. Якщо шаблон " +"``None``, вузол представляє шаблон захоплення (тобто голе ім’я) і завжди " +"матиме успіх." + +msgid "" +"The ``name`` attribute contains the name that will be bound if the pattern " +"is successful. If ``name`` is ``None``, ``pattern`` must also be ``None`` " +"and the node represents the wildcard pattern." +msgstr "" +"Атрибут ``name`` містить ім'я, яке буде зв'язано, якщо шаблон буде успішним. " +"Якщо ``name`` має значення ``None``, ``pattern`` також має бути ``None``, а " +"вузол представляє шаблон підстановки." + +msgid "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... match x:\n" +"... case [x] as y:\n" +"... ...\n" +"... case _:\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" Match(\n" +" subject=Name(id='x', ctx=Load()),\n" +" cases=[\n" +" match_case(\n" +" pattern=MatchAs(\n" +" pattern=MatchSequence(\n" +" patterns=[\n" +" MatchAs(name='x')]),\n" +" name='y'),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))]),\n" +" match_case(\n" +" pattern=MatchAs(),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])])" +msgstr "" + +msgid "" +"A match \"or-pattern\". An or-pattern matches each of its subpatterns in " +"turn to the subject, until one succeeds. The or-pattern is then deemed to " +"succeed. If none of the subpatterns succeed the or-pattern fails. The " +"``patterns`` attribute contains a list of match pattern nodes that will be " +"matched against the subject." +msgstr "" +"Збіг \"або шаблон\". Або-шаблон по черзі зіставляє кожен із своїх " +"підшаблонів із суб’єктом, поки один не досягне успіху. Після цього шаблон " +"або вважається успішним. Якщо жоден із підшаблонів не вдався, шаблон or-не " +"вдається. Атрибут ``patterns`` містить список вузлів шаблону відповідності, " +"які будуть зіставлятися з предметом." + +msgid "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... match x:\n" +"... case [x] | (y):\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" Match(\n" +" subject=Name(id='x', ctx=Load()),\n" +" cases=[\n" +" match_case(\n" +" pattern=MatchOr(\n" +" patterns=[\n" +" MatchSequence(\n" +" patterns=[\n" +" MatchAs(name='x')]),\n" +" MatchAs(name='y')]),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])])" +msgstr "" + +msgid "Type parameters" +msgstr "" + +msgid "" +":ref:`Type parameters ` can exist on classes, functions, and " +"type aliases." +msgstr "" + +msgid "" +"A :class:`typing.TypeVar`. ``name`` is the name of the type variable. " +"``bound`` is the bound or constraints, if any. If ``bound`` is a :class:" +"`Tuple`, it represents constraints; otherwise it represents the bound. " +"``default_value`` is the default value; if the :class:`!TypeVar` has no " +"default, this attribute will be set to ``None``." +msgstr "" + +msgid "" +">>> print(ast.dump(ast.parse(\"type Alias[T: int = bool] = list[T]\"), " +"indent=4))\n" +"Module(\n" +" body=[\n" +" TypeAlias(\n" +" name=Name(id='Alias', ctx=Store()),\n" +" type_params=[\n" +" TypeVar(\n" +" name='T',\n" +" bound=Name(id='int', ctx=Load()),\n" +" default_value=Name(id='bool', ctx=Load()))],\n" +" value=Subscript(\n" +" value=Name(id='list', ctx=Load()),\n" +" slice=Name(id='T', ctx=Load()),\n" +" ctx=Load()))])" +msgstr "" + +msgid "Added the *default_value* parameter." +msgstr "" + +msgid "" +"A :class:`typing.ParamSpec`. ``name`` is the name of the parameter " +"specification. ``default_value`` is the default value; if the :class:`!" +"ParamSpec` has no default, this attribute will be set to ``None``." +msgstr "" + +msgid "" +">>> print(ast.dump(ast.parse(\"type Alias[**P = [int, str]] = Callable[P, " +"int]\"), indent=4))\n" +"Module(\n" +" body=[\n" +" TypeAlias(\n" +" name=Name(id='Alias', ctx=Store()),\n" +" type_params=[\n" +" ParamSpec(\n" +" name='P',\n" +" default_value=List(\n" +" elts=[\n" +" Name(id='int', ctx=Load()),\n" +" Name(id='str', ctx=Load())],\n" +" ctx=Load()))],\n" +" value=Subscript(\n" +" value=Name(id='Callable', ctx=Load()),\n" +" slice=Tuple(\n" +" elts=[\n" +" Name(id='P', ctx=Load()),\n" +" Name(id='int', ctx=Load())],\n" +" ctx=Load()),\n" +" ctx=Load()))])" +msgstr "" + +msgid "" +"A :class:`typing.TypeVarTuple`. ``name`` is the name of the type variable " +"tuple. ``default_value`` is the default value; if the :class:`!TypeVarTuple` " +"has no default, this attribute will be set to ``None``." +msgstr "" + +msgid "" +">>> print(ast.dump(ast.parse(\"type Alias[*Ts = ()] = tuple[*Ts]\"), " +"indent=4))\n" +"Module(\n" +" body=[\n" +" TypeAlias(\n" +" name=Name(id='Alias', ctx=Store()),\n" +" type_params=[\n" +" TypeVarTuple(\n" +" name='Ts',\n" +" default_value=Tuple(ctx=Load()))],\n" +" value=Subscript(\n" +" value=Name(id='tuple', ctx=Load()),\n" +" slice=Tuple(\n" +" elts=[\n" +" Starred(\n" +" value=Name(id='Ts', ctx=Load()),\n" +" ctx=Load())],\n" +" ctx=Load()),\n" +" ctx=Load()))])" +msgstr "" + +msgid "Function and class definitions" +msgstr "Визначення функцій і класів" + +msgid "A function definition." +msgstr "Визначення функції." + +msgid "``name`` is a raw string of the function name." +msgstr "``name`` - це необроблений рядок назви функції." + +msgid "``args`` is an :class:`arguments` node." +msgstr "``args`` є вузлом :class:`arguments`." + +msgid "``body`` is the list of nodes inside the function." +msgstr "``body`` - це список вузлів усередині функції." + +msgid "" +"``decorator_list`` is the list of decorators to be applied, stored outermost " +"first (i.e. the first in the list will be applied last)." +msgstr "" +"``decorator_list`` — це список декораторів, які будуть застосовані, " +"зберігаються в першу чергу (тобто перший у списку буде застосовано останнім)." + +msgid "``returns`` is the return annotation." +msgstr "``returns`` - це анотація повернення." + +msgid "``type_params`` is a list of :ref:`type parameters `." +msgstr "" + +msgid "Added ``type_params``." +msgstr "" + +msgid "" +"``lambda`` is a minimal function definition that can be used inside an " +"expression. Unlike :class:`FunctionDef`, ``body`` holds a single node." +msgstr "" +"``лямбда`` - це мінімальне визначення функції, яке можна використовувати " +"всередині виразу. На відміну від :class:`FunctionDef`, ``body`` містить один " +"вузол." + +msgid "" +">>> print(ast.dump(ast.parse('lambda x,y: ...'), indent=4))\n" +"Module(\n" +" body=[\n" +" Expr(\n" +" value=Lambda(\n" +" args=arguments(\n" +" args=[\n" +" arg(arg='x'),\n" +" arg(arg='y')]),\n" +" body=Constant(value=Ellipsis)))])" +msgstr "" + +msgid "The arguments for a function." +msgstr "Аргументи функції." + +msgid "" +"``posonlyargs``, ``args`` and ``kwonlyargs`` are lists of :class:`arg` nodes." +msgstr "" +"``posonlyargs``, ``args`` і ``kwonlyargs`` - це списки вузлів :class:`arg`." + +msgid "" +"``vararg`` and ``kwarg`` are single :class:`arg` nodes, referring to the " +"``*args, **kwargs`` parameters." +msgstr "" +"``vararg`` і ``kwarg`` є окремими вузлами :class:`arg`, які посилаються на " +"параметри ``*args, **kwargs``." + +msgid "" +"``kw_defaults`` is a list of default values for keyword-only arguments. If " +"one is ``None``, the corresponding argument is required." +msgstr "" +"``kw_defaults`` - це список значень за замовчуванням для аргументів, що " +"містять лише ключові слова. Якщо одне значення ``None``, потрібен " +"відповідний аргумент." + +msgid "" +"``defaults`` is a list of default values for arguments that can be passed " +"positionally. If there are fewer defaults, they correspond to the last n " +"arguments." +msgstr "" +"``defaults`` - це список значень за замовчуванням для аргументів, які можна " +"передати позиційно. Якщо стандартних значень менше, вони відповідають " +"останнім n аргументам." + +msgid "" +"A single argument in a list. ``arg`` is a raw string of the argument name; " +"``annotation`` is its annotation, such as a :class:`Name` node." +msgstr "" + +msgid "" +"``type_comment`` is an optional string with the type annotation as a comment" +msgstr "``type_comment`` – необов’язковий рядок із анотацією типу як коментаря" + +msgid "" +">>> print(ast.dump(ast.parse(\"\"\"\\\n" +"... @decorator1\n" +"... @decorator2\n" +"... def f(a: 'annotation', b=1, c=2, *d, e, f=3, **g) -> 'return " +"annotation':\n" +"... pass\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" FunctionDef(\n" +" name='f',\n" +" args=arguments(\n" +" args=[\n" +" arg(\n" +" arg='a',\n" +" annotation=Constant(value='annotation')),\n" +" arg(arg='b'),\n" +" arg(arg='c')],\n" +" vararg=arg(arg='d'),\n" +" kwonlyargs=[\n" +" arg(arg='e'),\n" +" arg(arg='f')],\n" +" kw_defaults=[\n" +" None,\n" +" Constant(value=3)],\n" +" kwarg=arg(arg='g'),\n" +" defaults=[\n" +" Constant(value=1),\n" +" Constant(value=2)]),\n" +" body=[\n" +" Pass()],\n" +" decorator_list=[\n" +" Name(id='decorator1', ctx=Load()),\n" +" Name(id='decorator2', ctx=Load())],\n" +" returns=Constant(value='return annotation'))])" +msgstr "" + +msgid "A ``return`` statement." +msgstr "Оператор ``повернення``." + +msgid "" +">>> print(ast.dump(ast.parse('return 4'), indent=4))\n" +"Module(\n" +" body=[\n" +" Return(\n" +" value=Constant(value=4))])" +msgstr "" + +msgid "" +"A ``yield`` or ``yield from`` expression. Because these are expressions, " +"they must be wrapped in an :class:`Expr` node if the value sent back is not " +"used." +msgstr "" + +msgid "" +">>> print(ast.dump(ast.parse('yield x'), indent=4))\n" +"Module(\n" +" body=[\n" +" Expr(\n" +" value=Yield(\n" +" value=Name(id='x', ctx=Load())))])\n" +"\n" +">>> print(ast.dump(ast.parse('yield from x'), indent=4))\n" +"Module(\n" +" body=[\n" +" Expr(\n" +" value=YieldFrom(\n" +" value=Name(id='x', ctx=Load())))])" +msgstr "" + +msgid "" +"``global`` and ``nonlocal`` statements. ``names`` is a list of raw strings." +msgstr "" +"``глобальні`` і ``нелокальні`` заяви. ``names`` - це список необроблених " +"рядків." + +msgid "" +">>> print(ast.dump(ast.parse('global x,y,z'), indent=4))\n" +"Module(\n" +" body=[\n" +" Global(\n" +" names=[\n" +" 'x',\n" +" 'y',\n" +" 'z'])])\n" +"\n" +">>> print(ast.dump(ast.parse('nonlocal x,y,z'), indent=4))\n" +"Module(\n" +" body=[\n" +" Nonlocal(\n" +" names=[\n" +" 'x',\n" +" 'y',\n" +" 'z'])])" +msgstr "" + +msgid "A class definition." +msgstr "Визначення класу." + +msgid "``name`` is a raw string for the class name" +msgstr "``name`` - це необроблений рядок для імені класу" + +msgid "``bases`` is a list of nodes for explicitly specified base classes." +msgstr "``бази`` - це список вузлів для явно визначених базових класів." + +msgid "" +"``keywords`` is a list of :class:`.keyword` nodes, principally for " +"'metaclass'. Other keywords will be passed to the metaclass, as per :pep:" +"`3115`." +msgstr "" + +msgid "" +"``body`` is a list of nodes representing the code within the class " +"definition." +msgstr "``body`` - це список вузлів, що представляють код у визначенні класу." + +msgid "``decorator_list`` is a list of nodes, as in :class:`FunctionDef`." +msgstr "``decorator_list`` - це список вузлів, як у :class:`FunctionDef`." + +msgid "" +">>> print(ast.dump(ast.parse(\"\"\"\\\n" +"... @decorator1\n" +"... @decorator2\n" +"... class Foo(base1, base2, metaclass=meta):\n" +"... pass\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" ClassDef(\n" +" name='Foo',\n" +" bases=[\n" +" Name(id='base1', ctx=Load()),\n" +" Name(id='base2', ctx=Load())],\n" +" keywords=[\n" +" keyword(\n" +" arg='metaclass',\n" +" value=Name(id='meta', ctx=Load()))],\n" +" body=[\n" +" Pass()],\n" +" decorator_list=[\n" +" Name(id='decorator1', ctx=Load()),\n" +" Name(id='decorator2', ctx=Load())])])" +msgstr "" + +msgid "Async and await" +msgstr "Async і очікування" + +msgid "" +"An ``async def`` function definition. Has the same fields as :class:" +"`FunctionDef`." +msgstr "" +"Визначення функції ``async def``. Має ті самі поля, що й :class:" +"`FunctionDef`." + +msgid "" +"An ``await`` expression. ``value`` is what it waits for. Only valid in the " +"body of an :class:`AsyncFunctionDef`." +msgstr "" +"Вираз ``очікування``. ``value`` це те, на що він чекає. Дійсний лише в тілі :" +"class:`AsyncFunctionDef`." + +msgid "" +">>> print(ast.dump(ast.parse(\"\"\"\\\n" +"... async def f():\n" +"... await other_func()\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" AsyncFunctionDef(\n" +" name='f',\n" +" args=arguments(),\n" +" body=[\n" +" Expr(\n" +" value=Await(\n" +" value=Call(\n" +" func=Name(id='other_func', ctx=Load()))))])])" +msgstr "" + +msgid "" +"``async for`` loops and ``async with`` context managers. They have the same " +"fields as :class:`For` and :class:`With`, respectively. Only valid in the " +"body of an :class:`AsyncFunctionDef`." +msgstr "" +"``async for`` цикли ``async with`` контекстні менеджери. Вони мають ті самі " +"поля, що й :class:`For` і :class:`With` відповідно. Дійсний лише в тілі :" +"class:`AsyncFunctionDef`." + +msgid "" +"When a string is parsed by :func:`ast.parse`, operator nodes (subclasses of :" +"class:`ast.operator`, :class:`ast.unaryop`, :class:`ast.cmpop`, :class:`ast." +"boolop` and :class:`ast.expr_context`) on the returned tree will be " +"singletons. Changes to one will be reflected in all other occurrences of the " +"same value (e.g. :class:`ast.Add`)." +msgstr "" +"Коли рядок аналізується :func:`ast.parse`, вузли оператора (підкласи :class:" +"`ast.operator`, :class:`ast.unaryop`, :class:`ast.cmpop`, :class:`ast." +"boolop` і :class:`ast.expr_context`) у повернутому дереві будуть одиночними " +"елементами. Зміни в одному буде відображено в усіх інших входженнях того " +"самого значення (наприклад, :class:`ast.Add`)." + +msgid ":mod:`ast` Helpers" +msgstr ":mod:`ast` Помічники" + +msgid "" +"Apart from the node classes, the :mod:`ast` module defines these utility " +"functions and classes for traversing abstract syntax trees:" +msgstr "" +"Окрім класів вузлів, модуль :mod:`ast` визначає ці службові функції та класи " +"для обходу абстрактних синтаксичних дерев:" + +msgid "" +"Parse the source into an AST node. Equivalent to ``compile(source, " +"filename, mode, flags=FLAGS_VALUE, optimize=optimize)``, where " +"``FLAGS_VALUE`` is ``ast.PyCF_ONLY_AST`` if ``optimize <= 0`` and ``ast." +"PyCF_OPTIMIZED_AST`` otherwise." +msgstr "" + +msgid "" +"If ``type_comments=True`` is given, the parser is modified to check and " +"return type comments as specified by :pep:`484` and :pep:`526`. This is " +"equivalent to adding :data:`ast.PyCF_TYPE_COMMENTS` to the flags passed to :" +"func:`compile`. This will report syntax errors for misplaced type " +"comments. Without this flag, type comments will be ignored, and the " +"``type_comment`` field on selected AST nodes will always be ``None``. In " +"addition, the locations of ``# type: ignore`` comments will be returned as " +"the ``type_ignores`` attribute of :class:`Module` (otherwise it is always an " +"empty list)." +msgstr "" + +msgid "" +"In addition, if ``mode`` is ``'func_type'``, the input syntax is modified to " +"correspond to :pep:`484` \"signature type comments\", e.g. ``(str, int) -> " +"List[str]``." +msgstr "" +"Крім того, якщо ``mode`` є ``'func_type'``, синтаксис введення змінюється " +"відповідно до :pep:`484` \"коментарів типу підпису\", напр. ``(str, int) -> " +"Список[str]``." + +msgid "" +"Setting ``feature_version`` to a tuple ``(major, minor)`` will result in a " +"\"best-effort\" attempt to parse using that Python version's grammar. For " +"example, setting ``feature_version=(3, 9)`` will attempt to disallow parsing " +"of :keyword:`match` statements. Currently ``major`` must equal to ``3``. The " +"lowest supported version is ``(3, 7)`` (and this may increase in future " +"Python versions); the highest is ``sys.version_info[0:2]``. \"Best-effort\" " +"attempt means there is no guarantee that the parse (or success of the parse) " +"is the same as when run on the Python version corresponding to " +"``feature_version``." +msgstr "" + +msgid "" +"If source contains a null character (``\\0``), :exc:`ValueError` is raised." +msgstr "" + +msgid "" +"Note that successfully parsing source code into an AST object doesn't " +"guarantee that the source code provided is valid Python code that can be " +"executed as the compilation step can raise further :exc:`SyntaxError` " +"exceptions. For instance, the source ``return 42`` generates a valid AST " +"node for a return statement, but it cannot be compiled alone (it needs to be " +"inside a function node)." +msgstr "" +"Зауважте, що успішний розбір вихідного коду в об’єкт AST не гарантує, що " +"наданий вихідний код є дійсним кодом Python, який можна виконати, оскільки " +"етап компіляції може викликати подальші винятки :exc:`SyntaxError`. " +"Наприклад, вихідний ``return 42`` генерує дійсний вузол AST для оператора " +"return, але його не можна скомпілювати окремо (він має бути всередині " +"функціонального вузла)." + +msgid "" +"In particular, :func:`ast.parse` won't do any scoping checks, which the " +"compilation step does." +msgstr "" +"Зокрема, :func:`ast.parse` не виконуватиме жодних перевірок обсягу, що " +"робить крок компіляції." + +msgid "" +"It is possible to crash the Python interpreter with a sufficiently large/" +"complex string due to stack depth limitations in Python's AST compiler." +msgstr "" +"Можливий збій інтерпретатора Python із досить великим/складним рядком через " +"обмеження глибини стеку в компіляторі AST Python." + +msgid "Added ``type_comments``, ``mode='func_type'`` and ``feature_version``." +msgstr "Додано ``type_comments``, ``mode='func_type'`` і ``feature_version``." + +msgid "" +"The minimum supported version for ``feature_version`` is now ``(3, 7)``. The " +"``optimize`` argument was added." +msgstr "" + +msgid "" +"Unparse an :class:`ast.AST` object and generate a string with code that " +"would produce an equivalent :class:`ast.AST` object if parsed back with :" +"func:`ast.parse`." +msgstr "" +"Розберіть об’єкт :class:`ast.AST` і згенеруйте рядок із кодом, який створить " +"еквівалентний об’єкт :class:`ast.AST`, якщо його проаналізувати назад за " +"допомогою :func:`ast.parse`." + +msgid "" +"The produced code string will not necessarily be equal to the original code " +"that generated the :class:`ast.AST` object (without any compiler " +"optimizations, such as constant tuples/frozensets)." +msgstr "" +"Створений рядок коду не обов’язково дорівнюватиме вихідному коду, який " +"згенерував об’єкт :class:`ast.AST` (без будь-яких оптимізацій компілятора, " +"таких як константні кортежі/заморожені набори)." + +msgid "" +"Trying to unparse a highly complex expression would result with :exc:" +"`RecursionError`." +msgstr "" +"Спроба розібрати дуже складний вираз призведе до :exc:`RecursionError`." + +msgid "" +"Evaluate an expression node or a string containing only a Python literal or " +"container display. The string or node provided may only consist of the " +"following Python literal structures: strings, bytes, numbers, tuples, lists, " +"dicts, sets, booleans, ``None`` and ``Ellipsis``." +msgstr "" + +msgid "" +"This can be used for evaluating strings containing Python values without the " +"need to parse the values oneself. It is not capable of evaluating " +"arbitrarily complex expressions, for example involving operators or indexing." +msgstr "" + +msgid "" +"This function had been documented as \"safe\" in the past without defining " +"what that meant. That was misleading. This is specifically designed not to " +"execute Python code, unlike the more general :func:`eval`. There is no " +"namespace, no name lookups, or ability to call out. But it is not free from " +"attack: A relatively small input can lead to memory exhaustion or to C stack " +"exhaustion, crashing the process. There is also the possibility for " +"excessive CPU consumption denial of service on some inputs. Calling it on " +"untrusted data is thus not recommended." +msgstr "" + +msgid "" +"It is possible to crash the Python interpreter due to stack depth " +"limitations in Python's AST compiler." +msgstr "" + +msgid "" +"It can raise :exc:`ValueError`, :exc:`TypeError`, :exc:`SyntaxError`, :exc:" +"`MemoryError` and :exc:`RecursionError` depending on the malformed input." +msgstr "" +"Він може викликати :exc:`ValueError`, :exc:`TypeError`, :exc:`SyntaxError`, :" +"exc:`MemoryError` і :exc:`RecursionError` залежно від неправильного введення." + +msgid "Now allows bytes and set literals." +msgstr "Тепер дозволяє байти та встановлені літерали." + +msgid "Now supports creating empty sets with ``'set()'``." +msgstr "" +"Тепер підтримується створення порожніх наборів за допомогою ``'set()'``." + +msgid "For string inputs, leading spaces and tabs are now stripped." +msgstr "Для вводу рядків початкові пробіли та табуляції тепер видалені." + +msgid "" +"Return the docstring of the given *node* (which must be a :class:" +"`FunctionDef`, :class:`AsyncFunctionDef`, :class:`ClassDef`, or :class:" +"`Module` node), or ``None`` if it has no docstring. If *clean* is true, " +"clean up the docstring's indentation with :func:`inspect.cleandoc`." +msgstr "" +"Повертає рядок документації даного *вузла* (який має бути :class:" +"`FunctionDef`, :class:`AsyncFunctionDef`, :class:`ClassDef` або :class:" +"`Module` вузол), або ``None``, якщо він не має рядка документації. Якщо " +"*clean* має значення true, очистіть відступ у рядку документа за допомогою :" +"func:`inspect.cleandoc`." + +msgid ":class:`AsyncFunctionDef` is now supported." +msgstr ":class:`AsyncFunctionDef` тепер підтримується." + +msgid "" +"Get source code segment of the *source* that generated *node*. If some " +"location information (:attr:`~ast.AST.lineno`, :attr:`~ast.AST.end_lineno`, :" +"attr:`~ast.AST.col_offset`, or :attr:`~ast.AST.end_col_offset`) is missing, " +"return ``None``." +msgstr "" + +msgid "" +"If *padded* is ``True``, the first line of a multi-line statement will be " +"padded with spaces to match its original position." +msgstr "" +"Якщо *paded* має значення ``True``, перший рядок багаторядкового оператора " +"буде доповнено пробілами відповідно до його вихідної позиції." + +msgid "" +"When you compile a node tree with :func:`compile`, the compiler expects :" +"attr:`~ast.AST.lineno` and :attr:`~ast.AST.col_offset` attributes for every " +"node that supports them. This is rather tedious to fill in for generated " +"nodes, so this helper adds these attributes recursively where not already " +"set, by setting them to the values of the parent node. It works recursively " +"starting at *node*." +msgstr "" + +msgid "" +"Increment the line number and end line number of each node in the tree " +"starting at *node* by *n*. This is useful to \"move code\" to a different " +"location in a file." +msgstr "" +"Збільште номер рядка та номер кінцевого рядка кожного вузла в дереві, " +"починаючи з *вузла*, на *n*. Це корисно для \"переміщення коду\" в інше " +"місце у файлі." + +msgid "" +"Copy source location (:attr:`~ast.AST.lineno`, :attr:`~ast.AST.col_offset`, :" +"attr:`~ast.AST.end_lineno`, and :attr:`~ast.AST.end_col_offset`) from " +"*old_node* to *new_node* if possible, and return *new_node*." +msgstr "" + +msgid "" +"Yield a tuple of ``(fieldname, value)`` for each field in ``node._fields`` " +"that is present on *node*." +msgstr "" +"Отримайте кортеж ``(fieldname, value)`` для кожного поля ``node._fields``, " +"який присутній на *node*." + +msgid "" +"Yield all direct child nodes of *node*, that is, all fields that are nodes " +"and all items of fields that are lists of nodes." +msgstr "" +"Видає всі прямі дочірні вузли *node*, тобто всі поля, які є вузлами, і всі " +"елементи полів, які є списками вузлів." + +msgid "" +"Recursively yield all descendant nodes in the tree starting at *node* " +"(including *node* itself), in no specified order. This is useful if you " +"only want to modify nodes in place and don't care about the context." +msgstr "" +"Рекурсивно створювати всі вузли-нащадки в дереві, починаючи з *node* " +"(включаючи сам *node*), у невизначеному порядку. Це корисно, якщо ви хочете " +"лише змінити вузли на місці й не дбаєте про контекст." + +msgid "" +"A node visitor base class that walks the abstract syntax tree and calls a " +"visitor function for every node found. This function may return a value " +"which is forwarded by the :meth:`visit` method." +msgstr "" +"Базовий клас відвідувача вузла, який проходить абстрактне синтаксичне дерево " +"та викликає функцію відвідувача для кожного знайденого вузла. Ця функція " +"може повертати значення, яке пересилається методом :meth:`visit`." + +msgid "" +"This class is meant to be subclassed, with the subclass adding visitor " +"methods." +msgstr "" +"Цей клас призначений для створення підкласу, який додає методи відвідувачів." + +msgid "" +"Visit a node. The default implementation calls the method called :samp:" +"`self.visit_{classname}` where *classname* is the name of the node class, " +"or :meth:`generic_visit` if that method doesn't exist." +msgstr "" +"Відвідайте вузол. Стандартна реалізація викликає метод під назвою :samp:" +"`self.visit_{classname}`, де *classname* є назвою класу вузла, або :meth:" +"`generic_visit`, якщо цей метод не існує." + +msgid "This visitor calls :meth:`visit` on all children of the node." +msgstr "Цей відвідувач викликає :meth:`visit` для всіх дітей вузла." + +msgid "" +"Note that child nodes of nodes that have a custom visitor method won't be " +"visited unless the visitor calls :meth:`generic_visit` or visits them itself." +msgstr "" +"Зауважте, що дочірні вузли вузлів, які мають спеціальний метод відвідувача, " +"не будуть відвідані, якщо відвідувач не викличе :meth:`generic_visit` або " +"відвідає їх сам." + +msgid "Handles all constant nodes." +msgstr "" + +msgid "" +"Don't use the :class:`NodeVisitor` if you want to apply changes to nodes " +"during traversal. For this a special visitor exists (:class:" +"`NodeTransformer`) that allows modifications." +msgstr "" +"Не використовуйте :class:`NodeVisitor`, якщо ви хочете застосувати зміни до " +"вузлів під час обходу. Для цього існує спеціальний відвідувач (:class:" +"`NodeTransformer`), який дозволяє вносити зміни." + +msgid "" +"Methods :meth:`!visit_Num`, :meth:`!visit_Str`, :meth:`!visit_Bytes`, :meth:" +"`!visit_NameConstant` and :meth:`!visit_Ellipsis` are deprecated now and " +"will not be called in future Python versions. Add the :meth:" +"`visit_Constant` method to handle all constant nodes." +msgstr "" + +msgid "" +"A :class:`NodeVisitor` subclass that walks the abstract syntax tree and " +"allows modification of nodes." +msgstr "" +"Підклас :class:`NodeVisitor`, який проходить абстрактне синтаксичне дерево " +"та дозволяє модифікувати вузли." + +msgid "" +"The :class:`NodeTransformer` will walk the AST and use the return value of " +"the visitor methods to replace or remove the old node. If the return value " +"of the visitor method is ``None``, the node will be removed from its " +"location, otherwise it is replaced with the return value. The return value " +"may be the original node in which case no replacement takes place." +msgstr "" +":class:`NodeTransformer` пройде AST і використає значення, що повертається " +"методами відвідувача, щоб замінити або видалити старий вузол. Якщо " +"значенням, що повертається методом відвідувача, є ``None``, вузол буде " +"видалено зі свого розташування, інакше він замінюється значенням, що " +"повертається. Поверненим значенням може бути вихідний вузол, і в цьому " +"випадку заміна не відбувається." + +msgid "" +"Here is an example transformer that rewrites all occurrences of name lookups " +"(``foo``) to ``data['foo']``::" +msgstr "" +"Ось приклад трансформатора, який переписує всі випадки пошуку імен (``foo``) " +"на ``data['foo']``::" + +msgid "" +"class RewriteName(NodeTransformer):\n" +"\n" +" def visit_Name(self, node):\n" +" return Subscript(\n" +" value=Name(id='data', ctx=Load()),\n" +" slice=Constant(value=node.id),\n" +" ctx=node.ctx\n" +" )" +msgstr "" + +msgid "" +"Keep in mind that if the node you're operating on has child nodes you must " +"either transform the child nodes yourself or call the :meth:`~ast." +"NodeVisitor.generic_visit` method for the node first." +msgstr "" + +msgid "" +"For nodes that were part of a collection of statements (that applies to all " +"statement nodes), the visitor may also return a list of nodes rather than " +"just a single node." +msgstr "" +"Для вузлів, які були частиною набору операторів (що стосується всіх вузлів " +"операторів), відвідувач також може повернути список вузлів, а не лише один " +"вузол." + +msgid "" +"If :class:`NodeTransformer` introduces new nodes (that weren't part of " +"original tree) without giving them location information (such as :attr:`~ast." +"AST.lineno`), :func:`fix_missing_locations` should be called with the new " +"sub-tree to recalculate the location information::" +msgstr "" + +msgid "" +"tree = ast.parse('foo', mode='eval')\n" +"new_tree = fix_missing_locations(RewriteName().visit(tree))" +msgstr "" + +msgid "Usually you use the transformer like this::" +msgstr "Зазвичай ви використовуєте трансформатор таким чином:" + +msgid "node = YourTransformer().visit(node)" +msgstr "" + +msgid "" +"Return a formatted dump of the tree in *node*. This is mainly useful for " +"debugging purposes. If *annotate_fields* is true (by default), the returned " +"string will show the names and the values for fields. If *annotate_fields* " +"is false, the result string will be more compact by omitting unambiguous " +"field names. Attributes such as line numbers and column offsets are not " +"dumped by default. If this is wanted, *include_attributes* can be set to " +"true." +msgstr "" +"Повернути відформатований дамп дерева у *node*. Це в основному корисно для " +"цілей налагодження. Якщо *annotate_fields* має значення true (за " +"замовчуванням), у поверненому рядку відображатимуться імена та значення для " +"полів. Якщо *annotate_fields* має значення false, рядок результату буде " +"більш компактним за рахунок пропуску однозначних імен полів. Такі атрибути, " +"як номери рядків і зміщення стовпців, не скидаються за замовчуванням. Якщо " +"це потрібно, *include_attributes* можна встановити на true." + +msgid "" +"If *indent* is a non-negative integer or string, then the tree will be " +"pretty-printed with that indent level. An indent level of 0, negative, or " +"``\"\"`` will only insert newlines. ``None`` (the default) selects the " +"single line representation. Using a positive integer indent indents that " +"many spaces per level. If *indent* is a string (such as ``\"\\t\"``), that " +"string is used to indent each level." +msgstr "" +"Якщо *indent* є невід’ємним цілим числом або рядком, то дерево буде " +"надруковано з таким рівнем відступу. Рівень відступу 0, негативний або " +"``\"\"`` вставлятиме лише нові рядки. ``None`` (за замовчуванням) вибирає " +"однорядкове представлення. Використання додатного цілого відступу робить " +"стільки відступів на рівень. Якщо *indent* є рядком (наприклад, " +"``\"\\t\"``), цей рядок використовується для відступу кожного рівня." + +msgid "" +"If *show_empty* is ``False`` (the default), empty lists and fields that are " +"``None`` will be omitted from the output." +msgstr "" + +msgid "Added the *indent* option." +msgstr "Додано параметр *відступ*." + +msgid "Added the *show_empty* option." +msgstr "" + +msgid "" +">>> print(ast.dump(ast.parse(\"\"\"\\\n" +"... async def f():\n" +"... await other_func()\n" +"... \"\"\"), indent=4, show_empty=True))\n" +"Module(\n" +" body=[\n" +" AsyncFunctionDef(\n" +" name='f',\n" +" args=arguments(\n" +" posonlyargs=[],\n" +" args=[],\n" +" kwonlyargs=[],\n" +" kw_defaults=[],\n" +" defaults=[]),\n" +" body=[\n" +" Expr(\n" +" value=Await(\n" +" value=Call(\n" +" func=Name(id='other_func', ctx=Load()),\n" +" args=[],\n" +" keywords=[])))],\n" +" decorator_list=[],\n" +" type_params=[])],\n" +" type_ignores=[])" +msgstr "" + +msgid "Compiler Flags" +msgstr "Прапори компілятора" + +msgid "" +"The following flags may be passed to :func:`compile` in order to change " +"effects on the compilation of a program:" +msgstr "" +"Наступні прапорці можуть бути передані :func:`compile`, щоб змінити вплив на " +"компіляцію програми:" + +msgid "" +"Enables support for top-level ``await``, ``async for``, ``async with`` and " +"async comprehensions." +msgstr "" +"Вмикає підтримку ``await`` верхнього рівня, ``async for``, ``async with`` та " +"асинхронне розуміння." + +msgid "" +"Generates and returns an abstract syntax tree instead of returning a " +"compiled code object." +msgstr "" +"Створює та повертає абстрактне синтаксичне дерево замість повернення " +"скомпільованого об’єкта коду." + +msgid "" +"The returned AST is optimized according to the *optimize* argument in :func:" +"`compile` or :func:`ast.parse`." +msgstr "" + +msgid "" +"Enables support for :pep:`484` and :pep:`526` style type comments (``# type: " +"``, ``# type: ignore ``)." +msgstr "" +"Вмикає підтримку коментарів типу :pep:`484` і :pep:`526` (``# type: " +"``, ``# type: ignore ``)." + +msgid "Command-Line Usage" +msgstr "Використання командного рядка" + +msgid "" +"The :mod:`ast` module can be executed as a script from the command line. It " +"is as simple as:" +msgstr "" +"Модуль :mod:`ast` можна запустити як скрипт із командного рядка. Це так " +"просто:" + +msgid "python -m ast [-m ] [-a] [infile]" +msgstr "" + +msgid "The following options are accepted:" +msgstr "Приймаються такі варіанти:" + +msgid "Show the help message and exit." +msgstr "Показати довідкове повідомлення та вийти." + +msgid "" +"Specify what kind of code must be compiled, like the *mode* argument in :" +"func:`parse`." +msgstr "" +"Укажіть тип коду, який потрібно скомпілювати, наприклад аргумент *mode* у :" +"func:`parse`." + +msgid "Don't parse type comments." +msgstr "Не аналізуйте коментарі типу." + +msgid "Include attributes such as line numbers and column offsets." +msgstr "Додайте такі атрибути, як номери рядків і зміщення стовпців." + +msgid "Indentation of nodes in AST (number of spaces)." +msgstr "Відступ вузлів в AST (кількість пробілів)." + +msgid "" +"If :file:`infile` is specified its contents are parsed to AST and dumped to " +"stdout. Otherwise, the content is read from stdin." +msgstr "" +"Якщо вказано :file:`infile`, його вміст аналізується в AST і скидається в " +"stdout. В іншому випадку вміст читається зі стандартного вводу." + +msgid "" +"`Green Tree Snakes `_, an external " +"documentation resource, has good details on working with Python ASTs." +msgstr "" +"`Green Tree Snakes `_, зовнішній " +"ресурс документації, містить хороші відомості про роботу з Python AST." + +msgid "" +"`ASTTokens `_ " +"annotates Python ASTs with the positions of tokens and text in the source " +"code that generated them. This is helpful for tools that make source code " +"transformations." +msgstr "" +"`ASTTokens `_ " +"анотує AST Python за допомогою позицій токенів і тексту у вихідному коді, " +"який їх створив. Це корисно для інструментів, які здійснюють перетворення " +"вихідного коду." + +msgid "" +"`leoAst.py `_ unifies the token-based and parse-tree-based views of python programs " +"by inserting two-way links between tokens and ast nodes." +msgstr "" + +msgid "" +"`LibCST `_ parses code as a Concrete Syntax " +"Tree that looks like an ast tree and keeps all formatting details. It's " +"useful for building automated refactoring (codemod) applications and linters." +msgstr "" +"`LibCST `_ аналізує код як конкретне " +"синтаксичне дерево, яке виглядає як дерево ast і зберігає всі деталі " +"форматування. Це корисно для створення додатків і лінтерів для " +"автоматизованого рефакторинга (codemod)." + +msgid "" +"`Parso `_ is a Python parser that supports " +"error recovery and round-trip parsing for different Python versions (in " +"multiple Python versions). Parso is also able to list multiple syntax errors " +"in your Python file." +msgstr "" + +msgid "? (question mark)" +msgstr "? (знак питання)" + +msgid "in AST grammar" +msgstr "" + +msgid "* (asterisk)" +msgstr "* (зірочка)" diff --git a/library/asynchat.po b/library/asynchat.po new file mode 100644 index 000000000..f2198880e --- /dev/null +++ b/library/asynchat.po @@ -0,0 +1,39 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2024-11-19 01:02+0000\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!asynchat` --- Asynchronous socket command/response handler" +msgstr "" + +msgid "" +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.12 ` after being deprecated in " +"Python 3.6. The removal was decided in :pep:`594`." +msgstr "" + +msgid "Applications should use the :mod:`asyncio` module instead." +msgstr "" + +msgid "" +"The last version of Python that provided the :mod:`!asynchat` module was " +"`Python 3.11 `_." +msgstr "" diff --git a/library/asyncio-api-index.po b/library/asyncio-api-index.po new file mode 100644 index 000000000..2f1f3429b --- /dev/null +++ b/library/asyncio-api-index.po @@ -0,0 +1,367 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:54+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "High-level API Index" +msgstr "Індекс API високого рівня" + +msgid "This page lists all high-level async/await enabled asyncio APIs." +msgstr "" +"На цій сторінці перераховано всі асинхронні API високого рівня з підтримкою " +"функції очікування." + +msgid "Tasks" +msgstr "завдання" + +msgid "" +"Utilities to run asyncio programs, create Tasks, and await on multiple " +"things with timeouts." +msgstr "" +"Утиліти для запуску асинхронних програм, створення завдань і очікування " +"кількох речей із тайм-аутом." + +msgid ":func:`run`" +msgstr ":func:`run`" + +msgid "Create event loop, run a coroutine, close the loop." +msgstr "Створіть цикл подій, запустіть співпрограму, закрийте цикл." + +msgid ":class:`Runner`" +msgstr "" + +msgid "A context manager that simplifies multiple async function calls." +msgstr "" + +msgid ":class:`Task`" +msgstr ":class:`Task`" + +msgid "Task object." +msgstr "Об'єкт завдання." + +msgid ":class:`TaskGroup`" +msgstr "" + +msgid "" +"A context manager that holds a group of tasks. Provides a convenient and " +"reliable way to wait for all tasks in the group to finish." +msgstr "" + +msgid ":func:`create_task`" +msgstr ":func:`create_task`" + +msgid "Start an asyncio Task, then returns it." +msgstr "" + +msgid ":func:`current_task`" +msgstr ":func:`поточне_завдання`" + +msgid "Return the current Task." +msgstr "Повернути поточне завдання." + +msgid ":func:`all_tasks`" +msgstr ":func:`усі_завдання`" + +msgid "Return all tasks that are not yet finished for an event loop." +msgstr "" + +msgid "``await`` :func:`sleep`" +msgstr "``чекати`` :func:`sleep`" + +msgid "Sleep for a number of seconds." +msgstr "Поспати кілька секунд." + +msgid "``await`` :func:`gather`" +msgstr "``чекати`` :func:`gather`" + +msgid "Schedule and wait for things concurrently." +msgstr "Плануйте та чекайте подій одночасно." + +msgid "``await`` :func:`wait_for`" +msgstr "``очікувати`` :func:`wait_for`" + +msgid "Run with a timeout." +msgstr "Запустити з тайм-аутом." + +msgid "``await`` :func:`shield`" +msgstr "``чекати`` :func:`shield`" + +msgid "Shield from cancellation." +msgstr "Щит від скасування." + +msgid "``await`` :func:`wait`" +msgstr "``чекати`` :func:`wait`" + +msgid "Monitor for completion." +msgstr "Монітор для завершення." + +msgid ":func:`timeout`" +msgstr "" + +msgid "Run with a timeout. Useful in cases when ``wait_for`` is not suitable." +msgstr "" + +msgid ":func:`to_thread`" +msgstr ":func:`до_потоку`" + +msgid "Asynchronously run a function in a separate OS thread." +msgstr "Асинхронний запуск функції в окремому потоці ОС." + +msgid ":func:`run_coroutine_threadsafe`" +msgstr ":func:`run_coroutine_threadsafe`" + +msgid "Schedule a coroutine from another OS thread." +msgstr "Заплануйте співпрограму з іншого потоку ОС." + +msgid "``for in`` :func:`as_completed`" +msgstr "``for in`` :func:`as_completed`" + +msgid "Monitor for completion with a ``for`` loop." +msgstr "Контроль завершення за допомогою циклу ``for``." + +msgid "Examples" +msgstr "Приклади" + +msgid "" +":ref:`Using asyncio.gather() to run things in parallel " +"`." +msgstr "" +":ref:`Використання asyncio.gather() для паралельного запуску " +"`." + +msgid "" +":ref:`Using asyncio.wait_for() to enforce a timeout " +"`." +msgstr "" +":ref:`Використання asyncio.wait_for() для застосування тайм-ауту " +"`." + +msgid ":ref:`Cancellation `." +msgstr ":ref:`Скасування `." + +msgid ":ref:`Using asyncio.sleep() `." +msgstr ":ref:`Використання asyncio.sleep() `." + +msgid "See also the main :ref:`Tasks documentation page `." +msgstr "" +"Дивіться також головну :ref:`сторінку документації завдань `." + +msgid "Queues" +msgstr "Черги" + +msgid "" +"Queues should be used to distribute work amongst multiple asyncio Tasks, " +"implement connection pools, and pub/sub patterns." +msgstr "" +"Черги слід використовувати для розподілу роботи між декількома асинхронними " +"завданнями, впровадження пулів підключень і шаблонів pub/sub." + +msgid ":class:`Queue`" +msgstr ":class:`Queue`" + +msgid "A FIFO queue." +msgstr "Черга FIFO." + +msgid ":class:`PriorityQueue`" +msgstr ":class:`PriorityQueue`" + +msgid "A priority queue." +msgstr "Пріоритетна черга." + +msgid ":class:`LifoQueue`" +msgstr ":class:`LifoQueue`" + +msgid "A LIFO queue." +msgstr "Черга LIFO." + +msgid "" +":ref:`Using asyncio.Queue to distribute workload between several Tasks " +"`." +msgstr "" +":ref:`Використання asyncio.Queue для розподілу робочого навантаження між " +"кількома завданнями `." + +msgid "See also the :ref:`Queues documentation page `." +msgstr "" +"Дивіться також :ref:`сторінку документації про черги `." + +msgid "Subprocesses" +msgstr "Підпроцеси" + +msgid "Utilities to spawn subprocesses and run shell commands." +msgstr "Утиліти для створення підпроцесів і виконання команд оболонки." + +msgid "``await`` :func:`create_subprocess_exec`" +msgstr "``чекати`` :func:`create_subprocess_exec`" + +msgid "Create a subprocess." +msgstr "Створіть підпроцес." + +msgid "``await`` :func:`create_subprocess_shell`" +msgstr "``чекати`` :func:`create_subprocess_shell`" + +msgid "Run a shell command." +msgstr "Виконайте команду оболонки." + +msgid ":ref:`Executing a shell command `." +msgstr ":ref:`Виконання команди оболонки `." + +msgid "See also the :ref:`subprocess APIs ` documentation." +msgstr "" +"Дивіться також документацію :ref:`API підпроцесів `." + +msgid "Streams" +msgstr "Потоки" + +msgid "High-level APIs to work with network IO." +msgstr "API високого рівня для роботи з мережевим вводом-виводом." + +msgid "``await`` :func:`open_connection`" +msgstr "``чекати`` :func:`open_connection`" + +msgid "Establish a TCP connection." +msgstr "Встановіть з'єднання TCP." + +msgid "``await`` :func:`open_unix_connection`" +msgstr "``чекати`` :func:`open_unix_connection`" + +msgid "Establish a Unix socket connection." +msgstr "Встановіть підключення через сокет Unix." + +msgid "``await`` :func:`start_server`" +msgstr "``чекати`` :func:`start_server`" + +msgid "Start a TCP server." +msgstr "Запустіть сервер TCP." + +msgid "``await`` :func:`start_unix_server`" +msgstr "``чекати`` :func:`start_unix_server`" + +msgid "Start a Unix socket server." +msgstr "Запустіть сокет-сервер Unix." + +msgid ":class:`StreamReader`" +msgstr ":class:`StreamReader`" + +msgid "High-level async/await object to receive network data." +msgstr "Високорівневий об’єкт async/wait для отримання мережевих даних." + +msgid ":class:`StreamWriter`" +msgstr ":class:`StreamWriter`" + +msgid "High-level async/await object to send network data." +msgstr "Високорівневий об’єкт async/await для надсилання мережевих даних." + +msgid ":ref:`Example TCP client `." +msgstr ":ref:`Приклад TCP-клієнта `." + +msgid "See also the :ref:`streams APIs ` documentation." +msgstr "Дивіться також документацію :ref:`streams APIs `." + +msgid "Synchronization" +msgstr "Синхронізація" + +msgid "Threading-like synchronization primitives that can be used in Tasks." +msgstr "" +"Примітиви потокової синхронізації, які можна використовувати в Завданнях." + +msgid ":class:`Lock`" +msgstr ":class:`Lock`" + +msgid "A mutex lock." +msgstr "Блокування м'ютексу." + +msgid ":class:`Event`" +msgstr ":class:`Event`" + +msgid "An event object." +msgstr "Об'єкт події." + +msgid ":class:`Condition`" +msgstr ":class:`Condition`" + +msgid "A condition object." +msgstr "Об'єкт умови." + +msgid ":class:`Semaphore`" +msgstr ":class:`Semaphore`" + +msgid "A semaphore." +msgstr "Семафор." + +msgid ":class:`BoundedSemaphore`" +msgstr ":class:`BoundedSemaphore`" + +msgid "A bounded semaphore." +msgstr "Обмежений семафор." + +msgid ":class:`Barrier`" +msgstr "" + +msgid "A barrier object." +msgstr "" + +msgid ":ref:`Using asyncio.Event `." +msgstr ":ref:`Використання asyncio.Event `." + +msgid ":ref:`Using asyncio.Barrier `." +msgstr "" + +msgid "" +"See also the documentation of asyncio :ref:`synchronization primitives " +"`." +msgstr "" +"Дивіться також документацію asyncio :ref:`примітивів синхронізації `." + +msgid "Exceptions" +msgstr "Винятки" + +msgid ":exc:`asyncio.CancelledError`" +msgstr ":exc:`asyncio.CancelledError`" + +msgid "Raised when a Task is cancelled. See also :meth:`Task.cancel`." +msgstr "" +"Піднімається, коли завдання скасовано. Дивіться також :meth:`Task.cancel`." + +msgid ":exc:`asyncio.BrokenBarrierError`" +msgstr "" + +msgid "Raised when a Barrier is broken. See also :meth:`Barrier.wait`." +msgstr "" + +msgid "" +":ref:`Handling CancelledError to run code on cancellation request " +"`." +msgstr "" +":ref:`Обробка CancelledError для запуску коду запиту на скасування " +"`." + +msgid "" +"See also the full list of :ref:`asyncio-specific exceptions `." +msgstr "" +"Дивіться також повний список :ref:`специфічних винятків asyncio `." diff --git a/library/asyncio-dev.po b/library/asyncio-dev.po new file mode 100644 index 000000000..998c2d7ec --- /dev/null +++ b/library/asyncio-dev.po @@ -0,0 +1,382 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:54+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Developing with asyncio" +msgstr "Розробка з asyncio" + +msgid "" +"Asynchronous programming is different from classic \"sequential\" " +"programming." +msgstr "" +"Асинхронне програмування відрізняється від класичного \"послідовного\" " +"програмування." + +msgid "" +"This page lists common mistakes and traps and explains how to avoid them." +msgstr "" +"На цій сторінці наведено типові помилки та пастки та пояснено, як їх " +"уникнути." + +msgid "Debug Mode" +msgstr "Режим налагодження" + +msgid "" +"By default asyncio runs in production mode. In order to ease the " +"development asyncio has a *debug mode*." +msgstr "" +"За замовчуванням asyncio працює у робочому режимі. Щоб полегшити розробку, " +"asyncio має *режим налагодження*." + +msgid "There are several ways to enable asyncio debug mode:" +msgstr "Є кілька способів увімкнути асинхронний режим налагодження:" + +msgid "Setting the :envvar:`PYTHONASYNCIODEBUG` environment variable to ``1``." +msgstr "Встановлення змінної середовища :envvar:`PYTHONASYNCIODEBUG` на ``1``." + +msgid "Using the :ref:`Python Development Mode `." +msgstr "Використання :ref:`режиму розробки Python `." + +msgid "Passing ``debug=True`` to :func:`asyncio.run`." +msgstr "Передача ``debug=True`` до :func:`asyncio.run`." + +msgid "Calling :meth:`loop.set_debug`." +msgstr "Виклик :meth:`loop.set_debug`." + +msgid "In addition to enabling the debug mode, consider also:" +msgstr "Окрім увімкнення режиму налагодження, враховуйте також:" + +msgid "" +"setting the log level of the :ref:`asyncio logger ` to :py:" +"const:`logging.DEBUG`, for example the following snippet of code can be run " +"at startup of the application::" +msgstr "" + +msgid "logging.basicConfig(level=logging.DEBUG)" +msgstr "" + +msgid "" +"configuring the :mod:`warnings` module to display :exc:`ResourceWarning` " +"warnings. One way of doing that is by using the :option:`-W` ``default`` " +"command line option." +msgstr "" +"налаштування модуля :mod:`warnings` для відображення попереджень :exc:" +"`ResourceWarning`. Один із способів зробити це — скористатися параметром " +"командного рядка :option:`-W` ``default``." + +msgid "When the debug mode is enabled:" +msgstr "Коли ввімкнено режим налагодження:" + +msgid "" +"asyncio checks for :ref:`coroutines that were not awaited ` and logs them; this mitigates the \"forgotten await\" " +"pitfall." +msgstr "" +"asyncio перевіряє :ref:`співпрограми, які не були очікувані `, і записує їх у журнал; це пом'якшує помилку " +"\"забутого очікування\"." + +msgid "" +"Many non-threadsafe asyncio APIs (such as :meth:`loop.call_soon` and :meth:" +"`loop.call_at` methods) raise an exception if they are called from a wrong " +"thread." +msgstr "" +"Багато небезпечних для потоків асинхронних API (таких як методи :meth:`loop." +"call_soon` і :meth:`loop.call_at`) викликають виняток, якщо вони " +"викликаються з неправильного потоку." + +msgid "" +"The execution time of the I/O selector is logged if it takes too long to " +"perform an I/O operation." +msgstr "" +"Час виконання селектора введення-виведення реєструється, якщо виконання " +"операції введення-виведення займає надто багато часу." + +msgid "" +"Callbacks taking longer than 100 milliseconds are logged. The :attr:`loop." +"slow_callback_duration` attribute can be used to set the minimum execution " +"duration in seconds that is considered \"slow\"." +msgstr "" + +msgid "Concurrency and Multithreading" +msgstr "Паралельність і багатопотоковість" + +msgid "" +"An event loop runs in a thread (typically the main thread) and executes all " +"callbacks and Tasks in its thread. While a Task is running in the event " +"loop, no other Tasks can run in the same thread. When a Task executes an " +"``await`` expression, the running Task gets suspended, and the event loop " +"executes the next Task." +msgstr "" +"Цикл подій виконується в потоці (зазвичай головному) і виконує всі зворотні " +"виклики та завдання у своєму потоці. Поки Завдання виконується в циклі " +"подій, жодні інші Завдання не можуть виконуватися в тому самому потоці. Коли " +"Завдання виконує вираз ``очікування``, запущене Завдання призупиняється, а " +"цикл подій виконує наступне Завдання." + +msgid "" +"To schedule a :term:`callback` from another OS thread, the :meth:`loop." +"call_soon_threadsafe` method should be used. Example::" +msgstr "" +"Щоб запланувати :term:`callback` з іншого потоку ОС, слід використовувати " +"метод :meth:`loop.call_soon_threadsafe`. Приклад::" + +msgid "loop.call_soon_threadsafe(callback, *args)" +msgstr "" + +msgid "" +"Almost all asyncio objects are not thread safe, which is typically not a " +"problem unless there is code that works with them from outside of a Task or " +"a callback. If there's a need for such code to call a low-level asyncio " +"API, the :meth:`loop.call_soon_threadsafe` method should be used, e.g.::" +msgstr "" +"Майже всі асинхронні об’єкти не є потокобезпечними, що зазвичай не є " +"проблемою, якщо немає коду, який працює з ними поза Завданням або зворотним " +"викликом. Якщо існує потреба в такому коді для виклику низькорівневого " +"асинхронного API, слід використовувати метод :meth:`loop." +"call_soon_threadsafe`, наприклад::" + +msgid "loop.call_soon_threadsafe(fut.cancel)" +msgstr "" + +msgid "" +"To schedule a coroutine object from a different OS thread, the :func:" +"`run_coroutine_threadsafe` function should be used. It returns a :class:" +"`concurrent.futures.Future` to access the result::" +msgstr "" +"Щоб запланувати об’єкт співпрограми з іншого потоку ОС, слід використати " +"функцію :func:`run_coroutine_threadsafe`. Він повертає :class:`concurrent." +"futures.Future` для доступу до результату::" + +msgid "" +"async def coro_func():\n" +" return await asyncio.sleep(1, 42)\n" +"\n" +"# Later in another OS thread:\n" +"\n" +"future = asyncio.run_coroutine_threadsafe(coro_func(), loop)\n" +"# Wait for the result:\n" +"result = future.result()" +msgstr "" + +msgid "To handle signals the event loop must be run in the main thread." +msgstr "" + +msgid "" +"The :meth:`loop.run_in_executor` method can be used with a :class:" +"`concurrent.futures.ThreadPoolExecutor` to execute blocking code in a " +"different OS thread without blocking the OS thread that the event loop runs " +"in." +msgstr "" +"Метод :meth:`loop.run_in_executor` можна використовувати з :class:" +"`concurrent.futures.ThreadPoolExecutor` для виконання коду блокування в " +"іншому потоці ОС, не блокуючи потік ОС, у якому виконується цикл подій." + +msgid "" +"There is currently no way to schedule coroutines or callbacks directly from " +"a different process (such as one started with :mod:`multiprocessing`). The :" +"ref:`asyncio-event-loop-methods` section lists APIs that can read from pipes " +"and watch file descriptors without blocking the event loop. In addition, " +"asyncio's :ref:`Subprocess ` APIs provide a way to start " +"a process and communicate with it from the event loop. Lastly, the " +"aforementioned :meth:`loop.run_in_executor` method can also be used with a :" +"class:`concurrent.futures.ProcessPoolExecutor` to execute code in a " +"different process." +msgstr "" + +msgid "Running Blocking Code" +msgstr "Запуск коду блокування" + +msgid "" +"Blocking (CPU-bound) code should not be called directly. For example, if a " +"function performs a CPU-intensive calculation for 1 second, all concurrent " +"asyncio Tasks and IO operations would be delayed by 1 second." +msgstr "" +"Код блокування (прив’язаний до процесора) не слід викликати безпосередньо. " +"Наприклад, якщо функція виконує інтенсивне обчислення ЦП протягом 1 секунди, " +"усі одночасні асинхронні завдання та операції введення-виведення будуть " +"відкладені на 1 секунду." + +msgid "" +"An executor can be used to run a task in a different thread or even in a " +"different process to avoid blocking the OS thread with the event loop. See " +"the :meth:`loop.run_in_executor` method for more details." +msgstr "" +"Виконавець можна використовувати для запуску завдання в іншому потоці або " +"навіть в іншому процесі, щоб уникнути блокування потоку ОС за допомогою " +"циклу подій. Додаткову інформацію див. у методі :meth:`loop.run_in_executor`." + +msgid "Logging" +msgstr "Лісозаготівля" + +msgid "" +"asyncio uses the :mod:`logging` module and all logging is performed via the " +"``\"asyncio\"`` logger." +msgstr "" +"asyncio використовує модуль :mod:`logging`, і все журналювання виконується " +"через ``\"asyncio\"`` реєстратор." + +msgid "" +"The default log level is :py:const:`logging.INFO`, which can be easily " +"adjusted::" +msgstr "" + +msgid "logging.getLogger(\"asyncio\").setLevel(logging.WARNING)" +msgstr "" + +msgid "" +"Network logging can block the event loop. It is recommended to use a " +"separate thread for handling logs or use non-blocking IO. For example, see :" +"ref:`blocking-handlers`." +msgstr "" + +msgid "Detect never-awaited coroutines" +msgstr "Виявляти ніколи не очікувані співпрограми" + +msgid "" +"When a coroutine function is called, but not awaited (e.g. ``coro()`` " +"instead of ``await coro()``) or the coroutine is not scheduled with :meth:" +"`asyncio.create_task`, asyncio will emit a :exc:`RuntimeWarning`::" +msgstr "" +"Коли функція співпрограми викликається, але не очікується (наприклад, " +"``coro()`` замість ``await coro()``) або співпрограма не запланована за " +"допомогою :meth:`asyncio.create_task`, asyncio видасть :exc:" +"`RuntimeWarning`::" + +msgid "" +"import asyncio\n" +"\n" +"async def test():\n" +" print(\"never scheduled\")\n" +"\n" +"async def main():\n" +" test()\n" +"\n" +"asyncio.run(main())" +msgstr "" + +msgid "Output::" +msgstr "Вихід::" + +msgid "" +"test.py:7: RuntimeWarning: coroutine 'test' was never awaited\n" +" test()" +msgstr "" + +msgid "Output in debug mode::" +msgstr "Вивід у режимі налагодження::" + +msgid "" +"test.py:7: RuntimeWarning: coroutine 'test' was never awaited\n" +"Coroutine created at (most recent call last)\n" +" File \"../t.py\", line 9, in \n" +" asyncio.run(main(), debug=True)\n" +"\n" +" < .. >\n" +"\n" +" File \"../t.py\", line 7, in main\n" +" test()\n" +" test()" +msgstr "" + +msgid "" +"The usual fix is to either await the coroutine or call the :meth:`asyncio." +"create_task` function::" +msgstr "" +"Звичайним виправленням є або очікування співпрограми, або виклик функції :" +"meth:`asyncio.create_task`::" + +msgid "" +"async def main():\n" +" await test()" +msgstr "" + +msgid "Detect never-retrieved exceptions" +msgstr "Виявлення ніколи не отриманих винятків" + +msgid "" +"If a :meth:`Future.set_exception` is called but the Future object is never " +"awaited on, the exception would never be propagated to the user code. In " +"this case, asyncio would emit a log message when the Future object is " +"garbage collected." +msgstr "" +"Якщо викликається :meth:`Future.set_exception`, але об’єкт Future ніколи не " +"очікується, виняток ніколи не поширюватиметься на код користувача. У цьому " +"випадку asyncio створюватиме повідомлення журналу, коли об’єкт Future " +"збиратиме сміття." + +msgid "Example of an unhandled exception::" +msgstr "Приклад необробленого винятку::" + +msgid "" +"import asyncio\n" +"\n" +"async def bug():\n" +" raise Exception(\"not consumed\")\n" +"\n" +"async def main():\n" +" asyncio.create_task(bug())\n" +"\n" +"asyncio.run(main())" +msgstr "" + +msgid "" +"Task exception was never retrieved\n" +"future: \n" +" exception=Exception('not consumed')>\n" +"\n" +"Traceback (most recent call last):\n" +" File \"test.py\", line 4, in bug\n" +" raise Exception(\"not consumed\")\n" +"Exception: not consumed" +msgstr "" + +msgid "" +":ref:`Enable the debug mode ` to get the traceback where " +"the task was created::" +msgstr "" +":ref:`Увімкніть режим налагодження `, щоб отримати " +"відстеження місця створення завдання:" + +msgid "asyncio.run(main(), debug=True)" +msgstr "" + +msgid "" +"Task exception was never retrieved\n" +"future: \n" +" exception=Exception('not consumed') created at asyncio/tasks.py:321>\n" +"\n" +"source_traceback: Object created at (most recent call last):\n" +" File \"../t.py\", line 9, in \n" +" asyncio.run(main(), debug=True)\n" +"\n" +"< .. >\n" +"\n" +"Traceback (most recent call last):\n" +" File \"../t.py\", line 4, in bug\n" +" raise Exception(\"not consumed\")\n" +"Exception: not consumed" +msgstr "" diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po new file mode 100644 index 000000000..79374cfbb --- /dev/null +++ b/library/asyncio-eventloop.po @@ -0,0 +1,2534 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:54+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Event Loop" +msgstr "Цикл подій" + +msgid "" +"**Source code:** :source:`Lib/asyncio/events.py`, :source:`Lib/asyncio/" +"base_events.py`" +msgstr "" +"**Вихідний код:** :source:`Lib/asyncio/events.py`, :source:`Lib/asyncio/" +"base_events.py`" + +msgid "Preface" +msgstr "Передмова" + +msgid "" +"The event loop is the core of every asyncio application. Event loops run " +"asynchronous tasks and callbacks, perform network IO operations, and run " +"subprocesses." +msgstr "" +"Цикл подій є ядром кожної асинхронної програми. Цикли подій запускають " +"асинхронні завдання та зворотні виклики, виконують мережеві операції вводу-" +"виводу та запускають підпроцеси." + +msgid "" +"Application developers should typically use the high-level asyncio " +"functions, such as :func:`asyncio.run`, and should rarely need to reference " +"the loop object or call its methods. This section is intended mostly for " +"authors of lower-level code, libraries, and frameworks, who need finer " +"control over the event loop behavior." +msgstr "" +"Розробникам додатків зазвичай слід використовувати асинхронні функції " +"високого рівня, такі як :func:`asyncio.run`, і їм рідко потрібно посилатися " +"на об’єкт циклу або викликати його методи. Цей розділ призначений переважно " +"для авторів коду нижчого рівня, бібліотек і фреймворків, яким потрібен " +"точніший контроль над поведінкою циклу подій." + +msgid "Obtaining the Event Loop" +msgstr "Отримання циклу подій" + +msgid "" +"The following low-level functions can be used to get, set, or create an " +"event loop:" +msgstr "" +"Наступні функції низького рівня можна використовувати для отримання, " +"встановлення або створення циклу подій:" + +msgid "Return the running event loop in the current OS thread." +msgstr "Повернути запущений цикл подій у поточному потоці ОС." + +msgid "Raise a :exc:`RuntimeError` if there is no running event loop." +msgstr "" + +msgid "This function can only be called from a coroutine or a callback." +msgstr "" + +msgid "Get the current event loop." +msgstr "Отримати поточний цикл подій." + +msgid "" +"When called from a coroutine or a callback (e.g. scheduled with call_soon or " +"similar API), this function will always return the running event loop." +msgstr "" + +msgid "" +"If there is no running event loop set, the function will return the result " +"of the ``get_event_loop_policy().get_event_loop()`` call." +msgstr "" + +msgid "" +"Because this function has rather complex behavior (especially when custom " +"event loop policies are in use), using the :func:`get_running_loop` function " +"is preferred to :func:`get_event_loop` in coroutines and callbacks." +msgstr "" +"Оскільки ця функція має досить складну поведінку (особливо, коли " +"використовуються користувацькі політики циклу подій), використанню функції :" +"func:`get_running_loop` краще, ніж :func:`get_event_loop` у співпрограмах і " +"зворотних викликах." + +msgid "" +"As noted above, consider using the higher-level :func:`asyncio.run` " +"function, instead of using these lower level functions to manually create " +"and close an event loop." +msgstr "" + +msgid "" +"Deprecation warning is emitted if there is no current event loop. In some " +"future Python release this will become an error." +msgstr "" + +msgid "Set *loop* as the current event loop for the current OS thread." +msgstr "" + +msgid "Create and return a new event loop object." +msgstr "Створити та повернути новий об’єкт циклу подій." + +msgid "" +"Note that the behaviour of :func:`get_event_loop`, :func:`set_event_loop`, " +"and :func:`new_event_loop` functions can be altered by :ref:`setting a " +"custom event loop policy `." +msgstr "" +"Зауважте, що поведінку функцій :func:`get_event_loop`, :func:" +"`set_event_loop` і :func:`new_event_loop` можна змінити шляхом :ref:" +"`встановлення спеціальної політики циклу подій `." + +msgid "Contents" +msgstr "Зміст" + +msgid "This documentation page contains the following sections:" +msgstr "Ця сторінка документації містить такі розділи:" + +msgid "" +"The `Event Loop Methods`_ section is the reference documentation of the " +"event loop APIs;" +msgstr "" +"Розділ `Event Loop Methods`_ є довідковою документацією щодо API циклу подій;" + +msgid "" +"The `Callback Handles`_ section documents the :class:`Handle` and :class:" +"`TimerHandle` instances which are returned from scheduling methods such as :" +"meth:`loop.call_soon` and :meth:`loop.call_later`;" +msgstr "" +"Розділ `Callback Handles`_ документує екземпляри :class:`Handle` і :class:" +"`TimerHandle`, які повертаються з таких методів планування, як :meth:`loop." +"call_soon` і :meth:`loop.call_later`;" + +msgid "" +"The `Server Objects`_ section documents types returned from event loop " +"methods like :meth:`loop.create_server`;" +msgstr "" +"Розділ `Server Objects`_ документує типи, що повертаються з методів циклу " +"подій, таких як :meth:`loop.create_server`;" + +msgid "" +"The `Event Loop Implementations`_ section documents the :class:" +"`SelectorEventLoop` and :class:`ProactorEventLoop` classes;" +msgstr "" +"Розділ `Event Loop Implementations`_ документує класи :class:" +"`SelectorEventLoop` і :class:`ProactorEventLoop`;" + +msgid "" +"The `Examples`_ section showcases how to work with some event loop APIs." +msgstr "Розділ `Examples`_ демонструє, як працювати з деякими API циклу подій." + +msgid "Event Loop Methods" +msgstr "Методи циклу подій" + +msgid "Event loops have **low-level** APIs for the following:" +msgstr "Цикли подій мають API **низького рівня** для наступного:" + +msgid "Running and stopping the loop" +msgstr "Запуск і зупинка циклу" + +msgid "Run until the *future* (an instance of :class:`Future`) has completed." +msgstr "Виконуйте, доки *future* (примірник :class:`Future`) не завершиться." + +msgid "" +"If the argument is a :ref:`coroutine object ` it is implicitly " +"scheduled to run as a :class:`asyncio.Task`." +msgstr "" +"Якщо аргумент є :ref:`об’єктом співпрограми `, він неявно " +"запланований для виконання як :class:`asyncio.Task`." + +msgid "Return the Future's result or raise its exception." +msgstr "Повернути результат майбутнього або викликати його виключення." + +msgid "Run the event loop until :meth:`stop` is called." +msgstr "Запускайте цикл подій, доки не буде викликано :meth:`stop`." + +msgid "" +"If :meth:`stop` is called before :meth:`run_forever` is called, the loop " +"will poll the I/O selector once with a timeout of zero, run all callbacks " +"scheduled in response to I/O events (and those that were already scheduled), " +"and then exit." +msgstr "" + +msgid "" +"If :meth:`stop` is called while :meth:`run_forever` is running, the loop " +"will run the current batch of callbacks and then exit. Note that new " +"callbacks scheduled by callbacks will not run in this case; instead, they " +"will run the next time :meth:`run_forever` or :meth:`run_until_complete` is " +"called." +msgstr "" +"Якщо :meth:`stop` викликається під час роботи :meth:`run_forever`, цикл " +"запустить поточний пакет зворотних викликів, а потім завершить роботу. " +"Зауважте, що нові зворотні виклики, заплановані зворотними викликами, не " +"виконуватимуться в цьому випадку; натомість вони запустяться під час " +"наступного виклику :meth:`run_forever` або :meth:`run_until_complete`." + +msgid "Stop the event loop." +msgstr "Зупиніть цикл подій." + +msgid "Return ``True`` if the event loop is currently running." +msgstr "Повертає ``True``, якщо цикл подій зараз запущено." + +msgid "Return ``True`` if the event loop was closed." +msgstr "Повертає ``True``, якщо цикл події було закрито." + +msgid "Close the event loop." +msgstr "Закрийте цикл подій." + +msgid "" +"The loop must not be running when this function is called. Any pending " +"callbacks will be discarded." +msgstr "" +"Під час виклику цієї функції цикл не повинен працювати. Усі зворотні " +"виклики, що очікують на розгляд, буде відхилено." + +msgid "" +"This method clears all queues and shuts down the executor, but does not wait " +"for the executor to finish." +msgstr "" +"Цей метод очищає всі черги та вимикає виконавець, але не чекає, поки " +"виконавець завершить роботу." + +msgid "" +"This method is idempotent and irreversible. No other methods should be " +"called after the event loop is closed." +msgstr "" +"Цей метод є ідемпотентним і необоротним. Ніякі інші методи не повинні " +"викликатися після закриття циклу подій." + +msgid "" +"Schedule all currently open :term:`asynchronous generator` objects to close " +"with an :meth:`~agen.aclose` call. After calling this method, the event " +"loop will issue a warning if a new asynchronous generator is iterated. This " +"should be used to reliably finalize all scheduled asynchronous generators." +msgstr "" + +msgid "" +"Note that there is no need to call this function when :func:`asyncio.run` is " +"used." +msgstr "" +"Зауважте, що немає потреби викликати цю функцію, коли використовується :func:" +"`asyncio.run`." + +msgid "Example::" +msgstr "Приклад::" + +msgid "" +"try:\n" +" loop.run_forever()\n" +"finally:\n" +" loop.run_until_complete(loop.shutdown_asyncgens())\n" +" loop.close()" +msgstr "" + +msgid "" +"Schedule the closure of the default executor and wait for it to join all of " +"the threads in the :class:`~concurrent.futures.ThreadPoolExecutor`. Once " +"this method has been called, using the default executor with :meth:`loop." +"run_in_executor` will raise a :exc:`RuntimeError`." +msgstr "" + +msgid "" +"The *timeout* parameter specifies the amount of time (in :class:`float` " +"seconds) the executor will be given to finish joining. With the default, " +"``None``, the executor is allowed an unlimited amount of time." +msgstr "" + +msgid "" +"If the *timeout* is reached, a :exc:`RuntimeWarning` is emitted and the " +"default executor is terminated without waiting for its threads to finish " +"joining." +msgstr "" + +msgid "" +"Do not call this method when using :func:`asyncio.run`, as the latter " +"handles default executor shutdown automatically." +msgstr "" + +msgid "Added the *timeout* parameter." +msgstr "" + +msgid "Scheduling callbacks" +msgstr "Планування зворотних дзвінків" + +msgid "" +"Schedule the *callback* :term:`callback` to be called with *args* arguments " +"at the next iteration of the event loop." +msgstr "" +"Заплануйте виклик *callback* :term:`callback` з аргументами *args* на " +"наступній ітерації циклу подій." + +msgid "" +"Return an instance of :class:`asyncio.Handle`, which can be used later to " +"cancel the callback." +msgstr "" + +msgid "" +"Callbacks are called in the order in which they are registered. Each " +"callback will be called exactly once." +msgstr "" +"Зворотні виклики викликаються в тому порядку, в якому вони зареєстровані. " +"Кожен зворотній виклик буде викликано рівно один раз." + +msgid "" +"The optional keyword-only *context* argument specifies a custom :class:" +"`contextvars.Context` for the *callback* to run in. Callbacks use the " +"current context when no *context* is provided." +msgstr "" + +msgid "Unlike :meth:`call_soon_threadsafe`, this method is not thread-safe." +msgstr "" + +msgid "" +"A thread-safe variant of :meth:`call_soon`. When scheduling callbacks from " +"another thread, this function *must* be used, since :meth:`call_soon` is not " +"thread-safe." +msgstr "" + +msgid "" +"This function is safe to be called from a reentrant context or signal " +"handler, however, it is not safe or fruitful to use the returned handle in " +"such contexts." +msgstr "" + +msgid "" +"Raises :exc:`RuntimeError` if called on a loop that's been closed. This can " +"happen on a secondary thread when the main application is shutting down." +msgstr "" +"Викликає :exc:`RuntimeError`, якщо викликається в закритому циклі. Це може " +"статися у вторинному потоці, коли основна програма вимикається." + +msgid "" +"See the :ref:`concurrency and multithreading ` " +"section of the documentation." +msgstr "" +"Перегляньте розділ :ref:`паралелізм і багатопотоковість ` документації." + +msgid "" +"The *context* keyword-only parameter was added. See :pep:`567` for more " +"details." +msgstr "" +"Додано параметр *context* тільки для ключового слова. Дивіться :pep:`567` " +"для більш детальної інформації." + +msgid "" +"Most :mod:`asyncio` scheduling functions don't allow passing keyword " +"arguments. To do that, use :func:`functools.partial`::" +msgstr "" +"Більшість функцій планування :mod:`asyncio` не дозволяють передавати ключові " +"аргументи. Для цього скористайтеся :func:`functools.partial`::" + +msgid "" +"# will schedule \"print(\"Hello\", flush=True)\"\n" +"loop.call_soon(\n" +" functools.partial(print, \"Hello\", flush=True))" +msgstr "" + +msgid "" +"Using partial objects is usually more convenient than using lambdas, as " +"asyncio can render partial objects better in debug and error messages." +msgstr "" +"Використання часткових об’єктів зазвичай зручніше, ніж використання лямбда-" +"виразів, оскільки asyncio може краще відтворювати часткові об’єкти в " +"повідомленнях про налагодження та помилки." + +msgid "Scheduling delayed callbacks" +msgstr "Планування відкладених зворотних викликів" + +msgid "" +"Event loop provides mechanisms to schedule callback functions to be called " +"at some point in the future. Event loop uses monotonic clocks to track time." +msgstr "" +"Цикл подій надає механізми для планування виклику функцій зворотного виклику " +"в певний момент у майбутньому. Цикл подій використовує монотонні годинники " +"для відстеження часу." + +msgid "" +"Schedule *callback* to be called after the given *delay* number of seconds " +"(can be either an int or a float)." +msgstr "" +"Розклад *зворотного виклику* для виклику після заданої *затримки* у секундах " +"(може бути як int, так і float)." + +msgid "" +"An instance of :class:`asyncio.TimerHandle` is returned which can be used to " +"cancel the callback." +msgstr "" +"Повертається екземпляр :class:`asyncio.TimerHandle`, який можна " +"використовувати для скасування зворотного виклику." + +msgid "" +"*callback* will be called exactly once. If two callbacks are scheduled for " +"exactly the same time, the order in which they are called is undefined." +msgstr "" +"*callback* буде передзвонено рівно один раз. Якщо два зворотні виклики " +"заплановано на один і той же час, порядок їх викликів не визначений." + +msgid "" +"The optional positional *args* will be passed to the callback when it is " +"called. If you want the callback to be called with keyword arguments use :" +"func:`functools.partial`." +msgstr "" +"Додатковий позиційний *args* буде передано зворотному виклику під час його " +"виклику. Якщо ви хочете, щоб зворотній виклик викликався з аргументами " +"ключового слова, використовуйте :func:`functools.partial`." + +msgid "" +"An optional keyword-only *context* argument allows specifying a custom :" +"class:`contextvars.Context` for the *callback* to run in. The current " +"context is used when no *context* is provided." +msgstr "" +"Необов’язковий аргумент *context*, що містить лише ключове слово, дозволяє " +"вказати спеціальний :class:`contextvars.Context` для виконання *зворотного " +"виклику*. Поточний контекст використовується, якщо *контексту* не надано." + +msgid "" +"In Python 3.7 and earlier with the default event loop implementation, the " +"*delay* could not exceed one day. This has been fixed in Python 3.8." +msgstr "" +"У Python 3.7 і раніше з реалізацією циклу подій за замовчуванням *затримка* " +"не могла перевищувати один день. Це було виправлено в Python 3.8." + +msgid "" +"Schedule *callback* to be called at the given absolute timestamp *when* (an " +"int or a float), using the same time reference as :meth:`loop.time`." +msgstr "" +"Заплануйте виклик *callback* у вказану абсолютну позначку часу *when* (int " +"або float), використовуючи те саме посилання на час, що й :meth:`loop.time`." + +msgid "This method's behavior is the same as :meth:`call_later`." +msgstr "Поведінка цього методу така ж, як і :meth:`call_later`." + +msgid "" +"In Python 3.7 and earlier with the default event loop implementation, the " +"difference between *when* and the current time could not exceed one day. " +"This has been fixed in Python 3.8." +msgstr "" +"У Python 3.7 і раніше з реалізацією циклу подій за замовчуванням різниця між " +"*when* і поточним часом не могла перевищувати одного дня. Це було виправлено " +"в Python 3.8." + +msgid "" +"Return the current time, as a :class:`float` value, according to the event " +"loop's internal monotonic clock." +msgstr "" +"Повертає поточний час у вигляді значення :class:`float` відповідно до " +"внутрішнього монотонного годинника циклу подій." + +msgid "" +"In Python 3.7 and earlier timeouts (relative *delay* or absolute *when*) " +"should not exceed one day. This has been fixed in Python 3.8." +msgstr "" +"У Python 3.7 та попередніх версіях тайм-аути (відносна *затримка* або " +"абсолютна *коли*) не повинні перевищувати одного дня. Це було виправлено в " +"Python 3.8." + +msgid "The :func:`asyncio.sleep` function." +msgstr "Функція :func:`asyncio.sleep`." + +msgid "Creating Futures and Tasks" +msgstr "Створення ф'ючерсів і завдань" + +msgid "Create an :class:`asyncio.Future` object attached to the event loop." +msgstr "Створіть об’єкт :class:`asyncio.Future`, приєднаний до циклу подій." + +msgid "" +"This is the preferred way to create Futures in asyncio. This lets third-" +"party event loops provide alternative implementations of the Future object " +"(with better performance or instrumentation)." +msgstr "" +"Це найкращий спосіб створення ф’ючерсів в асинхронному режимі. Це дозволяє " +"стороннім циклам подій надавати альтернативні реалізації об’єкта Future (з " +"кращою продуктивністю або інструментарієм)." + +msgid "" +"Schedule the execution of :ref:`coroutine ` *coro*. Return a :" +"class:`Task` object." +msgstr "" + +msgid "" +"Third-party event loops can use their own subclass of :class:`Task` for " +"interoperability. In this case, the result type is a subclass of :class:" +"`Task`." +msgstr "" +"Сторонні цикли подій можуть використовувати власний підклас :class:`Task` " +"для взаємодії. У цьому випадку тип результату є підкласом :class:`Task`." + +msgid "" +"If the *name* argument is provided and not ``None``, it is set as the name " +"of the task using :meth:`Task.set_name`." +msgstr "" +"Якщо вказано аргумент *name*, а не ``None``, він встановлюється як назва " +"завдання за допомогою :meth:`Task.set_name`." + +msgid "" +"An optional keyword-only *context* argument allows specifying a custom :" +"class:`contextvars.Context` for the *coro* to run in. The current context " +"copy is created when no *context* is provided." +msgstr "" + +msgid "Added the *name* parameter." +msgstr "Додано параметр *name*." + +msgid "Added the *context* parameter." +msgstr "" + +msgid "Set a task factory that will be used by :meth:`loop.create_task`." +msgstr "" +"Встановіть фабрику завдань, яка використовуватиметься :meth:`loop." +"create_task`." + +msgid "" +"If *factory* is ``None`` the default task factory will be set. Otherwise, " +"*factory* must be a *callable* with the signature matching ``(loop, coro, " +"**kwargs)``, where *loop* is a reference to the active event loop, and " +"*coro* is a coroutine object. The callable must pass on all *kwargs*, and " +"return a :class:`asyncio.Task`-compatible object." +msgstr "" + +msgid "Return a task factory or ``None`` if the default one is in use." +msgstr "Повертає фабрику завдань або ``None``, якщо використовується типова." + +msgid "Opening network connections" +msgstr "Відкриття мережевих підключень" + +msgid "" +"Open a streaming transport connection to a given address specified by *host* " +"and *port*." +msgstr "" +"Відкрийте потокове транспортне з’єднання за вказаною адресою, указаною " +"*host* і *port*." + +msgid "" +"The socket family can be either :py:const:`~socket.AF_INET` or :py:const:" +"`~socket.AF_INET6` depending on *host* (or the *family* argument, if " +"provided)." +msgstr "" + +msgid "The socket type will be :py:const:`~socket.SOCK_STREAM`." +msgstr "" + +msgid "" +"*protocol_factory* must be a callable returning an :ref:`asyncio protocol " +"` implementation." +msgstr "" +"*protocol_factory* має бути викликом, що повертає реалізацію :ref:`asyncio " +"protocol `." + +msgid "" +"This method will try to establish the connection in the background. When " +"successful, it returns a ``(transport, protocol)`` pair." +msgstr "" +"Цей метод намагатиметься встановити з’єднання у фоновому режимі. У разі " +"успіху він повертає пару ``(транспорт, протокол)``." + +msgid "The chronological synopsis of the underlying operation is as follows:" +msgstr "Хронологічний синопсис основної операції такий:" + +msgid "" +"The connection is established and a :ref:`transport ` is " +"created for it." +msgstr "" +"З’єднання встановлюється та для нього створюється :ref:`транспорт `." + +msgid "" +"*protocol_factory* is called without arguments and is expected to return a :" +"ref:`protocol ` instance." +msgstr "" +"*protocol_factory* викликається без аргументів і має повернути екземпляр :" +"ref:`protocol `." + +msgid "" +"The protocol instance is coupled with the transport by calling its :meth:" +"`~BaseProtocol.connection_made` method." +msgstr "" +"Екземпляр протоколу з’єднується з транспортом шляхом виклику його методу :" +"meth:`~BaseProtocol.connection_made`." + +msgid "A ``(transport, protocol)`` tuple is returned on success." +msgstr "Кортеж ``(транспорт, протокол)`` повертається в разі успіху." + +msgid "" +"The created transport is an implementation-dependent bidirectional stream." +msgstr "" +"Створений транспорт є двонаправленим потоком, що залежить від реалізації." + +msgid "Other arguments:" +msgstr "Інші аргументи:" + +msgid "" +"*ssl*: if given and not false, a SSL/TLS transport is created (by default a " +"plain TCP transport is created). If *ssl* is a :class:`ssl.SSLContext` " +"object, this context is used to create the transport; if *ssl* is :const:" +"`True`, a default context returned from :func:`ssl.create_default_context` " +"is used." +msgstr "" +"*ssl*: якщо задано і не має значення false, створюється транспорт SSL/TLS " +"(за замовчуванням створюється звичайний транспорт TCP). Якщо *ssl* є " +"об’єктом :class:`ssl.SSLContext`, цей контекст використовується для " +"створення транспорту; якщо *ssl* має значення :const:`True`, " +"використовується контекст за замовчуванням, який повертається з :func:`ssl." +"create_default_context`." + +msgid ":ref:`SSL/TLS security considerations `" +msgstr ":ref:`Заходи безпеки SSL/TLS `" + +msgid "" +"*server_hostname* sets or overrides the hostname that the target server's " +"certificate will be matched against. Should only be passed if *ssl* is not " +"``None``. By default the value of the *host* argument is used. If *host* " +"is empty, there is no default and you must pass a value for " +"*server_hostname*. If *server_hostname* is an empty string, hostname " +"matching is disabled (which is a serious security risk, allowing for " +"potential man-in-the-middle attacks)." +msgstr "" +"*server_hostname* встановлює або замінює ім’я хоста, з яким буде " +"зіставлятися сертифікат цільового сервера. Слід передавати лише якщо *ssl* " +"не є ``None``. За замовчуванням використовується значення аргументу *host*. " +"Якщо *host* порожній, за умовчанням немає, і ви повинні передати значення " +"*server_hostname*. Якщо *server_hostname* є порожнім рядком, збіг імен " +"хостів вимкнено (що є серйозною загрозою безпеці, уможливлюючи потенційні " +"атаки типу \"людина посередині\")." + +msgid "" +"*family*, *proto*, *flags* are the optional address family, protocol and " +"flags to be passed through to getaddrinfo() for *host* resolution. If given, " +"these should all be integers from the corresponding :mod:`socket` module " +"constants." +msgstr "" +"*family*, *proto*, *flags* — це необов’язкове сімейство адрес, протокол і " +"прапорці, які передаються до getaddrinfo() для вирішення *host*. Якщо " +"задано, усі вони мають бути цілими числами з відповідних констант модуля :" +"mod:`socket`." + +msgid "" +"*happy_eyeballs_delay*, if given, enables Happy Eyeballs for this " +"connection. It should be a floating-point number representing the amount of " +"time in seconds to wait for a connection attempt to complete, before " +"starting the next attempt in parallel. This is the \"Connection Attempt " +"Delay\" as defined in :rfc:`8305`. A sensible default value recommended by " +"the RFC is ``0.25`` (250 milliseconds)." +msgstr "" +"*happy_eyeballs_delay*, якщо задано, увімкне Happy Eyeballs для цього " +"підключення. Це має бути число з плаваючою комою, яке представляє кількість " +"часу в секундах, протягом якого потрібно очікувати завершення спроби " +"з’єднання перед початком наступної паралельної спроби. Це \"Затримка спроби " +"підключення\", як визначено в :rfc:`8305`. Розумним стандартним значенням, " +"рекомендованим RFC, є ``0,25`` (250 мілісекунд)." + +msgid "" +"*interleave* controls address reordering when a host name resolves to " +"multiple IP addresses. If ``0`` or unspecified, no reordering is done, and " +"addresses are tried in the order returned by :meth:`getaddrinfo`. If a " +"positive integer is specified, the addresses are interleaved by address " +"family, and the given integer is interpreted as \"First Address Family " +"Count\" as defined in :rfc:`8305`. The default is ``0`` if " +"*happy_eyeballs_delay* is not specified, and ``1`` if it is." +msgstr "" +"*interleave* контролює перевпорядкування адрес, коли ім’я хоста " +"перетворюється на декілька IP-адрес. Якщо ``0`` або не вказано, зміна " +"порядку не виконується, а адреси пробуються в порядку, який повертає :meth:" +"`getaddrinfo`. Якщо вказано додатне ціле число, адреси чергуються за " +"сімейством адрес, і задане ціле число інтерпретується як \"Перша кількість " +"сімейства адрес\", як визначено в :rfc:`8305`. Типовим значенням є ``0``, " +"якщо *happy_eyeballs_delay* не вказано, і ``1``, якщо так." + +msgid "" +"*sock*, if given, should be an existing, already connected :class:`socket." +"socket` object to be used by the transport. If *sock* is given, none of " +"*host*, *port*, *family*, *proto*, *flags*, *happy_eyeballs_delay*, " +"*interleave* and *local_addr* should be specified." +msgstr "" +"*sock*, якщо його надано, має бути існуючим, уже підключеним :class:`socket." +"socket` об’єктом, який буде використовуватися транспортом. Якщо вказано " +"*sock*, жоден з *host*, *port*, *family*, *proto*, *flags*, " +"*happy_eyeballs_delay*, *interleave* і *local_addr* не повинен бути вказаний." + +msgid "" +"The *sock* argument transfers ownership of the socket to the transport " +"created. To close the socket, call the transport's :meth:`~asyncio." +"BaseTransport.close` method." +msgstr "" + +msgid "" +"*local_addr*, if given, is a ``(local_host, local_port)`` tuple used to bind " +"the socket locally. The *local_host* and *local_port* are looked up using " +"``getaddrinfo()``, similarly to *host* and *port*." +msgstr "" +"*local_addr*, якщо вказано, це кортеж ``(local_host, local_port)``, який " +"використовується для локального зв’язування сокета. *local_host* і " +"*local_port* шукаються за допомогою ``getaddrinfo()``, подібно до *host* і " +"*port*." + +msgid "" +"*ssl_handshake_timeout* is (for a TLS connection) the time in seconds to " +"wait for the TLS handshake to complete before aborting the connection. " +"``60.0`` seconds if ``None`` (default)." +msgstr "" +"*ssl_handshake_timeout* — це (для з’єднання TLS) час у секундах очікування " +"завершення рукостискання TLS перед перериванням з’єднання. ``60.0`` секунд, " +"якщо ``None`` (за замовчуванням)." + +msgid "" +"*ssl_shutdown_timeout* is the time in seconds to wait for the SSL shutdown " +"to complete before aborting the connection. ``30.0`` seconds if ``None`` " +"(default)." +msgstr "" + +msgid "" +"*all_errors* determines what exceptions are raised when a connection cannot " +"be created. By default, only a single ``Exception`` is raised: the first " +"exception if there is only one or all errors have same message, or a single " +"``OSError`` with the error messages combined. When ``all_errors`` is " +"``True``, an ``ExceptionGroup`` will be raised containing all exceptions " +"(even if there is only one)." +msgstr "" + +msgid "Added support for SSL/TLS in :class:`ProactorEventLoop`." +msgstr "Додано підтримку SSL/TLS у :class:`ProactorEventLoop`." + +msgid "" +"The socket option :ref:`socket.TCP_NODELAY ` is set " +"by default for all TCP connections." +msgstr "" + +msgid "Added the *ssl_handshake_timeout* parameter." +msgstr "Додано параметр *ssl_handshake_timeout*." + +msgid "Added the *happy_eyeballs_delay* and *interleave* parameters." +msgstr "Додано параметри *happy_eyeballs_delay* і *interleave*." + +msgid "" +"Happy Eyeballs Algorithm: Success with Dual-Stack Hosts. When a server's " +"IPv4 path and protocol are working, but the server's IPv6 path and protocol " +"are not working, a dual-stack client application experiences significant " +"connection delay compared to an IPv4-only client. This is undesirable " +"because it causes the dual-stack client to have a worse user experience. " +"This document specifies requirements for algorithms that reduce this user-" +"visible delay and provides an algorithm." +msgstr "" + +msgid "For more information: https://datatracker.ietf.org/doc/html/rfc6555" +msgstr "" + +msgid "Added the *ssl_shutdown_timeout* parameter." +msgstr "" + +msgid "*all_errors* was added." +msgstr "" + +msgid "" +"The :func:`open_connection` function is a high-level alternative API. It " +"returns a pair of (:class:`StreamReader`, :class:`StreamWriter`) that can be " +"used directly in async/await code." +msgstr "" +"Функція :func:`open_connection` є альтернативним API високого рівня. Він " +"повертає пару (:class:`StreamReader`, :class:`StreamWriter`), яку можна " +"використовувати безпосередньо в коді async/await." + +msgid "Create a datagram connection." +msgstr "Створіть з'єднання дейтаграми." + +msgid "" +"The socket family can be either :py:const:`~socket.AF_INET`, :py:const:" +"`~socket.AF_INET6`, or :py:const:`~socket.AF_UNIX`, depending on *host* (or " +"the *family* argument, if provided)." +msgstr "" + +msgid "The socket type will be :py:const:`~socket.SOCK_DGRAM`." +msgstr "" + +msgid "" +"*protocol_factory* must be a callable returning a :ref:`protocol ` implementation." +msgstr "" +"*protocol_factory* має бути викликом, що повертає реалізацію :ref:`protocol " +"`." + +msgid "A tuple of ``(transport, protocol)`` is returned on success." +msgstr "Кортеж ``(транспорт, протокол)`` повертається в разі успіху." + +msgid "" +"*local_addr*, if given, is a ``(local_host, local_port)`` tuple used to bind " +"the socket locally. The *local_host* and *local_port* are looked up using :" +"meth:`getaddrinfo`." +msgstr "" +"*local_addr*, якщо вказано, це кортеж ``(local_host, local_port)``, який " +"використовується для локального зв’язування сокета. *local_host* і " +"*local_port* шукаються за допомогою :meth:`getaddrinfo`." + +msgid "" +"*remote_addr*, if given, is a ``(remote_host, remote_port)`` tuple used to " +"connect the socket to a remote address. The *remote_host* and *remote_port* " +"are looked up using :meth:`getaddrinfo`." +msgstr "" +"*remote_addr*, якщо вказано, це кортеж ``(remote_host, remote_port)``, який " +"використовується для підключення сокета до віддаленої адреси. *remote_host* " +"і *remote_port* шукаються за допомогою :meth:`getaddrinfo`." + +msgid "" +"*family*, *proto*, *flags* are the optional address family, protocol and " +"flags to be passed through to :meth:`getaddrinfo` for *host* resolution. If " +"given, these should all be integers from the corresponding :mod:`socket` " +"module constants." +msgstr "" +"*family*, *proto*, *flags* – це необов’язкове сімейство адрес, протокол і " +"прапори, які передаються до :meth:`getaddrinfo` для вирішення *host*. Якщо " +"задано, усі вони мають бути цілими числами з відповідних констант модуля :" +"mod:`socket`." + +msgid "" +"*reuse_port* tells the kernel to allow this endpoint to be bound to the same " +"port as other existing endpoints are bound to, so long as they all set this " +"flag when being created. This option is not supported on Windows and some " +"Unixes. If the :ref:`socket.SO_REUSEPORT ` constant " +"is not defined then this capability is unsupported." +msgstr "" + +msgid "" +"*allow_broadcast* tells the kernel to allow this endpoint to send messages " +"to the broadcast address." +msgstr "" +"*allow_broadcast* повідомляє ядру дозволити цій кінцевій точці надсилати " +"повідомлення на широкомовну адресу." + +msgid "" +"*sock* can optionally be specified in order to use a preexisting, already " +"connected, :class:`socket.socket` object to be used by the transport. If " +"specified, *local_addr* and *remote_addr* should be omitted (must be :const:" +"`None`)." +msgstr "" +"Опціонально можна вказати *sock*, щоб використовувати існуючий, уже " +"підключений об’єкт :class:`socket.socket`, який буде використовуватися " +"транспортом. Якщо вказано, *local_addr* і *remote_addr* слід опустити (має " +"бути :const:`None`)." + +msgid "" +"See :ref:`UDP echo client protocol ` and :" +"ref:`UDP echo server protocol ` examples." +msgstr "" +"Перегляньте приклади :ref:`UDP echo client protocol ` і :ref:`UDP echo server protocol ` прикладів." + +msgid "" +"The *family*, *proto*, *flags*, *reuse_address*, *reuse_port*, " +"*allow_broadcast*, and *sock* parameters were added." +msgstr "" + +msgid "Added support for Windows." +msgstr "Додана підтримка Windows." + +msgid "" +"The *reuse_address* parameter is no longer supported, as using :ref:`socket." +"SO_REUSEADDR ` poses a significant security concern " +"for UDP. Explicitly passing ``reuse_address=True`` will raise an exception." +msgstr "" + +msgid "" +"When multiple processes with differing UIDs assign sockets to an identical " +"UDP socket address with ``SO_REUSEADDR``, incoming packets can become " +"randomly distributed among the sockets." +msgstr "" +"Коли кілька процесів з різними UID призначають сокети ідентичній адресі " +"сокета UDP за допомогою ``SO_REUSEADDR``, вхідні пакети можуть розподілятися " +"між сокетами випадковим чином." + +msgid "" +"For supported platforms, *reuse_port* can be used as a replacement for " +"similar functionality. With *reuse_port*, :ref:`socket.SO_REUSEPORT ` is used instead, which specifically prevents processes with " +"differing UIDs from assigning sockets to the same socket address." +msgstr "" + +msgid "" +"The *reuse_address* parameter, disabled since Python 3.8.1, 3.7.6 and " +"3.6.10, has been entirely removed." +msgstr "" + +msgid "Create a Unix connection." +msgstr "Створіть підключення Unix." + +msgid "" +"The socket family will be :py:const:`~socket.AF_UNIX`; socket type will be :" +"py:const:`~socket.SOCK_STREAM`." +msgstr "" + +msgid "" +"*path* is the name of a Unix domain socket and is required, unless a *sock* " +"parameter is specified. Abstract Unix sockets, :class:`str`, :class:" +"`bytes`, and :class:`~pathlib.Path` paths are supported." +msgstr "" +"*path* — це ім’я сокета домену Unix і є обов’язковим, якщо не вказано " +"параметр *sock*. Підтримуються абстрактні сокети Unix, шляхи :class:`str`, :" +"class:`bytes` і :class:`~pathlib.Path`." + +msgid "" +"See the documentation of the :meth:`loop.create_connection` method for " +"information about arguments to this method." +msgstr "" +"Перегляньте документацію методу :meth:`loop.create_connection`, щоб отримати " +"інформацію про аргументи цього методу." + +msgid "Availability" +msgstr "" + +msgid "" +"Added the *ssl_handshake_timeout* parameter. The *path* parameter can now be " +"a :term:`path-like object`." +msgstr "" +"Додано параметр *ssl_handshake_timeout*. Параметр *path* тепер може бути :" +"term:`path-like object`." + +msgid "Creating network servers" +msgstr "Створення мережевих серверів" + +msgid "" +"Create a TCP server (socket type :const:`~socket.SOCK_STREAM`) listening on " +"*port* of the *host* address." +msgstr "" + +msgid "Returns a :class:`Server` object." +msgstr "Повертає об’єкт :class:`Server`." + +msgid "Arguments:" +msgstr "Аргументи:" + +msgid "" +"The *host* parameter can be set to several types which determine where the " +"server would be listening:" +msgstr "" +"Для параметра *host* можна встановити кілька типів, які визначають, де " +"сервер буде слухати:" + +msgid "" +"If *host* is a string, the TCP server is bound to a single network interface " +"specified by *host*." +msgstr "" +"Якщо *host* є рядком, сервер TCP прив’язаний до єдиного мережевого " +"інтерфейсу, визначеного *host*." + +msgid "" +"If *host* is a sequence of strings, the TCP server is bound to all network " +"interfaces specified by the sequence." +msgstr "" +"Якщо *host* є послідовністю рядків, TCP-сервер прив’язаний до всіх мережевих " +"інтерфейсів, визначених цією послідовністю." + +msgid "" +"If *host* is an empty string or ``None``, all interfaces are assumed and a " +"list of multiple sockets will be returned (most likely one for IPv4 and " +"another one for IPv6)." +msgstr "" +"Якщо *host* є порожнім рядком або ``None``, усі інтерфейси передбачаються, і " +"буде повернено список кількох сокетів (швидше за все, один для IPv4 та інший " +"для IPv6)." + +msgid "" +"The *port* parameter can be set to specify which port the server should " +"listen on. If ``0`` or ``None`` (the default), a random unused port will be " +"selected (note that if *host* resolves to multiple network interfaces, a " +"different random port will be selected for each interface)." +msgstr "" +"Параметр *port* можна встановити, щоб вказати, який порт сервер повинен " +"слухати. Якщо ``0`` або ``None`` (за замовчуванням), буде вибрано випадковий " +"невикористаний порт (зауважте, що якщо *host* розпізнає кілька мережевих " +"інтерфейсів, для кожного інтерфейсу буде вибрано окремий випадковий порт)." + +msgid "" +"*family* can be set to either :const:`socket.AF_INET` or :const:`~socket." +"AF_INET6` to force the socket to use IPv4 or IPv6. If not set, the *family* " +"will be determined from host name (defaults to :const:`~socket.AF_UNSPEC`)." +msgstr "" + +msgid "*flags* is a bitmask for :meth:`getaddrinfo`." +msgstr "*flags* — це бітова маска для :meth:`getaddrinfo`." + +msgid "" +"*sock* can optionally be specified in order to use a preexisting socket " +"object. If specified, *host* and *port* must not be specified." +msgstr "" +"За бажанням можна вказати *sock*, щоб використовувати вже існуючий об’єкт " +"socket. Якщо вказано, *host* і *port* не повинні вказуватися." + +msgid "" +"The *sock* argument transfers ownership of the socket to the server created. " +"To close the socket, call the server's :meth:`~asyncio.Server.close` method." +msgstr "" + +msgid "" +"*backlog* is the maximum number of queued connections passed to :meth:" +"`~socket.socket.listen` (defaults to 100)." +msgstr "" +"*backlog* — це максимальна кількість підключень у черзі, переданих до :meth:" +"`~socket.socket.listen` (за замовчуванням 100)." + +msgid "" +"*ssl* can be set to an :class:`~ssl.SSLContext` instance to enable TLS over " +"the accepted connections." +msgstr "" +"*ssl* можна встановити як екземпляр :class:`~ssl.SSLContext`, щоб увімкнути " +"TLS через прийнятні з’єднання." + +msgid "" +"*reuse_address* tells the kernel to reuse a local socket in ``TIME_WAIT`` " +"state, without waiting for its natural timeout to expire. If not specified " +"will automatically be set to ``True`` on Unix." +msgstr "" +"*reuse_address* повідомляє ядру повторно використовувати локальний сокет у " +"стані ``TIME_WAIT``, не чекаючи закінчення його природного часу очікування. " +"Якщо не вказано, для Unix буде автоматично встановлено значення ``True``." + +msgid "" +"*reuse_port* tells the kernel to allow this endpoint to be bound to the same " +"port as other existing endpoints are bound to, so long as they all set this " +"flag when being created. This option is not supported on Windows." +msgstr "" +"*reuse_port* повідомляє ядру дозволити цю кінцеву точку прив’язувати до того " +"самого порту, до якого прив’язані інші існуючі кінцеві точки, за умови, що " +"всі вони встановлюють цей прапор під час створення. Цей параметр не " +"підтримується в Windows." + +msgid "" +"*keep_alive* set to ``True`` keeps connections active by enabling the " +"periodic transmission of messages." +msgstr "" + +msgid "Added the *keep_alive* parameter." +msgstr "" + +msgid "" +"*ssl_handshake_timeout* is (for a TLS server) the time in seconds to wait " +"for the TLS handshake to complete before aborting the connection. ``60.0`` " +"seconds if ``None`` (default)." +msgstr "" +"*ssl_handshake_timeout* — це (для TLS-сервера) час у секундах очікування " +"завершення рукостискання TLS перед розривом з’єднання. ``60.0`` секунд, якщо " +"``None`` (за замовчуванням)." + +msgid "" +"*start_serving* set to ``True`` (the default) causes the created server to " +"start accepting connections immediately. When set to ``False``, the user " +"should await on :meth:`Server.start_serving` or :meth:`Server.serve_forever` " +"to make the server to start accepting connections." +msgstr "" +"*start_serving* встановлений на ``True`` (за замовчуванням), змушує " +"створений сервер негайно приймати підключення. Якщо встановлено значення " +"``False``, користувач повинен чекати :meth:`Server.start_serving` або :meth:" +"`Server.serve_forever`, щоб змусити сервер почати приймати з’єднання." + +msgid "The *host* parameter can be a sequence of strings." +msgstr "Параметр *host* може бути послідовністю рядків." + +msgid "" +"Added *ssl_handshake_timeout* and *start_serving* parameters. The socket " +"option :ref:`socket.TCP_NODELAY ` is set by default " +"for all TCP connections." +msgstr "" + +msgid "" +"The :func:`start_server` function is a higher-level alternative API that " +"returns a pair of :class:`StreamReader` and :class:`StreamWriter` that can " +"be used in an async/await code." +msgstr "" +"Функція :func:`start_server` — це альтернативний API вищого рівня, який " +"повертає пару :class:`StreamReader` і :class:`StreamWriter`, які можна " +"використовувати в коді async/await." + +msgid "" +"Similar to :meth:`loop.create_server` but works with the :py:const:`~socket." +"AF_UNIX` socket family." +msgstr "" + +msgid "" +"*path* is the name of a Unix domain socket, and is required, unless a *sock* " +"argument is provided. Abstract Unix sockets, :class:`str`, :class:`bytes`, " +"and :class:`~pathlib.Path` paths are supported." +msgstr "" +"*path* — це ім’я сокета домену Unix і є обов’язковим, якщо не надано " +"аргумент *sock*. Підтримуються абстрактні сокети Unix, шляхи :class:`str`, :" +"class:`bytes` і :class:`~pathlib.Path`." + +msgid "" +"If *cleanup_socket* is true then the Unix socket will automatically be " +"removed from the filesystem when the server is closed, unless the socket has " +"been replaced after the server has been created." +msgstr "" + +msgid "" +"See the documentation of the :meth:`loop.create_server` method for " +"information about arguments to this method." +msgstr "" +"Перегляньте документацію методу :meth:`loop.create_server` для отримання " +"інформації про аргументи цього методу." + +msgid "" +"Added the *ssl_handshake_timeout* and *start_serving* parameters. The *path* " +"parameter can now be a :class:`~pathlib.Path` object." +msgstr "" +"Додано параметри *ssl_handshake_timeout* і *start_serving*. Параметр *path* " +"тепер може бути об’єктом :class:`~pathlib.Path`." + +msgid "Added the *cleanup_socket* parameter." +msgstr "" + +msgid "Wrap an already accepted connection into a transport/protocol pair." +msgstr "Оберніть уже прийняте підключення до пари транспорт/протокол." + +msgid "" +"This method can be used by servers that accept connections outside of " +"asyncio but that use asyncio to handle them." +msgstr "" +"Цей метод може використовуватися серверами, які приймають з’єднання за " +"межами asyncio, але використовують asyncio для їх обробки." + +msgid "Parameters:" +msgstr "Параметри:" + +msgid "" +"*sock* is a preexisting socket object returned from :meth:`socket.accept " +"`." +msgstr "" +"*sock* — це вже існуючий об’єкт сокета, який повертається з :meth:`socket." +"accept `." + +msgid "" +"*ssl* can be set to an :class:`~ssl.SSLContext` to enable SSL over the " +"accepted connections." +msgstr "" +"*ssl* можна встановити як :class:`~ssl.SSLContext`, щоб увімкнути SSL через " +"прийнятні з’єднання." + +msgid "" +"*ssl_handshake_timeout* is (for an SSL connection) the time in seconds to " +"wait for the SSL handshake to complete before aborting the connection. " +"``60.0`` seconds if ``None`` (default)." +msgstr "" +"*ssl_handshake_timeout* — це (для з’єднання SSL) час у секундах очікування " +"завершення рукостискання SSL перед розривом з’єднання. ``60.0`` секунд, якщо " +"``None`` (за замовчуванням)." + +msgid "Returns a ``(transport, protocol)`` pair." +msgstr "Повертає пару ``(транспорт, протокол)``." + +msgid "Transferring files" +msgstr "Передача файлів" + +msgid "" +"Send a *file* over a *transport*. Return the total number of bytes sent." +msgstr "" +"Надіслати *файл* через *транспорт*. Повертає загальну кількість надісланих " +"байтів." + +msgid "The method uses high-performance :meth:`os.sendfile` if available." +msgstr "" +"Метод використовує високопродуктивний :meth:`os.sendfile`, якщо він " +"доступний." + +msgid "*file* must be a regular file object opened in binary mode." +msgstr "" +"*file* має бути звичайним файловим об’єктом, відкритим у двійковому режимі." + +msgid "" +"*offset* tells from where to start reading the file. If specified, *count* " +"is the total number of bytes to transmit as opposed to sending the file " +"until EOF is reached. File position is always updated, even when this method " +"raises an error, and :meth:`file.tell() ` can be used to " +"obtain the actual number of bytes sent." +msgstr "" +"*offset* вказує, звідки почати читання файлу. Якщо вказано, *count* — це " +"загальна кількість байтів для передачі, а не надсилання файлу до досягнення " +"EOF. Позиція файлу завжди оновлюється, навіть якщо цей метод викликає " +"помилку, і :meth:`file.tell() ` можна використовувати для " +"отримання фактичної кількості надісланих байтів." + +msgid "" +"*fallback* set to ``True`` makes asyncio to manually read and send the file " +"when the platform does not support the sendfile system call (e.g. Windows or " +"SSL socket on Unix)." +msgstr "" +"*fallback* встановлений на ``True`` робить asyncio для ручного читання та " +"надсилання файлу, коли платформа не підтримує системний виклик sendfile " +"(наприклад, Windows або SSL-сокет на Unix)." + +msgid "" +"Raise :exc:`SendfileNotAvailableError` if the system does not support the " +"*sendfile* syscall and *fallback* is ``False``." +msgstr "" +"Викликати :exc:`SendfileNotAvailableError`, якщо система не підтримує " +"системний виклик *sendfile* і *fallback* має значення ``False``." + +msgid "TLS Upgrade" +msgstr "Оновлення TLS" + +msgid "Upgrade an existing transport-based connection to TLS." +msgstr "Оновіть існуюче транспортне підключення до TLS." + +msgid "" +"Create a TLS coder/decoder instance and insert it between the *transport* " +"and the *protocol*. The coder/decoder implements both *transport*-facing " +"protocol and *protocol*-facing transport." +msgstr "" + +msgid "" +"Return the created two-interface instance. After *await*, the *protocol* " +"must stop using the original *transport* and communicate with the returned " +"object only because the coder caches *protocol*-side data and sporadically " +"exchanges extra TLS session packets with *transport*." +msgstr "" + +msgid "" +"In some situations (e.g. when the passed transport is already closing) this " +"may return ``None``." +msgstr "" + +msgid "" +"*transport* and *protocol* instances that methods like :meth:`~loop." +"create_server` and :meth:`~loop.create_connection` return." +msgstr "" +"екземпляри *transport* і *protocol*, які повертають такі методи, як :meth:" +"`~loop.create_server` і :meth:`~loop.create_connection`." + +msgid "*sslcontext*: a configured instance of :class:`~ssl.SSLContext`." +msgstr "*sslcontext*: налаштований екземпляр :class:`~ssl.SSLContext`." + +msgid "" +"*server_side* pass ``True`` when a server-side connection is being upgraded " +"(like the one created by :meth:`~loop.create_server`)." +msgstr "" +"*server_side* передає ``True``, коли з’єднання на стороні сервера " +"оновлюється (наприклад, створене :meth:`~loop.create_server`)." + +msgid "" +"*server_hostname*: sets or overrides the host name that the target server's " +"certificate will be matched against." +msgstr "" +"*server_hostname*: встановлює або замінює ім’я хоста, з яким буде " +"зіставлятися сертифікат цільового сервера." + +msgid "Watching file descriptors" +msgstr "Перегляд дескрипторів файлів" + +msgid "" +"Start monitoring the *fd* file descriptor for read availability and invoke " +"*callback* with the specified arguments once *fd* is available for reading." +msgstr "" +"Розпочніть моніторинг дескриптора файлу *fd* на доступність читання та " +"викличте *callback* із зазначеними аргументами, коли *fd* стане доступним " +"для читання." + +msgid "" +"Any preexisting callback registered for *fd* is cancelled and replaced by " +"*callback*." +msgstr "" + +msgid "" +"Stop monitoring the *fd* file descriptor for read availability. Returns " +"``True`` if *fd* was previously being monitored for reads." +msgstr "" + +msgid "" +"Start monitoring the *fd* file descriptor for write availability and invoke " +"*callback* with the specified arguments once *fd* is available for writing." +msgstr "" +"Розпочніть моніторинг дескриптора файлу *fd* на доступність запису та " +"викличте *callback* із зазначеними аргументами, коли *fd* стане доступним " +"для запису." + +msgid "" +"Use :func:`functools.partial` :ref:`to pass keyword arguments ` to *callback*." +msgstr "" +"Використовуйте :func:`functools.partial` :ref:`, щоб передати аргументи " +"ключового слова ` в *callback*." + +msgid "" +"Stop monitoring the *fd* file descriptor for write availability. Returns " +"``True`` if *fd* was previously being monitored for writes." +msgstr "" + +msgid "" +"See also :ref:`Platform Support ` section for some " +"limitations of these methods." +msgstr "" +"Перегляньте також розділ :ref:`Підтримка платформи `, щоб дізнатися про деякі обмеження цих методів." + +msgid "Working with socket objects directly" +msgstr "Безпосередня робота з об'єктами сокетів" + +msgid "" +"In general, protocol implementations that use transport-based APIs such as :" +"meth:`loop.create_connection` and :meth:`loop.create_server` are faster than " +"implementations that work with sockets directly. However, there are some use " +"cases when performance is not critical, and working with :class:`~socket." +"socket` objects directly is more convenient." +msgstr "" +"Загалом, реалізації протоколів, які використовують API на основі транспорту, " +"такі як :meth:`loop.create_connection` і :meth:`loop.create_server`, є " +"швидшими, ніж реалізації, які працюють безпосередньо з сокетами. Однак є " +"деякі випадки використання, коли продуктивність не є критичною, і працювати " +"з об’єктами :class:`~socket.socket` напряму зручніше." + +msgid "" +"Receive up to *nbytes* from *sock*. Asynchronous version of :meth:`socket." +"recv() `." +msgstr "" +"Отримайте до *nbytes* від *sock*. Асинхронна версія :meth:`socket.recv() " +"`." + +msgid "Return the received data as a bytes object." +msgstr "Повернути отримані дані як об’єкт bytes." + +msgid "*sock* must be a non-blocking socket." +msgstr "*sock* має бути неблокуючим сокетом." + +msgid "" +"Even though this method was always documented as a coroutine method, " +"releases before Python 3.7 returned a :class:`Future`. Since Python 3.7 this " +"is an ``async def`` method." +msgstr "" +"Незважаючи на те, що цей метод завжди документувався як метод співпрограми, " +"випуски до Python 3.7 повертали :class:`Future`. Починаючи з Python 3.7, це " +"метод ``async def``." + +msgid "" +"Receive data from *sock* into the *buf* buffer. Modeled after the blocking :" +"meth:`socket.recv_into() ` method." +msgstr "" +"Отримувати дані з *sock* в буфер *buf*. Створено за методом блокування :meth:" +"`socket.recv_into() `." + +msgid "Return the number of bytes written to the buffer." +msgstr "Повертає кількість байтів, записаних у буфер." + +msgid "" +"Receive a datagram of up to *bufsize* from *sock*. Asynchronous version of :" +"meth:`socket.recvfrom() `." +msgstr "" + +msgid "Return a tuple of (received data, remote address)." +msgstr "" + +msgid "" +"Receive a datagram of up to *nbytes* from *sock* into *buf*. Asynchronous " +"version of :meth:`socket.recvfrom_into() `." +msgstr "" + +msgid "Return a tuple of (number of bytes received, remote address)." +msgstr "" + +msgid "" +"Send *data* to the *sock* socket. Asynchronous version of :meth:`socket." +"sendall() `." +msgstr "" +"Надішліть *дані* в сокет *sock*. Асинхронна версія :meth:`socket.sendall() " +"`." + +msgid "" +"This method continues to send to the socket until either all data in *data* " +"has been sent or an error occurs. ``None`` is returned on success. On " +"error, an exception is raised. Additionally, there is no way to determine " +"how much data, if any, was successfully processed by the receiving end of " +"the connection." +msgstr "" +"Цей метод продовжує надсилати дані в сокет, доки не буде надіслано всі дані " +"в *data* або не станеться помилка. ``None`` повертається в разі успіху. У " +"разі помилки виникає виняток. Крім того, немає способу визначити, скільки " +"даних, якщо такі були, було успішно оброблено приймальною стороною з’єднання." + +msgid "" +"Even though the method was always documented as a coroutine method, before " +"Python 3.7 it returned a :class:`Future`. Since Python 3.7, this is an " +"``async def`` method." +msgstr "" +"Незважаючи на те, що метод завжди документувався як метод співпрограми, до " +"Python 3.7 він повертав :class:`Future`. Починаючи з Python 3.7, це метод " +"``async def``." + +msgid "" +"Send a datagram from *sock* to *address*. Asynchronous version of :meth:" +"`socket.sendto() `." +msgstr "" + +msgid "Return the number of bytes sent." +msgstr "" + +msgid "Connect *sock* to a remote socket at *address*." +msgstr "Підключіть *sock* до віддаленої розетки за *адресою*." + +msgid "" +"Asynchronous version of :meth:`socket.connect() `." +msgstr "Асинхронна версія :meth:`socket.connect() `." + +msgid "" +"``address`` no longer needs to be resolved. ``sock_connect`` will try to " +"check if the *address* is already resolved by calling :func:`socket." +"inet_pton`. If not, :meth:`loop.getaddrinfo` will be used to resolve the " +"*address*." +msgstr "" +"``address`` більше не потребує вирішення. ``sock_connect`` спробує " +"перевірити, чи *адреса* вже дозволена, викликавши :func:`socket.inet_pton`. " +"Якщо ні, :meth:`loop.getaddrinfo` буде використано для визначення *адреси*." + +msgid "" +":meth:`loop.create_connection` and :func:`asyncio.open_connection() " +"`." +msgstr "" +":meth:`loop.create_connection` і :func:`asyncio.open_connection() " +"`." + +msgid "" +"Accept a connection. Modeled after the blocking :meth:`socket.accept() " +"` method." +msgstr "" +"Прийняти підключення. Створено за методом блокування :meth:`socket.accept() " +"`." + +msgid "" +"The socket must be bound to an address and listening for connections. The " +"return value is a pair ``(conn, address)`` where *conn* is a *new* socket " +"object usable to send and receive data on the connection, and *address* is " +"the address bound to the socket on the other end of the connection." +msgstr "" +"Сокет має бути прив’язаний до адреси та прослуховувати підключення. " +"Поверненим значенням є пара ``(conn, address)``, де *conn* — це *новий* " +"об’єкт сокета, який можна використовувати для надсилання та отримання даних " +"під час з’єднання, а *address* — це адреса, прив’язана до сокета на іншому " +"кінець з'єднання." + +msgid ":meth:`loop.create_server` and :func:`start_server`." +msgstr ":meth:`loop.create_server` і :func:`start_server`." + +msgid "" +"Send a file using high-performance :mod:`os.sendfile` if possible. Return " +"the total number of bytes sent." +msgstr "" +"Якщо можливо, надішліть файл за допомогою високопродуктивного :mod:`os." +"sendfile`. Повертає загальну кількість надісланих байтів." + +msgid "" +"Asynchronous version of :meth:`socket.sendfile() `." +msgstr "Асинхронна версія :meth:`socket.sendfile() `." + +msgid "" +"*sock* must be a non-blocking :const:`socket.SOCK_STREAM` :class:`~socket." +"socket`." +msgstr "" +"*sock* має бути неблокуючим :const:`socket.SOCK_STREAM` :class:`~socket." +"socket`." + +msgid "*file* must be a regular file object open in binary mode." +msgstr "" +"*file* має бути звичайним файловим об’єктом, відкритим у двійковому режимі." + +msgid "" +"*fallback*, when set to ``True``, makes asyncio manually read and send the " +"file when the platform does not support the sendfile syscall (e.g. Windows " +"or SSL socket on Unix)." +msgstr "" +"*fallback*, якщо встановлено значення ``True``, змушує asyncio читати та " +"надсилати файл вручну, якщо платформа не підтримує системний виклик sendfile " +"(наприклад, Windows або сокет SSL в Unix)." + +msgid "" +"Raise :exc:`SendfileNotAvailableError` if the system does not support " +"*sendfile* syscall and *fallback* is ``False``." +msgstr "" +"Викликати :exc:`SendfileNotAvailableError`, якщо система не підтримує " +"системний виклик *sendfile* і *fallback* має значення ``False``." + +msgid "DNS" +msgstr "DNS" + +msgid "Asynchronous version of :meth:`socket.getaddrinfo`." +msgstr "Асинхронна версія :meth:`socket.getaddrinfo`." + +msgid "Asynchronous version of :meth:`socket.getnameinfo`." +msgstr "Асинхронна версія :meth:`socket.getnameinfo`." + +msgid "" +"Both *getaddrinfo* and *getnameinfo* internally utilize their synchronous " +"versions through the loop's default thread pool executor. When this executor " +"is saturated, these methods may experience delays, which higher-level " +"networking libraries may report as increased timeouts. To mitigate this, " +"consider using a custom executor for other user tasks, or setting a default " +"executor with a larger number of workers." +msgstr "" + +msgid "" +"Both *getaddrinfo* and *getnameinfo* methods were always documented to " +"return a coroutine, but prior to Python 3.7 they were, in fact, returning :" +"class:`asyncio.Future` objects. Starting with Python 3.7 both methods are " +"coroutines." +msgstr "" +"Обидва методи *getaddrinfo* і *getnameinfo* завжди були задокументовані для " +"повернення співпрограми, але до Python 3.7 вони фактично повертали об’єкти :" +"class:`asyncio.Future`. Починаючи з Python 3.7 обидва методи є " +"співпрограмами." + +msgid "Working with pipes" +msgstr "Робота з трубами" + +msgid "Register the read end of *pipe* in the event loop." +msgstr "Зареєструйте прочитаний кінець *pipe* у циклі подій." + +msgid "*pipe* is a :term:`file-like object `." +msgstr "*pipe* — це :term:`файлоподібний об’єкт `." + +msgid "" +"Return pair ``(transport, protocol)``, where *transport* supports the :class:" +"`ReadTransport` interface and *protocol* is an object instantiated by the " +"*protocol_factory*." +msgstr "" +"Повернена пара ``(транспорт, протокол)``, де *transport* підтримує " +"інтерфейс :class:`ReadTransport`, а *protocol* є об’єктом, створеним " +"*protocol_factory*." + +msgid "" +"With :class:`SelectorEventLoop` event loop, the *pipe* is set to non-" +"blocking mode." +msgstr "" +"За допомогою циклу подій :class:`SelectorEventLoop` *pipe* встановлюється в " +"неблокуючий режим." + +msgid "Register the write end of *pipe* in the event loop." +msgstr "Зареєструйте кінець запису *pipe* у циклі подій." + +msgid "*pipe* is :term:`file-like object `." +msgstr "*pipe* — це :term:`файлоподібний об’єкт `." + +msgid "" +"Return pair ``(transport, protocol)``, where *transport* supports :class:" +"`WriteTransport` interface and *protocol* is an object instantiated by the " +"*protocol_factory*." +msgstr "" +"Повернена пара ``(транспорт, протокол)``, де *transport* підтримує " +"інтерфейс :class:`WriteTransport`, а *protocol* є об’єктом, створеним " +"*protocol_factory*." + +msgid "" +":class:`SelectorEventLoop` does not support the above methods on Windows. " +"Use :class:`ProactorEventLoop` instead for Windows." +msgstr "" +":class:`SelectorEventLoop` не підтримує наведені вище методи в Windows. " +"Використовуйте :class:`ProactorEventLoop` замість цього для Windows." + +msgid "" +"The :meth:`loop.subprocess_exec` and :meth:`loop.subprocess_shell` methods." +msgstr "Методи :meth:`loop.subprocess_exec` і :meth:`loop.subprocess_shell`." + +msgid "Unix signals" +msgstr "Сигнали Unix" + +msgid "Set *callback* as the handler for the *signum* signal." +msgstr "Встановіть *callback* як обробник для сигналу *signum*." + +msgid "" +"The callback will be invoked by *loop*, along with other queued callbacks " +"and runnable coroutines of that event loop. Unlike signal handlers " +"registered using :func:`signal.signal`, a callback registered with this " +"function is allowed to interact with the event loop." +msgstr "" +"Зворотний виклик буде викликаний *циклом* разом з іншими зворотними " +"викликами в черзі та запущеними співпрограмами цього циклу подій. На відміну " +"від обробників сигналів, зареєстрованих за допомогою :func:`signal.signal`, " +"зворотній виклик, зареєстрований у цій функції, може взаємодіяти з циклом " +"подій." + +msgid "" +"Raise :exc:`ValueError` if the signal number is invalid or uncatchable. " +"Raise :exc:`RuntimeError` if there is a problem setting up the handler." +msgstr "" +"Викликайте :exc:`ValueError`, якщо номер сигналу недійсний або не " +"вловлюється. Викликати :exc:`RuntimeError`, якщо є проблема з налаштуванням " +"обробника." + +msgid "" +"Like :func:`signal.signal`, this function must be invoked in the main thread." +msgstr "" +"Подібно до :func:`signal.signal`, ця функція має бути викликана в основному " +"потоці." + +msgid "Remove the handler for the *sig* signal." +msgstr "Видаліть обробник для сигналу *sig*." + +msgid "" +"Return ``True`` if the signal handler was removed, or ``False`` if no " +"handler was set for the given signal." +msgstr "" +"Повертає ``True``, якщо обробник сигналу було видалено, або ``False``, якщо " +"обробник не встановлено для даного сигналу." + +msgid "The :mod:`signal` module." +msgstr "Модуль :mod:`signal`." + +msgid "Executing code in thread or process pools" +msgstr "Виконання коду в потоках або пулах процесів" + +msgid "Arrange for *func* to be called in the specified executor." +msgstr "Організувати виклик *func* у вказаному виконавці." + +msgid "" +"The *executor* argument should be an :class:`concurrent.futures.Executor` " +"instance. The default executor is used if *executor* is ``None``. The " +"default executor can be set by :meth:`loop.set_default_executor`, otherwise, " +"a :class:`concurrent.futures.ThreadPoolExecutor` will be lazy-initialized " +"and used by :func:`run_in_executor` if needed." +msgstr "" + +msgid "" +"import asyncio\n" +"import concurrent.futures\n" +"\n" +"def blocking_io():\n" +" # File operations (such as logging) can block the\n" +" # event loop: run them in a thread pool.\n" +" with open('/dev/urandom', 'rb') as f:\n" +" return f.read(100)\n" +"\n" +"def cpu_bound():\n" +" # CPU-bound operations will block the event loop:\n" +" # in general it is preferable to run them in a\n" +" # process pool.\n" +" return sum(i * i for i in range(10 ** 7))\n" +"\n" +"async def main():\n" +" loop = asyncio.get_running_loop()\n" +"\n" +" ## Options:\n" +"\n" +" # 1. Run in the default loop's executor:\n" +" result = await loop.run_in_executor(\n" +" None, blocking_io)\n" +" print('default thread pool', result)\n" +"\n" +" # 2. Run in a custom thread pool:\n" +" with concurrent.futures.ThreadPoolExecutor() as pool:\n" +" result = await loop.run_in_executor(\n" +" pool, blocking_io)\n" +" print('custom thread pool', result)\n" +"\n" +" # 3. Run in a custom process pool:\n" +" with concurrent.futures.ProcessPoolExecutor() as pool:\n" +" result = await loop.run_in_executor(\n" +" pool, cpu_bound)\n" +" print('custom process pool', result)\n" +"\n" +"if __name__ == '__main__':\n" +" asyncio.run(main())" +msgstr "" + +msgid "" +"Note that the entry point guard (``if __name__ == '__main__'``) is required " +"for option 3 due to the peculiarities of :mod:`multiprocessing`, which is " +"used by :class:`~concurrent.futures.ProcessPoolExecutor`. See :ref:`Safe " +"importing of main module `." +msgstr "" + +msgid "This method returns a :class:`asyncio.Future` object." +msgstr "Цей метод повертає об’єкт :class:`asyncio.Future`." + +msgid "" +"Use :func:`functools.partial` :ref:`to pass keyword arguments ` to *func*." +msgstr "" +"Використовуйте :func:`functools.partial` :ref:`, щоб передати аргументи " +"ключового слова ` до *func*." + +msgid "" +":meth:`loop.run_in_executor` no longer configures the ``max_workers`` of the " +"thread pool executor it creates, instead leaving it up to the thread pool " +"executor (:class:`~concurrent.futures.ThreadPoolExecutor`) to set the " +"default." +msgstr "" +":meth:`loop.run_in_executor` більше не налаштовує ``max_workers`` виконавця " +"пулу потоків, який він створює, натомість залишаючи його виконавцю пулу " +"потоків (:class:`~concurrent.futures.ThreadPoolExecutor`) для встановлення " +"за замовчуванням." + +msgid "" +"Set *executor* as the default executor used by :meth:`run_in_executor`. " +"*executor* must be an instance of :class:`~concurrent.futures." +"ThreadPoolExecutor`." +msgstr "" + +msgid "" +"*executor* must be an instance of :class:`~concurrent.futures." +"ThreadPoolExecutor`." +msgstr "" + +msgid "Error Handling API" +msgstr "API обробки помилок" + +msgid "Allows customizing how exceptions are handled in the event loop." +msgstr "Дозволяє налаштувати спосіб обробки винятків у циклі подій." + +msgid "Set *handler* as the new event loop exception handler." +msgstr "Встановіть *обробник* як новий обробник винятків циклу подій." + +msgid "" +"If *handler* is ``None``, the default exception handler will be set. " +"Otherwise, *handler* must be a callable with the signature matching ``(loop, " +"context)``, where ``loop`` is a reference to the active event loop, and " +"``context`` is a ``dict`` object containing the details of the exception " +"(see :meth:`call_exception_handler` documentation for details about context)." +msgstr "" +"Якщо *обробник* має значення ``None``, буде встановлено обробник винятків за " +"умовчанням. В іншому випадку *обробник* має бути викликом із сигнатурою, що " +"відповідає ``(цикл, контекст)``, де ``цикл`` є посиланням на активний цикл " +"подій, а ``контекст`` є ``dict`` об’єкт, що містить деталі винятку " +"(перегляньте документацію :meth:`call_exception_handler`, щоб дізнатися " +"більше про контекст)." + +msgid "" +"If the handler is called on behalf of a :class:`~asyncio.Task` or :class:" +"`~asyncio.Handle`, it is run in the :class:`contextvars.Context` of that " +"task or callback handle." +msgstr "" + +msgid "" +"The handler may be called in the :class:`~contextvars.Context` of the task " +"or handle where the exception originated." +msgstr "" + +msgid "" +"Return the current exception handler, or ``None`` if no custom exception " +"handler was set." +msgstr "" +"Повертає поточний обробник винятків або ``None``, якщо настроюваний обробник " +"винятків не встановлено." + +msgid "Default exception handler." +msgstr "Обробник винятків за замовчуванням." + +msgid "" +"This is called when an exception occurs and no exception handler is set. " +"This can be called by a custom exception handler that wants to defer to the " +"default handler behavior." +msgstr "" +"Це викликається, коли виникає виняткова ситуація, а обробник винятків не " +"встановлено. Це може бути викликано спеціальним обробником винятків, який " +"хоче відкласти поведінку обробника за замовчуванням." + +msgid "" +"*context* parameter has the same meaning as in :meth:" +"`call_exception_handler`." +msgstr "" +"Параметр *context* має те саме значення, що й у :meth:" +"`call_exception_handler`." + +msgid "Call the current event loop exception handler." +msgstr "Викликати обробник винятків поточного циклу подій." + +msgid "" +"*context* is a ``dict`` object containing the following keys (new keys may " +"be introduced in future Python versions):" +msgstr "" +"*context* — це об’єкт ``dict``, що містить такі ключі (нові ключі можуть " +"бути представлені в наступних версіях Python):" + +msgid "'message': Error message;" +msgstr "'message': повідомлення про помилку;" + +msgid "'exception' (optional): Exception object;" +msgstr "'exception' (необов'язковий): об'єкт винятку;" + +msgid "'future' (optional): :class:`asyncio.Future` instance;" +msgstr "'майбутнє' (необов'язково): екземпляр :class:`asyncio.Future`;" + +msgid "'task' (optional): :class:`asyncio.Task` instance;" +msgstr "'task' (необов'язковий): :class:`asyncio.Task` екземпляр;" + +msgid "'handle' (optional): :class:`asyncio.Handle` instance;" +msgstr "'handle' (необов'язковий): :class:`asyncio.Handle` екземпляр;" + +msgid "'protocol' (optional): :ref:`Protocol ` instance;" +msgstr "" +"'протокол' (необов'язково): :ref:`примірник протоколу `;" + +msgid "'transport' (optional): :ref:`Transport ` instance;" +msgstr "" +"'transport' (необов'язковий): :ref:`Transport ` екземпляр;" + +msgid "'socket' (optional): :class:`socket.socket` instance;" +msgstr "'socket' (необов'язковий): :class:`socket.socket` екземпляр;" + +msgid "'source_traceback' (optional): Traceback of the source;" +msgstr "" + +msgid "'handle_traceback' (optional): Traceback of the handle;" +msgstr "" + +msgid "'asyncgen' (optional): Asynchronous generator that caused" +msgstr "'asyncgen' (необов'язково): асинхронний генератор, який викликав" + +msgid "the exception." +msgstr "виняток." + +msgid "" +"This method should not be overloaded in subclassed event loops. For custom " +"exception handling, use the :meth:`set_exception_handler` method." +msgstr "" + +msgid "Enabling debug mode" +msgstr "Увімкнення режиму налагодження" + +msgid "Get the debug mode (:class:`bool`) of the event loop." +msgstr "Отримати режим налагодження (:class:`bool`) циклу подій." + +msgid "" +"The default value is ``True`` if the environment variable :envvar:" +"`PYTHONASYNCIODEBUG` is set to a non-empty string, ``False`` otherwise." +msgstr "" +"Значенням за замовчуванням є ``True``, якщо змінна середовища :envvar:" +"`PYTHONASYNCIODEBUG` має значення непорожнього рядка, ``False`` в іншому " +"випадку." + +msgid "Set the debug mode of the event loop." +msgstr "Встановіть режим налагодження циклу подій." + +msgid "" +"The new :ref:`Python Development Mode ` can now also be used to " +"enable the debug mode." +msgstr "" +"Новий :ref:`Режим розробки Python ` тепер також можна " +"використовувати для ввімкнення режиму налагодження." + +msgid "" +"This attribute can be used to set the minimum execution duration in seconds " +"that is considered \"slow\". When debug mode is enabled, \"slow\" callbacks " +"are logged." +msgstr "" + +msgid "Default value is 100 milliseconds." +msgstr "" + +msgid "The :ref:`debug mode of asyncio `." +msgstr ":ref:`режим налагодження asyncio `." + +msgid "Running Subprocesses" +msgstr "Запущені підпроцеси" + +msgid "" +"Methods described in this subsections are low-level. In regular async/await " +"code consider using the high-level :func:`asyncio.create_subprocess_shell` " +"and :func:`asyncio.create_subprocess_exec` convenience functions instead." +msgstr "" +"Методи, описані в цьому підрозділі, є низькорівневими. У звичайному коді " +"async/await розгляньте можливість використовувати натомість зручні функції " +"високого рівня :func:`asyncio.create_subprocess_shell` і :func:`asyncio." +"create_subprocess_exec`." + +msgid "" +"On Windows, the default event loop :class:`ProactorEventLoop` supports " +"subprocesses, whereas :class:`SelectorEventLoop` does not. See :ref:" +"`Subprocess Support on Windows ` for details." +msgstr "" +"У Windows типовий цикл подій :class:`ProactorEventLoop` підтримує " +"підпроцеси, тоді як :class:`SelectorEventLoop` не підтримує. Дивіться :ref:" +"`Підтримку підпроцесів у Windows `, щоб " +"дізнатися більше." + +msgid "" +"Create a subprocess from one or more string arguments specified by *args*." +msgstr "" +"Створіть підпроцес з одного або кількох рядкових аргументів, визначених " +"*args*." + +msgid "*args* must be a list of strings represented by:" +msgstr "*args* має бути списком рядків, представлених:" + +msgid ":class:`str`;" +msgstr ":class:`str`;" + +msgid "" +"or :class:`bytes`, encoded to the :ref:`filesystem encoding `." +msgstr "" +"або :class:`bytes`, закодований у :ref:`кодування файлової системи " +"`." + +msgid "" +"The first string specifies the program executable, and the remaining strings " +"specify the arguments. Together, string arguments form the ``argv`` of the " +"program." +msgstr "" +"Перший рядок визначає виконуваний файл програми, а решта рядків визначають " +"аргументи. Разом рядкові аргументи утворюють ``argv`` програми." + +msgid "" +"This is similar to the standard library :class:`subprocess.Popen` class " +"called with ``shell=False`` and the list of strings passed as the first " +"argument; however, where :class:`~subprocess.Popen` takes a single argument " +"which is list of strings, *subprocess_exec* takes multiple string arguments." +msgstr "" +"Це схоже на клас стандартної бібліотеки :class:`subprocess.Popen`, " +"викликаний за допомогою ``shell=False`` і списку рядків, переданих як перший " +"аргумент; однак, якщо :class:`~subprocess.Popen` приймає один аргумент, який " +"є списком рядків, *subprocess_exec* приймає кілька рядкових аргументів." + +msgid "" +"The *protocol_factory* must be a callable returning a subclass of the :class:" +"`asyncio.SubprocessProtocol` class." +msgstr "" +"*protocol_factory* має бути викликаним, що повертає підклас класу :class:" +"`asyncio.SubprocessProtocol`." + +msgid "Other parameters:" +msgstr "Інші параметри:" + +msgid "*stdin* can be any of these:" +msgstr "*stdin* може бути будь-яким із цих:" + +msgid "a file-like object" +msgstr "" + +msgid "" +"an existing file descriptor (a positive integer), for example those created " +"with :meth:`os.pipe`" +msgstr "" + +msgid "" +"the :const:`subprocess.PIPE` constant (default) which will create a new pipe " +"and connect it," +msgstr "" +"константа :const:`subprocess.PIPE` (за замовчуванням), яка створить новий " +"канал і з’єднає його," + +msgid "" +"the value ``None`` which will make the subprocess inherit the file " +"descriptor from this process" +msgstr "" +"значення ``None``, яке змусить підпроцес успадкувати дескриптор файлу від " +"цього процесу" + +msgid "" +"the :const:`subprocess.DEVNULL` constant which indicates that the special :" +"data:`os.devnull` file will be used" +msgstr "" +"константа :const:`subprocess.DEVNULL`, яка вказує, що буде використовуватися " +"спеціальний файл :data:`os.devnull`" + +msgid "*stdout* can be any of these:" +msgstr "*stdout* може бути будь-яким із цього:" + +msgid "*stderr* can be any of these:" +msgstr "*stderr* може бути будь-яким із цього:" + +msgid "" +"the :const:`subprocess.STDOUT` constant which will connect the standard " +"error stream to the process' standard output stream" +msgstr "" +"константа :const:`subprocess.STDOUT`, яка підключатиме стандартний потік " +"помилок до стандартного потоку виводу процесу" + +msgid "" +"All other keyword arguments are passed to :class:`subprocess.Popen` without " +"interpretation, except for *bufsize*, *universal_newlines*, *shell*, *text*, " +"*encoding* and *errors*, which should not be specified at all." +msgstr "" +"Усі інші аргументи ключових слів передаються до :class:`subprocess.Popen` " +"без інтерпретації, за винятком *bufsize*, *universal_newlines*, *shell*, " +"*text*, *encoding* і *errors*, які не слід вказувати в все." + +msgid "" +"The ``asyncio`` subprocess API does not support decoding the streams as " +"text. :func:`bytes.decode` can be used to convert the bytes returned from " +"the stream to text." +msgstr "" +"API підпроцесу ``asyncio`` не підтримує декодування потоків як тексту. :func:" +"`bytes.decode` можна використовувати для перетворення байтів, повернутих із " +"потоку, на текст." + +msgid "" +"If a file-like object passed as *stdin*, *stdout* or *stderr* represents a " +"pipe, then the other side of this pipe should be registered with :meth:" +"`~loop.connect_write_pipe` or :meth:`~loop.connect_read_pipe` for use with " +"the event loop." +msgstr "" + +msgid "" +"See the constructor of the :class:`subprocess.Popen` class for documentation " +"on other arguments." +msgstr "" +"Перегляньте конструктор класу :class:`subprocess.Popen` для документації " +"щодо інших аргументів." + +msgid "" +"Returns a pair of ``(transport, protocol)``, where *transport* conforms to " +"the :class:`asyncio.SubprocessTransport` base class and *protocol* is an " +"object instantiated by the *protocol_factory*." +msgstr "" +"Повертає пару \"(transport, protocol)\", де *transport* відповідає базовому " +"класу :class:`asyncio.SubprocessTransport`, а *protocol* є об’єктом, " +"створеним *protocol_factory*." + +msgid "" +"Create a subprocess from *cmd*, which can be a :class:`str` or a :class:" +"`bytes` string encoded to the :ref:`filesystem encoding `, using the platform's \"shell\" syntax." +msgstr "" +"Створіть підпроцес із *cmd*, який може бути :class:`str` або :class:`bytes` " +"рядком, закодованим у :ref:`кодуванні файлової системи `, використовуючи синтаксис \"оболонки\" платформи." + +msgid "" +"This is similar to the standard library :class:`subprocess.Popen` class " +"called with ``shell=True``." +msgstr "" +"Це схоже на клас стандартної бібліотеки :class:`subprocess.Popen`, що " +"викликається за допомогою ``shell=True``." + +msgid "" +"The *protocol_factory* must be a callable returning a subclass of the :class:" +"`SubprocessProtocol` class." +msgstr "" +"*protocol_factory* має бути викликаним, що повертає підклас класу :class:" +"`SubprocessProtocol`." + +msgid "" +"See :meth:`~loop.subprocess_exec` for more details about the remaining " +"arguments." +msgstr "" +"Перегляньте :meth:`~loop.subprocess_exec` для отримання додаткової " +"інформації про інші аргументи." + +msgid "" +"Returns a pair of ``(transport, protocol)``, where *transport* conforms to " +"the :class:`SubprocessTransport` base class and *protocol* is an object " +"instantiated by the *protocol_factory*." +msgstr "" +"Повертає пару \"(transport, protocol)\", де *transport* відповідає базовому " +"класу :class:`SubprocessTransport`, а *protocol* є об’єктом, створеним " +"*protocol_factory*." + +msgid "" +"It is the application's responsibility to ensure that all whitespace and " +"special characters are quoted appropriately to avoid `shell injection " +"`_ " +"vulnerabilities. The :func:`shlex.quote` function can be used to properly " +"escape whitespace and special characters in strings that are going to be " +"used to construct shell commands." +msgstr "" +"Програма несе відповідальність за те, щоб усі пробіли та спеціальні символи " +"були взяті в лапки належним чином, щоб уникнути вразливості `впровадження " +"оболонки `_. " +"Функцію :func:`shlex.quote` можна використати для правильного екранування " +"пробілів і спеціальних символів у рядках, які використовуватимуться для " +"створення команд оболонки." + +msgid "Callback Handles" +msgstr "Ручки зворотного виклику" + +msgid "" +"A callback wrapper object returned by :meth:`loop.call_soon`, :meth:`loop." +"call_soon_threadsafe`." +msgstr "" +"Об’єкт оболонки зворотного виклику, повернутий :meth:`loop.call_soon`, :meth:" +"`loop.call_soon_threadsafe`." + +msgid "" +"Return the :class:`contextvars.Context` object associated with the handle." +msgstr "" + +msgid "" +"Cancel the callback. If the callback has already been canceled or executed, " +"this method has no effect." +msgstr "" +"Скасувати зворотний дзвінок. Якщо зворотний виклик уже скасовано або " +"виконано, цей метод не має ефекту." + +msgid "Return ``True`` if the callback was cancelled." +msgstr "Повертає ``True``, якщо зворотний виклик було скасовано." + +msgid "" +"A callback wrapper object returned by :meth:`loop.call_later`, and :meth:" +"`loop.call_at`." +msgstr "" +"Об’єкт оболонки зворотного виклику, повернутий :meth:`loop.call_later` і :" +"meth:`loop.call_at`." + +msgid "This class is a subclass of :class:`Handle`." +msgstr "Цей клас є підкласом :class:`Handle`." + +msgid "Return a scheduled callback time as :class:`float` seconds." +msgstr "" +"Повертає запланований час зворотного виклику як :class:`float` секунди." + +msgid "" +"The time is an absolute timestamp, using the same time reference as :meth:" +"`loop.time`." +msgstr "" +"Час – це абсолютна позначка часу, яка використовує те саме посилання на час, " +"що й :meth:`loop.time`." + +msgid "Server Objects" +msgstr "Серверні об’єкти" + +msgid "" +"Server objects are created by :meth:`loop.create_server`, :meth:`loop." +"create_unix_server`, :func:`start_server`, and :func:`start_unix_server` " +"functions." +msgstr "" +"Серверні об’єкти створюються функціями :meth:`loop.create_server`, :meth:" +"`loop.create_unix_server`, :func:`start_server` і :func:`start_unix_server`." + +msgid "Do not instantiate the :class:`Server` class directly." +msgstr "" + +msgid "" +"*Server* objects are asynchronous context managers. When used in an ``async " +"with`` statement, it's guaranteed that the Server object is closed and not " +"accepting new connections when the ``async with`` statement is completed::" +msgstr "" +"Об'єкти *Server* є асинхронними менеджерами контексту. При використанні в " +"операторі ``async with`` гарантується, що об’єкт Server закритий і не " +"приймає нових з’єднань після завершення оператора ``async with``::" + +msgid "" +"srv = await loop.create_server(...)\n" +"\n" +"async with srv:\n" +" # some code\n" +"\n" +"# At this point, srv is closed and no longer accepts new connections." +msgstr "" + +msgid "Server object is an asynchronous context manager since Python 3.7." +msgstr "" +"Серверний об’єкт — це асинхронний менеджер контексту, починаючи з Python 3.7." + +msgid "" +"This class was exposed publicly as ``asyncio.Server`` in Python 3.9.11, " +"3.10.3 and 3.11." +msgstr "" + +msgid "" +"Stop serving: close listening sockets and set the :attr:`sockets` attribute " +"to ``None``." +msgstr "" +"Зупинити обслуговування: закрийте сокети прослуховування та встановіть для " +"атрибута :attr:`sockets` значення ``None``." + +msgid "" +"The sockets that represent existing incoming client connections are left " +"open." +msgstr "" +"Сокети, які представляють наявні вхідні підключення клієнта, залишаються " +"відкритими." + +msgid "" +"The server is closed asynchronously; use the :meth:`wait_closed` coroutine " +"to wait until the server is closed (and no more connections are active)." +msgstr "" + +msgid "Close all existing incoming client connections." +msgstr "" + +msgid "" +"Calls :meth:`~asyncio.BaseTransport.close` on all associated transports." +msgstr "" + +msgid "" +":meth:`close` should be called before :meth:`close_clients` when closing the " +"server to avoid races with new clients connecting." +msgstr "" + +msgid "" +"Close all existing incoming client connections immediately, without waiting " +"for pending operations to complete." +msgstr "" + +msgid "" +"Calls :meth:`~asyncio.WriteTransport.abort` on all associated transports." +msgstr "" + +msgid "" +":meth:`close` should be called before :meth:`abort_clients` when closing the " +"server to avoid races with new clients connecting." +msgstr "" + +msgid "Return the event loop associated with the server object." +msgstr "Повертає цикл подій, пов’язаний з об’єктом сервера." + +msgid "Start accepting connections." +msgstr "Почніть приймати підключення." + +msgid "" +"This method is idempotent, so it can be called when the server is already " +"serving." +msgstr "" + +msgid "" +"The *start_serving* keyword-only parameter to :meth:`loop.create_server` " +"and :meth:`asyncio.start_server` allows creating a Server object that is not " +"accepting connections initially. In this case ``Server.start_serving()``, " +"or :meth:`Server.serve_forever` can be used to make the Server start " +"accepting connections." +msgstr "" +"Ключовий параметр *start_serving* для :meth:`loop.create_server` і :meth:" +"`asyncio.start_server` дозволяє створити об’єкт сервера, який спочатку не " +"приймає підключення. У цьому випадку ``Server.start_serving()`` або :meth:" +"`Server.serve_forever` можна використати, щоб сервер почав приймати " +"з’єднання." + +msgid "" +"Start accepting connections until the coroutine is cancelled. Cancellation " +"of ``serve_forever`` task causes the server to be closed." +msgstr "" +"Почніть приймати підключення, доки співпрограму не буде скасовано. " +"Скасування завдання ``serve_forever`` призводить до закриття сервера." + +msgid "" +"This method can be called if the server is already accepting connections. " +"Only one ``serve_forever`` task can exist per one *Server* object." +msgstr "" +"Цей метод можна викликати, якщо сервер уже приймає підключення. На один " +"об’єкт *Server* може існувати лише одне завдання ``serve_forever``." + +msgid "" +"async def client_connected(reader, writer):\n" +" # Communicate with the client with\n" +" # reader/writer streams. For example:\n" +" await reader.readline()\n" +"\n" +"async def main(host, port):\n" +" srv = await asyncio.start_server(\n" +" client_connected, host, port)\n" +" await srv.serve_forever()\n" +"\n" +"asyncio.run(main('127.0.0.1', 0))" +msgstr "" + +msgid "Return ``True`` if the server is accepting new connections." +msgstr "Повертає ``True``, якщо сервер приймає нові підключення." + +msgid "" +"Wait until the :meth:`close` method completes and all active connections " +"have finished." +msgstr "" + +msgid "" +"List of socket-like objects, ``asyncio.trsock.TransportSocket``, which the " +"server is listening on." +msgstr "" + +msgid "" +"Prior to Python 3.7 ``Server.sockets`` used to return an internal list of " +"server sockets directly. In 3.7 a copy of that list is returned." +msgstr "" +"До Python 3.7 ``Server.sockets`` використовувався для безпосереднього " +"повернення внутрішнього списку серверних сокетів. У 3.7 повертається копія " +"цього списку." + +msgid "Event Loop Implementations" +msgstr "Реалізації циклу подій" + +msgid "" +"asyncio ships with two different event loop implementations: :class:" +"`SelectorEventLoop` and :class:`ProactorEventLoop`." +msgstr "" +"asyncio постачається з двома різними реалізаціями циклу подій: :class:" +"`SelectorEventLoop` і :class:`ProactorEventLoop`." + +msgid "By default asyncio is configured to use :class:`EventLoop`." +msgstr "" + +msgid "" +"A subclass of :class:`AbstractEventLoop` based on the :mod:`selectors` " +"module." +msgstr "" + +msgid "" +"Uses the most efficient *selector* available for the given platform. It is " +"also possible to manually configure the exact selector implementation to be " +"used::" +msgstr "" +"Використовує найефективніший *селектор*, доступний для даної платформи. " +"Також можна вручну налаштувати точну реалізацію селектора, яка буде " +"використовуватися:" + +msgid "" +"import asyncio\n" +"import selectors\n" +"\n" +"class MyPolicy(asyncio.DefaultEventLoopPolicy):\n" +" def new_event_loop(self):\n" +" selector = selectors.SelectSelector()\n" +" return asyncio.SelectorEventLoop(selector)\n" +"\n" +"asyncio.set_event_loop_policy(MyPolicy())" +msgstr "" + +msgid "" +"A subclass of :class:`AbstractEventLoop` for Windows that uses \"I/O " +"Completion Ports\" (IOCP)." +msgstr "" + +msgid "" +"`MSDN documentation on I/O Completion Ports `_." +msgstr "" + +msgid "" +"An alias to the most efficient available subclass of :class:" +"`AbstractEventLoop` for the given platform." +msgstr "" + +msgid "" +"It is an alias to :class:`SelectorEventLoop` on Unix and :class:" +"`ProactorEventLoop` on Windows." +msgstr "" + +msgid "Abstract base class for asyncio-compliant event loops." +msgstr "Абстрактний базовий клас для асинційно-сумісних циклів подій." + +msgid "" +"The :ref:`asyncio-event-loop-methods` section lists all methods that an " +"alternative implementation of ``AbstractEventLoop`` should have defined." +msgstr "" + +msgid "Examples" +msgstr "Приклади" + +msgid "" +"Note that all examples in this section **purposefully** show how to use the " +"low-level event loop APIs, such as :meth:`loop.run_forever` and :meth:`loop." +"call_soon`. Modern asyncio applications rarely need to be written this way; " +"consider using the high-level functions like :func:`asyncio.run`." +msgstr "" +"Зверніть увагу, що всі приклади в цьому розділі **цілеспрямовано** " +"показують, як використовувати API циклу подій низького рівня, такі як :meth:" +"`loop.run_forever` і :meth:`loop.call_soon`. Сучасні асинхронні програми " +"рідко потрібно писати таким чином; подумайте про використання функцій " +"високого рівня, таких як :func:`asyncio.run`." + +msgid "Hello World with call_soon()" +msgstr "Привіт, світ із call_soon()" + +msgid "" +"An example using the :meth:`loop.call_soon` method to schedule a callback. " +"The callback displays ``\"Hello World\"`` and then stops the event loop::" +msgstr "" +"Приклад використання методу :meth:`loop.call_soon` для планування зворотного " +"виклику. Зворотний виклик відображає ``\"Hello World\"``, а потім зупиняє " +"цикл подій::" + +msgid "" +"import asyncio\n" +"\n" +"def hello_world(loop):\n" +" \"\"\"A callback to print 'Hello World' and stop the event loop\"\"\"\n" +" print('Hello World')\n" +" loop.stop()\n" +"\n" +"loop = asyncio.new_event_loop()\n" +"\n" +"# Schedule a call to hello_world()\n" +"loop.call_soon(hello_world, loop)\n" +"\n" +"# Blocking call interrupted by loop.stop()\n" +"try:\n" +" loop.run_forever()\n" +"finally:\n" +" loop.close()" +msgstr "" + +msgid "" +"A similar :ref:`Hello World ` example created with a coroutine " +"and the :func:`run` function." +msgstr "" +"Подібний приклад :ref:`Hello World `, створений за допомогою " +"співпрограми та функції :func:`run`." + +msgid "Display the current date with call_later()" +msgstr "Показати поточну дату за допомогою call_later()" + +msgid "" +"An example of a callback displaying the current date every second. The " +"callback uses the :meth:`loop.call_later` method to reschedule itself after " +"5 seconds, and then stops the event loop::" +msgstr "" +"Приклад зворотного виклику, що відображає поточну дату кожну секунду. " +"Зворотний виклик використовує метод :meth:`loop.call_later`, щоб " +"перепланувати себе через 5 секунд, а потім зупинити цикл подій::" + +msgid "" +"import asyncio\n" +"import datetime\n" +"\n" +"def display_date(end_time, loop):\n" +" print(datetime.datetime.now())\n" +" if (loop.time() + 1.0) < end_time:\n" +" loop.call_later(1, display_date, end_time, loop)\n" +" else:\n" +" loop.stop()\n" +"\n" +"loop = asyncio.new_event_loop()\n" +"\n" +"# Schedule the first call to display_date()\n" +"end_time = loop.time() + 5.0\n" +"loop.call_soon(display_date, end_time, loop)\n" +"\n" +"# Blocking call interrupted by loop.stop()\n" +"try:\n" +" loop.run_forever()\n" +"finally:\n" +" loop.close()" +msgstr "" + +msgid "" +"A similar :ref:`current date ` example created with a " +"coroutine and the :func:`run` function." +msgstr "" +"Схожий приклад :ref:`current date `, створений за " +"допомогою співпрограми та функції :func:`run`." + +msgid "Watch a file descriptor for read events" +msgstr "Спостерігайте за подіями читання файлового дескриптора" + +msgid "" +"Wait until a file descriptor received some data using the :meth:`loop." +"add_reader` method and then close the event loop::" +msgstr "" +"Зачекайте, доки дескриптор файлу не отримає деякі дані за допомогою методу :" +"meth:`loop.add_reader`, а потім закрийте цикл подій::" + +msgid "" +"import asyncio\n" +"from socket import socketpair\n" +"\n" +"# Create a pair of connected file descriptors\n" +"rsock, wsock = socketpair()\n" +"\n" +"loop = asyncio.new_event_loop()\n" +"\n" +"def reader():\n" +" data = rsock.recv(100)\n" +" print(\"Received:\", data.decode())\n" +"\n" +" # We are done: unregister the file descriptor\n" +" loop.remove_reader(rsock)\n" +"\n" +" # Stop the event loop\n" +" loop.stop()\n" +"\n" +"# Register the file descriptor for read event\n" +"loop.add_reader(rsock, reader)\n" +"\n" +"# Simulate the reception of data from the network\n" +"loop.call_soon(wsock.send, 'abc'.encode())\n" +"\n" +"try:\n" +" # Run the event loop\n" +" loop.run_forever()\n" +"finally:\n" +" # We are done. Close sockets and the event loop.\n" +" rsock.close()\n" +" wsock.close()\n" +" loop.close()" +msgstr "" + +msgid "" +"A similar :ref:`example ` using " +"transports, protocols, and the :meth:`loop.create_connection` method." +msgstr "" +"Подібний :ref:`приклад ` з використанням " +"транспортів, протоколів і методу :meth:`loop.create_connection`." + +msgid "" +"Another similar :ref:`example ` " +"using the high-level :func:`asyncio.open_connection` function and streams." +msgstr "" +"Інший подібний :ref:`приклад ` з " +"використанням високорівневої функції :func:`asyncio.open_connection` і " +"потоків." + +msgid "Set signal handlers for SIGINT and SIGTERM" +msgstr "Встановити обробники сигналів для SIGINT і SIGTERM" + +msgid "(This ``signals`` example only works on Unix.)" +msgstr "(Цей приклад ``сигналів`` працює лише в Unix.)" + +msgid "" +"Register handlers for signals :const:`~signal.SIGINT` and :const:`~signal." +"SIGTERM` using the :meth:`loop.add_signal_handler` method::" +msgstr "" + +msgid "" +"import asyncio\n" +"import functools\n" +"import os\n" +"import signal\n" +"\n" +"def ask_exit(signame, loop):\n" +" print(\"got signal %s: exit\" % signame)\n" +" loop.stop()\n" +"\n" +"async def main():\n" +" loop = asyncio.get_running_loop()\n" +"\n" +" for signame in {'SIGINT', 'SIGTERM'}:\n" +" loop.add_signal_handler(\n" +" getattr(signal, signame),\n" +" functools.partial(ask_exit, signame, loop))\n" +"\n" +" await asyncio.sleep(3600)\n" +"\n" +"print(\"Event loop running for 1 hour, press Ctrl+C to interrupt.\")\n" +"print(f\"pid {os.getpid()}: send SIGINT or SIGTERM to exit.\")\n" +"\n" +"asyncio.run(main())" +msgstr "" diff --git a/library/asyncio-exceptions.po b/library/asyncio-exceptions.po new file mode 100644 index 000000000..e5ba6b8b2 --- /dev/null +++ b/library/asyncio-exceptions.po @@ -0,0 +1,98 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:54+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Exceptions" +msgstr "Винятки" + +msgid "**Source code:** :source:`Lib/asyncio/exceptions.py`" +msgstr "**Вихідний код:** :source:`Lib/asyncio/exceptions.py`" + +msgid "" +"A deprecated alias of :exc:`TimeoutError`, raised when the operation has " +"exceeded the given deadline." +msgstr "" + +msgid "This class was made an alias of :exc:`TimeoutError`." +msgstr "Цей клас отримав псевдонім :exc:`TimeoutError`." + +msgid "The operation has been cancelled." +msgstr "Операцію скасовано." + +msgid "" +"This exception can be caught to perform custom operations when asyncio Tasks " +"are cancelled. In almost all situations the exception must be re-raised." +msgstr "" +"Цей виняток можна перехопити для виконання спеціальних операцій, коли " +"асинхронні завдання скасовуються. Майже в усіх ситуаціях виняток потрібно " +"підняти повторно." + +msgid "" +":exc:`CancelledError` is now a subclass of :class:`BaseException` rather " +"than :class:`Exception`." +msgstr "" + +msgid "Invalid internal state of :class:`Task` or :class:`Future`." +msgstr "Недійсний внутрішній стан :class:`Task` або :class:`Future`." + +msgid "" +"Can be raised in situations like setting a result value for a *Future* " +"object that already has a result value set." +msgstr "" +"Може бути викликано в таких ситуаціях, як встановлення значення результату " +"для об’єкта *Future*, для якого вже встановлено значення результату." + +msgid "" +"The \"sendfile\" syscall is not available for the given socket or file type." +msgstr "" +"Системний виклик \"sendfile\" недоступний для даного сокета або типу файлу." + +msgid "A subclass of :exc:`RuntimeError`." +msgstr "Підклас :exc:`RuntimeError`." + +msgid "The requested read operation did not complete fully." +msgstr "Запитана операція читання не завершена повністю." + +msgid "Raised by the :ref:`asyncio stream APIs`." +msgstr "Створено :ref:`asyncio stream API `." + +msgid "This exception is a subclass of :exc:`EOFError`." +msgstr "Цей виняток є підкласом :exc:`EOFError`." + +msgid "The total number (:class:`int`) of expected bytes." +msgstr "Загальна кількість (:class:`int`) очікуваних байтів." + +msgid "A string of :class:`bytes` read before the end of stream was reached." +msgstr "Рядок із :class:`bytes` прочитано до кінця потоку." + +msgid "Reached the buffer size limit while looking for a separator." +msgstr "Досягнуто обмеження розміру буфера під час пошуку роздільника." + +msgid "Raised by the :ref:`asyncio stream APIs `." +msgstr "Створено :ref:`asyncio stream API `." + +msgid "The total number of to be consumed bytes." +msgstr "Загальна кількість спожитих байтів." diff --git a/library/asyncio-extending.po b/library/asyncio-extending.po new file mode 100644 index 000000000..4692f0921 --- /dev/null +++ b/library/asyncio-extending.po @@ -0,0 +1,132 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2022-11-05 19:48+0000\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Extending" +msgstr "" + +msgid "" +"The main direction for :mod:`asyncio` extending is writing custom *event " +"loop* classes. Asyncio has helpers that could be used to simplify this task." +msgstr "" + +msgid "" +"Third-parties should reuse existing asyncio code with caution, a new Python " +"version is free to break backward compatibility in *internal* part of API." +msgstr "" + +msgid "Writing a Custom Event Loop" +msgstr "" + +msgid "" +":class:`asyncio.AbstractEventLoop` declares very many methods. Implementing " +"all them from scratch is a tedious job." +msgstr "" + +msgid "" +"A loop can get many common methods implementation for free by inheriting " +"from :class:`asyncio.BaseEventLoop`." +msgstr "" + +msgid "" +"In turn, the successor should implement a bunch of *private* methods " +"declared but not implemented in :class:`asyncio.BaseEventLoop`." +msgstr "" + +msgid "" +"For example, ``loop.create_connection()`` checks arguments, resolves DNS " +"addresses, and calls ``loop._make_socket_transport()`` that should be " +"implemented by inherited class. The ``_make_socket_transport()`` method is " +"not documented and is considered as an *internal* API." +msgstr "" + +msgid "Future and Task private constructors" +msgstr "" + +msgid "" +":class:`asyncio.Future` and :class:`asyncio.Task` should be never created " +"directly, please use corresponding :meth:`loop.create_future` and :meth:" +"`loop.create_task`, or :func:`asyncio.create_task` factories instead." +msgstr "" + +msgid "" +"However, third-party *event loops* may *reuse* built-in future and task " +"implementations for the sake of getting a complex and highly optimized code " +"for free." +msgstr "" + +msgid "For this purpose the following, *private* constructors are listed:" +msgstr "" + +msgid "Create a built-in future instance." +msgstr "" + +msgid "*loop* is an optional event loop instance." +msgstr "" + +msgid "Create a built-in task instance." +msgstr "" + +msgid "" +"*loop* is an optional event loop instance. The rest of arguments are " +"described in :meth:`loop.create_task` description." +msgstr "" + +msgid "*context* argument is added." +msgstr "" + +msgid "Task lifetime support" +msgstr "" + +msgid "" +"A third party task implementation should call the following functions to " +"keep a task visible by :func:`asyncio.all_tasks` and :func:`asyncio." +"current_task`:" +msgstr "" + +msgid "Register a new *task* as managed by *asyncio*." +msgstr "" + +msgid "Call the function from a task constructor." +msgstr "" + +msgid "Unregister a *task* from *asyncio* internal structures." +msgstr "" + +msgid "The function should be called when a task is about to finish." +msgstr "" + +msgid "Switch the current task to the *task* argument." +msgstr "" + +msgid "" +"Call the function just before executing a portion of embedded *coroutine* (:" +"meth:`coroutine.send` or :meth:`coroutine.throw`)." +msgstr "" + +msgid "Switch the current task back from *task* to ``None``." +msgstr "" + +msgid "" +"Call the function just after :meth:`coroutine.send` or :meth:`coroutine." +"throw` execution." +msgstr "" diff --git a/library/asyncio-future.po b/library/asyncio-future.po new file mode 100644 index 000000000..a0626bc41 --- /dev/null +++ b/library/asyncio-future.po @@ -0,0 +1,412 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:55+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Futures" +msgstr "Ф'ючерси" + +msgid "" +"**Source code:** :source:`Lib/asyncio/futures.py`, :source:`Lib/asyncio/" +"base_futures.py`" +msgstr "" +"**Вихідний код:** :source:`Lib/asyncio/futures.py`, :source:`Lib/asyncio/" +"base_futures.py`" + +msgid "" +"*Future* objects are used to bridge **low-level callback-based code** with " +"high-level async/await code." +msgstr "" +"Об’єкти *Future* використовуються для з’єднання **низькорівневого коду на " +"основі зворотного виклику** з високорівневим асинхронним кодом/кодом " +"очікування." + +msgid "Future Functions" +msgstr "Майбутні функції" + +msgid "Return ``True`` if *obj* is either of:" +msgstr "Повертає ``True``, якщо *obj* є одним із:" + +msgid "an instance of :class:`asyncio.Future`," +msgstr "екземпляр :class:`asyncio.Future`," + +msgid "an instance of :class:`asyncio.Task`," +msgstr "екземпляр :class:`asyncio.Task`," + +msgid "a Future-like object with a ``_asyncio_future_blocking`` attribute." +msgstr "Future-подібний об’єкт з атрибутом ``_asyncio_future_blocking``." + +msgid "Return:" +msgstr "Повернення:" + +msgid "" +"*obj* argument as is, if *obj* is a :class:`Future`, a :class:`Task`, or a " +"Future-like object (:func:`isfuture` is used for the test.)" +msgstr "" +"Аргумент *obj* як є, якщо *obj* є :class:`Future`, :class:`Task` або Future-" +"подібним об’єктом (:func:`isfuture` використовується для перевірки.)" + +msgid "" +"a :class:`Task` object wrapping *obj*, if *obj* is a coroutine (:func:" +"`iscoroutine` is used for the test); in this case the coroutine will be " +"scheduled by ``ensure_future()``." +msgstr "" +"об’єкт :class:`Task`, що обгортає *obj*, якщо *obj* є співпрограмою (для " +"тесту використовується :func:`iscoroutine`); у цьому випадку співпрограма " +"буде запланована ``ensure_future()``." + +msgid "" +"a :class:`Task` object that would await on *obj*, if *obj* is an awaitable (:" +"func:`inspect.isawaitable` is used for the test.)" +msgstr "" +"об’єкт :class:`Task`, який очікуватиме на *obj*, якщо *obj* є очікуваним (:" +"func:`inspect.isawaitable` використовується для тесту.)" + +msgid "If *obj* is neither of the above a :exc:`TypeError` is raised." +msgstr "Якщо *obj* не є жодним із наведених вище, виникає :exc:`TypeError`." + +msgid "" +"See also the :func:`create_task` function which is the preferred way for " +"creating new Tasks." +msgstr "" +"Дивіться також функцію :func:`create_task`, яка є кращим способом створення " +"нових завдань." + +msgid "" +"Save a reference to the result of this function, to avoid a task " +"disappearing mid-execution." +msgstr "" + +msgid "The function accepts any :term:`awaitable` object." +msgstr "Функція приймає будь-який об’єкт :term:`awaitable`." + +msgid "" +"Deprecation warning is emitted if *obj* is not a Future-like object and " +"*loop* is not specified and there is no running event loop." +msgstr "" +"Якщо *obj* не є Future-подібним об’єктом і *loop* не вказано, і цикл подій " +"не виконується, видається попередження про застаріле." + +msgid "" +"Wrap a :class:`concurrent.futures.Future` object in a :class:`asyncio." +"Future` object." +msgstr "" +"Загорніть об’єкт :class:`concurrent.futures.Future` в об’єкт :class:`asyncio." +"Future`." + +msgid "" +"Deprecation warning is emitted if *future* is not a Future-like object and " +"*loop* is not specified and there is no running event loop." +msgstr "" +"Якщо *future* не є об’єктом, схожим на Future, і *loop* не вказано, і немає " +"запущеного циклу подій, видається попередження про застаріння." + +msgid "Future Object" +msgstr "Майбутній об'єкт" + +msgid "" +"A Future represents an eventual result of an asynchronous operation. Not " +"thread-safe." +msgstr "" +"Future представляє кінцевий результат асинхронної операції. Небезпечно для " +"потоків." + +msgid "" +"Future is an :term:`awaitable` object. Coroutines can await on Future " +"objects until they either have a result or an exception set, or until they " +"are cancelled. A Future can be awaited multiple times and the result is same." +msgstr "" + +msgid "" +"Typically Futures are used to enable low-level callback-based code (e.g. in " +"protocols implemented using asyncio :ref:`transports `) to interoperate with high-level async/await code." +msgstr "" +"Зазвичай ф’ючерси використовуються, щоб увімкнути низькорівневий код на " +"основі зворотного виклику (наприклад, у протоколах, реалізованих за " +"допомогою asyncio :ref:`transports `) для " +"взаємодії з високорівневим асинхронним кодом/кодом очікування." + +msgid "" +"The rule of thumb is to never expose Future objects in user-facing APIs, and " +"the recommended way to create a Future object is to call :meth:`loop." +"create_future`. This way alternative event loop implementations can inject " +"their own optimized implementations of a Future object." +msgstr "" +"Емпіричне правило полягає в тому, щоб ніколи не показувати об’єкти Future в " +"призначених для користувача API, а рекомендований спосіб створити об’єкт " +"Future – це викликати :meth:`loop.create_future`. Таким чином альтернативні " +"реалізації циклу подій можуть вводити власні оптимізовані реалізації об’єкта " +"Future." + +msgid "Added support for the :mod:`contextvars` module." +msgstr "Додано підтримку модуля :mod:`contextvars`." + +msgid "" +"Deprecation warning is emitted if *loop* is not specified and there is no " +"running event loop." +msgstr "" +"Якщо *loop* не вказано і немає запущеного циклу подій, видається " +"попередження про застаріле." + +msgid "Return the result of the Future." +msgstr "Повернути результат Future." + +msgid "" +"If the Future is *done* and has a result set by the :meth:`set_result` " +"method, the result value is returned." +msgstr "" +"Якщо Future *done* і має результат, встановлений методом :meth:`set_result`, " +"повертається значення результату." + +msgid "" +"If the Future is *done* and has an exception set by the :meth:" +"`set_exception` method, this method raises the exception." +msgstr "" +"Якщо Future *done* і має виняток, встановлений методом :meth:" +"`set_exception`, цей метод викликає виняток." + +msgid "" +"If the Future has been *cancelled*, this method raises a :exc:" +"`CancelledError` exception." +msgstr "" +"Якщо Future було *скасовано*, цей метод викликає виняток :exc:" +"`CancelledError`." + +msgid "" +"If the Future's result isn't yet available, this method raises an :exc:" +"`InvalidStateError` exception." +msgstr "" + +msgid "Mark the Future as *done* and set its result." +msgstr "Позначте майбутнє як *виконане* та встановіть його результат." + +msgid "" +"Raises an :exc:`InvalidStateError` error if the Future is already *done*." +msgstr "" + +msgid "Mark the Future as *done* and set an exception." +msgstr "Позначте майбутнє як *готове* та встановіть виняток." + +msgid "Return ``True`` if the Future is *done*." +msgstr "Повертає ``True``, якщо Future *done*." + +msgid "" +"A Future is *done* if it was *cancelled* or if it has a result or an " +"exception set with :meth:`set_result` or :meth:`set_exception` calls." +msgstr "" +"Майбутнє вважається *виконаним*, якщо його було *скасовано* або якщо він має " +"результат чи виняток, встановлений за допомогою викликів :meth:`set_result` " +"або :meth:`set_exception`." + +msgid "Return ``True`` if the Future was *cancelled*." +msgstr "Повертає ``True``, якщо Future було *скасовано*." + +msgid "" +"The method is usually used to check if a Future is not *cancelled* before " +"setting a result or an exception for it::" +msgstr "" +"Метод зазвичай використовується, щоб перевірити, чи Future не *скасовано* " +"перед встановленням результату або винятку для нього::" + +msgid "" +"if not fut.cancelled():\n" +" fut.set_result(42)" +msgstr "" + +msgid "Add a callback to be run when the Future is *done*." +msgstr "" +"Додайте зворотний виклик, який буде запущено, коли Майбутнє *зроблено*." + +msgid "The *callback* is called with the Future object as its only argument." +msgstr "" +"*Зворотний виклик* викликається з об’єктом Future як єдиним аргументом." + +msgid "" +"If the Future is already *done* when this method is called, the callback is " +"scheduled with :meth:`loop.call_soon`." +msgstr "" +"Якщо Future вже *done* під час виклику цього методу, зворотний виклик " +"планується за допомогою :meth:`loop.call_soon`." + +msgid "" +"An optional keyword-only *context* argument allows specifying a custom :" +"class:`contextvars.Context` for the *callback* to run in. The current " +"context is used when no *context* is provided." +msgstr "" +"Необов’язковий аргумент *context*, що містить лише ключове слово, дозволяє " +"вказати спеціальний :class:`contextvars.Context` для виконання *зворотного " +"виклику*. Поточний контекст використовується, якщо *контексту* не надано." + +msgid "" +":func:`functools.partial` can be used to pass parameters to the callback, e." +"g.::" +msgstr "" +":func:`functools.partial` можна використовувати для передачі параметрів " +"зворотному виклику, наприклад::" + +msgid "" +"# Call 'print(\"Future:\", fut)' when \"fut\" is done.\n" +"fut.add_done_callback(\n" +" functools.partial(print, \"Future:\"))" +msgstr "" + +msgid "" +"The *context* keyword-only parameter was added. See :pep:`567` for more " +"details." +msgstr "" +"Додано параметр *context* тільки для ключового слова. Дивіться :pep:`567` " +"для більш детальної інформації." + +msgid "Remove *callback* from the callbacks list." +msgstr "Видалити *callback* зі списку зворотних викликів." + +msgid "" +"Returns the number of callbacks removed, which is typically 1, unless a " +"callback was added more than once." +msgstr "" +"Повертає кількість видалених зворотних викликів, яка зазвичай дорівнює 1, " +"якщо зворотний виклик не було додано кілька разів." + +msgid "Cancel the Future and schedule callbacks." +msgstr "Скасувати майбутнє та запланувати зворотні виклики." + +msgid "" +"If the Future is already *done* or *cancelled*, return ``False``. Otherwise, " +"change the Future's state to *cancelled*, schedule the callbacks, and return " +"``True``." +msgstr "" +"Якщо Future вже *виконано* або *скасовано*, поверніть ``False``. В іншому " +"випадку змініть стан Future на *cancelled*, заплануйте зворотні виклики та " +"поверніть ``True``." + +msgid "Added the *msg* parameter." +msgstr "Додано параметр *msg*." + +msgid "Return the exception that was set on this Future." +msgstr "Повертає виняток, встановлений для цього Future." + +msgid "" +"The exception (or ``None`` if no exception was set) is returned only if the " +"Future is *done*." +msgstr "" +"Виняток (або ``None``, якщо виключення не було встановлено) повертається, " +"лише якщо Future *done*." + +msgid "" +"If the Future isn't *done* yet, this method raises an :exc:" +"`InvalidStateError` exception." +msgstr "" +"Якщо Future ще не *зроблено*, цей метод викликає виняток :exc:" +"`InvalidStateError`." + +msgid "Return the event loop the Future object is bound to." +msgstr "Повертає цикл подій, до якого прив’язаний об’єкт Future." + +msgid "" +"This example creates a Future object, creates and schedules an asynchronous " +"Task to set result for the Future, and waits until the Future has a result::" +msgstr "" +"У цьому прикладі створюється об’єкт Future, створюється та планується " +"асинхронне завдання для встановлення результату для Future та очікується, " +"доки Future не отримає результат::" + +msgid "" +"async def set_after(fut, delay, value):\n" +" # Sleep for *delay* seconds.\n" +" await asyncio.sleep(delay)\n" +"\n" +" # Set *value* as a result of *fut* Future.\n" +" fut.set_result(value)\n" +"\n" +"async def main():\n" +" # Get the current event loop.\n" +" loop = asyncio.get_running_loop()\n" +"\n" +" # Create a new Future object.\n" +" fut = loop.create_future()\n" +"\n" +" # Run \"set_after()\" coroutine in a parallel Task.\n" +" # We are using the low-level \"loop.create_task()\" API here because\n" +" # we already have a reference to the event loop at hand.\n" +" # Otherwise we could have just used \"asyncio.create_task()\".\n" +" loop.create_task(\n" +" set_after(fut, 1, '... world'))\n" +"\n" +" print('hello ...')\n" +"\n" +" # Wait until *fut* has a result (1 second) and print it.\n" +" print(await fut)\n" +"\n" +"asyncio.run(main())" +msgstr "" + +msgid "" +"The Future object was designed to mimic :class:`concurrent.futures.Future`. " +"Key differences include:" +msgstr "" +"Об’єкт Future був розроблений для імітації :class:`concurrent.futures." +"Future`. Основні відмінності:" + +msgid "" +"unlike asyncio Futures, :class:`concurrent.futures.Future` instances cannot " +"be awaited." +msgstr "" +"на відміну від asyncio Futures, екземпляри :class:`concurrent.futures." +"Future` не можна чекати." + +msgid "" +":meth:`asyncio.Future.result` and :meth:`asyncio.Future.exception` do not " +"accept the *timeout* argument." +msgstr "" +":meth:`asyncio.Future.result` і :meth:`asyncio.Future.exception` не " +"приймають аргумент *timeout*." + +msgid "" +":meth:`asyncio.Future.result` and :meth:`asyncio.Future.exception` raise an :" +"exc:`InvalidStateError` exception when the Future is not *done*." +msgstr "" +":meth:`asyncio.Future.result` і :meth:`asyncio.Future.exception` викликають " +"виняток :exc:`InvalidStateError`, коли Future не *виконано*." + +msgid "" +"Callbacks registered with :meth:`asyncio.Future.add_done_callback` are not " +"called immediately. They are scheduled with :meth:`loop.call_soon` instead." +msgstr "" +"Зворотні виклики, зареєстровані за допомогою :meth:`asyncio.Future." +"add_done_callback`, не викликаються негайно. Натомість вони плануються за " +"допомогою :meth:`loop.call_soon`." + +msgid "" +"asyncio Future is not compatible with the :func:`concurrent.futures.wait` " +"and :func:`concurrent.futures.as_completed` functions." +msgstr "" +"asyncio Future несумісний із функціями :func:`concurrent.futures.wait` і :" +"func:`concurrent.futures.as_completed`." + +msgid "" +":meth:`asyncio.Future.cancel` accepts an optional ``msg`` argument, but :" +"meth:`concurrent.futures.Future.cancel` does not." +msgstr "" diff --git a/library/asyncio-llapi-index.po b/library/asyncio-llapi-index.po new file mode 100644 index 000000000..9acef0d23 --- /dev/null +++ b/library/asyncio-llapi-index.po @@ -0,0 +1,847 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:55+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Low-level API Index" +msgstr "Індекс API низького рівня" + +msgid "This page lists all low-level asyncio APIs." +msgstr "На цій сторінці перераховано всі асинхронні API низького рівня." + +msgid "Obtaining the Event Loop" +msgstr "Отримання циклу подій" + +msgid ":func:`asyncio.get_running_loop`" +msgstr ":func:`asyncio.get_running_loop`" + +msgid "The **preferred** function to get the running event loop." +msgstr "**Переважна** функція для отримання запущеного циклу подій." + +msgid ":func:`asyncio.get_event_loop`" +msgstr ":func:`asyncio.get_event_loop`" + +msgid "Get an event loop instance (running or current via the current policy)." +msgstr "" + +msgid ":func:`asyncio.set_event_loop`" +msgstr ":func:`asyncio.set_event_loop`" + +msgid "Set the event loop as current via the current policy." +msgstr "Установіть цикл подій як поточний за допомогою поточної політики." + +msgid ":func:`asyncio.new_event_loop`" +msgstr ":func:`asyncio.new_event_loop`" + +msgid "Create a new event loop." +msgstr "Створіть новий цикл подій." + +msgid "Examples" +msgstr "Приклади" + +msgid ":ref:`Using asyncio.get_running_loop() `." +msgstr "" +":ref:`Використання asyncio.get_running_loop() `." + +msgid "Event Loop Methods" +msgstr "Методи циклу подій" + +msgid "" +"See also the main documentation section about the :ref:`asyncio-event-loop-" +"methods`." +msgstr "" + +msgid "Lifecycle" +msgstr "Життєвий цикл" + +msgid ":meth:`loop.run_until_complete`" +msgstr ":meth:`loop.run_until_complete`" + +msgid "Run a Future/Task/awaitable until complete." +msgstr "Запустіть Future/Task/waitable до завершення." + +msgid ":meth:`loop.run_forever`" +msgstr ":meth:`loop.run_forever`" + +msgid "Run the event loop forever." +msgstr "Запустити цикл подій назавжди." + +msgid ":meth:`loop.stop`" +msgstr ":meth:`loop.stop`" + +msgid "Stop the event loop." +msgstr "Зупиніть цикл подій." + +msgid ":meth:`loop.close`" +msgstr ":meth:`loop.close`" + +msgid "Close the event loop." +msgstr "Закрийте цикл подій." + +msgid ":meth:`loop.is_running`" +msgstr "" + +msgid "Return ``True`` if the event loop is running." +msgstr "Повертає ``True``, якщо запущено цикл подій." + +msgid ":meth:`loop.is_closed`" +msgstr "" + +msgid "Return ``True`` if the event loop is closed." +msgstr "Повертає ``True``, якщо цикл події закрито." + +msgid "``await`` :meth:`loop.shutdown_asyncgens`" +msgstr "``чекати`` :meth:`loop.shutdown_asyncgens`" + +msgid "Close asynchronous generators." +msgstr "Закрити асинхронні генератори." + +msgid "Debugging" +msgstr "Налагодження" + +msgid ":meth:`loop.set_debug`" +msgstr ":meth:`loop.set_debug`" + +msgid "Enable or disable the debug mode." +msgstr "Увімкніть або вимкніть режим налагодження." + +msgid ":meth:`loop.get_debug`" +msgstr ":meth:`loop.get_debug`" + +msgid "Get the current debug mode." +msgstr "Отримати поточний режим налагодження." + +msgid "Scheduling Callbacks" +msgstr "Планування зворотних викликів" + +msgid ":meth:`loop.call_soon`" +msgstr ":meth:`loop.call_soon`" + +msgid "Invoke a callback soon." +msgstr "Незабаром викликайте зворотний дзвінок." + +msgid ":meth:`loop.call_soon_threadsafe`" +msgstr ":meth:`loop.call_soon_threadsafe`" + +msgid "A thread-safe variant of :meth:`loop.call_soon`." +msgstr "Потоково-безпечний варіант :meth:`loop.call_soon`." + +msgid ":meth:`loop.call_later`" +msgstr ":meth:`loop.call_later`" + +msgid "Invoke a callback *after* the given time." +msgstr "Викликати зворотний виклик *після* вказаного часу." + +msgid ":meth:`loop.call_at`" +msgstr ":meth:`loop.call_at`" + +msgid "Invoke a callback *at* the given time." +msgstr "Викликати зворотний виклик *у* вказаний час." + +msgid "Thread/Process Pool" +msgstr "Пул потоків/процесів" + +msgid "``await`` :meth:`loop.run_in_executor`" +msgstr "``чекати`` :meth:`loop.run_in_executor`" + +msgid "" +"Run a CPU-bound or other blocking function in a :mod:`concurrent.futures` " +"executor." +msgstr "" +"Запустіть пов’язану з ЦП функцію або іншу функцію блокування у виконавці :" +"mod:`concurrent.futures`." + +msgid ":meth:`loop.set_default_executor`" +msgstr ":meth:`loop.set_default_executor`" + +msgid "Set the default executor for :meth:`loop.run_in_executor`." +msgstr "" +"Встановити виконавця за замовчуванням для :meth:`loop.run_in_executor`." + +msgid "Tasks and Futures" +msgstr "Завдання та майбутнє" + +msgid ":meth:`loop.create_future`" +msgstr ":meth:`loop.create_future`" + +msgid "Create a :class:`Future` object." +msgstr "Створіть об’єкт :class:`Future`." + +msgid ":meth:`loop.create_task`" +msgstr ":meth:`loop.create_task`" + +msgid "Schedule coroutine as a :class:`Task`." +msgstr "Розклад співпрограми як :class:`Task`." + +msgid ":meth:`loop.set_task_factory`" +msgstr ":meth:`loop.set_task_factory`" + +msgid "" +"Set a factory used by :meth:`loop.create_task` to create :class:`Tasks " +"`." +msgstr "" +"Установіть фабрику, яку використовує :meth:`loop.create_task` для створення :" +"class:`Tasks `." + +msgid ":meth:`loop.get_task_factory`" +msgstr ":meth:`loop.get_task_factory`" + +msgid "" +"Get the factory :meth:`loop.create_task` uses to create :class:`Tasks " +"`." +msgstr "" +"Отримайте фабрику, яку :meth:`loop.create_task` використовує для створення :" +"class:`Tasks `." + +msgid "DNS" +msgstr "DNS" + +msgid "``await`` :meth:`loop.getaddrinfo`" +msgstr "``чекати`` :meth:`loop.getaddrinfo`" + +msgid "Asynchronous version of :meth:`socket.getaddrinfo`." +msgstr "Асинхронна версія :meth:`socket.getaddrinfo`." + +msgid "``await`` :meth:`loop.getnameinfo`" +msgstr "``чекати`` :meth:`loop.getnameinfo`" + +msgid "Asynchronous version of :meth:`socket.getnameinfo`." +msgstr "Асинхронна версія :meth:`socket.getnameinfo`." + +msgid "Networking and IPC" +msgstr "Мережа та IPC" + +msgid "``await`` :meth:`loop.create_connection`" +msgstr "``чекати`` :meth:`loop.create_connection`" + +msgid "Open a TCP connection." +msgstr "Відкрийте TCP-з'єднання." + +msgid "``await`` :meth:`loop.create_server`" +msgstr "``чекати`` :meth:`loop.create_server`" + +msgid "Create a TCP server." +msgstr "Створіть сервер TCP." + +msgid "``await`` :meth:`loop.create_unix_connection`" +msgstr "``чекати`` :meth:`loop.create_unix_connection`" + +msgid "Open a Unix socket connection." +msgstr "Відкрийте підключення сокета Unix." + +msgid "``await`` :meth:`loop.create_unix_server`" +msgstr "``чекати`` :meth:`loop.create_unix_server`" + +msgid "Create a Unix socket server." +msgstr "Створіть сокет-сервер Unix." + +msgid "``await`` :meth:`loop.connect_accepted_socket`" +msgstr "``чекати`` :meth:`loop.connect_accepted_socket`" + +msgid "Wrap a :class:`~socket.socket` into a ``(transport, protocol)`` pair." +msgstr "Оберніть :class:`~socket.socket` в пару ``(транспорт, протокол)``." + +msgid "``await`` :meth:`loop.create_datagram_endpoint`" +msgstr "``чекати`` :meth:`loop.create_datagram_endpoint`" + +msgid "Open a datagram (UDP) connection." +msgstr "Відкрийте з'єднання дейтаграми (UDP)." + +msgid "``await`` :meth:`loop.sendfile`" +msgstr "``чекати`` :meth:`loop.sendfile`" + +msgid "Send a file over a transport." +msgstr "Надіслати файл через транспорт." + +msgid "``await`` :meth:`loop.start_tls`" +msgstr "``чекати`` :meth:`loop.start_tls`" + +msgid "Upgrade an existing connection to TLS." +msgstr "Оновіть наявне підключення до TLS." + +msgid "``await`` :meth:`loop.connect_read_pipe`" +msgstr "``чекати`` :meth:`loop.connect_read_pipe`" + +msgid "Wrap a read end of a pipe into a ``(transport, protocol)`` pair." +msgstr "Оберніть зчитований кінець каналу в пару ``(транспорт, протокол)``." + +msgid "``await`` :meth:`loop.connect_write_pipe`" +msgstr "``чекати`` :meth:`loop.connect_write_pipe`" + +msgid "Wrap a write end of a pipe into a ``(transport, protocol)`` pair." +msgstr "Оберніть кінець каналу для запису в пару ``(транспорт, протокол)``." + +msgid "Sockets" +msgstr "Сокети" + +msgid "``await`` :meth:`loop.sock_recv`" +msgstr "``чекати`` :meth:`loop.sock_recv`" + +msgid "Receive data from the :class:`~socket.socket`." +msgstr "Отримувати дані з :class:`~socket.socket`." + +msgid "``await`` :meth:`loop.sock_recv_into`" +msgstr "``чекати`` :meth:`loop.sock_recv_into`" + +msgid "Receive data from the :class:`~socket.socket` into a buffer." +msgstr "Отримувати дані з :class:`~socket.socket` в буфер." + +msgid "``await`` :meth:`loop.sock_recvfrom`" +msgstr "" + +msgid "Receive a datagram from the :class:`~socket.socket`." +msgstr "" + +msgid "``await`` :meth:`loop.sock_recvfrom_into`" +msgstr "" + +msgid "Receive a datagram from the :class:`~socket.socket` into a buffer." +msgstr "" + +msgid "``await`` :meth:`loop.sock_sendall`" +msgstr "``чекати`` :meth:`loop.sock_sendall`" + +msgid "Send data to the :class:`~socket.socket`." +msgstr "Надсилайте дані до :class:`~socket.socket`." + +msgid "``await`` :meth:`loop.sock_sendto`" +msgstr "" + +msgid "Send a datagram via the :class:`~socket.socket` to the given address." +msgstr "" + +msgid "``await`` :meth:`loop.sock_connect`" +msgstr "``чекати`` :meth:`loop.sock_connect`" + +msgid "Connect the :class:`~socket.socket`." +msgstr "Підключіть :class:`~socket.socket`." + +msgid "``await`` :meth:`loop.sock_accept`" +msgstr "``чекати`` :meth:`loop.sock_accept`" + +msgid "Accept a :class:`~socket.socket` connection." +msgstr "Прийміть підключення :class:`~socket.socket`." + +msgid "``await`` :meth:`loop.sock_sendfile`" +msgstr "``чекати`` :meth:`loop.sock_sendfile`" + +msgid "Send a file over the :class:`~socket.socket`." +msgstr "Надішліть файл через :class:`~socket.socket`." + +msgid ":meth:`loop.add_reader`" +msgstr ":meth:`loop.add_reader`" + +msgid "Start watching a file descriptor for read availability." +msgstr "Почніть переглядати файловий дескриптор на наявність читання." + +msgid ":meth:`loop.remove_reader`" +msgstr ":meth:`loop.remove_reader`" + +msgid "Stop watching a file descriptor for read availability." +msgstr "Припиніть перегляд дескриптора файлу на доступність читання." + +msgid ":meth:`loop.add_writer`" +msgstr ":meth:`loop.add_writer`" + +msgid "Start watching a file descriptor for write availability." +msgstr "Почніть переглядати файловий дескриптор на доступність запису." + +msgid ":meth:`loop.remove_writer`" +msgstr ":meth:`loop.remove_writer`" + +msgid "Stop watching a file descriptor for write availability." +msgstr "Припиніть стежити за доступністю запису в дескрипторі файлів." + +msgid "Unix Signals" +msgstr "Сигнали Unix" + +msgid ":meth:`loop.add_signal_handler`" +msgstr ":meth:`loop.add_signal_handler`" + +msgid "Add a handler for a :mod:`signal`." +msgstr "Додайте обробник для :mod:`signal`." + +msgid ":meth:`loop.remove_signal_handler`" +msgstr ":meth:`loop.remove_signal_handler`" + +msgid "Remove a handler for a :mod:`signal`." +msgstr "Видаліть обробник для :mod:`signal`." + +msgid "Subprocesses" +msgstr "Підпроцеси" + +msgid ":meth:`loop.subprocess_exec`" +msgstr ":meth:`loop.subprocess_exec`" + +msgid "Spawn a subprocess." +msgstr "Створити підпроцес." + +msgid ":meth:`loop.subprocess_shell`" +msgstr ":meth:`loop.subprocess_shell`" + +msgid "Spawn a subprocess from a shell command." +msgstr "Створити підпроцес із команди оболонки." + +msgid "Error Handling" +msgstr "Обробка помилок" + +msgid ":meth:`loop.call_exception_handler`" +msgstr ":meth:`loop.call_exception_handler`" + +msgid "Call the exception handler." +msgstr "Виклик обробника винятків." + +msgid ":meth:`loop.set_exception_handler`" +msgstr ":meth:`loop.set_exception_handler`" + +msgid "Set a new exception handler." +msgstr "Встановити новий обробник винятків." + +msgid ":meth:`loop.get_exception_handler`" +msgstr ":meth:`loop.get_exception_handler`" + +msgid "Get the current exception handler." +msgstr "Отримати поточний обробник винятків." + +msgid ":meth:`loop.default_exception_handler`" +msgstr ":meth:`loop.default_exception_handler`" + +msgid "The default exception handler implementation." +msgstr "Реалізація обробника винятків за замовчуванням." + +msgid "" +":ref:`Using asyncio.new_event_loop() and loop.run_forever() " +"`." +msgstr "" + +msgid ":ref:`Using loop.call_later() `." +msgstr ":ref:`Використання loop.call_later() `." + +msgid "" +"Using ``loop.create_connection()`` to implement :ref:`an echo-client " +"`." +msgstr "" +"Використання ``loop.create_connection()`` для реалізації :ref:`ехо-клієнта " +"`." + +msgid "" +"Using ``loop.create_connection()`` to :ref:`connect a socket " +"`." +msgstr "" +"Використання ``loop.create_connection()`` для :ref:`підключення сокета " +"`." + +msgid "" +":ref:`Using add_reader() to watch an FD for read events " +"`." +msgstr "" +":ref:`Використання add_reader() для перегляду FD для подій читання " +"`." + +msgid ":ref:`Using loop.add_signal_handler() `." +msgstr "" +":ref:`Використання loop.add_signal_handler() `." + +msgid ":ref:`Using loop.subprocess_exec() `." +msgstr "" +":ref:`Використання loop.subprocess_exec() " +"`." + +msgid "Transports" +msgstr "Транспорти" + +msgid "All transports implement the following methods:" +msgstr "Усі транспорти реалізують такі методи:" + +msgid ":meth:`transport.close() `" +msgstr ":meth:`transport.close() `" + +msgid "Close the transport." +msgstr "Закрити транспорт." + +msgid ":meth:`transport.is_closing() `" +msgstr ":meth:`transport.is_closing() `" + +msgid "Return ``True`` if the transport is closing or is closed." +msgstr "Повертає ``True``, якщо транспорт закривається або закритий." + +msgid ":meth:`transport.get_extra_info() `" +msgstr ":meth:`transport.get_extra_info() `" + +msgid "Request for information about the transport." +msgstr "Запит інформації про транспорт." + +msgid ":meth:`transport.set_protocol() `" +msgstr ":meth:`transport.set_protocol() `" + +msgid "Set a new protocol." +msgstr "Встановіть новий протокол." + +msgid ":meth:`transport.get_protocol() `" +msgstr ":meth:`transport.get_protocol() `" + +msgid "Return the current protocol." +msgstr "Повернути поточний протокол." + +msgid "" +"Transports that can receive data (TCP and Unix connections, pipes, etc). " +"Returned from methods like :meth:`loop.create_connection`, :meth:`loop." +"create_unix_connection`, :meth:`loop.connect_read_pipe`, etc:" +msgstr "" +"Транспорти, які можуть отримувати дані (з’єднання TCP і Unix, канали тощо). " +"Повертається з таких методів, як :meth:`loop.create_connection`, :meth:`loop." +"create_unix_connection`, :meth:`loop.connect_read_pipe` тощо:" + +msgid "Read Transports" +msgstr "Читайте Транспорт" + +msgid ":meth:`transport.is_reading() `" +msgstr ":meth:`transport.is_reading() `" + +msgid "Return ``True`` if the transport is receiving." +msgstr "Повертає ``True``, якщо транспорт отримує." + +msgid ":meth:`transport.pause_reading() `" +msgstr ":meth:`transport.pause_reading() `" + +msgid "Pause receiving." +msgstr "Призупинити отримання." + +msgid ":meth:`transport.resume_reading() `" +msgstr ":meth:`transport.resume_reading() `" + +msgid "Resume receiving." +msgstr "Відновити прийом." + +msgid "" +"Transports that can Send data (TCP and Unix connections, pipes, etc). " +"Returned from methods like :meth:`loop.create_connection`, :meth:`loop." +"create_unix_connection`, :meth:`loop.connect_write_pipe`, etc:" +msgstr "" +"Транспорти, які можуть надсилати дані (з’єднання TCP і Unix, канали тощо). " +"Повертається з таких методів, як :meth:`loop.create_connection`, :meth:`loop." +"create_unix_connection`, :meth:`loop.connect_write_pipe` тощо:" + +msgid "Write Transports" +msgstr "Напишіть Транспорти" + +msgid ":meth:`transport.write() `" +msgstr ":meth:`transport.write() `" + +msgid "Write data to the transport." +msgstr "Записати дані в транспорт." + +msgid ":meth:`transport.writelines() `" +msgstr ":meth:`transport.writelines() `" + +msgid "Write buffers to the transport." +msgstr "Записати буфери в транспорт." + +msgid ":meth:`transport.can_write_eof() `" +msgstr ":meth:`transport.can_write_eof() `" + +msgid "Return :const:`True` if the transport supports sending EOF." +msgstr "Повертає :const:`True`, якщо транспорт підтримує надсилання EOF." + +msgid ":meth:`transport.write_eof() `" +msgstr ":meth:`transport.write_eof() `" + +msgid "Close and send EOF after flushing buffered data." +msgstr "Закрийте та надішліть EOF після очищення буферизованих даних." + +msgid ":meth:`transport.abort() `" +msgstr ":meth:`transport.abort() `" + +msgid "Close the transport immediately." +msgstr "Негайно закрити транспорт." + +msgid "" +":meth:`transport.get_write_buffer_size() `" +msgstr "" +":meth:`transport.get_write_buffer_size() `" + +msgid "Return the current size of the output buffer." +msgstr "" + +msgid "" +":meth:`transport.get_write_buffer_limits() `" +msgstr "" + +msgid "Return high and low water marks for write flow control." +msgstr "" +"Повернути верхні та нижні водяні позначки для керування потоком запису." + +msgid "" +":meth:`transport.set_write_buffer_limits() `" +msgstr "" +":meth:`transport.set_write_buffer_limits() `" + +msgid "Set new high and low water marks for write flow control." +msgstr "" +"Встановіть нові позначки верхнього та нижнього рівня для контролю потоку " +"запису." + +msgid "Transports returned by :meth:`loop.create_datagram_endpoint`:" +msgstr "Транспорти, повернуті :meth:`loop.create_datagram_endpoint`:" + +msgid "Datagram Transports" +msgstr "Транспортування дейтаграм" + +msgid ":meth:`transport.sendto() `" +msgstr ":meth:`transport.sendto() `" + +msgid "Send data to the remote peer." +msgstr "Надсилати дані віддаленому одноранговому пристрою." + +msgid ":meth:`transport.abort() `" +msgstr ":meth:`transport.abort() `" + +msgid "" +"Low-level transport abstraction over subprocesses. Returned by :meth:`loop." +"subprocess_exec` and :meth:`loop.subprocess_shell`:" +msgstr "" +"Низькорівнева транспортна абстракція над підпроцесами. Повертається :meth:" +"`loop.subprocess_exec` і :meth:`loop.subprocess_shell`:" + +msgid "Subprocess Transports" +msgstr "Транспортування підпроцесів" + +msgid ":meth:`transport.get_pid() `" +msgstr ":meth:`transport.get_pid() `" + +msgid "Return the subprocess process id." +msgstr "Повернути ідентифікатор процесу підпроцесу." + +msgid "" +":meth:`transport.get_pipe_transport() `" +msgstr "" +":meth:`transport.get_pipe_transport() `" + +msgid "" +"Return the transport for the requested communication pipe (*stdin*, " +"*stdout*, or *stderr*)." +msgstr "" +"Повернути транспорт для запитуваного каналу зв’язку (*stdin*, *stdout* або " +"*stderr*)." + +msgid ":meth:`transport.get_returncode() `" +msgstr "" +":meth:`transport.get_returncode() `" + +msgid "Return the subprocess return code." +msgstr "Повернути код повернення підпроцесу." + +msgid ":meth:`transport.kill() `" +msgstr ":meth:`transport.kill() `" + +msgid "Kill the subprocess." +msgstr "Закрийте підпроцес." + +msgid ":meth:`transport.send_signal() `" +msgstr ":meth:`transport.send_signal() `" + +msgid "Send a signal to the subprocess." +msgstr "Надішліть сигнал підпроцесу." + +msgid ":meth:`transport.terminate() `" +msgstr ":meth:`transport.terminate() `" + +msgid "Stop the subprocess." +msgstr "Зупиніть підпроцес." + +msgid ":meth:`transport.close() `" +msgstr ":meth:`transport.close() `" + +msgid "Kill the subprocess and close all pipes." +msgstr "Закрийте підпроцес і закрийте всі канали." + +msgid "Protocols" +msgstr "Протоколи" + +msgid "Protocol classes can implement the following **callback methods**:" +msgstr "" +"Класи протоколів можуть реалізовувати такі **методи зворотного виклику**:" + +msgid "``callback`` :meth:`connection_made() `" +msgstr "" +"``зворотний виклик`` :meth:`connection_made() `" + +msgid "Called when a connection is made." +msgstr "Викликається, коли встановлено з'єднання." + +msgid "``callback`` :meth:`connection_lost() `" +msgstr "" +"``зворотний виклик`` :meth:`connection_lost() `" + +msgid "Called when the connection is lost or closed." +msgstr "Викликається, коли з'єднання втрачено або закрито." + +msgid "``callback`` :meth:`pause_writing() `" +msgstr "" +"``зворотний виклик`` :meth:`pause_writing() `" + +msgid "Called when the transport's buffer goes over the high water mark." +msgstr "Викликається, коли транспортний буфер перевищує позначку високої води." + +msgid "``callback`` :meth:`resume_writing() `" +msgstr "" +"``зворотний виклик`` :meth:`resume_writing() `" + +msgid "Called when the transport's buffer drains below the low water mark." +msgstr "" +"Викликається, коли буфер транспорту стікає нижче позначки низького рівня " +"води." + +msgid "Streaming Protocols (TCP, Unix Sockets, Pipes)" +msgstr "Протоколи потокової передачі (TCP, Unix-сокети, канали)" + +msgid "``callback`` :meth:`data_received() `" +msgstr "``зворотний виклик`` :meth:`data_received() `" + +msgid "Called when some data is received." +msgstr "Викликається при отриманні деяких даних." + +msgid "``callback`` :meth:`eof_received() `" +msgstr "``зворотний виклик`` :meth:`eof_received() `" + +msgid "Called when an EOF is received." +msgstr "Викликається, коли отримано EOF." + +msgid "Buffered Streaming Protocols" +msgstr "Буферизовані потокові протоколи" + +msgid "``callback`` :meth:`get_buffer() `" +msgstr "" +"``зворотний виклик`` :meth:`get_buffer() `" + +msgid "Called to allocate a new receive buffer." +msgstr "Викликається для виділення нового буфера отримання." + +msgid "``callback`` :meth:`buffer_updated() `" +msgstr "" +"``зворотний виклик`` :meth:`buffer_updated() `" + +msgid "Called when the buffer was updated with the received data." +msgstr "Викликається, коли буфер оновлюється отриманими даними." + +msgid "``callback`` :meth:`eof_received() `" +msgstr "" +"``зворотний виклик`` :meth:`eof_received() `" + +msgid "Datagram Protocols" +msgstr "Протоколи дейтаграм" + +msgid "" +"``callback`` :meth:`datagram_received() `" +msgstr "" +"``зворотний виклик`` :meth:`datagram_received() `" + +msgid "Called when a datagram is received." +msgstr "Викликається, коли отримано дейтаграму." + +msgid "``callback`` :meth:`error_received() `" +msgstr "" +"``зворотний виклик`` :meth:`error_received() `" + +msgid "" +"Called when a previous send or receive operation raises an :class:`OSError`." +msgstr "" +"Викликається, коли попередня операція надсилання чи отримання викликає :" +"class:`OSError`." + +msgid "Subprocess Protocols" +msgstr "Протоколи підпроцесів" + +msgid "``callback`` :meth:`~SubprocessProtocol.pipe_data_received`" +msgstr "" + +msgid "" +"Called when the child process writes data into its *stdout* or *stderr* pipe." +msgstr "" +"Викликається, коли дочірній процес записує дані у свій канал *stdout* або " +"*stderr*." + +msgid "``callback`` :meth:`~SubprocessProtocol.pipe_connection_lost`" +msgstr "" + +msgid "" +"Called when one of the pipes communicating with the child process is closed." +msgstr "" +"Викликається, коли одна з труб, що спілкуються з дочірнім процесом, закрита." + +msgid "" +"``callback`` :meth:`process_exited() `" +msgstr "" +"``зворотний виклик`` :meth:`process_exited() `" + +msgid "" +"Called when the child process has exited. It can be called before :meth:" +"`~SubprocessProtocol.pipe_data_received` and :meth:`~SubprocessProtocol." +"pipe_connection_lost` methods." +msgstr "" + +msgid "Event Loop Policies" +msgstr "Політики циклу подій" + +msgid "" +"Policies is a low-level mechanism to alter the behavior of functions like :" +"func:`asyncio.get_event_loop`. See also the main :ref:`policies section " +"` for more details." +msgstr "" +"Політики — це механізм низького рівня для зміни поведінки таких функцій, як :" +"func:`asyncio.get_event_loop`. Перегляньте також основний :ref:`розділ " +"правил ` для отримання додаткової інформації." + +msgid "Accessing Policies" +msgstr "Доступ до політик" + +msgid ":meth:`asyncio.get_event_loop_policy`" +msgstr ":meth:`asyncio.get_event_loop_policy`" + +msgid "Return the current process-wide policy." +msgstr "Повернути поточну політику для всього процесу." + +msgid ":meth:`asyncio.set_event_loop_policy`" +msgstr ":meth:`asyncio.set_event_loop_policy`" + +msgid "Set a new process-wide policy." +msgstr "Установіть нову політику для всього процесу." + +msgid ":class:`AbstractEventLoopPolicy`" +msgstr ":class:`AbstractEventLoopPolicy`" + +msgid "Base class for policy objects." +msgstr "Базовий клас для об’єктів політики." diff --git a/library/asyncio-platforms.po b/library/asyncio-platforms.po new file mode 100644 index 000000000..8c848967c --- /dev/null +++ b/library/asyncio-platforms.po @@ -0,0 +1,177 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:55+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Platform Support" +msgstr "Підтримка платформи" + +msgid "" +"The :mod:`asyncio` module is designed to be portable, but some platforms " +"have subtle differences and limitations due to the platforms' underlying " +"architecture and capabilities." +msgstr "" +"Модуль :mod:`asyncio` розроблений як портативний, але деякі платформи мають " +"незначні відмінності та обмеження через базову архітектуру та можливості " +"платформ." + +msgid "All Platforms" +msgstr "Усі платформи" + +msgid "" +":meth:`loop.add_reader` and :meth:`loop.add_writer` cannot be used to " +"monitor file I/O." +msgstr "" +":meth:`loop.add_reader` і :meth:`loop.add_writer` не можна використовувати " +"для моніторингу файлового введення/виведення." + +msgid "Windows" +msgstr "вікна" + +msgid "" +"**Source code:** :source:`Lib/asyncio/proactor_events.py`, :source:`Lib/" +"asyncio/windows_events.py`, :source:`Lib/asyncio/windows_utils.py`" +msgstr "" +"**Вихідний код:** :source:`Lib/asyncio/proactor_events.py`, :source:`Lib/" +"asyncio/windows_events.py`, :source:`Lib/asyncio/windows_utils.py`" + +msgid "On Windows, :class:`ProactorEventLoop` is now the default event loop." +msgstr "" +"У Windows :class:`ProactorEventLoop` тепер є циклом подій за замовчуванням." + +msgid "All event loops on Windows do not support the following methods:" +msgstr "Усі цикли подій у Windows не підтримують такі методи:" + +msgid "" +":meth:`loop.create_unix_connection` and :meth:`loop.create_unix_server` are " +"not supported. The :const:`socket.AF_UNIX` socket family is specific to Unix." +msgstr "" + +msgid "" +":meth:`loop.add_signal_handler` and :meth:`loop.remove_signal_handler` are " +"not supported." +msgstr "" +":meth:`loop.add_signal_handler` і :meth:`loop.remove_signal_handler` не " +"підтримуються." + +msgid ":class:`SelectorEventLoop` has the following limitations:" +msgstr ":class:`SelectorEventLoop` має такі обмеження:" + +msgid "" +":class:`~selectors.SelectSelector` is used to wait on socket events: it " +"supports sockets and is limited to 512 sockets." +msgstr "" +":class:`~selectors.SelectSelector` використовується для очікування подій " +"сокетів: він підтримує сокети та обмежений 512 сокетами." + +msgid "" +":meth:`loop.add_reader` and :meth:`loop.add_writer` only accept socket " +"handles (e.g. pipe file descriptors are not supported)." +msgstr "" +":meth:`loop.add_reader` і :meth:`loop.add_writer` приймають лише дескриптори " +"сокетів (наприклад, дескриптори каналів файлів не підтримуються)." + +msgid "" +"Pipes are not supported, so the :meth:`loop.connect_read_pipe` and :meth:" +"`loop.connect_write_pipe` methods are not implemented." +msgstr "" +"Канали не підтримуються, тому методи :meth:`loop.connect_read_pipe` і :meth:" +"`loop.connect_write_pipe` не реалізовані." + +msgid "" +":ref:`Subprocesses ` are not supported, i.e. :meth:`loop." +"subprocess_exec` and :meth:`loop.subprocess_shell` methods are not " +"implemented." +msgstr "" +":ref:`Підпроцеси ` не підтримуються, тобто методи :meth:" +"`loop.subprocess_exec` і :meth:`loop.subprocess_shell` не реалізовані." + +msgid ":class:`ProactorEventLoop` has the following limitations:" +msgstr ":class:`ProactorEventLoop` має такі обмеження:" + +msgid "" +"The :meth:`loop.add_reader` and :meth:`loop.add_writer` methods are not " +"supported." +msgstr "" +"Методи :meth:`loop.add_reader` і :meth:`loop.add_writer` не підтримуються." + +msgid "" +"The resolution of the monotonic clock on Windows is usually around 15.6 " +"milliseconds. The best resolution is 0.5 milliseconds. The resolution " +"depends on the hardware (availability of `HPET `_) and on the Windows configuration." +msgstr "" + +msgid "Subprocess Support on Windows" +msgstr "Підтримка підпроцесів у Windows" + +msgid "" +"On Windows, the default event loop :class:`ProactorEventLoop` supports " +"subprocesses, whereas :class:`SelectorEventLoop` does not." +msgstr "" +"У Windows типовий цикл подій :class:`ProactorEventLoop` підтримує " +"підпроцеси, тоді як :class:`SelectorEventLoop` не підтримує." + +msgid "" +"The :meth:`policy.set_child_watcher() ` function is also not supported, as :class:" +"`ProactorEventLoop` has a different mechanism to watch child processes." +msgstr "" +"Функція :meth:`policy.set_child_watcher() ` також не підтримується, оскільки :class:" +"`ProactorEventLoop` має інший механізм для спостереження за дочірніми " +"процесами." + +msgid "macOS" +msgstr "macOS" + +msgid "Modern macOS versions are fully supported." +msgstr "Сучасні версії macOS повністю підтримуються." + +msgid "macOS <= 10.8" +msgstr "macOS <= 10.8" + +msgid "" +"On macOS 10.6, 10.7 and 10.8, the default event loop uses :class:`selectors." +"KqueueSelector`, which does not support character devices on these " +"versions. The :class:`SelectorEventLoop` can be manually configured to use :" +"class:`~selectors.SelectSelector` or :class:`~selectors.PollSelector` to " +"support character devices on these older versions of macOS. Example::" +msgstr "" +"У macOS 10.6, 10.7 і 10.8 цикл подій за замовчуванням використовує :class:" +"`selectors.KqueueSelector`, який не підтримує символьні пристрої в цих " +"версіях. :class:`SelectorEventLoop` можна вручну налаштувати на " +"використання :class:`~selectors.SelectSelector` або :class:`~selectors." +"PollSelector` для підтримки символьних пристроїв у цих старіших версіях " +"macOS. Приклад::" + +msgid "" +"import asyncio\n" +"import selectors\n" +"\n" +"selector = selectors.SelectSelector()\n" +"loop = asyncio.SelectorEventLoop(selector)\n" +"asyncio.set_event_loop(loop)" +msgstr "" diff --git a/library/asyncio-policy.po b/library/asyncio-policy.po new file mode 100644 index 000000000..5b51e4eb5 --- /dev/null +++ b/library/asyncio-policy.po @@ -0,0 +1,423 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:55+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Policies" +msgstr "політики" + +msgid "" +"An event loop policy is a global object used to get and set the current :ref:" +"`event loop `, as well as create new event loops. The " +"default policy can be :ref:`replaced ` with :ref:" +"`built-in alternatives ` to use different event loop " +"implementations, or substituted by a :ref:`custom policy ` that can override these behaviors." +msgstr "" + +msgid "" +"The :ref:`policy object ` gets and sets a separate " +"event loop per *context*. This is per-thread by default, though custom " +"policies could define *context* differently." +msgstr "" + +msgid "" +"Custom event loop policies can control the behavior of :func:" +"`get_event_loop`, :func:`set_event_loop`, and :func:`new_event_loop`." +msgstr "" + +msgid "" +"Policy objects should implement the APIs defined in the :class:" +"`AbstractEventLoopPolicy` abstract base class." +msgstr "" +"Об’єкти політики мають реалізовувати API, визначені в :class:" +"`AbstractEventLoopPolicy` абстрактному базовому класі." + +msgid "Getting and Setting the Policy" +msgstr "Отримання та налаштування політики" + +msgid "" +"The following functions can be used to get and set the policy for the " +"current process:" +msgstr "" +"Наступні функції можна використовувати для отримання та налаштування " +"політики для поточного процесу:" + +msgid "Return the current process-wide policy." +msgstr "Повернути поточну політику для всього процесу." + +msgid "Set the current process-wide policy to *policy*." +msgstr "Установіть поточну політику для всього процесу на *policy*." + +msgid "If *policy* is set to ``None``, the default policy is restored." +msgstr "" +"Якщо *policy* встановлено на ``None``, політика за замовчуванням буде " +"відновлена." + +msgid "Policy Objects" +msgstr "Об'єкти політики" + +msgid "The abstract event loop policy base class is defined as follows:" +msgstr "" +"Базовий клас політики абстрактного циклу подій визначається наступним чином:" + +msgid "An abstract base class for asyncio policies." +msgstr "Абстрактний базовий клас для асинхронних політик." + +msgid "Get the event loop for the current context." +msgstr "Отримати цикл подій для поточного контексту." + +msgid "" +"Return an event loop object implementing the :class:`AbstractEventLoop` " +"interface." +msgstr "" +"Повертає об’єкт циклу подій, що реалізує інтерфейс :class:" +"`AbstractEventLoop`." + +msgid "This method should never return ``None``." +msgstr "Цей метод ніколи не повинен повертати ``None``." + +msgid "Set the event loop for the current context to *loop*." +msgstr "Встановіть для циклу подій для поточного контексту значення *loop*." + +msgid "Create and return a new event loop object." +msgstr "Створити та повернути новий об’єкт циклу подій." + +msgid "Get a child process watcher object." +msgstr "Отримайте дочірній об’єкт спостереження за процесом." + +msgid "" +"Return a watcher object implementing the :class:`AbstractChildWatcher` " +"interface." +msgstr "" +"Повертає об’єкт спостереження, що реалізує інтерфейс :class:" +"`AbstractChildWatcher`." + +msgid "This function is Unix specific." +msgstr "Ця функція є специфічною для Unix." + +msgid "Set the current child process watcher to *watcher*." +msgstr "" +"Встановіть для поточного спостерігача дочірнього процесу значення *watcher*." + +msgid "asyncio ships with the following built-in policies:" +msgstr "asyncio поставляється з такими вбудованими політиками:" + +msgid "" +"The default asyncio policy. Uses :class:`SelectorEventLoop` on Unix and :" +"class:`ProactorEventLoop` on Windows." +msgstr "" +"Стандартна асинхронна політика. Використовує :class:`SelectorEventLoop` в " +"Unix і :class:`ProactorEventLoop` у Windows." + +msgid "" +"There is no need to install the default policy manually. asyncio is " +"configured to use the default policy automatically." +msgstr "" +"Немає необхідності встановлювати стандартну політику вручну. asyncio " +"налаштовано на автоматичне використання політики за замовчуванням." + +msgid "On Windows, :class:`ProactorEventLoop` is now used by default." +msgstr "" +"У Windows :class:`ProactorEventLoop` тепер використовується за замовчуванням." + +msgid "" +"The :meth:`get_event_loop` method of the default asyncio policy now emits a :" +"exc:`DeprecationWarning` if there is no current event loop set and it " +"decides to create one. In some future Python release this will become an " +"error." +msgstr "" + +msgid "" +"An alternative event loop policy that uses the :class:`SelectorEventLoop` " +"event loop implementation." +msgstr "" +"Альтернативна політика циклу подій, яка використовує реалізацію циклу подій :" +"class:`SelectorEventLoop`." + +msgid "Availability" +msgstr "" + +msgid "" +"An alternative event loop policy that uses the :class:`ProactorEventLoop` " +"event loop implementation." +msgstr "" +"Альтернативна політика циклу подій, яка використовує реалізацію циклу подій :" +"class:`ProactorEventLoop`." + +msgid "Process Watchers" +msgstr "Спостерігачі процесів" + +msgid "" +"A process watcher allows customization of how an event loop monitors child " +"processes on Unix. Specifically, the event loop needs to know when a child " +"process has exited." +msgstr "" +"Спостерігач процесів дозволяє налаштувати те, як цикл подій відстежує " +"дочірні процеси в Unix. Зокрема, цикл подій повинен знати, коли завершився " +"дочірній процес." + +msgid "" +"In asyncio, child processes are created with :func:`create_subprocess_exec` " +"and :meth:`loop.subprocess_exec` functions." +msgstr "" +"В asyncio дочірні процеси створюються за допомогою функцій :func:" +"`create_subprocess_exec` і :meth:`loop.subprocess_exec`." + +msgid "" +"asyncio defines the :class:`AbstractChildWatcher` abstract base class, which " +"child watchers should implement, and has four different implementations: :" +"class:`ThreadedChildWatcher` (configured to be used by default), :class:" +"`MultiLoopChildWatcher`, :class:`SafeChildWatcher`, and :class:" +"`FastChildWatcher`." +msgstr "" +"asyncio визначає абстрактний базовий клас :class:`AbstractChildWatcher`, " +"який повинні реалізувати дочірні спостерігачі, і має чотири різні " +"реалізації: :class:`ThreadedChildWatcher` (налаштований для використання за " +"замовчуванням), :class:`MultiLoopChildWatcher`, :class:`SafeChildWatcher` і :" +"class:`FastChildWatcher`." + +msgid "" +"See also the :ref:`Subprocess and Threads ` " +"section." +msgstr "" +"Дивіться також розділ :ref:`Subprocess and Threads `." + +msgid "" +"The following two functions can be used to customize the child process " +"watcher implementation used by the asyncio event loop:" +msgstr "" +"Наступні дві функції можна використовувати для налаштування реалізації " +"спостерігача дочірніх процесів, що використовується циклом асинхронних подій:" + +msgid "Return the current child watcher for the current policy." +msgstr "Повертає поточний дочірній спостерігач для поточної політики." + +msgid "" +"Set the current child watcher to *watcher* for the current policy. " +"*watcher* must implement methods defined in the :class:" +"`AbstractChildWatcher` base class." +msgstr "" +"Установіть для поточного дочірнього спостерігача значення *watcher* для " +"поточної політики. *watcher* повинен реалізовувати методи, визначені в " +"базовому класі :class:`AbstractChildWatcher`." + +msgid "" +"Third-party event loops implementations might not support custom child " +"watchers. For such event loops, using :func:`set_child_watcher` might be " +"prohibited or have no effect." +msgstr "" +"Реалізації сторонніх циклів подій можуть не підтримувати користувацькі " +"дочірні спостерігачі. Для таких циклів подій використання :func:" +"`set_child_watcher` може бути заборонено або не матиме ефекту." + +msgid "Register a new child handler." +msgstr "Зареєструвати нового дочірнього обробника." + +msgid "" +"Arrange for ``callback(pid, returncode, *args)`` to be called when a process " +"with PID equal to *pid* terminates. Specifying another callback for the " +"same process replaces the previous handler." +msgstr "" +"Організуйте виклик ``callback(pid, returncode, *args)`` під час завершення " +"процесу з PID, рівним *pid*. Зазначення іншого зворотного виклику для того " +"самого процесу замінює попередній обробник." + +msgid "The *callback* callable must be thread-safe." +msgstr "Функція *callback* має бути потокобезпечною." + +msgid "Removes the handler for process with PID equal to *pid*." +msgstr "Видаляє обробник для процесу з PID рівним *pid*." + +msgid "" +"The function returns ``True`` if the handler was successfully removed, " +"``False`` if there was nothing to remove." +msgstr "" +"Функція повертає ``True``, якщо обробник було успішно видалено, ``False``, " +"якщо не було нічого для видалення." + +msgid "Attach the watcher to an event loop." +msgstr "Приєднайте спостерігач до циклу подій." + +msgid "" +"If the watcher was previously attached to an event loop, then it is first " +"detached before attaching to the new loop." +msgstr "" +"Якщо спостерігач був раніше приєднаний до циклу подій, то він спочатку " +"від'єднується перед приєднанням до нового циклу." + +msgid "Note: loop may be ``None``." +msgstr "Примітка: цикл може бути ``None``." + +msgid "Return ``True`` if the watcher is ready to use." +msgstr "Повертає ``True``, якщо спостерігач готовий до використання." + +msgid "" +"Spawning a subprocess with *inactive* current child watcher raises :exc:" +"`RuntimeError`." +msgstr "" +"Створення підпроцесу з *неактивним* поточним дочірнім спостерігачем " +"викликає :exc:`RuntimeError`." + +msgid "Close the watcher." +msgstr "Закрийте спостерігач." + +msgid "" +"This method has to be called to ensure that underlying resources are cleaned-" +"up." +msgstr "" +"Цей метод потрібно викликати, щоб переконатися, що базові ресурси очищені." + +msgid "" +"This implementation starts a new waiting thread for every subprocess spawn." +msgstr "" +"Ця реалізація запускає новий потік очікування для кожного породження " +"підпроцесу." + +msgid "" +"It works reliably even when the asyncio event loop is run in a non-main OS " +"thread." +msgstr "" +"Він працює надійно, навіть якщо цикл асинхронних подій виконується в " +"неосновному потоці ОС." + +msgid "" +"There is no noticeable overhead when handling a big number of children " +"(*O*\\ (1) each time a child terminates), but starting a thread per process " +"requires extra memory." +msgstr "" + +msgid "This watcher is used by default." +msgstr "Цей спостерігач використовується за замовчуванням." + +msgid "" +"This implementation registers a :py:data:`SIGCHLD` signal handler on " +"instantiation. That can break third-party code that installs a custom " +"handler for :py:data:`SIGCHLD` signal." +msgstr "" +"Ця реалізація реєструє обробник сигналу :py:data:`SIGCHLD` під час створення " +"екземпляра. Це може порушити код третьої сторони, який встановлює " +"спеціальний обробник для сигналу :py:data:`SIGCHLD`." + +msgid "" +"The watcher avoids disrupting other code spawning processes by polling every " +"process explicitly on a :py:data:`SIGCHLD` signal." +msgstr "" +"Спостерігач уникає порушення інших процесів створення коду, явно опитуючи " +"кожен процес за сигналом :py:data:`SIGCHLD`." + +msgid "" +"There is no limitation for running subprocesses from different threads once " +"the watcher is installed." +msgstr "" +"Немає обмежень для запуску підпроцесів з різних потоків після встановлення " +"спостерігача." + +msgid "" +"The solution is safe but it has a significant overhead when handling a big " +"number of processes (*O*\\ (*n*) each time a :py:data:`SIGCHLD` is received)." +msgstr "" + +msgid "" +"This implementation uses active event loop from the main thread to handle :" +"py:data:`SIGCHLD` signal. If the main thread has no running event loop " +"another thread cannot spawn a subprocess (:exc:`RuntimeError` is raised)." +msgstr "" +"Ця реалізація використовує активний цикл подій з основного потоку для " +"обробки сигналу :py:data:`SIGCHLD`. Якщо основний потік не має запущеного " +"циклу подій, інший потік не може породити підпроцес (виникає :exc:" +"`RuntimeError`)." + +msgid "" +"This solution is as safe as :class:`MultiLoopChildWatcher` and has the same " +"*O*\\ (*n*) complexity but requires a running event loop in the main thread " +"to work." +msgstr "" + +msgid "" +"This implementation reaps every terminated processes by calling ``os." +"waitpid(-1)`` directly, possibly breaking other code spawning processes and " +"waiting for their termination." +msgstr "" +"Ця реалізація збирає всі завершені процеси шляхом безпосереднього виклику " +"``os.waitpid(-1)``, можливо, порушуючи інші процеси породження коду та " +"чекаючи їх завершення." + +msgid "" +"There is no noticeable overhead when handling a big number of children " +"(*O*\\ (1) each time a child terminates)." +msgstr "" + +msgid "" +"This solution requires a running event loop in the main thread to work, as :" +"class:`SafeChildWatcher`." +msgstr "" +"Для роботи цього рішення потрібен запущений цикл подій у головному потоці, " +"як :class:`SafeChildWatcher`." + +msgid "" +"This implementation polls process file descriptors (pidfds) to await child " +"process termination. In some respects, :class:`PidfdChildWatcher` is a " +"\"Goldilocks\" child watcher implementation. It doesn't require signals or " +"threads, doesn't interfere with any processes launched outside the event " +"loop, and scales linearly with the number of subprocesses launched by the " +"event loop. The main disadvantage is that pidfds are specific to Linux, and " +"only work on recent (5.3+) kernels." +msgstr "" +"Ця реалізація опитує дескриптори файлів процесу (pidfds) для очікування " +"завершення дочірнього процесу. У деяких відношеннях :class:" +"`PidfdChildWatcher` є реалізацією дочірнього спостерігача \"Золотовласка\". " +"Він не потребує сигналів чи потоків, не заважає жодним процесам, запущеним " +"поза циклом подій, і масштабується лінійно залежно від кількості " +"підпроцесів, запущених циклом подій. Основним недоліком є те, що pidfds є " +"специфічними для Linux і працюють лише на останніх (5.3+) ядрах." + +msgid "Custom Policies" +msgstr "Спеціальна політика" + +msgid "" +"To implement a new event loop policy, it is recommended to subclass :class:" +"`DefaultEventLoopPolicy` and override the methods for which custom behavior " +"is wanted, e.g.::" +msgstr "" +"Щоб запровадити нову політику циклу подій, рекомендується створити підклас :" +"class:`DefaultEventLoopPolicy` і перевизначити методи, для яких потрібна " +"спеціальна поведінка, наприклад::" + +msgid "" +"class MyEventLoopPolicy(asyncio.DefaultEventLoopPolicy):\n" +"\n" +" def get_event_loop(self):\n" +" \"\"\"Get the event loop.\n" +"\n" +" This may be None or an instance of EventLoop.\n" +" \"\"\"\n" +" loop = super().get_event_loop()\n" +" # Do something with loop ...\n" +" return loop\n" +"\n" +"asyncio.set_event_loop_policy(MyEventLoopPolicy())" +msgstr "" diff --git a/library/asyncio-protocol.po b/library/asyncio-protocol.po new file mode 100644 index 000000000..b9f1e4ae2 --- /dev/null +++ b/library/asyncio-protocol.po @@ -0,0 +1,1458 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:55+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Transports and Protocols" +msgstr "Транспорт і протоколи" + +msgid "Preface" +msgstr "Передмова" + +msgid "" +"Transports and Protocols are used by the **low-level** event loop APIs such " +"as :meth:`loop.create_connection`. They use callback-based programming " +"style and enable high-performance implementations of network or IPC " +"protocols (e.g. HTTP)." +msgstr "" +"Транспорти та протоколи використовуються API циклу подій **низького рівня**, " +"наприклад :meth:`loop.create_connection`. Вони використовують стиль " +"програмування на основі зворотного виклику та дозволяють високопродуктивні " +"реалізації мережевих або IPC-протоколів (наприклад, HTTP)." + +msgid "" +"Essentially, transports and protocols should only be used in libraries and " +"frameworks and never in high-level asyncio applications." +msgstr "" +"По суті, транспорти та протоколи слід використовувати лише в бібліотеках і " +"фреймворках, а не в асинхронних програмах високого рівня." + +msgid "This documentation page covers both `Transports`_ and `Protocols`_." +msgstr "Ця сторінка документації охоплює як `Transports`_, так і `Protocols`_." + +msgid "Introduction" +msgstr "Вступ" + +msgid "" +"At the highest level, the transport is concerned with *how* bytes are " +"transmitted, while the protocol determines *which* bytes to transmit (and to " +"some extent when)." +msgstr "" +"На найвищому рівні транспорт стосується того, *як* передаються байти, тоді " +"як протокол визначає, *які* байти передавати (і певною мірою коли)." + +msgid "" +"A different way of saying the same thing: a transport is an abstraction for " +"a socket (or similar I/O endpoint) while a protocol is an abstraction for an " +"application, from the transport's point of view." +msgstr "" +"Інший спосіб сказати те саме: транспорт є абстракцією для сокета (або " +"подібної кінцевої точки вводу/виводу), тоді як протокол є абстракцією для " +"програми з точки зору транспорту." + +msgid "" +"Yet another view is the transport and protocol interfaces together define an " +"abstract interface for using network I/O and interprocess I/O." +msgstr "" +"Ще один погляд полягає в тому, що транспортний і протокольний інтерфейси " +"разом визначають абстрактний інтерфейс для використання мережевого вводу-" +"виводу та міжпроцесного введення-виведення." + +msgid "" +"There is always a 1:1 relationship between transport and protocol objects: " +"the protocol calls transport methods to send data, while the transport calls " +"protocol methods to pass it data that has been received." +msgstr "" +"Між транспортними об’єктами та об’єктами протоколу завжди існує зв’язок 1:1: " +"протокол викликає транспортні методи для надсилання даних, тоді як транспорт " +"викликає протокольні методи для передачі йому отриманих даних." + +msgid "" +"Most of connection oriented event loop methods (such as :meth:`loop." +"create_connection`) usually accept a *protocol_factory* argument used to " +"create a *Protocol* object for an accepted connection, represented by a " +"*Transport* object. Such methods usually return a tuple of ``(transport, " +"protocol)``." +msgstr "" +"Більшість методів циклу подій, орієнтованих на підключення (таких як :meth:" +"`loop.create_connection`), зазвичай приймають аргумент *protocol_factory*, " +"який використовується для створення об’єкта *Protocol* для прийнятного " +"з’єднання, представленого об’єктом *Transport*. Такі методи зазвичай " +"повертають кортеж ``(транспорт, протокол)``." + +msgid "Contents" +msgstr "Зміст" + +msgid "This documentation page contains the following sections:" +msgstr "Ця сторінка документації містить такі розділи:" + +msgid "" +"The `Transports`_ section documents asyncio :class:`BaseTransport`, :class:" +"`ReadTransport`, :class:`WriteTransport`, :class:`Transport`, :class:" +"`DatagramTransport`, and :class:`SubprocessTransport` classes." +msgstr "" +"Розділ `Transports`_ документує asyncio :class:`BaseTransport`, :class:" +"`ReadTransport`, :class:`WriteTransport`, :class:`Transport`, :class:" +"`DatagramTransport` і :class:`SubprocessTransport` класи." + +msgid "" +"The `Protocols`_ section documents asyncio :class:`BaseProtocol`, :class:" +"`Protocol`, :class:`BufferedProtocol`, :class:`DatagramProtocol`, and :class:" +"`SubprocessProtocol` classes." +msgstr "" +"Розділ `Protocols`_ документує асинхронні класи :class:`BaseProtocol`, :" +"class:`Protocol`, :class:`BufferedProtocol`, :class:`DatagramProtocol` і :" +"class:`SubprocessProtocol`." + +msgid "" +"The `Examples`_ section showcases how to work with transports, protocols, " +"and low-level event loop APIs." +msgstr "" +"Розділ `Examples`_ демонструє, як працювати з транспортами, протоколами та " +"API низькорівневого циклу подій." + +msgid "Transports" +msgstr "Транспорти" + +msgid "**Source code:** :source:`Lib/asyncio/transports.py`" +msgstr "**Вихідний код:** :source:`Lib/asyncio/transports.py`" + +msgid "" +"Transports are classes provided by :mod:`asyncio` in order to abstract " +"various kinds of communication channels." +msgstr "" +"Транспорти — це класи, надані :mod:`asyncio` для абстрагування різних видів " +"каналів зв’язку." + +msgid "" +"Transport objects are always instantiated by an :ref:`asyncio event loop " +"`." +msgstr "" +"Транспортні об’єкти завжди створюються :ref:`асинхронним циклом подій " +"`." + +msgid "" +"asyncio implements transports for TCP, UDP, SSL, and subprocess pipes. The " +"methods available on a transport depend on the transport's kind." +msgstr "" +"asyncio реалізує транспорти для каналів TCP, UDP, SSL і підпроцесів. Методи, " +"доступні на транспорті, залежать від типу транспорту." + +msgid "" +"The transport classes are :ref:`not thread safe `." +msgstr "" +"Транспортні класи :ref:`не потоково безпечні `." + +msgid "Transports Hierarchy" +msgstr "Ієрархія транспортів" + +msgid "" +"Base class for all transports. Contains methods that all asyncio transports " +"share." +msgstr "" +"Базовий клас для всіх видів транспорту. Містить методи, спільні для всіх " +"асинхронних транспортів." + +msgid "A base transport for write-only connections." +msgstr "Базовий транспорт для підключень лише для запису." + +msgid "" +"Instances of the *WriteTransport* class are returned from the :meth:`loop." +"connect_write_pipe` event loop method and are also used by subprocess-" +"related methods like :meth:`loop.subprocess_exec`." +msgstr "" +"Екземпляри класу *WriteTransport* повертаються з методу циклу подій :meth:" +"`loop.connect_write_pipe`, а також використовуються пов’язаними з " +"підпроцесами методами, наприклад :meth:`loop.subprocess_exec`." + +msgid "A base transport for read-only connections." +msgstr "Базовий транспорт для підключень лише для читання." + +msgid "" +"Instances of the *ReadTransport* class are returned from the :meth:`loop." +"connect_read_pipe` event loop method and are also used by subprocess-related " +"methods like :meth:`loop.subprocess_exec`." +msgstr "" +"Екземпляри класу *ReadTransport* повертаються з методу циклу подій :meth:" +"`loop.connect_read_pipe`, а також використовуються пов’язаними з " +"підпроцесами методами, наприклад :meth:`loop.subprocess_exec`." + +msgid "" +"Interface representing a bidirectional transport, such as a TCP connection." +msgstr "" +"Інтерфейс, що представляє двонаправлений транспорт, наприклад TCP-з'єднання." + +msgid "" +"The user does not instantiate a transport directly; they call a utility " +"function, passing it a protocol factory and other information necessary to " +"create the transport and protocol." +msgstr "" +"Користувач не створює екземпляр транспорту безпосередньо; вони викликають " +"службову функцію, передаючи їй фабрику протоколів та іншу інформацію, " +"необхідну для створення транспорту та протоколу." + +msgid "" +"Instances of the *Transport* class are returned from or used by event loop " +"methods like :meth:`loop.create_connection`, :meth:`loop." +"create_unix_connection`, :meth:`loop.create_server`, :meth:`loop.sendfile`, " +"etc." +msgstr "" +"Екземпляри класу *Transport* повертаються або використовуються такими " +"методами циклу подій, як :meth:`loop.create_connection`, :meth:`loop." +"create_unix_connection`, :meth:`loop.create_server`, :meth:`loop. sendfile` " +"тощо." + +msgid "A transport for datagram (UDP) connections." +msgstr "Транспорт для з’єднань дейтаграм (UDP)." + +msgid "" +"Instances of the *DatagramTransport* class are returned from the :meth:`loop." +"create_datagram_endpoint` event loop method." +msgstr "" +"Екземпляри класу *DatagramTransport* повертаються з методу циклу подій :meth:" +"`loop.create_datagram_endpoint`." + +msgid "" +"An abstraction to represent a connection between a parent and its child OS " +"process." +msgstr "" +"Абстракція для представлення зв’язку між батьківським і дочірнім процесами " +"ОС." + +msgid "" +"Instances of the *SubprocessTransport* class are returned from event loop " +"methods :meth:`loop.subprocess_shell` and :meth:`loop.subprocess_exec`." +msgstr "" +"Екземпляри класу *SubprocessTransport* повертаються з методів циклу подій :" +"meth:`loop.subprocess_shell` і :meth:`loop.subprocess_exec`." + +msgid "Base Transport" +msgstr "Базовий транспорт" + +msgid "Close the transport." +msgstr "Закрити транспорт." + +msgid "" +"If the transport has a buffer for outgoing data, buffered data will be " +"flushed asynchronously. No more data will be received. After all buffered " +"data is flushed, the protocol's :meth:`protocol.connection_lost() " +"` method will be called with :const:`None` as " +"its argument. The transport should not be used once it is closed." +msgstr "" + +msgid "Return ``True`` if the transport is closing or is closed." +msgstr "Повертає ``True``, якщо транспорт закривається або закритий." + +msgid "Return information about the transport or underlying resources it uses." +msgstr "" +"Повертає інформацію про транспорт або основні ресурси, які він використовує." + +msgid "" +"*name* is a string representing the piece of transport-specific information " +"to get." +msgstr "" +"*ім’я* — це рядок, що представляє частину транспортної інформації, яку " +"потрібно отримати." + +msgid "" +"*default* is the value to return if the information is not available, or if " +"the transport does not support querying it with the given third-party event " +"loop implementation or on the current platform." +msgstr "" +"*default* — це значення, яке повертається, якщо інформація недоступна або " +"якщо транспорт не підтримує її запит за допомогою сторонньої реалізації " +"циклу подій або на поточній платформі." + +msgid "" +"For example, the following code attempts to get the underlying socket object " +"of the transport::" +msgstr "" +"Наприклад, наступний код намагається отримати базовий об’єкт сокета " +"транспорту::" + +msgid "" +"sock = transport.get_extra_info('socket')\n" +"if sock is not None:\n" +" print(sock.getsockopt(...))" +msgstr "" + +msgid "Categories of information that can be queried on some transports:" +msgstr "Категорії інформації, які можна запитувати на деяких транспортах:" + +msgid "socket:" +msgstr "розетка:" + +msgid "" +"``'peername'``: the remote address to which the socket is connected, result " +"of :meth:`socket.socket.getpeername` (``None`` on error)" +msgstr "" +"``'peername'``: віддалена адреса, до якої підключено сокет, результат :meth:" +"`socket.socket.getpeername` (``None`` у разі помилки)" + +msgid "``'socket'``: :class:`socket.socket` instance" +msgstr "``'socket'``: :class:`socket.socket` екземпляр" + +msgid "" +"``'sockname'``: the socket's own address, result of :meth:`socket.socket." +"getsockname`" +msgstr "" +"``'sockname'``: власна адреса сокета, результат :meth:`socket.socket." +"getsockname`" + +msgid "SSL socket:" +msgstr "SSL-сокет:" + +msgid "" +"``'compression'``: the compression algorithm being used as a string, or " +"``None`` if the connection isn't compressed; result of :meth:`ssl.SSLSocket." +"compression`" +msgstr "" +"``'стиснення'``: алгоритм стиснення, що використовується як рядок, або " +"``None``, якщо з'єднання не стиснуте; результат :meth:`ssl.SSLSocket." +"compression`" + +msgid "" +"``'cipher'``: a three-value tuple containing the name of the cipher being " +"used, the version of the SSL protocol that defines its use, and the number " +"of secret bits being used; result of :meth:`ssl.SSLSocket.cipher`" +msgstr "" +"``'cipher'``: кортеж з трьох значень, що містить назву використовуваного " +"шифру, версію протоколу SSL, яка визначає його використання, і кількість " +"секретних бітів, що використовуються; результат :meth:`ssl.SSLSocket.cipher`" + +msgid "" +"``'peercert'``: peer certificate; result of :meth:`ssl.SSLSocket.getpeercert`" +msgstr "" +"``'peercert'``: одноранговий сертифікат; результат :meth:`ssl.SSLSocket." +"getpeercert`" + +msgid "``'sslcontext'``: :class:`ssl.SSLContext` instance" +msgstr "``'sslcontext'``: екземпляр :class:`ssl.SSLContext`" + +msgid "" +"``'ssl_object'``: :class:`ssl.SSLObject` or :class:`ssl.SSLSocket` instance" +msgstr "" +"``'ssl_object'``: :class:`ssl.SSLObject` або :class:`ssl.SSLSocket` екземпляр" + +msgid "pipe:" +msgstr "труба:" + +msgid "``'pipe'``: pipe object" +msgstr "``'pipe'``: об'єкт труби" + +msgid "subprocess:" +msgstr "підпроцес:" + +msgid "``'subprocess'``: :class:`subprocess.Popen` instance" +msgstr "екземпляр ``'subprocess'``: :class:`subprocess.Popen`" + +msgid "Set a new protocol." +msgstr "Встановіть новий протокол." + +msgid "" +"Switching protocol should only be done when both protocols are documented to " +"support the switch." +msgstr "" +"Протокол перемикання слід виконувати лише тоді, коли обидва протоколи " +"задокументовано для підтримки перемикання." + +msgid "Return the current protocol." +msgstr "Повернути поточний протокол." + +msgid "Read-only Transports" +msgstr "Транспорти лише для читання" + +msgid "Return ``True`` if the transport is receiving new data." +msgstr "Повертає ``True``, якщо транспорт отримує нові дані." + +msgid "" +"Pause the receiving end of the transport. No data will be passed to the " +"protocol's :meth:`protocol.data_received() ` method " +"until :meth:`resume_reading` is called." +msgstr "" +"Призупинити приймальний кінець транспорту. Жодні дані не будуть передані в " +"метод протоколу :meth:`protocol.data_received() `, " +"доки не буде викликано :meth:`resume_reading`." + +msgid "" +"The method is idempotent, i.e. it can be called when the transport is " +"already paused or closed." +msgstr "" +"Метод є ідемпотентним, тобто його можна викликати, коли транспорт вже " +"призупинено або закрито." + +msgid "" +"Resume the receiving end. The protocol's :meth:`protocol.data_received() " +"` method will be called once again if some data is " +"available for reading." +msgstr "" +"Відновіть приймальний кінець. Метод :meth:`protocol.data_received() " +"` протоколу буде викликано ще раз, якщо деякі дані " +"доступні для читання." + +msgid "" +"The method is idempotent, i.e. it can be called when the transport is " +"already reading." +msgstr "" +"Метод є ідемпотентним, тобто його можна викликати, коли транспорт вже читає." + +msgid "Write-only Transports" +msgstr "Транспорти лише для запису" + +msgid "" +"Close the transport immediately, without waiting for pending operations to " +"complete. Buffered data will be lost. No more data will be received. The " +"protocol's :meth:`protocol.connection_lost() ` " +"method will eventually be called with :const:`None` as its argument." +msgstr "" +"Закрийте транспорт негайно, не чекаючи завершення незавершених операцій. " +"Буферизовані дані буде втрачено. Дані більше не надходитимуть. Метод :meth:" +"`protocol.connection_lost() ` протоколу " +"зрештою буде викликано з :const:`None` як аргумент." + +msgid "" +"Return :const:`True` if the transport supports :meth:`~WriteTransport." +"write_eof`, :const:`False` if not." +msgstr "" +"Повертає :const:`True`, якщо транспорт підтримує :meth:`~WriteTransport." +"write_eof`, :const:`False`, якщо ні." + +msgid "Return the current size of the output buffer used by the transport." +msgstr "" +"Повертає поточний розмір вихідного буфера, який використовується транспортом." + +msgid "" +"Get the *high* and *low* watermarks for write flow control. Return a tuple " +"``(low, high)`` where *low* and *high* are positive number of bytes." +msgstr "" +"Отримайте *високий* і *низький* водяні знаки для керування потоком запису. " +"Повертає кортеж ``(low, high)``, де *low* і *high* є додатною кількістю " +"байтів." + +msgid "Use :meth:`set_write_buffer_limits` to set the limits." +msgstr "" +"Використовуйте :meth:`set_write_buffer_limits`, щоб встановити обмеження." + +msgid "Set the *high* and *low* watermarks for write flow control." +msgstr "" +"Встановіть *високий* і *низький* водяні знаки для керування потоком запису." + +msgid "" +"These two values (measured in number of bytes) control when the protocol's :" +"meth:`protocol.pause_writing() ` and :meth:" +"`protocol.resume_writing() ` methods are " +"called. If specified, the low watermark must be less than or equal to the " +"high watermark. Neither *high* nor *low* can be negative." +msgstr "" +"Ці два значення (вимірюються в кількості байтів) контролюють, коли " +"викликаються методи протоколу :meth:`protocol.pause_writing() ` і :meth:`protocol.resume_writing() `. Якщо вказано, нижній водяний знак має бути меншим або " +"дорівнювати високому водяному знаку. Ні *високий*, ні *низький* не можуть " +"бути негативними." + +msgid "" +":meth:`~BaseProtocol.pause_writing` is called when the buffer size becomes " +"greater than or equal to the *high* value. If writing has been paused, :meth:" +"`~BaseProtocol.resume_writing` is called when the buffer size becomes less " +"than or equal to the *low* value." +msgstr "" +":meth:`~BaseProtocol.pause_writing` викликається, коли розмір буфера стає " +"більшим або рівним значенню *high*. Якщо запис призупинено, :meth:" +"`~BaseProtocol.resume_writing` викликається, коли розмір буфера стає меншим " +"або рівним *низькому* значенню." + +msgid "" +"The defaults are implementation-specific. If only the high watermark is " +"given, the low watermark defaults to an implementation-specific value less " +"than or equal to the high watermark. Setting *high* to zero forces *low* to " +"zero as well, and causes :meth:`~BaseProtocol.pause_writing` to be called " +"whenever the buffer becomes non-empty. Setting *low* to zero causes :meth:" +"`~BaseProtocol.resume_writing` to be called only once the buffer is empty. " +"Use of zero for either limit is generally sub-optimal as it reduces " +"opportunities for doing I/O and computation concurrently." +msgstr "" +"Значення за замовчуванням залежать від реалізації. Якщо вказано лише високий " +"водяний знак, низький водяний знак за замовчуванням має значення, що " +"залежить від реалізації, менше або дорівнює верхньому водяному знаку. Якщо " +"встановити *high* на нуль, *low* також буде встановлено на нуль і спричинить " +"виклик :meth:`~BaseProtocol.pause_writing` щоразу, коли буфер стає " +"непорожнім. Якщо встановити *low* на нуль, :meth:`~BaseProtocol." +"resume_writing` буде викликатися лише після того, як буфер буде порожнім. " +"Використання нуля для будь-якого обмеження, як правило, є неоптимальним, " +"оскільки воно зменшує можливості одночасного виконання вводу-виводу та " +"обчислень." + +msgid "Use :meth:`~WriteTransport.get_write_buffer_limits` to get the limits." +msgstr "" +"Використовуйте :meth:`~WriteTransport.get_write_buffer_limits`, щоб отримати " +"обмеження." + +msgid "Write some *data* bytes to the transport." +msgstr "Запишіть кілька байтів *data* в транспорт." + +msgid "" +"This method does not block; it buffers the data and arranges for it to be " +"sent out asynchronously." +msgstr "" +"Цей спосіб не блокує; він буферизує дані та організовує їх асинхронне " +"надсилання." + +msgid "" +"Write a list (or any iterable) of data bytes to the transport. This is " +"functionally equivalent to calling :meth:`write` on each element yielded by " +"the iterable, but may be implemented more efficiently." +msgstr "" +"Запишіть список (або будь-яку ітерацію) байтів даних у транспорт. Це " +"функціонально еквівалентно виклику :meth:`write` для кожного елемента, " +"отриманого iterable, але може бути реалізовано більш ефективно." + +msgid "" +"Close the write end of the transport after flushing all buffered data. Data " +"may still be received." +msgstr "" +"Закрийте кінець запису транспорту після очищення всіх буферизованих даних. " +"Дані ще можуть бути отримані." + +msgid "" +"This method can raise :exc:`NotImplementedError` if the transport (e.g. SSL) " +"doesn't support half-closed connections." +msgstr "" +"Цей метод може викликати :exc:`NotImplementedError`, якщо транспорт " +"(наприклад, SSL) не підтримує напівзакриті з’єднання." + +msgid "Datagram Transports" +msgstr "Транспортування дейтаграм" + +msgid "" +"Send the *data* bytes to the remote peer given by *addr* (a transport-" +"dependent target address). If *addr* is :const:`None`, the data is sent to " +"the target address given on transport creation." +msgstr "" +"Надішліть байти *data* до віддаленого однорангового вузла, заданого *addr* " +"(цільова адреса, що залежить від транспорту). Якщо *addr* має значення :" +"const:`None`, дані надсилаються на цільову адресу, указану під час створення " +"транспорту." + +msgid "" +"This method can be called with an empty bytes object to send a zero-length " +"datagram. The buffer size calculation used for flow control is also updated " +"to account for the datagram header." +msgstr "" + +msgid "" +"Close the transport immediately, without waiting for pending operations to " +"complete. Buffered data will be lost. No more data will be received. The " +"protocol's :meth:`protocol.connection_lost() ` " +"method will eventually be called with :const:`None` as its argument." +msgstr "" +"Закрийте транспорт негайно, не чекаючи завершення незавершених операцій. " +"Буферизовані дані буде втрачено. Дані більше не надходитимуть. Метод :meth:" +"`protocol.connection_lost() ` протоколу " +"зрештою буде викликано з :const:`None` як аргумент." + +msgid "Subprocess Transports" +msgstr "Транспортування підпроцесів" + +msgid "Return the subprocess process id as an integer." +msgstr "Повертає ідентифікатор процесу підпроцесу як ціле число." + +msgid "" +"Return the transport for the communication pipe corresponding to the integer " +"file descriptor *fd*:" +msgstr "" +"Повертає транспорт для комунікаційного каналу, що відповідає цілочисельному " +"файловому дескриптору *fd*:" + +msgid "" +"``0``: readable streaming transport of the standard input (*stdin*), or :" +"const:`None` if the subprocess was not created with ``stdin=PIPE``" +msgstr "" +"``0``: доступний для читання потоковий транспорт стандартного введення " +"(*stdin*) або :const:`None`, якщо підпроцес не було створено за допомогою " +"``stdin=PIPE``" + +msgid "" +"``1``: writable streaming transport of the standard output (*stdout*), or :" +"const:`None` if the subprocess was not created with ``stdout=PIPE``" +msgstr "" +"``1``: доступний для запису потоковий транспорт стандартного виводу " +"(*stdout*) або :const:`None`, якщо підпроцес не було створено за допомогою " +"``stdout=PIPE``" + +msgid "" +"``2``: writable streaming transport of the standard error (*stderr*), or :" +"const:`None` if the subprocess was not created with ``stderr=PIPE``" +msgstr "" +"``2``: доступний для запису потоковий транспорт стандартної помилки " +"(*stderr*) або :const:`None`, якщо підпроцес не було створено за допомогою " +"``stderr=PIPE``" + +msgid "other *fd*: :const:`None`" +msgstr "інший *fd*: :const:`None`" + +msgid "" +"Return the subprocess return code as an integer or :const:`None` if it " +"hasn't returned, which is similar to the :attr:`subprocess.Popen.returncode` " +"attribute." +msgstr "" +"Повертає код повернення підпроцесу як ціле число або :const:`None`, якщо він " +"не повернувся, що подібно до атрибута :attr:`subprocess.Popen.returncode`." + +msgid "Kill the subprocess." +msgstr "Закрийте підпроцес." + +msgid "" +"On POSIX systems, the function sends SIGKILL to the subprocess. On Windows, " +"this method is an alias for :meth:`terminate`." +msgstr "" +"У системах POSIX функція надсилає SIGKILL підпроцесу. У Windows цей метод є " +"псевдонімом для :meth:`terminate`." + +msgid "See also :meth:`subprocess.Popen.kill`." +msgstr "Дивіться також :meth:`subprocess.Popen.kill`." + +msgid "" +"Send the *signal* number to the subprocess, as in :meth:`subprocess.Popen." +"send_signal`." +msgstr "" +"Надішліть номер *сигналу* підпроцесу, як у :meth:`subprocess.Popen." +"send_signal`." + +msgid "Stop the subprocess." +msgstr "Зупиніть підпроцес." + +msgid "" +"On POSIX systems, this method sends :py:const:`~signal.SIGTERM` to the " +"subprocess. On Windows, the Windows API function :c:func:`!TerminateProcess` " +"is called to stop the subprocess." +msgstr "" + +msgid "See also :meth:`subprocess.Popen.terminate`." +msgstr "Дивіться також :meth:`subprocess.Popen.terminate`." + +msgid "Kill the subprocess by calling the :meth:`kill` method." +msgstr "Закрийте підпроцес, викликавши метод :meth:`kill`." + +msgid "" +"If the subprocess hasn't returned yet, and close transports of *stdin*, " +"*stdout*, and *stderr* pipes." +msgstr "" +"Якщо підпроцес ще не повернувся, закрийте транспорти каналів *stdin*, " +"*stdout* і *stderr*." + +msgid "Protocols" +msgstr "Протоколи" + +msgid "**Source code:** :source:`Lib/asyncio/protocols.py`" +msgstr "**Вихідний код:** :source:`Lib/asyncio/protocols.py`" + +msgid "" +"asyncio provides a set of abstract base classes that should be used to " +"implement network protocols. Those classes are meant to be used together " +"with :ref:`transports `." +msgstr "" +"asyncio надає набір абстрактних базових класів, які слід використовувати для " +"реалізації мережевих протоколів. Ці класи призначені для використання разом " +"із :ref:`transports `." + +msgid "" +"Subclasses of abstract base protocol classes may implement some or all " +"methods. All these methods are callbacks: they are called by transports on " +"certain events, for example when some data is received. A base protocol " +"method should be called by the corresponding transport." +msgstr "" +"Підкласи абстрактних базових класів протоколу можуть реалізовувати деякі або " +"всі методи. Усі ці методи є зворотними викликами: вони викликаються " +"транспортами під час певних подій, наприклад, коли надходять якісь дані. " +"Метод базового протоколу має викликатися відповідним транспортом." + +msgid "Base Protocols" +msgstr "Базові протоколи" + +msgid "Base protocol with methods that all protocols share." +msgstr "Базовий протокол із методами, які використовують усі протоколи." + +msgid "" +"The base class for implementing streaming protocols (TCP, Unix sockets, etc)." +msgstr "" +"Базовий клас для реалізації потокових протоколів (TCP, Unix-сокети тощо)." + +msgid "" +"A base class for implementing streaming protocols with manual control of the " +"receive buffer." +msgstr "" +"Базовий клас для реалізації потокових протоколів із ручним керуванням " +"приймальним буфером." + +msgid "The base class for implementing datagram (UDP) protocols." +msgstr "Базовий клас для реалізації протоколів дейтаграм (UDP)." + +msgid "" +"The base class for implementing protocols communicating with child processes " +"(unidirectional pipes)." +msgstr "" +"Базовий клас для реалізації протоколів, що спілкуються з дочірніми процесами " +"(односпрямовані канали)." + +msgid "Base Protocol" +msgstr "Базовий протокол" + +msgid "All asyncio protocols can implement Base Protocol callbacks." +msgstr "" +"Усі асинхронні протоколи можуть реалізовувати зворотні виклики базового " +"протоколу." + +msgid "Connection Callbacks" +msgstr "Зворотні виклики підключення" + +msgid "" +"Connection callbacks are called on all protocols, exactly once per a " +"successful connection. All other protocol callbacks can only be called " +"between those two methods." +msgstr "" +"Зворотні виклики підключення викликаються для всіх протоколів рівно один раз " +"за успішне підключення. Усі інші зворотні виклики протоколу можна викликати " +"лише між цими двома методами." + +msgid "Called when a connection is made." +msgstr "Викликається, коли встановлено з'єднання." + +msgid "" +"The *transport* argument is the transport representing the connection. The " +"protocol is responsible for storing the reference to its transport." +msgstr "" +"Аргумент *transport* — це транспорт, що представляє з’єднання. Протокол " +"відповідає за збереження посилання на свій транспорт." + +msgid "Called when the connection is lost or closed." +msgstr "Викликається, коли з'єднання втрачено або закрито." + +msgid "" +"The argument is either an exception object or :const:`None`. The latter " +"means a regular EOF is received, or the connection was aborted or closed by " +"this side of the connection." +msgstr "" +"Аргументом є або об’єкт винятку, або :const:`None`. Останнє означає, що " +"отримано звичайний EOF, або з’єднання було перервано чи закрито цією " +"стороною з’єднання." + +msgid "Flow Control Callbacks" +msgstr "Зворотні виклики керування потоком" + +msgid "" +"Flow control callbacks can be called by transports to pause or resume " +"writing performed by the protocol." +msgstr "" +"Зворотні виклики керування потоком можуть бути викликані транспортами, щоб " +"призупинити або відновити запис, який виконується протоколом." + +msgid "" +"See the documentation of the :meth:`~WriteTransport.set_write_buffer_limits` " +"method for more details." +msgstr "" +"Додаткову інформацію дивіться в документації методу :meth:`~WriteTransport." +"set_write_buffer_limits`." + +msgid "Called when the transport's buffer goes over the high watermark." +msgstr "Викликається, коли транспортний буфер переходить верхній водяний знак." + +msgid "Called when the transport's buffer drains below the low watermark." +msgstr "" +"Викликається, коли транспортний буфер закінчується нижче низького водяного " +"знака." + +msgid "" +"If the buffer size equals the high watermark, :meth:`~BaseProtocol." +"pause_writing` is not called: the buffer size must go strictly over." +msgstr "" +"Якщо розмір буфера дорівнює верхньому водяному знаку, :meth:`~BaseProtocol." +"pause_writing` не викликається: розмір буфера має суворо перевищувати." + +msgid "" +"Conversely, :meth:`~BaseProtocol.resume_writing` is called when the buffer " +"size is equal or lower than the low watermark. These end conditions are " +"important to ensure that things go as expected when either mark is zero." +msgstr "" +"І навпаки, :meth:`~BaseProtocol.resume_writing` викликається, коли розмір " +"буфера дорівнює або менше ніж нижній водяний знак. Ці кінцеві умови важливі " +"для забезпечення того, щоб усе відбувалося так, як очікувалося, коли будь-" +"яка позначка дорівнює нулю." + +msgid "Streaming Protocols" +msgstr "Протоколи потокової передачі" + +msgid "" +"Event methods, such as :meth:`loop.create_server`, :meth:`loop." +"create_unix_server`, :meth:`loop.create_connection`, :meth:`loop." +"create_unix_connection`, :meth:`loop.connect_accepted_socket`, :meth:`loop." +"connect_read_pipe`, and :meth:`loop.connect_write_pipe` accept factories " +"that return streaming protocols." +msgstr "" +"Методи подій, такі як :meth:`loop.create_server`, :meth:`loop." +"create_unix_server`, :meth:`loop.create_connection`, :meth:`loop." +"create_unix_connection`, :meth:`loop.connect_accepted_socket`, :meth:`loop." +"connect_read_pipe` і :meth:`loop.connect_write_pipe` приймають фабрики, які " +"повертають потокові протоколи." + +msgid "" +"Called when some data is received. *data* is a non-empty bytes object " +"containing the incoming data." +msgstr "" +"Викликається при отриманні деяких даних. *data* — це об’єкт із непорожніми " +"байтами, що містить вхідні дані." + +msgid "" +"Whether the data is buffered, chunked or reassembled depends on the " +"transport. In general, you shouldn't rely on specific semantics and instead " +"make your parsing generic and flexible. However, data is always received in " +"the correct order." +msgstr "" +"Від транспортування залежить, чи будуть дані буферизовані, фрагментовані чи " +"повторно зібрані. Загалом, вам не слід покладатися на конкретну семантику, а " +"натомість робити аналіз загальним і гнучким. Однак дані завжди надходять у " +"правильному порядку." + +msgid "" +"The method can be called an arbitrary number of times while a connection is " +"open." +msgstr "" +"Метод можна викликати довільну кількість разів, поки з’єднання відкрито." + +msgid "" +"However, :meth:`protocol.eof_received() ` is called " +"at most once. Once ``eof_received()`` is called, ``data_received()`` is not " +"called anymore." +msgstr "" + +msgid "" +"Called when the other end signals it won't send any more data (for example " +"by calling :meth:`transport.write_eof() `, if the " +"other end also uses asyncio)." +msgstr "" +"Викликається, коли інший кінець сигналізує, що більше не надсилатиме даних " +"(наприклад, викликом :meth:`transport.write_eof() `, якщо інший кінець також використовує asyncio)." + +msgid "" +"This method may return a false value (including ``None``), in which case the " +"transport will close itself. Conversely, if this method returns a true " +"value, the protocol used determines whether to close the transport. Since " +"the default implementation returns ``None``, it implicitly closes the " +"connection." +msgstr "" +"Цей метод може повернути хибне значення (включаючи ``None``), у цьому " +"випадку транспорт закриється сам. І навпаки, якщо цей метод повертає істинне " +"значення, протокол, який використовується, визначає, чи закривати транспорт. " +"Оскільки реалізація за замовчуванням повертає ``None``, вона неявно закриває " +"з’єднання." + +msgid "" +"Some transports, including SSL, don't support half-closed connections, in " +"which case returning true from this method will result in the connection " +"being closed." +msgstr "" +"Деякі транспортні засоби, включно з SSL, не підтримують напівзакриті " +"з’єднання, і в цьому випадку повернення true з цього методу призведе до " +"закриття з’єднання." + +msgid "State machine:" +msgstr "Державна машина:" + +msgid "" +"start -> connection_made\n" +" [-> data_received]*\n" +" [-> eof_received]?\n" +"-> connection_lost -> end" +msgstr "" + +msgid "Buffered Streaming Protocols" +msgstr "Буферизовані потокові протоколи" + +msgid "" +"Buffered Protocols can be used with any event loop method that supports " +"`Streaming Protocols`_." +msgstr "" +"Буферизовані протоколи можна використовувати з будь-яким методом циклу " +"подій, який підтримує `Streaming Protocols`_." + +msgid "" +"``BufferedProtocol`` implementations allow explicit manual allocation and " +"control of the receive buffer. Event loops can then use the buffer provided " +"by the protocol to avoid unnecessary data copies. This can result in " +"noticeable performance improvement for protocols that receive big amounts of " +"data. Sophisticated protocol implementations can significantly reduce the " +"number of buffer allocations." +msgstr "" +"Реалізації ``BufferedProtocol`` дозволяють явно вручну розподіляти та " +"контролювати буфер отримання. Потім цикли подій можуть використовувати " +"буфер, наданий протоколом, щоб уникнути непотрібних копій даних. Це може " +"призвести до помітного підвищення продуктивності для протоколів, які " +"отримують великі обсяги даних. Складні реалізації протоколів можуть значно " +"зменшити кількість розподілів буферів." + +msgid "" +"The following callbacks are called on :class:`BufferedProtocol` instances:" +msgstr "" +"Наступні зворотні виклики викликаються в екземплярах :class:" +"`BufferedProtocol`:" + +msgid "Called to allocate a new receive buffer." +msgstr "Викликається для виділення нового буфера отримання." + +msgid "" +"*sizehint* is the recommended minimum size for the returned buffer. It is " +"acceptable to return smaller or larger buffers than what *sizehint* " +"suggests. When set to -1, the buffer size can be arbitrary. It is an error " +"to return a buffer with a zero size." +msgstr "" +"*sizehint* — рекомендований мінімальний розмір для поверненого буфера. " +"Дозволено повертати менші або більші буфери, ніж пропонує *sizehint*. Якщо " +"встановлено значення -1, розмір буфера може бути довільним. Помилкою є " +"повернення буфера з нульовим розміром." + +msgid "" +"``get_buffer()`` must return an object implementing the :ref:`buffer " +"protocol `." +msgstr "" +"``get_buffer()`` має повертати об’єкт, що реалізує :ref:`протокол буфера " +"`." + +msgid "Called when the buffer was updated with the received data." +msgstr "Викликається, коли буфер оновлюється отриманими даними." + +msgid "*nbytes* is the total number of bytes that were written to the buffer." +msgstr "*nbytes* — це загальна кількість байтів, які були записані в буфер." + +msgid "" +"See the documentation of the :meth:`protocol.eof_received() ` method." +msgstr "" +"Перегляньте документацію методу :meth:`protocol.eof_received() `." + +msgid "" +":meth:`~BufferedProtocol.get_buffer` can be called an arbitrary number of " +"times during a connection. However, :meth:`protocol.eof_received() " +"` is called at most once and, if called, :meth:" +"`~BufferedProtocol.get_buffer` and :meth:`~BufferedProtocol.buffer_updated` " +"won't be called after it." +msgstr "" +":meth:`~BufferedProtocol.get_buffer` можна викликати довільну кількість " +"разів під час з’єднання. Однак :meth:`protocol.eof_received() ` викликається щонайбільше один раз, і, якщо буде викликано, :" +"meth:`~BufferedProtocol.get_buffer` і :meth:`~BufferedProtocol." +"buffer_updated` не будуть викликатися після нього." + +msgid "" +"start -> connection_made\n" +" [-> get_buffer\n" +" [-> buffer_updated]?\n" +" ]*\n" +" [-> eof_received]?\n" +"-> connection_lost -> end" +msgstr "" + +msgid "Datagram Protocols" +msgstr "Протоколи дейтаграм" + +msgid "" +"Datagram Protocol instances should be constructed by protocol factories " +"passed to the :meth:`loop.create_datagram_endpoint` method." +msgstr "" +"Екземпляри протоколу дейтаграм мають бути створені фабриками протоколів, " +"переданими в метод :meth:`loop.create_datagram_endpoint`." + +msgid "" +"Called when a datagram is received. *data* is a bytes object containing the " +"incoming data. *addr* is the address of the peer sending the data; the " +"exact format depends on the transport." +msgstr "" +"Викликається, коли отримано дейтаграму. *data* — це об’єкт bytes, що містить " +"вхідні дані. *addr* — це адреса вузла, який надсилає дані; точний формат " +"залежить від транспорту." + +msgid "" +"Called when a previous send or receive operation raises an :class:" +"`OSError`. *exc* is the :class:`OSError` instance." +msgstr "" +"Викликається, коли попередня операція надсилання чи отримання викликає :" +"class:`OSError`. *exc* — це екземпляр :class:`OSError`." + +msgid "" +"This method is called in rare conditions, when the transport (e.g. UDP) " +"detects that a datagram could not be delivered to its recipient. In many " +"conditions though, undeliverable datagrams will be silently dropped." +msgstr "" +"Цей метод викликається в рідкісних випадках, коли транспорт (наприклад, UDP) " +"виявляє, що дейтаграму не вдалося доставити одержувачу. Однак у багатьох " +"випадках дейтаграми, які неможливо доставити, будуть мовчки видалені." + +msgid "" +"On BSD systems (macOS, FreeBSD, etc.) flow control is not supported for " +"datagram protocols, because there is no reliable way to detect send failures " +"caused by writing too many packets." +msgstr "" +"У системах BSD (macOS, FreeBSD тощо) керування потоком не підтримується для " +"протоколів дейтаграм, оскільки немає надійного способу виявити помилки " +"надсилання, спричинені записом занадто великої кількості пакетів." + +msgid "" +"The socket always appears 'ready' and excess packets are dropped. An :class:" +"`OSError` with ``errno`` set to :const:`errno.ENOBUFS` may or may not be " +"raised; if it is raised, it will be reported to :meth:`DatagramProtocol." +"error_received` but otherwise ignored." +msgstr "" +"Сокет завжди виглядає \"готовим\", а зайві пакети відкидаються. Помилка :" +"class:`OSEror` з ``errno`` встановленим на :const:`errno.ENOBUFS` може " +"виникати або не виникати; якщо воно піднято, про це буде повідомлено :meth:" +"`DatagramProtocol.error_received`, але в інших випадках воно буде " +"проігноровано." + +msgid "Subprocess Protocols" +msgstr "Протоколи підпроцесів" + +msgid "" +"Subprocess Protocol instances should be constructed by protocol factories " +"passed to the :meth:`loop.subprocess_exec` and :meth:`loop.subprocess_shell` " +"methods." +msgstr "" +"Екземпляри протоколу підпроцесу мають бути створені фабриками протоколів, " +"переданими методам :meth:`loop.subprocess_exec` і :meth:`loop." +"subprocess_shell`." + +msgid "" +"Called when the child process writes data into its stdout or stderr pipe." +msgstr "" +"Викликається, коли дочірній процес записує дані в канал stdout або stderr." + +msgid "*fd* is the integer file descriptor of the pipe." +msgstr "*fd* — цілочисельний файловий дескриптор каналу." + +msgid "*data* is a non-empty bytes object containing the received data." +msgstr "*data* — об’єкт із непорожніми байтами, що містить отримані дані." + +msgid "" +"Called when one of the pipes communicating with the child process is closed." +msgstr "" +"Викликається, коли одна з труб, що спілкуються з дочірнім процесом, закрита." + +msgid "*fd* is the integer file descriptor that was closed." +msgstr "*fd* — цілочисельний файловий дескриптор, який було закрито." + +msgid "Called when the child process has exited." +msgstr "Викликається, коли дочірній процес завершився." + +msgid "" +"It can be called before :meth:`~SubprocessProtocol.pipe_data_received` and :" +"meth:`~SubprocessProtocol.pipe_connection_lost` methods." +msgstr "" + +msgid "Examples" +msgstr "Приклади" + +msgid "TCP Echo Server" +msgstr "TCP Echo Server" + +msgid "" +"Create a TCP echo server using the :meth:`loop.create_server` method, send " +"back received data, and close the connection::" +msgstr "" +"Створіть TCP-сервер ехо за допомогою методу :meth:`loop.create_server`, " +"надішліть назад отримані дані та закрийте з’єднання::" + +msgid "" +"import asyncio\n" +"\n" +"\n" +"class EchoServerProtocol(asyncio.Protocol):\n" +" def connection_made(self, transport):\n" +" peername = transport.get_extra_info('peername')\n" +" print('Connection from {}'.format(peername))\n" +" self.transport = transport\n" +"\n" +" def data_received(self, data):\n" +" message = data.decode()\n" +" print('Data received: {!r}'.format(message))\n" +"\n" +" print('Send: {!r}'.format(message))\n" +" self.transport.write(data)\n" +"\n" +" print('Close the client socket')\n" +" self.transport.close()\n" +"\n" +"\n" +"async def main():\n" +" # Get a reference to the event loop as we plan to use\n" +" # low-level APIs.\n" +" loop = asyncio.get_running_loop()\n" +"\n" +" server = await loop.create_server(\n" +" EchoServerProtocol,\n" +" '127.0.0.1', 8888)\n" +"\n" +" async with server:\n" +" await server.serve_forever()\n" +"\n" +"\n" +"asyncio.run(main())" +msgstr "" + +msgid "" +"The :ref:`TCP echo server using streams ` " +"example uses the high-level :func:`asyncio.start_server` function." +msgstr "" +"У прикладі :ref:`TCP echo server using streams ` використовується функція :func:`asyncio.start_server` високого " +"рівня." + +msgid "TCP Echo Client" +msgstr "TCP Echo Client" + +msgid "" +"A TCP echo client using the :meth:`loop.create_connection` method, sends " +"data, and waits until the connection is closed::" +msgstr "" +"TCP-клієнт відлуння, використовуючи метод :meth:`loop.create_connection`, " +"надсилає дані та чекає, доки з’єднання не буде закрито::" + +msgid "" +"import asyncio\n" +"\n" +"\n" +"class EchoClientProtocol(asyncio.Protocol):\n" +" def __init__(self, message, on_con_lost):\n" +" self.message = message\n" +" self.on_con_lost = on_con_lost\n" +"\n" +" def connection_made(self, transport):\n" +" transport.write(self.message.encode())\n" +" print('Data sent: {!r}'.format(self.message))\n" +"\n" +" def data_received(self, data):\n" +" print('Data received: {!r}'.format(data.decode()))\n" +"\n" +" def connection_lost(self, exc):\n" +" print('The server closed the connection')\n" +" self.on_con_lost.set_result(True)\n" +"\n" +"\n" +"async def main():\n" +" # Get a reference to the event loop as we plan to use\n" +" # low-level APIs.\n" +" loop = asyncio.get_running_loop()\n" +"\n" +" on_con_lost = loop.create_future()\n" +" message = 'Hello World!'\n" +"\n" +" transport, protocol = await loop.create_connection(\n" +" lambda: EchoClientProtocol(message, on_con_lost),\n" +" '127.0.0.1', 8888)\n" +"\n" +" # Wait until the protocol signals that the connection\n" +" # is lost and close the transport.\n" +" try:\n" +" await on_con_lost\n" +" finally:\n" +" transport.close()\n" +"\n" +"\n" +"asyncio.run(main())" +msgstr "" + +msgid "" +"The :ref:`TCP echo client using streams ` " +"example uses the high-level :func:`asyncio.open_connection` function." +msgstr "" +"У прикладі :ref:`TCP echo client using streams ` використовується функція :func:`asyncio.open_connection` високого " +"рівня." + +msgid "UDP Echo Server" +msgstr "Сервер UDP Echo" + +msgid "" +"A UDP echo server, using the :meth:`loop.create_datagram_endpoint` method, " +"sends back received data::" +msgstr "" +"Ехо-сервер UDP за допомогою методу :meth:`loop.create_datagram_endpoint` " +"повертає отримані дані:" + +msgid "" +"import asyncio\n" +"\n" +"\n" +"class EchoServerProtocol:\n" +" def connection_made(self, transport):\n" +" self.transport = transport\n" +"\n" +" def datagram_received(self, data, addr):\n" +" message = data.decode()\n" +" print('Received %r from %s' % (message, addr))\n" +" print('Send %r to %s' % (message, addr))\n" +" self.transport.sendto(data, addr)\n" +"\n" +"\n" +"async def main():\n" +" print(\"Starting UDP server\")\n" +"\n" +" # Get a reference to the event loop as we plan to use\n" +" # low-level APIs.\n" +" loop = asyncio.get_running_loop()\n" +"\n" +" # One protocol instance will be created to serve all\n" +" # client requests.\n" +" transport, protocol = await loop.create_datagram_endpoint(\n" +" EchoServerProtocol,\n" +" local_addr=('127.0.0.1', 9999))\n" +"\n" +" try:\n" +" await asyncio.sleep(3600) # Serve for 1 hour.\n" +" finally:\n" +" transport.close()\n" +"\n" +"\n" +"asyncio.run(main())" +msgstr "" + +msgid "UDP Echo Client" +msgstr "UDP Echo Client" + +msgid "" +"A UDP echo client, using the :meth:`loop.create_datagram_endpoint` method, " +"sends data and closes the transport when it receives the answer::" +msgstr "" +"Ехо-клієнт UDP, використовуючи метод :meth:`loop.create_datagram_endpoint`, " +"надсилає дані та закриває транспорт, коли отримує відповідь:" + +msgid "" +"import asyncio\n" +"\n" +"\n" +"class EchoClientProtocol:\n" +" def __init__(self, message, on_con_lost):\n" +" self.message = message\n" +" self.on_con_lost = on_con_lost\n" +" self.transport = None\n" +"\n" +" def connection_made(self, transport):\n" +" self.transport = transport\n" +" print('Send:', self.message)\n" +" self.transport.sendto(self.message.encode())\n" +"\n" +" def datagram_received(self, data, addr):\n" +" print(\"Received:\", data.decode())\n" +"\n" +" print(\"Close the socket\")\n" +" self.transport.close()\n" +"\n" +" def error_received(self, exc):\n" +" print('Error received:', exc)\n" +"\n" +" def connection_lost(self, exc):\n" +" print(\"Connection closed\")\n" +" self.on_con_lost.set_result(True)\n" +"\n" +"\n" +"async def main():\n" +" # Get a reference to the event loop as we plan to use\n" +" # low-level APIs.\n" +" loop = asyncio.get_running_loop()\n" +"\n" +" on_con_lost = loop.create_future()\n" +" message = \"Hello World!\"\n" +"\n" +" transport, protocol = await loop.create_datagram_endpoint(\n" +" lambda: EchoClientProtocol(message, on_con_lost),\n" +" remote_addr=('127.0.0.1', 9999))\n" +"\n" +" try:\n" +" await on_con_lost\n" +" finally:\n" +" transport.close()\n" +"\n" +"\n" +"asyncio.run(main())" +msgstr "" + +msgid "Connecting Existing Sockets" +msgstr "Підключення наявних розеток" + +msgid "" +"Wait until a socket receives data using the :meth:`loop.create_connection` " +"method with a protocol::" +msgstr "" +"Зачекайте, поки сокет отримає дані за допомогою методу :meth:`loop." +"create_connection` з протоколом::" + +msgid "" +"import asyncio\n" +"import socket\n" +"\n" +"\n" +"class MyProtocol(asyncio.Protocol):\n" +"\n" +" def __init__(self, on_con_lost):\n" +" self.transport = None\n" +" self.on_con_lost = on_con_lost\n" +"\n" +" def connection_made(self, transport):\n" +" self.transport = transport\n" +"\n" +" def data_received(self, data):\n" +" print(\"Received:\", data.decode())\n" +"\n" +" # We are done: close the transport;\n" +" # connection_lost() will be called automatically.\n" +" self.transport.close()\n" +"\n" +" def connection_lost(self, exc):\n" +" # The socket has been closed\n" +" self.on_con_lost.set_result(True)\n" +"\n" +"\n" +"async def main():\n" +" # Get a reference to the event loop as we plan to use\n" +" # low-level APIs.\n" +" loop = asyncio.get_running_loop()\n" +" on_con_lost = loop.create_future()\n" +"\n" +" # Create a pair of connected sockets\n" +" rsock, wsock = socket.socketpair()\n" +"\n" +" # Register the socket to wait for data.\n" +" transport, protocol = await loop.create_connection(\n" +" lambda: MyProtocol(on_con_lost), sock=rsock)\n" +"\n" +" # Simulate the reception of data from the network.\n" +" loop.call_soon(wsock.send, 'abc'.encode())\n" +"\n" +" try:\n" +" await protocol.on_con_lost\n" +" finally:\n" +" transport.close()\n" +" wsock.close()\n" +"\n" +"asyncio.run(main())" +msgstr "" + +msgid "" +"The :ref:`watch a file descriptor for read events " +"` example uses the low-level :meth:`loop." +"add_reader` method to register an FD." +msgstr "" +"У прикладі :ref:`спостерігати за файловим дескриптором для подій читання " +"` використовується метод низького рівня :meth:" +"`loop.add_reader` для реєстрації FD." + +msgid "" +"The :ref:`register an open socket to wait for data using streams " +"` example uses high-level streams " +"created by the :func:`open_connection` function in a coroutine." +msgstr "" +"У прикладі :ref:`register an open socket to wait for data using streams " +"` використовуються потоки " +"високого рівня, створені функцією :func:`open_connection` у співпрограмі." + +msgid "loop.subprocess_exec() and SubprocessProtocol" +msgstr "loop.subprocess_exec() і SubprocessProtocol" + +msgid "" +"An example of a subprocess protocol used to get the output of a subprocess " +"and to wait for the subprocess exit." +msgstr "" +"Приклад протоколу підпроцесу, який використовується для отримання " +"результатів підпроцесу та очікування виходу підпроцесу." + +msgid "The subprocess is created by the :meth:`loop.subprocess_exec` method::" +msgstr "Підпроцес створюється методом :meth:`loop.subprocess_exec`::" + +msgid "" +"import asyncio\n" +"import sys\n" +"\n" +"class DateProtocol(asyncio.SubprocessProtocol):\n" +" def __init__(self, exit_future):\n" +" self.exit_future = exit_future\n" +" self.output = bytearray()\n" +" self.pipe_closed = False\n" +" self.exited = False\n" +"\n" +" def pipe_connection_lost(self, fd, exc):\n" +" self.pipe_closed = True\n" +" self.check_for_exit()\n" +"\n" +" def pipe_data_received(self, fd, data):\n" +" self.output.extend(data)\n" +"\n" +" def process_exited(self):\n" +" self.exited = True\n" +" # process_exited() method can be called before\n" +" # pipe_connection_lost() method: wait until both methods are\n" +" # called.\n" +" self.check_for_exit()\n" +"\n" +" def check_for_exit(self):\n" +" if self.pipe_closed and self.exited:\n" +" self.exit_future.set_result(True)\n" +"\n" +"async def get_date():\n" +" # Get a reference to the event loop as we plan to use\n" +" # low-level APIs.\n" +" loop = asyncio.get_running_loop()\n" +"\n" +" code = 'import datetime; print(datetime.datetime.now())'\n" +" exit_future = asyncio.Future(loop=loop)\n" +"\n" +" # Create the subprocess controlled by DateProtocol;\n" +" # redirect the standard output into a pipe.\n" +" transport, protocol = await loop.subprocess_exec(\n" +" lambda: DateProtocol(exit_future),\n" +" sys.executable, '-c', code,\n" +" stdin=None, stderr=None)\n" +"\n" +" # Wait for the subprocess exit using the process_exited()\n" +" # method of the protocol.\n" +" await exit_future\n" +"\n" +" # Close the stdout pipe.\n" +" transport.close()\n" +"\n" +" # Read the output which was collected by the\n" +" # pipe_data_received() method of the protocol.\n" +" data = bytes(protocol.output)\n" +" return data.decode('ascii').rstrip()\n" +"\n" +"date = asyncio.run(get_date())\n" +"print(f\"Current date: {date}\")" +msgstr "" + +msgid "" +"See also the :ref:`same example ` " +"written using high-level APIs." +msgstr "" +"Дивіться також :ref:`той самий приклад " +"`, написаний з використанням API " +"високого рівня." diff --git a/library/asyncio-queue.po b/library/asyncio-queue.po new file mode 100644 index 000000000..5c5b2b27a --- /dev/null +++ b/library/asyncio-queue.po @@ -0,0 +1,305 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-04 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:55+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Queues" +msgstr "Черги" + +msgid "**Source code:** :source:`Lib/asyncio/queues.py`" +msgstr "**Вихідний код:** :source:`Lib/asyncio/queues.py`" + +msgid "" +"asyncio queues are designed to be similar to classes of the :mod:`queue` " +"module. Although asyncio queues are not thread-safe, they are designed to " +"be used specifically in async/await code." +msgstr "" +"асинхронні черги розроблені таким чином, щоб бути подібними до класів " +"модуля :mod:`queue`. Хоча асинхронні черги не є потокобезпечними, вони " +"розроблені спеціально для використання в асинхронному коді/коді очікування." + +msgid "" +"Note that methods of asyncio queues don't have a *timeout* parameter; use :" +"func:`asyncio.wait_for` function to do queue operations with a timeout." +msgstr "" +"Зауважте, що методи асинхронних черг не мають параметра *timeout*; " +"використовуйте функцію :func:`asyncio.wait_for`, щоб виконувати операції в " +"черзі з тайм-аутом." + +msgid "See also the `Examples`_ section below." +msgstr "Дивіться також розділ `Examples`_ нижче." + +msgid "Queue" +msgstr "Чергу" + +msgid "A first in, first out (FIFO) queue." +msgstr "Черга першим прийшов, першим вийшов (FIFO)." + +msgid "" +"If *maxsize* is less than or equal to zero, the queue size is infinite. If " +"it is an integer greater than ``0``, then ``await put()`` blocks when the " +"queue reaches *maxsize* until an item is removed by :meth:`get`." +msgstr "" +"Якщо *maxsize* менше або дорівнює нулю, розмір черги є нескінченним. Якщо це " +"ціле число, більше за ``0``, тоді ``await put()`` блокує, коли черга досягає " +"*maxsize*, доки елемент не буде видалено :meth:`get`." + +msgid "" +"Unlike the standard library threading :mod:`queue`, the size of the queue is " +"always known and can be returned by calling the :meth:`qsize` method." +msgstr "" +"На відміну від стандартної потокової обробки бібліотеки :mod:`queue`, розмір " +"черги завжди відомий і може бути повернутий викликом методу :meth:`qsize`." + +msgid "Removed the *loop* parameter." +msgstr "Видалено параметр *loop*." + +msgid "This class is :ref:`not thread safe `." +msgstr "Цей клас :ref:`не потоково безпечний `." + +msgid "Number of items allowed in the queue." +msgstr "Кількість елементів, дозволених у черзі." + +msgid "Return ``True`` if the queue is empty, ``False`` otherwise." +msgstr "Повертає ``True``, якщо черга порожня, ``False`` інакше." + +msgid "Return ``True`` if there are :attr:`maxsize` items in the queue." +msgstr "Повертає ``True``, якщо в черзі є елементи :attr:`maxsize`." + +msgid "" +"If the queue was initialized with ``maxsize=0`` (the default), then :meth:" +"`full` never returns ``True``." +msgstr "" + +msgid "" +"Remove and return an item from the queue. If queue is empty, wait until an " +"item is available." +msgstr "" +"Видалити та повернути елемент із черги. Якщо черга порожня, зачекайте, поки " +"елемент стане доступним." + +msgid "" +"Raises :exc:`QueueShutDown` if the queue has been shut down and is empty, or " +"if the queue has been shut down immediately." +msgstr "" + +msgid "" +"Return an item if one is immediately available, else raise :exc:`QueueEmpty`." +msgstr "" +"Повернути елемент, якщо він одразу доступний, інакше підняти :exc:" +"`QueueEmpty`." + +msgid "Block until all items in the queue have been received and processed." +msgstr "Блокуйте, доки всі елементи в черзі не будуть отримані та оброблені." + +msgid "" +"The count of unfinished tasks goes up whenever an item is added to the " +"queue. The count goes down whenever a consumer coroutine calls :meth:" +"`task_done` to indicate that the item was retrieved and all work on it is " +"complete. When the count of unfinished tasks drops to zero, :meth:`join` " +"unblocks." +msgstr "" +"Кількість незавершених завдань зростає щоразу, коли елемент додається до " +"черги. Підрахунок зменшується щоразу, коли співпрограма споживача викликає :" +"meth:`task_done`, щоб вказати, що елемент було отримано та вся робота над " +"ним завершена. Коли кількість незавершених завдань падає до нуля, :meth:" +"`join` розблоковується." + +msgid "" +"Put an item into the queue. If the queue is full, wait until a free slot is " +"available before adding the item." +msgstr "" +"Помістіть товар у чергу. Якщо черга заповнена, зачекайте, поки з’явиться " +"вільне місце, перш ніж додавати елемент." + +msgid "Raises :exc:`QueueShutDown` if the queue has been shut down." +msgstr "" + +msgid "Put an item into the queue without blocking." +msgstr "Поставте елемент у чергу без блокування." + +msgid "If no free slot is immediately available, raise :exc:`QueueFull`." +msgstr "Якщо вільного місця немає, підніміть :exc:`QueueFull`." + +msgid "Return the number of items in the queue." +msgstr "Повернути кількість елементів у черзі." + +msgid "" +"Shut down the queue, making :meth:`~Queue.get` and :meth:`~Queue.put` raise :" +"exc:`QueueShutDown`." +msgstr "" + +msgid "" +"By default, :meth:`~Queue.get` on a shut down queue will only raise once the " +"queue is empty. Set *immediate* to true to make :meth:`~Queue.get` raise " +"immediately instead." +msgstr "" + +msgid "" +"All blocked callers of :meth:`~Queue.put` and :meth:`~Queue.get` will be " +"unblocked. If *immediate* is true, a task will be marked as done for each " +"remaining item in the queue, which may unblock callers of :meth:`~Queue." +"join`." +msgstr "" + +msgid "Indicate that a formerly enqueued work item is complete." +msgstr "" + +msgid "" +"Used by queue consumers. For each :meth:`~Queue.get` used to fetch a work " +"item, a subsequent call to :meth:`task_done` tells the queue that the " +"processing on the work item is complete." +msgstr "" + +msgid "" +"If a :meth:`join` is currently blocking, it will resume when all items have " +"been processed (meaning that a :meth:`task_done` call was received for every " +"item that had been :meth:`~Queue.put` into the queue)." +msgstr "" +"Якщо :meth:`join` зараз блокує, воно відновиться, коли всі елементи буде " +"оброблено (це означає, що виклик :meth:`task_done` отримано для кожного " +"елемента, який був :meth:`~Queue.put` в черга)." + +msgid "" +"``shutdown(immediate=True)`` calls :meth:`task_done` for each remaining item " +"in the queue." +msgstr "" + +msgid "" +"Raises :exc:`ValueError` if called more times than there were items placed " +"in the queue." +msgstr "" +"Викликає :exc:`ValueError`, якщо викликається стільки разів, скільки було " +"елементів, розміщених у черзі." + +msgid "Priority Queue" +msgstr "Пріоритетна черга" + +msgid "" +"A variant of :class:`Queue`; retrieves entries in priority order (lowest " +"first)." +msgstr "" +"Варіант :class:`Queue`; отримує записи в порядку пріоритету (найнижчий " +"спочатку)." + +msgid "Entries are typically tuples of the form ``(priority_number, data)``." +msgstr "Записи зазвичай є кортежами у формі ``(число_пріоритету, дані)``." + +msgid "LIFO Queue" +msgstr "Черга LIFO" + +msgid "" +"A variant of :class:`Queue` that retrieves most recently added entries first " +"(last in, first out)." +msgstr "" +"Варіант :class:`Queue`, який першими отримує нещодавно додані записи " +"(останнім увійшов, першим вийшов)." + +msgid "Exceptions" +msgstr "Винятки" + +msgid "" +"This exception is raised when the :meth:`~Queue.get_nowait` method is called " +"on an empty queue." +msgstr "" +"Цей виняток виникає, коли метод :meth:`~Queue.get_nowait` викликається в " +"порожній черзі." + +msgid "" +"Exception raised when the :meth:`~Queue.put_nowait` method is called on a " +"queue that has reached its *maxsize*." +msgstr "" +"Виняток виникає, коли метод :meth:`~Queue.put_nowait` викликається в черзі, " +"яка досягла *максимального розміру*." + +msgid "" +"Exception raised when :meth:`~Queue.put` or :meth:`~Queue.get` is called on " +"a queue which has been shut down." +msgstr "" + +msgid "Examples" +msgstr "Приклади" + +msgid "" +"Queues can be used to distribute workload between several concurrent tasks::" +msgstr "" +"Черги можна використовувати для розподілу робочого навантаження між кількома " +"одночасними завданнями:" + +msgid "" +"import asyncio\n" +"import random\n" +"import time\n" +"\n" +"\n" +"async def worker(name, queue):\n" +" while True:\n" +" # Get a \"work item\" out of the queue.\n" +" sleep_for = await queue.get()\n" +"\n" +" # Sleep for the \"sleep_for\" seconds.\n" +" await asyncio.sleep(sleep_for)\n" +"\n" +" # Notify the queue that the \"work item\" has been processed.\n" +" queue.task_done()\n" +"\n" +" print(f'{name} has slept for {sleep_for:.2f} seconds')\n" +"\n" +"\n" +"async def main():\n" +" # Create a queue that we will use to store our \"workload\".\n" +" queue = asyncio.Queue()\n" +"\n" +" # Generate random timings and put them into the queue.\n" +" total_sleep_time = 0\n" +" for _ in range(20):\n" +" sleep_for = random.uniform(0.05, 1.0)\n" +" total_sleep_time += sleep_for\n" +" queue.put_nowait(sleep_for)\n" +"\n" +" # Create three worker tasks to process the queue concurrently.\n" +" tasks = []\n" +" for i in range(3):\n" +" task = asyncio.create_task(worker(f'worker-{i}', queue))\n" +" tasks.append(task)\n" +"\n" +" # Wait until the queue is fully processed.\n" +" started_at = time.monotonic()\n" +" await queue.join()\n" +" total_slept_for = time.monotonic() - started_at\n" +"\n" +" # Cancel our worker tasks.\n" +" for task in tasks:\n" +" task.cancel()\n" +" # Wait until all worker tasks are cancelled.\n" +" await asyncio.gather(*tasks, return_exceptions=True)\n" +"\n" +" print('====')\n" +" print(f'3 workers slept in parallel for {total_slept_for:.2f} seconds')\n" +" print(f'total expected sleep time: {total_sleep_time:.2f} seconds')\n" +"\n" +"\n" +"asyncio.run(main())" +msgstr "" diff --git a/library/asyncio-runner.po b/library/asyncio-runner.po new file mode 100644 index 000000000..f92c808cf --- /dev/null +++ b/library/asyncio-runner.po @@ -0,0 +1,208 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2022-11-05 19:48+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Runners" +msgstr "" + +msgid "**Source code:** :source:`Lib/asyncio/runners.py`" +msgstr "" + +msgid "" +"This section outlines high-level asyncio primitives to run asyncio code." +msgstr "" + +msgid "" +"They are built on top of an :ref:`event loop ` with the " +"aim to simplify async code usage for common wide-spread scenarios." +msgstr "" + +msgid "Running an asyncio Program" +msgstr "" + +msgid "Execute the :term:`coroutine` *coro* and return the result." +msgstr "" + +msgid "" +"This function runs the passed coroutine, taking care of managing the asyncio " +"event loop, *finalizing asynchronous generators*, and closing the executor." +msgstr "" + +msgid "" +"This function cannot be called when another asyncio event loop is running in " +"the same thread." +msgstr "" + +msgid "" +"If *debug* is ``True``, the event loop will be run in debug mode. ``False`` " +"disables debug mode explicitly. ``None`` is used to respect the global :ref:" +"`asyncio-debug-mode` settings." +msgstr "" + +msgid "" +"If *loop_factory* is not ``None``, it is used to create a new event loop; " +"otherwise :func:`asyncio.new_event_loop` is used. The loop is closed at the " +"end. This function should be used as a main entry point for asyncio " +"programs, and should ideally only be called once. It is recommended to use " +"*loop_factory* to configure the event loop instead of policies. Passing :" +"class:`asyncio.EventLoop` allows running asyncio without the policy system." +msgstr "" + +msgid "" +"The executor is given a timeout duration of 5 minutes to shutdown. If the " +"executor hasn't finished within that duration, a warning is emitted and the " +"executor is closed." +msgstr "" + +msgid "Example::" +msgstr "Приклад::" + +msgid "" +"async def main():\n" +" await asyncio.sleep(1)\n" +" print('hello')\n" +"\n" +"asyncio.run(main())" +msgstr "" + +msgid "Updated to use :meth:`loop.shutdown_default_executor`." +msgstr "" + +msgid "" +"*debug* is ``None`` by default to respect the global debug mode settings." +msgstr "" + +msgid "Added *loop_factory* parameter." +msgstr "" + +msgid "Runner context manager" +msgstr "" + +msgid "" +"A context manager that simplifies *multiple* async function calls in the " +"same context." +msgstr "" + +msgid "" +"Sometimes several top-level async functions should be called in the same :" +"ref:`event loop ` and :class:`contextvars.Context`." +msgstr "" + +msgid "" +"*loop_factory* could be used for overriding the loop creation. It is the " +"responsibility of the *loop_factory* to set the created loop as the current " +"one. By default :func:`asyncio.new_event_loop` is used and set as current " +"event loop with :func:`asyncio.set_event_loop` if *loop_factory* is ``None``." +msgstr "" + +msgid "" +"Basically, :func:`asyncio.run` example can be rewritten with the runner " +"usage::" +msgstr "" + +msgid "" +"async def main():\n" +" await asyncio.sleep(1)\n" +" print('hello')\n" +"\n" +"with asyncio.Runner() as runner:\n" +" runner.run(main())" +msgstr "" + +msgid "Run a :term:`coroutine ` *coro* in the embedded loop." +msgstr "" + +msgid "Return the coroutine's result or raise its exception." +msgstr "" + +msgid "" +"An optional keyword-only *context* argument allows specifying a custom :" +"class:`contextvars.Context` for the *coro* to run in. The runner's default " +"context is used if ``None``." +msgstr "" + +msgid "Close the runner." +msgstr "" + +msgid "" +"Finalize asynchronous generators, shutdown default executor, close the event " +"loop and release embedded :class:`contextvars.Context`." +msgstr "" + +msgid "Return the event loop associated with the runner instance." +msgstr "" + +msgid "" +":class:`Runner` uses the lazy initialization strategy, its constructor " +"doesn't initialize underlying low-level structures." +msgstr "" + +msgid "" +"Embedded *loop* and *context* are created at the :keyword:`with` body " +"entering or the first call of :meth:`run` or :meth:`get_loop`." +msgstr "" + +msgid "Handling Keyboard Interruption" +msgstr "" + +msgid "" +"When :const:`signal.SIGINT` is raised by :kbd:`Ctrl-C`, :exc:" +"`KeyboardInterrupt` exception is raised in the main thread by default. " +"However this doesn't work with :mod:`asyncio` because it can interrupt " +"asyncio internals and can hang the program from exiting." +msgstr "" + +msgid "" +"To mitigate this issue, :mod:`asyncio` handles :const:`signal.SIGINT` as " +"follows:" +msgstr "" + +msgid "" +":meth:`asyncio.Runner.run` installs a custom :const:`signal.SIGINT` handler " +"before any user code is executed and removes it when exiting from the " +"function." +msgstr "" + +msgid "" +"The :class:`~asyncio.Runner` creates the main task for the passed coroutine " +"for its execution." +msgstr "" + +msgid "" +"When :const:`signal.SIGINT` is raised by :kbd:`Ctrl-C`, the custom signal " +"handler cancels the main task by calling :meth:`asyncio.Task.cancel` which " +"raises :exc:`asyncio.CancelledError` inside the main task. This causes the " +"Python stack to unwind, ``try/except`` and ``try/finally`` blocks can be " +"used for resource cleanup. After the main task is cancelled, :meth:`asyncio." +"Runner.run` raises :exc:`KeyboardInterrupt`." +msgstr "" + +msgid "" +"A user could write a tight loop which cannot be interrupted by :meth:" +"`asyncio.Task.cancel`, in which case the second following :kbd:`Ctrl-C` " +"immediately raises the :exc:`KeyboardInterrupt` without cancelling the main " +"task." +msgstr "" diff --git a/library/asyncio-stream.po b/library/asyncio-stream.po new file mode 100644 index 000000000..a16740b8a --- /dev/null +++ b/library/asyncio-stream.po @@ -0,0 +1,650 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-04 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:55+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Streams" +msgstr "Потоки" + +msgid "**Source code:** :source:`Lib/asyncio/streams.py`" +msgstr "**Вихідний код:** :source:`Lib/asyncio/streams.py`" + +msgid "" +"Streams are high-level async/await-ready primitives to work with network " +"connections. Streams allow sending and receiving data without using " +"callbacks or low-level protocols and transports." +msgstr "" +"Потоки — це високорівневі асинхронні/готові до очікування примітиви для " +"роботи з мережевими підключеннями. Потоки дозволяють надсилати й отримувати " +"дані без використання зворотних викликів або низькорівневих протоколів і " +"транспортів." + +msgid "Here is an example of a TCP echo client written using asyncio streams::" +msgstr "" +"Ось приклад клієнта відлуння TCP, написаного з використанням асинхронних " +"потоків::" + +msgid "" +"import asyncio\n" +"\n" +"async def tcp_echo_client(message):\n" +" reader, writer = await asyncio.open_connection(\n" +" '127.0.0.1', 8888)\n" +"\n" +" print(f'Send: {message!r}')\n" +" writer.write(message.encode())\n" +" await writer.drain()\n" +"\n" +" data = await reader.read(100)\n" +" print(f'Received: {data.decode()!r}')\n" +"\n" +" print('Close the connection')\n" +" writer.close()\n" +" await writer.wait_closed()\n" +"\n" +"asyncio.run(tcp_echo_client('Hello World!'))" +msgstr "" + +msgid "See also the `Examples`_ section below." +msgstr "Дивіться також розділ `Examples`_ нижче." + +msgid "Stream Functions" +msgstr "Потокові функції" + +msgid "" +"The following top-level asyncio functions can be used to create and work " +"with streams:" +msgstr "" +"Наступні асинхронні функції верхнього рівня можна використовувати для " +"створення та роботи з потоками:" + +msgid "" +"Establish a network connection and return a pair of ``(reader, writer)`` " +"objects." +msgstr "" +"Встановіть мережеве з’єднання та поверніть пару об’єктів ``(reader, " +"writer)``." + +msgid "" +"The returned *reader* and *writer* objects are instances of :class:" +"`StreamReader` and :class:`StreamWriter` classes." +msgstr "" +"Повернені об’єкти *reader* і *writer* є екземплярами класів :class:" +"`StreamReader` і :class:`StreamWriter`." + +msgid "" +"*limit* determines the buffer size limit used by the returned :class:" +"`StreamReader` instance. By default the *limit* is set to 64 KiB." +msgstr "" +"*limit* визначає обмеження розміру буфера, який використовується повернутим " +"екземпляром :class:`StreamReader`. За замовчуванням *обмеження* встановлено " +"на 64 КБ." + +msgid "" +"The rest of the arguments are passed directly to :meth:`loop." +"create_connection`." +msgstr "" +"Решта аргументів передаються безпосередньо до :meth:`loop.create_connection`." + +msgid "" +"The *sock* argument transfers ownership of the socket to the :class:" +"`StreamWriter` created. To close the socket, call its :meth:`~asyncio." +"StreamWriter.close` method." +msgstr "" + +msgid "Added the *ssl_handshake_timeout* parameter." +msgstr "Додано параметр *ssl_handshake_timeout*." + +msgid "Added the *happy_eyeballs_delay* and *interleave* parameters." +msgstr "Додано параметри *happy_eyeballs_delay* і *interleave*." + +msgid "Removed the *loop* parameter." +msgstr "Видалено параметр *loop*." + +msgid "Added the *ssl_shutdown_timeout* parameter." +msgstr "" + +msgid "Start a socket server." +msgstr "Запустіть сервер сокетів." + +msgid "" +"The *client_connected_cb* callback is called whenever a new client " +"connection is established. It receives a ``(reader, writer)`` pair as two " +"arguments, instances of the :class:`StreamReader` and :class:`StreamWriter` " +"classes." +msgstr "" +"Зворотний виклик *client_connected_cb* викликається щоразу, коли " +"встановлюється нове підключення клієнта. Він отримує пару ``(reader, " +"writer)`` як два аргументи, екземпляри класів :class:`StreamReader` і :class:" +"`StreamWriter`." + +msgid "" +"*client_connected_cb* can be a plain callable or a :ref:`coroutine function " +"`; if it is a coroutine function, it will be automatically " +"scheduled as a :class:`Task`." +msgstr "" +"*client_connected_cb* може бути простим викликом або :ref:`функцією " +"співпрограми `; якщо це функція співпрограми, вона буде " +"автоматично запланована як :class:`Task`." + +msgid "" +"The rest of the arguments are passed directly to :meth:`loop.create_server`." +msgstr "" +"Решта аргументів передаються безпосередньо до :meth:`loop.create_server`." + +msgid "" +"The *sock* argument transfers ownership of the socket to the server created. " +"To close the socket, call the server's :meth:`~asyncio.Server.close` method." +msgstr "" + +msgid "Added the *ssl_handshake_timeout* and *start_serving* parameters." +msgstr "Додано параметри *ssl_handshake_timeout* і *start_serving*." + +msgid "Added the *keep_alive* parameter." +msgstr "" + +msgid "Unix Sockets" +msgstr "Unix-сокети" + +msgid "" +"Establish a Unix socket connection and return a pair of ``(reader, writer)``." +msgstr "" +"Встановіть з’єднання через сокет Unix і поверніть пару ``(reader, writer)``." + +msgid "Similar to :func:`open_connection` but operates on Unix sockets." +msgstr "Подібно до :func:`open_connection`, але працює на сокетах Unix." + +msgid "See also the documentation of :meth:`loop.create_unix_connection`." +msgstr "Дивіться також документацію :meth:`loop.create_unix_connection`." + +msgid "Availability" +msgstr "" + +msgid "" +"Added the *ssl_handshake_timeout* parameter. The *path* parameter can now be " +"a :term:`path-like object`" +msgstr "" +"Додано параметр *ssl_handshake_timeout*. Параметр *path* тепер може бути :" +"term:`path-like object`" + +msgid "Start a Unix socket server." +msgstr "Запустіть сокет-сервер Unix." + +msgid "Similar to :func:`start_server` but works with Unix sockets." +msgstr "Подібно до :func:`start_server`, але працює з сокетами Unix." + +msgid "See also the documentation of :meth:`loop.create_unix_server`." +msgstr "Дивіться також документацію :meth:`loop.create_unix_server`." + +msgid "" +"Added the *ssl_handshake_timeout* and *start_serving* parameters. The *path* " +"parameter can now be a :term:`path-like object`." +msgstr "" +"Додано параметри *ssl_handshake_timeout* і *start_serving*. Параметр *path* " +"тепер може бути :term:`path-like object`." + +msgid "StreamReader" +msgstr "StreamReader" + +msgid "" +"Represents a reader object that provides APIs to read data from the IO " +"stream. As an :term:`asynchronous iterable`, the object supports the :" +"keyword:`async for` statement." +msgstr "" + +msgid "" +"It is not recommended to instantiate *StreamReader* objects directly; use :" +"func:`open_connection` and :func:`start_server` instead." +msgstr "" +"Не рекомендується безпосередньо створювати екземпляри об’єктів " +"*StreamReader*; замість цього використовуйте :func:`open_connection` і :func:" +"`start_server`." + +msgid "Acknowledge the EOF." +msgstr "" + +msgid "Read up to *n* bytes from the stream." +msgstr "" + +msgid "" +"If *n* is not provided or set to ``-1``, read until EOF, then return all " +"read :class:`bytes`. If EOF was received and the internal buffer is empty, " +"return an empty ``bytes`` object." +msgstr "" + +msgid "If *n* is ``0``, return an empty ``bytes`` object immediately." +msgstr "" + +msgid "" +"If *n* is positive, return at most *n* available ``bytes`` as soon as at " +"least 1 byte is available in the internal buffer. If EOF is received before " +"any byte is read, return an empty ``bytes`` object." +msgstr "" + +msgid "" +"Read one line, where \"line\" is a sequence of bytes ending with ``\\n``." +msgstr "" +"Прочитати один рядок, де \"рядок\" — це послідовність байтів, що " +"закінчуються на ``\\n``." + +msgid "" +"If EOF is received and ``\\n`` was not found, the method returns partially " +"read data." +msgstr "" +"Якщо EOF отримано, а ``\\n`` не знайдено, метод повертає частково прочитані " +"дані." + +msgid "" +"If EOF is received and the internal buffer is empty, return an empty " +"``bytes`` object." +msgstr "" +"Якщо EOF отримано, а внутрішній буфер порожній, поверніть порожній об’єкт " +"``bytes``." + +msgid "Read exactly *n* bytes." +msgstr "Прочитайте рівно *n* байт." + +msgid "" +"Raise an :exc:`IncompleteReadError` if EOF is reached before *n* can be " +"read. Use the :attr:`IncompleteReadError.partial` attribute to get the " +"partially read data." +msgstr "" +"Викликати :exc:`IncompleteReadError`, якщо EOF досягнуто до того, як *n* " +"можна буде прочитати. Використовуйте атрибут :attr:`IncompleteReadError." +"partial`, щоб отримати частково прочитані дані." + +msgid "Read data from the stream until *separator* is found." +msgstr "Читати дані з потоку, доки не буде знайдено *роздільник*." + +msgid "" +"On success, the data and separator will be removed from the internal buffer " +"(consumed). Returned data will include the separator at the end." +msgstr "" +"У разі успіху дані та роздільник буде видалено з внутрішнього буфера " +"(використано). Повернуті дані включатимуть роздільник у кінці." + +msgid "" +"If the amount of data read exceeds the configured stream limit, a :exc:" +"`LimitOverrunError` exception is raised, and the data is left in the " +"internal buffer and can be read again." +msgstr "" +"Якщо обсяг зчитаних даних перевищує налаштований ліміт потоку, виникає " +"виняток :exc:`LimitOverrunError`, і дані залишаються у внутрішньому буфері " +"та можуть бути прочитані знову." + +msgid "" +"If EOF is reached before the complete separator is found, an :exc:" +"`IncompleteReadError` exception is raised, and the internal buffer is " +"reset. The :attr:`IncompleteReadError.partial` attribute may contain a " +"portion of the separator." +msgstr "" +"Якщо EOF досягнуто до того, як знайдено повний роздільник, виникає виняток :" +"exc:`IncompleteReadError`, і внутрішній буфер скидається. Атрибут :attr:" +"`IncompleteReadError.partial` може містити частину роздільника." + +msgid "" +"The *separator* may also be a tuple of separators. In this case the return " +"value will be the shortest possible that has any separator as the suffix. " +"For the purposes of :exc:`LimitOverrunError`, the shortest possible " +"separator is considered to be the one that matched." +msgstr "" + +msgid "The *separator* parameter may now be a :class:`tuple` of separators." +msgstr "" + +msgid "Return ``True`` if the buffer is empty and :meth:`feed_eof` was called." +msgstr "" +"Повертає ``True``, якщо буфер порожній і було викликано :meth:`feed_eof`." + +msgid "StreamWriter" +msgstr "StreamWriter" + +msgid "" +"Represents a writer object that provides APIs to write data to the IO stream." +msgstr "" +"Представляє об’єкт запису, який надає API для запису даних у потік вводу-" +"виводу." + +msgid "" +"It is not recommended to instantiate *StreamWriter* objects directly; use :" +"func:`open_connection` and :func:`start_server` instead." +msgstr "" +"Не рекомендується безпосередньо створювати екземпляри об’єктів " +"*StreamWriter*; замість цього використовуйте :func:`open_connection` і :func:" +"`start_server`." + +msgid "" +"The method attempts to write the *data* to the underlying socket " +"immediately. If that fails, the data is queued in an internal write buffer " +"until it can be sent." +msgstr "" +"Метод намагається негайно записати *дані* в основний сокет. Якщо це не " +"вдається, дані ставляться в чергу у внутрішній буфер запису, доки їх не буде " +"надіслано." + +msgid "The method should be used along with the ``drain()`` method::" +msgstr "Цей метод слід використовувати разом із методом ``drain()``:" + +msgid "" +"stream.write(data)\n" +"await stream.drain()" +msgstr "" + +msgid "" +"The method writes a list (or any iterable) of bytes to the underlying socket " +"immediately. If that fails, the data is queued in an internal write buffer " +"until it can be sent." +msgstr "" +"Метод негайно записує список (або будь-яку ітерацію) байтів у базовий сокет. " +"Якщо це не вдається, дані ставляться в чергу у внутрішній буфер запису, доки " +"їх не буде надіслано." + +msgid "" +"stream.writelines(lines)\n" +"await stream.drain()" +msgstr "" + +msgid "The method closes the stream and the underlying socket." +msgstr "Метод закриває потік і базовий сокет." + +msgid "" +"The method should be used, though not mandatory, along with the " +"``wait_closed()`` method::" +msgstr "" + +msgid "" +"stream.close()\n" +"await stream.wait_closed()" +msgstr "" + +msgid "" +"Return ``True`` if the underlying transport supports the :meth:`write_eof` " +"method, ``False`` otherwise." +msgstr "" +"Повертає ``True``, якщо основний транспорт підтримує метод :meth:" +"`write_eof`, ``False`` інакше." + +msgid "" +"Close the write end of the stream after the buffered write data is flushed." +msgstr "" +"Закрийте кінець запису потоку після очищення буферизованих даних запису." + +msgid "Return the underlying asyncio transport." +msgstr "Повернути базовий асинхронний транспорт." + +msgid "" +"Access optional transport information; see :meth:`BaseTransport." +"get_extra_info` for details." +msgstr "" +"Доступ до додаткової транспортної інформації; подробиці див. :meth:" +"`BaseTransport.get_extra_info`." + +msgid "Wait until it is appropriate to resume writing to the stream. Example::" +msgstr "Зачекайте, доки буде прийнятно продовжити запис у потік. Приклад::" + +msgid "" +"writer.write(data)\n" +"await writer.drain()" +msgstr "" + +msgid "" +"This is a flow control method that interacts with the underlying IO write " +"buffer. When the size of the buffer reaches the high watermark, *drain()* " +"blocks until the size of the buffer is drained down to the low watermark and " +"writing can be resumed. When there is nothing to wait for, the :meth:" +"`drain` returns immediately." +msgstr "" +"Це метод керування потоком, який взаємодіє з базовим буфером запису вводу-" +"виводу. Коли розмір буфера досягає верхнього водяного знака, *drain()* " +"блокує, доки розмір буфера не зменшиться до низького водяного знака, і запис " +"можна буде відновити. Коли нема чого чекати, :meth:`drain` повертається " +"негайно." + +msgid "Upgrade an existing stream-based connection to TLS." +msgstr "" + +msgid "Parameters:" +msgstr "Параметри:" + +msgid "*sslcontext*: a configured instance of :class:`~ssl.SSLContext`." +msgstr "*sslcontext*: налаштований екземпляр :class:`~ssl.SSLContext`." + +msgid "" +"*server_hostname*: sets or overrides the host name that the target server's " +"certificate will be matched against." +msgstr "" +"*server_hostname*: встановлює або замінює ім’я хоста, з яким буде " +"зіставлятися сертифікат цільового сервера." + +msgid "" +"*ssl_handshake_timeout* is the time in seconds to wait for the TLS handshake " +"to complete before aborting the connection. ``60.0`` seconds if ``None`` " +"(default)." +msgstr "" + +msgid "" +"*ssl_shutdown_timeout* is the time in seconds to wait for the SSL shutdown " +"to complete before aborting the connection. ``30.0`` seconds if ``None`` " +"(default)." +msgstr "" + +msgid "" +"Return ``True`` if the stream is closed or in the process of being closed." +msgstr "" +"Повертає ``True``, якщо потік закрито або знаходиться в процесі закриття." + +msgid "Wait until the stream is closed." +msgstr "Зачекайте, поки потік закриється." + +msgid "" +"Should be called after :meth:`close` to wait until the underlying connection " +"is closed, ensuring that all data has been flushed before e.g. exiting the " +"program." +msgstr "" + +msgid "Examples" +msgstr "Приклади" + +msgid "TCP echo client using streams" +msgstr "TCP echo client використовує потоки" + +msgid "TCP echo client using the :func:`asyncio.open_connection` function::" +msgstr "" +"TCP-клієнт відлуння за допомогою функції :func:`asyncio.open_connection`::" + +msgid "" +"The :ref:`TCP echo client protocol " +"` example uses the low-level :meth:" +"`loop.create_connection` method." +msgstr "" +"У прикладі :ref:`TCP echo client protocol " +"` використовується метод низького " +"рівня :meth:`loop.create_connection`." + +msgid "TCP echo server using streams" +msgstr "Сервер відлуння TCP з використанням потоків" + +msgid "TCP echo server using the :func:`asyncio.start_server` function::" +msgstr "" +"Сервер відлуння TCP за допомогою функції :func:`asyncio.start_server`::" + +msgid "" +"import asyncio\n" +"\n" +"async def handle_echo(reader, writer):\n" +" data = await reader.read(100)\n" +" message = data.decode()\n" +" addr = writer.get_extra_info('peername')\n" +"\n" +" print(f\"Received {message!r} from {addr!r}\")\n" +"\n" +" print(f\"Send: {message!r}\")\n" +" writer.write(data)\n" +" await writer.drain()\n" +"\n" +" print(\"Close the connection\")\n" +" writer.close()\n" +" await writer.wait_closed()\n" +"\n" +"async def main():\n" +" server = await asyncio.start_server(\n" +" handle_echo, '127.0.0.1', 8888)\n" +"\n" +" addrs = ', '.join(str(sock.getsockname()) for sock in server.sockets)\n" +" print(f'Serving on {addrs}')\n" +"\n" +" async with server:\n" +" await server.serve_forever()\n" +"\n" +"asyncio.run(main())" +msgstr "" + +msgid "" +"The :ref:`TCP echo server protocol " +"` example uses the :meth:`loop." +"create_server` method." +msgstr "" +"У прикладі :ref:`TCP echo server protocol " +"` використовується метод :meth:" +"`loop.create_server`." + +msgid "Get HTTP headers" +msgstr "Отримайте заголовки HTTP" + +msgid "" +"Simple example querying HTTP headers of the URL passed on the command line::" +msgstr "" +"Простий приклад запиту HTTP-заголовків URL-адреси, переданої в командному " +"рядку::" + +msgid "" +"import asyncio\n" +"import urllib.parse\n" +"import sys\n" +"\n" +"async def print_http_headers(url):\n" +" url = urllib.parse.urlsplit(url)\n" +" if url.scheme == 'https':\n" +" reader, writer = await asyncio.open_connection(\n" +" url.hostname, 443, ssl=True)\n" +" else:\n" +" reader, writer = await asyncio.open_connection(\n" +" url.hostname, 80)\n" +"\n" +" query = (\n" +" f\"HEAD {url.path or '/'} HTTP/1.0\\r\\n\"\n" +" f\"Host: {url.hostname}\\r\\n\"\n" +" f\"\\r\\n\"\n" +" )\n" +"\n" +" writer.write(query.encode('latin-1'))\n" +" while True:\n" +" line = await reader.readline()\n" +" if not line:\n" +" break\n" +"\n" +" line = line.decode('latin1').rstrip()\n" +" if line:\n" +" print(f'HTTP header> {line}')\n" +"\n" +" # Ignore the body, close the socket\n" +" writer.close()\n" +" await writer.wait_closed()\n" +"\n" +"url = sys.argv[1]\n" +"asyncio.run(print_http_headers(url))" +msgstr "" + +msgid "Usage::" +msgstr "Використання::" + +msgid "python example.py http://example.com/path/page.html" +msgstr "" + +msgid "or with HTTPS::" +msgstr "або з HTTPS::" + +msgid "python example.py https://example.com/path/page.html" +msgstr "" + +msgid "Register an open socket to wait for data using streams" +msgstr "Зареєструйте відкритий сокет для очікування даних за допомогою потоків" + +msgid "" +"Coroutine waiting until a socket receives data using the :func:" +"`open_connection` function::" +msgstr "" +"Співпрограма очікує, доки сокет не отримає дані за допомогою функції :func:" +"`open_connection`::" + +msgid "" +"import asyncio\n" +"import socket\n" +"\n" +"async def wait_for_data():\n" +" # Get a reference to the current event loop because\n" +" # we want to access low-level APIs.\n" +" loop = asyncio.get_running_loop()\n" +"\n" +" # Create a pair of connected sockets.\n" +" rsock, wsock = socket.socketpair()\n" +"\n" +" # Register the open socket to wait for data.\n" +" reader, writer = await asyncio.open_connection(sock=rsock)\n" +"\n" +" # Simulate the reception of data from the network\n" +" loop.call_soon(wsock.send, 'abc'.encode())\n" +"\n" +" # Wait for data\n" +" data = await reader.read(100)\n" +"\n" +" # Got data, we are done: close the socket\n" +" print(\"Received:\", data.decode())\n" +" writer.close()\n" +" await writer.wait_closed()\n" +"\n" +" # Close the second socket\n" +" wsock.close()\n" +"\n" +"asyncio.run(wait_for_data())" +msgstr "" + +msgid "" +"The :ref:`register an open socket to wait for data using a protocol " +"` example uses a low-level protocol and " +"the :meth:`loop.create_connection` method." +msgstr "" +"У прикладі :ref:`реєструвати відкритий сокет для очікування даних за " +"допомогою протоколу ` використовується " +"протокол низького рівня та метод :meth:`loop.create_connection`." + +msgid "" +"The :ref:`watch a file descriptor for read events " +"` example uses the low-level :meth:`loop." +"add_reader` method to watch a file descriptor." +msgstr "" +"У прикладі :ref:`спостерігати за подіями читання файлового дескриптора " +"` використовується низькорівневий метод :meth:" +"`loop.add_reader` для спостереження за файловим дескриптором." diff --git a/library/asyncio-subprocess.po b/library/asyncio-subprocess.po new file mode 100644 index 000000000..d9e8a6f8c --- /dev/null +++ b/library/asyncio-subprocess.po @@ -0,0 +1,525 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:55+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Subprocesses" +msgstr "Підпроцеси" + +msgid "" +"**Source code:** :source:`Lib/asyncio/subprocess.py`, :source:`Lib/asyncio/" +"base_subprocess.py`" +msgstr "" +"**Вихідний код:** :source:`Lib/asyncio/subprocess.py`, :source:`Lib/asyncio/" +"base_subprocess.py`" + +msgid "" +"This section describes high-level async/await asyncio APIs to create and " +"manage subprocesses." +msgstr "" +"У цьому розділі описано високорівневі API async/await asyncio для створення " +"та керування підпроцесами." + +msgid "" +"Here's an example of how asyncio can run a shell command and obtain its " +"result::" +msgstr "" +"Ось приклад того, як asyncio може запустити команду оболонки та отримати її " +"результат::" + +msgid "" +"import asyncio\n" +"\n" +"async def run(cmd):\n" +" proc = await asyncio.create_subprocess_shell(\n" +" cmd,\n" +" stdout=asyncio.subprocess.PIPE,\n" +" stderr=asyncio.subprocess.PIPE)\n" +"\n" +" stdout, stderr = await proc.communicate()\n" +"\n" +" print(f'[{cmd!r} exited with {proc.returncode}]')\n" +" if stdout:\n" +" print(f'[stdout]\\n{stdout.decode()}')\n" +" if stderr:\n" +" print(f'[stderr]\\n{stderr.decode()}')\n" +"\n" +"asyncio.run(run('ls /zzz'))" +msgstr "" + +msgid "will print::" +msgstr "надрукую::" + +msgid "" +"['ls /zzz' exited with 1]\n" +"[stderr]\n" +"ls: /zzz: No such file or directory" +msgstr "" + +msgid "" +"Because all asyncio subprocess functions are asynchronous and asyncio " +"provides many tools to work with such functions, it is easy to execute and " +"monitor multiple subprocesses in parallel. It is indeed trivial to modify " +"the above example to run several commands simultaneously::" +msgstr "" +"Оскільки всі функції підпроцесів asyncio є асинхронними, а asyncio надає " +"багато інструментів для роботи з такими функціями, легко виконувати та " +"контролювати декілька підпроцесів паралельно. Дійсно тривіально змінити " +"наведений вище приклад для одночасного запуску кількох команд:" + +msgid "" +"async def main():\n" +" await asyncio.gather(\n" +" run('ls /zzz'),\n" +" run('sleep 1; echo \"hello\"'))\n" +"\n" +"asyncio.run(main())" +msgstr "" + +msgid "See also the `Examples`_ subsection." +msgstr "Дивіться також підрозділ `Examples`_." + +msgid "Creating Subprocesses" +msgstr "Створення підпроцесів" + +msgid "Create a subprocess." +msgstr "Створіть підпроцес." + +msgid "" +"The *limit* argument sets the buffer limit for :class:`StreamReader` " +"wrappers for :attr:`~asyncio.subprocess.Process.stdout` and :attr:`~asyncio." +"subprocess.Process.stderr` (if :const:`subprocess.PIPE` is passed to " +"*stdout* and *stderr* arguments)." +msgstr "" + +msgid "Return a :class:`~asyncio.subprocess.Process` instance." +msgstr "Повертає екземпляр :class:`~asyncio.subprocess.Process`." + +msgid "" +"See the documentation of :meth:`loop.subprocess_exec` for other parameters." +msgstr "" +"Перегляньте документацію :meth:`loop.subprocess_exec` для інших параметрів." + +msgid "Removed the *loop* parameter." +msgstr "Видалено параметр *loop*." + +msgid "Run the *cmd* shell command." +msgstr "Виконайте команду оболонки *cmd*." + +msgid "" +"See the documentation of :meth:`loop.subprocess_shell` for other parameters." +msgstr "" +"Перегляньте документацію :meth:`loop.subprocess_shell` для інших параметрів." + +msgid "" +"It is the application's responsibility to ensure that all whitespace and " +"special characters are quoted appropriately to avoid `shell injection " +"`_ " +"vulnerabilities. The :func:`shlex.quote` function can be used to properly " +"escape whitespace and special shell characters in strings that are going to " +"be used to construct shell commands." +msgstr "" +"Програма несе відповідальність за те, щоб усі пробіли та спеціальні символи " +"були взяті в лапки належним чином, щоб уникнути вразливості `впровадження " +"оболонки `_. " +"Функцію :func:`shlex.quote` можна використати для правильного екранування " +"пробілів і спеціальних символів оболонки в рядках, які використовуватимуться " +"для створення команд оболонки." + +msgid "" +"Subprocesses are available for Windows if a :class:`ProactorEventLoop` is " +"used. See :ref:`Subprocess Support on Windows ` " +"for details." +msgstr "" +"Підпроцеси доступні для Windows, якщо використовується :class:" +"`ProactorEventLoop`. Дивіться :ref:`Підтримку підпроцесів у Windows `, щоб дізнатися більше." + +msgid "" +"asyncio also has the following *low-level* APIs to work with subprocesses: :" +"meth:`loop.subprocess_exec`, :meth:`loop.subprocess_shell`, :meth:`loop." +"connect_read_pipe`, :meth:`loop.connect_write_pipe`, as well as the :ref:" +"`Subprocess Transports ` and :ref:`Subprocess " +"Protocols `." +msgstr "" +"asyncio також має такі *низькопівневі* API для роботи з підпроцесами: :meth:" +"`loop.subprocess_exec`, :meth:`loop.subprocess_shell`, :meth:`loop." +"connect_read_pipe`, :meth:`loop.connect_write_pipe`, а також :ref:" +"`Транспорти підпроцесів ` і :ref:`Протоколи " +"підпроцесів `." + +msgid "Constants" +msgstr "Константи" + +msgid "Can be passed to the *stdin*, *stdout* or *stderr* parameters." +msgstr "Можна передати в параметри *stdin*, *stdout* або *stderr*." + +msgid "" +"If *PIPE* is passed to *stdin* argument, the :attr:`Process.stdin ` attribute will point to a :class:`~asyncio." +"StreamWriter` instance." +msgstr "" + +msgid "" +"If *PIPE* is passed to *stdout* or *stderr* arguments, the :attr:`Process." +"stdout ` and :attr:`Process.stderr " +"` attributes will point to :class:" +"`~asyncio.StreamReader` instances." +msgstr "" + +msgid "" +"Special value that can be used as the *stderr* argument and indicates that " +"standard error should be redirected into standard output." +msgstr "" +"Спеціальне значення, яке можна використовувати як аргумент *stderr* і вказує " +"на те, що стандартну помилку слід перенаправляти в стандартний вивід." + +msgid "" +"Special value that can be used as the *stdin*, *stdout* or *stderr* argument " +"to process creation functions. It indicates that the special file :data:`os." +"devnull` will be used for the corresponding subprocess stream." +msgstr "" +"Спеціальне значення, яке можна використовувати як аргумент *stdin*, *stdout* " +"або *stderr* для функцій створення процесу. Це вказує, що спеціальний файл :" +"data:`os.devnull` буде використано для відповідного потоку підпроцесу." + +msgid "Interacting with Subprocesses" +msgstr "Взаємодія з підпроцесами" + +msgid "" +"Both :func:`create_subprocess_exec` and :func:`create_subprocess_shell` " +"functions return instances of the *Process* class. *Process* is a high-" +"level wrapper that allows communicating with subprocesses and watching for " +"their completion." +msgstr "" +"Обидві функції :func:`create_subprocess_exec` і :func:" +"`create_subprocess_shell` повертають екземпляри класу *Process*. *Process* — " +"це високорівнева оболонка, яка дозволяє спілкуватися з підпроцесами та " +"спостерігати за їх завершенням." + +msgid "" +"An object that wraps OS processes created by the :func:`~asyncio." +"create_subprocess_exec` and :func:`~asyncio.create_subprocess_shell` " +"functions." +msgstr "" + +msgid "" +"This class is designed to have a similar API to the :class:`subprocess." +"Popen` class, but there are some notable differences:" +msgstr "" +"Цей клас розроблено таким чином, щоб мати API, подібний до класу :class:" +"`subprocess.Popen`, але є деякі помітні відмінності:" + +msgid "" +"unlike Popen, Process instances do not have an equivalent to the :meth:" +"`~subprocess.Popen.poll` method;" +msgstr "" +"на відміну від Popen, екземпляри Process не мають еквівалента методу :meth:" +"`~subprocess.Popen.poll`;" + +msgid "" +"the :meth:`~asyncio.subprocess.Process.communicate` and :meth:`~asyncio." +"subprocess.Process.wait` methods don't have a *timeout* parameter: use the :" +"func:`~asyncio.wait_for` function;" +msgstr "" + +msgid "" +"the :meth:`Process.wait() ` method is " +"asynchronous, whereas :meth:`subprocess.Popen.wait` method is implemented as " +"a blocking busy loop;" +msgstr "" +"метод :meth:`Process.wait() ` є " +"асинхронним, тоді як метод :meth:`subprocess.Popen.wait` реалізовано як " +"блокуючий цикл зайнятості;" + +msgid "the *universal_newlines* parameter is not supported." +msgstr "параметр *universal_newlines* не підтримується." + +msgid "This class is :ref:`not thread safe `." +msgstr "Цей клас :ref:`не потоково безпечний `." + +msgid "" +"See also the :ref:`Subprocess and Threads ` " +"section." +msgstr "" +"Дивіться також розділ :ref:`Підпроцеси та потоки `." + +msgid "Wait for the child process to terminate." +msgstr "Дочекайтеся завершення дочірнього процесу." + +msgid "Set and return the :attr:`returncode` attribute." +msgstr "Установіть і поверніть атрибут :attr:`returncode`." + +msgid "" +"This method can deadlock when using ``stdout=PIPE`` or ``stderr=PIPE`` and " +"the child process generates so much output that it blocks waiting for the OS " +"pipe buffer to accept more data. Use the :meth:`communicate` method when " +"using pipes to avoid this condition." +msgstr "" +"Цей метод може призвести до взаємоблокування під час використання " +"``stdout=PIPE`` або ``stderr=PIPE``, і дочірній процес генерує стільки " +"вихідних даних, що він блокує очікування, поки буфер каналу ОС прийме більше " +"даних. Використовуйте метод :meth:`communicate` під час використання " +"каналів, щоб уникнути цієї ситуації." + +msgid "Interact with process:" +msgstr "Взаємодія з процесом:" + +msgid "send data to *stdin* (if *input* is not ``None``);" +msgstr "надсилати дані на *stdin* (якщо *input* не ``None``);" + +msgid "closes *stdin*;" +msgstr "" + +msgid "read data from *stdout* and *stderr*, until EOF is reached;" +msgstr "читати дані з *stdout* і *stderr*, доки не буде досягнуто EOF;" + +msgid "wait for process to terminate." +msgstr "дочекайтеся завершення процесу." + +msgid "" +"The optional *input* argument is the data (:class:`bytes` object) that will " +"be sent to the child process." +msgstr "" +"Додатковий *вхідний* аргумент — це дані (об’єкт :class:`bytes`), які будуть " +"надіслані дочірньому процесу." + +msgid "Return a tuple ``(stdout_data, stderr_data)``." +msgstr "Повертає кортеж ``(stdout_data, stderr_data)``." + +msgid "" +"If either :exc:`BrokenPipeError` or :exc:`ConnectionResetError` exception is " +"raised when writing *input* into *stdin*, the exception is ignored. This " +"condition occurs when the process exits before all data are written into " +"*stdin*." +msgstr "" +"Якщо під час запису *input* у *stdin* виникає виняткова ситуація :exc:" +"`BrokenPipeError` або :exc:`ConnectionResetError`, виняток ігнорується. Ця " +"умова виникає, коли процес завершується до того, як усі дані будуть записані " +"в *stdin*." + +msgid "" +"If it is desired to send data to the process' *stdin*, the process needs to " +"be created with ``stdin=PIPE``. Similarly, to get anything other than " +"``None`` in the result tuple, the process has to be created with " +"``stdout=PIPE`` and/or ``stderr=PIPE`` arguments." +msgstr "" +"Якщо потрібно надіслати дані процесу *stdin*, процес потрібно створити за " +"допомогою ``stdin=PIPE``. Подібним чином, щоб отримати в кортежі результатів " +"щось інше, окрім ``None``, процес має бути створений з аргументами " +"``stdout=PIPE`` та/або ``stderr=PIPE``." + +msgid "" +"Note, that the data read is buffered in memory, so do not use this method if " +"the data size is large or unlimited." +msgstr "" +"Зауважте, що зчитані дані буферизуються в пам’яті, тому не використовуйте " +"цей метод, якщо розмір даних великий або необмежений." + +msgid "*stdin* gets closed when ``input=None`` too." +msgstr "" + +msgid "Sends the signal *signal* to the child process." +msgstr "Надсилає сигнал *signal* дочірньому процесу." + +msgid "" +"On Windows, :py:const:`~signal.SIGTERM` is an alias for :meth:`terminate`. " +"``CTRL_C_EVENT`` and ``CTRL_BREAK_EVENT`` can be sent to processes started " +"with a *creationflags* parameter which includes ``CREATE_NEW_PROCESS_GROUP``." +msgstr "" + +msgid "Stop the child process." +msgstr "Зупиніть дочірній процес." + +msgid "" +"On POSIX systems this method sends :py:const:`~signal.SIGTERM` to the child " +"process." +msgstr "" + +msgid "" +"On Windows the Win32 API function :c:func:`!TerminateProcess` is called to " +"stop the child process." +msgstr "" + +msgid "Kill the child process." +msgstr "Закрийте дочірній процес." + +msgid "" +"On POSIX systems this method sends :py:data:`~signal.SIGKILL` to the child " +"process." +msgstr "" + +msgid "On Windows this method is an alias for :meth:`terminate`." +msgstr "У Windows цей метод є псевдонімом для :meth:`terminate`." + +msgid "" +"Standard input stream (:class:`~asyncio.StreamWriter`) or ``None`` if the " +"process was created with ``stdin=None``." +msgstr "" + +msgid "" +"Standard output stream (:class:`~asyncio.StreamReader`) or ``None`` if the " +"process was created with ``stdout=None``." +msgstr "" + +msgid "" +"Standard error stream (:class:`~asyncio.StreamReader`) or ``None`` if the " +"process was created with ``stderr=None``." +msgstr "" + +msgid "" +"Use the :meth:`communicate` method rather than :attr:`process.stdin.write() " +"`, :attr:`await process.stdout.read() ` or :attr:`await " +"process.stderr.read() `. This avoids deadlocks due to streams " +"pausing reading or writing and blocking the child process." +msgstr "" +"Використовуйте метод :meth:`communicate` замість :attr:`process.stdin." +"write() `, :attr:`await process.stdout.read() ` або :attr:" +"`await process.stderr.read () `. Це дозволяє уникнути " +"взаємоблокувань через те, що потоки призупиняють читання або запис і " +"блокують дочірній процес." + +msgid "Process identification number (PID)." +msgstr "Ідентифікаційний номер процесу (PID)." + +msgid "" +"Note that for processes created by the :func:`~asyncio." +"create_subprocess_shell` function, this attribute is the PID of the spawned " +"shell." +msgstr "" + +msgid "Return code of the process when it exits." +msgstr "Код повернення процесу під час його завершення." + +msgid "A ``None`` value indicates that the process has not terminated yet." +msgstr "Значення ``None`` вказує на те, що процес ще не завершено." + +msgid "" +"A negative value ``-N`` indicates that the child was terminated by signal " +"``N`` (POSIX only)." +msgstr "" +"Від’ємне значення ``-N`` вказує на те, що дочірній елемент було завершено " +"сигналом ``N`` (лише POSIX)." + +msgid "Subprocess and Threads" +msgstr "Підпроцеси та потоки" + +msgid "" +"Standard asyncio event loop supports running subprocesses from different " +"threads by default." +msgstr "" +"Стандартний асинхронний цикл подій за замовчуванням підтримує виконання " +"підпроцесів з різних потоків." + +msgid "" +"On Windows subprocesses are provided by :class:`ProactorEventLoop` only " +"(default), :class:`SelectorEventLoop` has no subprocess support." +msgstr "" +"У Windows підпроцеси надаються лише :class:`ProactorEventLoop` (за " +"замовчуванням), :class:`SelectorEventLoop` не підтримує підпроцеси." + +msgid "" +"On UNIX *child watchers* are used for subprocess finish waiting, see :ref:" +"`asyncio-watchers` for more info." +msgstr "" +"В UNIX *child watchers* використовуються для очікування завершення " +"підпроцесу, див. :ref:`asyncio-watchers` для отримання додаткової інформації." + +msgid "" +"UNIX switched to use :class:`ThreadedChildWatcher` for spawning subprocesses " +"from different threads without any limitation." +msgstr "" +"UNIX перейшла на використання :class:`ThreadedChildWatcher` для створення " +"підпроцесів з різних потоків без будь-яких обмежень." + +msgid "" +"Spawning a subprocess with *inactive* current child watcher raises :exc:" +"`RuntimeError`." +msgstr "" +"Створення підпроцесу з *неактивним* поточним дочірнім спостерігачем " +"викликає :exc:`RuntimeError`." + +msgid "" +"Note that alternative event loop implementations might have own limitations; " +"please refer to their documentation." +msgstr "" +"Зауважте, що альтернативні реалізації циклу подій можуть мати власні " +"обмеження; зверніться до їх документації." + +msgid "" +"The :ref:`Concurrency and multithreading in asyncio ` section." +msgstr "" +"Розділ :ref:`Параллельність і багатопотоковість в asyncio `." + +msgid "Examples" +msgstr "Приклади" + +msgid "" +"An example using the :class:`~asyncio.subprocess.Process` class to control a " +"subprocess and the :class:`StreamReader` class to read from its standard " +"output." +msgstr "" +"Приклад використання класу :class:`~asyncio.subprocess.Process` для " +"керування підпроцесом і класу :class:`StreamReader` для читання зі " +"стандартного виводу." + +msgid "" +"The subprocess is created by the :func:`create_subprocess_exec` function::" +msgstr "Підпроцес створюється функцією :func:`create_subprocess_exec`::" + +msgid "" +"import asyncio\n" +"import sys\n" +"\n" +"async def get_date():\n" +" code = 'import datetime; print(datetime.datetime.now())'\n" +"\n" +" # Create the subprocess; redirect the standard output\n" +" # into a pipe.\n" +" proc = await asyncio.create_subprocess_exec(\n" +" sys.executable, '-c', code,\n" +" stdout=asyncio.subprocess.PIPE)\n" +"\n" +" # Read one line of output.\n" +" data = await proc.stdout.readline()\n" +" line = data.decode('ascii').rstrip()\n" +"\n" +" # Wait for the subprocess exit.\n" +" await proc.wait()\n" +" return line\n" +"\n" +"date = asyncio.run(get_date())\n" +"print(f\"Current date: {date}\")" +msgstr "" + +msgid "" +"See also the :ref:`same example ` written " +"using low-level APIs." +msgstr "" +"Дивіться також :ref:`той же приклад `, " +"написаний з використанням API низького рівня." diff --git a/library/asyncio-sync.po b/library/asyncio-sync.po new file mode 100644 index 000000000..3d90df352 --- /dev/null +++ b/library/asyncio-sync.po @@ -0,0 +1,595 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-04 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:55+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Synchronization Primitives" +msgstr "Примітиви синхронізації" + +msgid "**Source code:** :source:`Lib/asyncio/locks.py`" +msgstr "**Вихідний код:** :source:`Lib/asyncio/locks.py`" + +msgid "" +"asyncio synchronization primitives are designed to be similar to those of " +"the :mod:`threading` module with two important caveats:" +msgstr "" +"Примітиви синхронізації asyncio розроблені таким чином, щоб бути подібними " +"до модулів :mod:`threading` з двома важливими застереженнями:" + +msgid "" +"asyncio primitives are not thread-safe, therefore they should not be used " +"for OS thread synchronization (use :mod:`threading` for that);" +msgstr "" +"примітиви asyncio не є потокобезпечними, тому їх не слід використовувати для " +"синхронізації потоків ОС (для цього використовуйте :mod:`threading`);" + +msgid "" +"methods of these synchronization primitives do not accept the *timeout* " +"argument; use the :func:`asyncio.wait_for` function to perform operations " +"with timeouts." +msgstr "" +"методи цих примітивів синхронізації не приймають аргумент *timeout*; " +"використовуйте функцію :func:`asyncio.wait_for` для виконання операцій із " +"тайм-аутами." + +msgid "asyncio has the following basic synchronization primitives:" +msgstr "asyncio має такі базові примітиви синхронізації:" + +msgid ":class:`Lock`" +msgstr ":class:`Lock`" + +msgid ":class:`Event`" +msgstr ":class:`Event`" + +msgid ":class:`Condition`" +msgstr ":class:`Condition`" + +msgid ":class:`Semaphore`" +msgstr ":class:`Semaphore`" + +msgid ":class:`BoundedSemaphore`" +msgstr ":class:`BoundedSemaphore`" + +msgid ":class:`Barrier`" +msgstr "" + +msgid "Lock" +msgstr "Замок" + +msgid "Implements a mutex lock for asyncio tasks. Not thread-safe." +msgstr "" +"Реалізує блокування м'ютексу для асинхронних завдань. Небезпечно для потоків." + +msgid "" +"An asyncio lock can be used to guarantee exclusive access to a shared " +"resource." +msgstr "" +"Асинхронне блокування можна використовувати, щоб гарантувати ексклюзивний " +"доступ до спільного ресурсу." + +msgid "The preferred way to use a Lock is an :keyword:`async with` statement::" +msgstr "" +"Найкращим способом використання Lock є оператор :keyword:`async with`::" + +msgid "" +"lock = asyncio.Lock()\n" +"\n" +"# ... later\n" +"async with lock:\n" +" # access shared state" +msgstr "" + +msgid "which is equivalent to::" +msgstr "що еквівалентно::" + +msgid "" +"lock = asyncio.Lock()\n" +"\n" +"# ... later\n" +"await lock.acquire()\n" +"try:\n" +" # access shared state\n" +"finally:\n" +" lock.release()" +msgstr "" + +msgid "Removed the *loop* parameter." +msgstr "Видалено параметр *loop*." + +msgid "Acquire the lock." +msgstr "Придбайте замок." + +msgid "" +"This method waits until the lock is *unlocked*, sets it to *locked* and " +"returns ``True``." +msgstr "" +"Цей метод очікує, поки блокування буде *розблоковано*, встановлює його на " +"*заблоковано* та повертає ``True``." + +msgid "" +"When more than one coroutine is blocked in :meth:`acquire` waiting for the " +"lock to be unlocked, only one coroutine eventually proceeds." +msgstr "" +"Якщо в :meth:`acquire` заблоковано більше ніж одну співпрограму, яка очікує " +"розблокування блокування, зрештою виконується лише одна співпрограма." + +msgid "" +"Acquiring a lock is *fair*: the coroutine that proceeds will be the first " +"coroutine that started waiting on the lock." +msgstr "" +"Отримання блокування є *чесним*: співпрограма, яка продовжується, буде " +"першою співпрограмою, яка почала очікувати на блокування." + +msgid "Release the lock." +msgstr "Відпустіть замок." + +msgid "When the lock is *locked*, reset it to *unlocked* and return." +msgstr "" +"Коли замок *заблоковано*, скиньте його на *розблоковано* та поверніться." + +msgid "If the lock is *unlocked*, a :exc:`RuntimeError` is raised." +msgstr "Якщо блокування *розблоковано*, виникає :exc:`RuntimeError`." + +msgid "Return ``True`` if the lock is *locked*." +msgstr "Повертає ``True``, якщо блокування *заблоковано*." + +msgid "Event" +msgstr "Подія" + +msgid "An event object. Not thread-safe." +msgstr "Об'єкт події. Небезпечно для потоків." + +msgid "" +"An asyncio event can be used to notify multiple asyncio tasks that some " +"event has happened." +msgstr "" +"Асинхронну подію можна використовувати для сповіщення кількох асинхронних " +"завдань про те, що сталася якась подія." + +msgid "" +"An Event object manages an internal flag that can be set to *true* with the :" +"meth:`~Event.set` method and reset to *false* with the :meth:`clear` " +"method. The :meth:`~Event.wait` method blocks until the flag is set to " +"*true*. The flag is set to *false* initially." +msgstr "" +"Об’єкт Event керує внутрішнім прапором, який можна встановити на *true* за " +"допомогою методу :meth:`~Event.set` і скинути на *false* за допомогою " +"методу :meth:`clear`. Метод :meth:`~Event.wait` блокується, доки прапор не " +"буде встановлено на *true*. Спочатку для прапора встановлено значення " +"*false*." + +msgid "Example::" +msgstr "Приклад::" + +msgid "" +"async def waiter(event):\n" +" print('waiting for it ...')\n" +" await event.wait()\n" +" print('... got it!')\n" +"\n" +"async def main():\n" +" # Create an Event object.\n" +" event = asyncio.Event()\n" +"\n" +" # Spawn a Task to wait until 'event' is set.\n" +" waiter_task = asyncio.create_task(waiter(event))\n" +"\n" +" # Sleep for 1 second and set the event.\n" +" await asyncio.sleep(1)\n" +" event.set()\n" +"\n" +" # Wait until the waiter task is finished.\n" +" await waiter_task\n" +"\n" +"asyncio.run(main())" +msgstr "" + +msgid "Wait until the event is set." +msgstr "Дочекайтеся встановлення події." + +msgid "" +"If the event is set, return ``True`` immediately. Otherwise block until " +"another task calls :meth:`~Event.set`." +msgstr "" +"Якщо подія встановлена, негайно поверніть ``True``. Інакше заблокуйте, доки " +"інше завдання не викличе :meth:`~Event.set`." + +msgid "Set the event." +msgstr "Встановити подію." + +msgid "All tasks waiting for event to be set will be immediately awakened." +msgstr "" +"Усі завдання, які очікують встановлення події, будуть негайно активовані." + +msgid "Clear (unset) the event." +msgstr "Очистити (скасувати) подію." + +msgid "" +"Tasks awaiting on :meth:`~Event.wait` will now block until the :meth:`~Event." +"set` method is called again." +msgstr "" +"Завдання, що очікують на :meth:`~Event.wait`, тепер блокуватимуться, доки " +"метод :meth:`~Event.set` не буде викликано знову." + +msgid "Return ``True`` if the event is set." +msgstr "Повертає ``True``, якщо подія встановлена." + +msgid "Condition" +msgstr "Хвороба" + +msgid "A Condition object. Not thread-safe." +msgstr "Об’єкт Condition. Небезпечно для потоків." + +msgid "" +"An asyncio condition primitive can be used by a task to wait for some event " +"to happen and then get exclusive access to a shared resource." +msgstr "" +"Примітив асинхронної умови може використовуватися завданням для очікування " +"настання певної події та отримання ексклюзивного доступу до спільного " +"ресурсу." + +msgid "" +"In essence, a Condition object combines the functionality of an :class:" +"`Event` and a :class:`Lock`. It is possible to have multiple Condition " +"objects share one Lock, which allows coordinating exclusive access to a " +"shared resource between different tasks interested in particular states of " +"that shared resource." +msgstr "" +"По суті, об’єкт Condition поєднує функціональні можливості :class:`Event` і :" +"class:`Lock`. Кілька об’єктів Condition можуть використовувати один Lock, що " +"дозволяє координувати ексклюзивний доступ до спільного ресурсу між різними " +"завданнями, зацікавленими в певних станах цього спільного ресурсу." + +msgid "" +"The optional *lock* argument must be a :class:`Lock` object or ``None``. In " +"the latter case a new Lock object is created automatically." +msgstr "" +"Додатковий аргумент *lock* має бути об’єктом :class:`Lock` або ``None``. В " +"останньому випадку новий об’єкт Lock створюється автоматично." + +msgid "" +"The preferred way to use a Condition is an :keyword:`async with` statement::" +msgstr "" +"Найкращим способом використання умови є оператор :keyword:`async with`::" + +msgid "" +"cond = asyncio.Condition()\n" +"\n" +"# ... later\n" +"async with cond:\n" +" await cond.wait()" +msgstr "" + +msgid "" +"cond = asyncio.Condition()\n" +"\n" +"# ... later\n" +"await cond.acquire()\n" +"try:\n" +" await cond.wait()\n" +"finally:\n" +" cond.release()" +msgstr "" + +msgid "Acquire the underlying lock." +msgstr "Отримайте основний замок." + +msgid "" +"This method waits until the underlying lock is *unlocked*, sets it to " +"*locked* and returns ``True``." +msgstr "" +"Цей метод чекає, доки базове блокування *розблокується*, встановлює його на " +"*locked* і повертає ``True``." + +msgid "" +"Wake up *n* tasks (1 by default) waiting on this condition. If fewer than " +"*n* tasks are waiting they are all awakened." +msgstr "" + +msgid "" +"The lock must be acquired before this method is called and released shortly " +"after. If called with an *unlocked* lock a :exc:`RuntimeError` error is " +"raised." +msgstr "" +"Блокування має бути отримано перед викликом цього методу та звільнено " +"незабаром після цього. У разі виклику з *розблокованим* блокуванням виникає " +"помилка :exc:`RuntimeError`." + +msgid "Return ``True`` if the underlying lock is acquired." +msgstr "Повертає ``True``, якщо основне блокування отримано." + +msgid "Wake up all tasks waiting on this condition." +msgstr "Розбудіть усі завдання, що очікують за цієї умови." + +msgid "This method acts like :meth:`notify`, but wakes up all waiting tasks." +msgstr "" +"Цей метод діє як :meth:`notify`, але активує всі завдання, що очікують." + +msgid "Release the underlying lock." +msgstr "Звільніть базовий замок." + +msgid "When invoked on an unlocked lock, a :exc:`RuntimeError` is raised." +msgstr "" +"Під час виклику для розблокованого блокування виникає :exc:`RuntimeError`." + +msgid "Wait until notified." +msgstr "Дочекайтеся повідомлення." + +msgid "" +"If the calling task has not acquired the lock when this method is called, a :" +"exc:`RuntimeError` is raised." +msgstr "" +"Якщо завдання, що викликає, не отримало блокування під час виклику цього " +"методу, виникає :exc:`RuntimeError`." + +msgid "" +"This method releases the underlying lock, and then blocks until it is " +"awakened by a :meth:`notify` or :meth:`notify_all` call. Once awakened, the " +"Condition re-acquires its lock and this method returns ``True``." +msgstr "" +"Цей метод знімає основне блокування, а потім блокує, доки його не розбудить " +"виклик :meth:`notify` або :meth:`notify_all`. Після пробудження умова знову " +"блокується, і цей метод повертає ``True``." + +msgid "" +"Note that a task *may* return from this call spuriously, which is why the " +"caller should always re-check the state and be prepared to :meth:`~Condition." +"wait` again. For this reason, you may prefer to use :meth:`~Condition." +"wait_for` instead." +msgstr "" + +msgid "Wait until a predicate becomes *true*." +msgstr "Зачекайте, поки предикат стане *true*." + +msgid "" +"The predicate must be a callable which result will be interpreted as a " +"boolean value. The method will repeatedly :meth:`~Condition.wait` until the " +"predicate evaluates to *true*. The final value is the return value." +msgstr "" + +msgid "Semaphore" +msgstr "Семафор" + +msgid "A Semaphore object. Not thread-safe." +msgstr "Об'єкт Semaphore. Небезпечно для потоків." + +msgid "" +"A semaphore manages an internal counter which is decremented by each :meth:" +"`acquire` call and incremented by each :meth:`release` call. The counter can " +"never go below zero; when :meth:`acquire` finds that it is zero, it blocks, " +"waiting until some task calls :meth:`release`." +msgstr "" +"Семафор керує внутрішнім лічильником, який зменшується при кожному виклику :" +"meth:`acquire` і збільшується при кожному виклику :meth:`release`. Лічильник " +"ніколи не може опускатися нижче нуля; коли :meth:`acquire` виявляє, що він " +"дорівнює нулю, він блокується, чекаючи, поки якесь завдання викличе :meth:" +"`release`." + +msgid "" +"The optional *value* argument gives the initial value for the internal " +"counter (``1`` by default). If the given value is less than ``0`` a :exc:" +"`ValueError` is raised." +msgstr "" +"Необов’язковий аргумент *value* дає початкове значення для внутрішнього " +"лічильника (``1`` за замовчуванням). Якщо вказане значення менше ніж ``0``, " +"виникає :exc:`ValueError`." + +msgid "" +"The preferred way to use a Semaphore is an :keyword:`async with` statement::" +msgstr "" +"Кращим способом використання семафора є оператор :keyword:`async with`::" + +msgid "" +"sem = asyncio.Semaphore(10)\n" +"\n" +"# ... later\n" +"async with sem:\n" +" # work with shared resource" +msgstr "" + +msgid "" +"sem = asyncio.Semaphore(10)\n" +"\n" +"# ... later\n" +"await sem.acquire()\n" +"try:\n" +" # work with shared resource\n" +"finally:\n" +" sem.release()" +msgstr "" + +msgid "Acquire a semaphore." +msgstr "Придбайте семафор." + +msgid "" +"If the internal counter is greater than zero, decrement it by one and return " +"``True`` immediately. If it is zero, wait until a :meth:`release` is called " +"and return ``True``." +msgstr "" +"Якщо внутрішній лічильник більший за нуль, зменште його на одиницю та " +"негайно поверніть ``True``. Якщо він дорівнює нулю, дочекайтеся виклику :" +"meth:`release` і поверніть ``True``." + +msgid "Returns ``True`` if semaphore can not be acquired immediately." +msgstr "Повертає ``True``, якщо семафор не може бути отриманий негайно." + +msgid "" +"Release a semaphore, incrementing the internal counter by one. Can wake up a " +"task waiting to acquire the semaphore." +msgstr "" +"Відпустіть семафор, збільшивши внутрішній лічильник на одиницю. Може " +"розбудити завдання, яке очікує отримання семафора." + +msgid "" +"Unlike :class:`BoundedSemaphore`, :class:`Semaphore` allows making more " +"``release()`` calls than ``acquire()`` calls." +msgstr "" +"На відміну від :class:`BoundedSemaphore`, :class:`Semaphore` дозволяє робити " +"більше викликів ``release()``, ніж викликів ``acquire()``." + +msgid "BoundedSemaphore" +msgstr "Обмежений семафор" + +msgid "A bounded semaphore object. Not thread-safe." +msgstr "Обмежений семафорний об’єкт. Небезпечно для потоків." + +msgid "" +"Bounded Semaphore is a version of :class:`Semaphore` that raises a :exc:" +"`ValueError` in :meth:`~Semaphore.release` if it increases the internal " +"counter above the initial *value*." +msgstr "" +"Обмежений семафор — це версія :class:`Semaphore`, яка викликає :exc:" +"`ValueError` у :meth:`~Semaphore.release`, якщо він збільшує внутрішній " +"лічильник вище початкового *значення*." + +msgid "Barrier" +msgstr "" + +msgid "A barrier object. Not thread-safe." +msgstr "" + +msgid "" +"A barrier is a simple synchronization primitive that allows to block until " +"*parties* number of tasks are waiting on it. Tasks can wait on the :meth:" +"`~Barrier.wait` method and would be blocked until the specified number of " +"tasks end up waiting on :meth:`~Barrier.wait`. At that point all of the " +"waiting tasks would unblock simultaneously." +msgstr "" + +msgid "" +":keyword:`async with` can be used as an alternative to awaiting on :meth:" +"`~Barrier.wait`." +msgstr "" + +msgid "The barrier can be reused any number of times." +msgstr "" + +msgid "" +"async def example_barrier():\n" +" # barrier with 3 parties\n" +" b = asyncio.Barrier(3)\n" +"\n" +" # create 2 new waiting tasks\n" +" asyncio.create_task(b.wait())\n" +" asyncio.create_task(b.wait())\n" +"\n" +" await asyncio.sleep(0)\n" +" print(b)\n" +"\n" +" # The third .wait() call passes the barrier\n" +" await b.wait()\n" +" print(b)\n" +" print(\"barrier passed\")\n" +"\n" +" await asyncio.sleep(0)\n" +" print(b)\n" +"\n" +"asyncio.run(example_barrier())" +msgstr "" + +msgid "Result of this example is::" +msgstr "" + +msgid "" +"\n" +"\n" +"barrier passed\n" +"" +msgstr "" + +msgid "" +"Pass the barrier. When all the tasks party to the barrier have called this " +"function, they are all unblocked simultaneously." +msgstr "" + +msgid "" +"When a waiting or blocked task in the barrier is cancelled, this task exits " +"the barrier which stays in the same state. If the state of the barrier is " +"\"filling\", the number of waiting task decreases by 1." +msgstr "" + +msgid "" +"The return value is an integer in the range of 0 to ``parties-1``, different " +"for each task. This can be used to select a task to do some special " +"housekeeping, e.g.::" +msgstr "" + +msgid "" +"...\n" +"async with barrier as position:\n" +" if position == 0:\n" +" # Only one task prints this\n" +" print('End of *draining phase*')" +msgstr "" + +msgid "" +"This method may raise a :class:`BrokenBarrierError` exception if the barrier " +"is broken or reset while a task is waiting. It could raise a :exc:" +"`CancelledError` if a task is cancelled." +msgstr "" + +msgid "" +"Return the barrier to the default, empty state. Any tasks waiting on it " +"will receive the :class:`BrokenBarrierError` exception." +msgstr "" + +msgid "" +"If a barrier is broken it may be better to just leave it and create a new " +"one." +msgstr "" + +msgid "" +"Put the barrier into a broken state. This causes any active or future calls " +"to :meth:`~Barrier.wait` to fail with the :class:`BrokenBarrierError`. Use " +"this for example if one of the tasks needs to abort, to avoid infinite " +"waiting tasks." +msgstr "" + +msgid "The number of tasks required to pass the barrier." +msgstr "" + +msgid "The number of tasks currently waiting in the barrier while filling." +msgstr "" + +msgid "A boolean that is ``True`` if the barrier is in the broken state." +msgstr "" +"Логічне значення, яке має значення ``True``, якщо бар’єр знаходиться в " +"зламаному стані." + +msgid "" +"This exception, a subclass of :exc:`RuntimeError`, is raised when the :class:" +"`Barrier` object is reset or broken." +msgstr "" +"Цей виняток, підклас :exc:`RuntimeError`, виникає, коли об’єкт :class:" +"`Barrier` скидається або зламано." + +msgid "" +"Acquiring a lock using ``await lock`` or ``yield from lock`` and/or :keyword:" +"`with` statement (``with await lock``, ``with (yield from lock)``) was " +"removed. Use ``async with lock`` instead." +msgstr "" +"Отримання блокування за допомогою оператора ``await lock`` або ``yield from " +"lock`` та/або :keyword:`with` (``with await lock``, ``with (yield from " +"lock)``) було видалено . Натомість використовуйте ``async with lock``." diff --git a/library/asyncio-task.po b/library/asyncio-task.po new file mode 100644 index 000000000..87b408670 --- /dev/null +++ b/library/asyncio-task.po @@ -0,0 +1,1828 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2023 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:55+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2023\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Coroutines and Tasks" +msgstr "Співпрограми та завдання" + +msgid "" +"This section outlines high-level asyncio APIs to work with coroutines and " +"Tasks." +msgstr "" +"У цьому розділі описано асинхронні API високого рівня для роботи з " +"співпрограмами та завданнями." + +msgid "Coroutines" +msgstr "Співпрограми" + +msgid "**Source code:** :source:`Lib/asyncio/coroutines.py`" +msgstr "" + +msgid "" +":term:`Coroutines ` declared with the async/await syntax is the " +"preferred way of writing asyncio applications. For example, the following " +"snippet of code prints \"hello\", waits 1 second, and then prints \"world\"::" +msgstr "" +":term:`Coroutines `, оголошений із синтаксисом async/await, є " +"кращим способом написання асинхронних програм. Наприклад, наступний фрагмент " +"коду друкує \"hello\", чекає 1 секунду, а потім друкує \"world\"::" + +msgid "" +">>> import asyncio\n" +"\n" +">>> async def main():\n" +"... print('hello')\n" +"... await asyncio.sleep(1)\n" +"... print('world')\n" +"\n" +">>> asyncio.run(main())\n" +"hello\n" +"world" +msgstr "" + +msgid "" +"Note that simply calling a coroutine will not schedule it to be executed::" +msgstr "Зауважте, що простий виклик співпрограми не запланує її виконання:" + +msgid "" +">>> main()\n" +"" +msgstr "" + +msgid "To actually run a coroutine, asyncio provides the following mechanisms:" +msgstr "" + +msgid "" +"The :func:`asyncio.run` function to run the top-level entry point \"main()\" " +"function (see the above example.)" +msgstr "" +"Функція :func:`asyncio.run` для запуску функції точки входу верхнього рівня " +"\"main()\" (див. приклад вище)." + +msgid "" +"Awaiting on a coroutine. The following snippet of code will print \"hello\" " +"after waiting for 1 second, and then print \"world\" after waiting for " +"*another* 2 seconds::" +msgstr "" +"Очікування співпрограми. Наступний фрагмент коду надрукує \"привіт\" після " +"очікування 1 секунду, а потім надрукує \"світ\" після очікування *ще* 2 " +"секунди::" + +msgid "" +"import asyncio\n" +"import time\n" +"\n" +"async def say_after(delay, what):\n" +" await asyncio.sleep(delay)\n" +" print(what)\n" +"\n" +"async def main():\n" +" print(f\"started at {time.strftime('%X')}\")\n" +"\n" +" await say_after(1, 'hello')\n" +" await say_after(2, 'world')\n" +"\n" +" print(f\"finished at {time.strftime('%X')}\")\n" +"\n" +"asyncio.run(main())" +msgstr "" + +msgid "Expected output::" +msgstr "Очікуваний результат::" + +msgid "" +"started at 17:13:52\n" +"hello\n" +"world\n" +"finished at 17:13:55" +msgstr "" + +msgid "" +"The :func:`asyncio.create_task` function to run coroutines concurrently as " +"asyncio :class:`Tasks `." +msgstr "" +"Функція :func:`asyncio.create_task` для одночасного запуску співпрограм як " +"asyncio :class:`Tasks `." + +msgid "" +"Let's modify the above example and run two ``say_after`` coroutines " +"*concurrently*::" +msgstr "" +"Давайте змінимо наведений вище приклад і запустимо дві співпрограми " +"``say_after`` *одночасно*::" + +msgid "" +"async def main():\n" +" task1 = asyncio.create_task(\n" +" say_after(1, 'hello'))\n" +"\n" +" task2 = asyncio.create_task(\n" +" say_after(2, 'world'))\n" +"\n" +" print(f\"started at {time.strftime('%X')}\")\n" +"\n" +" # Wait until both tasks are completed (should take\n" +" # around 2 seconds.)\n" +" await task1\n" +" await task2\n" +"\n" +" print(f\"finished at {time.strftime('%X')}\")" +msgstr "" + +msgid "" +"Note that expected output now shows that the snippet runs 1 second faster " +"than before::" +msgstr "" +"Зауважте, що очікуваний вихід тепер показує, що фрагмент працює на 1 секунду " +"швидше, ніж раніше:" + +msgid "" +"started at 17:14:32\n" +"hello\n" +"world\n" +"finished at 17:14:34" +msgstr "" + +msgid "" +"The :class:`asyncio.TaskGroup` class provides a more modern alternative to :" +"func:`create_task`. Using this API, the last example becomes::" +msgstr "" + +msgid "" +"async def main():\n" +" async with asyncio.TaskGroup() as tg:\n" +" task1 = tg.create_task(\n" +" say_after(1, 'hello'))\n" +"\n" +" task2 = tg.create_task(\n" +" say_after(2, 'world'))\n" +"\n" +" print(f\"started at {time.strftime('%X')}\")\n" +"\n" +" # The await is implicit when the context manager exits.\n" +"\n" +" print(f\"finished at {time.strftime('%X')}\")" +msgstr "" + +msgid "The timing and output should be the same as for the previous version." +msgstr "" + +msgid ":class:`asyncio.TaskGroup`." +msgstr "" + +msgid "Awaitables" +msgstr "очікування" + +msgid "" +"We say that an object is an **awaitable** object if it can be used in an :" +"keyword:`await` expression. Many asyncio APIs are designed to accept " +"awaitables." +msgstr "" +"Ми кажемо, що об’єкт є **очікуваним** об’єктом, якщо його можна " +"використовувати у виразі :keyword:`await`. Багато асинхронних API розроблено " +"для прийняття очікуваних." + +msgid "" +"There are three main types of *awaitable* objects: **coroutines**, " +"**Tasks**, and **Futures**." +msgstr "" +"Існує три основних типи *очікуваних* об’єктів: **співпрограми**, " +"**Завдання** та **Ф’ючерси**." + +msgid "" +"Python coroutines are *awaitables* and therefore can be awaited from other " +"coroutines::" +msgstr "" +"Співпрограми Python є *очікуваними*, тому їх можна очікувати від інших " +"співпрограм:" + +msgid "" +"import asyncio\n" +"\n" +"async def nested():\n" +" return 42\n" +"\n" +"async def main():\n" +" # Nothing happens if we just call \"nested()\".\n" +" # A coroutine object is created but not awaited,\n" +" # so it *won't run at all*.\n" +" nested() # will raise a \"RuntimeWarning\".\n" +"\n" +" # Let's do it differently now and await it:\n" +" print(await nested()) # will print \"42\".\n" +"\n" +"asyncio.run(main())" +msgstr "" + +msgid "" +"In this documentation the term \"coroutine\" can be used for two closely " +"related concepts:" +msgstr "" +"У цій документації термін \"співпрограма\" може використовуватися для двох " +"тісно пов’язаних понять:" + +msgid "a *coroutine function*: an :keyword:`async def` function;" +msgstr "*співпрограма*: функція :keyword:`async def`;" + +msgid "" +"a *coroutine object*: an object returned by calling a *coroutine function*." +msgstr "" +"*об’єкт співпрограми*: об’єкт, повернутий викликом *функції співпрограми*." + +msgid "Tasks" +msgstr "завдання" + +msgid "*Tasks* are used to schedule coroutines *concurrently*." +msgstr "*Завдання* використовуються для *одночасного* планування співпрограм." + +msgid "" +"When a coroutine is wrapped into a *Task* with functions like :func:`asyncio." +"create_task` the coroutine is automatically scheduled to run soon::" +msgstr "" +"Коли співпрограму загорнуто в *Task* із такими функціями, як :func:`asyncio." +"create_task`, співпрограма автоматично планується для незабаром:" + +msgid "" +"import asyncio\n" +"\n" +"async def nested():\n" +" return 42\n" +"\n" +"async def main():\n" +" # Schedule nested() to run soon concurrently\n" +" # with \"main()\".\n" +" task = asyncio.create_task(nested())\n" +"\n" +" # \"task\" can now be used to cancel \"nested()\", or\n" +" # can simply be awaited to wait until it is complete:\n" +" await task\n" +"\n" +"asyncio.run(main())" +msgstr "" + +msgid "Futures" +msgstr "Ф'ючерси" + +msgid "" +"A :class:`Future` is a special **low-level** awaitable object that " +"represents an **eventual result** of an asynchronous operation." +msgstr "" +":class:`Future` — це спеціальний **низькорівневий** очікуваний об’єкт, який " +"представляє **кінцевий результат** асинхронної операції." + +msgid "" +"When a Future object is *awaited* it means that the coroutine will wait " +"until the Future is resolved in some other place." +msgstr "" +"Коли об’єкт Future *очікується*, це означає, що співпрограма чекатиме, поки " +"Future не буде дозволено в іншому місці." + +msgid "" +"Future objects in asyncio are needed to allow callback-based code to be used " +"with async/await." +msgstr "" +"Майбутні об’єкти в asyncio потрібні для того, щоб код на основі зворотного " +"виклику використовувався з async/await." + +msgid "" +"Normally **there is no need** to create Future objects at the application " +"level code." +msgstr "" +"Зазвичай **немає необхідності** створювати об’єкти Future на рівні програми." + +msgid "" +"Future objects, sometimes exposed by libraries and some asyncio APIs, can be " +"awaited::" +msgstr "" +"Майбутні об’єкти, іноді доступні бібліотеками та деякими асинхронними API, " +"можна очікувати:" + +msgid "" +"async def main():\n" +" await function_that_returns_a_future_object()\n" +"\n" +" # this is also valid:\n" +" await asyncio.gather(\n" +" function_that_returns_a_future_object(),\n" +" some_python_coroutine()\n" +" )" +msgstr "" + +msgid "" +"A good example of a low-level function that returns a Future object is :meth:" +"`loop.run_in_executor`." +msgstr "" +"Хорошим прикладом функції низького рівня, яка повертає об’єкт Future, є :" +"meth:`loop.run_in_executor`." + +msgid "Creating Tasks" +msgstr "Створення завдань" + +msgid "**Source code:** :source:`Lib/asyncio/tasks.py`" +msgstr "" + +msgid "" +"Wrap the *coro* :ref:`coroutine ` into a :class:`Task` and " +"schedule its execution. Return the Task object." +msgstr "" +"Загорніть *coro* :ref:`coroutine ` в :class:`Task` і заплануйте " +"його виконання. Повернути об’єкт Task." + +msgid "" +"If *name* is not ``None``, it is set as the name of the task using :meth:" +"`Task.set_name`." +msgstr "" +"Якщо *name* не є ``None``, воно встановлюється як назва завдання за " +"допомогою :meth:`Task.set_name`." + +msgid "" +"An optional keyword-only *context* argument allows specifying a custom :" +"class:`contextvars.Context` for the *coro* to run in. The current context " +"copy is created when no *context* is provided." +msgstr "" + +msgid "" +"The task is executed in the loop returned by :func:`get_running_loop`, :exc:" +"`RuntimeError` is raised if there is no running loop in current thread." +msgstr "" +"Завдання виконується в циклі, який повертає :func:`get_running_loop`, :exc:" +"`RuntimeError` виникає, якщо в поточному потоці немає запущеного циклу." + +msgid "" +":meth:`asyncio.TaskGroup.create_task` is a new alternative leveraging " +"structural concurrency; it allows for waiting for a group of related tasks " +"with strong safety guarantees." +msgstr "" + +msgid "" +"Save a reference to the result of this function, to avoid a task " +"disappearing mid-execution. The event loop only keeps weak references to " +"tasks. A task that isn't referenced elsewhere may get garbage collected at " +"any time, even before it's done. For reliable \"fire-and-forget\" background " +"tasks, gather them in a collection::" +msgstr "" + +msgid "" +"background_tasks = set()\n" +"\n" +"for i in range(10):\n" +" task = asyncio.create_task(some_coro(param=i))\n" +"\n" +" # Add task to the set. This creates a strong reference.\n" +" background_tasks.add(task)\n" +"\n" +" # To prevent keeping references to finished tasks forever,\n" +" # make each task remove its own reference from the set after\n" +" # completion:\n" +" task.add_done_callback(background_tasks.discard)" +msgstr "" + +msgid "Added the *name* parameter." +msgstr "Додано параметр *name*." + +msgid "Added the *context* parameter." +msgstr "" + +msgid "Task Cancellation" +msgstr "" + +msgid "" +"Tasks can easily and safely be cancelled. When a task is cancelled, :exc:" +"`asyncio.CancelledError` will be raised in the task at the next opportunity." +msgstr "" + +msgid "" +"It is recommended that coroutines use ``try/finally`` blocks to robustly " +"perform clean-up logic. In case :exc:`asyncio.CancelledError` is explicitly " +"caught, it should generally be propagated when clean-up is complete. :exc:" +"`asyncio.CancelledError` directly subclasses :exc:`BaseException` so most " +"code will not need to be aware of it." +msgstr "" + +msgid "" +"The asyncio components that enable structured concurrency, like :class:" +"`asyncio.TaskGroup` and :func:`asyncio.timeout`, are implemented using " +"cancellation internally and might misbehave if a coroutine swallows :exc:" +"`asyncio.CancelledError`. Similarly, user code should not generally call :" +"meth:`uncancel `. However, in cases when suppressing :" +"exc:`asyncio.CancelledError` is truly desired, it is necessary to also call " +"``uncancel()`` to completely remove the cancellation state." +msgstr "" + +msgid "Task Groups" +msgstr "" + +msgid "" +"Task groups combine a task creation API with a convenient and reliable way " +"to wait for all tasks in the group to finish." +msgstr "" + +msgid "" +"An :ref:`asynchronous context manager ` holding a " +"group of tasks. Tasks can be added to the group using :meth:`create_task`. " +"All tasks are awaited when the context manager exits." +msgstr "" + +msgid "" +"Create a task in this task group. The signature matches that of :func:" +"`asyncio.create_task`. If the task group is inactive (e.g. not yet entered, " +"already finished, or in the process of shutting down), we will close the " +"given ``coro``." +msgstr "" + +msgid "Close the given coroutine if the task group is not active." +msgstr "" + +msgid "Example::" +msgstr "Приклад::" + +msgid "" +"async def main():\n" +" async with asyncio.TaskGroup() as tg:\n" +" task1 = tg.create_task(some_coro(...))\n" +" task2 = tg.create_task(another_coro(...))\n" +" print(f\"Both tasks have completed now: {task1.result()}, {task2." +"result()}\")" +msgstr "" + +msgid "" +"The ``async with`` statement will wait for all tasks in the group to finish. " +"While waiting, new tasks may still be added to the group (for example, by " +"passing ``tg`` into one of the coroutines and calling ``tg.create_task()`` " +"in that coroutine). Once the last task has finished and the ``async with`` " +"block is exited, no new tasks may be added to the group." +msgstr "" + +msgid "" +"The first time any of the tasks belonging to the group fails with an " +"exception other than :exc:`asyncio.CancelledError`, the remaining tasks in " +"the group are cancelled. No further tasks can then be added to the group. At " +"this point, if the body of the ``async with`` statement is still active (i." +"e., :meth:`~object.__aexit__` hasn't been called yet), the task directly " +"containing the ``async with`` statement is also cancelled. The resulting :" +"exc:`asyncio.CancelledError` will interrupt an ``await``, but it will not " +"bubble out of the containing ``async with`` statement." +msgstr "" + +msgid "" +"Once all tasks have finished, if any tasks have failed with an exception " +"other than :exc:`asyncio.CancelledError`, those exceptions are combined in " +"an :exc:`ExceptionGroup` or :exc:`BaseExceptionGroup` (as appropriate; see " +"their documentation) which is then raised." +msgstr "" + +msgid "" +"Two base exceptions are treated specially: If any task fails with :exc:" +"`KeyboardInterrupt` or :exc:`SystemExit`, the task group still cancels the " +"remaining tasks and waits for them, but then the initial :exc:" +"`KeyboardInterrupt` or :exc:`SystemExit` is re-raised instead of :exc:" +"`ExceptionGroup` or :exc:`BaseExceptionGroup`." +msgstr "" + +msgid "" +"If the body of the ``async with`` statement exits with an exception (so :" +"meth:`~object.__aexit__` is called with an exception set), this is treated " +"the same as if one of the tasks failed: the remaining tasks are cancelled " +"and then waited for, and non-cancellation exceptions are grouped into an " +"exception group and raised. The exception passed into :meth:`~object." +"__aexit__`, unless it is :exc:`asyncio.CancelledError`, is also included in " +"the exception group. The same special case is made for :exc:" +"`KeyboardInterrupt` and :exc:`SystemExit` as in the previous paragraph." +msgstr "" + +msgid "" +"Task groups are careful not to mix up the internal cancellation used to " +"\"wake up\" their :meth:`~object.__aexit__` with cancellation requests for " +"the task in which they are running made by other parties. In particular, " +"when one task group is syntactically nested in another, and both experience " +"an exception in one of their child tasks simultaneously, the inner task " +"group will process its exceptions, and then the outer task group will " +"receive another cancellation and process its own exceptions." +msgstr "" + +msgid "" +"In the case where a task group is cancelled externally and also must raise " +"an :exc:`ExceptionGroup`, it will call the parent task's :meth:`~asyncio." +"Task.cancel` method. This ensures that a :exc:`asyncio.CancelledError` will " +"be raised at the next :keyword:`await`, so the cancellation is not lost." +msgstr "" + +msgid "" +"Task groups preserve the cancellation count reported by :meth:`asyncio.Task." +"cancelling`." +msgstr "" + +msgid "" +"Improved handling of simultaneous internal and external cancellations and " +"correct preservation of cancellation counts." +msgstr "" + +msgid "Terminating a Task Group" +msgstr "" + +msgid "" +"While terminating a task group is not natively supported by the standard " +"library, termination can be achieved by adding an exception-raising task to " +"the task group and ignoring the raised exception:" +msgstr "" + +msgid "" +"import asyncio\n" +"from asyncio import TaskGroup\n" +"\n" +"class TerminateTaskGroup(Exception):\n" +" \"\"\"Exception raised to terminate a task group.\"\"\"\n" +"\n" +"async def force_terminate_task_group():\n" +" \"\"\"Used to force termination of a task group.\"\"\"\n" +" raise TerminateTaskGroup()\n" +"\n" +"async def job(task_id, sleep_time):\n" +" print(f'Task {task_id}: start')\n" +" await asyncio.sleep(sleep_time)\n" +" print(f'Task {task_id}: done')\n" +"\n" +"async def main():\n" +" try:\n" +" async with TaskGroup() as group:\n" +" # spawn some tasks\n" +" group.create_task(job(1, 0.5))\n" +" group.create_task(job(2, 1.5))\n" +" # sleep for 1 second\n" +" await asyncio.sleep(1)\n" +" # add an exception-raising task to force the group to terminate\n" +" group.create_task(force_terminate_task_group())\n" +" except* TerminateTaskGroup:\n" +" pass\n" +"\n" +"asyncio.run(main())" +msgstr "" + +msgid "Expected output:" +msgstr "" + +msgid "" +"Task 1: start\n" +"Task 2: start\n" +"Task 1: done" +msgstr "" + +msgid "Sleeping" +msgstr "спить" + +msgid "Block for *delay* seconds." +msgstr "Блокувати на *затримку* секунд." + +msgid "" +"If *result* is provided, it is returned to the caller when the coroutine " +"completes." +msgstr "" +"Якщо надано *результат*, він повертається абоненту після завершення " +"співпрограми." + +msgid "" +"``sleep()`` always suspends the current task, allowing other tasks to run." +msgstr "" +"``sleep()`` завжди призупиняє поточне завдання, дозволяючи виконувати інші " +"завдання." + +msgid "" +"Setting the delay to 0 provides an optimized path to allow other tasks to " +"run. This can be used by long-running functions to avoid blocking the event " +"loop for the full duration of the function call." +msgstr "" +"Встановлення затримки на 0 забезпечує оптимізований шлях для виконання інших " +"завдань. Це може бути використано функціями, які довго виконуються, щоб " +"уникнути блокування циклу подій протягом повної тривалості виклику функції." + +msgid "" +"Example of coroutine displaying the current date every second for 5 seconds::" +msgstr "" +"Приклад співпрограми, що відображає поточну дату кожну секунду протягом 5 " +"секунд:" + +msgid "" +"import asyncio\n" +"import datetime\n" +"\n" +"async def display_date():\n" +" loop = asyncio.get_running_loop()\n" +" end_time = loop.time() + 5.0\n" +" while True:\n" +" print(datetime.datetime.now())\n" +" if (loop.time() + 1.0) >= end_time:\n" +" break\n" +" await asyncio.sleep(1)\n" +"\n" +"asyncio.run(display_date())" +msgstr "" + +msgid "Removed the *loop* parameter." +msgstr "Видалено параметр *loop*." + +msgid "Raises :exc:`ValueError` if *delay* is :data:`~math.nan`." +msgstr "" + +msgid "Running Tasks Concurrently" +msgstr "Одночасне виконання завдань" + +msgid "" +"Run :ref:`awaitable objects ` in the *aws* sequence " +"*concurrently*." +msgstr "" +"Запустіть :ref:`waitable objects ` у послідовності *aws* " +"*одночасно*." + +msgid "" +"If any awaitable in *aws* is a coroutine, it is automatically scheduled as a " +"Task." +msgstr "" +"Якщо будь-який awaitable у *aws* є співпрограмою, він автоматично " +"запланований як завдання." + +msgid "" +"If all awaitables are completed successfully, the result is an aggregate " +"list of returned values. The order of result values corresponds to the " +"order of awaitables in *aws*." +msgstr "" +"Якщо всі очікування виконано успішно, результатом буде зведений список " +"повернутих значень. Порядок значень результатів відповідає порядку " +"очікуваних значень у *aws*." + +msgid "" +"If *return_exceptions* is ``False`` (default), the first raised exception is " +"immediately propagated to the task that awaits on ``gather()``. Other " +"awaitables in the *aws* sequence **won't be cancelled** and will continue to " +"run." +msgstr "" +"Якщо *return_exceptions* має значення ``False`` (за замовчуванням), перший " +"викликаний виняток негайно поширюється на завдання, яке очікує на " +"``gather()``. Інші очікування в послідовності *aws* **не будуть скасовані** " +"і продовжуватимуть працювати." + +msgid "" +"If *return_exceptions* is ``True``, exceptions are treated the same as " +"successful results, and aggregated in the result list." +msgstr "" +"Якщо *return_exceptions* має значення ``True``, винятки обробляються так " +"само, як успішні результати, і агрегуються в списку результатів." + +msgid "" +"If ``gather()`` is *cancelled*, all submitted awaitables (that have not " +"completed yet) are also *cancelled*." +msgstr "" +"Якщо ``gather()`` *скасовано*, усі надіслані очікування (які ще не " +"завершені) також *скасуються*." + +msgid "" +"If any Task or Future from the *aws* sequence is *cancelled*, it is treated " +"as if it raised :exc:`CancelledError` -- the ``gather()`` call is **not** " +"cancelled in this case. This is to prevent the cancellation of one " +"submitted Task/Future to cause other Tasks/Futures to be cancelled." +msgstr "" +"Якщо будь-яке завдання або майбутнє з послідовності *aws* *скасовано*, воно " +"розглядається як викликане :exc:`CancelledError` -- у цьому випадку виклик " +"``gather()`` **не** скасовується . Це робиться для того, щоб запобігти " +"скасуванню одного поданого Завдання/Майбутнього, що спричинить скасування " +"інших Завдань/Ф’ючерсів." + +msgid "" +"A new alternative to create and run tasks concurrently and wait for their " +"completion is :class:`asyncio.TaskGroup`. *TaskGroup* provides stronger " +"safety guarantees than *gather* for scheduling a nesting of subtasks: if a " +"task (or a subtask, a task scheduled by a task) raises an exception, " +"*TaskGroup* will, while *gather* will not, cancel the remaining scheduled " +"tasks)." +msgstr "" + +msgid "" +"import asyncio\n" +"\n" +"async def factorial(name, number):\n" +" f = 1\n" +" for i in range(2, number + 1):\n" +" print(f\"Task {name}: Compute factorial({number}), currently i={i}..." +"\")\n" +" await asyncio.sleep(1)\n" +" f *= i\n" +" print(f\"Task {name}: factorial({number}) = {f}\")\n" +" return f\n" +"\n" +"async def main():\n" +" # Schedule three calls *concurrently*:\n" +" L = await asyncio.gather(\n" +" factorial(\"A\", 2),\n" +" factorial(\"B\", 3),\n" +" factorial(\"C\", 4),\n" +" )\n" +" print(L)\n" +"\n" +"asyncio.run(main())\n" +"\n" +"# Expected output:\n" +"#\n" +"# Task A: Compute factorial(2), currently i=2...\n" +"# Task B: Compute factorial(3), currently i=2...\n" +"# Task C: Compute factorial(4), currently i=2...\n" +"# Task A: factorial(2) = 2\n" +"# Task B: Compute factorial(3), currently i=3...\n" +"# Task C: Compute factorial(4), currently i=3...\n" +"# Task B: factorial(3) = 6\n" +"# Task C: Compute factorial(4), currently i=4...\n" +"# Task C: factorial(4) = 24\n" +"# [2, 6, 24]" +msgstr "" + +msgid "" +"If *return_exceptions* is false, cancelling gather() after it has been " +"marked done won't cancel any submitted awaitables. For instance, gather can " +"be marked done after propagating an exception to the caller, therefore, " +"calling ``gather.cancel()`` after catching an exception (raised by one of " +"the awaitables) from gather won't cancel any other awaitables." +msgstr "" + +msgid "" +"If the *gather* itself is cancelled, the cancellation is propagated " +"regardless of *return_exceptions*." +msgstr "" +"Якщо сам *gather* скасовано, скасування поширюється незалежно від " +"*return_exceptions*." + +msgid "" +"Deprecation warning is emitted if no positional arguments are provided or " +"not all positional arguments are Future-like objects and there is no running " +"event loop." +msgstr "" +"Якщо не надано позиційних аргументів або не всі позиційні аргументи є Future-" +"подібними об’єктами, і немає запущеного циклу подій, видається попередження " +"про застаріле." + +msgid "Eager Task Factory" +msgstr "" + +msgid "A task factory for eager task execution." +msgstr "" + +msgid "" +"When using this factory (via :meth:`loop.set_task_factory(asyncio." +"eager_task_factory) `), coroutines begin execution " +"synchronously during :class:`Task` construction. Tasks are only scheduled on " +"the event loop if they block. This can be a performance improvement as the " +"overhead of loop scheduling is avoided for coroutines that complete " +"synchronously." +msgstr "" + +msgid "" +"A common example where this is beneficial is coroutines which employ caching " +"or memoization to avoid actual I/O when possible." +msgstr "" + +msgid "" +"Immediate execution of the coroutine is a semantic change. If the coroutine " +"returns or raises, the task is never scheduled to the event loop. If the " +"coroutine execution blocks, the task is scheduled to the event loop. This " +"change may introduce behavior changes to existing applications. For example, " +"the application's task execution order is likely to change." +msgstr "" + +msgid "" +"Create an eager task factory, similar to :func:`eager_task_factory`, using " +"the provided *custom_task_constructor* when creating a new task instead of " +"the default :class:`Task`." +msgstr "" + +msgid "" +"*custom_task_constructor* must be a *callable* with the signature matching " +"the signature of :class:`Task.__init__ `. The callable must return a :" +"class:`asyncio.Task`-compatible object." +msgstr "" + +msgid "" +"This function returns a *callable* intended to be used as a task factory of " +"an event loop via :meth:`loop.set_task_factory(factory) `)." +msgstr "" + +msgid "Shielding From Cancellation" +msgstr "Захист від скасування" + +msgid "" +"Protect an :ref:`awaitable object ` from being :meth:" +"`cancelled `." +msgstr "" +"Захист :ref:`очікуваного об’єкта ` від :meth:`скасування " +"`." + +msgid "If *aw* is a coroutine it is automatically scheduled as a Task." +msgstr "Якщо *aw* є співпрограмою, вона автоматично запланована як завдання." + +msgid "The statement::" +msgstr "Заява::" + +msgid "" +"task = asyncio.create_task(something())\n" +"res = await shield(task)" +msgstr "" + +msgid "is equivalent to::" +msgstr "еквівалентно::" + +msgid "res = await something()" +msgstr "" + +msgid "" +"*except* that if the coroutine containing it is cancelled, the Task running " +"in ``something()`` is not cancelled. From the point of view of " +"``something()``, the cancellation did not happen. Although its caller is " +"still cancelled, so the \"await\" expression still raises a :exc:" +"`CancelledError`." +msgstr "" +"*за винятком* того, що якщо співпрограму, яка містить його, скасовується, " +"Завдання, що виконується в ``something()``, не скасовується. З точки зору " +"``something()``, скасування не відбулося. Хоча його виклик все ще скасовано, " +"тому вираз \"чекати\" все ще викликає :exc:`CancelledError`." + +msgid "" +"If ``something()`` is cancelled by other means (i.e. from within itself) " +"that would also cancel ``shield()``." +msgstr "" +"Якщо ``something()`` скасовано іншими засобами (тобто зсередини), це також " +"скасує ``shield()``." + +msgid "" +"If it is desired to completely ignore cancellation (not recommended) the " +"``shield()`` function should be combined with a try/except clause, as " +"follows::" +msgstr "" +"Якщо потрібно повністю ігнорувати скасування (не рекомендовано), функцію " +"``shield()`` слід поєднати з реченням try/except, як показано нижче:" + +msgid "" +"task = asyncio.create_task(something())\n" +"try:\n" +" res = await shield(task)\n" +"except CancelledError:\n" +" res = None" +msgstr "" + +msgid "" +"Save a reference to tasks passed to this function, to avoid a task " +"disappearing mid-execution. The event loop only keeps weak references to " +"tasks. A task that isn't referenced elsewhere may get garbage collected at " +"any time, even before it's done." +msgstr "" + +msgid "" +"Deprecation warning is emitted if *aw* is not Future-like object and there " +"is no running event loop." +msgstr "" +"Якщо *aw* не є Future-подібним об’єктом і немає запущеного циклу подій, " +"видається попередження про застаріння." + +msgid "Timeouts" +msgstr "Тайм-аути" + +msgid "" +"Return an :ref:`asynchronous context manager ` that " +"can be used to limit the amount of time spent waiting on something." +msgstr "" + +msgid "" +"*delay* can either be ``None``, or a float/int number of seconds to wait. If " +"*delay* is ``None``, no time limit will be applied; this can be useful if " +"the delay is unknown when the context manager is created." +msgstr "" + +msgid "" +"In either case, the context manager can be rescheduled after creation using :" +"meth:`Timeout.reschedule`." +msgstr "" + +msgid "" +"async def main():\n" +" async with asyncio.timeout(10):\n" +" await long_running_task()" +msgstr "" + +msgid "" +"If ``long_running_task`` takes more than 10 seconds to complete, the context " +"manager will cancel the current task and handle the resulting :exc:`asyncio." +"CancelledError` internally, transforming it into a :exc:`TimeoutError` which " +"can be caught and handled." +msgstr "" + +msgid "" +"The :func:`asyncio.timeout` context manager is what transforms the :exc:" +"`asyncio.CancelledError` into a :exc:`TimeoutError`, which means the :exc:" +"`TimeoutError` can only be caught *outside* of the context manager." +msgstr "" + +msgid "Example of catching :exc:`TimeoutError`::" +msgstr "" + +msgid "" +"async def main():\n" +" try:\n" +" async with asyncio.timeout(10):\n" +" await long_running_task()\n" +" except TimeoutError:\n" +" print(\"The long operation timed out, but we've handled it.\")\n" +"\n" +" print(\"This statement will run regardless.\")" +msgstr "" + +msgid "" +"The context manager produced by :func:`asyncio.timeout` can be rescheduled " +"to a different deadline and inspected." +msgstr "" + +msgid "" +"An :ref:`asynchronous context manager ` for " +"cancelling overdue coroutines." +msgstr "" + +msgid "" +"``when`` should be an absolute time at which the context should time out, as " +"measured by the event loop's clock:" +msgstr "" + +msgid "If ``when`` is ``None``, the timeout will never trigger." +msgstr "" + +msgid "" +"If ``when < loop.time()``, the timeout will trigger on the next iteration of " +"the event loop." +msgstr "" + +msgid "" +"Return the current deadline, or ``None`` if the current deadline is not set." +msgstr "" + +msgid "Reschedule the timeout." +msgstr "" + +msgid "Return whether the context manager has exceeded its deadline (expired)." +msgstr "" + +msgid "" +"async def main():\n" +" try:\n" +" # We do not know the timeout when starting, so we pass ``None``.\n" +" async with asyncio.timeout(None) as cm:\n" +" # We know the timeout now, so we reschedule it.\n" +" new_deadline = get_running_loop().time() + 10\n" +" cm.reschedule(new_deadline)\n" +"\n" +" await long_running_task()\n" +" except TimeoutError:\n" +" pass\n" +"\n" +" if cm.expired():\n" +" print(\"Looks like we haven't finished on time.\")" +msgstr "" + +msgid "Timeout context managers can be safely nested." +msgstr "" + +msgid "" +"Similar to :func:`asyncio.timeout`, except *when* is the absolute time to " +"stop waiting, or ``None``." +msgstr "" + +msgid "" +"async def main():\n" +" loop = get_running_loop()\n" +" deadline = loop.time() + 20\n" +" try:\n" +" async with asyncio.timeout_at(deadline):\n" +" await long_running_task()\n" +" except TimeoutError:\n" +" print(\"The long operation timed out, but we've handled it.\")\n" +"\n" +" print(\"This statement will run regardless.\")" +msgstr "" + +msgid "" +"Wait for the *aw* :ref:`awaitable ` to complete with a " +"timeout." +msgstr "" +"Зачекайте, поки *aw* :ref:`awaitable ` завершиться з " +"тайм-аутом." + +msgid "" +"*timeout* can either be ``None`` or a float or int number of seconds to wait " +"for. If *timeout* is ``None``, block until the future completes." +msgstr "" +"*timeout* може бути або ``None``, або числом секунд для очікування з " +"плаваючою точкою або int. Якщо *timeout* має значення ``None``, блокуйте до " +"завершення майбутнього." + +msgid "" +"If a timeout occurs, it cancels the task and raises :exc:`TimeoutError`." +msgstr "" + +msgid "" +"To avoid the task :meth:`cancellation `, wrap it in :func:" +"`shield`." +msgstr "" +"Щоб уникнути завдання :meth:`скасування `, загорніть його в :" +"func:`shield`." + +msgid "" +"The function will wait until the future is actually cancelled, so the total " +"wait time may exceed the *timeout*. If an exception happens during " +"cancellation, it is propagated." +msgstr "" +"Функція чекатиме, доки майбутнє фактично не буде скасовано, тому загальний " +"час очікування може перевищити *тайм-аут*. Якщо під час скасування виникає " +"виняток, він поширюється." + +msgid "If the wait is cancelled, the future *aw* is also cancelled." +msgstr "Якщо очікування скасовується, майбутнє *aw* також скасовується." + +msgid "" +"async def eternity():\n" +" # Sleep for one hour\n" +" await asyncio.sleep(3600)\n" +" print('yay!')\n" +"\n" +"async def main():\n" +" # Wait for at most 1 second\n" +" try:\n" +" await asyncio.wait_for(eternity(), timeout=1.0)\n" +" except TimeoutError:\n" +" print('timeout!')\n" +"\n" +"asyncio.run(main())\n" +"\n" +"# Expected output:\n" +"#\n" +"# timeout!" +msgstr "" + +msgid "" +"When *aw* is cancelled due to a timeout, ``wait_for`` waits for *aw* to be " +"cancelled. Previously, it raised :exc:`TimeoutError` immediately." +msgstr "" + +msgid "Raises :exc:`TimeoutError` instead of :exc:`asyncio.TimeoutError`." +msgstr "" + +msgid "Waiting Primitives" +msgstr "Очікування примітивів" + +msgid "" +"Run :class:`~asyncio.Future` and :class:`~asyncio.Task` instances in the " +"*aws* iterable concurrently and block until the condition specified by " +"*return_when*." +msgstr "" + +msgid "The *aws* iterable must not be empty." +msgstr "Ітерація *aws* не має бути порожньою." + +msgid "Returns two sets of Tasks/Futures: ``(done, pending)``." +msgstr "Повертає два набори Tasks/Futures: ``(done, pending)``." + +msgid "Usage::" +msgstr "Використання::" + +msgid "done, pending = await asyncio.wait(aws)" +msgstr "" + +msgid "" +"*timeout* (a float or int), if specified, can be used to control the maximum " +"number of seconds to wait before returning." +msgstr "" +"*timeout* (float або int), якщо вказано, можна використовувати для керування " +"максимальною кількістю секунд очікування перед поверненням." + +msgid "" +"Note that this function does not raise :exc:`TimeoutError`. Futures or Tasks " +"that aren't done when the timeout occurs are simply returned in the second " +"set." +msgstr "" + +msgid "" +"*return_when* indicates when this function should return. It must be one of " +"the following constants:" +msgstr "" +"*return_when* вказує, коли ця функція має повернутися. Це має бути одна з " +"таких констант:" + +msgid "Constant" +msgstr "Постійний" + +msgid "Description" +msgstr "опис" + +msgid "The function will return when any future finishes or is cancelled." +msgstr "" +"Функція повернеться, коли будь-який майбутній завершиться або буде скасовано." + +msgid "" +"The function will return when any future finishes by raising an exception. " +"If no future raises an exception then it is equivalent to :const:" +"`ALL_COMPLETED`." +msgstr "" + +msgid "The function will return when all futures finish or are cancelled." +msgstr "" +"Функція повернеться, коли всі ф’ючерси закінчаться або будуть скасовані." + +msgid "" +"Unlike :func:`~asyncio.wait_for`, ``wait()`` does not cancel the futures " +"when a timeout occurs." +msgstr "" +"На відміну від :func:`~asyncio.wait_for`, ``wait()`` не скасовує ф’ючерси, " +"коли настає тайм-аут." + +msgid "Passing coroutine objects to ``wait()`` directly is forbidden." +msgstr "" + +msgid "Added support for generators yielding tasks." +msgstr "" + +msgid "" +"Run :ref:`awaitable objects ` in the *aws* iterable " +"concurrently. The returned object can be iterated to obtain the results of " +"the awaitables as they finish." +msgstr "" + +msgid "" +"The object returned by ``as_completed()`` can be iterated as an :term:" +"`asynchronous iterator` or a plain :term:`iterator`. When asynchronous " +"iteration is used, the originally-supplied awaitables are yielded if they " +"are tasks or futures. This makes it easy to correlate previously-scheduled " +"tasks with their results. Example::" +msgstr "" + +msgid "" +"ipv4_connect = create_task(open_connection(\"127.0.0.1\", 80))\n" +"ipv6_connect = create_task(open_connection(\"::1\", 80))\n" +"tasks = [ipv4_connect, ipv6_connect]\n" +"\n" +"async for earliest_connect in as_completed(tasks):\n" +" # earliest_connect is done. The result can be obtained by\n" +" # awaiting it or calling earliest_connect.result()\n" +" reader, writer = await earliest_connect\n" +"\n" +" if earliest_connect is ipv6_connect:\n" +" print(\"IPv6 connection established.\")\n" +" else:\n" +" print(\"IPv4 connection established.\")" +msgstr "" + +msgid "" +"During asynchronous iteration, implicitly-created tasks will be yielded for " +"supplied awaitables that aren't tasks or futures." +msgstr "" + +msgid "" +"When used as a plain iterator, each iteration yields a new coroutine that " +"returns the result or raises the exception of the next completed awaitable. " +"This pattern is compatible with Python versions older than 3.13::" +msgstr "" + +msgid "" +"ipv4_connect = create_task(open_connection(\"127.0.0.1\", 80))\n" +"ipv6_connect = create_task(open_connection(\"::1\", 80))\n" +"tasks = [ipv4_connect, ipv6_connect]\n" +"\n" +"for next_connect in as_completed(tasks):\n" +" # next_connect is not one of the original task objects. It must be\n" +" # awaited to obtain the result value or raise the exception of the\n" +" # awaitable that finishes next.\n" +" reader, writer = await next_connect" +msgstr "" + +msgid "" +"A :exc:`TimeoutError` is raised if the timeout occurs before all awaitables " +"are done. This is raised by the ``async for`` loop during asynchronous " +"iteration or by the coroutines yielded during plain iteration." +msgstr "" + +msgid "" +"Deprecation warning is emitted if not all awaitable objects in the *aws* " +"iterable are Future-like objects and there is no running event loop." +msgstr "" +"Якщо не всі очікувані об’єкти в *aws* iterable є об’єктами, подібними до " +"майбутнього, і немає запущеного циклу подій, видається попередження про " +"застаріле." + +msgid "" +"The result can now be used as either an :term:`asynchronous iterator` or as " +"a plain :term:`iterator` (previously it was only a plain iterator)." +msgstr "" + +msgid "Running in Threads" +msgstr "Запуск у потоках" + +msgid "Asynchronously run function *func* in a separate thread." +msgstr "Асинхронний запуск функції *func* в окремому потоці." + +msgid "" +"Any \\*args and \\*\\*kwargs supplied for this function are directly passed " +"to *func*. Also, the current :class:`contextvars.Context` is propagated, " +"allowing context variables from the event loop thread to be accessed in the " +"separate thread." +msgstr "" +"Будь-які \\*args і \\*\\*kwargs, надані для цієї функції, безпосередньо " +"передаються до *func*. Крім того, поточний :class:`contextvars.Context` " +"поширюється, дозволяючи доступ до змінних контексту з потоку циклу подій в " +"окремому потоці." + +msgid "" +"Return a coroutine that can be awaited to get the eventual result of *func*." +msgstr "" +"Повертає співпрограму, яку можна очікувати, щоб отримати кінцевий результат " +"*func*." + +msgid "" +"This coroutine function is primarily intended to be used for executing IO-" +"bound functions/methods that would otherwise block the event loop if they " +"were run in the main thread. For example::" +msgstr "" + +msgid "" +"def blocking_io():\n" +" print(f\"start blocking_io at {time.strftime('%X')}\")\n" +" # Note that time.sleep() can be replaced with any blocking\n" +" # IO-bound operation, such as file operations.\n" +" time.sleep(1)\n" +" print(f\"blocking_io complete at {time.strftime('%X')}\")\n" +"\n" +"async def main():\n" +" print(f\"started main at {time.strftime('%X')}\")\n" +"\n" +" await asyncio.gather(\n" +" asyncio.to_thread(blocking_io),\n" +" asyncio.sleep(1))\n" +"\n" +" print(f\"finished main at {time.strftime('%X')}\")\n" +"\n" +"\n" +"asyncio.run(main())\n" +"\n" +"# Expected output:\n" +"#\n" +"# started main at 19:50:53\n" +"# start blocking_io at 19:50:53\n" +"# blocking_io complete at 19:50:54\n" +"# finished main at 19:50:54" +msgstr "" + +msgid "" +"Directly calling ``blocking_io()`` in any coroutine would block the event " +"loop for its duration, resulting in an additional 1 second of run time. " +"Instead, by using ``asyncio.to_thread()``, we can run it in a separate " +"thread without blocking the event loop." +msgstr "" + +msgid "" +"Due to the :term:`GIL`, ``asyncio.to_thread()`` can typically only be used " +"to make IO-bound functions non-blocking. However, for extension modules that " +"release the GIL or alternative Python implementations that don't have one, " +"``asyncio.to_thread()`` can also be used for CPU-bound functions." +msgstr "" + +msgid "Scheduling From Other Threads" +msgstr "Планування з інших потоків" + +msgid "Submit a coroutine to the given event loop. Thread-safe." +msgstr "Надішліть співпрограму в заданий цикл подій. Ниткобезпечний." + +msgid "" +"Return a :class:`concurrent.futures.Future` to wait for the result from " +"another OS thread." +msgstr "" +"Поверніть :class:`concurrent.futures.Future`, щоб дочекатися результату від " +"іншого потоку ОС." + +msgid "" +"This function is meant to be called from a different OS thread than the one " +"where the event loop is running. Example::" +msgstr "" +"Цю функцію призначено для виклику з потоку ОС, відмінного від того, у якому " +"виконується цикл подій. Приклад::" + +msgid "" +"# Create a coroutine\n" +"coro = asyncio.sleep(1, result=3)\n" +"\n" +"# Submit the coroutine to a given loop\n" +"future = asyncio.run_coroutine_threadsafe(coro, loop)\n" +"\n" +"# Wait for the result with an optional timeout argument\n" +"assert future.result(timeout) == 3" +msgstr "" + +msgid "" +"If an exception is raised in the coroutine, the returned Future will be " +"notified. It can also be used to cancel the task in the event loop::" +msgstr "" +"Якщо в співпрограмі виникає виняток, буде повідомлено про повернутий Future. " +"Його також можна використовувати для скасування завдання в циклі подій::" + +msgid "" +"try:\n" +" result = future.result(timeout)\n" +"except TimeoutError:\n" +" print('The coroutine took too long, cancelling the task...')\n" +" future.cancel()\n" +"except Exception as exc:\n" +" print(f'The coroutine raised an exception: {exc!r}')\n" +"else:\n" +" print(f'The coroutine returned: {result!r}')" +msgstr "" + +msgid "" +"See the :ref:`concurrency and multithreading ` " +"section of the documentation." +msgstr "" +"Перегляньте розділ :ref:`паралелізм і багатопотоковість ` документації." + +msgid "" +"Unlike other asyncio functions this function requires the *loop* argument to " +"be passed explicitly." +msgstr "" +"На відміну від інших асинхронних функцій, ця функція вимагає явної передачі " +"аргументу *loop*." + +msgid "Introspection" +msgstr "самоаналіз" + +msgid "" +"Return the currently running :class:`Task` instance, or ``None`` if no task " +"is running." +msgstr "" +"Повертає поточний екземпляр :class:`Task` або ``None``, якщо жодне завдання " +"не виконується." + +msgid "" +"If *loop* is ``None`` :func:`get_running_loop` is used to get the current " +"loop." +msgstr "" +"Якщо *loop* має значення ``None`` :func:`get_running_loop` використовується " +"для отримання поточного циклу." + +msgid "Return a set of not yet finished :class:`Task` objects run by the loop." +msgstr "" +"Повертає набір ще не завершених об’єктів :class:`Task`, які виконуються " +"циклом." + +msgid "" +"If *loop* is ``None``, :func:`get_running_loop` is used for getting current " +"loop." +msgstr "" +"Якщо *loop* має значення ``None``, :func:`get_running_loop` використовується " +"для отримання поточного циклу." + +msgid "Return ``True`` if *obj* is a coroutine object." +msgstr "" + +msgid "Task Object" +msgstr "Об'єкт завдання" + +msgid "" +"A :class:`Future-like ` object that runs a Python :ref:`coroutine " +"`. Not thread-safe." +msgstr "" +"Об’єкт :class:`подібний до майбутнього `, який запускає :ref:" +"`сопрограму Python `. Небезпечно для потоків." + +msgid "" +"Tasks are used to run coroutines in event loops. If a coroutine awaits on a " +"Future, the Task suspends the execution of the coroutine and waits for the " +"completion of the Future. When the Future is *done*, the execution of the " +"wrapped coroutine resumes." +msgstr "" +"Завдання використовуються для виконання співпрограм у циклах подій. Якщо " +"співпрограма очікує на Future, Завдання призупиняє виконання співпрограми та " +"чекає завершення Future. Коли Future *done*, виконання загорнутої " +"співпрограми відновлюється." + +msgid "" +"Event loops use cooperative scheduling: an event loop runs one Task at a " +"time. While a Task awaits for the completion of a Future, the event loop " +"runs other Tasks, callbacks, or performs IO operations." +msgstr "" +"Цикли подій використовують кооперативне планування: цикл подій виконує одне " +"завдання за раз. Поки Завдання очікує завершення Майбутнього, цикл подій " +"запускає інші Завдання, зворотні виклики або виконує операції введення-" +"виведення." + +msgid "" +"Use the high-level :func:`asyncio.create_task` function to create Tasks, or " +"the low-level :meth:`loop.create_task` or :func:`ensure_future` functions. " +"Manual instantiation of Tasks is discouraged." +msgstr "" +"Використовуйте функцію високого рівня :func:`asyncio.create_task` для " +"створення завдань або функції низького рівня :meth:`loop.create_task` або :" +"func:`ensure_future`. Не рекомендується створювати завдання вручну." + +msgid "" +"To cancel a running Task use the :meth:`cancel` method. Calling it will " +"cause the Task to throw a :exc:`CancelledError` exception into the wrapped " +"coroutine. If a coroutine is awaiting on a Future object during " +"cancellation, the Future object will be cancelled." +msgstr "" +"Щоб скасувати запущене завдання, використовуйте метод :meth:`cancel`. Його " +"виклик призведе до того, що завдання створить виняток :exc:`CancelledError` " +"у загорнутій співпрограмі. Якщо співпрограма очікує на об’єкті Future під " +"час скасування, об’єкт Future буде скасовано." + +msgid "" +":meth:`cancelled` can be used to check if the Task was cancelled. The method " +"returns ``True`` if the wrapped coroutine did not suppress the :exc:" +"`CancelledError` exception and was actually cancelled." +msgstr "" +":meth:`cancelled` можна використовувати, щоб перевірити, чи було скасовано " +"завдання. Метод повертає ``True``, якщо загорнута співпрограма не придушила " +"виняток :exc:`CancelledError` і була фактично скасована." + +msgid "" +":class:`asyncio.Task` inherits from :class:`Future` all of its APIs except :" +"meth:`Future.set_result` and :meth:`Future.set_exception`." +msgstr "" +":class:`asyncio.Task` успадковує від :class:`Future` усі його API, крім :" +"meth:`Future.set_result` і :meth:`Future.set_exception`." + +msgid "" +"An optional keyword-only *context* argument allows specifying a custom :" +"class:`contextvars.Context` for the *coro* to run in. If no *context* is " +"provided, the Task copies the current context and later runs its coroutine " +"in the copied context." +msgstr "" + +msgid "" +"An optional keyword-only *eager_start* argument allows eagerly starting the " +"execution of the :class:`asyncio.Task` at task creation time. If set to " +"``True`` and the event loop is running, the task will start executing the " +"coroutine immediately, until the first time the coroutine blocks. If the " +"coroutine returns or raises without blocking, the task will be finished " +"eagerly and will skip scheduling to the event loop." +msgstr "" + +msgid "Added support for the :mod:`contextvars` module." +msgstr "Додано підтримку модуля :mod:`contextvars`." + +msgid "" +"Deprecation warning is emitted if *loop* is not specified and there is no " +"running event loop." +msgstr "" +"Якщо *loop* не вказано і немає запущеного циклу подій, видається " +"попередження про застаріле." + +msgid "Added the *eager_start* parameter." +msgstr "" + +msgid "Return ``True`` if the Task is *done*." +msgstr "Повертає ``True``, якщо завдання *виконано*." + +msgid "" +"A Task is *done* when the wrapped coroutine either returned a value, raised " +"an exception, or the Task was cancelled." +msgstr "" +"Завдання вважається *виконаним*, коли загорнута співпрограма або повернула " +"значення, викликала виняток, або завдання було скасовано." + +msgid "Return the result of the Task." +msgstr "Повернути результат Завдання." + +msgid "" +"If the Task is *done*, the result of the wrapped coroutine is returned (or " +"if the coroutine raised an exception, that exception is re-raised.)" +msgstr "" +"Якщо завдання *виконано*, повертається результат загорнутої співпрограми " +"(або якщо співпрограма викликала виняток, цей виняток викликається повторно)." + +msgid "" +"If the Task has been *cancelled*, this method raises a :exc:`CancelledError` " +"exception." +msgstr "" +"Якщо завдання було *скасовано*, цей метод викликає виняток :exc:" +"`CancelledError`." + +msgid "" +"If the Task's result isn't yet available, this method raises an :exc:" +"`InvalidStateError` exception." +msgstr "" + +msgid "Return the exception of the Task." +msgstr "Повернути виняток Завдання." + +msgid "" +"If the wrapped coroutine raised an exception that exception is returned. If " +"the wrapped coroutine returned normally this method returns ``None``." +msgstr "" +"Якщо загорнута співпрограма викликала виняток, цей виняток повертається. " +"Якщо загорнута співпрограма повертає нормальний результат, цей метод " +"повертає ``None``." + +msgid "" +"If the Task isn't *done* yet, this method raises an :exc:`InvalidStateError` " +"exception." +msgstr "" +"Якщо завдання ще не *виконано*, цей метод викликає виняток :exc:" +"`InvalidStateError`." + +msgid "Add a callback to be run when the Task is *done*." +msgstr "" +"Додайте зворотний виклик, який буде запущено, коли Завдання *виконано*." + +msgid "This method should only be used in low-level callback-based code." +msgstr "" +"Цей метод слід використовувати лише в низькорівневому коді на основі " +"зворотного виклику." + +msgid "" +"See the documentation of :meth:`Future.add_done_callback` for more details." +msgstr "" +"Перегляньте документацію :meth:`Future.add_done_callback` для отримання " +"додаткової інформації." + +msgid "Remove *callback* from the callbacks list." +msgstr "Видалити *callback* зі списку зворотних викликів." + +msgid "" +"See the documentation of :meth:`Future.remove_done_callback` for more " +"details." +msgstr "" +"Перегляньте документацію :meth:`Future.remove_done_callback` для отримання " +"додаткової інформації." + +msgid "Return the list of stack frames for this Task." +msgstr "Повернути список фреймів стека для цього завдання." + +msgid "" +"If the wrapped coroutine is not done, this returns the stack where it is " +"suspended. If the coroutine has completed successfully or was cancelled, " +"this returns an empty list. If the coroutine was terminated by an exception, " +"this returns the list of traceback frames." +msgstr "" +"Якщо загорнуту співпрограму не виконано, це повертає стек, де він був " +"призупинений. Якщо співпрограма завершилася успішно або була скасована, " +"повертається порожній список. Якщо співпрограму було припинено через " +"виняток, повертається список кадрів трасування." + +msgid "The frames are always ordered from oldest to newest." +msgstr "Рамки завжди впорядковуються від найстаріших до найновіших." + +msgid "Only one stack frame is returned for a suspended coroutine." +msgstr "Для призупиненої співпрограми повертається лише один кадр стека." + +msgid "" +"The optional *limit* argument sets the maximum number of frames to return; " +"by default all available frames are returned. The ordering of the returned " +"list differs depending on whether a stack or a traceback is returned: the " +"newest frames of a stack are returned, but the oldest frames of a traceback " +"are returned. (This matches the behavior of the traceback module.)" +msgstr "" +"Необов'язковий аргумент *limit* встановлює максимальну кількість кадрів для " +"повернення; за замовчуванням повертаються всі доступні кадри. Порядок " +"поверненого списку відрізняється залежно від того, повертається стек чи " +"трасування: повертаються найновіші кадри стеку, але повертаються найстаріші " +"кадри трасування. (Це відповідає поведінці модуля відстеження.)" + +msgid "Print the stack or traceback for this Task." +msgstr "Роздрукуйте стек або відстеження для цього завдання." + +msgid "" +"This produces output similar to that of the traceback module for the frames " +"retrieved by :meth:`get_stack`." +msgstr "" +"Це створює вихідні дані, подібні до результатів модуля трасування для " +"кадрів, отриманих :meth:`get_stack`." + +msgid "The *limit* argument is passed to :meth:`get_stack` directly." +msgstr "Аргумент *limit* передається безпосередньо в :meth:`get_stack`." + +msgid "" +"The *file* argument is an I/O stream to which the output is written; by " +"default output is written to :data:`sys.stdout`." +msgstr "" + +msgid "Return the coroutine object wrapped by the :class:`Task`." +msgstr "Повертає об’єкт співпрограми, обгорнутий :class:`Task`." + +msgid "" +"This will return ``None`` for Tasks which have already completed eagerly. " +"See the :ref:`Eager Task Factory `." +msgstr "" + +msgid "Newly added eager task execution means result may be ``None``." +msgstr "" + +msgid "" +"Return the :class:`contextvars.Context` object associated with the task." +msgstr "" + +msgid "Return the name of the Task." +msgstr "Повернути назву завдання." + +msgid "" +"If no name has been explicitly assigned to the Task, the default asyncio " +"Task implementation generates a default name during instantiation." +msgstr "" +"Якщо Завданню не було явно призначено ім’я, реалізація асинхронного Завдання " +"за замовчуванням генерує ім’я за замовчуванням під час створення екземпляра." + +msgid "Set the name of the Task." +msgstr "Встановіть назву завдання." + +msgid "" +"The *value* argument can be any object, which is then converted to a string." +msgstr "" +"Аргументом *value* може бути будь-який об’єкт, який потім перетворюється на " +"рядок." + +msgid "" +"In the default Task implementation, the name will be visible in the :func:" +"`repr` output of a task object." +msgstr "" +"У реалізації Task за замовчуванням ім’я буде видно у виводі :func:`repr` " +"об’єкта task." + +msgid "Request the Task to be cancelled." +msgstr "Вимагайте скасування Завдання." + +msgid "" +"If the Task is already *done* or *cancelled*, return ``False``, otherwise, " +"return ``True``." +msgstr "" + +msgid "" +"The method arranges for a :exc:`CancelledError` exception to be thrown into " +"the wrapped coroutine on the next cycle of the event loop." +msgstr "" + +msgid "" +"The coroutine then has a chance to clean up or even deny the request by " +"suppressing the exception with a :keyword:`try` ... ... ``except " +"CancelledError`` ... :keyword:`finally` block. Therefore, unlike :meth:" +"`Future.cancel`, :meth:`Task.cancel` does not guarantee that the Task will " +"be cancelled, although suppressing cancellation completely is not common and " +"is actively discouraged. Should the coroutine nevertheless decide to " +"suppress the cancellation, it needs to call :meth:`Task.uncancel` in " +"addition to catching the exception." +msgstr "" + +msgid "Added the *msg* parameter." +msgstr "Додано параметр *msg*." + +msgid "The ``msg`` parameter is propagated from cancelled task to its awaiter." +msgstr "" + +msgid "" +"The following example illustrates how coroutines can intercept the " +"cancellation request::" +msgstr "" +"Наступний приклад ілюструє, як співпрограми можуть перехопити запит на " +"скасування:" + +msgid "" +"async def cancel_me():\n" +" print('cancel_me(): before sleep')\n" +"\n" +" try:\n" +" # Wait for 1 hour\n" +" await asyncio.sleep(3600)\n" +" except asyncio.CancelledError:\n" +" print('cancel_me(): cancel sleep')\n" +" raise\n" +" finally:\n" +" print('cancel_me(): after sleep')\n" +"\n" +"async def main():\n" +" # Create a \"cancel_me\" Task\n" +" task = asyncio.create_task(cancel_me())\n" +"\n" +" # Wait for 1 second\n" +" await asyncio.sleep(1)\n" +"\n" +" task.cancel()\n" +" try:\n" +" await task\n" +" except asyncio.CancelledError:\n" +" print(\"main(): cancel_me is cancelled now\")\n" +"\n" +"asyncio.run(main())\n" +"\n" +"# Expected output:\n" +"#\n" +"# cancel_me(): before sleep\n" +"# cancel_me(): cancel sleep\n" +"# cancel_me(): after sleep\n" +"# main(): cancel_me is cancelled now" +msgstr "" + +msgid "Return ``True`` if the Task is *cancelled*." +msgstr "Повертає ``True``, якщо завдання *скасовано*." + +msgid "" +"The Task is *cancelled* when the cancellation was requested with :meth:" +"`cancel` and the wrapped coroutine propagated the :exc:`CancelledError` " +"exception thrown into it." +msgstr "" +"Завдання *скасовується*, коли запит на скасування надійшов за допомогою :" +"meth:`cancel`, а загорнута співпрограма поширила виняткову ситуацію :exc:" +"`CancelledError`, яка виникла в ній." + +msgid "Decrement the count of cancellation requests to this Task." +msgstr "" + +msgid "Returns the remaining number of cancellation requests." +msgstr "" + +msgid "" +"Note that once execution of a cancelled task completed, further calls to :" +"meth:`uncancel` are ineffective." +msgstr "" + +msgid "" +"This method is used by asyncio's internals and isn't expected to be used by " +"end-user code. In particular, if a Task gets successfully uncancelled, this " +"allows for elements of structured concurrency like :ref:`taskgroups` and :" +"func:`asyncio.timeout` to continue running, isolating cancellation to the " +"respective structured block. For example::" +msgstr "" + +msgid "" +"async def make_request_with_timeout():\n" +" try:\n" +" async with asyncio.timeout(1):\n" +" # Structured block affected by the timeout:\n" +" await make_request()\n" +" await make_another_request()\n" +" except TimeoutError:\n" +" log(\"There was a timeout\")\n" +" # Outer code not affected by the timeout:\n" +" await unrelated_code()" +msgstr "" + +msgid "" +"While the block with ``make_request()`` and ``make_another_request()`` might " +"get cancelled due to the timeout, ``unrelated_code()`` should continue " +"running even in case of the timeout. This is implemented with :meth:" +"`uncancel`. :class:`TaskGroup` context managers use :func:`uncancel` in a " +"similar fashion." +msgstr "" + +msgid "" +"If end-user code is, for some reason, suppressing cancellation by catching :" +"exc:`CancelledError`, it needs to call this method to remove the " +"cancellation state." +msgstr "" + +msgid "" +"When this method decrements the cancellation count to zero, the method " +"checks if a previous :meth:`cancel` call had arranged for :exc:" +"`CancelledError` to be thrown into the task. If it hasn't been thrown yet, " +"that arrangement will be rescinded (by resetting the internal " +"``_must_cancel`` flag)." +msgstr "" + +msgid "Changed to rescind pending cancellation requests upon reaching zero." +msgstr "" + +msgid "" +"Return the number of pending cancellation requests to this Task, i.e., the " +"number of calls to :meth:`cancel` less the number of :meth:`uncancel` calls." +msgstr "" + +msgid "" +"Note that if this number is greater than zero but the Task is still " +"executing, :meth:`cancelled` will still return ``False``. This is because " +"this number can be lowered by calling :meth:`uncancel`, which can lead to " +"the task not being cancelled after all if the cancellation requests go down " +"to zero." +msgstr "" + +msgid "" +"This method is used by asyncio's internals and isn't expected to be used by " +"end-user code. See :meth:`uncancel` for more details." +msgstr "" diff --git a/library/asyncio.po b/library/asyncio.po new file mode 100644 index 000000000..5e3981b7c --- /dev/null +++ b/library/asyncio.po @@ -0,0 +1,173 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Olga Tomakhina, 2022 +# Dmytro Kazanzhy, 2025 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:55+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2025\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "High-level APIs" +msgstr "API високого рівня" + +msgid "Low-level APIs" +msgstr "Низькорівневі API" + +msgid "Guides and Tutorials" +msgstr "Посібники та підручники" + +msgid ":mod:`!asyncio` --- Asynchronous I/O" +msgstr "" + +msgid "Hello World!" +msgstr "Hello World!" + +msgid "" +"import asyncio\n" +"\n" +"async def main():\n" +" print('Hello ...')\n" +" await asyncio.sleep(1)\n" +" print('... World!')\n" +"\n" +"asyncio.run(main())" +msgstr "" + +msgid "" +"asyncio is a library to write **concurrent** code using the **async/await** " +"syntax." +msgstr "" +"asyncio — це бібліотека для написання **паралельного** коду за допомогою " +"синтаксису **async/await**." + +msgid "" +"asyncio is used as a foundation for multiple Python asynchronous frameworks " +"that provide high-performance network and web-servers, database connection " +"libraries, distributed task queues, etc." +msgstr "" +"asyncio використовується як основа для багатьох асинхронних фреймворків " +"Python, які забезпечують високопродуктивні мережеві та веб-сервери, " +"бібліотеки підключення до бази даних, розподілені черги завдань тощо." + +msgid "" +"asyncio is often a perfect fit for IO-bound and high-level **structured** " +"network code." +msgstr "" +"asyncio часто ідеально підходить для високорівневого **структурованого** " +"мережевого коду." + +msgid "asyncio provides a set of **high-level** APIs to:" +msgstr "asyncio пропонує набір **високорівневого** API для:" + +msgid "" +":ref:`run Python coroutines ` concurrently and have full control " +"over their execution;" +msgstr "" +":ref:`запускати співпрограми Python ` одночасно та мати повний " +"контроль над їх виконанням;" + +msgid "perform :ref:`network IO and IPC `;" +msgstr "виконувати :ref:`мережевий IO та IPC `;" + +msgid "control :ref:`subprocesses `;" +msgstr "керування :ref:`підпроцесами `;" + +msgid "distribute tasks via :ref:`queues `;" +msgstr "розподіляти завдання через :ref:`черги `;" + +msgid ":ref:`synchronize ` concurrent code;" +msgstr ":ref:`синхронізувати ` конкурентний код;" + +msgid "" +"Additionally, there are **low-level** APIs for *library and framework " +"developers* to:" +msgstr "" +"Також існують **низькорівневі** API для *розробників бібліотек і " +"фреймворків*, щоб:" + +msgid "" +"create and manage :ref:`event loops `, which provide " +"asynchronous APIs for :ref:`networking `, running :ref:" +"`subprocesses `, handling :ref:`OS signals " +"`, etc;" +msgstr "" + +msgid "" +"implement efficient protocols using :ref:`transports `;" +msgstr "" +"реалізувати ефективні протоколи за допомогою :ref:`transports `;" + +msgid "" +":ref:`bridge ` callback-based libraries and code with async/" +"await syntax." +msgstr "" +":ref:`bridge ` бібліотеки зворотного виклику та код із " +"синтаксисом async/await." + +msgid "Availability" +msgstr "" + +msgid "" +"This module does not work or is not available on WebAssembly. See :ref:`wasm-" +"availability` for more information." +msgstr "" + +msgid "asyncio REPL" +msgstr "" + +msgid "" +"You can experiment with an ``asyncio`` concurrent context in the :term:" +"`REPL`:" +msgstr "" + +msgid "" +"$ python -m asyncio\n" +"asyncio REPL ...\n" +"Use \"await\" directly instead of \"asyncio.run()\".\n" +"Type \"help\", \"copyright\", \"credits\" or \"license\" for more " +"information.\n" +">>> import asyncio\n" +">>> await asyncio.sleep(10, result='hello')\n" +"'hello'" +msgstr "" + +msgid "" +"Raises an :ref:`auditing event ` ``cpython.run_stdin`` with no " +"arguments." +msgstr "" +"Викликає :ref:`подію аудиту ` ``cpython.run_stdin`` без аргументів." + +msgid "(also 3.11.10, 3.10.15, 3.9.20, and 3.8.20) Emits audit events." +msgstr "" + +msgid "" +"Uses PyREPL if possible, in which case :envvar:`PYTHONSTARTUP` is also " +"executed. Emits audit events." +msgstr "" + +msgid "Reference" +msgstr "Посилання" + +msgid "The source code for asyncio can be found in :source:`Lib/asyncio/`." +msgstr "Вихідний код для asyncio можна знайти в :source:`Lib/asyncio/`." diff --git a/library/asyncore.po b/library/asyncore.po new file mode 100644 index 000000000..41123fd42 --- /dev/null +++ b/library/asyncore.po @@ -0,0 +1,39 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2024-11-19 01:02+0000\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!asyncore` --- Asynchronous socket handler" +msgstr "" + +msgid "" +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.12 ` after being deprecated in " +"Python 3.6. The removal was decided in :pep:`594`." +msgstr "" + +msgid "Applications should use the :mod:`asyncio` module instead." +msgstr "" + +msgid "" +"The last version of Python that provided the :mod:`!asyncore` module was " +"`Python 3.11 `_." +msgstr "" diff --git a/library/atexit.po b/library/atexit.po new file mode 100644 index 000000000..fcc2ea1c6 --- /dev/null +++ b/library/atexit.po @@ -0,0 +1,212 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:55+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!atexit` --- Exit handlers" +msgstr "" + +msgid "" +"The :mod:`atexit` module defines functions to register and unregister " +"cleanup functions. Functions thus registered are automatically executed " +"upon normal interpreter termination. :mod:`atexit` runs these functions in " +"the *reverse* order in which they were registered; if you register ``A``, " +"``B``, and ``C``, at interpreter termination time they will be run in the " +"order ``C``, ``B``, ``A``." +msgstr "" +"Модуль :mod:`atexit` визначає функції для реєстрації та скасування " +"реєстрації функцій очищення. Зареєстровані таким чином функції автоматично " +"виконуються після звичайного завершення роботи інтерпретатора. :mod:`atexit` " +"запускає ці функції у *зворотному* порядку, у якому вони були зареєстровані; " +"якщо ви зареєструєте ``A``, ``B`` і ``C``, під час завершення роботи " +"інтерпретатора вони виконуватимуться в порядку ``C``, ``B``, ``A`` ." + +msgid "" +"**Note:** The functions registered via this module are not called when the " +"program is killed by a signal not handled by Python, when a Python fatal " +"internal error is detected, or when :func:`os._exit` is called." +msgstr "" +"**Примітка:** Функції, зареєстровані за допомогою цього модуля, не " +"викликаються, коли програма припиняється через сигнал, який не оброблюється " +"Python, коли виявлено критичну внутрішню помилку Python або коли " +"викликається :func:`os._exit`." + +msgid "" +"**Note:** The effect of registering or unregistering functions from within a " +"cleanup function is undefined." +msgstr "" + +msgid "" +"When used with C-API subinterpreters, registered functions are local to the " +"interpreter they were registered in." +msgstr "" +"При використанні з субінтерпретаторами C-API зареєстровані функції є " +"локальними для інтерпретатора, у якому вони були зареєстровані." + +msgid "" +"Register *func* as a function to be executed at termination. Any optional " +"arguments that are to be passed to *func* must be passed as arguments to :" +"func:`register`. It is possible to register the same function and arguments " +"more than once." +msgstr "" +"Зареєструйте *func* як функцію, яка буде виконуватися після завершення. Будь-" +"які необов’язкові аргументи, які мають бути передані в *func*, повинні бути " +"передані як аргументи в :func:`register`. Є можливість зареєструвати ту саму " +"функцію та аргументи кілька разів." + +msgid "" +"At normal program termination (for instance, if :func:`sys.exit` is called " +"or the main module's execution completes), all functions registered are " +"called in last in, first out order. The assumption is that lower level " +"modules will normally be imported before higher level modules and thus must " +"be cleaned up later." +msgstr "" +"Під час звичайного завершення програми (наприклад, якщо викликається :func:" +"`sys.exit` або завершується виконання основного модуля), усі зареєстровані " +"функції викликаються в порядку останнього входу, першого виходу. " +"Припускається, що модулі нижчого рівня зазвичай імпортуються перед модулями " +"вищого рівня, тому їх потрібно очистити пізніше." + +msgid "" +"If an exception is raised during execution of the exit handlers, a traceback " +"is printed (unless :exc:`SystemExit` is raised) and the exception " +"information is saved. After all exit handlers have had a chance to run, the " +"last exception to be raised is re-raised." +msgstr "" +"Якщо під час виконання обробників виходу виникає виняток, друкується " +"зворотне трасування (якщо не викликається :exc:`SystemExit`), а інформація " +"про виключення зберігається. Після того, як усі обробники виходу мали " +"можливість запуститися, останній виняток, який було викликано, викликається " +"повторно." + +msgid "" +"This function returns *func*, which makes it possible to use it as a " +"decorator." +msgstr "" +"Ця функція повертає *func*, що дає змогу використовувати її як декоратор." + +msgid "" +"Starting new threads or calling :func:`os.fork` from a registered function " +"can lead to race condition between the main Python runtime thread freeing " +"thread states while internal :mod:`threading` routines or the new process " +"try to use that state. This can lead to crashes rather than clean shutdown." +msgstr "" + +msgid "" +"Attempts to start a new thread or :func:`os.fork` a new process in a " +"registered function now leads to :exc:`RuntimeError`." +msgstr "" + +msgid "" +"Remove *func* from the list of functions to be run at interpreter shutdown. :" +"func:`unregister` silently does nothing if *func* was not previously " +"registered. If *func* has been registered more than once, every occurrence " +"of that function in the :mod:`atexit` call stack will be removed. Equality " +"comparisons (``==``) are used internally during unregistration, so function " +"references do not need to have matching identities." +msgstr "" +"Видаліть *func* зі списку функцій, які будуть запускатися після завершення " +"роботи інтерпретатора. :func:`unregister` мовчки нічого не робить, якщо " +"*func* не було раніше зареєстровано. Якщо *func* було зареєстровано кілька " +"разів, кожне входження цієї функції в стек викликів :mod:`atexit` буде " +"видалено. Порівняння рівності (``==``) використовуються внутрішньо під час " +"скасування реєстрації, тому посилання на функції не повинні мати відповідні " +"ідентифікатори." + +msgid "Module :mod:`readline`" +msgstr "Модуль :mod:`readline`" + +msgid "" +"Useful example of :mod:`atexit` to read and write :mod:`readline` history " +"files." +msgstr "" +"Корисний приклад :mod:`atexit` для читання та запису файлів історії :mod:" +"`readline`." + +msgid ":mod:`atexit` Example" +msgstr ":mod:`atexit` Приклад" + +msgid "" +"The following simple example demonstrates how a module can initialize a " +"counter from a file when it is imported and save the counter's updated value " +"automatically when the program terminates without relying on the application " +"making an explicit call into this module at termination. ::" +msgstr "" +"Наступний простий приклад демонструє, як модуль може ініціалізувати " +"лічильник із файлу під час його імпорту та автоматично зберігати оновлене " +"значення лічильника, коли програма завершує роботу, не покладаючись на те, " +"що програма здійснює явний виклик цього модуля під час завершення. ::" + +msgid "" +"try:\n" +" with open('counterfile') as infile:\n" +" _count = int(infile.read())\n" +"except FileNotFoundError:\n" +" _count = 0\n" +"\n" +"def incrcounter(n):\n" +" global _count\n" +" _count = _count + n\n" +"\n" +"def savecounter():\n" +" with open('counterfile', 'w') as outfile:\n" +" outfile.write('%d' % _count)\n" +"\n" +"import atexit\n" +"\n" +"atexit.register(savecounter)" +msgstr "" + +msgid "" +"Positional and keyword arguments may also be passed to :func:`register` to " +"be passed along to the registered function when it is called::" +msgstr "" +"Позиційні та ключові аргументи також можуть бути передані :func:`register` " +"для передачі зареєстрованій функції під час її виклику::" + +msgid "" +"def goodbye(name, adjective):\n" +" print('Goodbye %s, it was %s to meet you.' % (name, adjective))\n" +"\n" +"import atexit\n" +"\n" +"atexit.register(goodbye, 'Donny', 'nice')\n" +"# or:\n" +"atexit.register(goodbye, adjective='nice', name='Donny')" +msgstr "" + +msgid "Usage as a :term:`decorator`::" +msgstr "Використання як :term:`decorator`::" + +msgid "" +"import atexit\n" +"\n" +"@atexit.register\n" +"def goodbye():\n" +" print('You are now leaving the Python sector.')" +msgstr "" + +msgid "This only works with functions that can be called without arguments." +msgstr "Це працює лише з функціями, які можна викликати без аргументів." diff --git a/library/audioop.po b/library/audioop.po new file mode 100644 index 000000000..605d047df --- /dev/null +++ b/library/audioop.po @@ -0,0 +1,36 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2024-11-19 01:02+0000\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!audioop` --- Manipulate raw audio data" +msgstr "" + +msgid "" +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." +msgstr "" + +msgid "" +"The last version of Python that provided the :mod:`!audioop` module was " +"`Python 3.12 `_." +msgstr "" diff --git a/library/audit_events.po b/library/audit_events.po new file mode 100644 index 000000000..f417e73a3 --- /dev/null +++ b/library/audit_events.po @@ -0,0 +1,116 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:55+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Audit events table" +msgstr "Таблиця подій аудиту" + +msgid "" +"This table contains all events raised by :func:`sys.audit` or :c:func:" +"`PySys_Audit` calls throughout the CPython runtime and the standard " +"library. These calls were added in 3.8 or later (see :pep:`578`)." +msgstr "" + +msgid "" +"See :func:`sys.addaudithook` and :c:func:`PySys_AddAuditHook` for " +"information on handling these events." +msgstr "" +"Перегляньте :func:`sys.addaudithook` і :c:func:`PySys_AddAuditHook` для " +"отримання інформації про обробку цих подій." + +msgid "" +"This table is generated from the CPython documentation, and may not " +"represent events raised by other implementations. See your runtime specific " +"documentation for actual events raised." +msgstr "" +"Ця таблиця створена з документації CPython і може не відображати події, " +"викликані іншими реалізаціями. Перегляньте спеціальну документацію щодо " +"середовища виконання для фактичних викликаних подій." + +msgid "" +"The following events are raised internally and do not correspond to any " +"public API of CPython:" +msgstr "" +"Наступні події викликаються внутрішньо і не відповідають жодному публічному " +"API CPython:" + +msgid "Audit event" +msgstr "Подія аудиту" + +msgid "Arguments" +msgstr "Аргументи" + +msgid "_winapi.CreateFile" +msgstr "_winapi.CreateFile" + +msgid "" +"``file_name``, ``desired_access``, ``share_mode``, ``creation_disposition``, " +"``flags_and_attributes``" +msgstr "" +"``file_name``, ``desired_access``, ``share_mode``, ``creation_disposition``, " +"``flags_and_attributes``" + +msgid "_winapi.CreateJunction" +msgstr "_winapi.CreateJunction" + +msgid "``src_path``, ``dst_path``" +msgstr "``src_path``, ``dst_path``" + +msgid "_winapi.CreateNamedPipe" +msgstr "_winapi.CreateNamedPipe" + +msgid "``name``, ``open_mode``, ``pipe_mode``" +msgstr "``name``, ``open_mode``, ``pipe_mode``" + +msgid "_winapi.CreatePipe" +msgstr "_winapi.CreatePipe" + +msgid "_winapi.CreateProcess" +msgstr "_winapi.CreateProcess" + +msgid "``application_name``, ``command_line``, ``current_directory``" +msgstr "``назва_програми``, ``командний_рядок``, ``поточний_каталог``" + +msgid "_winapi.OpenProcess" +msgstr "_winapi.OpenProcess" + +msgid "``process_id``, ``desired_access``" +msgstr "``process_id``, ``desired_access``" + +msgid "_winapi.TerminateProcess" +msgstr "_winapi.TerminateProcess" + +msgid "``handle``, ``exit_code``" +msgstr "``дескриптор``, ``exit_code``" + +msgid "ctypes.PyObj_FromPtr" +msgstr "ctypes.PyObj_FromPtr" + +msgid "``obj``" +msgstr "``obj``" + +msgid "audit events" +msgstr "" diff --git a/library/base64.po b/library/base64.po new file mode 100644 index 000000000..7416bc9bc --- /dev/null +++ b/library/base64.po @@ -0,0 +1,489 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2023 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:55+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2023\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!base64` --- Base16, Base32, Base64, Base85 Data Encodings" +msgstr "" + +msgid "**Source code:** :source:`Lib/base64.py`" +msgstr "**Вихідний код:** :source:`Lib/base64.py`" + +msgid "" +"This module provides functions for encoding binary data to printable ASCII " +"characters and decoding such encodings back to binary data. It provides " +"encoding and decoding functions for the encodings specified in :rfc:`4648`, " +"which defines the Base16, Base32, and Base64 algorithms, and for the de-" +"facto standard Ascii85 and Base85 encodings." +msgstr "" +"Цей модуль надає функції для кодування двійкових даних у друковані символи " +"ASCII і декодування таких кодувань назад у двійкові дані. Він надає функції " +"кодування та декодування для кодувань, указаних у :rfc:`4648`, який визначає " +"алгоритми Base16, Base32 і Base64, а також для стандартних кодувань Ascii85 " +"і Base85." + +msgid "" +"The :rfc:`4648` encodings are suitable for encoding binary data so that it " +"can be safely sent by email, used as parts of URLs, or included as part of " +"an HTTP POST request. The encoding algorithm is not the same as the :" +"program:`uuencode` program." +msgstr "" +"Кодування :rfc:`4648` підходить для кодування двійкових даних, щоб їх можна " +"було безпечно надсилати електронною поштою, використовувати як частини URL-" +"адрес або додавати як частину запиту HTTP POST. Алгоритм кодування не такий " +"самий, як програма :program:`uuencode`." + +msgid "" +"There are two interfaces provided by this module. The modern interface " +"supports encoding :term:`bytes-like objects ` to ASCII :" +"class:`bytes`, and decoding :term:`bytes-like objects ` " +"or strings containing ASCII to :class:`bytes`. Both base-64 alphabets " +"defined in :rfc:`4648` (normal, and URL- and filesystem-safe) are supported." +msgstr "" +"Цей модуль має два інтерфейси. Сучасний інтерфейс підтримує кодування :term:" +"`bytes-подібних об’єктів ` в ASCII :class:`bytes` і " +"декодування :term:`bytes-подібних об’єктів ` або рядків, " +"що містять ASCII в :class:`bytes`. Підтримуються обидва алфавіти base-64, " +"визначені в :rfc:`4648` (звичайний і безпечний для URL-адрес і файлової " +"системи)." + +msgid "" +"The legacy interface does not support decoding from strings, but it does " +"provide functions for encoding and decoding to and from :term:`file objects " +"`. It only supports the Base64 standard alphabet, and it adds " +"newlines every 76 characters as per :rfc:`2045`. Note that if you are " +"looking for :rfc:`2045` support you probably want to be looking at the :mod:" +"`email` package instead." +msgstr "" +"Застарілий інтерфейс не підтримує декодування з рядків, але він надає " +"функції для кодування та декодування до та з :term:`файлових об’єктів `. Він підтримує лише стандартний алфавіт Base64 і додає нові рядки " +"кожні 76 символів відповідно до :rfc:`2045`. Зауважте, що якщо ви шукаєте " +"підтримку :rfc:`2045`, ви, ймовірно, захочете подивитися на пакет :mod:" +"`email`." + +msgid "" +"ASCII-only Unicode strings are now accepted by the decoding functions of the " +"modern interface." +msgstr "" +"Тепер функції декодування сучасного інтерфейсу приймають рядки Unicode лише " +"для ASCII." + +msgid "" +"Any :term:`bytes-like objects ` are now accepted by all " +"encoding and decoding functions in this module. Ascii85/Base85 support " +"added." +msgstr "" +"Будь-які :term:`байтоподібні об’єкти ` тепер приймаються " +"всіма функціями кодування та декодування в цьому модулі. Додано підтримку " +"Ascii85/Base85." + +msgid "The modern interface provides:" +msgstr "Сучасний інтерфейс забезпечує:" + +msgid "" +"Encode the :term:`bytes-like object` *s* using Base64 and return the " +"encoded :class:`bytes`." +msgstr "" +"Закодуйте :term:`bytes-like object` *s* за допомогою Base64 і поверніть " +"закодовані :class:`bytes`." + +msgid "" +"Optional *altchars* must be a :term:`bytes-like object` of length 2 which " +"specifies an alternative alphabet for the ``+`` and ``/`` characters. This " +"allows an application to e.g. generate URL or filesystem safe Base64 " +"strings. The default is ``None``, for which the standard Base64 alphabet is " +"used." +msgstr "" + +msgid "" +"May assert or raise a :exc:`ValueError` if the length of *altchars* is not " +"2. Raises a :exc:`TypeError` if *altchars* is not a :term:`bytes-like " +"object`." +msgstr "" + +msgid "" +"Decode the Base64 encoded :term:`bytes-like object` or ASCII string *s* and " +"return the decoded :class:`bytes`." +msgstr "" +"Декодуйте закодований Base64 :term:`bytes-like object` або рядок ASCII *s* і " +"повертайте розкодований :class:`bytes`." + +msgid "" +"Optional *altchars* must be a :term:`bytes-like object` or ASCII string of " +"length 2 which specifies the alternative alphabet used instead of the ``+`` " +"and ``/`` characters." +msgstr "" + +msgid "" +"A :exc:`binascii.Error` exception is raised if *s* is incorrectly padded." +msgstr "" +"Виняток :exc:`binascii.Error` викликається, якщо *s* неправильно доповнено." + +msgid "" +"If *validate* is ``False`` (the default), characters that are neither in the " +"normal base-64 alphabet nor the alternative alphabet are discarded prior to " +"the padding check. If *validate* is ``True``, these non-alphabet characters " +"in the input result in a :exc:`binascii.Error`." +msgstr "" +"Якщо *validate* має значення ``False`` (за замовчуванням), символи, які не " +"належать ні до звичайного алфавіту base-64, ні до альтернативного алфавіту, " +"відкидаються перед перевіркою заповнення. Якщо *validate* має значення " +"``True``, ці неалфавітні символи у вхідних даних призводять до :exc:" +"`binascii.Error`." + +msgid "" +"For more information about the strict base64 check, see :func:`binascii." +"a2b_base64`" +msgstr "" + +msgid "" +"May assert or raise a :exc:`ValueError` if the length of *altchars* is not 2." +msgstr "" + +msgid "" +"Encode :term:`bytes-like object` *s* using the standard Base64 alphabet and " +"return the encoded :class:`bytes`." +msgstr "" +"Кодуйте :term:`bytes-like object` *s* за допомогою стандартного алфавіту " +"Base64 і повертайте закодовані :class:`bytes`." + +msgid "" +"Decode :term:`bytes-like object` or ASCII string *s* using the standard " +"Base64 alphabet and return the decoded :class:`bytes`." +msgstr "" +"Декодуйте :term:`bytes-like object` або рядок ASCII *s* за допомогою " +"стандартного алфавіту Base64 і повертайте декодований :class:`bytes`." + +msgid "" +"Encode :term:`bytes-like object` *s* using the URL- and filesystem-safe " +"alphabet, which substitutes ``-`` instead of ``+`` and ``_`` instead of ``/" +"`` in the standard Base64 alphabet, and return the encoded :class:`bytes`. " +"The result can still contain ``=``." +msgstr "" +"Кодуйте :term:`bytes-like object` *s* за допомогою алфавіту, безпечного для " +"URL-адреси та файлової системи, який замінює ``-`` замість ``+`` і ``_`` " +"замість ``/`` у стандартному алфавіті Base64 і повертає закодовані :class:" +"`bytes`. Результат все ще може містити ``=``." + +msgid "" +"Decode :term:`bytes-like object` or ASCII string *s* using the URL- and " +"filesystem-safe alphabet, which substitutes ``-`` instead of ``+`` and ``_`` " +"instead of ``/`` in the standard Base64 alphabet, and return the decoded :" +"class:`bytes`." +msgstr "" +"Декодуйте :term:`bytes-like object` або рядок ASCII *s* за допомогою " +"алфавіту, безпечного для URL-адреси та файлової системи, який замінює ``-`` " +"замість ``+`` і ``_`` замість ``/`` у стандартному алфавіті Base64 і " +"повертає декодовані :class:`bytes`." + +msgid "" +"Encode the :term:`bytes-like object` *s* using Base32 and return the " +"encoded :class:`bytes`." +msgstr "" +"Закодуйте :term:`bytes-like object` *s* за допомогою Base32 і поверніть " +"закодовані :class:`bytes`." + +msgid "" +"Decode the Base32 encoded :term:`bytes-like object` or ASCII string *s* and " +"return the decoded :class:`bytes`." +msgstr "" +"Декодуйте закодований Base32 :term:`bytes-like object` або рядок ASCII *s* і " +"повертайте розкодований :class:`bytes`." + +msgid "" +"Optional *casefold* is a flag specifying whether a lowercase alphabet is " +"acceptable as input. For security purposes, the default is ``False``." +msgstr "" +"Необов’язковий *casefold* — це позначка, яка вказує, чи прийнятний алфавіт у " +"нижньому регістрі як вхідні дані. З міркувань безпеки за умовчанням " +"встановлено значення ``False``." + +msgid "" +":rfc:`4648` allows for optional mapping of the digit 0 (zero) to the letter " +"O (oh), and for optional mapping of the digit 1 (one) to either the letter I " +"(eye) or letter L (el). The optional argument *map01* when not ``None``, " +"specifies which letter the digit 1 should be mapped to (when *map01* is not " +"``None``, the digit 0 is always mapped to the letter O). For security " +"purposes the default is ``None``, so that 0 and 1 are not allowed in the " +"input." +msgstr "" +":rfc:`4648` дозволяє додаткове відображення цифри 0 (нуль) на літеру O (oh), " +"а також додаткове відображення цифри 1 (один) у літеру I (око) або літеру L " +"(el) . Необов’язковий аргумент *map01*, якщо він не \"None\", визначає, на " +"яку букву має бути зіставлено цифру 1 (якщо *map01* не є \"None\", цифра 0 " +"завжди зіставляється з літерою O). З міркувань безпеки типовим значенням є " +"``None``, тому 0 і 1 не допускаються у вхідних даних." + +msgid "" +"A :exc:`binascii.Error` is raised if *s* is incorrectly padded or if there " +"are non-alphabet characters present in the input." +msgstr "" +"Помилка :exc:`binascii.Error` виникає, якщо *s* неправильно доповнено або " +"якщо у вхідних даних присутні символи не алфавіту." + +msgid "" +"Similar to :func:`b32encode` but uses the Extended Hex Alphabet, as defined " +"in :rfc:`4648`." +msgstr "" +"Подібно до :func:`b32encode`, але використовує розширений шістнадцятковий " +"алфавіт, як визначено в :rfc:`4648`." + +msgid "" +"Similar to :func:`b32decode` but uses the Extended Hex Alphabet, as defined " +"in :rfc:`4648`." +msgstr "" +"Подібно до :func:`b32decode`, але використовує розширений шістнадцятковий " +"алфавіт, як визначено в :rfc:`4648`." + +msgid "" +"This version does not allow the digit 0 (zero) to the letter O (oh) and " +"digit 1 (one) to either the letter I (eye) or letter L (el) mappings, all " +"these characters are included in the Extended Hex Alphabet and are not " +"interchangeable." +msgstr "" +"У цій версії не допускається зіставлення цифри 0 (нуль) з літерою O (oh) і " +"цифри 1 (один) з літерою I (око) або літерою L (el). Усі ці символи входять " +"до розширеного шістнадцяткового алфавіту. і не є взаємозамінними." + +msgid "" +"Encode the :term:`bytes-like object` *s* using Base16 and return the " +"encoded :class:`bytes`." +msgstr "" +"Закодуйте :term:`bytes-like object` *s* за допомогою Base16 і поверніть " +"закодовані :class:`bytes`." + +msgid "" +"Decode the Base16 encoded :term:`bytes-like object` or ASCII string *s* and " +"return the decoded :class:`bytes`." +msgstr "" +"Декодуйте закодований Base16 :term:`bytes-like object` або рядок ASCII *s* і " +"повертайте розкодований :class:`bytes`." + +msgid "" +"Encode the :term:`bytes-like object` *b* using Ascii85 and return the " +"encoded :class:`bytes`." +msgstr "" +"Закодуйте :term:`bytes-like object` *b* за допомогою Ascii85 та поверніть " +"закодовані :class:`bytes`." + +msgid "" +"*foldspaces* is an optional flag that uses the special short sequence 'y' " +"instead of 4 consecutive spaces (ASCII 0x20) as supported by 'btoa'. This " +"feature is not supported by the \"standard\" Ascii85 encoding." +msgstr "" +"*foldspaces* — це необов’язковий прапорець, який використовує спеціальну " +"коротку послідовність \"y\" замість 4 послідовних пробілів (ASCII 0x20), як " +"це підтримується \"btoa\". Ця функція не підтримується \"стандартним\" " +"кодуванням Ascii85." + +msgid "" +"*wrapcol* controls whether the output should have newline (``b'\\n'``) " +"characters added to it. If this is non-zero, each output line will be at " +"most this many characters long, excluding the trailing newline." +msgstr "" + +msgid "" +"*pad* controls whether the input is padded to a multiple of 4 before " +"encoding. Note that the ``btoa`` implementation always pads." +msgstr "" +"*pad* контролює, чи додається вхід до числа, кратного 4, перед кодуванням. " +"Зауважте, що реалізація ``btoa`` завжди доповнює." + +msgid "" +"*adobe* controls whether the encoded byte sequence is framed with ``<~`` and " +"``~>``, which is used by the Adobe implementation." +msgstr "" +"*adobe* контролює, чи буде закодована послідовність байтів обрамлена ``<~`` " +"and ``~>``, яка використовується реалізацією Adobe." + +msgid "" +"Decode the Ascii85 encoded :term:`bytes-like object` or ASCII string *b* and " +"return the decoded :class:`bytes`." +msgstr "" +"Декодуйте закодований Ascii85 :term:`bytes-like object` або рядок ASCII *b* " +"та повертайте декодований :class:`bytes`." + +msgid "" +"*foldspaces* is a flag that specifies whether the 'y' short sequence should " +"be accepted as shorthand for 4 consecutive spaces (ASCII 0x20). This feature " +"is not supported by the \"standard\" Ascii85 encoding." +msgstr "" +"*foldspaces* — це позначка, яка вказує, чи слід приймати коротку " +"послідовність 'y' як скорочення для 4 послідовних пробілів (ASCII 0x20). Ця " +"функція не підтримується \"стандартним\" кодуванням Ascii85." + +msgid "" +"*adobe* controls whether the input sequence is in Adobe Ascii85 format (i.e. " +"is framed with <~ and ~>)." +msgstr "" +"*adobe* контролює, чи буде вхідна послідовність у форматі Adobe Ascii85 " +"(тобто в рамці <~ and ~>)." + +msgid "" +"*ignorechars* should be a :term:`bytes-like object` or ASCII string " +"containing characters to ignore from the input. This should only contain " +"whitespace characters, and by default contains all whitespace characters in " +"ASCII." +msgstr "" +"*ignorechars* має бути :term:`bytes-like object` або рядком ASCII, що " +"містить символи, які слід ігнорувати у введених даних. Він має містити лише " +"пробільні символи та за замовчуванням містить усі пробільні символи в ASCII." + +msgid "" +"Encode the :term:`bytes-like object` *b* using base85 (as used in e.g. git-" +"style binary diffs) and return the encoded :class:`bytes`." +msgstr "" +"Закодуйте :term:`bytes-like object` *b* за допомогою base85 (як " +"використовується, наприклад, у бінарних відмінностях у стилі git) і " +"поверніть закодований :class:`bytes`." + +msgid "" +"If *pad* is true, the input is padded with ``b'\\0'`` so its length is a " +"multiple of 4 bytes before encoding." +msgstr "" +"Якщо *pad* має значення true, вхід доповнюється ``b'\\0``, тому його довжина " +"є кратною 4 байтам перед кодуванням." + +msgid "" +"Decode the base85-encoded :term:`bytes-like object` or ASCII string *b* and " +"return the decoded :class:`bytes`. Padding is implicitly removed, if " +"necessary." +msgstr "" +"Декодуйте закодований base85 :term:`bytes-like object` або рядок ASCII *b* " +"та повертайте декодований :class:`bytes`. Відступи неявно видаляються, якщо " +"необхідно." + +msgid "" +"Encode the :term:`bytes-like object` *s* using Z85 (as used in ZeroMQ) and " +"return the encoded :class:`bytes`. See `Z85 specification `_ for more information." +msgstr "" + +msgid "" +"Decode the Z85-encoded :term:`bytes-like object` or ASCII string *s* and " +"return the decoded :class:`bytes`. See `Z85 specification `_ for more information." +msgstr "" + +msgid "The legacy interface:" +msgstr "Застарілий інтерфейс:" + +msgid "" +"Decode the contents of the binary *input* file and write the resulting " +"binary data to the *output* file. *input* and *output* must be :term:`file " +"objects `. *input* will be read until ``input.readline()`` " +"returns an empty bytes object." +msgstr "" +"Декодуйте вміст двійкового *вхідного* файлу та запишіть отримані двійкові " +"дані у *вихідний* файл. *вхід* і *вихід* мають бути :term:`файловими " +"об’єктами `. *input* читатиметься, доки ``input.readline()`` не " +"поверне порожній об’єкт bytes." + +msgid "" +"Decode the :term:`bytes-like object` *s*, which must contain one or more " +"lines of base64 encoded data, and return the decoded :class:`bytes`." +msgstr "" +"Декодуйте :term:`bytes-like object` *s*, який має містити один або кілька " +"рядків даних у кодуванні base64, і повертайте розкодовані :class:`bytes`." + +msgid "" +"Encode the contents of the binary *input* file and write the resulting " +"base64 encoded data to the *output* file. *input* and *output* must be :term:" +"`file objects `. *input* will be read until ``input.read()`` " +"returns an empty bytes object. :func:`encode` inserts a newline character " +"(``b'\\n'``) after every 76 bytes of the output, as well as ensuring that " +"the output always ends with a newline, as per :rfc:`2045` (MIME)." +msgstr "" +"Закодуйте вміст двійкового *вхідного* файлу та запишіть отримані дані в " +"кодуванні base64 у *вихідний* файл. *вхід* і *вихід* мають бути :term:" +"`файловими об’єктами `. *input* читатиметься, доки ``input." +"read()`` не поверне порожній об’єкт bytes. :func:`encode` вставляє символ " +"нового рядка (``b'\\n'``) після кожних 76 байтів виводу, а також гарантує, " +"що вивід завжди закінчується символом нового рядка, відповідно до :rfc:" +"`2045` (MIME)." + +msgid "" +"Encode the :term:`bytes-like object` *s*, which can contain arbitrary binary " +"data, and return :class:`bytes` containing the base64-encoded data, with " +"newlines (``b'\\n'``) inserted after every 76 bytes of output, and ensuring " +"that there is a trailing newline, as per :rfc:`2045` (MIME)." +msgstr "" +"Закодуйте :term:`bytes-like object` *s*, який може містити довільні двійкові " +"дані, і поверніть :class:`bytes`, що містить дані в кодуванні base64, із " +"символами нового рядка (``b'\\n'``) вставляється після кожних 76 байтів " +"виводу та забезпечує наявність кінцевого нового рядка відповідно до :rfc:" +"`2045` (MIME)." + +msgid "An example usage of the module:" +msgstr "Приклад використання модуля:" + +msgid "Security Considerations" +msgstr "Міркування безпеки" + +msgid "" +"A new security considerations section was added to :rfc:`4648` (section 12); " +"it's recommended to review the security section for any code deployed to " +"production." +msgstr "" +"Новий розділ міркувань безпеки додано до :rfc:`4648` (розділ 12); " +"рекомендуємо переглянути розділ безпеки для будь-якого коду, розгорнутого в " +"робочій версії." + +msgid "Module :mod:`binascii`" +msgstr "Модуль :mod:`binascii`" + +msgid "" +"Support module containing ASCII-to-binary and binary-to-ASCII conversions." +msgstr "" +"Модуль підтримки, що містить перетворення ASCII у двійковий і двійковий у " +"ASCII." + +msgid "" +":rfc:`1521` - MIME (Multipurpose Internet Mail Extensions) Part One: " +"Mechanisms for Specifying and Describing the Format of Internet Message " +"Bodies" +msgstr "" +":rfc:`1521` - MIME (багатоцільові розширення інтернет-пошти), частина перша: " +"механізми визначення й опису формату тіл інтернет-повідомлень" + +msgid "" +"Section 5.2, \"Base64 Content-Transfer-Encoding,\" provides the definition " +"of the base64 encoding." +msgstr "" +"Розділ 5.2 \"Кодування передачі вмісту Base64\" містить визначення кодування " +"base64." + +msgid "base64" +msgstr "база64" + +msgid "encoding" +msgstr "кодування" + +msgid "MIME" +msgstr "" + +msgid "base64 encoding" +msgstr "" diff --git a/library/bdb.po b/library/bdb.po new file mode 100644 index 000000000..e780e33bb --- /dev/null +++ b/library/bdb.po @@ -0,0 +1,577 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:55+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!bdb` --- Debugger framework" +msgstr "" + +msgid "**Source code:** :source:`Lib/bdb.py`" +msgstr "**Вихідний код:** :source:`Lib/bdb.py`" + +msgid "" +"The :mod:`bdb` module handles basic debugger functions, like setting " +"breakpoints or managing execution via the debugger." +msgstr "" +"Модуль :mod:`bdb` обробляє основні функції налагоджувача, як-от встановлення " +"точок зупину або керування виконанням через налагоджувач." + +msgid "The following exception is defined:" +msgstr "Визначено такий виняток:" + +msgid "Exception raised by the :class:`Bdb` class for quitting the debugger." +msgstr "Виняток, створений класом :class:`Bdb` для виходу з налагоджувача." + +msgid "The :mod:`bdb` module also defines two classes:" +msgstr "Модуль :mod:`bdb` також визначає два класи:" + +msgid "" +"This class implements temporary breakpoints, ignore counts, disabling and " +"(re-)enabling, and conditionals." +msgstr "" +"Цей клас реалізує тимчасові точки зупинки, ігнорування підрахунків, " +"відключення та (повторне) увімкнення, а також умови." + +msgid "" +"Breakpoints are indexed by number through a list called :attr:`bpbynumber` " +"and by ``(file, line)`` pairs through :attr:`bplist`. The former points to " +"a single instance of class :class:`Breakpoint`. The latter points to a list " +"of such instances since there may be more than one breakpoint per line." +msgstr "" +"Точки зупину індексуються за номером у списку під назвою :attr:`bpbynumber` " +"та парами ``(файл, рядок)`` через :attr:`bplist`. Перший вказує на єдиний " +"екземпляр класу :class:`Breakpoint`. Останній вказує на список таких " +"випадків, оскільки на рядок може бути більше однієї точки зупину." + +msgid "" +"When creating a breakpoint, its associated :attr:`file name ` should " +"be in canonical form. If a :attr:`funcname` is defined, a breakpoint :attr:" +"`hit ` will be counted when the first line of that function is " +"executed. A :attr:`conditional ` breakpoint always counts a :attr:" +"`hit `." +msgstr "" + +msgid ":class:`Breakpoint` instances have the following methods:" +msgstr "Екземпляри :class:`Breakpoint` мають такі методи:" + +msgid "" +"Delete the breakpoint from the list associated to a file/line. If it is the " +"last breakpoint in that position, it also deletes the entry for the file/" +"line." +msgstr "" +"Видалити точку зупину зі списку, пов’язаного з файлом/рядком. Якщо це " +"остання точка зупину в цій позиції, вона також видаляє запис для файлу/рядка." + +msgid "Mark the breakpoint as enabled." +msgstr "Позначте точку зупину як увімкнену." + +msgid "Mark the breakpoint as disabled." +msgstr "Позначте точку зупину як вимкнену." + +msgid "" +"Return a string with all the information about the breakpoint, nicely " +"formatted:" +msgstr "" +"Повертає рядок з усією інформацією про точку зупину, красиво відформатований:" + +msgid "Breakpoint number." +msgstr "" + +msgid "Temporary status (del or keep)." +msgstr "" + +msgid "File/line position." +msgstr "" + +msgid "Break condition." +msgstr "" + +msgid "Number of times to ignore." +msgstr "" + +msgid "Number of times hit." +msgstr "" + +msgid "" +"Print the output of :meth:`bpformat` to the file *out*, or if it is " +"``None``, to standard output." +msgstr "" +"Надрукувати вихідні дані :meth:`bpformat` у файл *out*, або, якщо він " +"``None``, у стандартний вихід." + +msgid ":class:`Breakpoint` instances have the following attributes:" +msgstr "" + +msgid "File name of the :class:`Breakpoint`." +msgstr "" + +msgid "Line number of the :class:`Breakpoint` within :attr:`file`." +msgstr "" + +msgid "``True`` if a :class:`Breakpoint` at (file, line) is temporary." +msgstr "" + +msgid "Condition for evaluating a :class:`Breakpoint` at (file, line)." +msgstr "" + +msgid "" +"Function name that defines whether a :class:`Breakpoint` is hit upon " +"entering the function." +msgstr "" + +msgid "``True`` if :class:`Breakpoint` is enabled." +msgstr "" + +msgid "Numeric index for a single instance of a :class:`Breakpoint`." +msgstr "" + +msgid "" +"Dictionary of :class:`Breakpoint` instances indexed by (:attr:`file`, :attr:" +"`line`) tuples." +msgstr "" + +msgid "Number of times to ignore a :class:`Breakpoint`." +msgstr "" + +msgid "Count of the number of times a :class:`Breakpoint` has been hit." +msgstr "" + +msgid "The :class:`Bdb` class acts as a generic Python debugger base class." +msgstr "Клас :class:`Bdb` діє як загальний базовий клас налагоджувача Python." + +msgid "" +"This class takes care of the details of the trace facility; a derived class " +"should implement user interaction. The standard debugger class (:class:`pdb." +"Pdb`) is an example." +msgstr "" +"Цей клас піклується про деталі засобу трасування; похідний клас повинен " +"реалізовувати взаємодію з користувачем. Прикладом є стандартний клас " +"відладчика (:class:`pdb.Pdb`)." + +msgid "" +"The *skip* argument, if given, must be an iterable of glob-style module name " +"patterns. The debugger will not step into frames that originate in a module " +"that matches one of these patterns. Whether a frame is considered to " +"originate in a certain module is determined by the ``__name__`` in the frame " +"globals." +msgstr "" +"Аргумент *skip*, якщо він наданий, має бути повторюваним шаблоном імен " +"модулів у стилі glob. Налагоджувач не ввійде в кадри, які походять із " +"модуля, який відповідає одному з цих шаблонів. Чи вважається, що фрейм " +"походить із певного модуля, визначається ``__name__`` у глобальних " +"параметрах фрейму." + +msgid "Added the *skip* parameter." +msgstr "" + +msgid "" +"The following methods of :class:`Bdb` normally don't need to be overridden." +msgstr "Наступні методи :class:`Bdb` зазвичай не потребують перевизначення." + +msgid "Return canonical form of *filename*." +msgstr "" + +msgid "" +"For real file names, the canonical form is an operating-system-dependent, :" +"func:`case-normalized ` :func:`absolute path `. A *filename* with angle brackets, such as ``\"\"`` " +"generated in interactive mode, is returned unchanged." +msgstr "" + +msgid "" +"Set the :attr:`!botframe`, :attr:`!stopframe`, :attr:`!returnframe` and :" +"attr:`quitting ` attributes with values ready to start " +"debugging." +msgstr "" + +msgid "" +"This function is installed as the trace function of debugged frames. Its " +"return value is the new trace function (in most cases, that is, itself)." +msgstr "" +"Ця функція встановлена як функція трасування налагоджених кадрів. Його " +"значенням, що повертається, є нова функція трасування (у більшості випадків, " +"тобто сама)." + +msgid "" +"The default implementation decides how to dispatch a frame, depending on the " +"type of event (passed as a string) that is about to be executed. *event* can " +"be one of the following:" +msgstr "" +"Реалізація за замовчуванням вирішує, як відправляти кадр, залежно від типу " +"події (переданої у вигляді рядка), яка має бути виконана. *подією* може бути " +"одне з наступного:" + +msgid "``\"line\"``: A new line of code is going to be executed." +msgstr "``\"рядок\"``: буде виконано новий рядок коду." + +msgid "" +"``\"call\"``: A function is about to be called, or another code block " +"entered." +msgstr "``\"виклик\"``: функція буде викликана або введено інший блок коду." + +msgid "``\"return\"``: A function or other code block is about to return." +msgstr "``\"return\"``: функція або інший блок коду збирається повернутися." + +msgid "``\"exception\"``: An exception has occurred." +msgstr "``\"exception\"``: сталася виняток." + +msgid "``\"c_call\"``: A C function is about to be called." +msgstr "``\"c_call\"``: функція C збирається викликатися." + +msgid "``\"c_return\"``: A C function has returned." +msgstr "``\"c_return\"``: функція C повернулася." + +msgid "``\"c_exception\"``: A C function has raised an exception." +msgstr "``\"c_exception\"``: функція C викликала виняток." + +msgid "" +"For the Python events, specialized functions (see below) are called. For " +"the C events, no action is taken." +msgstr "" +"Для подій Python викликаються спеціалізовані функції (див. нижче). Для подій " +"C не виконується жодних дій." + +msgid "The *arg* parameter depends on the previous event." +msgstr "Параметр *arg* залежить від попередньої події." + +msgid "" +"See the documentation for :func:`sys.settrace` for more information on the " +"trace function. For more information on code and frame objects, refer to :" +"ref:`types`." +msgstr "" +"Перегляньте документацію для :func:`sys.settrace`, щоб дізнатися більше про " +"функцію трасування. Для отримання додаткової інформації про код і об’єкти " +"фрейму зверніться до :ref:`types`." + +msgid "" +"If the debugger should stop on the current line, invoke the :meth:" +"`user_line` method (which should be overridden in subclasses). Raise a :exc:" +"`BdbQuit` exception if the :attr:`quitting ` flag is set " +"(which can be set from :meth:`user_line`). Return a reference to the :meth:" +"`trace_dispatch` method for further tracing in that scope." +msgstr "" + +msgid "" +"If the debugger should stop on this function call, invoke the :meth:" +"`user_call` method (which should be overridden in subclasses). Raise a :exc:" +"`BdbQuit` exception if the :attr:`quitting ` flag is set " +"(which can be set from :meth:`user_call`). Return a reference to the :meth:" +"`trace_dispatch` method for further tracing in that scope." +msgstr "" + +msgid "" +"If the debugger should stop on this function return, invoke the :meth:" +"`user_return` method (which should be overridden in subclasses). Raise a :" +"exc:`BdbQuit` exception if the :attr:`quitting ` flag is set " +"(which can be set from :meth:`user_return`). Return a reference to the :" +"meth:`trace_dispatch` method for further tracing in that scope." +msgstr "" + +msgid "" +"If the debugger should stop at this exception, invokes the :meth:" +"`user_exception` method (which should be overridden in subclasses). Raise a :" +"exc:`BdbQuit` exception if the :attr:`quitting ` flag is set " +"(which can be set from :meth:`user_exception`). Return a reference to the :" +"meth:`trace_dispatch` method for further tracing in that scope." +msgstr "" + +msgid "" +"Normally derived classes don't override the following methods, but they may " +"if they want to redefine the definition of stopping and breakpoints." +msgstr "" +"Зазвичай похідні класи не замінюють наступні методи, але вони можуть, якщо " +"хочуть перевизначити визначення зупинки та точок зупинки." + +msgid "Return ``True`` if *module_name* matches any skip pattern." +msgstr "" + +msgid "Return ``True`` if *frame* is below the starting frame in the stack." +msgstr "" + +msgid "Return ``True`` if there is an effective breakpoint for this line." +msgstr "" + +msgid "" +"Check whether a line or function breakpoint exists and is in effect. Delete " +"temporary breakpoints based on information from :func:`effective`." +msgstr "" + +msgid "Return ``True`` if any breakpoint exists for *frame*'s filename." +msgstr "" + +msgid "" +"Derived classes should override these methods to gain control over debugger " +"operation." +msgstr "" +"Похідні класи повинні перевизначати ці методи, щоб отримати контроль над " +"роботою відладчика." + +msgid "" +"Called from :meth:`dispatch_call` if a break might stop inside the called " +"function." +msgstr "" + +msgid "" +"*argument_list* is not used anymore and will always be ``None``. The " +"argument is kept for backwards compatibility." +msgstr "" + +msgid "" +"Called from :meth:`dispatch_line` when either :meth:`stop_here` or :meth:" +"`break_here` returns ``True``." +msgstr "" + +msgid "" +"Called from :meth:`dispatch_return` when :meth:`stop_here` returns ``True``." +msgstr "" + +msgid "" +"Called from :meth:`dispatch_exception` when :meth:`stop_here` returns " +"``True``." +msgstr "" + +msgid "Handle how a breakpoint must be removed when it is a temporary one." +msgstr "Визначте, як потрібно видалити точку зупину, якщо вона є тимчасовою." + +msgid "This method must be implemented by derived classes." +msgstr "Цей метод має бути реалізований похідними класами." + +msgid "" +"Derived classes and clients can call the following methods to affect the " +"stepping state." +msgstr "" +"Похідні класи та клієнти можуть викликати наступні методи, щоб впливати на " +"кроковий стан." + +msgid "Stop after one line of code." +msgstr "Зупинка після одного рядка коду." + +msgid "Stop on the next line in or below the given frame." +msgstr "Зупиніться на наступному рядку в заданому кадрі або під ним." + +msgid "Stop when returning from the given frame." +msgstr "Зупинка при поверненні із заданого кадру." + +msgid "" +"Stop when the line with the *lineno* greater than the current one is reached " +"or when returning from current frame." +msgstr "" + +msgid "" +"Start debugging from *frame*. If *frame* is not specified, debugging starts " +"from caller's frame." +msgstr "" +"Почніть налагодження з *фрейму*. Якщо *frame* не вказано, налагодження " +"починається з кадру абонента." + +msgid "" +":func:`set_trace` will enter the debugger immediately, rather than on the " +"next line of code to be executed." +msgstr "" + +msgid "" +"Stop only at breakpoints or when finished. If there are no breakpoints, set " +"the system trace function to ``None``." +msgstr "" +"Зупиняйтеся лише в точках зупинки або після завершення. Якщо немає " +"контрольних точок, встановіть для функції трасування системи значення " +"``None``." + +msgid "" +"Set the :attr:`!quitting` attribute to ``True``. This raises :exc:`BdbQuit` " +"in the next call to one of the :meth:`!dispatch_\\*` methods." +msgstr "" + +msgid "" +"Derived classes and clients can call the following methods to manipulate " +"breakpoints. These methods return a string containing an error message if " +"something went wrong, or ``None`` if all is well." +msgstr "" +"Похідні класи та клієнти можуть викликати наведені нижче методи для " +"керування точками зупинки. Ці методи повертають рядок, що містить " +"повідомлення про помилку, якщо щось пішло не так, або ``None``, якщо все " +"добре." + +msgid "" +"Set a new breakpoint. If the *lineno* line doesn't exist for the *filename* " +"passed as argument, return an error message. The *filename* should be in " +"canonical form, as described in the :meth:`canonic` method." +msgstr "" +"Встановіть нову точку зупинки. Якщо рядок *lineno* не існує для *ім’я " +"файлу*, переданого як аргумент, поверніть повідомлення про помилку. *Ім’я* " +"файлу має бути в канонічній формі, як описано в методі :meth:`canonic`." + +msgid "" +"Delete the breakpoints in *filename* and *lineno*. If none were set, return " +"an error message." +msgstr "" + +msgid "" +"Delete the breakpoint which has the index *arg* in the :attr:`Breakpoint." +"bpbynumber`. If *arg* is not numeric or out of range, return an error " +"message." +msgstr "" +"Видаліть точку зупину, яка має індекс *arg* у :attr:`Breakpoint.bpbynumber`. " +"Якщо *arg* не є числом або виходить за межі діапазону, повертає повідомлення " +"про помилку." + +msgid "" +"Delete all breakpoints in *filename*. If none were set, return an error " +"message." +msgstr "" + +msgid "" +"Delete all existing breakpoints. If none were set, return an error message." +msgstr "" + +msgid "" +"Return a breakpoint specified by the given number. If *arg* is a string, it " +"will be converted to a number. If *arg* is a non-numeric string, if the " +"given breakpoint never existed or has been deleted, a :exc:`ValueError` is " +"raised." +msgstr "" +"Повертає точку зупину, визначену заданим числом. Якщо *arg* є рядком, його " +"буде перетворено на число. Якщо *arg* є нечисловим рядком, якщо задана точка " +"зупину ніколи не існувала або була видалена, виникає :exc:`ValueError`." + +msgid "Return ``True`` if there is a breakpoint for *lineno* in *filename*." +msgstr "" + +msgid "" +"Return all breakpoints for *lineno* in *filename*, or an empty list if none " +"are set." +msgstr "" +"Повертає всі контрольні точки для *lineno* в *імені файлу* або порожній " +"список, якщо жодна з них не встановлена." + +msgid "Return all breakpoints in *filename*, or an empty list if none are set." +msgstr "" +"Повертає всі контрольні точки в *назві файлу* або порожній список, якщо " +"жодна з них не встановлена." + +msgid "Return all breakpoints that are set." +msgstr "Повернути всі встановлені точки зупину." + +msgid "" +"Derived classes and clients can call the following methods to get a data " +"structure representing a stack trace." +msgstr "" +"Похідні класи та клієнти можуть викликати наведені нижче методи, щоб " +"отримати структуру даних, що представляє трасування стека." + +msgid "Return a list of (frame, lineno) tuples in a stack trace, and a size." +msgstr "" + +msgid "" +"The most recently called frame is last in the list. The size is the number " +"of frames below the frame where the debugger was invoked." +msgstr "" + +msgid "" +"Return a string with information about a stack entry, which is a ``(frame, " +"lineno)`` tuple. The return string contains:" +msgstr "" + +msgid "The canonical filename which contains the frame." +msgstr "" + +msgid "The function name or ``\"\"``." +msgstr "" + +msgid "The input arguments." +msgstr "Вхідні аргументи." + +msgid "The return value." +msgstr "Повернене значення." + +msgid "The line of code (if it exists)." +msgstr "Рядок коду (якщо він існує)." + +msgid "" +"The following two methods can be called by clients to use a debugger to " +"debug a :term:`statement`, given as a string." +msgstr "" +"Наступні два методи можуть бути викликані клієнтами для використання " +"налагоджувача для налагодження :term:`statement`, поданого як рядок." + +msgid "" +"Debug a statement executed via the :func:`exec` function. *globals* " +"defaults to :attr:`!__main__.__dict__`, *locals* defaults to *globals*." +msgstr "" + +msgid "" +"Debug an expression executed via the :func:`eval` function. *globals* and " +"*locals* have the same meaning as in :meth:`run`." +msgstr "" +"Налагодити вираз, що виконується за допомогою функції :func:`eval`. " +"*globals* і *locals* мають те саме значення, що й у :meth:`run`." + +msgid "For backwards compatibility. Calls the :meth:`run` method." +msgstr "Для зворотної сумісності. Викликає метод :meth:`run`." + +msgid "Debug a single function call, and return its result." +msgstr "Налагодити один виклик функції та повернути його результат." + +msgid "Finally, the module defines the following functions:" +msgstr "Нарешті, модуль визначає такі функції:" + +msgid "" +"Return ``True`` if we should break here, depending on the way the :class:" +"`Breakpoint` *b* was set." +msgstr "" + +msgid "" +"If it was set via line number, it checks if :attr:`b.line ` is the same as the one in *frame*. If the breakpoint was set via :" +"attr:`function name `, we have to check we are in " +"the right *frame* (the right function) and if we are on its first executable " +"line." +msgstr "" + +msgid "" +"Return ``(active breakpoint, delete temporary flag)`` or ``(None, None)`` as " +"the breakpoint to act upon." +msgstr "" + +msgid "" +"The *active breakpoint* is the first entry in :attr:`bplist ` for the (:attr:`file `, :attr:`line `) (which must exist) that is :attr:`enabled `, for which :func:`checkfuncname` is true, and that has neither a " +"false :attr:`condition ` nor positive :attr:`ignore " +"` count. The *flag*, meaning that a temporary " +"breakpoint should be deleted, is ``False`` only when the :attr:`cond ` cannot be evaluated (in which case, :attr:`ignore ` count is ignored)." +msgstr "" + +msgid "If no such entry exists, then ``(None, None)`` is returned." +msgstr "" + +msgid "Start debugging with a :class:`Bdb` instance from caller's frame." +msgstr "Почніть налагодження з екземпляра :class:`Bdb` із фрейму абонента." + +msgid "quitting (bdb.Bdb attribute)" +msgstr "" diff --git a/library/binary.po b/library/binary.po new file mode 100644 index 000000000..737086dc0 --- /dev/null +++ b/library/binary.po @@ -0,0 +1,55 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:56+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Binary Data Services" +msgstr "Служби двійкових даних" + +msgid "" +"The modules described in this chapter provide some basic services operations " +"for manipulation of binary data. Other operations on binary data, " +"specifically in relation to file formats and network protocols, are " +"described in the relevant sections." +msgstr "" +"Модулі, описані в цьому розділі, надають деякі базові сервісні операції для " +"роботи з двійковими даними. Інші операції з двійковими даними, зокрема щодо " +"форматів файлів і мережевих протоколів, описані у відповідних розділах." + +msgid "" +"Some libraries described under :ref:`textservices` also work with either " +"ASCII-compatible binary formats (for example, :mod:`re`) or all binary data " +"(for example, :mod:`difflib`)." +msgstr "" +"Деякі бібліотеки, описані в :ref:`textservices`, також працюють або з ASCII-" +"сумісними бінарними форматами (наприклад, :mod:`re`), або з усіма двійковими " +"даними (наприклад, :mod:`difflib`)." + +msgid "" +"In addition, see the documentation for Python's built-in binary data types " +"in :ref:`binaryseq`." +msgstr "" +"Крім того, перегляньте документацію щодо вбудованих двійкових типів даних " +"Python у :ref:`binaryseq`." diff --git a/library/binascii.po b/library/binascii.po new file mode 100644 index 000000000..6879d456a --- /dev/null +++ b/library/binascii.po @@ -0,0 +1,273 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:56+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!binascii` --- Convert between binary and ASCII" +msgstr "" + +msgid "" +"The :mod:`binascii` module contains a number of methods to convert between " +"binary and various ASCII-encoded binary representations. Normally, you will " +"not use these functions directly but use wrapper modules like :mod:`base64` " +"instead. The :mod:`binascii` module contains low-level functions written in " +"C for greater speed that are used by the higher-level modules." +msgstr "" + +msgid "" +"``a2b_*`` functions accept Unicode strings containing only ASCII characters. " +"Other functions only accept :term:`bytes-like objects ` " +"(such as :class:`bytes`, :class:`bytearray` and other objects that support " +"the buffer protocol)." +msgstr "" +"Функції ``a2b_*`` приймають рядки Unicode, що містять лише символи ASCII. " +"Інші функції приймають лише :term:`байтоподібні об’єкти ` " +"(такі як :class:`bytes`, :class:`bytearray` та інші об’єкти, які підтримують " +"протокол буфера)." + +msgid "ASCII-only unicode strings are now accepted by the ``a2b_*`` functions." +msgstr "Функції ``a2b_*`` тепер приймають рядки Unicode тільки ASCII." + +msgid "The :mod:`binascii` module defines the following functions:" +msgstr "Модуль :mod:`binascii` визначає такі функції:" + +msgid "" +"Convert a single line of uuencoded data back to binary and return the binary " +"data. Lines normally contain 45 (binary) bytes, except for the last line. " +"Line data may be followed by whitespace." +msgstr "" +"Перетворити один рядок uuencoded даних назад у двійкові та повернути " +"двійкові дані. Рядки зазвичай містять 45 (двійкових) байт, за винятком " +"останнього рядка. Після рядкових даних може стояти пробіл." + +msgid "" +"Convert binary data to a line of ASCII characters, the return value is the " +"converted line, including a newline char. The length of *data* should be at " +"most 45. If *backtick* is true, zeros are represented by ``'`'`` instead of " +"spaces." +msgstr "" +"Перетворює двійкові дані на рядок із символами ASCII, повертається значенням " +"є перетворений рядок, включаючи символ нового рядка. Довжина *data* має " +"становити щонайбільше 45. Якщо *backtick* має значення true, нулі " +"позначаються символом ``''`'`` замість пробілів." + +msgid "Added the *backtick* parameter." +msgstr "Додано параметр *backtick*." + +msgid "" +"Convert a block of base64 data back to binary and return the binary data. " +"More than one line may be passed at a time." +msgstr "" +"Перетворіть блок даних base64 назад у двійковий і поверніть двійкові дані. " +"Одночасно можна передати більше одного рядка." + +msgid "" +"If *strict_mode* is true, only valid base64 data will be converted. Invalid " +"base64 data will raise :exc:`binascii.Error`." +msgstr "" + +msgid "Valid base64:" +msgstr "" + +msgid "Conforms to :rfc:`3548`." +msgstr "" + +msgid "Contains only characters from the base64 alphabet." +msgstr "" + +msgid "" +"Contains no excess data after padding (including excess padding, newlines, " +"etc.)." +msgstr "" + +msgid "Does not start with a padding." +msgstr "" + +msgid "Added the *strict_mode* parameter." +msgstr "" + +msgid "" +"Convert binary data to a line of ASCII characters in base64 coding. The " +"return value is the converted line, including a newline char if *newline* is " +"true. The output of this function conforms to :rfc:`3548`." +msgstr "" +"Перетворення двійкових даних у рядок символів ASCII у кодуванні base64. " +"Поверненим значенням є перетворений рядок, включаючи символ нового рядка, " +"якщо *новий рядок* має значення true. Вихід цієї функції відповідає :rfc:" +"`3548`." + +msgid "Added the *newline* parameter." +msgstr "Додано параметр *новий рядок*." + +msgid "" +"Convert a block of quoted-printable data back to binary and return the " +"binary data. More than one line may be passed at a time. If the optional " +"argument *header* is present and true, underscores will be decoded as spaces." +msgstr "" +"Перетворити блок даних, які можна роздрукувати в лапках, назад у двійкові та " +"повернути двійкові дані. Одночасно можна передати більше одного рядка. Якщо " +"необов’язковий аргумент *header* присутній і має значення true, підкреслення " +"розшифровуватимуться як пробіли." + +msgid "" +"Convert binary data to a line(s) of ASCII characters in quoted-printable " +"encoding. The return value is the converted line(s). If the optional " +"argument *quotetabs* is present and true, all tabs and spaces will be " +"encoded. If the optional argument *istext* is present and true, newlines " +"are not encoded but trailing whitespace will be encoded. If the optional " +"argument *header* is present and true, spaces will be encoded as underscores " +"per :rfc:`1522`. If the optional argument *header* is present and false, " +"newline characters will be encoded as well; otherwise linefeed conversion " +"might corrupt the binary data stream." +msgstr "" +"Перетворюйте двійкові дані на рядки символів ASCII у кодуванні, що " +"друкується в лапках. Поверненим значенням є перетворені рядки. Якщо " +"необов’язковий аргумент *quotetabs* присутній і вірний, усі символи " +"табуляції та пробіли будуть закодовані. Якщо необов’язковий аргумент " +"*istext* присутній і має значення true, нові рядки не кодуються, але кінцеві " +"пробіли кодуються. Якщо необов’язковий аргумент *header* присутній і " +"відповідає дійсності, пробіли будуть закодовані як підкреслення відповідно " +"до :rfc:`1522`. Якщо необов’язковий аргумент *header* присутній і false, " +"символи нового рядка також будуть закодовані; інакше перетворення переводу " +"рядка може пошкодити двійковий потік даних." + +msgid "" +"Compute a 16-bit CRC value of *data*, starting with *value* as the initial " +"CRC, and return the result. This uses the CRC-CCITT polynomial *x*:sup:`16` " +"+ *x*:sup:`12` + *x*:sup:`5` + 1, often represented as 0x1021. This CRC is " +"used in the binhex4 format." +msgstr "" +"Обчисліть 16-бітне значення CRC *data*, починаючи з *value* як початкового " +"CRC, і поверніть результат. Тут використовується поліном CRC-CCITT *x*:sup:" +"`16` + *x*:sup:`12` + *x*:sup:`5` + 1, який часто представляється як 0x1021. " +"Цей CRC використовується у форматі binhex4." + +msgid "" +"Compute CRC-32, the unsigned 32-bit checksum of *data*, starting with an " +"initial CRC of *value*. The default initial CRC is zero. The algorithm is " +"consistent with the ZIP file checksum. Since the algorithm is designed for " +"use as a checksum algorithm, it is not suitable for use as a general hash " +"algorithm. Use as follows::" +msgstr "" +"Обчисліть CRC-32, беззнакову 32-бітну контрольну суму *даних*, починаючи з " +"початкового CRC *значення*. Початковий CRC за умовчанням дорівнює нулю. " +"Алгоритм узгоджується з контрольною сумою файлу ZIP. Оскільки алгоритм " +"розроблено для використання як алгоритм контрольної суми, він не підходить " +"для використання як загальний алгоритм хешування. Використовуйте наступним " +"чином:" + +msgid "" +"print(binascii.crc32(b\"hello world\"))\n" +"# Or, in two pieces:\n" +"crc = binascii.crc32(b\"hello\")\n" +"crc = binascii.crc32(b\" world\", crc)\n" +"print('crc32 = {:#010x}'.format(crc))" +msgstr "" + +msgid "The result is always unsigned." +msgstr "" + +msgid "" +"Return the hexadecimal representation of the binary *data*. Every byte of " +"*data* is converted into the corresponding 2-digit hex representation. The " +"returned bytes object is therefore twice as long as the length of *data*." +msgstr "" +"Повертає шістнадцяткове представлення двійкових *даних*. Кожен байт *даних* " +"перетворюється у відповідне 2-значне шістнадцяткове представлення. Тому " +"повернутий об’єкт bytes вдвічі довший за довжину *data*." + +msgid "" +"Similar functionality (but returning a text string) is also conveniently " +"accessible using the :meth:`bytes.hex` method." +msgstr "" +"Подібні функції (але повернення текстового рядка) також зручно доступні за " +"допомогою методу :meth:`bytes.hex`." + +msgid "" +"If *sep* is specified, it must be a single character str or bytes object. It " +"will be inserted in the output after every *bytes_per_sep* input bytes. " +"Separator placement is counted from the right end of the output by default, " +"if you wish to count from the left, supply a negative *bytes_per_sep* value." +msgstr "" +"Якщо вказано *sep*, це має бути односимвольний об’єкт str або bytes. Його " +"буде вставлено у вивід після кожного вхідного байта *bytes_per_sep*. " +"Розташування роздільника за замовчуванням відраховується від правого кінця " +"виводу. Якщо ви бажаєте відраховувати зліва, укажіть від’ємне значення " +"*bytes_per_sep*." + +msgid "The *sep* and *bytes_per_sep* parameters were added." +msgstr "Додано параметри *sep* і *bytes_per_sep*." + +msgid "" +"Return the binary data represented by the hexadecimal string *hexstr*. This " +"function is the inverse of :func:`b2a_hex`. *hexstr* must contain an even " +"number of hexadecimal digits (which can be upper or lower case), otherwise " +"an :exc:`Error` exception is raised." +msgstr "" +"Повертає двійкові дані, представлені шістнадцятковим рядком *hexstr*. Ця " +"функція є зворотною до :func:`b2a_hex`. *hexstr* має містити парну кількість " +"шістнадцяткових цифр (які можуть бути великими чи нижніми регістрами), " +"інакше виникає виняткова ситуація :exc:`Error`." + +msgid "" +"Similar functionality (accepting only text string arguments, but more " +"liberal towards whitespace) is also accessible using the :meth:`bytes." +"fromhex` class method." +msgstr "" +"Подібна функціональність (приймає лише текстові рядкові аргументи, але більш " +"вільна щодо пробілів) також доступна за допомогою методу класу :meth:`bytes." +"fromhex`." + +msgid "Exception raised on errors. These are usually programming errors." +msgstr "Виняток, викликаний помилками. Зазвичай це помилки програмування." + +msgid "" +"Exception raised on incomplete data. These are usually not programming " +"errors, but may be handled by reading a little more data and trying again." +msgstr "" +"Винятком є неповні дані. Зазвичай це не помилки програмування, але їх можна " +"вирішити, прочитавши трохи більше даних і повторивши спробу." + +msgid "Module :mod:`base64`" +msgstr "Модуль :mod:`base64`" + +msgid "" +"Support for RFC compliant base64-style encoding in base 16, 32, 64, and 85." +msgstr "" +"Підтримка RFC-сумісного кодування в стилі base64 у базових 16, 32, 64 та 85." + +msgid "Module :mod:`quopri`" +msgstr "Модуль :mod:`quopri`" + +msgid "Support for quoted-printable encoding used in MIME email messages." +msgstr "" +"Підтримка кодування для друку в лапках, що використовується в електронних " +"повідомленнях MIME." + +msgid "module" +msgstr "модуль" + +msgid "base64" +msgstr "база64" diff --git a/library/bisect.po b/library/bisect.po new file mode 100644 index 000000000..9d045c568 --- /dev/null +++ b/library/bisect.po @@ -0,0 +1,311 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:56+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!bisect` --- Array bisection algorithm" +msgstr "" + +msgid "**Source code:** :source:`Lib/bisect.py`" +msgstr "**Вихідний код:** :source:`Lib/bisect.py`" + +msgid "" +"This module provides support for maintaining a list in sorted order without " +"having to sort the list after each insertion. For long lists of items with " +"expensive comparison operations, this can be an improvement over linear " +"searches or frequent resorting." +msgstr "" + +msgid "" +"The module is called :mod:`bisect` because it uses a basic bisection " +"algorithm to do its work. Unlike other bisection tools that search for a " +"specific value, the functions in this module are designed to locate an " +"insertion point. Accordingly, the functions never call an :meth:`~object." +"__eq__` method to determine whether a value has been found. Instead, the " +"functions only call the :meth:`~object.__lt__` method and will return an " +"insertion point between values in an array." +msgstr "" + +msgid "The following functions are provided:" +msgstr "Передбачені такі функції:" + +msgid "" +"Locate the insertion point for *x* in *a* to maintain sorted order. The " +"parameters *lo* and *hi* may be used to specify a subset of the list which " +"should be considered; by default the entire list is used. If *x* is already " +"present in *a*, the insertion point will be before (to the left of) any " +"existing entries. The return value is suitable for use as the first " +"parameter to ``list.insert()`` assuming that *a* is already sorted." +msgstr "" +"Знайдіть точку вставки для *x* у *a*, щоб зберегти відсортований порядок. " +"Параметри *lo* і *hi* можуть використовуватися для визначення підмножини " +"списку, яку слід враховувати; за замовчуванням використовується весь список. " +"Якщо *x* уже присутній у *a*, точка вставки буде перед будь-якими існуючими " +"записами (зліва від них). Повернене значення придатне для використання як " +"перший параметр для ``list.insert()`` за умови, що *a* вже відсортовано." + +msgid "" +"The returned insertion point *ip* partitions the array *a* into two slices " +"such that ``all(elem < x for elem in a[lo : ip])`` is true for the left " +"slice and ``all(elem >= x for elem in a[ip : hi])`` is true for the right " +"slice." +msgstr "" + +msgid "" +"*key* specifies a :term:`key function` of one argument that is used to " +"extract a comparison key from each element in the array. To support " +"searching complex records, the key function is not applied to the *x* value." +msgstr "" +"*key* визначає :term:`key function` одного аргументу, який використовується " +"для отримання ключа порівняння з кожного елемента в масиві. Для підтримки " +"пошуку складних записів функція ключа не застосовується до значення *x*." + +msgid "" +"If *key* is ``None``, the elements are compared directly and no key function " +"is called." +msgstr "" + +msgid "Added the *key* parameter." +msgstr "Додано параметр *key*." + +msgid "" +"Similar to :py:func:`~bisect.bisect_left`, but returns an insertion point " +"which comes after (to the right of) any existing entries of *x* in *a*." +msgstr "" + +msgid "" +"The returned insertion point *ip* partitions the array *a* into two slices " +"such that ``all(elem <= x for elem in a[lo : ip])`` is true for the left " +"slice and ``all(elem > x for elem in a[ip : hi])`` is true for the right " +"slice." +msgstr "" + +msgid "Insert *x* in *a* in sorted order." +msgstr "Вставте *x* у *a* в порядку сортування." + +msgid "" +"This function first runs :py:func:`~bisect.bisect_left` to locate an " +"insertion point. Next, it runs the :meth:`!insert` method on *a* to insert " +"*x* at the appropriate position to maintain sort order." +msgstr "" + +msgid "" +"To support inserting records in a table, the *key* function (if any) is " +"applied to *x* for the search step but not for the insertion step." +msgstr "" +"Щоб підтримувати вставлення записів у таблицю, функція *key* (якщо є) " +"застосовується до *x* для кроку пошуку, але не для кроку вставки." + +msgid "" +"Keep in mind that the *O*\\ (log *n*) search is dominated by the slow *O*\\ " +"(*n*) insertion step." +msgstr "" + +msgid "" +"Similar to :py:func:`~bisect.insort_left`, but inserting *x* in *a* after " +"any existing entries of *x*." +msgstr "" + +msgid "" +"This function first runs :py:func:`~bisect.bisect_right` to locate an " +"insertion point. Next, it runs the :meth:`!insert` method on *a* to insert " +"*x* at the appropriate position to maintain sort order." +msgstr "" + +msgid "Performance Notes" +msgstr "Примітки щодо продуктивності" + +msgid "" +"When writing time sensitive code using *bisect()* and *insort()*, keep these " +"thoughts in mind:" +msgstr "" +"Під час написання чутливого до часу коду за допомогою *bisect()* і " +"*insort()* пам’ятайте про такі думки:" + +msgid "" +"Bisection is effective for searching ranges of values. For locating specific " +"values, dictionaries are more performant." +msgstr "" +"Ділення навпіл ефективне для пошуку діапазонів значень. Для пошуку " +"конкретних значень словники більш ефективні." + +msgid "" +"The *insort()* functions are *O*\\ (*n*) because the logarithmic search step " +"is dominated by the linear time insertion step." +msgstr "" + +msgid "" +"The search functions are stateless and discard key function results after " +"they are used. Consequently, if the search functions are used in a loop, " +"the key function may be called again and again on the same array elements. " +"If the key function isn't fast, consider wrapping it with :py:func:" +"`functools.cache` to avoid duplicate computations. Alternatively, consider " +"searching an array of precomputed keys to locate the insertion point (as " +"shown in the examples section below)." +msgstr "" + +msgid "" +"`Sorted Collections `_ is a " +"high performance module that uses *bisect* to managed sorted collections of " +"data." +msgstr "" + +msgid "" +"The `SortedCollection recipe `_ uses bisect to build a full-featured collection class " +"with straight-forward search methods and support for a key-function. The " +"keys are precomputed to save unnecessary calls to the key function during " +"searches." +msgstr "" +"`Рецепт SortedCollection `_ використовує bisect для створення повнофункціонального " +"класу колекції з прямими методами пошуку та підтримкою функції ключа. Ключі " +"попередньо обчислені, щоб уникнути непотрібних викликів функції клавіш під " +"час пошуку." + +msgid "Searching Sorted Lists" +msgstr "Пошук у відсортованих списках" + +msgid "" +"The above `bisect functions`_ are useful for finding insertion points but " +"can be tricky or awkward to use for common searching tasks. The following " +"five functions show how to transform them into the standard lookups for " +"sorted lists::" +msgstr "" + +msgid "" +"def index(a, x):\n" +" 'Locate the leftmost value exactly equal to x'\n" +" i = bisect_left(a, x)\n" +" if i != len(a) and a[i] == x:\n" +" return i\n" +" raise ValueError\n" +"\n" +"def find_lt(a, x):\n" +" 'Find rightmost value less than x'\n" +" i = bisect_left(a, x)\n" +" if i:\n" +" return a[i-1]\n" +" raise ValueError\n" +"\n" +"def find_le(a, x):\n" +" 'Find rightmost value less than or equal to x'\n" +" i = bisect_right(a, x)\n" +" if i:\n" +" return a[i-1]\n" +" raise ValueError\n" +"\n" +"def find_gt(a, x):\n" +" 'Find leftmost value greater than x'\n" +" i = bisect_right(a, x)\n" +" if i != len(a):\n" +" return a[i]\n" +" raise ValueError\n" +"\n" +"def find_ge(a, x):\n" +" 'Find leftmost item greater than or equal to x'\n" +" i = bisect_left(a, x)\n" +" if i != len(a):\n" +" return a[i]\n" +" raise ValueError" +msgstr "" + +msgid "Examples" +msgstr "Приклади" + +msgid "" +"The :py:func:`~bisect.bisect` function can be useful for numeric table " +"lookups. This example uses :py:func:`~bisect.bisect` to look up a letter " +"grade for an exam score (say) based on a set of ordered numeric breakpoints: " +"90 and up is an 'A', 80 to 89 is a 'B', and so on::" +msgstr "" + +msgid "" +">>> def grade(score, breakpoints=[60, 70, 80, 90], grades='FDCBA'):\n" +"... i = bisect(breakpoints, score)\n" +"... return grades[i]\n" +"...\n" +">>> [grade(score) for score in [33, 99, 77, 70, 89, 90, 100]]\n" +"['F', 'A', 'C', 'C', 'B', 'A', 'A']" +msgstr "" + +msgid "" +"The :py:func:`~bisect.bisect` and :py:func:`~bisect.insort` functions also " +"work with lists of tuples. The *key* argument can serve to extract the " +"field used for ordering records in a table::" +msgstr "" + +msgid "" +">>> from collections import namedtuple\n" +">>> from operator import attrgetter\n" +">>> from bisect import bisect, insort\n" +">>> from pprint import pprint\n" +"\n" +">>> Movie = namedtuple('Movie', ('name', 'released', 'director'))\n" +"\n" +">>> movies = [\n" +"... Movie('Jaws', 1975, 'Spielberg'),\n" +"... Movie('Titanic', 1997, 'Cameron'),\n" +"... Movie('The Birds', 1963, 'Hitchcock'),\n" +"... Movie('Aliens', 1986, 'Cameron')\n" +"... ]\n" +"\n" +">>> # Find the first movie released after 1960\n" +">>> by_year = attrgetter('released')\n" +">>> movies.sort(key=by_year)\n" +">>> movies[bisect(movies, 1960, key=by_year)]\n" +"Movie(name='The Birds', released=1963, director='Hitchcock')\n" +"\n" +">>> # Insert a movie while maintaining sort order\n" +">>> romance = Movie('Love Story', 1970, 'Hiller')\n" +">>> insort(movies, romance, key=by_year)\n" +">>> pprint(movies)\n" +"[Movie(name='The Birds', released=1963, director='Hitchcock'),\n" +" Movie(name='Love Story', released=1970, director='Hiller'),\n" +" Movie(name='Jaws', released=1975, director='Spielberg'),\n" +" Movie(name='Aliens', released=1986, director='Cameron'),\n" +" Movie(name='Titanic', released=1997, director='Cameron')]" +msgstr "" + +msgid "" +"If the key function is expensive, it is possible to avoid repeated function " +"calls by searching a list of precomputed keys to find the index of a record::" +msgstr "" +"Якщо функція ключа є дорогою, можна уникнути повторних викликів функції " +"шляхом пошуку списку попередньо обчислених ключів, щоб знайти індекс запису::" + +msgid "" +">>> data = [('red', 5), ('blue', 1), ('yellow', 8), ('black', 0)]\n" +">>> data.sort(key=lambda r: r[1]) # Or use operator.itemgetter(1).\n" +">>> keys = [r[1] for r in data] # Precompute a list of keys.\n" +">>> data[bisect_left(keys, 0)]\n" +"('black', 0)\n" +">>> data[bisect_left(keys, 1)]\n" +"('blue', 1)\n" +">>> data[bisect_left(keys, 5)]\n" +"('red', 5)\n" +">>> data[bisect_left(keys, 8)]\n" +"('yellow', 8)" +msgstr "" diff --git a/library/builtins.po b/library/builtins.po new file mode 100644 index 000000000..7f8910edc --- /dev/null +++ b/library/builtins.po @@ -0,0 +1,92 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:56+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!builtins` --- Built-in objects" +msgstr "" + +msgid "" +"This module provides direct access to all 'built-in' identifiers of Python; " +"for example, ``builtins.open`` is the full name for the built-in function :" +"func:`open`." +msgstr "" + +msgid "" +"This module is not normally accessed explicitly by most applications, but " +"can be useful in modules that provide objects with the same name as a built-" +"in value, but in which the built-in of that name is also needed. For " +"example, in a module that wants to implement an :func:`open` function that " +"wraps the built-in :func:`open`, this module can be used directly::" +msgstr "" +"Більшість програм зазвичай не мають явного доступу до цього модуля, але він " +"може бути корисним у модулях, які надають об’єкти з тим же іменем, що й " +"вбудоване значення, але в яких також необхідне вбудоване ім’я. Наприклад, у " +"модулі, який хоче реалізувати функцію :func:`open`, яка обгортає вбудовану :" +"func:`open`, цей модуль можна використовувати безпосередньо:" + +msgid "" +"import builtins\n" +"\n" +"def open(path):\n" +" f = builtins.open(path, 'r')\n" +" return UpperCaser(f)\n" +"\n" +"class UpperCaser:\n" +" '''Wrapper around a file that converts output to uppercase.'''\n" +"\n" +" def __init__(self, f):\n" +" self._f = f\n" +"\n" +" def read(self, count=-1):\n" +" return self._f.read(count).upper()\n" +"\n" +" # ..." +msgstr "" + +msgid "" +"As an implementation detail, most modules have the name ``__builtins__`` " +"made available as part of their globals. The value of ``__builtins__`` is " +"normally either this module or the value of this module's :attr:`~object." +"__dict__` attribute. Since this is an implementation detail, it may not be " +"used by alternate implementations of Python." +msgstr "" +"Як деталь реалізації, більшість модулів мають назву ``__builtins__``, " +"доступну як частину їхніх глобальних елементів. Значення ``__builtins__`` " +"зазвичай є або цим модулем, або значенням атрибута :attr:`~object.__dict__` " +"цього модуля. Оскільки це деталь реалізації, вона не може використовуватися " +"альтернативними реалізаціями Python." + +msgid ":ref:`built-in-consts`" +msgstr "" + +msgid ":ref:`bltin-exceptions`" +msgstr "" + +msgid ":ref:`built-in-funcs`" +msgstr "" + +msgid ":ref:`bltin-types`" +msgstr "" diff --git a/library/bz2.po b/library/bz2.po new file mode 100644 index 000000000..852f53517 --- /dev/null +++ b/library/bz2.po @@ -0,0 +1,457 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:56+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!bz2` --- Support for :program:`bzip2` compression" +msgstr "" + +msgid "**Source code:** :source:`Lib/bz2.py`" +msgstr "**Вихідний код:** :source:`Lib/bz2.py`" + +msgid "" +"This module provides a comprehensive interface for compressing and " +"decompressing data using the bzip2 compression algorithm." +msgstr "" +"Цей модуль забезпечує комплексний інтерфейс для стиснення та розпакування " +"даних за допомогою алгоритму стиснення bzip2." + +msgid "The :mod:`bz2` module contains:" +msgstr "Модуль :mod:`bz2` містить:" + +msgid "" +"The :func:`.open` function and :class:`BZ2File` class for reading and " +"writing compressed files." +msgstr "" +"Функція :func:`.open` і клас :class:`BZ2File` для читання та запису " +"стиснених файлів." + +msgid "" +"The :class:`BZ2Compressor` and :class:`BZ2Decompressor` classes for " +"incremental (de)compression." +msgstr "" +"Класи :class:`BZ2Compressor` і :class:`BZ2Decompressor` для поступового " +"(де)стиснення." + +msgid "" +"The :func:`compress` and :func:`decompress` functions for one-shot " +"(de)compression." +msgstr "" +"Функції :func:`compress` і :func:`decompress` для одноразового (де)стиснення." + +msgid "(De)compression of files" +msgstr "(Де)компресія файлів" + +msgid "" +"Open a bzip2-compressed file in binary or text mode, returning a :term:`file " +"object`." +msgstr "" +"Відкрийте файл, стиснутий за допомогою bzip2, у двійковому або текстовому " +"режимі, повертаючи :term:`file object`." + +msgid "" +"As with the constructor for :class:`BZ2File`, the *filename* argument can be " +"an actual filename (a :class:`str` or :class:`bytes` object), or an existing " +"file object to read from or write to." +msgstr "" +"Як і у випадку з конструктором для :class:`BZ2File`, аргумент *filename* " +"може бути фактичним ім’ям файлу (об’єкт :class:`str` або :class:`bytes`) або " +"наявним файловим об’єктом для читання чи запису до." + +msgid "" +"The *mode* argument can be any of ``'r'``, ``'rb'``, ``'w'``, ``'wb'``, " +"``'x'``, ``'xb'``, ``'a'`` or ``'ab'`` for binary mode, or ``'rt'``, " +"``'wt'``, ``'xt'``, or ``'at'`` for text mode. The default is ``'rb'``." +msgstr "" +"Аргумент *mode* може бути будь-яким із ``'r'``, ``'rb'``, ``'w'``, ``'wb'``, " +"``'x'``, ``'xb'``, ``'a'`` або ``'ab'`` для бінарного режиму або ``'rt'``, " +"``'wt'``, ``'xt'`` або ``'at'`` для текстового режиму. Типовим є ``'rb'``." + +msgid "" +"The *compresslevel* argument is an integer from 1 to 9, as for the :class:" +"`BZ2File` constructor." +msgstr "" +"Аргумент *compresslevel* є цілим числом від 1 до 9, як і для конструктора :" +"class:`BZ2File`." + +msgid "" +"For binary mode, this function is equivalent to the :class:`BZ2File` " +"constructor: ``BZ2File(filename, mode, compresslevel=compresslevel)``. In " +"this case, the *encoding*, *errors* and *newline* arguments must not be " +"provided." +msgstr "" +"Для двійкового режиму ця функція еквівалентна конструктору :class:`BZ2File`: " +"``BZ2File(filename, mode, compresslevel=compresslevel)``. У цьому випадку " +"аргументи *encoding*, *errors* і *newline* не повинні надаватися." + +msgid "" +"For text mode, a :class:`BZ2File` object is created, and wrapped in an :" +"class:`io.TextIOWrapper` instance with the specified encoding, error " +"handling behavior, and line ending(s)." +msgstr "" +"Для текстового режиму створюється об’єкт :class:`BZ2File`, який загортається " +"в екземпляр :class:`io.TextIOWrapper` із вказаним кодуванням, поведінкою " +"обробки помилок і закінченнями рядків." + +msgid "The ``'x'`` (exclusive creation) mode was added." +msgstr "Додано режим ``'x`` (ексклюзивне створення)." + +msgid "Accepts a :term:`path-like object`." +msgstr "Приймає :term:`path-like object`." + +msgid "Open a bzip2-compressed file in binary mode." +msgstr "Відкрийте файл, стиснутий за допомогою bzip2, у двійковому режимі." + +msgid "" +"If *filename* is a :class:`str` or :class:`bytes` object, open the named " +"file directly. Otherwise, *filename* should be a :term:`file object`, which " +"will be used to read or write the compressed data." +msgstr "" +"Якщо *filename* є об’єктом :class:`str` або :class:`bytes`, відкрийте " +"названий файл безпосередньо. В іншому випадку *filename* має бути :term:" +"`file object`, який використовуватиметься для читання або запису стиснутих " +"даних." + +msgid "" +"The *mode* argument can be either ``'r'`` for reading (default), ``'w'`` for " +"overwriting, ``'x'`` for exclusive creation, or ``'a'`` for appending. These " +"can equivalently be given as ``'rb'``, ``'wb'``, ``'xb'`` and ``'ab'`` " +"respectively." +msgstr "" +"Аргументом *mode* може бути ``'r'`` для читання (за замовчуванням), ``'w'`` " +"для перезапису, ``'x'`` для ексклюзивного створення або ``'a'`` для " +"додавання. Їх можна еквівалентно вказати як ``'rb'``, ``'wb'``, ``'xb'`` і " +"``'ab'`` відповідно." + +msgid "" +"If *filename* is a file object (rather than an actual file name), a mode of " +"``'w'`` does not truncate the file, and is instead equivalent to ``'a'``." +msgstr "" +"Якщо *filename* є об’єктом файлу (а не справжнім ім’ям файлу), режим ``'w'`` " +"не скорочує файл, а замість цього еквівалентний ``'a'``." + +msgid "" +"If *mode* is ``'w'`` or ``'a'``, *compresslevel* can be an integer between " +"``1`` and ``9`` specifying the level of compression: ``1`` produces the " +"least compression, and ``9`` (default) produces the most compression." +msgstr "" +"Якщо *mode* має значення ``'w'`` або ``'a'``, *compresslevel* може бути " +"цілим числом від ``1`` до ``9``, що визначає рівень стиснення: ``1`` створює " +"найменше стиснення, а ``9`` (за замовчуванням) створює найбільше стиснення." + +msgid "" +"If *mode* is ``'r'``, the input file may be the concatenation of multiple " +"compressed streams." +msgstr "" +"Якщо *mode* має значення ``'r'``, вхідний файл може бути конкатенацією " +"кількох стиснутих потоків." + +msgid "" +":class:`BZ2File` provides all of the members specified by the :class:`io." +"BufferedIOBase`, except for :meth:`~io.BufferedIOBase.detach` and :meth:`~io." +"IOBase.truncate`. Iteration and the :keyword:`with` statement are supported." +msgstr "" + +msgid ":class:`BZ2File` also provides the following methods and attributes:" +msgstr "" + +msgid "" +"Return buffered data without advancing the file position. At least one byte " +"of data will be returned (unless at EOF). The exact number of bytes returned " +"is unspecified." +msgstr "" +"Повернути буферизовані дані без просування позиції файлу. Буде повернено " +"принаймні один байт даних (якщо не EOF). Точна кількість повернутих байтів " +"не вказана." + +msgid "" +"While calling :meth:`peek` does not change the file position of the :class:" +"`BZ2File`, it may change the position of the underlying file object (e.g. if " +"the :class:`BZ2File` was constructed by passing a file object for " +"*filename*)." +msgstr "" +"Хоча виклик :meth:`peek` не змінює позицію файлу :class:`BZ2File`, він може " +"змінити позицію основного файлового об’єкта (наприклад, якщо :class:" +"`BZ2File` було створено шляхом передачі файлового об’єкта для *ім'я файлу*)." + +msgid "Return the file descriptor for the underlying file." +msgstr "" + +msgid "Return whether the file was opened for reading." +msgstr "" + +msgid "Return whether the file supports seeking." +msgstr "" + +msgid "Return whether the file was opened for writing." +msgstr "" + +msgid "" +"Read up to *size* uncompressed bytes, while trying to avoid making multiple " +"reads from the underlying stream. Reads up to a buffer's worth of data if " +"size is negative." +msgstr "" + +msgid "Returns ``b''`` if the file is at EOF." +msgstr "" + +msgid "Read bytes into *b*." +msgstr "" + +msgid "Returns the number of bytes read (0 for EOF)." +msgstr "" + +msgid "``'rb'`` for reading and ``'wb'`` for writing." +msgstr "" + +msgid "" +"The bzip2 file name. Equivalent to the :attr:`~io.FileIO.name` attribute of " +"the underlying :term:`file object`." +msgstr "" + +msgid "Support for the :keyword:`with` statement was added." +msgstr "Додано підтримку оператора :keyword:`with`." + +msgid "" +"Support was added for *filename* being a :term:`file object` instead of an " +"actual filename." +msgstr "" +"Було додано підтримку для *filename* як :term:`file object` замість " +"фактичної назви файлу." + +msgid "" +"The ``'a'`` (append) mode was added, along with support for reading multi-" +"stream files." +msgstr "" +"Було додано режим ``'a'`` (додавання) разом із підтримкою читання " +"багатопотокових файлів." + +msgid "" +"The :meth:`~io.BufferedIOBase.read` method now accepts an argument of " +"``None``." +msgstr "Метод :meth:`~io.BufferedIOBase.read` тепер приймає аргумент ``None``." + +msgid "" +"The *buffering* parameter has been removed. It was ignored and deprecated " +"since Python 3.0. Pass an open file object to control how the file is opened." +msgstr "" +"Параметр *buffering* видалено. Він був проігнорований і застарілим, " +"починаючи з Python 3.0. Передайте відкритий файловий об’єкт, щоб " +"контролювати, як відкривається файл." + +msgid "The *compresslevel* parameter became keyword-only." +msgstr "Параметр *compresslevel* став лише ключовим словом." + +msgid "" +"This class is thread unsafe in the face of multiple simultaneous readers or " +"writers, just like its equivalent classes in :mod:`gzip` and :mod:`lzma` " +"have always been." +msgstr "" +"Цей клас є потоково небезпечним перед обличчям кількох одночасних читачів " +"або записувачів, як завжди були його еквівалентні класи в :mod:`gzip` і :mod:" +"`lzma`." + +msgid "Incremental (de)compression" +msgstr "Поступове (роз)стиснення" + +msgid "" +"Create a new compressor object. This object may be used to compress data " +"incrementally. For one-shot compression, use the :func:`compress` function " +"instead." +msgstr "" +"Створіть новий об’єкт компресора. Цей об’єкт можна використовувати для " +"поступового стиснення даних. Для одноразового стиснення замість цього " +"використовуйте функцію :func:`compress`." + +msgid "" +"*compresslevel*, if given, must be an integer between ``1`` and ``9``. The " +"default is ``9``." +msgstr "" +"*compresslevel*, якщо задано, має бути цілим числом від ``1`` до ``9``. " +"Типовим значенням є ``9``." + +msgid "" +"Provide data to the compressor object. Returns a chunk of compressed data if " +"possible, or an empty byte string otherwise." +msgstr "" +"Надайте дані об’єкту компресора. Повертає фрагмент стиснутих даних, якщо це " +"можливо, або порожній рядок байтів в іншому випадку." + +msgid "" +"When you have finished providing data to the compressor, call the :meth:" +"`flush` method to finish the compression process." +msgstr "" +"Коли ви закінчите надсилати дані компресору, викличте метод :meth:`flush`, " +"щоб завершити процес стиснення." + +msgid "" +"Finish the compression process. Returns the compressed data left in internal " +"buffers." +msgstr "" +"Завершіть процес стиснення. Повертає стислі дані, що залишилися у внутрішніх " +"буферах." + +msgid "" +"The compressor object may not be used after this method has been called." +msgstr "Об’єкт компресора не можна використовувати після виклику цього методу." + +msgid "" +"Create a new decompressor object. This object may be used to decompress data " +"incrementally. For one-shot compression, use the :func:`decompress` function " +"instead." +msgstr "" +"Створіть новий об’єкт декомпресора. Цей об’єкт можна використовувати для " +"поступового розпакування даних. Для одноразового стиснення замість цього " +"використовуйте функцію :func:`decompress`." + +msgid "" +"This class does not transparently handle inputs containing multiple " +"compressed streams, unlike :func:`decompress` and :class:`BZ2File`. If you " +"need to decompress a multi-stream input with :class:`BZ2Decompressor`, you " +"must use a new decompressor for each stream." +msgstr "" +"Цей клас не обробляє прозоро вхідні дані, що містять кілька стиснутих " +"потоків, на відміну від :func:`decompress` і :class:`BZ2File`. Якщо вам " +"потрібно розпакувати багатопотоковий вхід за допомогою :class:" +"`BZ2Decompressor`, ви повинні використовувати новий розпаковувач для кожного " +"потоку." + +msgid "" +"Decompress *data* (a :term:`bytes-like object`), returning uncompressed data " +"as bytes. Some of *data* may be buffered internally, for use in later calls " +"to :meth:`decompress`. The returned data should be concatenated with the " +"output of any previous calls to :meth:`decompress`." +msgstr "" +"Розпакуйте *дані* (:term:`bytes-like object`), повертаючи нестиснуті дані у " +"вигляді байтів. Деякі з *даних* можуть бути збережені у внутрішньому буфері " +"для використання в подальших викликах :meth:`decompress`. Повернуті дані " +"мають бути об’єднані з результатами будь-яких попередніх викликів :meth:" +"`decompress`." + +msgid "" +"If *max_length* is nonnegative, returns at most *max_length* bytes of " +"decompressed data. If this limit is reached and further output can be " +"produced, the :attr:`~.needs_input` attribute will be set to ``False``. In " +"this case, the next call to :meth:`~.decompress` may provide *data* as " +"``b''`` to obtain more of the output." +msgstr "" +"Якщо *max_length* є невід’ємним, повертає щонайбільше *max_length* байтів " +"розпакованих даних. Якщо цей ліміт буде досягнуто, і буде створено подальший " +"вихід, атрибут :attr:`~.needs_input` буде встановлено на ``False``. У цьому " +"випадку наступний виклик :meth:`~.decompress` може надати *data* як ``b''``, " +"щоб отримати більше вихідних даних." + +msgid "" +"If all of the input data was decompressed and returned (either because this " +"was less than *max_length* bytes, or because *max_length* was negative), " +"the :attr:`~.needs_input` attribute will be set to ``True``." +msgstr "" +"Якщо всі вхідні дані було розпаковано та повернуто (або через те, що вони " +"були меншими за *max_length* байтів, або через те, що *max_length* було " +"від’ємним), для атрибута :attr:`~.needs_input` буде встановлено значення " +"``True`` ." + +msgid "" +"Attempting to decompress data after the end of stream is reached raises an :" +"exc:`EOFError`. Any data found after the end of the stream is ignored and " +"saved in the :attr:`~.unused_data` attribute." +msgstr "" + +msgid "Added the *max_length* parameter." +msgstr "Додано параметр *max_length*." + +msgid "``True`` if the end-of-stream marker has been reached." +msgstr "``True``, якщо досягнуто маркера кінця потоку." + +msgid "Data found after the end of the compressed stream." +msgstr "Дані знайдено після закінчення стисненого потоку." + +msgid "" +"If this attribute is accessed before the end of the stream has been reached, " +"its value will be ``b''``." +msgstr "" +"Якщо цей атрибут доступний до досягнення кінця потоку, його значення буде " +"``b''``." + +msgid "" +"``False`` if the :meth:`.decompress` method can provide more decompressed " +"data before requiring new uncompressed input." +msgstr "" +"``False``, якщо метод :meth:`.decompress` може надати більше розпакованих " +"даних перед запитом нового нестисненого введення." + +msgid "One-shot (de)compression" +msgstr "Одноразова (де)компресія" + +msgid "Compress *data*, a :term:`bytes-like object `." +msgstr "Стиснути *data*, :term:`байт-подібний об’єкт `." + +msgid "For incremental compression, use a :class:`BZ2Compressor` instead." +msgstr "" +"Для інкрементного стиснення замість цього використовуйте :class:" +"`BZ2Compressor`." + +msgid "Decompress *data*, a :term:`bytes-like object `." +msgstr "Розархівуйте *data*, :term:`байт-подібний об’єкт `." + +msgid "" +"If *data* is the concatenation of multiple compressed streams, decompress " +"all of the streams." +msgstr "" +"Якщо *data* є конкатенацією кількох стиснутих потоків, розпакуйте всі потоки." + +msgid "For incremental decompression, use a :class:`BZ2Decompressor` instead." +msgstr "" +"Для інкрементної декомпресії замість цього використовуйте :class:" +"`BZ2Decompressor`." + +msgid "Support for multi-stream inputs was added." +msgstr "Додано підтримку багатопотокових входів." + +msgid "Examples of usage" +msgstr "Приклади вживання" + +msgid "Below are some examples of typical usage of the :mod:`bz2` module." +msgstr "" +"Нижче наведено декілька прикладів типового використання модуля :mod:`bz2`." + +msgid "" +"Using :func:`compress` and :func:`decompress` to demonstrate round-trip " +"compression:" +msgstr "" +"Використання :func:`compress` і :func:`decompress` для демонстрації " +"двостороннього стиснення:" + +msgid "Using :class:`BZ2Compressor` for incremental compression:" +msgstr "Використання :class:`BZ2Compressor` для поступового стиснення:" + +msgid "" +"The example above uses a very \"nonrandom\" stream of data (a stream of " +"``b\"z\"`` chunks). Random data tends to compress poorly, while ordered, " +"repetitive data usually yields a high compression ratio." +msgstr "" + +msgid "Writing and reading a bzip2-compressed file in binary mode:" +msgstr "Запис і читання файлу, стисненого bzip2, у двійковому режимі:" diff --git a/library/calendar.po b/library/calendar.po new file mode 100644 index 000000000..5fab2964e --- /dev/null +++ b/library/calendar.po @@ -0,0 +1,736 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2023 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:56+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2023\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!calendar` --- General calendar-related functions" +msgstr "" + +msgid "**Source code:** :source:`Lib/calendar.py`" +msgstr "**Вихідний код:** :source:`Lib/calendar.py`" + +msgid "" +"This module allows you to output calendars like the Unix :program:`cal` " +"program, and provides additional useful functions related to the calendar. " +"By default, these calendars have Monday as the first day of the week, and " +"Sunday as the last (the European convention). Use :func:`setfirstweekday` to " +"set the first day of the week to Sunday (6) or to any other weekday. " +"Parameters that specify dates are given as integers. For related " +"functionality, see also the :mod:`datetime` and :mod:`time` modules." +msgstr "" +"Цей модуль дозволяє виводити календарі, як програма Unix :program:`cal`, і " +"надає додаткові корисні функції, пов’язані з календарем. За замовчуванням у " +"цих календарях першим днем тижня є понеділок, а останнім — неділя " +"(європейська конвенція). Використовуйте :func:`setfirstweekday`, щоб " +"установити першим днем тижня неділю (6) або будь-який інший день тижня. " +"Параметри, що визначають дати, задаються як цілі числа. Для пов’язаних " +"функцій перегляньте також модулі :mod:`datetime` і :mod:`time`." + +msgid "" +"The functions and classes defined in this module use an idealized calendar, " +"the current Gregorian calendar extended indefinitely in both directions. " +"This matches the definition of the \"proleptic Gregorian\" calendar in " +"Dershowitz and Reingold's book \"Calendrical Calculations\", where it's the " +"base calendar for all computations. Zero and negative years are interpreted " +"as prescribed by the ISO 8601 standard. Year 0 is 1 BC, year -1 is 2 BC, " +"and so on." +msgstr "" +"Функції та класи, визначені в цьому модулі, використовують ідеалізований " +"календар, поточний григоріанський календар, розширений на невизначений " +"термін в обох напрямках. Це відповідає визначенню \"пролептичного " +"григоріанського\" календаря в книзі Дершовіца та Рейнгольда \"Календарні " +"обчислення\", де це базовий календар для всіх обчислень. Нульові та " +"негативні роки інтерпретуються відповідно до стандарту ISO 8601. Рік 0 — це " +"1 рік до нашої ери, рік -1 — це 2 рік до нашої ери і так далі." + +msgid "" +"Creates a :class:`Calendar` object. *firstweekday* is an integer specifying " +"the first day of the week. :const:`MONDAY` is ``0`` (the default), :const:" +"`SUNDAY` is ``6``." +msgstr "" +"Створює об’єкт :class:`Calendar`. *firstweekday* — це ціле число, що " +"визначає перший день тижня. :const:`MONDAY` — це ``0`` (за замовчуванням), :" +"const:`SUNDAY` — ``6``." + +msgid "" +"A :class:`Calendar` object provides several methods that can be used for " +"preparing the calendar data for formatting. This class doesn't do any " +"formatting itself. This is the job of subclasses." +msgstr "" +"Об’єкт :class:`Calendar` надає кілька методів, які можна використовувати для " +"підготовки даних календаря до форматування. Цей клас сам не виконує " +"форматування. Це робота підкласів." + +msgid ":class:`Calendar` instances have the following methods and attributes:" +msgstr "" + +msgid "The first weekday as an integer (0--6)." +msgstr "" + +msgid "" +"This property can also be set and read using :meth:`~Calendar." +"setfirstweekday` and :meth:`~Calendar.getfirstweekday` respectively." +msgstr "" + +msgid "Return an :class:`int` for the current first weekday (0--6)." +msgstr "" + +msgid "Identical to reading the :attr:`~Calendar.firstweekday` property." +msgstr "" + +msgid "" +"Set the first weekday to *firstweekday*, passed as an :class:`int` (0--6)" +msgstr "" + +msgid "Identical to setting the :attr:`~Calendar.firstweekday` property." +msgstr "" + +msgid "" +"Return an iterator for the week day numbers that will be used for one week. " +"The first value from the iterator will be the same as the value of the :attr:" +"`~Calendar.firstweekday` property." +msgstr "" + +msgid "" +"Return an iterator for the month *month* (1--12) in the year *year*. This " +"iterator will return all days (as :class:`datetime.date` objects) for the " +"month and all days before the start of the month or after the end of the " +"month that are required to get a complete week." +msgstr "" +"Повертає ітератор для місяця *month* (1--12) у році *year*. Цей ітератор " +"поверне всі дні (як об’єкти :class:`datetime.date`) за місяць і всі дні до " +"початку або після кінця місяця, необхідні для отримання повного тижня." + +msgid "" +"Return an iterator for the month *month* in the year *year* similar to :meth:" +"`itermonthdates`, but not restricted by the :class:`datetime.date` range. " +"Days returned will simply be day of the month numbers. For the days outside " +"of the specified month, the day number is ``0``." +msgstr "" +"Повертає ітератор для місяця *місяць* у році *рік*, подібний до :meth:" +"`itermonthdates`, але не обмежений діапазоном :class:`datetime.date`. " +"Повернені дні будуть просто номерами днів місяця. Для днів поза вказаним " +"місяцем номер дня дорівнює ``0``." + +msgid "" +"Return an iterator for the month *month* in the year *year* similar to :meth:" +"`itermonthdates`, but not restricted by the :class:`datetime.date` range. " +"Days returned will be tuples consisting of a day of the month number and a " +"week day number." +msgstr "" +"Повертає ітератор для місяця *місяць* у році *рік*, подібний до :meth:" +"`itermonthdates`, але не обмежений діапазоном :class:`datetime.date`. " +"Повернуті дні будуть кортежами, що складаються з номера дня місяця та номера " +"дня тижня." + +msgid "" +"Return an iterator for the month *month* in the year *year* similar to :meth:" +"`itermonthdates`, but not restricted by the :class:`datetime.date` range. " +"Days returned will be tuples consisting of a year, a month and a day of the " +"month numbers." +msgstr "" +"Повертає ітератор для місяця *місяць* у році *рік*, подібний до :meth:" +"`itermonthdates`, але не обмежений діапазоном :class:`datetime.date`. " +"Повернуті дні будуть кортежами, що складаються з номерів року, місяця та дня " +"місяця." + +msgid "" +"Return an iterator for the month *month* in the year *year* similar to :meth:" +"`itermonthdates`, but not restricted by the :class:`datetime.date` range. " +"Days returned will be tuples consisting of a year, a month, a day of the " +"month, and a day of the week numbers." +msgstr "" +"Повертає ітератор для місяця *місяць* у році *рік*, подібний до :meth:" +"`itermonthdates`, але не обмежений діапазоном :class:`datetime.date`. " +"Повернуті дні будуть кортежами, що складаються з номерів року, місяця, дня " +"місяця та дня тижня." + +msgid "" +"Return a list of the weeks in the month *month* of the *year* as full " +"weeks. Weeks are lists of seven :class:`datetime.date` objects." +msgstr "" +"Повертає список тижнів у місяці *місяць* *року* як повні тижні. Тижні — це " +"списки із семи об’єктів :class:`datetime.date`." + +msgid "" +"Return a list of the weeks in the month *month* of the *year* as full " +"weeks. Weeks are lists of seven tuples of day numbers and weekday numbers." +msgstr "" +"Повертає список тижнів у місяці *місяць* *року* як повні тижні. Тижні — це " +"списки із семи кортежів номерів днів і днів тижня." + +msgid "" +"Return a list of the weeks in the month *month* of the *year* as full " +"weeks. Weeks are lists of seven day numbers." +msgstr "" +"Повертає список тижнів у місяці *місяць* *року* як повні тижні. Тижні — це " +"списки із семи днів." + +msgid "" +"Return the data for the specified year ready for formatting. The return " +"value is a list of month rows. Each month row contains up to *width* months " +"(defaulting to 3). Each month contains between 4 and 6 weeks and each week " +"contains 1--7 days. Days are :class:`datetime.date` objects." +msgstr "" +"Повернути готові до форматування дані за вказаний рік. Поверненим значенням " +"є список рядків місяця. Кожен рядок місяця містить до *width* місяців (за " +"замовчуванням до 3). Кожен місяць містить від 4 до 6 тижнів, а кожен тиждень " +"містить 1--7 днів. Дні є об’єктами :class:`datetime.date`." + +msgid "" +"Return the data for the specified year ready for formatting (similar to :" +"meth:`yeardatescalendar`). Entries in the week lists are tuples of day " +"numbers and weekday numbers. Day numbers outside this month are zero." +msgstr "" +"Повертає дані за вказаний рік, готові до форматування (подібно до :meth:" +"`yeardatescalendar`). Записи в тижневих списках є кортежами номерів днів і " +"днів тижня. Номери днів поза цим місяцем дорівнюють нулю." + +msgid "" +"Return the data for the specified year ready for formatting (similar to :" +"meth:`yeardatescalendar`). Entries in the week lists are day numbers. Day " +"numbers outside this month are zero." +msgstr "" +"Повертає дані за вказаний рік, готові до форматування (подібно до :meth:" +"`yeardatescalendar`). Записи в тижневих списках є номерами днів. Номери днів " +"поза цим місяцем дорівнюють нулю." + +msgid "This class can be used to generate plain text calendars." +msgstr "" +"Цей клас можна використовувати для створення простих текстових календарів." + +msgid ":class:`TextCalendar` instances have the following methods:" +msgstr "Екземпляри :class:`TextCalendar` мають такі методи:" + +msgid "" +"Return a string representing a single day formatted with the given *width*. " +"If *theday* is ``0``, return a string of spaces of the specified width, " +"representing an empty day. The *weekday* parameter is unused." +msgstr "" + +msgid "" +"Return a single week in a string with no newline. If *w* is provided, it " +"specifies the width of the date columns, which are centered. Depends on the " +"first weekday as specified in the constructor or set by the :meth:" +"`setfirstweekday` method." +msgstr "" + +msgid "" +"Return a string representing the name of a single weekday formatted to the " +"specified *width*. The *weekday* parameter is an integer representing the " +"day of the week, where ``0`` is Monday and ``6`` is Sunday." +msgstr "" + +msgid "" +"Return a string containing the header row of weekday names, formatted with " +"the given *width* for each column. The names depend on the locale settings " +"and are padded to the specified width." +msgstr "" + +msgid "" +"Return a month's calendar in a multi-line string. If *w* is provided, it " +"specifies the width of the date columns, which are centered. If *l* is " +"given, it specifies the number of lines that each week will use. Depends on " +"the first weekday as specified in the constructor or set by the :meth:" +"`setfirstweekday` method." +msgstr "" +"Повертає місячний календар у багаторядковому рядку. Якщо вказано *w*, воно " +"визначає ширину стовпців дати, які розташовані по центру. Якщо задано *l*, " +"це визначає кількість рядків, які використовуватимуться кожного тижня. " +"Залежить від першого дня тижня, як зазначено в конструкторі або встановлено " +"методом :meth:`setfirstweekday`." + +msgid "" +"Return a string representing the month's name centered within the specified " +"*width*. If *withyear* is ``True``, include the year in the output. The " +"*theyear* and *themonth* parameters specify the year and month for the name " +"to be formatted respectively." +msgstr "" + +msgid "Print a month's calendar as returned by :meth:`formatmonth`." +msgstr "Надрукувати місячний календар, який повертає :meth:`formatmonth`." + +msgid "" +"Return a *m*-column calendar for an entire year as a multi-line string. " +"Optional parameters *w*, *l*, and *c* are for date column width, lines per " +"week, and number of spaces between month columns, respectively. Depends on " +"the first weekday as specified in the constructor or set by the :meth:" +"`setfirstweekday` method. The earliest year for which a calendar can be " +"generated is platform-dependent." +msgstr "" +"Повертає календар зі стовпцями *m* для цілого року як багаторядковий рядок. " +"Додаткові параметри *w*, *l* і *c* призначені для ширини стовпця дати, " +"рядків на тиждень і кількості пробілів між стовпцями місяця відповідно. " +"Залежить від першого дня тижня, як зазначено в конструкторі або встановлено " +"методом :meth:`setfirstweekday`. Найперший рік, для якого можна створити " +"календар, залежить від платформи." + +msgid "" +"Print the calendar for an entire year as returned by :meth:`formatyear`." +msgstr "Роздрукувати календар на цілий рік, який повертає :meth:`formatyear`." + +msgid "This class can be used to generate HTML calendars." +msgstr "Цей клас можна використовувати для створення HTML-календарів." + +msgid ":class:`!HTMLCalendar` instances have the following methods:" +msgstr "Екземпляри :class:`!HTMLCalendar` мають такі методи:" + +msgid "" +"Return a month's calendar as an HTML table. If *withyear* is true the year " +"will be included in the header, otherwise just the month name will be used." +msgstr "" +"Повертає місячний календар як таблицю HTML. Якщо *withyear* має значення " +"true, рік буде включено в заголовок, інакше використовуватиметься лише назва " +"місяця." + +msgid "" +"Return a year's calendar as an HTML table. *width* (defaulting to 3) " +"specifies the number of months per row." +msgstr "" +"Повертає річний календар як таблицю HTML. *width* (за замовчуванням 3) " +"визначає кількість місяців у рядку." + +msgid "" +"Return a year's calendar as a complete HTML page. *width* (defaulting to 3) " +"specifies the number of months per row. *css* is the name for the cascading " +"style sheet to be used. :const:`None` can be passed if no style sheet should " +"be used. *encoding* specifies the encoding to be used for the output " +"(defaulting to the system default encoding)." +msgstr "" +"Повертає річний календар як повну сторінку HTML. *width* (за замовчуванням " +"3) визначає кількість місяців у рядку. *css* — назва каскадної таблиці " +"стилів, яка буде використовуватися. :const:`None` можна передати, якщо не " +"потрібно використовувати таблицю стилів. *encoding* вказує кодування, яке " +"буде використовуватися для виведення (за замовчуванням використовується " +"стандартне кодування системи)." + +msgid "" +"Return a month name as an HTML table row. If *withyear* is true the year " +"will be included in the row, otherwise just the month name will be used." +msgstr "" + +msgid "" +":class:`!HTMLCalendar` has the following attributes you can override to " +"customize the CSS classes used by the calendar:" +msgstr "" +":class:`!HTMLCalendar` має такі атрибути, які ви можете замінити, щоб " +"налаштувати класи CSS, які використовує календар:" + +msgid "" +"A list of CSS classes used for each weekday. The default class list is::" +msgstr "" +"Список класів CSS, які використовуються для кожного дня тижня. Типовий " +"список класів:" + +msgid "" +"cssclasses = [\"mon\", \"tue\", \"wed\", \"thu\", \"fri\", \"sat\", \"sun\"]" +msgstr "" + +msgid "more styles can be added for each day::" +msgstr "на кожен день можна додати більше стилів::" + +msgid "" +"cssclasses = [\"mon text-bold\", \"tue\", \"wed\", \"thu\", \"fri\", " +"\"sat\", \"sun red\"]" +msgstr "" + +msgid "Note that the length of this list must be seven items." +msgstr "Зауважте, що довжина цього списку має складатися із семи пунктів." + +msgid "The CSS class for a weekday occurring in the previous or coming month." +msgstr "Клас CSS для дня тижня в попередньому або наступному місяці." + +msgid "" +"A list of CSS classes used for weekday names in the header row. The default " +"is the same as :attr:`cssclasses`." +msgstr "" +"Список класів CSS, які використовуються для назв днів тижня в рядку " +"заголовка. За замовчуванням таке саме, як :attr:`cssclasses`." + +msgid "" +"The month's head CSS class (used by :meth:`formatmonthname`). The default " +"value is ``\"month\"``." +msgstr "" +"Головний клас CSS місяця (використовується :meth:`formatmonthname`). " +"Значенням за замовчуванням є ``\"місяць\"``." + +msgid "" +"The CSS class for the whole month's table (used by :meth:`formatmonth`). The " +"default value is ``\"month\"``." +msgstr "" +"Клас CSS для таблиці всього місяця (використовується :meth:`formatmonth`). " +"Значенням за замовчуванням є ``\"місяць\"``." + +msgid "" +"The CSS class for the whole year's table of tables (used by :meth:" +"`formatyear`). The default value is ``\"year\"``." +msgstr "" +"Клас CSS для таблиці таблиць за цілий рік (використовується :meth:" +"`formatyear`). Значення за замовчуванням – ``\"рік\"``." + +msgid "" +"The CSS class for the table head for the whole year (used by :meth:" +"`formatyear`). The default value is ``\"year\"``." +msgstr "" +"Клас CSS для заголовка таблиці за цілий рік (використовується :meth:" +"`formatyear`). Значення за замовчуванням – ``\"рік\"``." + +msgid "" +"Note that although the naming for the above described class attributes is " +"singular (e.g. ``cssclass_month`` ``cssclass_noday``), one can replace the " +"single CSS class with a space separated list of CSS classes, for example::" +msgstr "" +"Зауважте, що хоча імена для описаних вище атрибутів класу є одниною " +"(наприклад, ``cssclass_month`` ``cssclass_noday``), можна замінити один клас " +"CSS списком класів CSS, розділених пробілами, наприклад::" + +msgid "\"text-bold text-red\"" +msgstr "" + +msgid "Here is an example how :class:`!HTMLCalendar` can be customized::" +msgstr "Ось приклад того, як :class:`!HTMLCalendar` можна налаштувати::" + +msgid "" +"class CustomHTMLCal(calendar.HTMLCalendar):\n" +" cssclasses = [style + \" text-nowrap\" for style in\n" +" calendar.HTMLCalendar.cssclasses]\n" +" cssclass_month_head = \"text-center month-head\"\n" +" cssclass_month = \"text-center month\"\n" +" cssclass_year = \"text-italic lead\"" +msgstr "" + +msgid "" +"This subclass of :class:`TextCalendar` can be passed a locale name in the " +"constructor and will return month and weekday names in the specified locale." +msgstr "" + +msgid "" +"This subclass of :class:`HTMLCalendar` can be passed a locale name in the " +"constructor and will return month and weekday names in the specified locale." +msgstr "" + +msgid "" +"The constructor, :meth:`!formatweekday` and :meth:`!formatmonthname` methods " +"of these two classes temporarily change the ``LC_TIME`` locale to the given " +"*locale*. Because the current locale is a process-wide setting, they are not " +"thread-safe." +msgstr "" + +msgid "For simple text calendars this module provides the following functions." +msgstr "Для простих текстових календарів цей модуль надає такі функції." + +msgid "" +"Sets the weekday (``0`` is Monday, ``6`` is Sunday) to start each week. The " +"values :const:`MONDAY`, :const:`TUESDAY`, :const:`WEDNESDAY`, :const:" +"`THURSDAY`, :const:`FRIDAY`, :const:`SATURDAY`, and :const:`SUNDAY` are " +"provided for convenience. For example, to set the first weekday to Sunday::" +msgstr "" +"Встановлює день тижня (``0`` - понеділок, ``6`` - неділя), щоб почати кожен " +"тиждень. Значення :const:`MONDAY`, :const:`TUESDAY`, :const:`WEDNESDAY`, :" +"const:`THURSDAY`, :const:`FRIDAY`, :const:`SATURDAY` і :const:`SUNDAY` " +"надаються для зручності. Наприклад, щоб встановити першим днем тижня неділю:" + +msgid "" +"import calendar\n" +"calendar.setfirstweekday(calendar.SUNDAY)" +msgstr "" + +msgid "Returns the current setting for the weekday to start each week." +msgstr "Повертає поточне налаштування дня тижня для початку кожного тижня." + +msgid "" +"Returns :const:`True` if *year* is a leap year, otherwise :const:`False`." +msgstr "" +"Повертає :const:`True`, якщо *year* є високосним роком, інакше :const:" +"`False`." + +msgid "" +"Returns the number of leap years in the range from *y1* to *y2* (exclusive), " +"where *y1* and *y2* are years." +msgstr "" +"Повертає кількість високосних років у діапазоні від *y1* до *y2* (за " +"винятком), де *y1* і *y2* — роки." + +msgid "This function works for ranges spanning a century change." +msgstr "Ця функція працює для діапазонів, що охоплюють зміну століття." + +msgid "" +"Returns the day of the week (``0`` is Monday) for *year* (``1970``--...), " +"*month* (``1``--``12``), *day* (``1``--``31``)." +msgstr "" +"Повертає день тижня (\"0\" — понеділок) для *року* (``1970``--...), *місяця* " +"(``1``--``12``), *день* (``1``-``31``)." + +msgid "" +"Return a header containing abbreviated weekday names. *n* specifies the " +"width in characters for one weekday." +msgstr "" +"Повертає заголовок, що містить скорочені назви днів тижня. *n* визначає " +"ширину в символах для одного дня тижня." + +msgid "" +"Returns weekday of first day of the month and number of days in month, for " +"the specified *year* and *month*." +msgstr "" +"Повертає день тижня першого дня місяця та кількість днів у місяці для " +"вказаного *року* та *місяця*." + +msgid "" +"Returns a matrix representing a month's calendar. Each row represents a " +"week; days outside of the month are represented by zeros. Each week begins " +"with Monday unless set by :func:`setfirstweekday`." +msgstr "" +"Повертає матрицю, що представляє місячний календар. Кожен рядок означає " +"тиждень; дні поза місяцем позначаються нулями. Кожен тиждень починається з " +"понеділка, якщо не встановлено :func:`setfirstweekday`." + +msgid "Prints a month's calendar as returned by :func:`month`." +msgstr "Друкує місячний календар, який повертає :func:`month`." + +msgid "" +"Returns a month's calendar in a multi-line string using the :meth:" +"`~TextCalendar.formatmonth` of the :class:`TextCalendar` class." +msgstr "" + +msgid "" +"Prints the calendar for an entire year as returned by :func:`calendar`." +msgstr "Друкує календар на цілий рік, який повертає :func:`calendar`." + +msgid "" +"Returns a 3-column calendar for an entire year as a multi-line string using " +"the :meth:`~TextCalendar.formatyear` of the :class:`TextCalendar` class." +msgstr "" + +msgid "" +"An unrelated but handy function that takes a time tuple such as returned by " +"the :func:`~time.gmtime` function in the :mod:`time` module, and returns the " +"corresponding Unix timestamp value, assuming an epoch of 1970, and the POSIX " +"encoding. In fact, :func:`time.gmtime` and :func:`timegm` are each others' " +"inverse." +msgstr "" +"Непов’язана, але зручна функція, яка приймає кортеж часу, такий як " +"повернутий функцією :func:`~time.gmtime` в модулі :mod:`time`, і повертає " +"відповідне значення мітки часу Unix, припускаючи епоху 1970 року, і " +"кодування POSIX. Насправді :func:`time.gmtime` і :func:`timegm` є зворотними " +"один одному." + +msgid "The :mod:`calendar` module exports the following data attributes:" +msgstr "Модуль :mod:`calendar` експортує такі атрибути даних:" + +msgid "" +"A sequence that represents the days of the week in the current locale, where " +"Monday is day number 0." +msgstr "" + +msgid "" +"A sequence that represents the abbreviated days of the week in the current " +"locale, where Mon is day number 0." +msgstr "" + +msgid "" +"Aliases for the days of the week, where ``MONDAY`` is ``0`` and ``SUNDAY`` " +"is ``6``." +msgstr "" + +msgid "" +"Enumeration defining days of the week as integer constants. The members of " +"this enumeration are exported to the module scope as :data:`MONDAY` through :" +"data:`SUNDAY`." +msgstr "" + +msgid "" +"A sequence that represents the months of the year in the current locale. " +"This follows normal convention of January being month number 1, so it has a " +"length of 13 and ``month_name[0]`` is the empty string." +msgstr "" + +msgid "" +"A sequence that represents the abbreviated months of the year in the current " +"locale. This follows normal convention of January being month number 1, so " +"it has a length of 13 and ``month_abbr[0]`` is the empty string." +msgstr "" + +msgid "" +"Aliases for the months of the year, where ``JANUARY`` is ``1`` and " +"``DECEMBER`` is ``12``." +msgstr "" + +msgid "" +"Enumeration defining months of the year as integer constants. The members of " +"this enumeration are exported to the module scope as :data:`JANUARY` " +"through :data:`DECEMBER`." +msgstr "" + +msgid "The :mod:`calendar` module defines the following exceptions:" +msgstr "" + +msgid "" +"A subclass of :exc:`ValueError`, raised when the given month number is " +"outside of the range 1-12 (inclusive)." +msgstr "" + +msgid "The invalid month number." +msgstr "" + +msgid "" +"A subclass of :exc:`ValueError`, raised when the given weekday number is " +"outside of the range 0-6 (inclusive)." +msgstr "" + +msgid "The invalid weekday number." +msgstr "" + +msgid "Module :mod:`datetime`" +msgstr "Модуль :mod:`datetime`" + +msgid "" +"Object-oriented interface to dates and times with similar functionality to " +"the :mod:`time` module." +msgstr "" +"Об’єктно-орієнтований інтерфейс для дат і часу з аналогічною " +"функціональністю модуля :mod:`time`." + +msgid "Module :mod:`time`" +msgstr "Модуль :mod:`time`" + +msgid "Low-level time related functions." +msgstr "Низькорівневі функції, пов'язані з часом." + +msgid "Command-Line Usage" +msgstr "Використання командного рядка" + +msgid "" +"The :mod:`calendar` module can be executed as a script from the command line " +"to interactively print a calendar." +msgstr "" + +msgid "" +"python -m calendar [-h] [-L LOCALE] [-e ENCODING] [-t {text,html}]\n" +" [-w WIDTH] [-l LINES] [-s SPACING] [-m MONTHS] [-c CSS]\n" +" [-f FIRST_WEEKDAY] [year] [month]" +msgstr "" + +msgid "For example, to print a calendar for the year 2000:" +msgstr "" + +msgid "" +"$ python -m calendar 2000\n" +" 2000\n" +"\n" +" January February March\n" +"Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su\n" +" 1 2 1 2 3 4 5 6 1 2 3 4 5\n" +" 3 4 5 6 7 8 9 7 8 9 10 11 12 13 6 7 8 9 10 11 12\n" +"10 11 12 13 14 15 16 14 15 16 17 18 19 20 13 14 15 16 17 18 19\n" +"17 18 19 20 21 22 23 21 22 23 24 25 26 27 20 21 22 23 24 25 26\n" +"24 25 26 27 28 29 30 28 29 27 28 29 30 31\n" +"31\n" +"\n" +" April May June\n" +"Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su\n" +" 1 2 1 2 3 4 5 6 7 1 2 3 4\n" +" 3 4 5 6 7 8 9 8 9 10 11 12 13 14 5 6 7 8 9 10 11\n" +"10 11 12 13 14 15 16 15 16 17 18 19 20 21 12 13 14 15 16 17 18\n" +"17 18 19 20 21 22 23 22 23 24 25 26 27 28 19 20 21 22 23 24 25\n" +"24 25 26 27 28 29 30 29 30 31 26 27 28 29 30\n" +"\n" +" July August September\n" +"Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su\n" +" 1 2 1 2 3 4 5 6 1 2 3\n" +" 3 4 5 6 7 8 9 7 8 9 10 11 12 13 4 5 6 7 8 9 10\n" +"10 11 12 13 14 15 16 14 15 16 17 18 19 20 11 12 13 14 15 16 17\n" +"17 18 19 20 21 22 23 21 22 23 24 25 26 27 18 19 20 21 22 23 24\n" +"24 25 26 27 28 29 30 28 29 30 31 25 26 27 28 29 30\n" +"31\n" +"\n" +" October November December\n" +"Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su\n" +" 1 1 2 3 4 5 1 2 3\n" +" 2 3 4 5 6 7 8 6 7 8 9 10 11 12 4 5 6 7 8 9 10\n" +" 9 10 11 12 13 14 15 13 14 15 16 17 18 19 11 12 13 14 15 16 17\n" +"16 17 18 19 20 21 22 20 21 22 23 24 25 26 18 19 20 21 22 23 24\n" +"23 24 25 26 27 28 29 27 28 29 30 25 26 27 28 29 30 31\n" +"30 31" +msgstr "" + +msgid "The following options are accepted:" +msgstr "Приймаються такі варіанти:" + +msgid "Show the help message and exit." +msgstr "Показати довідкове повідомлення та вийти." + +msgid "The locale to use for month and weekday names. Defaults to English." +msgstr "" + +msgid "" +"The encoding to use for output. :option:`--encoding` is required if :option:" +"`--locale` is set." +msgstr "" + +msgid "Print the calendar to the terminal as text, or as an HTML document." +msgstr "" + +msgid "" +"The weekday to start each week. Must be a number between 0 (Monday) and 6 " +"(Sunday). Defaults to 0." +msgstr "" + +msgid "The year to print the calendar for. Defaults to the current year." +msgstr "" + +msgid "" +"The month of the specified :option:`year` to print the calendar for. Must be " +"a number between 1 and 12, and may only be used in text mode. Defaults to " +"printing a calendar for the full year." +msgstr "" + +msgid "*Text-mode options:*" +msgstr "" + +msgid "" +"The width of the date column in terminal columns. The date is printed " +"centred in the column. Any value lower than 2 is ignored. Defaults to 2." +msgstr "" + +msgid "" +"The number of lines for each week in terminal rows. The date is printed top-" +"aligned. Any value lower than 1 is ignored. Defaults to 1." +msgstr "" + +msgid "" +"The space between months in columns. Any value lower than 2 is ignored. " +"Defaults to 6." +msgstr "" + +msgid "The number of months printed per row. Defaults to 3." +msgstr "" + +msgid "*HTML-mode options:*" +msgstr "" + +msgid "" +"The path of a CSS stylesheet to use for the calendar. This must either be " +"relative to the generated HTML, or an absolute HTTP or ``file:///`` URL." +msgstr "" diff --git a/library/cgi.po b/library/cgi.po new file mode 100644 index 000000000..704420148 --- /dev/null +++ b/library/cgi.po @@ -0,0 +1,42 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2024-11-19 01:02+0000\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!cgi` --- Common Gateway Interface support" +msgstr "" + +msgid "" +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." +msgstr "" + +msgid "" +"A fork of the module on PyPI can be used instead: :pypi:`legacy-cgi`. This " +"is a copy of the cgi module, no longer maintained or supported by the core " +"Python team." +msgstr "" + +msgid "" +"The last version of Python that provided the :mod:`!cgi` module was `Python " +"3.12 `_." +msgstr "" diff --git a/library/cgitb.po b/library/cgitb.po new file mode 100644 index 000000000..c5935ea36 --- /dev/null +++ b/library/cgitb.po @@ -0,0 +1,42 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2024-11-19 01:02+0000\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!cgitb` --- Traceback manager for CGI scripts" +msgstr "" + +msgid "" +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." +msgstr "" + +msgid "" +"A fork of the module on PyPI can now be used instead: :pypi:`legacy-cgi`. " +"This is a copy of the cgi module, no longer maintained or supported by the " +"core Python team." +msgstr "" + +msgid "" +"The last version of Python that provided the :mod:`!cgitb` module was " +"`Python 3.12 `_." +msgstr "" diff --git a/library/chunk.po b/library/chunk.po new file mode 100644 index 000000000..f000e8afb --- /dev/null +++ b/library/chunk.po @@ -0,0 +1,36 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2024-11-19 01:02+0000\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!chunk` --- Read IFF chunked data" +msgstr "" + +msgid "" +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." +msgstr "" + +msgid "" +"The last version of Python that provided the :mod:`!chunk` module was " +"`Python 3.12 `_." +msgstr "" diff --git a/library/cmath.po b/library/cmath.po new file mode 100644 index 000000000..5a8fd8602 --- /dev/null +++ b/library/cmath.po @@ -0,0 +1,561 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2023 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:56+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2023\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!cmath` --- Mathematical functions for complex numbers" +msgstr "" + +msgid "" +"This module provides access to mathematical functions for complex numbers. " +"The functions in this module accept integers, floating-point numbers or " +"complex numbers as arguments. They will also accept any Python object that " +"has either a :meth:`~object.__complex__` or a :meth:`~object.__float__` " +"method: these methods are used to convert the object to a complex or " +"floating-point number, respectively, and the function is then applied to the " +"result of the conversion." +msgstr "" + +msgid "" +"For functions involving branch cuts, we have the problem of deciding how to " +"define those functions on the cut itself. Following Kahan's \"Branch cuts " +"for complex elementary functions\" paper, as well as Annex G of C99 and " +"later C standards, we use the sign of zero to distinguish one side of the " +"branch cut from the other: for a branch cut along (a portion of) the real " +"axis we look at the sign of the imaginary part, while for a branch cut along " +"the imaginary axis we look at the sign of the real part." +msgstr "" + +msgid "" +"For example, the :func:`cmath.sqrt` function has a branch cut along the " +"negative real axis. An argument of ``complex(-2.0, -0.0)`` is treated as " +"though it lies *below* the branch cut, and so gives a result on the negative " +"imaginary axis::" +msgstr "" + +msgid "" +">>> cmath.sqrt(complex(-2.0, -0.0))\n" +"-1.4142135623730951j" +msgstr "" + +msgid "" +"But an argument of ``complex(-2.0, 0.0)`` is treated as though it lies above " +"the branch cut::" +msgstr "" + +msgid "" +">>> cmath.sqrt(complex(-2.0, 0.0))\n" +"1.4142135623730951j" +msgstr "" + +msgid "**Conversions to and from polar coordinates**" +msgstr "" + +msgid ":func:`phase(z) `" +msgstr "" + +msgid "Return the phase of *z*" +msgstr "" + +msgid ":func:`polar(z) `" +msgstr "" + +msgid "Return the representation of *z* in polar coordinates" +msgstr "" + +msgid ":func:`rect(r, phi) `" +msgstr "" + +msgid "Return the complex number *z* with polar coordinates *r* and *phi*" +msgstr "" + +msgid "**Power and logarithmic functions**" +msgstr "" + +msgid ":func:`exp(z) `" +msgstr "" + +msgid "Return *e* raised to the power *z*" +msgstr "" + +msgid ":func:`log(z[, base]) `" +msgstr "" + +msgid "Return the logarithm of *z* to the given *base* (*e* by default)" +msgstr "" + +msgid ":func:`log10(z) `" +msgstr "" + +msgid "Return the base-10 logarithm of *z*" +msgstr "" + +msgid ":func:`sqrt(z) `" +msgstr "" + +msgid "Return the square root of *z*" +msgstr "" + +msgid "**Trigonometric functions**" +msgstr "" + +msgid ":func:`acos(z) `" +msgstr "" + +msgid "Return the arc cosine of *z*" +msgstr "" + +msgid ":func:`asin(z) `" +msgstr "" + +msgid "Return the arc sine of *z*" +msgstr "" + +msgid ":func:`atan(z) `" +msgstr "" + +msgid "Return the arc tangent of *z*" +msgstr "" + +msgid ":func:`cos(z) `" +msgstr "" + +msgid "Return the cosine of *z*" +msgstr "" + +msgid ":func:`sin(z) `" +msgstr "" + +msgid "Return the sine of *z*" +msgstr "" + +msgid ":func:`tan(z) `" +msgstr "" + +msgid "Return the tangent of *z*" +msgstr "" + +msgid "**Hyperbolic functions**" +msgstr "" + +msgid ":func:`acosh(z) `" +msgstr "" + +msgid "Return the inverse hyperbolic cosine of *z*" +msgstr "" + +msgid ":func:`asinh(z) `" +msgstr "" + +msgid "Return the inverse hyperbolic sine of *z*" +msgstr "" + +msgid ":func:`atanh(z) `" +msgstr "" + +msgid "Return the inverse hyperbolic tangent of *z*" +msgstr "" + +msgid ":func:`cosh(z) `" +msgstr "" + +msgid "Return the hyperbolic cosine of *z*" +msgstr "" + +msgid ":func:`sinh(z) `" +msgstr "" + +msgid "Return the hyperbolic sine of *z*" +msgstr "" + +msgid ":func:`tanh(z) `" +msgstr "" + +msgid "Return the hyperbolic tangent of *z*" +msgstr "" + +msgid "**Classification functions**" +msgstr "" + +msgid ":func:`isfinite(z) `" +msgstr "" + +msgid "Check if all components of *z* are finite" +msgstr "" + +msgid ":func:`isinf(z) `" +msgstr "" + +msgid "Check if any component of *z* is infinite" +msgstr "" + +msgid ":func:`isnan(z) `" +msgstr "" + +msgid "Check if any component of *z* is a NaN" +msgstr "" + +msgid ":func:`isclose(a, b, *, rel_tol, abs_tol) `" +msgstr "" + +msgid "Check if the values *a* and *b* are close to each other" +msgstr "" + +msgid "**Constants**" +msgstr "" + +msgid ":data:`pi`" +msgstr "" + +msgid "*π* = 3.141592..." +msgstr "" + +msgid ":data:`e`" +msgstr "" + +msgid "*e* = 2.718281..." +msgstr "" + +msgid ":data:`tau`" +msgstr "" + +msgid "*τ* = 2\\ *π* = 6.283185..." +msgstr "" + +msgid ":data:`inf`" +msgstr "" + +msgid "Positive infinity" +msgstr "" + +msgid ":data:`infj`" +msgstr "" + +msgid "Pure imaginary infinity" +msgstr "" + +msgid ":data:`nan`" +msgstr "" + +msgid "\"Not a number\" (NaN)" +msgstr "" + +msgid ":data:`nanj`" +msgstr "" + +msgid "Pure imaginary NaN" +msgstr "" + +msgid "Conversions to and from polar coordinates" +msgstr "Перетворення в і з полярних координат" + +msgid "" +"A Python complex number ``z`` is stored internally using *rectangular* or " +"*Cartesian* coordinates. It is completely determined by its *real part* ``z." +"real`` and its *imaginary part* ``z.imag``." +msgstr "" + +msgid "" +"*Polar coordinates* give an alternative way to represent a complex number. " +"In polar coordinates, a complex number *z* is defined by the modulus *r* and " +"the phase angle *phi*. The modulus *r* is the distance from *z* to the " +"origin, while the phase *phi* is the counterclockwise angle, measured in " +"radians, from the positive x-axis to the line segment that joins the origin " +"to *z*." +msgstr "" +"*Полярні координати* дають альтернативний спосіб представлення комплексного " +"числа. У полярних координатах комплексне число *z* визначається модулем *r* " +"і фазовим кутом *phi*. Модуль *r* — це відстань від *z* до початку " +"координат, тоді як фаза *phi* — це кут проти годинникової стрілки, виміряний " +"у радіанах, від додатної осі x до відрізка лінії, який з’єднує початок " +"координат із *z*." + +msgid "" +"The following functions can be used to convert from the native rectangular " +"coordinates to polar coordinates and back." +msgstr "" +"Наступні функції можна використовувати для перетворення вихідних прямокутних " +"координат у полярні координати та назад." + +msgid "" +"Return the phase of *z* (also known as the *argument* of *z*), as a float. " +"``phase(z)`` is equivalent to ``math.atan2(z.imag, z.real)``. The result " +"lies in the range [-\\ *π*, *π*], and the branch cut for this operation lies " +"along the negative real axis. The sign of the result is the same as the " +"sign of ``z.imag``, even when ``z.imag`` is zero::" +msgstr "" + +msgid "" +">>> phase(complex(-1.0, 0.0))\n" +"3.141592653589793\n" +">>> phase(complex(-1.0, -0.0))\n" +"-3.141592653589793" +msgstr "" + +msgid "" +"The modulus (absolute value) of a complex number *z* can be computed using " +"the built-in :func:`abs` function. There is no separate :mod:`cmath` module " +"function for this operation." +msgstr "" + +msgid "" +"Return the representation of *z* in polar coordinates. Returns a pair ``(r, " +"phi)`` where *r* is the modulus of *z* and *phi* is the phase of *z*. " +"``polar(z)`` is equivalent to ``(abs(z), phase(z))``." +msgstr "" + +msgid "" +"Return the complex number *z* with polar coordinates *r* and *phi*. " +"Equivalent to ``complex(r * math.cos(phi), r * math.sin(phi))``." +msgstr "" + +msgid "Power and logarithmic functions" +msgstr "Степеневі та логарифмічні функції" + +msgid "" +"Return *e* raised to the power *z*, where *e* is the base of natural " +"logarithms." +msgstr "" + +msgid "" +"Return the logarithm of *z* to the given *base*. If the *base* is not " +"specified, returns the natural logarithm of *z*. There is one branch cut, " +"from 0 along the negative real axis to -∞." +msgstr "" + +msgid "" +"Return the base-10 logarithm of *z*. This has the same branch cut as :func:" +"`log`." +msgstr "" + +msgid "" +"Return the square root of *z*. This has the same branch cut as :func:`log`." +msgstr "" + +msgid "Trigonometric functions" +msgstr "Тригонометричні функції" + +msgid "" +"Return the arc cosine of *z*. There are two branch cuts: One extends right " +"from 1 along the real axis to ∞. The other extends left from -1 along the " +"real axis to -∞." +msgstr "" + +msgid "" +"Return the arc sine of *z*. This has the same branch cuts as :func:`acos`." +msgstr "" + +msgid "" +"Return the arc tangent of *z*. There are two branch cuts: One extends from " +"``1j`` along the imaginary axis to ``∞j``. The other extends from ``-1j`` " +"along the imaginary axis to ``-∞j``." +msgstr "" + +msgid "Return the cosine of *z*." +msgstr "" + +msgid "Return the sine of *z*." +msgstr "" + +msgid "Return the tangent of *z*." +msgstr "" + +msgid "Hyperbolic functions" +msgstr "Гіперболічні функції" + +msgid "" +"Return the inverse hyperbolic cosine of *z*. There is one branch cut, " +"extending left from 1 along the real axis to -∞." +msgstr "" + +msgid "" +"Return the inverse hyperbolic sine of *z*. There are two branch cuts: One " +"extends from ``1j`` along the imaginary axis to ``∞j``. The other extends " +"from ``-1j`` along the imaginary axis to ``-∞j``." +msgstr "" + +msgid "" +"Return the inverse hyperbolic tangent of *z*. There are two branch cuts: One " +"extends from ``1`` along the real axis to ``∞``. The other extends from " +"``-1`` along the real axis to ``-∞``." +msgstr "" + +msgid "Return the hyperbolic cosine of *z*." +msgstr "" + +msgid "Return the hyperbolic sine of *z*." +msgstr "" + +msgid "Return the hyperbolic tangent of *z*." +msgstr "" + +msgid "Classification functions" +msgstr "Функції класифікації" + +msgid "" +"Return ``True`` if both the real and imaginary parts of *z* are finite, and " +"``False`` otherwise." +msgstr "" + +msgid "" +"Return ``True`` if either the real or the imaginary part of *z* is an " +"infinity, and ``False`` otherwise." +msgstr "" + +msgid "" +"Return ``True`` if either the real or the imaginary part of *z* is a NaN, " +"and ``False`` otherwise." +msgstr "" + +msgid "" +"Return ``True`` if the values *a* and *b* are close to each other and " +"``False`` otherwise." +msgstr "" +"Повертає ``True``, якщо значення *a* і *b* близькі одне до одного, і " +"``False`` в іншому випадку." + +msgid "" +"Whether or not two values are considered close is determined according to " +"given absolute and relative tolerances. If no errors occur, the result will " +"be: ``abs(a-b) <= max(rel_tol * max(abs(a), abs(b)), abs_tol)``." +msgstr "" + +msgid "" +"*rel_tol* is the relative tolerance -- it is the maximum allowed difference " +"between *a* and *b*, relative to the larger absolute value of *a* or *b*. " +"For example, to set a tolerance of 5%, pass ``rel_tol=0.05``. The default " +"tolerance is ``1e-09``, which assures that the two values are the same " +"within about 9 decimal digits. *rel_tol* must be nonnegative and less than " +"``1.0``." +msgstr "" + +msgid "" +"*abs_tol* is the absolute tolerance; it defaults to ``0.0`` and it must be " +"nonnegative. When comparing ``x`` to ``0.0``, ``isclose(x, 0)`` is computed " +"as ``abs(x) <= rel_tol * abs(x)``, which is ``False`` for any ``x`` and " +"rel_tol less than ``1.0``. So add an appropriate positive abs_tol argument " +"to the call." +msgstr "" + +msgid "" +"The IEEE 754 special values of ``NaN``, ``inf``, and ``-inf`` will be " +"handled according to IEEE rules. Specifically, ``NaN`` is not considered " +"close to any other value, including ``NaN``. ``inf`` and ``-inf`` are only " +"considered close to themselves." +msgstr "" +"Спеціальні значення IEEE 754 ``NaN``, ``inf`` і ``-inf`` оброблятимуться " +"відповідно до правил IEEE. Зокрема, ``NaN`` не вважається близьким до будь-" +"якого іншого значення, включаючи ``NaN``. ``inf`` і ``-inf`` вважаються лише " +"близькими до самих себе." + +msgid ":pep:`485` -- A function for testing approximate equality" +msgstr ":pep:`485` -- Функція для перевірки приблизної рівності" + +msgid "Constants" +msgstr "Константи" + +msgid "The mathematical constant *π*, as a float." +msgstr "Математична константа *π* у вигляді числа з плаваючою точкою." + +msgid "The mathematical constant *e*, as a float." +msgstr "Математична константа *e* як число з плаваючою точкою." + +msgid "The mathematical constant *τ*, as a float." +msgstr "Математична константа *τ* як число з плаваючою точкою." + +msgid "Floating-point positive infinity. Equivalent to ``float('inf')``." +msgstr "" +"Додатна нескінченність із плаваючою комою. Еквівалент ``float('inf')``." + +msgid "" +"Complex number with zero real part and positive infinity imaginary part. " +"Equivalent to ``complex(0.0, float('inf'))``." +msgstr "" +"Комплексне число з нульовою дійсною частиною та додатною нескінченною уявною " +"частиною. Еквівалент ``complex(0.0, float('inf'))``." + +msgid "" +"A floating-point \"not a number\" (NaN) value. Equivalent to " +"``float('nan')``." +msgstr "" +"Значення з плаваючою комою \"не число\" (NaN). Еквівалент ``float('nan')``." + +msgid "" +"Complex number with zero real part and NaN imaginary part. Equivalent to " +"``complex(0.0, float('nan'))``." +msgstr "" +"Комплексне число з нульовою дійсною частиною та NaN уявною частиною. " +"Еквівалент ``complex(0.0, float('nan'))``." + +msgid "" +"Note that the selection of functions is similar, but not identical, to that " +"in module :mod:`math`. The reason for having two modules is that some users " +"aren't interested in complex numbers, and perhaps don't even know what they " +"are. They would rather have ``math.sqrt(-1)`` raise an exception than " +"return a complex number. Also note that the functions defined in :mod:" +"`cmath` always return a complex number, even if the answer can be expressed " +"as a real number (in which case the complex number has an imaginary part of " +"zero)." +msgstr "" +"Зауважте, що вибір функцій подібний, але не ідентичний до вибору в модулі :" +"mod:`math`. Причина наявності двох модулів полягає в тому, що деякі " +"користувачі не цікавляться комплексними числами і, можливо, навіть не " +"знають, що це таке. Вони радше, щоб ``math.sqrt(-1)`` викликав виняток, ніж " +"повертав комплексне число. Також зауважте, що функції, визначені в :mod:" +"`cmath`, завжди повертають комплексне число, навіть якщо відповідь може бути " +"виражена як дійсне число (у цьому випадку комплексне число має уявну частину " +"нуля)." + +msgid "" +"A note on branch cuts: They are curves along which the given function fails " +"to be continuous. They are a necessary feature of many complex functions. " +"It is assumed that if you need to compute with complex functions, you will " +"understand about branch cuts. Consult almost any (not too elementary) book " +"on complex variables for enlightenment. For information of the proper " +"choice of branch cuts for numerical purposes, a good reference should be the " +"following:" +msgstr "" +"Примітка щодо розрізів гілок: це криві, уздовж яких дана функція не є " +"неперервною. Вони є необхідною ознакою багатьох складних функцій. " +"Передбачається, що якщо вам потрібно обчислювати зі складними функціями, ви " +"зрозумієте про скорочення гілок. Зверніться до майже будь-якої (не надто " +"елементарної) книги про комплексні змінні для просвітлення. Щоб отримати " +"інформацію щодо правильного вибору обрізків гілок для чисельних цілей, " +"гарною довідкою має бути наступне:" + +msgid "" +"Kahan, W: Branch cuts for complex elementary functions; or, Much ado about " +"nothing's sign bit. In Iserles, A., and Powell, M. (eds.), The state of the " +"art in numerical analysis. Clarendon Press (1987) pp165--211." +msgstr "" +"Kahan, W: Розрізи гілок для складних елементарних функцій; або \"Багато шуму " +"з нічого\". У Ізерлес, А. та Пауелл, М. (ред.), Сучасний стан числового " +"аналізу. Clarendon Press (1987) pp165--211." + +msgid "module" +msgstr "модуль" + +msgid "math" +msgstr "математика" diff --git a/library/cmd.po b/library/cmd.po new file mode 100644 index 000000000..ad3695f89 --- /dev/null +++ b/library/cmd.po @@ -0,0 +1,509 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:56+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!cmd` --- Support for line-oriented command interpreters" +msgstr "" + +msgid "**Source code:** :source:`Lib/cmd.py`" +msgstr "**Вихідний код:** :source:`Lib/cmd.py`" + +msgid "" +"The :class:`Cmd` class provides a simple framework for writing line-oriented " +"command interpreters. These are often useful for test harnesses, " +"administrative tools, and prototypes that will later be wrapped in a more " +"sophisticated interface." +msgstr "" +"Клас :class:`Cmd` забезпечує просту структуру для написання рядково-" +"орієнтованих інтерпретаторів команд. Вони часто корисні для тестових систем, " +"інструментів адміністрування та прототипів, які пізніше будуть загорнуті в " +"більш складний інтерфейс." + +msgid "" +"A :class:`Cmd` instance or subclass instance is a line-oriented interpreter " +"framework. There is no good reason to instantiate :class:`Cmd` itself; " +"rather, it's useful as a superclass of an interpreter class you define " +"yourself in order to inherit :class:`Cmd`'s methods and encapsulate action " +"methods." +msgstr "" +"Екземпляр :class:`Cmd` або екземпляр підкласу — це рядково-орієнтована " +"структура інтерпретатора. Немає вагомих причин створювати сам :class:`Cmd`; " +"скоріше, це корисно як суперклас класу інтерпретатора, який ви визначаєте " +"самостійно, щоб успадкувати методи :class:`Cmd` та інкапсулювати методи дії." + +msgid "" +"The optional argument *completekey* is the :mod:`readline` name of a " +"completion key; it defaults to :kbd:`Tab`. If *completekey* is not :const:" +"`None` and :mod:`readline` is available, command completion is done " +"automatically." +msgstr "" +"Необов’язковий аргумент *completekey* є назвою :mod:`readline` ключа " +"завершення; типово :kbd:`Tab`. Якщо *completekey* не :const:`None` і :mod:" +"`readline` доступний, завершення команди виконується автоматично." + +msgid "" +"The default, ``'tab'``, is treated specially, so that it refers to the :kbd:" +"`Tab` key on every :data:`readline.backend`. Specifically, if :data:" +"`readline.backend` is ``editline``, ``Cmd`` will use ``'^I'`` instead of " +"``'tab'``. Note that other values are not treated this way, and might only " +"work with a specific backend." +msgstr "" + +msgid "" +"The optional arguments *stdin* and *stdout* specify the input and output " +"file objects that the Cmd instance or subclass instance will use for input " +"and output. If not specified, they will default to :data:`sys.stdin` and :" +"data:`sys.stdout`." +msgstr "" +"Необов’язкові аргументи *stdin* і *stdout* визначають вхідні та вихідні " +"файлові об’єкти, які екземпляр Cmd або екземпляр підкласу використовуватиме " +"для введення та виведення. Якщо не вказати, за замовчуванням вони будуть :" +"data:`sys.stdin` і :data:`sys.stdout`." + +msgid "" +"If you want a given *stdin* to be used, make sure to set the instance's :" +"attr:`use_rawinput` attribute to ``False``, otherwise *stdin* will be " +"ignored." +msgstr "" +"Якщо ви хочете, щоб використовувався заданий *stdin*, обов’язково встановіть " +"для атрибута екземпляра :attr:`use_rawinput` значення ``False``, інакше " +"*stdin* буде проігноровано." + +msgid "``completekey='tab'`` is replaced by ``'^I'`` for ``editline``." +msgstr "" + +msgid "Cmd Objects" +msgstr "Cmd об’єкти" + +msgid "A :class:`Cmd` instance has the following methods:" +msgstr "Екземпляр :class:`Cmd` має такі методи:" + +msgid "" +"Repeatedly issue a prompt, accept input, parse an initial prefix off the " +"received input, and dispatch to action methods, passing them the remainder " +"of the line as argument." +msgstr "" +"Повторно видавати підказку, приймати введення, аналізувати початковий " +"префікс отриманого введення та відправляти до методів дії, передаючи їм " +"решту рядка як аргумент." + +msgid "" +"The optional argument is a banner or intro string to be issued before the " +"first prompt (this overrides the :attr:`intro` class attribute)." +msgstr "" +"Необов’язковим аргументом є банер або вступний рядок, який буде виданий " +"перед першою підказкою (це замінює атрибут класу :attr:`intro`)." + +msgid "" +"If the :mod:`readline` module is loaded, input will automatically inherit :" +"program:`bash`\\ -like history-list editing (e.g. :kbd:`Control-P` scrolls " +"back to the last command, :kbd:`Control-N` forward to the next one, :kbd:" +"`Control-F` moves the cursor to the right non-destructively, :kbd:`Control-" +"B` moves the cursor to the left non-destructively, etc.)." +msgstr "" +"Якщо завантажено модуль :mod:`readline`, введення автоматично успадковує :" +"program:`bash`\\ -подібне до редагування списку історії (наприклад, :kbd:" +"`Control-P` прокручує назад до останньої команди, :kbd:`Control-N` " +"переходить до наступного, :kbd:`Control-F` переміщує курсор праворуч " +"недеструктивно, :kbd:`Control-B` переміщує курсор ліворуч недеструктивно " +"тощо)." + +msgid "An end-of-file on input is passed back as the string ``'EOF'``." +msgstr "Кінець файлу при введенні передається назад як рядок ``'EOF'``." + +msgid "" +"An interpreter instance will recognize a command name ``foo`` if and only if " +"it has a method :meth:`!do_foo`. As a special case, a line beginning with " +"the character ``'?'`` is dispatched to the method :meth:`do_help`. As " +"another special case, a line beginning with the character ``'!'`` is " +"dispatched to the method :meth:`!do_shell` (if such a method is defined)." +msgstr "" + +msgid "" +"This method will return when the :meth:`postcmd` method returns a true " +"value. The *stop* argument to :meth:`postcmd` is the return value from the " +"command's corresponding :meth:`!do_\\*` method." +msgstr "" + +msgid "" +"If completion is enabled, completing commands will be done automatically, " +"and completing of commands args is done by calling :meth:`!complete_foo` " +"with arguments *text*, *line*, *begidx*, and *endidx*. *text* is the string " +"prefix we are attempting to match: all returned matches must begin with it. " +"*line* is the current input line with leading whitespace removed, *begidx* " +"and *endidx* are the beginning and ending indexes of the prefix text, which " +"could be used to provide different completion depending upon which position " +"the argument is in." +msgstr "" + +msgid "" +"All subclasses of :class:`Cmd` inherit a predefined :meth:`!do_help`. This " +"method, called with an argument ``'bar'``, invokes the corresponding method :" +"meth:`!help_bar`, and if that is not present, prints the docstring of :meth:" +"`!do_bar`, if available. With no argument, :meth:`!do_help` lists all " +"available help topics (that is, all commands with corresponding :meth:`!" +"help_\\*` methods or commands that have docstrings), and also lists any " +"undocumented commands." +msgstr "" + +msgid "" +"Interpret the argument as though it had been typed in response to the " +"prompt. This may be overridden, but should not normally need to be; see the :" +"meth:`precmd` and :meth:`postcmd` methods for useful execution hooks. The " +"return value is a flag indicating whether interpretation of commands by the " +"interpreter should stop. If there is a :meth:`!do_\\*` method for the " +"command *str*, the return value of that method is returned, otherwise the " +"return value from the :meth:`default` method is returned." +msgstr "" + +msgid "" +"Method called when an empty line is entered in response to the prompt. If " +"this method is not overridden, it repeats the last nonempty command entered." +msgstr "" +"Метод викликається, коли у відповідь на підказку вводиться порожній рядок. " +"Якщо цей метод не перевизначено, він повторює останню введену непорожню " +"команду." + +msgid "" +"Method called on an input line when the command prefix is not recognized. If " +"this method is not overridden, it prints an error message and returns." +msgstr "" +"Метод, який викликається у рядку введення, коли префікс команди не " +"розпізнається. Якщо цей метод не перевизначено, він друкує повідомлення про " +"помилку та повертається." + +msgid "" +"Method called to complete an input line when no command-specific :meth:`!" +"complete_\\*` method is available. By default, it returns an empty list." +msgstr "" + +msgid "" +"Method called to display a list of strings as a compact set of columns. Each " +"column is only as wide as necessary. Columns are separated by two spaces for " +"readability." +msgstr "" + +msgid "" +"Hook method executed just before the command line *line* is interpreted, but " +"after the input prompt is generated and issued. This method is a stub in :" +"class:`Cmd`; it exists to be overridden by subclasses. The return value is " +"used as the command which will be executed by the :meth:`onecmd` method; " +"the :meth:`precmd` implementation may re-write the command or simply return " +"*line* unchanged." +msgstr "" +"Метод підхоплення виконується безпосередньо перед інтерпретацією *рядка* " +"командного рядка, але після створення та видачі підказки введення. Цей метод " +"є заглушкою в :class:`Cmd`; він існує, щоб бути заміненим підкласами. " +"Повернене значення використовується як команда, яка буде виконана методом :" +"meth:`onecmd`; реалізація :meth:`precmd` може переписати команду або просто " +"повернути *рядок* без змін." + +msgid "" +"Hook method executed just after a command dispatch is finished. This method " +"is a stub in :class:`Cmd`; it exists to be overridden by subclasses. *line* " +"is the command line which was executed, and *stop* is a flag which indicates " +"whether execution will be terminated after the call to :meth:`postcmd`; this " +"will be the return value of the :meth:`onecmd` method. The return value of " +"this method will be used as the new value for the internal flag which " +"corresponds to *stop*; returning false will cause interpretation to continue." +msgstr "" +"Метод підхоплення виконується відразу після завершення відправки команди. " +"Цей метод є заглушкою в :class:`Cmd`; він існує, щоб бути заміненим " +"підкласами. *рядок* — це командний рядок, який було виконано, а *стоп* — це " +"позначка, яка вказує, чи буде виконання припинено після виклику :meth:" +"`postcmd`; це буде значення, яке повертає метод :meth:`onecmd`. Повернене " +"значення цього методу буде використано як нове значення для внутрішнього " +"прапора, який відповідає *stop*; повернення false призведе до продовження " +"інтерпретації." + +msgid "" +"Hook method executed once when :meth:`cmdloop` is called. This method is a " +"stub in :class:`Cmd`; it exists to be overridden by subclasses." +msgstr "" +"Метод підхоплення виконується один раз під час виклику :meth:`cmdloop`. Цей " +"метод є заглушкою в :class:`Cmd`; він існує, щоб бути заміненим підкласами." + +msgid "" +"Hook method executed once when :meth:`cmdloop` is about to return. This " +"method is a stub in :class:`Cmd`; it exists to be overridden by subclasses." +msgstr "" +"Метод підключення виконується один раз, коли :meth:`cmdloop` збирається " +"повернутися. Цей метод є заглушкою в :class:`Cmd`; він існує, щоб бути " +"заміненим підкласами." + +msgid "" +"Instances of :class:`Cmd` subclasses have some public instance variables:" +msgstr "" +"Екземпляри підкласів :class:`Cmd` мають деякі публічні змінні екземпляра:" + +msgid "The prompt issued to solicit input." +msgstr "Підказка, видана для запиту введення." + +msgid "The string of characters accepted for the command prefix." +msgstr "Рядок символів, прийнятний для префікса команди." + +msgid "The last nonempty command prefix seen." +msgstr "Останній непорожній префікс команди." + +msgid "" +"A list of queued input lines. The cmdqueue list is checked in :meth:" +"`cmdloop` when new input is needed; if it is nonempty, its elements will be " +"processed in order, as if entered at the prompt." +msgstr "" +"Список рядків введення в черзі. Список cmdqueue перевіряється в :meth:" +"`cmdloop`, коли потрібен новий вхід; якщо він непорожній, його елементи " +"будуть оброблені в порядку, ніби введені під час підказки." + +msgid "" +"A string to issue as an intro or banner. May be overridden by giving the :" +"meth:`cmdloop` method an argument." +msgstr "" +"Рядок для випуску як вступ або банер. Може бути перевизначено, надавши " +"методу :meth:`cmdloop` аргумент." + +msgid "" +"The header to issue if the help output has a section for documented commands." +msgstr "" +"Заголовок, який потрібно видавати, якщо вихід довідки містить розділ для " +"задокументованих команд." + +msgid "" +"The header to issue if the help output has a section for miscellaneous help " +"topics (that is, there are :meth:`!help_\\*` methods without corresponding :" +"meth:`!do_\\*` methods)." +msgstr "" + +msgid "" +"The header to issue if the help output has a section for undocumented " +"commands (that is, there are :meth:`!do_\\*` methods without corresponding :" +"meth:`!help_\\*` methods)." +msgstr "" + +msgid "" +"The character used to draw separator lines under the help-message headers. " +"If empty, no ruler line is drawn. It defaults to ``'='``." +msgstr "" +"Символ, який використовується для малювання роздільних ліній під заголовками " +"довідкових повідомлень. Якщо поле пусте, лінія лінійки не малюється. За " +"замовчуванням ``'='``." + +msgid "" +"A flag, defaulting to true. If true, :meth:`cmdloop` uses :func:`input` to " +"display a prompt and read the next command; if false, :data:`sys.stdout." +"write() ` and :data:`sys.stdin.readline() ` are used. " +"(This means that by importing :mod:`readline`, on systems that support it, " +"the interpreter will automatically support :program:`Emacs`\\ -like line " +"editing and command-history keystrokes.)" +msgstr "" + +msgid "Cmd Example" +msgstr "Приклад команди" + +msgid "" +"The :mod:`cmd` module is mainly useful for building custom shells that let a " +"user work with a program interactively." +msgstr "" +"Модуль :mod:`cmd` в основному корисний для створення спеціальних оболонок, " +"які дозволяють користувачеві працювати з програмою в інтерактивному режимі." + +msgid "" +"This section presents a simple example of how to build a shell around a few " +"of the commands in the :mod:`turtle` module." +msgstr "" +"У цьому розділі представлено простий приклад того, як створити оболонку " +"навколо кількох команд у модулі :mod:`turtle`." + +msgid "" +"Basic turtle commands such as :meth:`~turtle.forward` are added to a :class:" +"`Cmd` subclass with method named :meth:`!do_forward`. The argument is " +"converted to a number and dispatched to the turtle module. The docstring is " +"used in the help utility provided by the shell." +msgstr "" + +msgid "" +"The example also includes a basic record and playback facility implemented " +"with the :meth:`~Cmd.precmd` method which is responsible for converting the " +"input to lowercase and writing the commands to a file. The :meth:`!" +"do_playback` method reads the file and adds the recorded commands to the :" +"attr:`~Cmd.cmdqueue` for immediate playback::" +msgstr "" + +msgid "" +"import cmd, sys\n" +"from turtle import *\n" +"\n" +"class TurtleShell(cmd.Cmd):\n" +" intro = 'Welcome to the turtle shell. Type help or ? to list commands." +"\\n'\n" +" prompt = '(turtle) '\n" +" file = None\n" +"\n" +" # ----- basic turtle commands -----\n" +" def do_forward(self, arg):\n" +" 'Move the turtle forward by the specified distance: FORWARD 10'\n" +" forward(*parse(arg))\n" +" def do_right(self, arg):\n" +" 'Turn turtle right by given number of degrees: RIGHT 20'\n" +" right(*parse(arg))\n" +" def do_left(self, arg):\n" +" 'Turn turtle left by given number of degrees: LEFT 90'\n" +" left(*parse(arg))\n" +" def do_goto(self, arg):\n" +" 'Move turtle to an absolute position with changing orientation. " +"GOTO 100 200'\n" +" goto(*parse(arg))\n" +" def do_home(self, arg):\n" +" 'Return turtle to the home position: HOME'\n" +" home()\n" +" def do_circle(self, arg):\n" +" 'Draw circle with given radius an options extent and steps: CIRCLE " +"50'\n" +" circle(*parse(arg))\n" +" def do_position(self, arg):\n" +" 'Print the current turtle position: POSITION'\n" +" print('Current position is %d %d\\n' % position())\n" +" def do_heading(self, arg):\n" +" 'Print the current turtle heading in degrees: HEADING'\n" +" print('Current heading is %d\\n' % (heading(),))\n" +" def do_color(self, arg):\n" +" 'Set the color: COLOR BLUE'\n" +" color(arg.lower())\n" +" def do_undo(self, arg):\n" +" 'Undo (repeatedly) the last turtle action(s): UNDO'\n" +" def do_reset(self, arg):\n" +" 'Clear the screen and return turtle to center: RESET'\n" +" reset()\n" +" def do_bye(self, arg):\n" +" 'Stop recording, close the turtle window, and exit: BYE'\n" +" print('Thank you for using Turtle')\n" +" self.close()\n" +" bye()\n" +" return True\n" +"\n" +" # ----- record and playback -----\n" +" def do_record(self, arg):\n" +" 'Save future commands to filename: RECORD rose.cmd'\n" +" self.file = open(arg, 'w')\n" +" def do_playback(self, arg):\n" +" 'Playback commands from a file: PLAYBACK rose.cmd'\n" +" self.close()\n" +" with open(arg) as f:\n" +" self.cmdqueue.extend(f.read().splitlines())\n" +" def precmd(self, line):\n" +" line = line.lower()\n" +" if self.file and 'playback' not in line:\n" +" print(line, file=self.file)\n" +" return line\n" +" def close(self):\n" +" if self.file:\n" +" self.file.close()\n" +" self.file = None\n" +"\n" +"def parse(arg):\n" +" 'Convert a series of zero or more numbers to an argument tuple'\n" +" return tuple(map(int, arg.split()))\n" +"\n" +"if __name__ == '__main__':\n" +" TurtleShell().cmdloop()" +msgstr "" + +msgid "" +"Here is a sample session with the turtle shell showing the help functions, " +"using blank lines to repeat commands, and the simple record and playback " +"facility:" +msgstr "" +"Ось зразок сеансу з панциром черепахи, який показує довідкові функції, " +"використовує порожні рядки для повторення команд, а також простий засіб " +"запису та відтворення:" + +msgid "" +"Welcome to the turtle shell. Type help or ? to list commands.\n" +"\n" +"(turtle) ?\n" +"\n" +"Documented commands (type help ):\n" +"========================================\n" +"bye color goto home playback record right\n" +"circle forward heading left position reset undo\n" +"\n" +"(turtle) help forward\n" +"Move the turtle forward by the specified distance: FORWARD 10\n" +"(turtle) record spiral.cmd\n" +"(turtle) position\n" +"Current position is 0 0\n" +"\n" +"(turtle) heading\n" +"Current heading is 0\n" +"\n" +"(turtle) reset\n" +"(turtle) circle 20\n" +"(turtle) right 30\n" +"(turtle) circle 40\n" +"(turtle) right 30\n" +"(turtle) circle 60\n" +"(turtle) right 30\n" +"(turtle) circle 80\n" +"(turtle) right 30\n" +"(turtle) circle 100\n" +"(turtle) right 30\n" +"(turtle) circle 120\n" +"(turtle) right 30\n" +"(turtle) circle 120\n" +"(turtle) heading\n" +"Current heading is 180\n" +"\n" +"(turtle) forward 100\n" +"(turtle)\n" +"(turtle) right 90\n" +"(turtle) forward 100\n" +"(turtle)\n" +"(turtle) right 90\n" +"(turtle) forward 400\n" +"(turtle) right 90\n" +"(turtle) forward 500\n" +"(turtle) right 90\n" +"(turtle) forward 400\n" +"(turtle) right 90\n" +"(turtle) forward 300\n" +"(turtle) playback spiral.cmd\n" +"Current position is 0 0\n" +"\n" +"Current heading is 0\n" +"\n" +"Current heading is 180\n" +"\n" +"(turtle) bye\n" +"Thank you for using Turtle" +msgstr "" + +msgid "? (question mark)" +msgstr "? (знак питання)" + +msgid "in a command interpreter" +msgstr "" + +msgid "! (exclamation)" +msgstr "! (знак оклику)" diff --git a/library/cmdline.po b/library/cmdline.po new file mode 100644 index 000000000..35ea33b5c --- /dev/null +++ b/library/cmdline.po @@ -0,0 +1,184 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-04 14:18+0000\n" +"PO-Revision-Date: 2023-10-13 14:16+0000\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Modules command-line interface (CLI)" +msgstr "" + +msgid "The following modules have a command-line interface." +msgstr "" + +msgid ":ref:`ast `" +msgstr "" + +msgid ":ref:`asyncio `" +msgstr "" + +msgid ":mod:`base64`" +msgstr "" + +msgid ":ref:`calendar `" +msgstr "" + +msgid ":mod:`code`" +msgstr "" + +msgid ":ref:`compileall `" +msgstr "" + +msgid ":mod:`cProfile`: see :ref:`profile `" +msgstr "" + +msgid ":ref:`difflib `" +msgstr "" + +msgid ":ref:`dis `" +msgstr "" + +msgid ":ref:`doctest `" +msgstr "" + +msgid ":mod:`!encodings.rot_13`" +msgstr "" + +msgid ":mod:`ensurepip`" +msgstr "" + +msgid ":mod:`filecmp`" +msgstr "" + +msgid ":mod:`fileinput`" +msgstr "" + +msgid ":mod:`ftplib`" +msgstr "" + +msgid ":ref:`gzip `" +msgstr "" + +msgid ":ref:`http.server `" +msgstr "" + +msgid ":mod:`!idlelib`" +msgstr "" + +msgid ":ref:`inspect `" +msgstr "" + +msgid ":ref:`json.tool `" +msgstr "" + +msgid ":mod:`mimetypes`" +msgstr "" + +msgid ":mod:`pdb`" +msgstr "" + +msgid ":mod:`pickle`" +msgstr "" + +msgid ":ref:`pickletools `" +msgstr "" + +msgid ":mod:`platform`" +msgstr "" + +msgid ":mod:`poplib`" +msgstr "" + +msgid ":ref:`profile `" +msgstr "" + +msgid ":mod:`pstats`" +msgstr "" + +msgid ":ref:`py_compile `" +msgstr "" + +msgid ":mod:`pyclbr`" +msgstr "" + +msgid ":mod:`pydoc`" +msgstr "" + +msgid ":mod:`quopri`" +msgstr "" + +msgid ":ref:`random `" +msgstr "" + +msgid ":mod:`runpy`" +msgstr "" + +msgid ":ref:`site `" +msgstr "" + +msgid ":ref:`sqlite3 `" +msgstr "" + +msgid ":ref:`symtable `" +msgstr "" + +msgid ":ref:`sysconfig `" +msgstr "" + +msgid ":mod:`tabnanny`" +msgstr "" + +msgid ":ref:`tarfile `" +msgstr "" + +msgid ":mod:`!this`" +msgstr "" + +msgid ":ref:`timeit `" +msgstr "" + +msgid ":ref:`tokenize `" +msgstr "" + +msgid ":ref:`trace `" +msgstr "" + +msgid ":mod:`turtledemo`" +msgstr "" + +msgid ":ref:`unittest `" +msgstr "" + +msgid ":ref:`uuid `" +msgstr "" + +msgid ":mod:`venv`" +msgstr "" + +msgid ":mod:`webbrowser`" +msgstr "" + +msgid ":ref:`zipapp `" +msgstr "" + +msgid ":ref:`zipfile `" +msgstr "" + +msgid "See also the :ref:`Python command-line interface `." +msgstr "" diff --git a/library/cmdlinelibs.po b/library/cmdlinelibs.po new file mode 100644 index 000000000..e7c676cb2 --- /dev/null +++ b/library/cmdlinelibs.po @@ -0,0 +1,33 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2024-12-27 14:18+0000\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Command Line Interface Libraries" +msgstr "" + +msgid "" +"The modules described in this chapter assist with implementing command line " +"and terminal interfaces for applications." +msgstr "" + +msgid "Here's an overview:" +msgstr "" diff --git a/library/code.po b/library/code.po new file mode 100644 index 000000000..d2dae5fc7 --- /dev/null +++ b/library/code.po @@ -0,0 +1,286 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:56+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!code` --- Interpreter base classes" +msgstr "" + +msgid "**Source code:** :source:`Lib/code.py`" +msgstr "**Вихідний код:** :source:`Lib/code.py`" + +msgid "" +"The ``code`` module provides facilities to implement read-eval-print loops " +"in Python. Two classes and convenience functions are included which can be " +"used to build applications which provide an interactive interpreter prompt." +msgstr "" +"Модуль ``code`` надає засоби для реалізації циклів читання-оцінки-друку в " +"Python. Включено два класи та додаткові функції, які можна використовувати " +"для створення програм, які надають інтерактивну підказку інтерпретатора." + +msgid "" +"This class deals with parsing and interpreter state (the user's namespace); " +"it does not deal with input buffering or prompting or input file naming (the " +"filename is always passed in explicitly). The optional *locals* argument " +"specifies a mapping to use as the namespace in which code will be executed; " +"it defaults to a newly created dictionary with key ``'__name__'`` set to " +"``'__console__'`` and key ``'__doc__'`` set to ``None``." +msgstr "" + +msgid "" +"Closely emulate the behavior of the interactive Python interpreter. This " +"class builds on :class:`InteractiveInterpreter` and adds prompting using the " +"familiar ``sys.ps1`` and ``sys.ps2``, and input buffering. If *local_exit* " +"is true, ``exit()`` and ``quit()`` in the console will not raise :exc:" +"`SystemExit`, but instead return to the calling code." +msgstr "" + +msgid "Added *local_exit* parameter." +msgstr "" + +msgid "" +"Convenience function to run a read-eval-print loop. This creates a new " +"instance of :class:`InteractiveConsole` and sets *readfunc* to be used as " +"the :meth:`InteractiveConsole.raw_input` method, if provided. If *local* is " +"provided, it is passed to the :class:`InteractiveConsole` constructor for " +"use as the default namespace for the interpreter loop. If *local_exit* is " +"provided, it is passed to the :class:`InteractiveConsole` constructor. The :" +"meth:`~InteractiveConsole.interact` method of the instance is then run with " +"*banner* and *exitmsg* passed as the banner and exit message to use, if " +"provided. The console object is discarded after use." +msgstr "" + +msgid "Added *exitmsg* parameter." +msgstr "Додано параметр *exitmsg*." + +msgid "" +"This function is useful for programs that want to emulate Python's " +"interpreter main loop (a.k.a. the read-eval-print loop). The tricky part is " +"to determine when the user has entered an incomplete command that can be " +"completed by entering more text (as opposed to a complete command or a " +"syntax error). This function *almost* always makes the same decision as the " +"real interpreter main loop." +msgstr "" +"Ця функція корисна для програм, які хочуть емулювати основний цикл " +"інтерпретатора Python (він же цикл читання-оцінки-друку). Складна частина " +"полягає в тому, щоб визначити, коли користувач ввів неповну команду, яку " +"можна завершити введенням додаткового тексту (на відміну від повної команди " +"чи синтаксичної помилки). Ця функція *майже* завжди приймає те саме рішення, " +"що й основний цикл реального інтерпретатора." + +msgid "" +"*source* is the source string; *filename* is the optional filename from " +"which source was read, defaulting to ``''``; and *symbol* is the " +"optional grammar start symbol, which should be ``'single'`` (the default), " +"``'eval'`` or ``'exec'``." +msgstr "" +"*джерело* - вихідний рядок; *ім’я файлу* — необов’язкове ім’я файлу, з якого " +"було прочитано джерело, за умовчанням ``' ''``; і *symbol* є " +"необов’язковим символом початку граматики, який має бути ``'single'`` (за " +"замовчуванням), ``'eval'`` або ``'exec'``." + +msgid "" +"Returns a code object (the same as ``compile(source, filename, symbol)``) if " +"the command is complete and valid; ``None`` if the command is incomplete; " +"raises :exc:`SyntaxError` if the command is complete and contains a syntax " +"error, or raises :exc:`OverflowError` or :exc:`ValueError` if the command " +"contains an invalid literal." +msgstr "" +"Повертає об’єкт коду (те саме, що ``compile(source, filename, symbol)``), " +"якщо команда повна та дійсна; ``None``, якщо команда неповна; викликає :exc:" +"`SyntaxError`, якщо команда завершена та містить синтаксичну помилку, або " +"викликає :exc:`OverflowError` або :exc:`ValueError`, якщо команда містить " +"недійсний літерал." + +msgid "Interactive Interpreter Objects" +msgstr "Об'єкти інтерактивного інтерпретатора" + +msgid "" +"Compile and run some source in the interpreter. Arguments are the same as " +"for :func:`compile_command`; the default for *filename* is ``''``, " +"and for *symbol* is ``'single'``. One of several things can happen:" +msgstr "" +"Скомпілюйте та запустіть деяке джерело в інтерпретаторі. Аргументи такі " +"самі, як і для :func:`compile_command`; за замовчуванням для *ім’я файлу* є " +"``' ''``, а для *symbol* — ``'single'``. Може статися одне з кількох:" + +msgid "" +"The input is incorrect; :func:`compile_command` raised an exception (:exc:" +"`SyntaxError` or :exc:`OverflowError`). A syntax traceback will be printed " +"by calling the :meth:`showsyntaxerror` method. :meth:`runsource` returns " +"``False``." +msgstr "" +"Введено неправильно; :func:`compile_command` викликала виняток (:exc:" +"`SyntaxError` або :exc:`OverflowError`). Відстеження синтаксису буде " +"надруковано викликом методу :meth:`showsyntaxerror`. :meth:`runsource` " +"повертає ``False``." + +msgid "" +"The input is incomplete, and more input is required; :func:`compile_command` " +"returned ``None``. :meth:`runsource` returns ``True``." +msgstr "" +"Вхідні дані неповні, потрібні додаткові дані; :func:`compile_command` " +"повернула ``None``. :meth:`runsource` повертає ``True``." + +msgid "" +"The input is complete; :func:`compile_command` returned a code object. The " +"code is executed by calling the :meth:`runcode` (which also handles run-time " +"exceptions, except for :exc:`SystemExit`). :meth:`runsource` returns " +"``False``." +msgstr "" +"Введення завершено; :func:`compile_command` повернув об’єкт коду. Код " +"виконується шляхом виклику :meth:`runcode` (який також обробляє винятки під " +"час виконання, за винятком :exc:`SystemExit`). :meth:`runsource` повертає " +"``False``." + +msgid "" +"The return value can be used to decide whether to use ``sys.ps1`` or ``sys." +"ps2`` to prompt the next line." +msgstr "" +"Значення, що повертається, можна використовувати, щоб вирішити, чи " +"використовувати ``sys.ps1`` або ``sys.ps2`` для підказки наступного рядка." + +msgid "" +"Execute a code object. When an exception occurs, :meth:`showtraceback` is " +"called to display a traceback. All exceptions are caught except :exc:" +"`SystemExit`, which is allowed to propagate." +msgstr "" +"Виконати об’єкт коду. Коли виникає виняткова ситуація, :meth:`showtraceback` " +"викликається для відображення зворотного відстеження. Перехоплюються всі " +"винятки, крім :exc:`SystemExit`, якому дозволено поширюватися." + +msgid "" +"A note about :exc:`KeyboardInterrupt`: this exception may occur elsewhere in " +"this code, and may not always be caught. The caller should be prepared to " +"deal with it." +msgstr "" +"Примітка про :exc:`KeyboardInterrupt`: цей виняток може виникнути в іншому " +"місці цього коду та не завжди може бути перехоплений. Той, хто дзвонить, " +"повинен бути готовим до цього." + +msgid "" +"Display the syntax error that just occurred. This does not display a stack " +"trace because there isn't one for syntax errors. If *filename* is given, it " +"is stuffed into the exception instead of the default filename provided by " +"Python's parser, because it always uses ``''`` when reading from a " +"string. The output is written by the :meth:`write` method." +msgstr "" +"Відобразити синтаксичну помилку, яка щойно сталася. Це не відображає " +"трасування стека, оскільки немає трасування синтаксичних помилок. Якщо " +"вказано *filename*, воно вставляється у виняток замість назви файлу за " +"замовчуванням, наданої синтаксичним аналізатором Python, оскільки він завжди " +"використовує ``' ''`` під час читання з рядка. Вихід записується " +"методом :meth:`write`." + +msgid "" +"Display the exception that just occurred. We remove the first stack item " +"because it is within the interpreter object implementation. The output is " +"written by the :meth:`write` method." +msgstr "" +"Відобразити виняток, який щойно стався. Ми видаляємо перший елемент стеку, " +"оскільки він знаходиться в межах реалізації об’єкта інтерпретатора. Вихід " +"записується методом :meth:`write`." + +msgid "" +"The full chained traceback is displayed instead of just the primary " +"traceback." +msgstr "" +"Відображається повна ланцюгова трасування, а не лише основна трасування." + +msgid "" +"Write a string to the standard error stream (``sys.stderr``). Derived " +"classes should override this to provide the appropriate output handling as " +"needed." +msgstr "" +"Запишіть рядок у стандартний потік помилок (``sys.stderr``). Похідні класи " +"повинні замінити це, щоб забезпечити відповідну обробку виводу за потреби." + +msgid "Interactive Console Objects" +msgstr "Інтерактивні консольні об’єкти" + +msgid "" +"The :class:`InteractiveConsole` class is a subclass of :class:" +"`InteractiveInterpreter`, and so offers all the methods of the interpreter " +"objects as well as the following additions." +msgstr "" +"Клас :class:`InteractiveConsole` є підкласом :class:" +"`InteractiveInterpreter`, тому пропонує всі методи об’єктів інтерпретатора, " +"а також наступні доповнення." + +msgid "" +"Closely emulate the interactive Python console. The optional *banner* " +"argument specify the banner to print before the first interaction; by " +"default it prints a banner similar to the one printed by the standard Python " +"interpreter, followed by the class name of the console object in parentheses " +"(so as not to confuse this with the real interpreter -- since it's so " +"close!)." +msgstr "" +"Повністю емулюйте інтерактивну консоль Python. Необов’язковий аргумент " +"*banner* визначає банер для друку перед першою взаємодією; за замовчуванням " +"він друкує банер, подібний до того, який друкує стандартний інтерпретатор " +"Python, а потім ім’я класу консольного об’єкта в дужках (щоб не сплутати це " +"зі справжнім інтерпретатором, оскільки він дуже близький!)." + +msgid "" +"The optional *exitmsg* argument specifies an exit message printed when " +"exiting. Pass the empty string to suppress the exit message. If *exitmsg* is " +"not given or ``None``, a default message is printed." +msgstr "" +"Необов'язковий аргумент *exitmsg* визначає повідомлення про вихід, яке " +"друкується під час виходу. Передайте порожній рядок, щоб приховати " +"повідомлення про вихід. Якщо *exitmsg* не вказано або ``None``, буде " +"надруковано повідомлення за замовчуванням." + +msgid "To suppress printing any banner, pass an empty string." +msgstr "Щоб заборонити друк будь-якого банера, передайте порожній рядок." + +msgid "Print an exit message when exiting." +msgstr "Друк повідомлення про вихід під час виходу." + +msgid "" +"Push a line of source text to the interpreter. The line should not have a " +"trailing newline; it may have internal newlines. The line is appended to a " +"buffer and the interpreter's :meth:`~InteractiveInterpreter.runsource` " +"method is called with the concatenated contents of the buffer as source. If " +"this indicates that the command was executed or invalid, the buffer is " +"reset; otherwise, the command is incomplete, and the buffer is left as it " +"was after the line was appended. The return value is ``True`` if more input " +"is required, ``False`` if the line was dealt with in some way (this is the " +"same as :meth:`!runsource`)." +msgstr "" + +msgid "Remove any unhandled source text from the input buffer." +msgstr "Видаліть будь-який необроблений вихідний текст із вхідного буфера." + +msgid "" +"Write a prompt and read a line. The returned line does not include the " +"trailing newline. When the user enters the EOF key sequence, :exc:" +"`EOFError` is raised. The base implementation reads from ``sys.stdin``; a " +"subclass may replace this with a different implementation." +msgstr "" +"Напишіть підказку та прочитайте рядок. Повернений рядок не містить кінцевого " +"символу нового рядка. Коли користувач вводить послідовність клавіш EOF, " +"виникає :exc:`EOFError`. Базова реалізація читає з ``sys.stdin``; підклас " +"може замінити це іншою реалізацією." diff --git a/library/codecs.po b/library/codecs.po new file mode 100644 index 000000000..6f1189dc2 --- /dev/null +++ b/library/codecs.po @@ -0,0 +1,2770 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:56+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!codecs` --- Codec registry and base classes" +msgstr "" + +msgid "**Source code:** :source:`Lib/codecs.py`" +msgstr "**Вихідний код:** :source:`Lib/codecs.py`" + +msgid "" +"This module defines base classes for standard Python codecs (encoders and " +"decoders) and provides access to the internal Python codec registry, which " +"manages the codec and error handling lookup process. Most standard codecs " +"are :term:`text encodings `, which encode text to bytes (and " +"decode bytes to text), but there are also codecs provided that encode text " +"to text, and bytes to bytes. Custom codecs may encode and decode between " +"arbitrary types, but some module features are restricted to be used " +"specifically with :term:`text encodings ` or with codecs that " +"encode to :class:`bytes`." +msgstr "" +"Цей модуль визначає базові класи для стандартних кодеків Python (кодери та " +"декодери) і надає доступ до внутрішнього реєстру кодеків Python, який керує " +"процесом пошуку кодека та обробки помилок. Більшість стандартних кодеків — " +"це :term:`кодування тексту `, які кодують текст у байти (і " +"декодують байти в текст), але є також кодеки, які кодують текст у текст і " +"байти в байти. Спеціальні кодеки можуть кодувати та декодувати між " +"довільними типами, але деякі функції модулів обмежено для використання " +"спеціально з :term:`текстовими кодуваннями ` або з кодеками, " +"які кодують у :class:`bytes`." + +msgid "" +"The module defines the following functions for encoding and decoding with " +"any codec:" +msgstr "" +"Модуль визначає такі функції для кодування та декодування будь-яким кодеком:" + +msgid "Encodes *obj* using the codec registered for *encoding*." +msgstr "Кодує *obj* за допомогою кодека, зареєстрованого для *кодування*." + +msgid "" +"*Errors* may be given to set the desired error handling scheme. The default " +"error handler is ``'strict'`` meaning that encoding errors raise :exc:" +"`ValueError` (or a more codec specific subclass, such as :exc:" +"`UnicodeEncodeError`). Refer to :ref:`codec-base-classes` for more " +"information on codec error handling." +msgstr "" +"*Помилки* можуть бути надані для встановлення потрібної схеми обробки " +"помилок. Обробником помилок за замовчуванням є ``'strict'``, що означає, що " +"помилки кодування викликають :exc:`ValueError` (або більш специфічний " +"підклас кодека, наприклад :exc:`UnicodeEncodeError`). Зверніться до :ref:" +"`codec-base-classes` для отримання додаткової інформації щодо обробки " +"помилок кодека." + +msgid "Decodes *obj* using the codec registered for *encoding*." +msgstr "Декодує *obj* за допомогою кодека, зареєстрованого для *кодування*." + +msgid "" +"*Errors* may be given to set the desired error handling scheme. The default " +"error handler is ``'strict'`` meaning that decoding errors raise :exc:" +"`ValueError` (or a more codec specific subclass, such as :exc:" +"`UnicodeDecodeError`). Refer to :ref:`codec-base-classes` for more " +"information on codec error handling." +msgstr "" +"*Помилки* можуть бути надані для встановлення потрібної схеми обробки " +"помилок. Обробником помилок за замовчуванням є ``'strict'``, що означає, що " +"помилки декодування викликають :exc:`ValueError` (або більш специфічний " +"підклас кодека, такий як :exc:`UnicodeDecodeError`). Зверніться до :ref:" +"`codec-base-classes` для отримання додаткової інформації про обробку помилок " +"кодека." + +msgid "The full details for each codec can also be looked up directly:" +msgstr "" +"Повну інформацію про кожен кодек також можна переглянути безпосередньо:" + +msgid "" +"Looks up the codec info in the Python codec registry and returns a :class:" +"`CodecInfo` object as defined below." +msgstr "" +"Шукає інформацію про кодек у реєстрі кодеків Python і повертає об’єкт :class:" +"`CodecInfo`, як визначено нижче." + +msgid "" +"Encodings are first looked up in the registry's cache. If not found, the " +"list of registered search functions is scanned. If no :class:`CodecInfo` " +"object is found, a :exc:`LookupError` is raised. Otherwise, the :class:" +"`CodecInfo` object is stored in the cache and returned to the caller." +msgstr "" +"Кодування спочатку шукаються в кеші реєстру. Якщо не знайдено, сканується " +"список зареєстрованих функцій пошуку. Якщо об’єкт :class:`CodecInfo` не " +"знайдено, виникає :exc:`LookupError`. В іншому випадку об’єкт :class:" +"`CodecInfo` зберігається в кеші та повертається абоненту." + +msgid "" +"Codec details when looking up the codec registry. The constructor arguments " +"are stored in attributes of the same name:" +msgstr "" +"Відомості про кодек під час пошуку реєстру кодеків. Аргументи конструктора " +"зберігаються в однойменних атрибутах:" + +msgid "The name of the encoding." +msgstr "Назва кодування." + +msgid "" +"The stateless encoding and decoding functions. These must be functions or " +"methods which have the same interface as the :meth:`~Codec.encode` and :meth:" +"`~Codec.decode` methods of Codec instances (see :ref:`Codec Interface `). The functions or methods are expected to work in a stateless " +"mode." +msgstr "" +"Функції кодування та декодування без збереження стану. Це мають бути функції " +"чи методи, які мають той самий інтерфейс, що й методи :meth:`~Codec.encode` " +"і :meth:`~Codec.decode` екземплярів кодека (див. :ref:`Інтерфейс кодека " +"`). Очікується, що функції або методи працюватимуть у режимі " +"без збереження стану." + +msgid "" +"Incremental encoder and decoder classes or factory functions. These have to " +"provide the interface defined by the base classes :class:" +"`IncrementalEncoder` and :class:`IncrementalDecoder`, respectively. " +"Incremental codecs can maintain state." +msgstr "" +"Класи інкрементального кодера та декодера або заводські функції. Вони мають " +"забезпечувати інтерфейс, визначений базовими класами :class:" +"`IncrementalEncoder` та :class:`IncrementalDecoder` відповідно. Інкрементні " +"кодеки можуть підтримувати стан." + +msgid "" +"Stream writer and reader classes or factory functions. These have to provide " +"the interface defined by the base classes :class:`StreamWriter` and :class:" +"`StreamReader`, respectively. Stream codecs can maintain state." +msgstr "" +"Класи потокового запису та читання або фабричні функції. Вони мають " +"забезпечувати інтерфейс, визначений базовими класами :class:`StreamWriter` " +"і :class:`StreamReader` відповідно. Потокові кодеки можуть підтримувати стан." + +msgid "" +"To simplify access to the various codec components, the module provides " +"these additional functions which use :func:`lookup` for the codec lookup:" +msgstr "" +"Щоб спростити доступ до різних компонентів кодека, модуль надає такі " +"додаткові функції, які використовують :func:`lookup` для пошуку кодека:" + +msgid "" +"Look up the codec for the given encoding and return its encoder function." +msgstr "" +"Знайдіть кодек для даного кодування та поверніть його функцію кодувальника." + +msgid "Raises a :exc:`LookupError` in case the encoding cannot be found." +msgstr "Викликає :exc:`LookupError`, якщо кодування не знайдено." + +msgid "" +"Look up the codec for the given encoding and return its decoder function." +msgstr "" +"Знайдіть кодек для даного кодування та поверніть його функцію декодера." + +msgid "" +"Look up the codec for the given encoding and return its incremental encoder " +"class or factory function." +msgstr "" +"Знайдіть кодек для даного кодування та поверніть його інкрементний клас " +"кодера або заводську функцію." + +msgid "" +"Raises a :exc:`LookupError` in case the encoding cannot be found or the " +"codec doesn't support an incremental encoder." +msgstr "" +"Викликає :exc:`LookupError`, якщо кодування не знайдено або кодек не " +"підтримує інкрементний кодер." + +msgid "" +"Look up the codec for the given encoding and return its incremental decoder " +"class or factory function." +msgstr "" +"Знайдіть кодек для даного кодування та поверніть його інкрементний клас " +"декодера або заводську функцію." + +msgid "" +"Raises a :exc:`LookupError` in case the encoding cannot be found or the " +"codec doesn't support an incremental decoder." +msgstr "" +"Викликає :exc:`LookupError`, якщо кодування не знайдено або кодек не " +"підтримує інкрементний декодер." + +msgid "" +"Look up the codec for the given encoding and return its :class:" +"`StreamReader` class or factory function." +msgstr "" +"Знайдіть кодек для вказаного кодування та поверніть його клас :class:" +"`StreamReader` або фабричну функцію." + +msgid "" +"Look up the codec for the given encoding and return its :class:" +"`StreamWriter` class or factory function." +msgstr "" +"Знайдіть кодек для вказаного кодування та поверніть його клас :class:" +"`StreamWriter` або фабричну функцію." + +msgid "" +"Custom codecs are made available by registering a suitable codec search " +"function:" +msgstr "" +"Спеціальні кодеки стають доступними, якщо зареєструвати відповідну функцію " +"пошуку кодеків:" + +msgid "" +"Register a codec search function. Search functions are expected to take one " +"argument, being the encoding name in all lower case letters with hyphens and " +"spaces converted to underscores, and return a :class:`CodecInfo` object. In " +"case a search function cannot find a given encoding, it should return " +"``None``." +msgstr "" +"Зареєструйте функцію пошуку кодеків. Очікується, що функції пошуку " +"прийматимуть один аргумент, тобто ім’я кодування, яке складається з малих " +"літер із дефісами та пробілами, перетворене на підкреслення, і повертатиме " +"об’єкт :class:`CodecInfo`. Якщо функція пошуку не може знайти задане " +"кодування, вона має повернути ``None``." + +msgid "Hyphens and spaces are converted to underscore." +msgstr "Дефіси та пробіли перетворюються на підкреслення." + +msgid "" +"Unregister a codec search function and clear the registry's cache. If the " +"search function is not registered, do nothing." +msgstr "" +"Скасуйте реєстрацію функції пошуку кодеків і очистіть кеш реєстру. Якщо " +"функція пошуку не зареєстрована, нічого не робіть." + +msgid "" +"While the builtin :func:`open` and the associated :mod:`io` module are the " +"recommended approach for working with encoded text files, this module " +"provides additional utility functions and classes that allow the use of a " +"wider range of codecs when working with binary files:" +msgstr "" +"Хоча вбудований :func:`open` і пов’язаний модуль :mod:`io` є рекомендованим " +"підходом для роботи з кодованими текстовими файлами, цей модуль надає " +"додаткові службові функції та класи, які дозволяють використовувати ширший " +"діапазон кодеків під час роботи з бінарними файлами:" + +msgid "" +"Open an encoded file using the given *mode* and return an instance of :class:" +"`StreamReaderWriter`, providing transparent encoding/decoding. The default " +"file mode is ``'r'``, meaning to open the file in read mode." +msgstr "" +"Відкрийте закодований файл у заданому *режимі* та поверніть екземпляр :class:" +"`StreamReaderWriter`, забезпечуючи прозоре кодування/декодування. Типовим " +"режимом файлу є ``'r''``, що означає відкриття файлу в режимі читання." + +msgid "" +"If *encoding* is not ``None``, then the underlying encoded files are always " +"opened in binary mode. No automatic conversion of ``'\\n'`` is done on " +"reading and writing. The *mode* argument may be any binary mode acceptable " +"to the built-in :func:`open` function; the ``'b'`` is automatically added." +msgstr "" + +msgid "" +"*encoding* specifies the encoding which is to be used for the file. Any " +"encoding that encodes to and decodes from bytes is allowed, and the data " +"types supported by the file methods depend on the codec used." +msgstr "" +"*encoding* визначає кодування, яке буде використано для файлу. Дозволяється " +"будь-яке кодування, яке кодує та декодує з байтів, а типи даних, які " +"підтримуються методами файлів, залежать від використовуваного кодека." + +msgid "" +"*errors* may be given to define the error handling. It defaults to " +"``'strict'`` which causes a :exc:`ValueError` to be raised in case an " +"encoding error occurs." +msgstr "" +"*errors* можуть бути надані для визначення обробки помилок. За замовчуванням " +"встановлено значення ``'strict''``, що спричиняє виникнення :exc:" +"`ValueError` у разі виникнення помилки кодування." + +msgid "" +"*buffering* has the same meaning as for the built-in :func:`open` function. " +"It defaults to -1 which means that the default buffer size will be used." +msgstr "" +"*buffering* має те саме значення, що й вбудована функція :func:`open`. За " +"замовчуванням він дорівнює -1, що означає, що буде використано стандартний " +"розмір буфера." + +msgid "The ``'U'`` mode has been removed." +msgstr "" + +msgid "" +"Return a :class:`StreamRecoder` instance, a wrapped version of *file* which " +"provides transparent transcoding. The original file is closed when the " +"wrapped version is closed." +msgstr "" +"Повертає екземпляр :class:`StreamRecoder`, загорнуту версію *файлу*, яка " +"забезпечує прозоре перекодування. Вихідний файл закривається, коли " +"закривається упакована версія." + +msgid "" +"Data written to the wrapped file is decoded according to the given " +"*data_encoding* and then written to the original file as bytes using " +"*file_encoding*. Bytes read from the original file are decoded according to " +"*file_encoding*, and the result is encoded using *data_encoding*." +msgstr "" +"Дані, записані в обгорнутий файл, декодуються відповідно до заданого " +"*data_encoding*, а потім записуються в вихідний файл у вигляді байтів за " +"допомогою *file_encoding*. Байти, зчитані з вихідного файлу, декодуються " +"відповідно до *file_encoding*, а результат кодується за допомогою " +"*data_encoding*." + +msgid "If *file_encoding* is not given, it defaults to *data_encoding*." +msgstr "Якщо *file_encoding* не вказано, за умовчанням буде *data_encoding*." + +msgid "" +"*errors* may be given to define the error handling. It defaults to " +"``'strict'``, which causes :exc:`ValueError` to be raised in case an " +"encoding error occurs." +msgstr "" +"*errors* можуть бути надані для визначення обробки помилок. За замовчуванням " +"встановлено ``'strict'``, що спричиняє :exc:`ValueError`, що виникає у " +"випадку помилки кодування." + +msgid "" +"Uses an incremental encoder to iteratively encode the input provided by " +"*iterator*. This function is a :term:`generator`. The *errors* argument (as " +"well as any other keyword argument) is passed through to the incremental " +"encoder." +msgstr "" +"Використовує інкрементальний кодувальник для ітеративного кодування вхідних " +"даних, наданих *iterator*. Ця функція є :term:`generator`. Аргумент *errors* " +"(як і будь-який інший аргумент ключового слова) передається до " +"інкрементального кодувальника." + +msgid "" +"This function requires that the codec accept text :class:`str` objects to " +"encode. Therefore it does not support bytes-to-bytes encoders such as " +"``base64_codec``." +msgstr "" +"Ця функція вимагає, щоб кодек приймав текстові об’єкти :class:`str` для " +"кодування. Тому він не підтримує кодувальники байт-у-байт, такі як " +"``base64_codec``." + +msgid "" +"Uses an incremental decoder to iteratively decode the input provided by " +"*iterator*. This function is a :term:`generator`. The *errors* argument (as " +"well as any other keyword argument) is passed through to the incremental " +"decoder." +msgstr "" +"Використовує інкрементальний декодер для ітеративного декодування вхідних " +"даних, наданих *iterator*. Ця функція є :term:`generator`. Аргумент *errors* " +"(як і будь-який інший аргумент ключового слова) передається до " +"інкрементального декодера." + +msgid "" +"This function requires that the codec accept :class:`bytes` objects to " +"decode. Therefore it does not support text-to-text encoders such as " +"``rot_13``, although ``rot_13`` may be used equivalently with :func:" +"`iterencode`." +msgstr "" +"Ця функція вимагає, щоб кодек приймав об’єкти :class:`bytes` для " +"декодування. Тому він не підтримує кодувальники тексту в текст, такі як " +"``rot_13``, хоча ``rot_13`` можна використовувати еквівалентно з :func:" +"`iterencode`." + +msgid "" +"The module also provides the following constants which are useful for " +"reading and writing to platform dependent files:" +msgstr "" +"Модуль також надає наступні константи, які корисні для читання та запису в " +"залежні від платформи файли:" + +msgid "" +"These constants define various byte sequences, being Unicode byte order " +"marks (BOMs) for several encodings. They are used in UTF-16 and UTF-32 data " +"streams to indicate the byte order used, and in UTF-8 as a Unicode " +"signature. :const:`BOM_UTF16` is either :const:`BOM_UTF16_BE` or :const:" +"`BOM_UTF16_LE` depending on the platform's native byte order, :const:`BOM` " +"is an alias for :const:`BOM_UTF16`, :const:`BOM_LE` for :const:" +"`BOM_UTF16_LE` and :const:`BOM_BE` for :const:`BOM_UTF16_BE`. The others " +"represent the BOM in UTF-8 and UTF-32 encodings." +msgstr "" +"Ці константи визначають різні послідовності байтів, будучи мітками порядку " +"байтів Unicode (BOM) для кількох кодувань. Вони використовуються в потоках " +"даних UTF-16 і UTF-32 для позначення використовуваного порядку байтів, а в " +"UTF-8 як підпис Юнікод. :const:`BOM_UTF16` є або :const:`BOM_UTF16_BE`, або :" +"const:`BOM_UTF16_LE` залежно від рідного порядку байтів платформи, :const:" +"`BOM` є псевдонімом для :const:`BOM_UTF16`, :const:`BOM_LE` для :const:" +"`BOM_UTF16_LE` і :const:`BOM_BE` для :const:`BOM_UTF16_BE`. Інші " +"представляють специфікацію в кодуваннях UTF-8 і UTF-32." + +msgid "Codec Base Classes" +msgstr "Базові класи кодеків" + +msgid "" +"The :mod:`codecs` module defines a set of base classes which define the " +"interfaces for working with codec objects, and can also be used as the basis " +"for custom codec implementations." +msgstr "" +"Модуль :mod:`codecs` визначає набір базових класів, які визначають " +"інтерфейси для роботи з об’єктами кодеків, а також може бути використаний як " +"основа для користувацьких реалізацій кодеків." + +msgid "" +"Each codec has to define four interfaces to make it usable as codec in " +"Python: stateless encoder, stateless decoder, stream reader and stream " +"writer. The stream reader and writers typically reuse the stateless encoder/" +"decoder to implement the file protocols. Codec authors also need to define " +"how the codec will handle encoding and decoding errors." +msgstr "" +"Кожен кодек має визначати чотири інтерфейси, щоб зробити його придатним для " +"використання як кодек у Python: кодер без стану, декодер без стану, читач " +"потоку та запис потоку. Зчитувач і записувач потоків зазвичай повторно " +"використовують кодер/декодер без збереження стану для реалізації протоколів " +"файлів. Автори кодеків також повинні визначити, як кодек оброблятиме помилки " +"кодування та декодування." + +msgid "Error Handlers" +msgstr "Обробники помилок" + +msgid "" +"To simplify and standardize error handling, codecs may implement different " +"error handling schemes by accepting the *errors* string argument:" +msgstr "" +"Щоб спростити та стандартизувати обробку помилок, кодеки можуть " +"реалізовувати різні схеми обробки помилок, приймаючи рядковий аргумент " +"*errors*:" + +msgid "" +"The following error handlers can be used with all Python :ref:`standard-" +"encodings` codecs:" +msgstr "" +"Наступні обробники помилок можна використовувати з усіма кодеками Python :" +"ref:`standard-encodings`:" + +msgid "Value" +msgstr "Значення" + +msgid "Meaning" +msgstr "Значення" + +msgid "``'strict'``" +msgstr "``'строгий''``" + +msgid "" +"Raise :exc:`UnicodeError` (or a subclass), this is the default. Implemented " +"in :func:`strict_errors`." +msgstr "" +"Викликати :exc:`UnicodeError` (або підклас), це типово. Реалізовано в :func:" +"`strict_errors`." + +msgid "``'ignore'``" +msgstr "``'ігнорувати''``" + +msgid "" +"Ignore the malformed data and continue without further notice. Implemented " +"in :func:`ignore_errors`." +msgstr "" +"Ігноруйте неправильні дані та продовжуйте без додаткового повідомлення. " +"Реалізовано в :func:`ignore_errors`." + +msgid "``'replace'``" +msgstr "``'замінити'``" + +msgid "" +"Replace with a replacement marker. On encoding, use ``?`` (ASCII character). " +"On decoding, use ``�`` (U+FFFD, the official REPLACEMENT CHARACTER). " +"Implemented in :func:`replace_errors`." +msgstr "" +"Замініть маркером заміни. У кодуванні використовуйте ``?`` (символ ASCII). " +"Під час декодування використовуйте ``�`` (U+FFFD, офіційний СИМВОЛ ЗАМІНИ). " +"Реалізовано в :func:`replace_errors`." + +msgid "``'backslashreplace'``" +msgstr "``'заміна зворотної косої риски''``" + +msgid "" +"Replace with backslashed escape sequences. On encoding, use hexadecimal form " +"of Unicode code point with formats :samp:`\\\\x{hh}` :samp:`\\\\u{xxxx}` :" +"samp:`\\\\U{xxxxxxxx}`. On decoding, use hexadecimal form of byte value with " +"format :samp:`\\\\x{hh}`. Implemented in :func:`backslashreplace_errors`." +msgstr "" + +msgid "``'surrogateescape'``" +msgstr "``'сурогатна втеча'``" + +msgid "" +"On decoding, replace byte with individual surrogate code ranging from " +"``U+DC80`` to ``U+DCFF``. This code will then be turned back into the same " +"byte when the ``'surrogateescape'`` error handler is used when encoding the " +"data. (See :pep:`383` for more.)" +msgstr "" +"Під час декодування замініть байт окремим сурогатним кодом у діапазоні від " +"``U+DC80`` до ``U+DCFF``. Потім цей код буде перетворено назад у той самий " +"байт, коли під час кодування даних використовується обробник помилок " +"``'surrogateescape'``. (Докладніше див. :pep:`383`.)" + +msgid "" +"The following error handlers are only applicable to encoding (within :term:" +"`text encodings `):" +msgstr "" +"Наступні обробники помилок застосовуються лише до кодування (в межах :term:" +"`кодування тексту `):" + +msgid "``'xmlcharrefreplace'``" +msgstr "``'xmlcharrefreplace'``" + +msgid "" +"Replace with XML/HTML numeric character reference, which is a decimal form " +"of Unicode code point with format :samp:`&#{num};`. Implemented in :func:" +"`xmlcharrefreplace_errors`." +msgstr "" + +msgid "``'namereplace'``" +msgstr "``'namereplace'``" + +msgid "" +"Replace with ``\\N{...}`` escape sequences, what appears in the braces is " +"the Name property from Unicode Character Database. Implemented in :func:" +"`namereplace_errors`." +msgstr "" +"Замініть керуючу послідовність ``\\N{...}``, що відображається в фігурних " +"дужках — це властивість Name із бази даних символів Unicode. Реалізовано в :" +"func:`namereplace_errors`." + +msgid "" +"In addition, the following error handler is specific to the given codecs:" +msgstr "Крім того, наступний обробник помилок є специфічним для даних кодеків:" + +msgid "Codecs" +msgstr "Кодеки" + +msgid "``'surrogatepass'``" +msgstr "``'сурогатний пропуск''``" + +msgid "utf-8, utf-16, utf-32, utf-16-be, utf-16-le, utf-32-be, utf-32-le" +msgstr "utf-8, utf-16, utf-32, utf-16-be, utf-16-le, utf-32-be, utf-32-le" + +msgid "" +"Allow encoding and decoding surrogate code point (``U+D800`` - ``U+DFFF``) " +"as normal code point. Otherwise these codecs treat the presence of surrogate " +"code point in :class:`str` as an error." +msgstr "" +"Дозволити кодування та декодування сурогатної кодової точки (``U+D800`` - " +"``U+DFFF``) як звичайну кодову точку. Інакше ці кодеки розглядають наявність " +"сурогатної кодової точки в :class:`str` як помилку." + +msgid "The ``'surrogateescape'`` and ``'surrogatepass'`` error handlers." +msgstr "Обробники помилок ``'surrogateescape'`` і ``'surrogatepass'``." + +msgid "" +"The ``'surrogatepass'`` error handler now works with utf-16\\* and utf-32\\* " +"codecs." +msgstr "" +"Обробник помилок ``'surrogatepass'`` тепер працює з кодеками utf-16\\* і " +"utf-32\\*." + +msgid "The ``'namereplace'`` error handler." +msgstr "Обробник помилок ``'namereplace``." + +msgid "" +"The ``'backslashreplace'`` error handler now works with decoding and " +"translating." +msgstr "" +"Обробник помилок ``'backslashreplace'`` тепер працює з декодуванням і " +"перекладом." + +msgid "" +"The set of allowed values can be extended by registering a new named error " +"handler:" +msgstr "" +"Набір дозволених значень можна розширити, зареєструвавши новий іменований " +"обробник помилок:" + +msgid "" +"Register the error handling function *error_handler* under the name *name*. " +"The *error_handler* argument will be called during encoding and decoding in " +"case of an error, when *name* is specified as the errors parameter." +msgstr "" +"Зареєструйте функцію обробки помилок *error_handler* під назвою *name*. " +"Аргумент *error_handler* буде викликаний під час кодування та декодування у " +"разі помилки, якщо *name* вказано як параметр errors." + +msgid "" +"For encoding, *error_handler* will be called with a :exc:" +"`UnicodeEncodeError` instance, which contains information about the location " +"of the error. The error handler must either raise this or a different " +"exception, or return a tuple with a replacement for the unencodable part of " +"the input and a position where encoding should continue. The replacement may " +"be either :class:`str` or :class:`bytes`. If the replacement is bytes, the " +"encoder will simply copy them into the output buffer. If the replacement is " +"a string, the encoder will encode the replacement. Encoding continues on " +"original input at the specified position. Negative position values will be " +"treated as being relative to the end of the input string. If the resulting " +"position is out of bound an :exc:`IndexError` will be raised." +msgstr "" +"Для кодування *error_handler* буде викликано з екземпляром :exc:" +"`UnicodeEncodeError`, який містить інформацію про розташування помилки. " +"Обробник помилок повинен або викликати це чи інше виключення, або повернути " +"кортеж із заміною некодованої частини вхідних даних і позиції, де кодування " +"повинно продовжуватися. Заміна може бути :class:`str` або :class:`bytes`. " +"Якщо заміною є байти, кодер просто скопіює їх у вихідний буфер. Якщо заміна " +"є рядком, кодер закодує заміну. Кодування продовжується на початковому " +"введенні у вказаній позиції. Від’ємні значення позиції розглядатимуться як " +"такі, що відносяться до кінця вхідного рядка. Якщо результуюча позиція " +"виходить за межі, буде викликано :exc:`IndexError`." + +msgid "" +"Decoding and translating works similarly, except :exc:`UnicodeDecodeError` " +"or :exc:`UnicodeTranslateError` will be passed to the handler and that the " +"replacement from the error handler will be put into the output directly." +msgstr "" +"Декодування та переклад працює аналогічно, за винятком того, що :exc:" +"`UnicodeDecodeError` або :exc:`UnicodeTranslateError` буде передано " +"обробнику, а заміна з обробника помилок буде введена безпосередньо у вивід." + +msgid "" +"Previously registered error handlers (including the standard error handlers) " +"can be looked up by name:" +msgstr "" +"Раніше зареєстровані обробники помилок (включаючи стандартні обробники " +"помилок) можна шукати за назвою:" + +msgid "Return the error handler previously registered under the name *name*." +msgstr "" +"Повернути обробник помилок, попередньо зареєстрований під іменем *name*." + +msgid "Raises a :exc:`LookupError` in case the handler cannot be found." +msgstr "Викликає :exc:`LookupError`, якщо обробник не знайдено." + +msgid "" +"The following standard error handlers are also made available as module " +"level functions:" +msgstr "" +"Наступні стандартні обробники помилок також доступні як функції рівня модуля:" + +msgid "Implements the ``'strict'`` error handling." +msgstr "Реалізує ``'сувору'`` обробку помилок." + +msgid "Each encoding or decoding error raises a :exc:`UnicodeError`." +msgstr "Кожна помилка кодування або декодування викликає :exc:`UnicodeError`." + +msgid "Implements the ``'ignore'`` error handling." +msgstr "Реалізує обробку помилок ``'ignore''``." + +msgid "" +"Malformed data is ignored; encoding or decoding is continued without further " +"notice." +msgstr "" +"Некоректні дані ігноруються; кодування або декодування продовжується без " +"додаткового повідомлення." + +msgid "Implements the ``'replace'`` error handling." +msgstr "Реалізує обробку помилок ``'replace''``." + +msgid "" +"Substitutes ``?`` (ASCII character) for encoding errors or ``�`` (U+FFFD, " +"the official REPLACEMENT CHARACTER) for decoding errors." +msgstr "" +"Замінює ``?`` (символ ASCII) для помилок кодування або ``�`` (U+FFFD, " +"офіційний СИМВОЛ ЗАМІНИ) для помилок декодування." + +msgid "Implements the ``'backslashreplace'`` error handling." +msgstr "Реалізує обробку помилок ``'backslashreplace'``." + +msgid "" +"Malformed data is replaced by a backslashed escape sequence. On encoding, " +"use the hexadecimal form of Unicode code point with formats :samp:`\\\\x{hh}" +"` :samp:`\\\\u{xxxx}` :samp:`\\\\U{xxxxxxxx}`. On decoding, use the " +"hexadecimal form of byte value with format :samp:`\\\\x{hh}`." +msgstr "" + +msgid "Works with decoding and translating." +msgstr "Працює з декодуванням і перекладом." + +msgid "" +"Implements the ``'xmlcharrefreplace'`` error handling (for encoding within :" +"term:`text encoding` only)." +msgstr "" +"Реалізує обробку помилок ``'xmlcharrefreplace'`` (лише для кодування в " +"межах :term:`text encoding`)." + +msgid "" +"The unencodable character is replaced by an appropriate XML/HTML numeric " +"character reference, which is a decimal form of Unicode code point with " +"format :samp:`&#{num};` ." +msgstr "" + +msgid "" +"Implements the ``'namereplace'`` error handling (for encoding within :term:" +"`text encoding` only)." +msgstr "" +"Реалізує обробку помилок ``'namereplace'`` (лише для кодування в межах :term:" +"`text encoding`)." + +msgid "" +"The unencodable character is replaced by a ``\\N{...}`` escape sequence. The " +"set of characters that appear in the braces is the Name property from " +"Unicode Character Database. For example, the German lowercase letter ``'ß'`` " +"will be converted to byte sequence ``\\N{LATIN SMALL LETTER SHARP S}`` ." +msgstr "" +"Некодований символ замінюється керуючою послідовністю ``\\N{...}``. Набір " +"символів, що з’являються в фігурних дужках, є властивістю Name з бази даних " +"символів Unicode. Наприклад, німецьку малу літеру ``'ß'`` буде перетворено " +"на послідовність байтів ``\\N{LATIN SMALL LETTER SHARP S}`` ." + +msgid "Stateless Encoding and Decoding" +msgstr "Кодування та декодування без збереження стану" + +msgid "" +"The base :class:`Codec` class defines these methods which also define the " +"function interfaces of the stateless encoder and decoder:" +msgstr "" +"Базовий клас :class:`Codec` визначає ці методи, які також визначають " +"функціональні інтерфейси кодера та декодера без збереження стану:" + +msgid "" +"Encodes the object *input* and returns a tuple (output object, length " +"consumed). For instance, :term:`text encoding` converts a string object to a " +"bytes object using a particular character set encoding (e.g., ``cp1252`` or " +"``iso-8859-1``)." +msgstr "" +"Кодує об’єкт *input* і повертає кортеж (вихідний об’єкт, споживана довжина). " +"Наприклад, :term:`text encoding` перетворює рядковий об’єкт на об’єкт bytes, " +"використовуючи певне кодування набору символів (наприклад, ``cp1252`` або " +"``iso-8859-1``)." + +msgid "" +"The *errors* argument defines the error handling to apply. It defaults to " +"``'strict'`` handling." +msgstr "" +"Аргумент *errors* визначає застосовувану обробку помилок. За замовчуванням " +"``'сувора''`` обробка." + +msgid "" +"The method may not store state in the :class:`Codec` instance. Use :class:" +"`StreamWriter` for codecs which have to keep state in order to make encoding " +"efficient." +msgstr "" +"Метод може не зберігати стан в екземплярі :class:`Codec`. Використовуйте :" +"class:`StreamWriter` для кодеків, які мають зберігати стан, щоб зробити " +"кодування ефективним." + +msgid "" +"The encoder must be able to handle zero length input and return an empty " +"object of the output object type in this situation." +msgstr "" +"У цій ситуації кодер повинен мати можливість обробляти вхідні дані нульової " +"довжини та повертати порожній об’єкт типу вихідного об’єкта." + +msgid "" +"Decodes the object *input* and returns a tuple (output object, length " +"consumed). For instance, for a :term:`text encoding`, decoding converts a " +"bytes object encoded using a particular character set encoding to a string " +"object." +msgstr "" +"Декодує об’єкт *input* і повертає кортеж (вихідний об’єкт, споживана " +"довжина). Наприклад, для :term:`text encoding` декодування перетворює об’єкт " +"bytes, закодований за допомогою кодування певного набору символів, на " +"рядковий об’єкт." + +msgid "" +"For text encodings and bytes-to-bytes codecs, *input* must be a bytes object " +"or one which provides the read-only buffer interface -- for example, buffer " +"objects and memory mapped files." +msgstr "" +"Для текстових кодувань і кодеків від байтів до байтів *input* має бути " +"об’єктом bytes або таким, який забезпечує інтерфейс буфера лише для читання " +"– наприклад, об’єкти буфера та файли, відображені в пам’яті." + +msgid "" +"The method may not store state in the :class:`Codec` instance. Use :class:" +"`StreamReader` for codecs which have to keep state in order to make decoding " +"efficient." +msgstr "" +"Метод може не зберігати стан в екземплярі :class:`Codec`. Використовуйте :" +"class:`StreamReader` для кодеків, які мають зберігати стан, щоб зробити " +"декодування ефективним." + +msgid "" +"The decoder must be able to handle zero length input and return an empty " +"object of the output object type in this situation." +msgstr "" +"У цій ситуації декодер повинен мати можливість обробляти вхідні дані " +"нульової довжини та повертати порожній об’єкт типу вихідного об’єкта." + +msgid "Incremental Encoding and Decoding" +msgstr "Інкрементне кодування та декодування" + +msgid "" +"The :class:`IncrementalEncoder` and :class:`IncrementalDecoder` classes " +"provide the basic interface for incremental encoding and decoding. Encoding/" +"decoding the input isn't done with one call to the stateless encoder/decoder " +"function, but with multiple calls to the :meth:`~IncrementalEncoder.encode`/:" +"meth:`~IncrementalDecoder.decode` method of the incremental encoder/decoder. " +"The incremental encoder/decoder keeps track of the encoding/decoding process " +"during method calls." +msgstr "" +"Класи :class:`IncrementalEncoder` і :class:`IncrementalDecoder` забезпечують " +"базовий інтерфейс для інкрементного кодування та декодування. Кодування/" +"декодування вхідних даних виконується не одним викликом функції кодувальника/" +"декодера без збереження стану, а кількома викликами методу :meth:" +"`~IncrementalEncoder.encode`/:meth:`~IncrementalDecoder.decode` " +"інкрементального кодувальника /декодер. Інкрементний кодер/декодер відстежує " +"процес кодування/декодування під час викликів методів." + +msgid "" +"The joined output of calls to the :meth:`~IncrementalEncoder.encode`/:meth:" +"`~IncrementalDecoder.decode` method is the same as if all the single inputs " +"were joined into one, and this input was encoded/decoded with the stateless " +"encoder/decoder." +msgstr "" +"Об’єднаний вихід викликів методу :meth:`~IncrementalEncoder.encode`/:meth:" +"`~IncrementalDecoder.decode` такий самий, як якби всі окремі входи були " +"об’єднані в один, і цей вхід було закодовано/декодовано за допомогою кодер/" +"декодер без стану." + +msgid "IncrementalEncoder Objects" +msgstr "Об’єкти IncrementalEncoder" + +msgid "" +"The :class:`IncrementalEncoder` class is used for encoding an input in " +"multiple steps. It defines the following methods which every incremental " +"encoder must define in order to be compatible with the Python codec registry." +msgstr "" +"Клас :class:`IncrementalEncoder` використовується для кодування вхідних " +"даних у кілька кроків. Він визначає наступні методи, які повинен визначити " +"кожен інкрементальний кодер, щоб бути сумісним із реєстром кодеків Python." + +msgid "Constructor for an :class:`IncrementalEncoder` instance." +msgstr "Конструктор для екземпляра :class:`IncrementalEncoder`." + +msgid "" +"All incremental encoders must provide this constructor interface. They are " +"free to add additional keyword arguments, but only the ones defined here are " +"used by the Python codec registry." +msgstr "" +"Усі інкрементні кодери повинні забезпечувати цей інтерфейс конструктора. " +"Вони можуть вільно додавати додаткові аргументи ключових слів, але лише ті, " +"що визначені тут, використовуються реєстром кодеків Python." + +msgid "" +"The :class:`IncrementalEncoder` may implement different error handling " +"schemes by providing the *errors* keyword argument. See :ref:`error-" +"handlers` for possible values." +msgstr "" +":class:`IncrementalEncoder` може реалізовувати різні схеми обробки помилок, " +"надаючи аргумент ключового слова *errors*. Перегляньте :ref:`error-handlers` " +"можливі значення." + +msgid "" +"The *errors* argument will be assigned to an attribute of the same name. " +"Assigning to this attribute makes it possible to switch between different " +"error handling strategies during the lifetime of the :class:" +"`IncrementalEncoder` object." +msgstr "" +"Аргумент *errors* буде призначено однойменному атрибуту. Призначення цьому " +"атрибуту дає змогу перемикатися між різними стратегіями обробки помилок " +"протягом життя об’єкта :class:`IncrementalEncoder`." + +msgid "" +"Encodes *object* (taking the current state of the encoder into account) and " +"returns the resulting encoded object. If this is the last call to :meth:" +"`encode` *final* must be true (the default is false)." +msgstr "" +"Кодує *об’єкт* (з урахуванням поточного стану кодувальника) і повертає " +"отриманий закодований об’єкт. Якщо це останній виклик :meth:`encode`, " +"*final* має бути true (за умовчанням — false)." + +msgid "" +"Reset the encoder to the initial state. The output is discarded: call ``." +"encode(object, final=True)``, passing an empty byte or text string if " +"necessary, to reset the encoder and to get the output." +msgstr "" +"Скиньте кодер до початкового стану. Вихідні дані відхиляються: викличте ``." +"encode(object, final=True)``, передаючи порожній байт або текстовий рядок, " +"якщо необхідно, щоб скинути кодер і отримати вихідні дані." + +msgid "" +"Return the current state of the encoder which must be an integer. The " +"implementation should make sure that ``0`` is the most common state. (States " +"that are more complicated than integers can be converted into an integer by " +"marshaling/pickling the state and encoding the bytes of the resulting string " +"into an integer.)" +msgstr "" +"Повертає поточний стан кодувальника, який має бути цілим числом. Реалізація " +"має гарантувати, що ``0`` є найпоширенішим станом. (Стани, які є " +"складнішими, ніж цілі числа, можна перетворити на ціле число шляхом " +"маршалінгу/вибору стану та кодування байтів результуючого рядка в ціле " +"число.)" + +msgid "" +"Set the state of the encoder to *state*. *state* must be an encoder state " +"returned by :meth:`getstate`." +msgstr "" +"Встановіть стан кодера на *state*. *state* має бути станом кодувальника, " +"який повертає :meth:`getstate`." + +msgid "IncrementalDecoder Objects" +msgstr "Об’єкти IncrementalDecoder" + +msgid "" +"The :class:`IncrementalDecoder` class is used for decoding an input in " +"multiple steps. It defines the following methods which every incremental " +"decoder must define in order to be compatible with the Python codec registry." +msgstr "" +"Клас :class:`IncrementalDecoder` використовується для декодування вхідних " +"даних у кілька кроків. Він визначає наступні методи, які повинен визначити " +"кожен інкрементний декодер, щоб бути сумісним із реєстром кодеків Python." + +msgid "Constructor for an :class:`IncrementalDecoder` instance." +msgstr "Конструктор для екземпляра :class:`IncrementalDecoder`." + +msgid "" +"All incremental decoders must provide this constructor interface. They are " +"free to add additional keyword arguments, but only the ones defined here are " +"used by the Python codec registry." +msgstr "" +"Усі інкрементні декодери повинні забезпечувати цей інтерфейс конструктора. " +"Вони можуть вільно додавати додаткові аргументи ключових слів, але лише ті, " +"що визначені тут, використовуються реєстром кодеків Python." + +msgid "" +"The :class:`IncrementalDecoder` may implement different error handling " +"schemes by providing the *errors* keyword argument. See :ref:`error-" +"handlers` for possible values." +msgstr "" +":class:`IncrementalDecoder` може реалізовувати різні схеми обробки помилок, " +"надаючи аргумент ключового слова *errors*. Перегляньте :ref:`error-handlers` " +"можливі значення." + +msgid "" +"The *errors* argument will be assigned to an attribute of the same name. " +"Assigning to this attribute makes it possible to switch between different " +"error handling strategies during the lifetime of the :class:" +"`IncrementalDecoder` object." +msgstr "" +"Аргумент *errors* буде призначено однойменному атрибуту. Призначення цьому " +"атрибуту дає змогу перемикатися між різними стратегіями обробки помилок " +"протягом життя об’єкта :class:`IncrementalDecoder`." + +msgid "" +"Decodes *object* (taking the current state of the decoder into account) and " +"returns the resulting decoded object. If this is the last call to :meth:" +"`decode` *final* must be true (the default is false). If *final* is true the " +"decoder must decode the input completely and must flush all buffers. If this " +"isn't possible (e.g. because of incomplete byte sequences at the end of the " +"input) it must initiate error handling just like in the stateless case " +"(which might raise an exception)." +msgstr "" +"Декодує *об’єкт* (з урахуванням поточного стану декодера) і повертає " +"отриманий декодований об’єкт. Якщо це останній виклик :meth:`decode`, " +"*final* має бути true (за умовчанням — false). Якщо *final* має значення " +"true, декодер повинен повністю декодувати вхідні дані та скинути всі буфери. " +"Якщо це неможливо (наприклад, через неповну послідовність байтів у кінці " +"введення), він повинен ініціювати обробку помилок, як у випадку без стану " +"(що може спричинити виняток)." + +msgid "Reset the decoder to the initial state." +msgstr "Скиньте декодер до початкового стану." + +msgid "" +"Return the current state of the decoder. This must be a tuple with two " +"items, the first must be the buffer containing the still undecoded input. " +"The second must be an integer and can be additional state info. (The " +"implementation should make sure that ``0`` is the most common additional " +"state info.) If this additional state info is ``0`` it must be possible to " +"set the decoder to the state which has no input buffered and ``0`` as the " +"additional state info, so that feeding the previously buffered input to the " +"decoder returns it to the previous state without producing any output. " +"(Additional state info that is more complicated than integers can be " +"converted into an integer by marshaling/pickling the info and encoding the " +"bytes of the resulting string into an integer.)" +msgstr "" +"Повернути поточний стан декодера. Це має бути кортеж із двома елементами, " +"перший має бути буфером, що містить ще недекодований вхід. Друге має бути " +"цілим числом і може бути додатковою інформацією про стан. (Реалізація має " +"переконатися, що ``0`` є найпоширенішою додатковою інформацією про стан.) " +"Якщо ця додаткова інформація про стан ``0``, має бути можливим встановити " +"декодер у стан, який не має буферизації вхідних даних і ``0`` як додаткову " +"інформацію про стан, так що подача попередньо буферизованого вхідного " +"сигналу в декодер повертає його до попереднього стану без виведення. " +"(Додаткову інформацію про стан, яка є складнішою, ніж цілі числа, можна " +"перетворити на ціле число шляхом маршалінгу/вибору інформації та кодування " +"байтів отриманого рядка в ціле число.)" + +msgid "" +"Set the state of the decoder to *state*. *state* must be a decoder state " +"returned by :meth:`getstate`." +msgstr "" +"Встановіть стан декодера на *state*. *state* має бути станом декодера, який " +"повертає :meth:`getstate`." + +msgid "Stream Encoding and Decoding" +msgstr "Кодування та декодування потоку" + +msgid "" +"The :class:`StreamWriter` and :class:`StreamReader` classes provide generic " +"working interfaces which can be used to implement new encoding submodules " +"very easily. See :mod:`!encodings.utf_8` for an example of how this is done." +msgstr "" + +msgid "StreamWriter Objects" +msgstr "Об’єкти StreamWriter" + +msgid "" +"The :class:`StreamWriter` class is a subclass of :class:`Codec` and defines " +"the following methods which every stream writer must define in order to be " +"compatible with the Python codec registry." +msgstr "" +"Клас :class:`StreamWriter` є підкласом :class:`Codec` і визначає наступні " +"методи, які повинен визначити кожен записувач потоків, щоб бути сумісним із " +"реєстром кодеків Python." + +msgid "Constructor for a :class:`StreamWriter` instance." +msgstr "Конструктор для екземпляра :class:`StreamWriter`." + +msgid "" +"All stream writers must provide this constructor interface. They are free to " +"add additional keyword arguments, but only the ones defined here are used by " +"the Python codec registry." +msgstr "" +"Цей інтерфейс конструктора мають надавати всі автори потоків. Вони можуть " +"вільно додавати додаткові аргументи ключових слів, але лише ті, що визначені " +"тут, використовуються реєстром кодеків Python." + +msgid "" +"The *stream* argument must be a file-like object open for writing text or " +"binary data, as appropriate for the specific codec." +msgstr "" +"Аргумент *потік* має бути файлоподібним об’єктом, відкритим для запису " +"тексту або двійкових даних, відповідно до конкретного кодека." + +msgid "" +"The :class:`StreamWriter` may implement different error handling schemes by " +"providing the *errors* keyword argument. See :ref:`error-handlers` for the " +"standard error handlers the underlying stream codec may support." +msgstr "" +":class:`StreamWriter` може реалізовувати різні схеми обробки помилок, " +"надаючи аргумент ключового слова *errors*. Перегляньте :ref:`error-handlers` " +"для стандартних обробників помилок, які може підтримувати основний потоковий " +"кодек." + +msgid "" +"The *errors* argument will be assigned to an attribute of the same name. " +"Assigning to this attribute makes it possible to switch between different " +"error handling strategies during the lifetime of the :class:`StreamWriter` " +"object." +msgstr "" +"Аргумент *errors* буде призначено однойменному атрибуту. Призначення цьому " +"атрибуту дає змогу перемикатися між різними стратегіями обробки помилок " +"протягом життя об’єкта :class:`StreamWriter`." + +msgid "Writes the object's contents encoded to the stream." +msgstr "Записує закодований вміст об’єкта в потік." + +msgid "" +"Writes the concatenated iterable of strings to the stream (possibly by " +"reusing the :meth:`write` method). Infinite or very large iterables are not " +"supported. The standard bytes-to-bytes codecs do not support this method." +msgstr "" +"Записує конкатенований ітерований рядок у потік (можливо, повторно " +"використовуючи метод :meth:`write`). Нескінченні або дуже великі ітерації не " +"підтримуються. Стандартні кодеки від байтів до байтів не підтримують цей " +"метод." + +msgid "Resets the codec buffers used for keeping internal state." +msgstr "" +"Скидає буфери кодеків, які використовуються для збереження внутрішнього " +"стану." + +msgid "" +"Calling this method should ensure that the data on the output is put into a " +"clean state that allows appending of new fresh data without having to rescan " +"the whole stream to recover state." +msgstr "" +"Виклик цього методу повинен гарантувати, що дані на виході переведені в " +"чистий стан, який дозволяє додавати нові свіжі дані без необхідності " +"повторного сканування всього потоку для відновлення стану." + +msgid "" +"In addition to the above methods, the :class:`StreamWriter` must also " +"inherit all other methods and attributes from the underlying stream." +msgstr "" +"Окрім вищезазначених методів, :class:`StreamWriter` також має успадкувати " +"всі інші методи та атрибути базового потоку." + +msgid "StreamReader Objects" +msgstr "Об’єкти StreamReader" + +msgid "" +"The :class:`StreamReader` class is a subclass of :class:`Codec` and defines " +"the following methods which every stream reader must define in order to be " +"compatible with the Python codec registry." +msgstr "" +"Клас :class:`StreamReader` є підкласом :class:`Codec` і визначає наступні " +"методи, які повинен визначити кожен зчитувач потоку, щоб бути сумісним із " +"реєстром кодеків Python." + +msgid "Constructor for a :class:`StreamReader` instance." +msgstr "Конструктор для екземпляра :class:`StreamReader`." + +msgid "" +"All stream readers must provide this constructor interface. They are free to " +"add additional keyword arguments, but only the ones defined here are used by " +"the Python codec registry." +msgstr "" +"Усі зчитувачі потоків повинні надавати цей інтерфейс конструктора. Вони " +"можуть вільно додавати додаткові аргументи ключових слів, але лише ті, що " +"визначені тут, використовуються реєстром кодеків Python." + +msgid "" +"The *stream* argument must be a file-like object open for reading text or " +"binary data, as appropriate for the specific codec." +msgstr "" +"Аргумент *потік* має бути файлоподібним об’єктом, відкритим для читання " +"тексту або двійкових даних, відповідно до конкретного кодека." + +msgid "" +"The :class:`StreamReader` may implement different error handling schemes by " +"providing the *errors* keyword argument. See :ref:`error-handlers` for the " +"standard error handlers the underlying stream codec may support." +msgstr "" +":class:`StreamReader` може реалізовувати різні схеми обробки помилок, " +"надаючи аргумент ключового слова *errors*. Перегляньте :ref:`error-handlers` " +"для стандартних обробників помилок, які може підтримувати основний потоковий " +"кодек." + +msgid "" +"The *errors* argument will be assigned to an attribute of the same name. " +"Assigning to this attribute makes it possible to switch between different " +"error handling strategies during the lifetime of the :class:`StreamReader` " +"object." +msgstr "" +"Аргумент *errors* буде призначено однойменному атрибуту. Призначення цьому " +"атрибуту дає змогу перемикатися між різними стратегіями обробки помилок " +"протягом життя об’єкта :class:`StreamReader`." + +msgid "" +"The set of allowed values for the *errors* argument can be extended with :" +"func:`register_error`." +msgstr "" +"Набір дозволених значень для аргументу *errors* можна розширити за " +"допомогою :func:`register_error`." + +msgid "Decodes data from the stream and returns the resulting object." +msgstr "Декодує дані з потоку та повертає отриманий об’єкт." + +msgid "" +"The *chars* argument indicates the number of decoded code points or bytes to " +"return. The :func:`read` method will never return more data than requested, " +"but it might return less, if there is not enough available." +msgstr "" +"Аргумент *chars* вказує кількість декодованих кодових точок або байтів, які " +"потрібно повернути. Метод :func:`read` ніколи не поверне більше даних, ніж " +"вимагається, але може повернути менше, якщо їх буде недостатньо." + +msgid "" +"The *size* argument indicates the approximate maximum number of encoded " +"bytes or code points to read for decoding. The decoder can modify this " +"setting as appropriate. The default value -1 indicates to read and decode as " +"much as possible. This parameter is intended to prevent having to decode " +"huge files in one step." +msgstr "" +"Аргумент *size* вказує на приблизну максимальну кількість закодованих байтів " +"або кодових точок для читання для декодування. Декодер може змінювати цей " +"параметр за потреби. Значення за замовчуванням -1 вказує на читання та " +"декодування якомога більшої кількості. Цей параметр призначений для " +"запобігання необхідності декодувати великі файли за один крок." + +msgid "" +"The *firstline* flag indicates that it would be sufficient to only return " +"the first line, if there are decoding errors on later lines." +msgstr "" +"Прапорець *firstline* вказує на те, що було б достатньо повернути лише " +"перший рядок, якщо в наступних рядках є помилки декодування." + +msgid "" +"The method should use a greedy read strategy meaning that it should read as " +"much data as is allowed within the definition of the encoding and the given " +"size, e.g. if optional encoding endings or state markers are available on " +"the stream, these should be read too." +msgstr "" +"Метод повинен використовувати стратегію жадібного читання, тобто він повинен " +"зчитувати стільки даних, скільки дозволено у визначенні кодування та " +"заданого розміру, наприклад. якщо в потоці доступні додаткові закінчення " +"кодування або маркери стану, їх також слід прочитати." + +msgid "Read one line from the input stream and return the decoded data." +msgstr "Прочитати один рядок із вхідного потоку та повернути декодовані дані." + +msgid "" +"*size*, if given, is passed as size argument to the stream's :meth:`read` " +"method." +msgstr "" +"*size*, якщо задано, передається як аргумент розміру в метод :meth:`read` " +"потоку." + +msgid "" +"If *keepends* is false line-endings will be stripped from the lines returned." +msgstr "" +"Якщо *keepends* має значення false, закінчення рядків буде видалено з " +"повернутих рядків." + +msgid "" +"Read all lines available on the input stream and return them as a list of " +"lines." +msgstr "" +"Прочитати всі рядки, доступні у вхідному потоці, і повернути їх як список " +"рядків." + +msgid "" +"Line-endings are implemented using the codec's :meth:`decode` method and are " +"included in the list entries if *keepends* is true." +msgstr "" +"Закінчення рядків реалізуються за допомогою методу кодека :meth:`decode` і " +"включаються до записів списку, якщо *keepends* має значення true." + +msgid "" +"*sizehint*, if given, is passed as the *size* argument to the stream's :meth:" +"`read` method." +msgstr "" +"*sizehint*, якщо його задано, передається як аргумент *size* у метод потоку :" +"meth:`read`." + +msgid "" +"Note that no stream repositioning should take place. This method is " +"primarily intended to be able to recover from decoding errors." +msgstr "" +"Зауважте, що переміщення потоку не повинно відбуватися. Цей метод насамперед " +"призначений для відновлення після помилок декодування." + +msgid "" +"In addition to the above methods, the :class:`StreamReader` must also " +"inherit all other methods and attributes from the underlying stream." +msgstr "" +"Окрім вищезазначених методів, :class:`StreamReader` також має успадкувати " +"всі інші методи та атрибути базового потоку." + +msgid "StreamReaderWriter Objects" +msgstr "Об’єкти StreamReaderWriter" + +msgid "" +"The :class:`StreamReaderWriter` is a convenience class that allows wrapping " +"streams which work in both read and write modes." +msgstr "" +":class:`StreamReaderWriter` — це зручний клас, який дозволяє обгортати " +"потоки, які працюють як у режимі читання, так і в режимі запису." + +msgid "" +"The design is such that one can use the factory functions returned by the :" +"func:`lookup` function to construct the instance." +msgstr "" +"Конструкція така, що можна використовувати фабричні функції, які повертає " +"функція :func:`lookup` для створення екземпляра." + +msgid "" +"Creates a :class:`StreamReaderWriter` instance. *stream* must be a file-like " +"object. *Reader* and *Writer* must be factory functions or classes providing " +"the :class:`StreamReader` and :class:`StreamWriter` interface resp. Error " +"handling is done in the same way as defined for the stream readers and " +"writers." +msgstr "" +"Створює екземпляр :class:`StreamReaderWriter`. *потік* має бути " +"файлоподібним об’єктом. *Reader* і *Writer* повинні бути фабричними " +"функціями або класами, що забезпечують інтерфейс :class:`StreamReader` і :" +"class:`StreamWriter` відповідно. Обробка помилок виконується так само, як " +"визначено для читачів і записів потоку." + +msgid "" +":class:`StreamReaderWriter` instances define the combined interfaces of :" +"class:`StreamReader` and :class:`StreamWriter` classes. They inherit all " +"other methods and attributes from the underlying stream." +msgstr "" +"Екземпляри :class:`StreamReaderWriter` визначають комбіновані інтерфейси " +"класів :class:`StreamReader` і :class:`StreamWriter`. Вони успадковують усі " +"інші методи та атрибути від основного потоку." + +msgid "StreamRecoder Objects" +msgstr "Об’єкти StreamRecoder" + +msgid "" +"The :class:`StreamRecoder` translates data from one encoding to another, " +"which is sometimes useful when dealing with different encoding environments." +msgstr "" +":class:`StreamRecoder` переводить дані з одного кодування в інше, що іноді " +"корисно, коли ви маєте справу з різними середовищами кодування." + +msgid "" +"Creates a :class:`StreamRecoder` instance which implements a two-way " +"conversion: *encode* and *decode* work on the frontend — the data visible to " +"code calling :meth:`~StreamReader.read` and :meth:`~StreamWriter.write`, " +"while *Reader* and *Writer* work on the backend — the data in *stream*." +msgstr "" + +msgid "" +"You can use these objects to do transparent transcodings, e.g., from Latin-1 " +"to UTF-8 and back." +msgstr "" +"Ви можете використовувати ці об’єкти для прозорого перекодування, наприклад, " +"з Latin-1 на UTF-8 і назад." + +msgid "The *stream* argument must be a file-like object." +msgstr "Аргумент *потік* має бути файлоподібним об’єктом." + +msgid "" +"The *encode* and *decode* arguments must adhere to the :class:`Codec` " +"interface. *Reader* and *Writer* must be factory functions or classes " +"providing objects of the :class:`StreamReader` and :class:`StreamWriter` " +"interface respectively." +msgstr "" +"Аргументи *encode* і *decode* мають відповідати інтерфейсу :class:`Codec`. " +"*Reader* і *Writer* повинні бути фабричними функціями або класами, що " +"забезпечують об’єкти інтерфейсу :class:`StreamReader` і :class:" +"`StreamWriter` відповідно." + +msgid "" +"Error handling is done in the same way as defined for the stream readers and " +"writers." +msgstr "" +"Обробка помилок виконується так само, як визначено для читачів і записів " +"потоку." + +msgid "" +":class:`StreamRecoder` instances define the combined interfaces of :class:" +"`StreamReader` and :class:`StreamWriter` classes. They inherit all other " +"methods and attributes from the underlying stream." +msgstr "" +"Екземпляри :class:`StreamRecoder` визначають комбіновані інтерфейси класів :" +"class:`StreamReader` і :class:`StreamWriter`. Вони успадковують усі інші " +"методи та атрибути основного потоку." + +msgid "Encodings and Unicode" +msgstr "Кодування та Unicode" + +msgid "" +"Strings are stored internally as sequences of code points in range " +"``U+0000``--``U+10FFFF``. (See :pep:`393` for more details about the " +"implementation.) Once a string object is used outside of CPU and memory, " +"endianness and how these arrays are stored as bytes become an issue. As with " +"other codecs, serialising a string into a sequence of bytes is known as " +"*encoding*, and recreating the string from the sequence of bytes is known as " +"*decoding*. There are a variety of different text serialisation codecs, " +"which are collectivity referred to as :term:`text encodings `." +msgstr "" +"Рядки зберігаються внутрішньо як послідовності кодових точок у діапазоні " +"``U+0000``--``U+10FFFF``. (Див. :pep:`393` для отримання додаткової " +"інформації про реалізацію.) Коли рядковий об’єкт використовується поза " +"центральним процесором і пам’яттю, стає проблемою порядок байтів і те, як ці " +"масиви зберігаються як байти. Як і в інших кодеках, серіалізація рядка в " +"послідовність байтів відома як *кодування*, а відтворення рядка з " +"послідовності байтів відоме як *декодування*. Існує безліч різних кодеків " +"серіалізації тексту, які в сукупності називаються :term:`текстовими " +"кодуваннями `." + +msgid "" +"The simplest text encoding (called ``'latin-1'`` or ``'iso-8859-1'``) maps " +"the code points 0--255 to the bytes ``0x0``--``0xff``, which means that a " +"string object that contains code points above ``U+00FF`` can't be encoded " +"with this codec. Doing so will raise a :exc:`UnicodeEncodeError` that looks " +"like the following (although the details of the error message may differ): " +"``UnicodeEncodeError: 'latin-1' codec can't encode character '\\u1234' in " +"position 3: ordinal not in range(256)``." +msgstr "" +"Найпростіше кодування тексту (називається ``'latin-1'`` або " +"``'iso-8859-1'``) відображає кодові точки 0--255 на байти ``0x0``--``0xff``, " +"що означає, що рядковий об’єкт, який містить кодові точки вище ``U+00FF``, " +"не може бути закодований цим кодеком. Це призведе до появи :exc:" +"`UnicodeEncodeError`, яка виглядає так (хоча деталі повідомлення про помилку " +"можуть відрізнятися): ``UnicodeEncodeError: кодек 'latin-1' не може " +"закодувати символ '\\u1234' у позиції 3 : порядковий номер не в діапазоні " +"(256)``." + +msgid "" +"There's another group of encodings (the so called charmap encodings) that " +"choose a different subset of all Unicode code points and how these code " +"points are mapped to the bytes ``0x0``--``0xff``. To see how this is done " +"simply open e.g. :file:`encodings/cp1252.py` (which is an encoding that is " +"used primarily on Windows). There's a string constant with 256 characters " +"that shows you which character is mapped to which byte value." +msgstr "" +"Існує ще одна група кодувань (так звані кодування charmap), які вибирають " +"іншу підмножину всіх кодових точок Unicode і те, як ці кодові точки " +"відображаються на байти ``0x0``--``0xff``. Щоб побачити, як це робиться, " +"просто відкрийте, наприклад. :file:`encodings/cp1252.py` (це кодування, яке " +"використовується в основному в Windows). Існує рядкова константа з 256 " +"символами, яка показує, який символ зіставляється з яким значенням байта." + +msgid "" +"All of these encodings can only encode 256 of the 1114112 code points " +"defined in Unicode. A simple and straightforward way that can store each " +"Unicode code point, is to store each code point as four consecutive bytes. " +"There are two possibilities: store the bytes in big endian or in little " +"endian order. These two encodings are called ``UTF-32-BE`` and ``UTF-32-LE`` " +"respectively. Their disadvantage is that if e.g. you use ``UTF-32-BE`` on a " +"little endian machine you will always have to swap bytes on encoding and " +"decoding. ``UTF-32`` avoids this problem: bytes will always be in natural " +"endianness. When these bytes are read by a CPU with a different endianness, " +"then bytes have to be swapped though. To be able to detect the endianness of " +"a ``UTF-16`` or ``UTF-32`` byte sequence, there's the so called BOM (\"Byte " +"Order Mark\"). This is the Unicode character ``U+FEFF``. This character can " +"be prepended to every ``UTF-16`` or ``UTF-32`` byte sequence. The byte " +"swapped version of this character (``0xFFFE``) is an illegal character that " +"may not appear in a Unicode text. So when the first character in a " +"``UTF-16`` or ``UTF-32`` byte sequence appears to be a ``U+FFFE`` the bytes " +"have to be swapped on decoding. Unfortunately the character ``U+FEFF`` had a " +"second purpose as a ``ZERO WIDTH NO-BREAK SPACE``: a character that has no " +"width and doesn't allow a word to be split. It can e.g. be used to give " +"hints to a ligature algorithm. With Unicode 4.0 using ``U+FEFF`` as a ``ZERO " +"WIDTH NO-BREAK SPACE`` has been deprecated (with ``U+2060`` (``WORD " +"JOINER``) assuming this role). Nevertheless Unicode software still must be " +"able to handle ``U+FEFF`` in both roles: as a BOM it's a device to determine " +"the storage layout of the encoded bytes, and vanishes once the byte sequence " +"has been decoded into a string; as a ``ZERO WIDTH NO-BREAK SPACE`` it's a " +"normal character that will be decoded like any other." +msgstr "" +"Усі ці кодування можуть кодувати лише 256 із 1114112 кодових точок, " +"визначених у Unicode. Простий і зрозумілий спосіб збереження кожної кодової " +"точки Unicode полягає в тому, щоб зберегти кожну кодову точку у вигляді " +"чотирьох послідовних байтів. Є дві можливості: зберігати байти в порядку " +"старшого або малого порядку. Ці два кодування називаються ``UTF-32-BE`` і " +"``UTF-32-LE`` відповідно. Їх недолік полягає в тому, що якщо напр. якщо ви " +"використовуєте ``UTF-32-BE`` на машині з порядковим порядком байтів, вам " +"завжди доведеться міняти місцями байти під час кодування та декодування. " +"``UTF-32`` уникає цієї проблеми: байти завжди будуть у природному порядку " +"байтів. Коли ці байти зчитуються процесором з іншим порядком байтів, тоді " +"байти потрібно поміняти місцями. Щоб мати можливість виявити порядок байтів " +"послідовності байтів ``UTF-16`` або ``UTF-32``, існує так звана BOM " +"(\"Позначка порядку байтів\"). Це символ Unicode ``U+FEFF``. Цей символ " +"можна додавати до кожної послідовності байтів ``UTF-16`` або ``UTF-32``. " +"Версія цього символу з заміною байтів (``0xFFFE``) є неприпустимим символом, " +"який може не з’являтися в тексті Unicode. Отже, коли перший символ у " +"послідовності байтів ``UTF-16`` або ``UTF-32`` виглядає як ``U+FFFE``, байти " +"потрібно поміняти місцями під час декодування. На жаль, символ ``U+FEFF`` " +"мав другу мету як ``НУЛЬОВА ШИРИНА БЕЗ РОЗБИВУ``: символ, який не має ширини " +"і не дозволяє розділити слово. Це може напр. використовувати для надання " +"підказок алгоритму лігатури. З Юнікодом 4.0 використання ``U+FEFF`` як " +"``НУЛЬОВА ШИРИНА НЕРОЗБИВНОГО ПРОБІЛУ`` застаріло (з ``U+2060`` (``WORD " +"JOINER``) виконує цю роль). Незважаючи на це, програмне забезпечення Unicode " +"все ще має бути в змозі обробляти ``U+FEFF`` в обох ролях: як BOM, це " +"пристрій для визначення макета зберігання закодованих байтів і зникає, коли " +"послідовність байтів була декодована в рядок; як ``НУЛЬОВА ШИРИНА БЕЗ " +"РОЗБИВУ`` це звичайний символ, який буде декодовано, як і будь-який інший." + +msgid "" +"There's another encoding that is able to encode the full range of Unicode " +"characters: UTF-8. UTF-8 is an 8-bit encoding, which means there are no " +"issues with byte order in UTF-8. Each byte in a UTF-8 byte sequence consists " +"of two parts: marker bits (the most significant bits) and payload bits. The " +"marker bits are a sequence of zero to four ``1`` bits followed by a ``0`` " +"bit. Unicode characters are encoded like this (with x being payload bits, " +"which when concatenated give the Unicode character):" +msgstr "" +"Є інше кодування, яке може кодувати повний діапазон символів Unicode: UTF-8. " +"UTF-8 — це 8-бітне кодування, що означає, що в UTF-8 немає проблем із " +"порядком байтів. Кожен байт у послідовності байтів UTF-8 складається з двох " +"частин: бітів маркера (старших бітів) і бітів корисного навантаження. Біти " +"маркера являють собою послідовність із нуля до чотирьох бітів ``1``, за " +"якими йде ``0`` біт. Символи Unicode кодуються таким чином (де x є бітами " +"корисного навантаження, які при з’єднанні дають символ Unicode):" + +msgid "Range" +msgstr "Діапазон" + +msgid "Encoding" +msgstr "Кодування" + +msgid "``U-00000000`` ... ``U-0000007F``" +msgstr "``U-00000000`` ... ``U-0000007F``" + +msgid "0xxxxxxx" +msgstr "0xxxxxxx" + +msgid "``U-00000080`` ... ``U-000007FF``" +msgstr "``U-00000080`` ... ``U-000007FF``" + +msgid "110xxxxx 10xxxxxx" +msgstr "110xxxxx 10xxxxxx" + +msgid "``U-00000800`` ... ``U-0000FFFF``" +msgstr "``U-00000800`` ... ``U-0000FFFF``" + +msgid "1110xxxx 10xxxxxx 10xxxxxx" +msgstr "1110xxxx 10xxxxxx 10xxxxxx" + +msgid "``U-00010000`` ... ``U-0010FFFF``" +msgstr "``U-00010000`` ... ``U-0010FFFF``" + +msgid "11110xxx 10xxxxxx 10xxxxxx 10xxxxxx" +msgstr "11110xxx 10xxxxxx 10xxxxxx 10xxxxxx" + +msgid "" +"The least significant bit of the Unicode character is the rightmost x bit." +msgstr "Наймолодшим бітом символу Юнікод є крайній правий біт x." + +msgid "" +"As UTF-8 is an 8-bit encoding no BOM is required and any ``U+FEFF`` " +"character in the decoded string (even if it's the first character) is " +"treated as a ``ZERO WIDTH NO-BREAK SPACE``." +msgstr "" +"Оскільки UTF-8 є 8-бітним кодуванням, специфікація матеріалів не потрібна, і " +"будь-який символ ``U+FEFF`` у декодованому рядку (навіть якщо це перший " +"символ) розглядається як ``НУЛЬОВА ШИРИНА БЕЗ РОЗБИВУ`` ." + +msgid "" +"Without external information it's impossible to reliably determine which " +"encoding was used for encoding a string. Each charmap encoding can decode " +"any random byte sequence. However that's not possible with UTF-8, as UTF-8 " +"byte sequences have a structure that doesn't allow arbitrary byte sequences. " +"To increase the reliability with which a UTF-8 encoding can be detected, " +"Microsoft invented a variant of UTF-8 (that Python calls ``\"utf-8-sig\"``) " +"for its Notepad program: Before any of the Unicode characters is written to " +"the file, a UTF-8 encoded BOM (which looks like this as a byte sequence: " +"``0xef``, ``0xbb``, ``0xbf``) is written. As it's rather improbable that any " +"charmap encoded file starts with these byte values (which would e.g. map to" +msgstr "" +"Без зовнішньої інформації неможливо достовірно визначити, яке кодування було " +"використано для кодування рядка. Кожне кодування charmap може декодувати " +"будь-яку випадкову послідовність байтів. Однак це неможливо з UTF-8, " +"оскільки послідовності байтів UTF-8 мають структуру, яка не допускає " +"довільних послідовностей байтів. Щоб підвищити надійність виявлення " +"кодування UTF-8, Microsoft винайшла варіант UTF-8 (який Python називає " +"``\"utf-8-sig\"``) для своєї програми Notepad: перед будь-яким із символів " +"Unicode записується у файл, записується BOM у кодуванні UTF-8 (який виглядає " +"так як послідовність байтів: ``0xef``, ``0xbb``, ``0xbf``). Оскільки " +"малоймовірно, щоб будь-який файл, закодований charmap, починався з цих " +"значень байтів (що, наприклад, відображатиметься на" + +msgid "LATIN SMALL LETTER I WITH DIAERESIS" +msgstr "МАЛА ЛАТИНСЬКА БУКВА I З ДІАРЕЗИСОМ" + +msgid "RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK" +msgstr "ПОДВІЙНІ КУТНІ ЛАПКИ, Спрямовані вправо" + +msgid "INVERTED QUESTION MARK" +msgstr "ПЕРЕВЕРНУТИЙ ЗНАК ПИТАННЯ" + +msgid "" +"in iso-8859-1), this increases the probability that a ``utf-8-sig`` encoding " +"can be correctly guessed from the byte sequence. So here the BOM is not used " +"to be able to determine the byte order used for generating the byte " +"sequence, but as a signature that helps in guessing the encoding. On " +"encoding the utf-8-sig codec will write ``0xef``, ``0xbb``, ``0xbf`` as the " +"first three bytes to the file. On decoding ``utf-8-sig`` will skip those " +"three bytes if they appear as the first three bytes in the file. In UTF-8, " +"the use of the BOM is discouraged and should generally be avoided." +msgstr "" +"в iso-8859-1), це збільшує ймовірність того, що кодування ``utf-8-sig`` " +"можна правильно вгадати з послідовності байтів. Отже, тут BOM " +"використовується не для визначення порядку байтів, який використовується для " +"створення послідовності байтів, а як підпис, який допомагає вгадати " +"кодування. Під час кодування кодек utf-8-sig записуватиме ``0xef``, " +"``0xbb``, ``0xbf`` як перші три байти до файлу. Під час декодування ``utf-8-" +"sig`` пропустить ці три байти, якщо вони відображаються як перші три байти у " +"файлі. В UTF-8 використання BOM не рекомендується, і його слід уникати." + +msgid "Standard Encodings" +msgstr "Стандартні кодування" + +msgid "" +"Python comes with a number of codecs built-in, either implemented as C " +"functions or with dictionaries as mapping tables. The following table lists " +"the codecs by name, together with a few common aliases, and the languages " +"for which the encoding is likely used. Neither the list of aliases nor the " +"list of languages is meant to be exhaustive. Notice that spelling " +"alternatives that only differ in case or use a hyphen instead of an " +"underscore are also valid aliases; therefore, e.g. ``'utf-8'`` is a valid " +"alias for the ``'utf_8'`` codec." +msgstr "" +"Python поставляється з низкою вбудованих кодеків, реалізованих як функції C " +"або зі словниками як таблиці відображення. У наведеній нижче таблиці " +"наведено кодеки за назвами разом із кількома поширеними псевдонімами та " +"мовами, для яких, ймовірно, використовується кодування. Ні список " +"псевдонімів, ні список мов не є вичерпними. Зауважте, що варіанти написання, " +"які відрізняються лише регістром або використовують дефіс замість " +"підкреслення, також є дійсними псевдонімами; отже, напр. ``'utf-8''`` є " +"дійсним псевдонімом для ``'utf_8''`` кодека." + +msgid "" +"Some common encodings can bypass the codecs lookup machinery to improve " +"performance. These optimization opportunities are only recognized by CPython " +"for a limited set of (case insensitive) aliases: utf-8, utf8, latin-1, " +"latin1, iso-8859-1, iso8859-1, mbcs (Windows only), ascii, us-ascii, utf-16, " +"utf16, utf-32, utf32, and the same using underscores instead of dashes. " +"Using alternative aliases for these encodings may result in slower execution." +msgstr "" +"Деякі поширені кодування можуть обійти механізм пошуку кодеків для " +"підвищення продуктивності. Ці можливості оптимізації розпізнаються CPython " +"лише для обмеженого набору (незалежних від регістру) псевдонімів: utf-8, " +"utf8, latin-1, latin1, iso-8859-1, iso8859-1, mbcs (лише Windows), ascii, us " +"-ascii, utf-16, utf16, utf-32, utf32 і те саме, використовуючи підкреслення " +"замість тире. Використання альтернативних псевдонімів для цих кодувань може " +"призвести до сповільнення виконання." + +msgid "Optimization opportunity recognized for us-ascii." +msgstr "Можливість оптимізації визнана для us-ascii." + +msgid "" +"Many of the character sets support the same languages. They vary in " +"individual characters (e.g. whether the EURO SIGN is supported or not), and " +"in the assignment of characters to code positions. For the European " +"languages in particular, the following variants typically exist:" +msgstr "" +"Багато наборів символів підтримують однакові мови. Вони відрізняються за " +"окремими символами (наприклад, чи підтримується ЗНАК ЄВРО чи ні), а також за " +"призначенням символів позиціям коду. Зокрема, для європейських мов зазвичай " +"існують такі варіанти:" + +msgid "an ISO 8859 codeset" +msgstr "кодовий набір ISO 8859" + +msgid "" +"a Microsoft Windows code page, which is typically derived from an 8859 " +"codeset, but replaces control characters with additional graphic characters" +msgstr "" +"кодова сторінка Microsoft Windows, яка зазвичай походить від коду 8859, але " +"замінює контрольні символи додатковими графічними символами" + +msgid "an IBM EBCDIC code page" +msgstr "кодову сторінку IBM EBCDIC" + +msgid "an IBM PC code page, which is ASCII compatible" +msgstr "кодова сторінка IBM PC, сумісна з ASCII" + +msgid "Codec" +msgstr "Кодек" + +msgid "Aliases" +msgstr "Псевдоніми" + +msgid "Languages" +msgstr "Мови" + +msgid "ascii" +msgstr "ascii" + +msgid "646, us-ascii" +msgstr "646, us-ascii" + +msgid "English" +msgstr "англійська" + +msgid "big5" +msgstr "великий5" + +msgid "big5-tw, csbig5" +msgstr "big5-tw, csbig5" + +msgid "Traditional Chinese" +msgstr "Традиційний китайський" + +msgid "big5hkscs" +msgstr "big5hkscs" + +msgid "big5-hkscs, hkscs" +msgstr "big5-hkscs, hkscs" + +msgid "cp037" +msgstr "cp037" + +msgid "IBM037, IBM039" +msgstr "IBM037, IBM039" + +msgid "cp273" +msgstr "cp273" + +msgid "273, IBM273, csIBM273" +msgstr "273, IBM273, csIBM273" + +msgid "German" +msgstr "Німецький" + +msgid "cp424" +msgstr "cp424" + +msgid "EBCDIC-CP-HE, IBM424" +msgstr "EBCDIC-CP-HE, IBM424" + +msgid "Hebrew" +msgstr "іврит" + +msgid "cp437" +msgstr "cp437" + +msgid "437, IBM437" +msgstr "437, IBM437" + +msgid "cp500" +msgstr "cp500" + +msgid "EBCDIC-CP-BE, EBCDIC-CP-CH, IBM500" +msgstr "EBCDIC-CP-BE, EBCDIC-CP-CH, IBM500" + +msgid "Western Europe" +msgstr "Західна Європа" + +msgid "cp720" +msgstr "cp720" + +msgid "Arabic" +msgstr "арабська" + +msgid "cp737" +msgstr "cp737" + +msgid "Greek" +msgstr "грецька" + +msgid "cp775" +msgstr "cp775" + +msgid "IBM775" +msgstr "IBM775" + +msgid "Baltic languages" +msgstr "Балтійські мови" + +msgid "cp850" +msgstr "cp850" + +msgid "850, IBM850" +msgstr "850, IBM850" + +msgid "cp852" +msgstr "cp852" + +msgid "852, IBM852" +msgstr "852, IBM852" + +msgid "Central and Eastern Europe" +msgstr "Центральна та Східна Європа" + +msgid "cp855" +msgstr "cp855" + +msgid "855, IBM855" +msgstr "855, IBM855" + +msgid "Belarusian, Bulgarian, Macedonian, Russian, Serbian" +msgstr "" + +msgid "cp856" +msgstr "cp856" + +msgid "cp857" +msgstr "cp857" + +msgid "857, IBM857" +msgstr "857, IBM857" + +msgid "Turkish" +msgstr "турецька" + +msgid "cp858" +msgstr "cp858" + +msgid "858, IBM858" +msgstr "858, IBM858" + +msgid "cp860" +msgstr "cp860" + +msgid "860, IBM860" +msgstr "860, IBM860" + +msgid "Portuguese" +msgstr "португальська" + +msgid "cp861" +msgstr "cp861" + +msgid "861, CP-IS, IBM861" +msgstr "861, CP-IS, IBM861" + +msgid "Icelandic" +msgstr "ісландська" + +msgid "cp862" +msgstr "cp862" + +msgid "862, IBM862" +msgstr "862, IBM862" + +msgid "cp863" +msgstr "cp863" + +msgid "863, IBM863" +msgstr "863, IBM863" + +msgid "Canadian" +msgstr "канадський" + +msgid "cp864" +msgstr "cp864" + +msgid "IBM864" +msgstr "IBM864" + +msgid "cp865" +msgstr "cp865" + +msgid "865, IBM865" +msgstr "865, IBM865" + +msgid "Danish, Norwegian" +msgstr "датська, норвезька" + +msgid "cp866" +msgstr "cp866" + +msgid "866, IBM866" +msgstr "866, IBM866" + +msgid "Russian" +msgstr "російський" + +msgid "cp869" +msgstr "cp869" + +msgid "869, CP-GR, IBM869" +msgstr "869, CP-GR, IBM869" + +msgid "cp874" +msgstr "cp874" + +msgid "Thai" +msgstr "тайська" + +msgid "cp875" +msgstr "cp875" + +msgid "cp932" +msgstr "cp932" + +msgid "932, ms932, mskanji, ms-kanji, windows-31j" +msgstr "" + +msgid "Japanese" +msgstr "Японський" + +msgid "cp949" +msgstr "cp949" + +msgid "949, ms949, uhc" +msgstr "949, ms949, uhc" + +msgid "Korean" +msgstr "корейська" + +msgid "cp950" +msgstr "cp950" + +msgid "950, ms950" +msgstr "950, мс950" + +msgid "cp1006" +msgstr "cp1006" + +msgid "Urdu" +msgstr "урду" + +msgid "cp1026" +msgstr "cp1026" + +msgid "ibm1026" +msgstr "ibm1026" + +msgid "cp1125" +msgstr "cp1125" + +msgid "1125, ibm1125, cp866u, ruscii" +msgstr "1125, ibm1125, cp866u, рос" + +msgid "Ukrainian" +msgstr "українська" + +msgid "cp1140" +msgstr "cp1140" + +msgid "ibm1140" +msgstr "ibm1140" + +msgid "cp1250" +msgstr "cp1250" + +msgid "windows-1250" +msgstr "вікна-1250" + +msgid "cp1251" +msgstr "cp1251" + +msgid "windows-1251" +msgstr "вікна-1251" + +msgid "cp1252" +msgstr "cp1252" + +msgid "windows-1252" +msgstr "вікна-1252" + +msgid "cp1253" +msgstr "cp1253" + +msgid "windows-1253" +msgstr "вікна-1253" + +msgid "cp1254" +msgstr "cp1254" + +msgid "windows-1254" +msgstr "windows-1254" + +msgid "cp1255" +msgstr "cp1255" + +msgid "windows-1255" +msgstr "вікна-1255" + +msgid "cp1256" +msgstr "cp1256" + +msgid "windows-1256" +msgstr "вікна-1256" + +msgid "cp1257" +msgstr "cp1257" + +msgid "windows-1257" +msgstr "вікна-1257" + +msgid "cp1258" +msgstr "cp1258" + +msgid "windows-1258" +msgstr "вікна-1258" + +msgid "Vietnamese" +msgstr "в'єтнамська" + +msgid "euc_jp" +msgstr "euc_jp" + +msgid "eucjp, ujis, u-jis" +msgstr "eucjp, ujis, u-jis" + +msgid "euc_jis_2004" +msgstr "euc_jis_2004" + +msgid "jisx0213, eucjis2004" +msgstr "jisx0213, eucjis2004" + +msgid "euc_jisx0213" +msgstr "euc_jisx0213" + +msgid "eucjisx0213" +msgstr "eucjisx0213" + +msgid "euc_kr" +msgstr "euc_kr" + +msgid "euckr, korean, ksc5601, ks_c-5601, ks_c-5601-1987, ksx1001, ks_x-1001" +msgstr "" +"euckr, корейська, ksc5601, ks_c-5601, ks_c-5601-1987, ksx1001, ks_x-1001" + +msgid "gb2312" +msgstr "gb2312" + +msgid "" +"chinese, csiso58gb231280, euc-cn, euccn, eucgb2312-cn, gb2312-1980, " +"gb2312-80, iso-ir-58" +msgstr "" +"китайська, csiso58gb231280, euc-cn, euccn, eucgb2312-cn, gb2312-1980, " +"gb2312-80, iso-ir-58" + +msgid "Simplified Chinese" +msgstr "Спрощена Китайська" + +msgid "gbk" +msgstr "gbk" + +msgid "936, cp936, ms936" +msgstr "936, cp936, ms936" + +msgid "Unified Chinese" +msgstr "Єдина китайська" + +msgid "gb18030" +msgstr "gb18030" + +msgid "gb18030-2000" +msgstr "gb18030-2000" + +msgid "hz" +msgstr "Гц" + +msgid "hzgb, hz-gb, hz-gb-2312" +msgstr "hzgb, hz-gb, hz-gb-2312" + +msgid "iso2022_jp" +msgstr "iso2022_jp" + +msgid "csiso2022jp, iso2022jp, iso-2022-jp" +msgstr "csiso2022jp, iso2022jp, iso-2022-jp" + +msgid "iso2022_jp_1" +msgstr "iso2022_jp_1" + +msgid "iso2022jp-1, iso-2022-jp-1" +msgstr "iso2022jp-1, iso-2022-jp-1" + +msgid "iso2022_jp_2" +msgstr "iso2022_jp_2" + +msgid "iso2022jp-2, iso-2022-jp-2" +msgstr "iso2022jp-2, iso-2022-jp-2" + +msgid "Japanese, Korean, Simplified Chinese, Western Europe, Greek" +msgstr "Японська, корейська, спрощена китайська, західноєвропейська, грецька" + +msgid "iso2022_jp_2004" +msgstr "iso2022_jp_2004" + +msgid "iso2022jp-2004, iso-2022-jp-2004" +msgstr "iso2022jp-2004, iso-2022-jp-2004" + +msgid "iso2022_jp_3" +msgstr "iso2022_jp_3" + +msgid "iso2022jp-3, iso-2022-jp-3" +msgstr "iso2022jp-3, iso-2022-jp-3" + +msgid "iso2022_jp_ext" +msgstr "iso2022_jp_ext" + +msgid "iso2022jp-ext, iso-2022-jp-ext" +msgstr "iso2022jp-ext, iso-2022-jp-ext" + +msgid "iso2022_kr" +msgstr "iso2022_kr" + +msgid "csiso2022kr, iso2022kr, iso-2022-kr" +msgstr "csiso2022kr, iso2022kr, iso-2022-kr" + +msgid "latin_1" +msgstr "latin_1" + +msgid "iso-8859-1, iso8859-1, 8859, cp819, latin, latin1, L1" +msgstr "iso-8859-1, iso8859-1, 8859, cp819, latin, latin1, L1" + +msgid "iso8859_2" +msgstr "iso8859_2" + +msgid "iso-8859-2, latin2, L2" +msgstr "iso-8859-2, latin2, L2" + +msgid "iso8859_3" +msgstr "iso8859_3" + +msgid "iso-8859-3, latin3, L3" +msgstr "iso-8859-3, latin3, L3" + +msgid "Esperanto, Maltese" +msgstr "Есперанто, мальтійська" + +msgid "iso8859_4" +msgstr "iso8859_4" + +msgid "iso-8859-4, latin4, L4" +msgstr "iso-8859-4, latin4, L4" + +msgid "iso8859_5" +msgstr "iso8859_5" + +msgid "iso-8859-5, cyrillic" +msgstr "iso-8859-5, кирил" + +msgid "iso8859_6" +msgstr "iso8859_6" + +msgid "iso-8859-6, arabic" +msgstr "iso-8859-6, араб" + +msgid "iso8859_7" +msgstr "iso8859_7" + +msgid "iso-8859-7, greek, greek8" +msgstr "iso-8859-7, грецький, грецький8" + +msgid "iso8859_8" +msgstr "iso8859_8" + +msgid "iso-8859-8, hebrew" +msgstr "iso-8859-8, іврит" + +msgid "iso8859_9" +msgstr "iso8859_9" + +msgid "iso-8859-9, latin5, L5" +msgstr "iso-8859-9, latin5, L5" + +msgid "iso8859_10" +msgstr "iso8859_10" + +msgid "iso-8859-10, latin6, L6" +msgstr "iso-8859-10, latin6, L6" + +msgid "Nordic languages" +msgstr "Скандинавські мови" + +msgid "iso8859_11" +msgstr "iso8859_11" + +msgid "iso-8859-11, thai" +msgstr "iso-8859-11, тай" + +msgid "Thai languages" +msgstr "тайські мови" + +msgid "iso8859_13" +msgstr "iso8859_13" + +msgid "iso-8859-13, latin7, L7" +msgstr "iso-8859-13, latin7, L7" + +msgid "iso8859_14" +msgstr "iso8859_14" + +msgid "iso-8859-14, latin8, L8" +msgstr "iso-8859-14, latin8, L8" + +msgid "Celtic languages" +msgstr "кельтські мови" + +msgid "iso8859_15" +msgstr "iso8859_15" + +msgid "iso-8859-15, latin9, L9" +msgstr "iso-8859-15, latin9, L9" + +msgid "iso8859_16" +msgstr "iso8859_16" + +msgid "iso-8859-16, latin10, L10" +msgstr "iso-8859-16, latin10, L10" + +msgid "South-Eastern Europe" +msgstr "Південно-Східна Європа" + +msgid "johab" +msgstr "Йохаб" + +msgid "cp1361, ms1361" +msgstr "cp1361, ms1361" + +msgid "koi8_r" +msgstr "koi8_r" + +msgid "koi8_t" +msgstr "koi8_t" + +msgid "Tajik" +msgstr "таджицька" + +msgid "koi8_u" +msgstr "koi8_u" + +msgid "kz1048" +msgstr "kz1048" + +msgid "kz_1048, strk1048_2002, rk1048" +msgstr "kz_1048, strk1048_2002, rk1048" + +msgid "Kazakh" +msgstr "казахська" + +msgid "mac_cyrillic" +msgstr "mac_cyrillic" + +msgid "maccyrillic" +msgstr "макирилицею" + +msgid "mac_greek" +msgstr "mac_greek" + +msgid "macgreek" +msgstr "макгрік" + +msgid "mac_iceland" +msgstr "mac_iceland" + +msgid "maciceland" +msgstr "maciceland" + +msgid "mac_latin2" +msgstr "mac_latin2" + +msgid "maclatin2, maccentraleurope, mac_centeuro" +msgstr "maclatin2, maccentraleurope, mac_centeuro" + +msgid "mac_roman" +msgstr "mac_roman" + +msgid "macroman, macintosh" +msgstr "макромен, макінтош" + +msgid "mac_turkish" +msgstr "mac_turkish" + +msgid "macturkish" +msgstr "macturkish" + +msgid "ptcp154" +msgstr "ptcp154" + +msgid "csptcp154, pt154, cp154, cyrillic-asian" +msgstr "csptcp154, pt154, cp154, кирилиця-азійська" + +msgid "shift_jis" +msgstr "shift_jis" + +msgid "csshiftjis, shiftjis, sjis, s_jis" +msgstr "csshiftjis, shiftjis, sjis, s_jis" + +msgid "shift_jis_2004" +msgstr "shift_jis_2004" + +msgid "shiftjis2004, sjis_2004, sjis2004" +msgstr "shiftjis2004, sjis_2004, sjis2004" + +msgid "shift_jisx0213" +msgstr "shift_jisx0213" + +msgid "shiftjisx0213, sjisx0213, s_jisx0213" +msgstr "shiftjisx0213, sjisx0213, s_jisx0213" + +msgid "utf_32" +msgstr "utf_32" + +msgid "U32, utf32" +msgstr "U32, utf32" + +msgid "all languages" +msgstr "всі мови" + +msgid "utf_32_be" +msgstr "utf_32_be" + +msgid "UTF-32BE" +msgstr "UTF-32BE" + +msgid "utf_32_le" +msgstr "utf_32_le" + +msgid "UTF-32LE" +msgstr "UTF-32LE" + +msgid "utf_16" +msgstr "utf_16" + +msgid "U16, utf16" +msgstr "U16, utf16" + +msgid "utf_16_be" +msgstr "utf_16_be" + +msgid "UTF-16BE" +msgstr "UTF-16BE" + +msgid "utf_16_le" +msgstr "utf_16_le" + +msgid "UTF-16LE" +msgstr "UTF-16LE" + +msgid "utf_7" +msgstr "utf_7" + +msgid "U7, unicode-1-1-utf-7" +msgstr "U7, unicode-1-1-utf-7" + +msgid "utf_8" +msgstr "utf_8" + +msgid "U8, UTF, utf8, cp65001" +msgstr "U8, UTF, utf8, cp65001" + +msgid "utf_8_sig" +msgstr "utf_8_sig" + +msgid "" +"The utf-16\\* and utf-32\\* encoders no longer allow surrogate code points " +"(``U+D800``--``U+DFFF``) to be encoded. The utf-32\\* decoders no longer " +"decode byte sequences that correspond to surrogate code points." +msgstr "" +"Кодери utf-16\\* і utf-32\\* більше не дозволяють кодувати сурогатні кодові " +"точки (``U+D800``--``U+DFFF``). Декодери utf-32\\* більше не декодують " +"послідовності байтів, які відповідають сурогатним кодовим точкам." + +msgid "``cp65001`` is now an alias to ``utf_8``." +msgstr "``cp65001`` тепер є псевдонімом ``utf_8``." + +msgid "Python Specific Encodings" +msgstr "Спеціальні кодування Python" + +msgid "" +"A number of predefined codecs are specific to Python, so their codec names " +"have no meaning outside Python. These are listed in the tables below based " +"on the expected input and output types (note that while text encodings are " +"the most common use case for codecs, the underlying codec infrastructure " +"supports arbitrary data transforms rather than just text encodings). For " +"asymmetric codecs, the stated meaning describes the encoding direction." +msgstr "" +"Деякі попередньо визначені кодеки є специфічними для Python, тому їхні назви " +"кодеків не мають значення поза Python. Вони перераховані в таблицях нижче на " +"основі очікуваних типів введення та виведення (зауважте, що хоча кодування " +"тексту є найпоширенішим випадком використання кодеків, базова інфраструктура " +"кодеків підтримує довільні перетворення даних, а не лише кодування тексту). " +"Для асиметричних кодеків вказане значення описує напрямок кодування." + +msgid "Text Encodings" +msgstr "Кодування тексту" + +msgid "" +"The following codecs provide :class:`str` to :class:`bytes` encoding and :" +"term:`bytes-like object` to :class:`str` decoding, similar to the Unicode " +"text encodings." +msgstr "" +"Наступні кодеки забезпечують кодування :class:`str` до :class:`bytes` і " +"декодування :term:`bytes-like object` до :class:`str`, подібне до кодування " +"тексту Unicode." + +msgid "idna" +msgstr "idna" + +msgid "" +"Implement :rfc:`3490`, see also :mod:`encodings.idna`. Only " +"``errors='strict'`` is supported." +msgstr "" +"Реалізація :rfc:`3490`, див. також :mod:`encodings.idna`. Підтримується лише " +"``errors='strict'``." + +msgid "mbcs" +msgstr "mbcs" + +msgid "ansi, dbcs" +msgstr "ansi, dbcs" + +msgid "" +"Windows only: Encode the operand according to the ANSI codepage (CP_ACP)." +msgstr "" +"Лише для Windows: кодуйте операнд відповідно до кодової сторінки ANSI " +"(CP_ACP)." + +msgid "oem" +msgstr "oem" + +msgid "" +"Windows only: Encode the operand according to the OEM codepage (CP_OEMCP)." +msgstr "" +"Лише для Windows: кодуйте операнд відповідно до кодової сторінки OEM " +"(CP_OEMCP)." + +msgid "palmos" +msgstr "palmos" + +msgid "Encoding of PalmOS 3.5." +msgstr "Кодування PalmOS 3.5." + +msgid "punycode" +msgstr "punycode" + +msgid "Implement :rfc:`3492`. Stateful codecs are not supported." +msgstr "Впровадити :rfc:`3492`. Кодеки з підтримкою стану не підтримуються." + +msgid "raw_unicode_escape" +msgstr "raw_unicode_escape" + +msgid "" +"Latin-1 encoding with :samp:`\\\\u{XXXX}` and :samp:`\\\\U{XXXXXXXX}` for " +"other code points. Existing backslashes are not escaped in any way. It is " +"used in the Python pickle protocol." +msgstr "" + +msgid "undefined" +msgstr "невизначений" + +msgid "" +"Raise an exception for all conversions, even empty strings. The error " +"handler is ignored." +msgstr "" +"Викликати виняток для всіх перетворень, навіть для порожніх рядків. Обробник " +"помилок ігнорується." + +msgid "unicode_escape" +msgstr "unicode_escape" + +msgid "" +"Encoding suitable as the contents of a Unicode literal in ASCII-encoded " +"Python source code, except that quotes are not escaped. Decode from Latin-1 " +"source code. Beware that Python source code actually uses UTF-8 by default." +msgstr "" +"Кодування, придатне як вміст літералу Юнікод у вихідному коді Python із " +"кодуванням ASCII, за винятком того, що лапки не екрануються. Декодувати з " +"вихідного коду Latin-1. Майте на увазі, що вихідний код Python насправді " +"використовує UTF-8 за замовчуванням." + +msgid "\"unicode_internal\" codec is removed." +msgstr "Кодек \"unicode_internal\" видалено." + +msgid "Binary Transforms" +msgstr "Двійкові перетворення" + +msgid "" +"The following codecs provide binary transforms: :term:`bytes-like object` " +"to :class:`bytes` mappings. They are not supported by :meth:`bytes.decode` " +"(which only produces :class:`str` output)." +msgstr "" +"Наступні кодеки забезпечують двійкові перетворення: :term:`bytes-like " +"object` у :class:`bytes` зіставлення. Вони не підтримуються :meth:`bytes." +"decode` (який виводить лише :class:`str`)." + +msgid "Encoder / decoder" +msgstr "Кодер / декодер" + +msgid "base64_codec [#b64]_" +msgstr "base64_codec [#b64]_" + +msgid "base64, base_64" +msgstr "base64, base_64" + +msgid "" +"Convert the operand to multiline MIME base64 (the result always includes a " +"trailing ``'\\n'``)." +msgstr "" +"Перетворіть операнд на багаторядковий MIME base64 (результат завжди включає " +"``'\\n'``)." + +msgid "" +"accepts any :term:`bytes-like object` as input for encoding and decoding" +msgstr "" +"приймає будь-який :term:`bytes-like object` як вхідні дані для кодування та " +"декодування" + +msgid ":meth:`base64.encodebytes` / :meth:`base64.decodebytes`" +msgstr ":meth:`base64.encodebytes` / :meth:`base64.decodebytes`" + +msgid "bz2_codec" +msgstr "bz2_codec" + +msgid "bz2" +msgstr "bz2" + +msgid "Compress the operand using bz2." +msgstr "Стисніть операнд за допомогою bz2." + +msgid ":meth:`bz2.compress` / :meth:`bz2.decompress`" +msgstr ":meth:`bz2.compress` / :meth:`bz2.decompress`" + +msgid "hex_codec" +msgstr "hex_codec" + +msgid "hex" +msgstr "шістнадцятковий" + +msgid "" +"Convert the operand to hexadecimal representation, with two digits per byte." +msgstr "Перетворіть операнд у шістнадцяткове подання з двома цифрами на байт." + +msgid ":meth:`binascii.b2a_hex` / :meth:`binascii.a2b_hex`" +msgstr ":meth:`binascii.b2a_hex` / :meth:`binascii.a2b_hex`" + +msgid "quopri_codec" +msgstr "quopri_codec" + +msgid "quopri, quotedprintable, quoted_printable" +msgstr "quopri, quotedprintable, quoted_printable" + +msgid "Convert the operand to MIME quoted printable." +msgstr "Перетворіть операнд на MIME-цитований для друку." + +msgid ":meth:`quopri.encode` with ``quotetabs=True`` / :meth:`quopri.decode`" +msgstr ":meth:`quopri.encode` з ``quotetabs=True`` / :meth:`quopri.decode`" + +msgid "uu_codec" +msgstr "uu_codec" + +msgid "uu" +msgstr "uu" + +msgid "Convert the operand using uuencode." +msgstr "Перетворіть операнд за допомогою uuencode." + +msgid "zlib_codec" +msgstr "zlib_codec" + +msgid "zip, zlib" +msgstr "zip, zlib" + +msgid "Compress the operand using gzip." +msgstr "Стисніть операнд за допомогою gzip." + +msgid ":meth:`zlib.compress` / :meth:`zlib.decompress`" +msgstr ":meth:`zlib.compress` / :meth:`zlib.decompress`" + +msgid "" +"In addition to :term:`bytes-like objects `, " +"``'base64_codec'`` also accepts ASCII-only instances of :class:`str` for " +"decoding" +msgstr "" +"На додаток до :term:`байт-подібних об’єктів `, " +"``'base64_codec''`` також приймає лише ASCII-примірники :class:`str` для " +"декодування" + +msgid "Restoration of the binary transforms." +msgstr "Відновлення двійкових перетворень." + +msgid "Restoration of the aliases for the binary transforms." +msgstr "Відновлення псевдонімів для бінарних перетворень." + +msgid "Text Transforms" +msgstr "Перетворення тексту" + +msgid "" +"The following codec provides a text transform: a :class:`str` to :class:" +"`str` mapping. It is not supported by :meth:`str.encode` (which only " +"produces :class:`bytes` output)." +msgstr "" +"Наступний кодек забезпечує перетворення тексту: відображення :class:`str` у :" +"class:`str`. Він не підтримується :meth:`str.encode` (який виводить лише :" +"class:`bytes`)." + +msgid "rot_13" +msgstr "rot_13" + +msgid "rot13" +msgstr "гниль13" + +msgid "Return the Caesar-cypher encryption of the operand." +msgstr "Повернути шифрування операнда за допомогою шифру Цезаря." + +msgid "Restoration of the ``rot_13`` text transform." +msgstr "Відновлення текстового перетворення ``rot_13``." + +msgid "Restoration of the ``rot13`` alias." +msgstr "Відновлення псевдоніма ``rot13``." + +msgid "" +":mod:`encodings.idna` --- Internationalized Domain Names in Applications" +msgstr "" +":mod:`encodings.idna` --- Інтернаціоналізовані доменні імена в програмах" + +msgid "" +"This module implements :rfc:`3490` (Internationalized Domain Names in " +"Applications) and :rfc:`3492` (Nameprep: A Stringprep Profile for " +"Internationalized Domain Names (IDN)). It builds upon the ``punycode`` " +"encoding and :mod:`stringprep`." +msgstr "" +"Цей модуль реалізує :rfc:`3490` (інтернаціоналізовані доменні імена в " +"програмах) і :rfc:`3492` (nameprep: профіль Stringprep для " +"інтернаціоналізованих доменних імен (IDN)). Він побудований на основі " +"кодування ``punycode`` і :mod:`stringprep`." + +msgid "" +"If you need the IDNA 2008 standard from :rfc:`5891` and :rfc:`5895`, use the " +"third-party :pypi:`idna` module." +msgstr "" + +msgid "" +"These RFCs together define a protocol to support non-ASCII characters in " +"domain names. A domain name containing non-ASCII characters (such as ``www." +"Alliancefrançaise.nu``) is converted into an ASCII-compatible encoding (ACE, " +"such as ``www.xn--alliancefranaise-npb.nu``). The ACE form of the domain " +"name is then used in all places where arbitrary characters are not allowed " +"by the protocol, such as DNS queries, HTTP :mailheader:`Host` fields, and so " +"on. This conversion is carried out in the application; if possible invisible " +"to the user: The application should transparently convert Unicode domain " +"labels to IDNA on the wire, and convert back ACE labels to Unicode before " +"presenting them to the user." +msgstr "" +"Ці RFC разом визначають протокол для підтримки символів, відмінних від " +"ASCII, у доменних іменах. Доменне ім’я, що містить символи, відмінні від " +"ASCII (наприклад, ``www.Alliancefrançaise.nu``), перетворюється на ASCII-" +"сумісне кодування (ACE, наприклад ``www.xn--alliancefranaise-npb.nu``). " +"Форма ACE імені домену потім використовується в усіх місцях, де довільні " +"символи не дозволені протоколом, наприклад у запитах DNS, HTTP :mailheader:" +"`Host` тощо. Це перетворення здійснюється в додатку; якщо можливо, невидимі " +"для користувача: програма повинна прозоро перетворювати мітки домену Unicode " +"на IDNA на дроті та перетворювати мітки ACE назад у Unicode перед тим, як " +"представляти їх користувачеві." + +msgid "" +"Python supports this conversion in several ways: the ``idna`` codec " +"performs conversion between Unicode and ACE, separating an input string into " +"labels based on the separator characters defined in :rfc:`section 3.1 of RFC " +"3490 <3490#section-3.1>` and converting each label to ACE as required, and " +"conversely separating an input byte string into labels based on the ``.`` " +"separator and converting any ACE labels found into unicode. Furthermore, " +"the :mod:`socket` module transparently converts Unicode host names to ACE, " +"so that applications need not be concerned about converting host names " +"themselves when they pass them to the socket module. On top of that, modules " +"that have host names as function parameters, such as :mod:`http.client` and :" +"mod:`ftplib`, accept Unicode host names (:mod:`http.client` then also " +"transparently sends an IDNA hostname in the :mailheader:`Host` field if it " +"sends that field at all)." +msgstr "" +"Python підтримує це перетворення декількома способами: кодек ``idna`` " +"виконує перетворення між Юнікодом і ACE, розділяючи вхідний рядок на мітки " +"на основі символів-роздільників, визначених у :rfc:`розділі 3.1 RFC 3490 " +"<3490#section-3.1>`, і перетворюючи кожну мітку до ACE за потреби, і " +"навпаки, розділяючи вхідний байтовий рядок на мітки на основі роздільника ``." +"`` і перетворюючи будь-які знайдені мітки ACE в Юнікод. Крім того, модуль :" +"mod:`socket` прозоро перетворює імена хостів Unicode на ACE, тому програмам " +"не потрібно турбуватися про перетворення самих імен хостів, коли вони " +"передають їх модулю сокетів. Крім того, модулі, які мають імена хостів як " +"параметри функцій, наприклад :mod:`http.client` і :mod:`ftplib`, приймають " +"імена хостів Unicode (:mod:`http.client` потім також прозоро надсилає IDNA " +"ім’я хоста в полі :mailheader:`Host`, якщо воно взагалі надсилає це поле)." + +msgid "" +"When receiving host names from the wire (such as in reverse name lookup), no " +"automatic conversion to Unicode is performed: applications wishing to " +"present such host names to the user should decode them to Unicode." +msgstr "" +"Під час отримання імен хостів із проводу (наприклад, під час зворотного " +"пошуку імен) автоматичне перетворення в Unicode не виконується: програми, " +"які бажають надати такі імена хостів користувачеві, повинні декодувати їх у " +"Unicode." + +msgid "" +"The module :mod:`encodings.idna` also implements the nameprep procedure, " +"which performs certain normalizations on host names, to achieve case-" +"insensitivity of international domain names, and to unify similar " +"characters. The nameprep functions can be used directly if desired." +msgstr "" +"Модуль :mod:`encodings.idna` також реалізує процедуру nameprep, яка виконує " +"певні нормалізації імен хостів, щоб досягти нечутливості до регістру " +"міжнародних доменних імен і уніфікувати схожі символи. За бажанням можна " +"безпосередньо використовувати функції nameprep." + +msgid "" +"Return the nameprepped version of *label*. The implementation currently " +"assumes query strings, so ``AllowUnassigned`` is true." +msgstr "" +"Повертає запрограмовану версію *мітки*. Реалізація наразі передбачає рядки " +"запиту, тому ``AllowUnassigned`` є істинним." + +msgid "" +"Convert a label to ASCII, as specified in :rfc:`3490`. ``UseSTD3ASCIIRules`` " +"is assumed to be false." +msgstr "" +"Перетворіть мітку на ASCII, як зазначено в :rfc:`3490`. " +"``UseSTD3ASCIIRules`` вважається false." + +msgid "Convert a label to Unicode, as specified in :rfc:`3490`." +msgstr "Перетворіть мітку в Unicode, як зазначено в :rfc:`3490`." + +msgid ":mod:`encodings.mbcs` --- Windows ANSI codepage" +msgstr ":mod:`encodings.mbcs` --- кодова сторінка Windows ANSI" + +msgid "This module implements the ANSI codepage (CP_ACP)." +msgstr "Цей модуль реалізує кодову сторінку ANSI (CP_ACP)." + +msgid "Availability" +msgstr "" + +msgid "" +"Before 3.2, the *errors* argument was ignored; ``'replace'`` was always used " +"to encode, and ``'ignore'`` to decode." +msgstr "" +"До версії 3.2 аргумент *errors* ігнорувався; ``'replace'`` завжди " +"використовувався для кодування, а ``'ignore''`` для декодування." + +msgid "Support any error handler." +msgstr "Підтримка будь-якого засобу обробки помилок." + +msgid ":mod:`encodings.utf_8_sig` --- UTF-8 codec with BOM signature" +msgstr ":mod:`encodings.utf_8_sig` --- кодек UTF-8 із підписом BOM" + +msgid "" +"This module implements a variant of the UTF-8 codec. On encoding, a UTF-8 " +"encoded BOM will be prepended to the UTF-8 encoded bytes. For the stateful " +"encoder this is only done once (on the first write to the byte stream). On " +"decoding, an optional UTF-8 encoded BOM at the start of the data will be " +"skipped." +msgstr "" +"Цей модуль реалізує варіант кодека UTF-8. Під час кодування BOM у кодуванні " +"UTF-8 буде додано до байтів у кодуванні UTF-8. Для кодувальника зі " +"збереженням стану це робиться лише один раз (під час першого запису в потік " +"байтів). Під час декодування додаткова специфікація даних у кодуванні UTF-8 " +"на початку даних буде пропущена." + +msgid "Unicode" +msgstr "Unicode" + +msgid "encode" +msgstr "кодувати" + +msgid "decode" +msgstr "декодувати" + +msgid "streams" +msgstr "" + +msgid "stackable" +msgstr "" + +msgid "strict" +msgstr "" + +msgid "error handler's name" +msgstr "" + +msgid "ignore" +msgstr "" + +msgid "replace" +msgstr "" + +msgid "backslashreplace" +msgstr "" + +msgid "surrogateescape" +msgstr "" + +msgid "? (question mark)" +msgstr "? (знак питання)" + +msgid "replacement character" +msgstr "" + +msgid "\\ (backslash)" +msgstr "" + +msgid "escape sequence" +msgstr "" + +msgid "\\x" +msgstr "" + +msgid "\\u" +msgstr "" + +msgid "\\U" +msgstr "" + +msgid "xmlcharrefreplace" +msgstr "" + +msgid "namereplace" +msgstr "" + +msgid "surrogatepass" +msgstr "" diff --git a/library/codeop.po b/library/codeop.po new file mode 100644 index 000000000..19adc942a --- /dev/null +++ b/library/codeop.po @@ -0,0 +1,122 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:56+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!codeop` --- Compile Python code" +msgstr "" + +msgid "**Source code:** :source:`Lib/codeop.py`" +msgstr "**Вихідний код:** :source:`Lib/codeop.py`" + +msgid "" +"The :mod:`codeop` module provides utilities upon which the Python read-eval-" +"print loop can be emulated, as is done in the :mod:`code` module. As a " +"result, you probably don't want to use the module directly; if you want to " +"include such a loop in your program you probably want to use the :mod:`code` " +"module instead." +msgstr "" +"Модуль :mod:`codeop` надає утиліти, за допомогою яких можна емулювати цикл " +"читання-оцінки-друку Python, як це робиться в модулі :mod:`code`. У " +"результаті ви, ймовірно, не захочете використовувати модуль безпосередньо; " +"якщо ви хочете включити такий цикл у свою програму, ви, ймовірно, захочете " +"використовувати замість нього модуль :mod:`code`." + +msgid "There are two parts to this job:" +msgstr "У цій роботі є дві частини:" + +msgid "" +"Being able to tell if a line of input completes a Python statement: in " +"short, telling whether to print '``>>>``' or '``...``' next." +msgstr "" + +msgid "" +"Remembering which future statements the user has entered, so subsequent " +"input can be compiled with these in effect." +msgstr "" + +msgid "" +"The :mod:`codeop` module provides a way of doing each of these things, and a " +"way of doing them both." +msgstr "" +"Модуль :mod:`codeop` забезпечує спосіб виконання кожної з цих речей, а також " +"спосіб виконання обох." + +msgid "To do just the former:" +msgstr "Щоб зробити лише перше:" + +msgid "" +"Tries to compile *source*, which should be a string of Python code and " +"return a code object if *source* is valid Python code. In that case, the " +"filename attribute of the code object will be *filename*, which defaults to " +"``''``. Returns ``None`` if *source* is *not* valid Python code, but " +"is a prefix of valid Python code." +msgstr "" + +msgid "" +"If there is a problem with *source*, an exception will be raised. :exc:" +"`SyntaxError` is raised if there is invalid Python syntax, and :exc:" +"`OverflowError` or :exc:`ValueError` if there is an invalid literal." +msgstr "" +"Якщо є проблема з *source*, буде створено виняток. :exc:`SyntaxError` " +"виникає, якщо є недійсний синтаксис Python, і :exc:`OverflowError` або :exc:" +"`ValueError`, якщо є недійсний літерал." + +msgid "" +"The *symbol* argument determines whether *source* is compiled as a statement " +"(``'single'``, the default), as a sequence of :term:`statement` (``'exec'``) " +"or as an :term:`expression` (``'eval'``). Any other value will cause :exc:" +"`ValueError` to be raised." +msgstr "" + +msgid "" +"It is possible (but not likely) that the parser stops parsing with a " +"successful outcome before reaching the end of the source; in this case, " +"trailing symbols may be ignored instead of causing an error. For example, a " +"backslash followed by two newlines may be followed by arbitrary garbage. " +"This will be fixed once the API for the parser is better." +msgstr "" +"Можливо (але малоймовірно), що синтаксичний аналізатор припиняє синтаксичний " +"аналіз із успішним результатом до того, як досягне кінця джерела; у цьому " +"випадку кінцеві символи можуть ігноруватися замість того, щоб викликати " +"помилку. Наприклад, після зворотної скісної риски, за якою слідують два " +"символи нового рядка, може стояти довільне сміття. Це буде виправлено, коли " +"API для аналізатора стане кращим." + +msgid "" +"Instances of this class have :meth:`~object.__call__` methods identical in " +"signature to the built-in function :func:`compile`, but with the difference " +"that if the instance compiles program text containing a :mod:`__future__` " +"statement, the instance 'remembers' and compiles all subsequent program " +"texts with the statement in force." +msgstr "" + +msgid "" +"Instances of this class have :meth:`~object.__call__` methods identical in " +"signature to :func:`compile_command`; the difference is that if the instance " +"compiles program text containing a :mod:`__future__` statement, the instance " +"'remembers' and compiles all subsequent program texts with the statement in " +"force." +msgstr "" diff --git a/library/collections.po b/library/collections.po new file mode 100644 index 000000000..d1bcc93c2 --- /dev/null +++ b/library/collections.po @@ -0,0 +1,1948 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2025 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:56+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2025\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!collections` --- Container datatypes" +msgstr "" + +msgid "**Source code:** :source:`Lib/collections/__init__.py`" +msgstr "**Вихідний код:** :source:`Lib/collections/__init__.py`" + +msgid "" +"This module implements specialized container datatypes providing " +"alternatives to Python's general purpose built-in containers, :class:" +"`dict`, :class:`list`, :class:`set`, and :class:`tuple`." +msgstr "" +"Цей модуль реалізує спеціалізовані типи даних контейнерів, що є " +"альтернативою вбудованим контейнерам загального призначення Python, :class:" +"`dict`, :class:`list`, :class:`set` і :class:`tuple`." + +msgid ":func:`namedtuple`" +msgstr ":func:`namedtuple`" + +msgid "factory function for creating tuple subclasses with named fields" +msgstr "функція фабрики для створення підкласів кортежів з іменованими полями" + +msgid ":class:`deque`" +msgstr ":class:`deque`" + +msgid "list-like container with fast appends and pops on either end" +msgstr "" +"контейнер, схожий на список, із швидким додаванням і вискакуванням на обох " +"кінцях" + +msgid ":class:`ChainMap`" +msgstr ":class:`ChainMap`" + +msgid "dict-like class for creating a single view of multiple mappings" +msgstr "dict-подібний клас для створення єдиного перегляду кількох відображень" + +msgid ":class:`Counter`" +msgstr ":class:`Counter`" + +msgid "dict subclass for counting :term:`hashable` objects" +msgstr "" + +msgid ":class:`OrderedDict`" +msgstr ":class:`OrderedDict`" + +msgid "dict subclass that remembers the order entries were added" +msgstr "підклас dict, який запам’ятовує додані записи порядку" + +msgid ":class:`defaultdict`" +msgstr ":class:`defaultdict`" + +msgid "dict subclass that calls a factory function to supply missing values" +msgstr "" +"підклас dict, який викликає фабричну функцію для надання відсутніх значень" + +msgid ":class:`UserDict`" +msgstr ":class:`UserDict`" + +msgid "wrapper around dictionary objects for easier dict subclassing" +msgstr "" +"обгортка навколо об’єктів словника для легшого створення підкласів dict" + +msgid ":class:`UserList`" +msgstr ":class:`UserList`" + +msgid "wrapper around list objects for easier list subclassing" +msgstr "" +"обгортка навколо об'єктів списку для легшого створення підкласів списку" + +msgid ":class:`UserString`" +msgstr ":class:`UserString`" + +msgid "wrapper around string objects for easier string subclassing" +msgstr "" +"обгортка навколо рядкових об'єктів для легшого створення підкласів рядків" + +msgid ":class:`ChainMap` objects" +msgstr ":class:`ChainMap` об'єкти" + +msgid "" +"A :class:`ChainMap` class is provided for quickly linking a number of " +"mappings so they can be treated as a single unit. It is often much faster " +"than creating a new dictionary and running multiple :meth:`~dict.update` " +"calls." +msgstr "" +"Клас :class:`ChainMap` надається для швидкого зв’язування кількох " +"відображень, щоб їх можна було розглядати як єдине ціле. Часто це набагато " +"швидше, ніж створення нового словника та виконання кількох викликів :meth:" +"`~dict.update`." + +msgid "" +"The class can be used to simulate nested scopes and is useful in templating." +msgstr "" +"Клас можна використовувати для імітації вкладених областей і корисний у " +"створенні шаблонів." + +msgid "" +"A :class:`ChainMap` groups multiple dicts or other mappings together to " +"create a single, updateable view. If no *maps* are specified, a single " +"empty dictionary is provided so that a new chain always has at least one " +"mapping." +msgstr "" +":class:`ChainMap` групує кілька dicts або інших відображень разом, щоб " +"створити єдине оновлюване подання. Якщо *maps* не вказано, надається єдиний " +"порожній словник, щоб новий ланцюжок завжди мав принаймні одне відображення." + +msgid "" +"The underlying mappings are stored in a list. That list is public and can " +"be accessed or updated using the *maps* attribute. There is no other state." +msgstr "" +"Базові відображення зберігаються в списку. Цей список є загальнодоступним, і " +"до нього можна отримати доступ або оновити за допомогою атрибута *maps*. " +"Іншої держави немає." + +msgid "" +"Lookups search the underlying mappings successively until a key is found. " +"In contrast, writes, updates, and deletions only operate on the first " +"mapping." +msgstr "" +"Пошуки послідовно шукають базові відображення, доки не буде знайдено ключ. " +"Навпаки, записи, оновлення та видалення діють лише на першому відображенні." + +msgid "" +"A :class:`ChainMap` incorporates the underlying mappings by reference. So, " +"if one of the underlying mappings gets updated, those changes will be " +"reflected in :class:`ChainMap`." +msgstr "" +":class:`ChainMap` включає базові відображення за посиланням. Отже, якщо одне " +"з базових відображень буде оновлено, ці зміни буде відображено в :class:" +"`ChainMap`." + +msgid "" +"All of the usual dictionary methods are supported. In addition, there is a " +"*maps* attribute, a method for creating new subcontexts, and a property for " +"accessing all but the first mapping:" +msgstr "" +"Підтримуються всі звичайні словникові методи. Крім того, існує атрибут " +"*maps*, метод для створення нових підконтекстів і властивість для доступу до " +"всіх відображень, крім першого:" + +msgid "" +"A user updateable list of mappings. The list is ordered from first-searched " +"to last-searched. It is the only stored state and can be modified to change " +"which mappings are searched. The list should always contain at least one " +"mapping." +msgstr "" +"Список відображень, який можна оновлювати користувачем. Список упорядковано " +"від першого до останнього. Це єдиний стан, який зберігається, і його можна " +"змінити, щоб змінити зіставлення, які шукаються. Список завжди повинен " +"містити принаймні одне зіставлення." + +msgid "" +"Returns a new :class:`ChainMap` containing a new map followed by all of the " +"maps in the current instance. If ``m`` is specified, it becomes the new map " +"at the front of the list of mappings; if not specified, an empty dict is " +"used, so that a call to ``d.new_child()`` is equivalent to: ``ChainMap({}, " +"*d.maps)``. If any keyword arguments are specified, they update passed map " +"or new empty dict. This method is used for creating subcontexts that can be " +"updated without altering values in any of the parent mappings." +msgstr "" +"Повертає новий :class:`ChainMap`, який містить нову карту, за якою слідують " +"усі карти в поточному екземплярі. Якщо вказано ``m``, воно стає новою картою " +"на початку списку зіставлень; якщо не вказано, використовується порожній " +"dict, так що виклик ``d.new_child()`` еквівалентний: ``ChainMap({}, *d." +"maps)``. Якщо вказано будь-які аргументи ключового слова, вони оновлюють " +"передану карту або новий порожній dict. Цей метод використовується для " +"створення підконтекстів, які можна оновлювати без зміни значень у будь-якому " +"з батьківських відображень." + +msgid "The optional ``m`` parameter was added." +msgstr "Додано необов’язковий параметр ``m``." + +msgid "Keyword arguments support was added." +msgstr "Додано підтримку аргументів ключових слів." + +msgid "" +"Property returning a new :class:`ChainMap` containing all of the maps in the " +"current instance except the first one. This is useful for skipping the " +"first map in the search. Use cases are similar to those for the :keyword:" +"`nonlocal` keyword used in :term:`nested scopes `. The use " +"cases also parallel those for the built-in :func:`super` function. A " +"reference to ``d.parents`` is equivalent to: ``ChainMap(*d.maps[1:])``." +msgstr "" +"Властивість, що повертає новий :class:`ChainMap`, що містить усі карти в " +"поточному екземплярі, крім першої. Це корисно для пропуску першої карти в " +"пошуку. Випадки використання схожі на випадки використання ключового слова :" +"keyword:`nonlocal`, що використовується у :term:`вкладених областях `. Випадки використання також аналогічні використанню вбудованої " +"функції :func:`super`. Посилання на ``d.parents`` еквівалентне: " +"``ChainMap(*d.maps[1:])``." + +msgid "" +"Note, the iteration order of a :class:`ChainMap` is determined by scanning " +"the mappings last to first::" +msgstr "" + +msgid "" +">>> baseline = {'music': 'bach', 'art': 'rembrandt'}\n" +">>> adjustments = {'art': 'van gogh', 'opera': 'carmen'}\n" +">>> list(ChainMap(adjustments, baseline))\n" +"['music', 'art', 'opera']" +msgstr "" + +msgid "" +"This gives the same ordering as a series of :meth:`dict.update` calls " +"starting with the last mapping::" +msgstr "" +"Це дає такий самий порядок, як і серія викликів :meth:`dict.update`, " +"починаючи з останнього відображення::" + +msgid "" +">>> combined = baseline.copy()\n" +">>> combined.update(adjustments)\n" +">>> list(combined)\n" +"['music', 'art', 'opera']" +msgstr "" + +msgid "Added support for ``|`` and ``|=`` operators, specified in :pep:`584`." +msgstr "Додано підтримку операторів ``|`` і ``|=``, указаних у :pep:`584`." + +msgid "" +"The `MultiContext class `_ in the Enthought `CodeTools package " +"`_ has options to support writing to " +"any mapping in the chain." +msgstr "" +"`MultiContext class `_ у пакеті Enthought `CodeTools " +"`_ має опції для підтримки запису в " +"будь-яке відображення в ланцюжку." + +msgid "" +"Django's `Context class `_ for templating is a read-only chain of mappings. It " +"also features pushing and popping of contexts similar to the :meth:" +"`~collections.ChainMap.new_child` method and the :attr:`~collections." +"ChainMap.parents` property." +msgstr "" +"`Клас контексту Django `_ для створення шаблонів — це ланцюжок відображень лише " +"для читання. Він також має функцію надсилання та витягування контекстів, " +"подібних до методу :meth:`~collections.ChainMap.new_child` і властивості :" +"attr:`~collections.ChainMap.parents`." + +msgid "" +"The `Nested Contexts recipe `_ has options to control " +"whether writes and other mutations apply only to the first mapping or to any " +"mapping in the chain." +msgstr "" + +msgid "" +"A `greatly simplified read-only version of Chainmap `_." +msgstr "" +"`Значно спрощена версія Chainmap тільки для читання `_." + +msgid ":class:`ChainMap` Examples and Recipes" +msgstr ":class:`ChainMap` Приклади та рецепти" + +msgid "This section shows various approaches to working with chained maps." +msgstr "" +"У цьому розділі показано різні підходи до роботи з ланцюжковими картами." + +msgid "Example of simulating Python's internal lookup chain::" +msgstr "Приклад симуляції внутрішнього ланцюжка пошуку Python::" + +msgid "" +"import builtins\n" +"pylookup = ChainMap(locals(), globals(), vars(builtins))" +msgstr "" + +msgid "" +"Example of letting user specified command-line arguments take precedence " +"over environment variables which in turn take precedence over default " +"values::" +msgstr "" +"Приклад надання переваги заданим користувачем аргументам командного рядка " +"над змінними середовища, які, у свою чергу, мають пріоритет над значеннями " +"за замовчуванням::" + +msgid "" +"import os, argparse\n" +"\n" +"defaults = {'color': 'red', 'user': 'guest'}\n" +"\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument('-u', '--user')\n" +"parser.add_argument('-c', '--color')\n" +"namespace = parser.parse_args()\n" +"command_line_args = {k: v for k, v in vars(namespace).items() if v is not " +"None}\n" +"\n" +"combined = ChainMap(command_line_args, os.environ, defaults)\n" +"print(combined['color'])\n" +"print(combined['user'])" +msgstr "" + +msgid "" +"Example patterns for using the :class:`ChainMap` class to simulate nested " +"contexts::" +msgstr "" +"Приклади шаблонів використання класу :class:`ChainMap` для імітації " +"вкладених контекстів::" + +msgid "" +"c = ChainMap() # Create root context\n" +"d = c.new_child() # Create nested child context\n" +"e = c.new_child() # Child of c, independent from d\n" +"e.maps[0] # Current context dictionary -- like Python's " +"locals()\n" +"e.maps[-1] # Root context -- like Python's globals()\n" +"e.parents # Enclosing context chain -- like Python's nonlocals\n" +"\n" +"d['x'] = 1 # Set value in current context\n" +"d['x'] # Get first key in the chain of contexts\n" +"del d['x'] # Delete from current context\n" +"list(d) # All nested values\n" +"k in d # Check all nested values\n" +"len(d) # Number of nested values\n" +"d.items() # All nested items\n" +"dict(d) # Flatten into a regular dictionary" +msgstr "" + +msgid "" +"The :class:`ChainMap` class only makes updates (writes and deletions) to the " +"first mapping in the chain while lookups will search the full chain. " +"However, if deep writes and deletions are desired, it is easy to make a " +"subclass that updates keys found deeper in the chain::" +msgstr "" +"Клас :class:`ChainMap` лише оновлює (записує та видаляє) перше відображення " +"в ланцюжку, тоді як пошук шукатиме повний ланцюжок. Однак, якщо потрібні " +"глибокі записи та видалення, легко створити підклас, який оновлює ключі, " +"знайдені глибше в ланцюжку:" + +msgid "" +"class DeepChainMap(ChainMap):\n" +" 'Variant of ChainMap that allows direct updates to inner scopes'\n" +"\n" +" def __setitem__(self, key, value):\n" +" for mapping in self.maps:\n" +" if key in mapping:\n" +" mapping[key] = value\n" +" return\n" +" self.maps[0][key] = value\n" +"\n" +" def __delitem__(self, key):\n" +" for mapping in self.maps:\n" +" if key in mapping:\n" +" del mapping[key]\n" +" return\n" +" raise KeyError(key)\n" +"\n" +">>> d = DeepChainMap({'zebra': 'black'}, {'elephant': 'blue'}, {'lion': " +"'yellow'})\n" +">>> d['lion'] = 'orange' # update an existing key two levels down\n" +">>> d['snake'] = 'red' # new keys get added to the topmost dict\n" +">>> del d['elephant'] # remove an existing key one level down\n" +">>> d # display result\n" +"DeepChainMap({'zebra': 'black', 'snake': 'red'}, {}, {'lion': 'orange'})" +msgstr "" + +msgid ":class:`Counter` objects" +msgstr ":class:`Counter` об'єкти" + +msgid "" +"A counter tool is provided to support convenient and rapid tallies. For " +"example::" +msgstr "" +"Надається інструмент лічильника для зручного та швидкого підрахунку. " +"Наприклад::" + +msgid "" +">>> # Tally occurrences of words in a list\n" +">>> cnt = Counter()\n" +">>> for word in ['red', 'blue', 'red', 'green', 'blue', 'blue']:\n" +"... cnt[word] += 1\n" +"...\n" +">>> cnt\n" +"Counter({'blue': 3, 'red': 2, 'green': 1})\n" +"\n" +">>> # Find the ten most common words in Hamlet\n" +">>> import re\n" +">>> words = re.findall(r'\\w+', open('hamlet.txt').read().lower())\n" +">>> Counter(words).most_common(10)\n" +"[('the', 1143), ('and', 966), ('to', 762), ('of', 669), ('i', 631),\n" +" ('you', 554), ('a', 546), ('my', 514), ('hamlet', 471), ('in', 451)]" +msgstr "" + +msgid "" +"A :class:`Counter` is a :class:`dict` subclass for counting :term:`hashable` " +"objects. It is a collection where elements are stored as dictionary keys and " +"their counts are stored as dictionary values. Counts are allowed to be any " +"integer value including zero or negative counts. The :class:`Counter` class " +"is similar to bags or multisets in other languages." +msgstr "" + +msgid "" +"Elements are counted from an *iterable* or initialized from another " +"*mapping* (or counter):" +msgstr "" +"Елементи підраховуються з *iterable* або ініціалізуються з іншого *mapping* " +"(або лічильника):" + +msgid "" +"Counter objects have a dictionary interface except that they return a zero " +"count for missing items instead of raising a :exc:`KeyError`:" +msgstr "" +"Об’єкти лічильників мають інтерфейс словника, за винятком того, що вони " +"повертають нульову кількість для відсутніх елементів замість того, щоб " +"викликати :exc:`KeyError`:" + +msgid "" +"Setting a count to zero does not remove an element from a counter. Use " +"``del`` to remove it entirely:" +msgstr "" +"Встановлення лічильника на нуль не видаляє елемент із лічильника. " +"Використовуйте ``del``, щоб видалити його повністю:" + +msgid "" +"As a :class:`dict` subclass, :class:`Counter` inherited the capability to " +"remember insertion order. Math operations on *Counter* objects also " +"preserve order. Results are ordered according to when an element is first " +"encountered in the left operand and then by the order encountered in the " +"right operand." +msgstr "" +"Як підклас :class:`dict`, :class:`Counter` успадкував можливість " +"запам’ятовувати порядок вставки. Математичні операції над об’єктами " +"*Counter* також зберігають порядок. Результати впорядковуються відповідно до " +"того, коли елемент вперше зустрічається в лівому операнді, а потім у порядку " +"зустрічі в правому операнді." + +msgid "" +"Counter objects support additional methods beyond those available for all " +"dictionaries:" +msgstr "" +"Об’єкти лічильників підтримують додаткові методи, окрім тих, що доступні для " +"всіх словників:" + +msgid "" +"Return an iterator over elements repeating each as many times as its count. " +"Elements are returned in the order first encountered. If an element's count " +"is less than one, :meth:`elements` will ignore it." +msgstr "" +"Повертає ітератор над елементами, повторюючи кожен стільки разів, скільки " +"його кількість. Елементи повертаються в тому порядку, в якому вони " +"зустрічаються першими. Якщо кількість елемента менше одиниці, :meth:" +"`elements` проігнорує його." + +msgid "" +"Return a list of the *n* most common elements and their counts from the most " +"common to the least. If *n* is omitted or ``None``, :meth:`most_common` " +"returns *all* elements in the counter. Elements with equal counts are " +"ordered in the order first encountered:" +msgstr "" +"Повертає список з *n* найпоширеніших елементів і їх підрахунок від найбільш " +"поширених до найменших. Якщо *n* пропущено або ``None``, :meth:`most_common` " +"повертає *всі* елементи в лічильнику. Елементи з рівною кількістю " +"впорядковуються в порядку, коли вони зустрічаються першими:" + +msgid "" +"Elements are subtracted from an *iterable* or from another *mapping* (or " +"counter). Like :meth:`dict.update` but subtracts counts instead of " +"replacing them. Both inputs and outputs may be zero or negative." +msgstr "" +"Елементи віднімаються з *iterable* або з іншого *mapping* (або лічильника). " +"Подібно до :meth:`dict.update`, але кількість віднімає, а не замінює. І " +"входи, і виходи можуть бути нульовими або негативними." + +msgid "Compute the sum of the counts." +msgstr "Обчисліть суму підрахунків." + +msgid "" +"The usual dictionary methods are available for :class:`Counter` objects " +"except for two which work differently for counters." +msgstr "" +"Звичайні методи словника доступні для об’єктів :class:`Counter`, за винятком " +"двох, які працюють по-різному для лічильників." + +msgid "This class method is not implemented for :class:`Counter` objects." +msgstr "Цей метод класу не реалізований для об’єктів :class:`Counter`." + +msgid "" +"Elements are counted from an *iterable* or added-in from another *mapping* " +"(or counter). Like :meth:`dict.update` but adds counts instead of replacing " +"them. Also, the *iterable* is expected to be a sequence of elements, not a " +"sequence of ``(key, value)`` pairs." +msgstr "" +"Елементи підраховуються від *iterable* або add-in від іншого *mapping* (або " +"лічильника). Як :meth:`dict.update`, але додає лічильники замість їх заміни. " +"Крім того, очікується, що *iterable* буде послідовністю елементів, а не " +"послідовністю пар ``(ключ, значення)``." + +msgid "" +"Counters support rich comparison operators for equality, subset, and " +"superset relationships: ``==``, ``!=``, ``<``, ``<=``, ``>``, ``>=``. All of " +"those tests treat missing elements as having zero counts so that " +"``Counter(a=1) == Counter(a=1, b=0)`` returns true." +msgstr "" +"Лічильники підтримують розширені оператори порівняння для зв’язків рівності, " +"підмножини та надмножини: ``==``, ``!=``, ``<``, ``<=``, ``>``, ``>=``. Усі " +"ці тести розглядають відсутні елементи як такі, що мають нульову кількість, " +"тому ``Counter(a=1) == Counter(a=1, b=0)`` повертає true." + +msgid "Rich comparison operations were added." +msgstr "Додано розширені операції порівняння." + +msgid "" +"In equality tests, missing elements are treated as having zero counts. " +"Formerly, ``Counter(a=3)`` and ``Counter(a=3, b=0)`` were considered " +"distinct." +msgstr "" +"У тестах на рівність відсутні елементи розглядаються як такі, що мають " +"нульову кількість. Раніше ``Counter(a=3)`` і ``Counter(a=3, b=0)`` вважалися " +"різними." + +msgid "Common patterns for working with :class:`Counter` objects::" +msgstr "Загальні шаблони для роботи з об'єктами :class:`Counter`::" + +msgid "" +"c.total() # total of all counts\n" +"c.clear() # reset all counts\n" +"list(c) # list unique elements\n" +"set(c) # convert to a set\n" +"dict(c) # convert to a regular dictionary\n" +"c.items() # access the (elem, cnt) pairs\n" +"Counter(dict(list_of_pairs)) # convert from a list of (elem, cnt) pairs\n" +"c.most_common()[:-n-1:-1] # n least common elements\n" +"+c # remove zero and negative counts" +msgstr "" + +msgid "" +"Several mathematical operations are provided for combining :class:`Counter` " +"objects to produce multisets (counters that have counts greater than zero). " +"Addition and subtraction combine counters by adding or subtracting the " +"counts of corresponding elements. Intersection and union return the minimum " +"and maximum of corresponding counts. Equality and inclusion compare " +"corresponding counts. Each operation can accept inputs with signed counts, " +"but the output will exclude results with counts of zero or less." +msgstr "" +"Передбачено кілька математичних операцій для об’єднання об’єктів :class:" +"`Counter` для створення мультимножин (лічильників, які мають кількість, " +"більшу за нуль). Додавання та віднімання поєднують лічильники шляхом " +"додавання або віднімання підрахунків відповідних елементів. Перетин і " +"об’єднання повертають мінімальне та максимальне значення відповідних " +"підрахунків. Рівність і включення порівнюють відповідні підрахунки. Кожна " +"операція може приймати вхідні дані зі знаком підрахунків, але вихід " +"виключатиме результати з нульовими чи меншими значеннями." + +msgid "" +">>> c = Counter(a=3, b=1)\n" +">>> d = Counter(a=1, b=2)\n" +">>> c + d # add two counters together: c[x] + d[x]\n" +"Counter({'a': 4, 'b': 3})\n" +">>> c - d # subtract (keeping only positive counts)\n" +"Counter({'a': 2})\n" +">>> c & d # intersection: min(c[x], d[x])\n" +"Counter({'a': 1, 'b': 1})\n" +">>> c | d # union: max(c[x], d[x])\n" +"Counter({'a': 3, 'b': 2})\n" +">>> c == d # equality: c[x] == d[x]\n" +"False\n" +">>> c <= d # inclusion: c[x] <= d[x]\n" +"False" +msgstr "" + +msgid "" +"Unary addition and subtraction are shortcuts for adding an empty counter or " +"subtracting from an empty counter." +msgstr "" +"Унарне додавання та віднімання — це ярлики для додавання порожнього " +"лічильника або віднімання з порожнього лічильника." + +msgid "" +"Added support for unary plus, unary minus, and in-place multiset operations." +msgstr "" +"Додано підтримку унарних операцій плюс, унарний мінус і мультимножинних " +"операцій на місці." + +msgid "" +"Counters were primarily designed to work with positive integers to represent " +"running counts; however, care was taken to not unnecessarily preclude use " +"cases needing other types or negative values. To help with those use cases, " +"this section documents the minimum range and type restrictions." +msgstr "" +"Лічильники були в основному розроблені для роботи з позитивними цілими " +"числами для представлення поточних підрахунків; однак було вжито заходів для " +"того, щоб без потреби не виключити випадки використання, які потребують " +"інших типів або від’ємних значень. Щоб допомогти з цими випадками " +"використання, у цьому розділі описані мінімальні обмеження діапазону та типу." + +msgid "" +"The :class:`Counter` class itself is a dictionary subclass with no " +"restrictions on its keys and values. The values are intended to be numbers " +"representing counts, but you *could* store anything in the value field." +msgstr "" +"Сам клас :class:`Counter` є підкласом словника без обмежень щодо його ключів " +"і значень. Значення мають бути числами, що представляють кількість, але ви " +"*можете* зберігати будь-що в полі значення." + +msgid "" +"The :meth:`~Counter.most_common` method requires only that the values be " +"orderable." +msgstr "" +"Метод :meth:`~Counter.most_common` вимагає лише того, щоб значення можна " +"було впорядкувати." + +msgid "" +"For in-place operations such as ``c[key] += 1``, the value type need only " +"support addition and subtraction. So fractions, floats, and decimals would " +"work and negative values are supported. The same is also true for :meth:" +"`~Counter.update` and :meth:`~Counter.subtract` which allow negative and " +"zero values for both inputs and outputs." +msgstr "" +"Для операцій на місці, таких як ``c[key] += 1``, тип значення потребує лише " +"підтримки додавання та віднімання. Отже, дроби, числа з плаваючою точкою та " +"десяткові дроби працюватимуть, а від’ємні значення підтримуються. Те ж саме " +"вірно для :meth:`~Counter.update` і :meth:`~Counter.subtract`, які " +"дозволяють від’ємні та нульові значення як для входів, так і для виходів." + +msgid "" +"The multiset methods are designed only for use cases with positive values. " +"The inputs may be negative or zero, but only outputs with positive values " +"are created. There are no type restrictions, but the value type needs to " +"support addition, subtraction, and comparison." +msgstr "" +"Мультимножинні методи призначені лише для випадків використання з " +"позитивними значеннями. Вхідні дані можуть бути від’ємними або нульовими, " +"але створюються лише виходи з позитивними значеннями. Немає обмежень щодо " +"типів, але тип значення має підтримувати додавання, віднімання та порівняння." + +msgid "" +"The :meth:`~Counter.elements` method requires integer counts. It ignores " +"zero and negative counts." +msgstr "" +"Метод :meth:`~Counter.elements` вимагає підрахунку цілих чисел. Він ігнорує " +"нульові та негативні значення." + +msgid "" +"`Bag class `_ in Smalltalk." +msgstr "" +"`Клас сумки `_ у Smalltalk." + +msgid "" +"Wikipedia entry for `Multisets `_." +msgstr "" +"Запис у Вікіпедії для `Мультимножини `_." + +msgid "" +"`C++ multisets `_ tutorial with examples." +msgstr "" +"`C++ multisets `_ посібник із прикладами." + +msgid "" +"For mathematical operations on multisets and their use cases, see *Knuth, " +"Donald. The Art of Computer Programming Volume II, Section 4.6.3, Exercise " +"19*." +msgstr "" +"Про математичні операції над мультимножинами та випадки їх використання див. " +"*Knuth, Donald. Мистецтво комп’ютерного програмування, том II, розділ 4.6.3, " +"вправа 19*." + +msgid "" +"To enumerate all distinct multisets of a given size over a given set of " +"elements, see :func:`itertools.combinations_with_replacement`::" +msgstr "" +"Щоб перерахувати всі різні мультимножини заданого розміру над заданим " +"набором елементів, перегляньте :func:`itertools." +"combinations_with_replacement`::" + +msgid "" +"map(Counter, combinations_with_replacement('ABC', 2)) # --> AA AB AC BB BC CC" +msgstr "" + +msgid ":class:`deque` objects" +msgstr ":class:`deque` об'єкти" + +msgid "" +"Returns a new deque object initialized left-to-right (using :meth:`append`) " +"with data from *iterable*. If *iterable* is not specified, the new deque is " +"empty." +msgstr "" +"Повертає новий об’єкт deque, ініціалізований зліва направо (за допомогою :" +"meth:`append`) з даними з *iterable*. Якщо *iterable* не вказано, нова " +"двочерга порожня." + +msgid "" +"Deques are a generalization of stacks and queues (the name is pronounced " +"\"deck\" and is short for \"double-ended queue\"). Deques support thread-" +"safe, memory efficient appends and pops from either side of the deque with " +"approximately the same *O*\\ (1) performance in either direction." +msgstr "" + +msgid "" +"Though :class:`list` objects support similar operations, they are optimized " +"for fast fixed-length operations and incur *O*\\ (*n*) memory movement costs " +"for ``pop(0)`` and ``insert(0, v)`` operations which change both the size " +"and position of the underlying data representation." +msgstr "" + +msgid "" +"If *maxlen* is not specified or is ``None``, deques may grow to an arbitrary " +"length. Otherwise, the deque is bounded to the specified maximum length. " +"Once a bounded length deque is full, when new items are added, a " +"corresponding number of items are discarded from the opposite end. Bounded " +"length deques provide functionality similar to the ``tail`` filter in Unix. " +"They are also useful for tracking transactions and other pools of data where " +"only the most recent activity is of interest." +msgstr "" +"Якщо *maxlen* не вказано або має значення ``None``, дві версії можуть " +"зростати до довільної довжини. В іншому випадку двочерга обмежена до " +"вказаної максимальної довжини. Коли двочерга обмеженої довжини заповнюється, " +"коли додаються нові елементи, відповідна кількість елементів відкидається з " +"протилежного кінця. Обмежена довжина двох рядків забезпечує " +"функціональність, подібну до фільтра ``tail`` в Unix. Вони також корисні для " +"відстеження транзакцій та інших наборів даних, де цікаві лише останні дії." + +msgid "Deque objects support the following methods:" +msgstr "Об’єкти Deque підтримують такі методи:" + +msgid "Add *x* to the right side of the deque." +msgstr "Додайте *x* до правої сторони дека." + +msgid "Add *x* to the left side of the deque." +msgstr "Додайте *x* до лівої сторони дека." + +msgid "Remove all elements from the deque leaving it with length 0." +msgstr "Видаліть усі елементи з двоканального ряду, залишивши його довжиною 0." + +msgid "Create a shallow copy of the deque." +msgstr "Створіть поверхневу копію deque." + +msgid "Count the number of deque elements equal to *x*." +msgstr "Підрахуйте кількість елементів deque, що дорівнює *x*." + +msgid "" +"Extend the right side of the deque by appending elements from the iterable " +"argument." +msgstr "" +"Розширте праву частину двоканального ряду, додавши елементи з ітерованого " +"аргументу." + +msgid "" +"Extend the left side of the deque by appending elements from *iterable*. " +"Note, the series of left appends results in reversing the order of elements " +"in the iterable argument." +msgstr "" +"Розширте ліву сторону двостороннього коду, додавши елементи з *iterable*. " +"Зауважте, що серія лівих додань призводить до зміни порядку елементів у " +"повторюваному аргументі." + +msgid "" +"Return the position of *x* in the deque (at or after index *start* and " +"before index *stop*). Returns the first match or raises :exc:`ValueError` " +"if not found." +msgstr "" +"Повертає позицію *x* у черзі (за індексом *start* і перед індексом *stop*). " +"Повертає перший збіг або викликає :exc:`ValueError`, якщо не знайдено." + +msgid "Insert *x* into the deque at position *i*." +msgstr "Вставте *x* у рядок у позицію *i*." + +msgid "" +"If the insertion would cause a bounded deque to grow beyond *maxlen*, an :" +"exc:`IndexError` is raised." +msgstr "" +"Якщо вставка призведе до того, що обмежена двочерга виросте за межі " +"*maxlen*, виникає :exc:`IndexError`." + +msgid "" +"Remove and return an element from the right side of the deque. If no " +"elements are present, raises an :exc:`IndexError`." +msgstr "" +"Видаліть і поверніть елемент з правого боку двоканальної таблиці. Якщо немає " +"елементів, викликає :exc:`IndexError`." + +msgid "" +"Remove and return an element from the left side of the deque. If no elements " +"are present, raises an :exc:`IndexError`." +msgstr "" +"Видаліть і поверніть елемент з лівої сторони двосторонньої версії. Якщо " +"немає елементів, викликає :exc:`IndexError`." + +msgid "" +"Remove the first occurrence of *value*. If not found, raises a :exc:" +"`ValueError`." +msgstr "" +"Видаліть перше входження *значення*. Якщо не знайдено, викликає :exc:" +"`ValueError`." + +msgid "Reverse the elements of the deque in-place and then return ``None``." +msgstr "Перевернути елементи дек-версії на місці, а потім повернути ``None``." + +msgid "" +"Rotate the deque *n* steps to the right. If *n* is negative, rotate to the " +"left." +msgstr "" +"Поверніть двічі *n* кроків праворуч. Якщо *n* від’ємне, поверніть ліворуч." + +msgid "" +"When the deque is not empty, rotating one step to the right is equivalent to " +"``d.appendleft(d.pop())``, and rotating one step to the left is equivalent " +"to ``d.append(d.popleft())``." +msgstr "" +"Якщо двочерга не порожня, поворот на один крок праворуч еквівалентний ``d." +"appendleft(d.pop())`` , а поворот на один крок ліворуч еквівалентний ``d." +"append(d.popleft ())``." + +msgid "Deque objects also provide one read-only attribute:" +msgstr "Об’єкти Deque також надають один атрибут лише для читання:" + +msgid "Maximum size of a deque or ``None`` if unbounded." +msgstr "Максимальний розмір двочергового рядка або ``None``, якщо необмежений." + +msgid "" +"In addition to the above, deques support iteration, pickling, ``len(d)``, " +"``reversed(d)``, ``copy.copy(d)``, ``copy.deepcopy(d)``, membership testing " +"with the :keyword:`in` operator, and subscript references such as ``d[0]`` " +"to access the first element. Indexed access is *O*\\ (1) at both ends but " +"slows to *O*\\ (*n*) in the middle. For fast random access, use lists " +"instead." +msgstr "" + +msgid "" +"Starting in version 3.5, deques support ``__add__()``, ``__mul__()``, and " +"``__imul__()``." +msgstr "" +"Починаючи з версії 3.5, deques підтримують ``__add__()``, ``__mul__()`` і " +"``__imul__()``." + +msgid "Example:" +msgstr "приклад:" + +msgid "" +">>> from collections import deque\n" +">>> d = deque('ghi') # make a new deque with three items\n" +">>> for elem in d: # iterate over the deque's elements\n" +"... print(elem.upper())\n" +"G\n" +"H\n" +"I\n" +"\n" +">>> d.append('j') # add a new entry to the right side\n" +">>> d.appendleft('f') # add a new entry to the left side\n" +">>> d # show the representation of the deque\n" +"deque(['f', 'g', 'h', 'i', 'j'])\n" +"\n" +">>> d.pop() # return and remove the rightmost item\n" +"'j'\n" +">>> d.popleft() # return and remove the leftmost item\n" +"'f'\n" +">>> list(d) # list the contents of the deque\n" +"['g', 'h', 'i']\n" +">>> d[0] # peek at leftmost item\n" +"'g'\n" +">>> d[-1] # peek at rightmost item\n" +"'i'\n" +"\n" +">>> list(reversed(d)) # list the contents of a deque in " +"reverse\n" +"['i', 'h', 'g']\n" +">>> 'h' in d # search the deque\n" +"True\n" +">>> d.extend('jkl') # add multiple elements at once\n" +">>> d\n" +"deque(['g', 'h', 'i', 'j', 'k', 'l'])\n" +">>> d.rotate(1) # right rotation\n" +">>> d\n" +"deque(['l', 'g', 'h', 'i', 'j', 'k'])\n" +">>> d.rotate(-1) # left rotation\n" +">>> d\n" +"deque(['g', 'h', 'i', 'j', 'k', 'l'])\n" +"\n" +">>> deque(reversed(d)) # make a new deque in reverse order\n" +"deque(['l', 'k', 'j', 'i', 'h', 'g'])\n" +">>> d.clear() # empty the deque\n" +">>> d.pop() # cannot pop from an empty deque\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in -toplevel-\n" +" d.pop()\n" +"IndexError: pop from an empty deque\n" +"\n" +">>> d.extendleft('abc') # extendleft() reverses the input " +"order\n" +">>> d\n" +"deque(['c', 'b', 'a'])" +msgstr "" + +msgid ":class:`deque` Recipes" +msgstr ":class:`deque` Рецепти" + +msgid "This section shows various approaches to working with deques." +msgstr "У цьому розділі показано різні підходи до роботи з deque." + +msgid "" +"Bounded length deques provide functionality similar to the ``tail`` filter " +"in Unix::" +msgstr "" +"Обмежена довжина двостороннього ряду забезпечує функціональність, подібну до " +"фільтра ``tail`` в Unix::" + +msgid "" +"def tail(filename, n=10):\n" +" 'Return the last n lines of a file'\n" +" with open(filename) as f:\n" +" return deque(f, n)" +msgstr "" + +msgid "" +"Another approach to using deques is to maintain a sequence of recently added " +"elements by appending to the right and popping to the left::" +msgstr "" +"Інший підхід до використання двох блоків полягає в підтримці послідовності " +"нещодавно доданих елементів шляхом додавання праворуч і висування ліворуч:" + +msgid "" +"def moving_average(iterable, n=3):\n" +" # moving_average([40, 30, 50, 46, 39, 44]) --> 40.0 42.0 45.0 43.0\n" +" # https://en.wikipedia.org/wiki/Moving_average\n" +" it = iter(iterable)\n" +" d = deque(itertools.islice(it, n-1))\n" +" d.appendleft(0)\n" +" s = sum(d)\n" +" for elem in it:\n" +" s += elem - d.popleft()\n" +" d.append(elem)\n" +" yield s / n" +msgstr "" + +msgid "" +"A `round-robin scheduler `_ can be implemented with input iterators stored in a :" +"class:`deque`. Values are yielded from the active iterator in position " +"zero. If that iterator is exhausted, it can be removed with :meth:`~deque." +"popleft`; otherwise, it can be cycled back to the end with the :meth:`~deque." +"rotate` method::" +msgstr "" +"`Циклічний планувальник `_ може бути реалізований за допомогою ітераторів введення, " +"що зберігаються в :class:`deque`. Значення виводяться з активного ітератора " +"в нульовій позиції. Якщо цей ітератор вичерпано, його можна видалити за " +"допомогою :meth:`~deque.popleft`; інакше його можна повернути до кінця за " +"допомогою методу :meth:`~deque.rotate`::" + +msgid "" +"def roundrobin(*iterables):\n" +" \"roundrobin('ABC', 'D', 'EF') --> A D E B F C\"\n" +" iterators = deque(map(iter, iterables))\n" +" while iterators:\n" +" try:\n" +" while True:\n" +" yield next(iterators[0])\n" +" iterators.rotate(-1)\n" +" except StopIteration:\n" +" # Remove an exhausted iterator.\n" +" iterators.popleft()" +msgstr "" + +msgid "" +"The :meth:`~deque.rotate` method provides a way to implement :class:`deque` " +"slicing and deletion. For example, a pure Python implementation of ``del " +"d[n]`` relies on the ``rotate()`` method to position elements to be popped::" +msgstr "" +"Метод :meth:`~deque.rotate` забезпечує спосіб реалізації :class:`deque` " +"нарізки та видалення. Наприклад, чиста реалізація ``del d[n]`` на Python " +"покладається на метод ``rotate()`` для позиціонування елементів, які " +"потрібно відкрити:" + +msgid "" +"def delete_nth(d, n):\n" +" d.rotate(-n)\n" +" d.popleft()\n" +" d.rotate(n)" +msgstr "" + +msgid "" +"To implement :class:`deque` slicing, use a similar approach applying :meth:" +"`~deque.rotate` to bring a target element to the left side of the deque. " +"Remove old entries with :meth:`~deque.popleft`, add new entries with :meth:" +"`~deque.extend`, and then reverse the rotation. With minor variations on " +"that approach, it is easy to implement Forth style stack manipulations such " +"as ``dup``, ``drop``, ``swap``, ``over``, ``pick``, ``rot``, and ``roll``." +msgstr "" +"Щоб реалізувати нарізку :class:`deque`, скористайтеся подібним підходом, " +"застосовуючи :meth:`~deque.rotate`, щоб перемістити цільовий елемент у ліву " +"сторону від deque. Видаліть старі записи за допомогою :meth:`~deque." +"popleft`, додайте нові за допомогою :meth:`~deque.extend`, а потім змініть " +"чергування. З незначними варіаціями цього підходу легко реалізувати " +"маніпуляції стеком у стилі Forth, такі як ``dup``, ``drop``, ``swap``, " +"``over``, ``pick``, ``rot`` і ``roll``." + +msgid ":class:`defaultdict` objects" +msgstr ":class:`defaultdict` об’єкти" + +msgid "" +"Return a new dictionary-like object. :class:`defaultdict` is a subclass of " +"the built-in :class:`dict` class. It overrides one method and adds one " +"writable instance variable. The remaining functionality is the same as for " +"the :class:`dict` class and is not documented here." +msgstr "" +"Повернути новий об’єкт, схожий на словник. :class:`defaultdict` є підкласом " +"вбудованого класу :class:`dict`. Він замінює один метод і додає одну змінну " +"екземпляра, доступну для запису. Інші функції такі ж, як і для класу :class:" +"`dict`, і тут не описані." + +msgid "" +"The first argument provides the initial value for the :attr:" +"`default_factory` attribute; it defaults to ``None``. All remaining " +"arguments are treated the same as if they were passed to the :class:`dict` " +"constructor, including keyword arguments." +msgstr "" +"Перший аргумент надає початкове значення для атрибута :attr:" +"`default_factory`; за замовчуванням ``None``. Усі решта аргументів " +"обробляються так само, як якщо б вони були передані конструктору :class:" +"`dict`, включаючи аргументи ключових слів." + +msgid "" +":class:`defaultdict` objects support the following method in addition to the " +"standard :class:`dict` operations:" +msgstr "" +"Об’єкти :class:`defaultdict` підтримують наступний метод на додаток до " +"стандартних операцій :class:`dict`:" + +msgid "" +"If the :attr:`default_factory` attribute is ``None``, this raises a :exc:" +"`KeyError` exception with the *key* as argument." +msgstr "" +"Якщо атрибут :attr:`default_factory` має значення ``None``, це викликає " +"виключення :exc:`KeyError` з *key* як аргументом." + +msgid "" +"If :attr:`default_factory` is not ``None``, it is called without arguments " +"to provide a default value for the given *key*, this value is inserted in " +"the dictionary for the *key*, and returned." +msgstr "" +"Якщо :attr:`default_factory` не є ``None``, він викликається без аргументів, " +"щоб надати значення за замовчуванням для даного *ключа*, це значення " +"вставляється в словник для *ключа* та повертається." + +msgid "" +"If calling :attr:`default_factory` raises an exception this exception is " +"propagated unchanged." +msgstr "" +"Якщо виклик :attr:`default_factory` викликає виняток, цей виняток " +"поширюється без змін." + +msgid "" +"This method is called by the :meth:`~object.__getitem__` method of the :" +"class:`dict` class when the requested key is not found; whatever it returns " +"or raises is then returned or raised by :meth:`~object.__getitem__`." +msgstr "" + +msgid "" +"Note that :meth:`__missing__` is *not* called for any operations besides :" +"meth:`~object.__getitem__`. This means that :meth:`~dict.get` will, like " +"normal dictionaries, return ``None`` as a default rather than using :attr:" +"`default_factory`." +msgstr "" + +msgid ":class:`defaultdict` objects support the following instance variable:" +msgstr "Об’єкти :class:`defaultdict` підтримують таку змінну екземпляра:" + +msgid "" +"This attribute is used by the :meth:`__missing__` method; it is initialized " +"from the first argument to the constructor, if present, or to ``None``, if " +"absent." +msgstr "" +"Цей атрибут використовується методом :meth:`__missing__`; він " +"ініціалізується від першого аргументу до конструктора, якщо він присутній, " +"або до ``None``, якщо його немає." + +msgid "" +"Added merge (``|``) and update (``|=``) operators, specified in :pep:`584`." +msgstr "" +"Додано оператори злиття (``|``) і оновлення (``|=``), указані в :pep:`584`." + +msgid ":class:`defaultdict` Examples" +msgstr ":class:`defaultdict` Приклади" + +msgid "" +"Using :class:`list` as the :attr:`~defaultdict.default_factory`, it is easy " +"to group a sequence of key-value pairs into a dictionary of lists:" +msgstr "" +"Використовуючи :class:`list` як :attr:`~defaultdict.default_factory`, можна " +"легко згрупувати послідовність пар ключ-значення в словник списків:" + +msgid "" +"When each key is encountered for the first time, it is not already in the " +"mapping; so an entry is automatically created using the :attr:`~defaultdict." +"default_factory` function which returns an empty :class:`list`. The :meth:`!" +"list.append` operation then attaches the value to the new list. When keys " +"are encountered again, the look-up proceeds normally (returning the list for " +"that key) and the :meth:`!list.append` operation adds another value to the " +"list. This technique is simpler and faster than an equivalent technique " +"using :meth:`dict.setdefault`:" +msgstr "" + +msgid "" +"Setting the :attr:`~defaultdict.default_factory` to :class:`int` makes the :" +"class:`defaultdict` useful for counting (like a bag or multiset in other " +"languages):" +msgstr "" +"Встановлення :attr:`~defaultdict.default_factory` на :class:`int` робить :" +"class:`defaultdict` корисним для підрахунку (як сумка або мультинабір в " +"інших мовах):" + +msgid "" +"When a letter is first encountered, it is missing from the mapping, so the :" +"attr:`~defaultdict.default_factory` function calls :func:`int` to supply a " +"default count of zero. The increment operation then builds up the count for " +"each letter." +msgstr "" +"Коли буква зустрічається вперше, вона відсутня у відображенні, тому функція :" +"attr:`~defaultdict.default_factory` викликає :func:`int`, щоб надати нульову " +"кількість за умовчанням. Потім операція збільшення створює кількість для " +"кожної літери." + +msgid "" +"The function :func:`int` which always returns zero is just a special case of " +"constant functions. A faster and more flexible way to create constant " +"functions is to use a lambda function which can supply any constant value " +"(not just zero):" +msgstr "" +"Функція :func:`int`, яка завжди повертає нуль, є лише окремим випадком " +"постійних функцій. Швидший і більш гнучкий спосіб створення постійних " +"функцій полягає у використанні лямбда-функції, яка може надати будь-яке " +"постійне значення (не лише нуль):" + +msgid "" +"Setting the :attr:`~defaultdict.default_factory` to :class:`set` makes the :" +"class:`defaultdict` useful for building a dictionary of sets:" +msgstr "" +"Встановлення :attr:`~defaultdict.default_factory` на :class:`set` робить :" +"class:`defaultdict` корисним для створення словника наборів:" + +msgid ":func:`namedtuple` Factory Function for Tuples with Named Fields" +msgstr ":func:`namedtuple` Фабрична функція для кортежів з іменованими полями" + +msgid "" +"Named tuples assign meaning to each position in a tuple and allow for more " +"readable, self-documenting code. They can be used wherever regular tuples " +"are used, and they add the ability to access fields by name instead of " +"position index." +msgstr "" +"Іменовані кортежі призначають значення кожній позиції в кортежі та " +"забезпечують більш читабельний самодокументований код. Їх можна " +"використовувати скрізь, де використовуються звичайні кортежі, і вони додають " +"можливість доступу до полів за назвою замість індексу позиції." + +msgid "" +"Returns a new tuple subclass named *typename*. The new subclass is used to " +"create tuple-like objects that have fields accessible by attribute lookup as " +"well as being indexable and iterable. Instances of the subclass also have a " +"helpful docstring (with *typename* and *field_names*) and a helpful :meth:" +"`~object.__repr__` method which lists the tuple contents in a ``name=value`` " +"format." +msgstr "" + +msgid "" +"The *field_names* are a sequence of strings such as ``['x', 'y']``. " +"Alternatively, *field_names* can be a single string with each fieldname " +"separated by whitespace and/or commas, for example ``'x y'`` or ``'x, y'``." +msgstr "" +"*Імена_полів* — це послідовність рядків, наприклад ``['x', 'y']``. Крім " +"того, *назви_полів* можуть бути одним рядком із назвою кожного поля, " +"розділеного пробілами та/або комами, наприклад ``'x y'`` або ``'x, y'``." + +msgid "" +"Any valid Python identifier may be used for a fieldname except for names " +"starting with an underscore. Valid identifiers consist of letters, digits, " +"and underscores but do not start with a digit or underscore and cannot be a :" +"mod:`keyword` such as *class*, *for*, *return*, *global*, *pass*, or *raise*." +msgstr "" +"Для імені поля можна використовувати будь-який дійсний ідентифікатор Python, " +"за винятком імен, що починаються з підкреслення. Дійсні ідентифікатори " +"складаються з літер, цифр і підкреслення, але не починаються з цифри або " +"підкреслення і не можуть бути :mod:`keyword`, таким як *клас*, *для*, " +"*повернення*, *глобальний*, *перехід* , або *підняти*." + +msgid "" +"If *rename* is true, invalid fieldnames are automatically replaced with " +"positional names. For example, ``['abc', 'def', 'ghi', 'abc']`` is " +"converted to ``['abc', '_1', 'ghi', '_3']``, eliminating the keyword ``def`` " +"and the duplicate fieldname ``abc``." +msgstr "" +"Якщо *rename* має значення true, недійсні назви полів автоматично " +"замінюються позиційними іменами. Наприклад, ``['abc', 'def', 'ghi', 'abc']`` " +"перетворюється на ``['abc', '_1', 'ghi', '_3']``, усуваючи ключове слово " +"``def`` і повторюване ім’я поля ``abc``." + +msgid "" +"*defaults* can be ``None`` or an :term:`iterable` of default values. Since " +"fields with a default value must come after any fields without a default, " +"the *defaults* are applied to the rightmost parameters. For example, if the " +"fieldnames are ``['x', 'y', 'z']`` and the defaults are ``(1, 2)``, then " +"``x`` will be a required argument, ``y`` will default to ``1``, and ``z`` " +"will default to ``2``." +msgstr "" +"*defaults* може бути ``None`` або :term:`iterable` значень за замовчуванням. " +"Оскільки поля зі значенням за замовчуванням мають бути після будь-яких полів " +"без значення за замовчуванням, *за замовчуванням* застосовуються до крайніх " +"правих параметрів. Наприклад, якщо імена полів ``['x', 'y', 'z']``, а " +"значення за умовчанням ``(1, 2)``, тоді ``x`` буде обов'язковим аргументом, " +"``y`` за замовчуванням буде ``1``, а ``z`` буде ``2``." + +msgid "" +"If *module* is defined, the :attr:`~type.__module__` attribute of the named " +"tuple is set to that value." +msgstr "" + +msgid "" +"Named tuple instances do not have per-instance dictionaries, so they are " +"lightweight and require no more memory than regular tuples." +msgstr "" +"Іменовані екземпляри кортежу не мають словників для кожного екземпляра, тому " +"вони легкі та не вимагають більше пам’яті, ніж звичайні кортежі." + +msgid "" +"To support pickling, the named tuple class should be assigned to a variable " +"that matches *typename*." +msgstr "" +"Щоб підтримувати маринування, іменований клас кортежу має бути призначений " +"змінній, яка відповідає *typename*." + +msgid "Added support for *rename*." +msgstr "Додано підтримку *перейменування*." + +msgid "" +"The *verbose* and *rename* parameters became :ref:`keyword-only arguments " +"`." +msgstr "" +"Параметри *verbose* і *rename* стали :ref:`аргументами лише для ключових " +"слів `." + +msgid "Added the *module* parameter." +msgstr "Додано параметр *module*." + +msgid "Removed the *verbose* parameter and the :attr:`!_source` attribute." +msgstr "" + +msgid "" +"Added the *defaults* parameter and the :attr:`~somenamedtuple." +"_field_defaults` attribute." +msgstr "" + +msgid "" +">>> # Basic example\n" +">>> Point = namedtuple('Point', ['x', 'y'])\n" +">>> p = Point(11, y=22) # instantiate with positional or keyword " +"arguments\n" +">>> p[0] + p[1] # indexable like the plain tuple (11, 22)\n" +"33\n" +">>> x, y = p # unpack like a regular tuple\n" +">>> x, y\n" +"(11, 22)\n" +">>> p.x + p.y # fields also accessible by name\n" +"33\n" +">>> p # readable __repr__ with a name=value style\n" +"Point(x=11, y=22)" +msgstr "" + +msgid "" +"Named tuples are especially useful for assigning field names to result " +"tuples returned by the :mod:`csv` or :mod:`sqlite3` modules::" +msgstr "" +"Іменовані кортежі особливо корисні для призначення імен полів кортежам " +"результатів, які повертаються модулями :mod:`csv` або :mod:`sqlite3`::" + +msgid "" +"EmployeeRecord = namedtuple('EmployeeRecord', 'name, age, title, department, " +"paygrade')\n" +"\n" +"import csv\n" +"for emp in map(EmployeeRecord._make, csv.reader(open(\"employees.csv\", " +"\"rb\"))):\n" +" print(emp.name, emp.title)\n" +"\n" +"import sqlite3\n" +"conn = sqlite3.connect('/companydata')\n" +"cursor = conn.cursor()\n" +"cursor.execute('SELECT name, age, title, department, paygrade FROM " +"employees')\n" +"for emp in map(EmployeeRecord._make, cursor.fetchall()):\n" +" print(emp.name, emp.title)" +msgstr "" + +msgid "" +"In addition to the methods inherited from tuples, named tuples support three " +"additional methods and two attributes. To prevent conflicts with field " +"names, the method and attribute names start with an underscore." +msgstr "" +"На додаток до методів, успадкованих від кортежів, іменовані кортежі " +"підтримують три додаткові методи та два атрибути. Щоб запобігти конфліктам " +"імен полів, імена методів і атрибутів починаються зі знака підкреслення." + +msgid "" +"Class method that makes a new instance from an existing sequence or iterable." +msgstr "" +"Метод класу, який створює новий екземпляр із існуючої послідовності або " +"повторюється." + +msgid "" +">>> t = [11, 22]\n" +">>> Point._make(t)\n" +"Point(x=11, y=22)" +msgstr "" + +msgid "" +"Return a new :class:`dict` which maps field names to their corresponding " +"values:" +msgstr "" +"Повертає новий :class:`dict`, який зіставляє назви полів з відповідними " +"значеннями:" + +msgid "" +">>> p = Point(x=11, y=22)\n" +">>> p._asdict()\n" +"{'x': 11, 'y': 22}" +msgstr "" + +msgid "Returns an :class:`OrderedDict` instead of a regular :class:`dict`." +msgstr "Повертає :class:`OrderedDict` замість звичайного :class:`dict`." + +msgid "" +"Returns a regular :class:`dict` instead of an :class:`OrderedDict`. As of " +"Python 3.7, regular dicts are guaranteed to be ordered. If the extra " +"features of :class:`OrderedDict` are required, the suggested remediation is " +"to cast the result to the desired type: ``OrderedDict(nt._asdict())``." +msgstr "" +"Повертає звичайний :class:`dict` замість :class:`OrderedDict`. Починаючи з " +"Python 3.7, звичайні dicts гарантовано будуть упорядковані. Якщо потрібні " +"додаткові функції :class:`OrderedDict`, запропонованим виправленням є " +"приведення результату до потрібного типу: ``OrderedDict(nt._asdict())``." + +msgid "" +"Return a new instance of the named tuple replacing specified fields with new " +"values::" +msgstr "" +"Повертає новий екземпляр іменованого кортежу, замінюючи вказані поля новими " +"значеннями::" + +msgid "" +">>> p = Point(x=11, y=22)\n" +">>> p._replace(x=33)\n" +"Point(x=33, y=22)\n" +"\n" +">>> for partnum, record in inventory.items():\n" +"... inventory[partnum] = record._replace(price=newprices[partnum], " +"timestamp=time.now())" +msgstr "" + +msgid "" +"Named tuples are also supported by generic function :func:`copy.replace`." +msgstr "" + +msgid "" +"Raise :exc:`TypeError` instead of :exc:`ValueError` for invalid keyword " +"arguments." +msgstr "" + +msgid "" +"Tuple of strings listing the field names. Useful for introspection and for " +"creating new named tuple types from existing named tuples." +msgstr "" +"Кортеж рядків із переліком імен полів. Корисно для самоаналізу та для " +"створення нових іменованих типів кортежів із існуючих іменованих кортежів." + +msgid "" +">>> p._fields # view the field names\n" +"('x', 'y')\n" +"\n" +">>> Color = namedtuple('Color', 'red green blue')\n" +">>> Pixel = namedtuple('Pixel', Point._fields + Color._fields)\n" +">>> Pixel(11, 22, 128, 255, 0)\n" +"Pixel(x=11, y=22, red=128, green=255, blue=0)" +msgstr "" + +msgid "Dictionary mapping field names to default values." +msgstr "Словник зіставляє назви полів зі значеннями за замовчуванням." + +msgid "" +">>> Account = namedtuple('Account', ['type', 'balance'], defaults=[0])\n" +">>> Account._field_defaults\n" +"{'balance': 0}\n" +">>> Account('premium')\n" +"Account(type='premium', balance=0)" +msgstr "" + +msgid "" +"To retrieve a field whose name is stored in a string, use the :func:" +"`getattr` function:" +msgstr "" +"Щоб отримати поле, ім’я якого зберігається в рядку, використовуйте функцію :" +"func:`getattr`:" + +msgid "" +"To convert a dictionary to a named tuple, use the double-star-operator (as " +"described in :ref:`tut-unpacking-arguments`):" +msgstr "" +"Щоб перетворити словник на іменований кортеж, використовуйте оператор " +"подвійної зірочки (як описано в :ref:`tut-unpacking-arguments`):" + +msgid "" +"Since a named tuple is a regular Python class, it is easy to add or change " +"functionality with a subclass. Here is how to add a calculated field and a " +"fixed-width print format:" +msgstr "" +"Оскільки іменований кортеж є звичайним класом Python, його легко додати або " +"змінити функціональність за допомогою підкласу. Ось як додати обчислюване " +"поле та формат друку з фіксованою шириною:" + +msgid "" +">>> class Point(namedtuple('Point', ['x', 'y'])):\n" +"... __slots__ = ()\n" +"... @property\n" +"... def hypot(self):\n" +"... return (self.x ** 2 + self.y ** 2) ** 0.5\n" +"... def __str__(self):\n" +"... return 'Point: x=%6.3f y=%6.3f hypot=%6.3f' % (self.x, self.y, " +"self.hypot)\n" +"\n" +">>> for p in Point(3, 4), Point(14, 5/7):\n" +"... print(p)\n" +"Point: x= 3.000 y= 4.000 hypot= 5.000\n" +"Point: x=14.000 y= 0.714 hypot=14.018" +msgstr "" + +msgid "" +"The subclass shown above sets ``__slots__`` to an empty tuple. This helps " +"keep memory requirements low by preventing the creation of instance " +"dictionaries." +msgstr "" +"Показаний вище підклас встановлює ``__slots__`` на порожній кортеж. Це " +"допомагає підтримувати низькі вимоги до пам’яті, запобігаючи створенню " +"словників примірників." + +msgid "" +"Subclassing is not useful for adding new, stored fields. Instead, simply " +"create a new named tuple type from the :attr:`~somenamedtuple._fields` " +"attribute:" +msgstr "" +"Підкласи не корисні для додавання нових збережених полів. Замість цього " +"просто створіть новий іменований тип кортежу з атрибута :attr:" +"`~somenamedtuple._fields`:" + +msgid "" +"Docstrings can be customized by making direct assignments to the ``__doc__`` " +"fields:" +msgstr "" +"Рядки документів можна налаштувати шляхом прямого призначення полів " +"``__doc__``:" + +msgid "Property docstrings became writeable." +msgstr "Документаційні рядки властивостей стали доступними для запису." + +msgid "" +"See :class:`typing.NamedTuple` for a way to add type hints for named " +"tuples. It also provides an elegant notation using the :keyword:`class` " +"keyword::" +msgstr "" +"Дивіться :class:`typing.NamedTuple`, щоб дізнатися, як додати підказки типу " +"для іменованих кортежів. Він також забезпечує елегантну нотацію за допомогою " +"ключового слова :keyword:`class`::" + +msgid "" +"class Component(NamedTuple):\n" +" part_number: int\n" +" weight: float\n" +" description: Optional[str] = None" +msgstr "" + +msgid "" +"See :meth:`types.SimpleNamespace` for a mutable namespace based on an " +"underlying dictionary instead of a tuple." +msgstr "" +"Перегляньте :meth:`types.SimpleNamespace` для змінного простору імен, " +"заснованого на базовому словнику замість кортежу." + +msgid "" +"The :mod:`dataclasses` module provides a decorator and functions for " +"automatically adding generated special methods to user-defined classes." +msgstr "" +"Модуль :mod:`dataclasses` надає декоратор і функції для автоматичного " +"додавання згенерованих спеціальних методів до визначених користувачем класів." + +msgid ":class:`OrderedDict` objects" +msgstr ":class:`OrderedDict` об’єкти" + +msgid "" +"Ordered dictionaries are just like regular dictionaries but have some extra " +"capabilities relating to ordering operations. They have become less " +"important now that the built-in :class:`dict` class gained the ability to " +"remember insertion order (this new behavior became guaranteed in Python 3.7)." +msgstr "" +"Упорядковані словники схожі на звичайні словники, але мають деякі додаткові " +"можливості, пов’язані з операціями впорядкування. Тепер вони стали менш " +"важливими, оскільки вбудований клас :class:`dict` отримав можливість " +"запам’ятовувати порядок вставки (ця нова поведінка стала гарантованою в " +"Python 3.7)." + +msgid "Some differences from :class:`dict` still remain:" +msgstr "Деякі відмінності від :class:`dict` все ще залишаються:" + +msgid "" +"The regular :class:`dict` was designed to be very good at mapping " +"operations. Tracking insertion order was secondary." +msgstr "" +"Звичайний :class:`dict` був розроблений, щоб дуже добре виконувати операції " +"відображення. Відстеження порядку вставки було другорядним." + +msgid "" +"The :class:`OrderedDict` was designed to be good at reordering operations. " +"Space efficiency, iteration speed, and the performance of update operations " +"were secondary." +msgstr "" +":class:`OrderedDict` був розроблений, щоб добре справлятися з операціями " +"зміни порядку. Ефективність простору, швидкість ітерації та продуктивність " +"операцій оновлення були другорядними." + +msgid "" +"The :class:`OrderedDict` algorithm can handle frequent reordering operations " +"better than :class:`dict`. As shown in the recipes below, this makes it " +"suitable for implementing various kinds of LRU caches." +msgstr "" +"Алгоритм :class:`OrderedDict` може виконувати часті операції зміни порядку " +"краще, ніж :class:`dict`. Як показано в наведених нижче рецептах, це робить " +"його придатним для реалізації різних видів кешів LRU." + +msgid "" +"The equality operation for :class:`OrderedDict` checks for matching order." +msgstr "" +"Операція рівності для :class:`OrderedDict` перевіряє відповідність порядку." + +msgid "" +"A regular :class:`dict` can emulate the order sensitive equality test with " +"``p == q and all(k1 == k2 for k1, k2 in zip(p, q))``." +msgstr "" +"Звичайний :class:`dict` може емулювати чутливий до порядку тест рівності з " +"``p == q і all(k1 == k2 для k1, k2 в zip(p, q))``." + +msgid "" +"The :meth:`~OrderedDict.popitem` method of :class:`OrderedDict` has a " +"different signature. It accepts an optional argument to specify which item " +"is popped." +msgstr "" + +msgid "" +"A regular :class:`dict` can emulate OrderedDict's ``od.popitem(last=True)`` " +"with ``d.popitem()`` which is guaranteed to pop the rightmost (last) item." +msgstr "" +"Звичайний :class:`dict` може емулювати OrderedDict ``od.popitem(last=True)`` " +"за допомогою ``d.popitem()``, який гарантовано відкриває крайній правий " +"(останній) елемент." + +msgid "" +"A regular :class:`dict` can emulate OrderedDict's ``od.popitem(last=False)`` " +"with ``(k := next(iter(d)), d.pop(k))`` which will return and remove the " +"leftmost (first) item if it exists." +msgstr "" +"Звичайний :class:`dict` може емулювати OrderedDict ``od." +"popitem(last=False)`` з ``(k := next(iter(d)), d.pop(k))``, який повертатиме " +"і видаліть крайній лівий (перший) елемент, якщо він існує." + +msgid "" +":class:`OrderedDict` has a :meth:`~OrderedDict.move_to_end` method to " +"efficiently reposition an element to an endpoint." +msgstr "" + +msgid "" +"A regular :class:`dict` can emulate OrderedDict's ``od.move_to_end(k, " +"last=True)`` with ``d[k] = d.pop(k)`` which will move the key and its " +"associated value to the rightmost (last) position." +msgstr "" +"Звичайний :class:`dict` може емулювати OrderedDict ``od.move_to_end(k, " +"last=True)`` з ``d[k] = d.pop(k)``, який переміщуватиме ключ і його " +"пов’язане значення до крайньої правої (останньої) позиції." + +msgid "" +"A regular :class:`dict` does not have an efficient equivalent for " +"OrderedDict's ``od.move_to_end(k, last=False)`` which moves the key and its " +"associated value to the leftmost (first) position." +msgstr "" +"Звичайний :class:`dict` не має ефективного еквівалента для OrderedDict ``od." +"move_to_end(k, last=False)``, який переміщує ключ і пов’язане з ним значення " +"в крайню ліву (першу) позицію." + +msgid "" +"Until Python 3.8, :class:`dict` lacked a :meth:`~object.__reversed__` method." +msgstr "" + +msgid "" +"Return an instance of a :class:`dict` subclass that has methods specialized " +"for rearranging dictionary order." +msgstr "" +"Повертає екземпляр підкласу :class:`dict`, який має спеціалізовані методи " +"для зміни порядку словника." + +msgid "" +"The :meth:`popitem` method for ordered dictionaries returns and removes a " +"(key, value) pair. The pairs are returned in :abbr:`LIFO (last-in, first-" +"out)` order if *last* is true or :abbr:`FIFO (first-in, first-out)` order if " +"false." +msgstr "" +"Метод :meth:`popitem` для впорядкованих словників повертає та видаляє пару " +"(ключ, значення). Пари повертаються в порядку :abbr:`LIFO (останній прийшов, " +"перший вийшов)`, якщо *останній* має значення true, або :abbr:`FIFO (перший " +"прийшов, перший вийшов)`, якщо значення false." + +msgid "" +"Move an existing *key* to either end of an ordered dictionary. The item is " +"moved to the right end if *last* is true (the default) or to the beginning " +"if *last* is false. Raises :exc:`KeyError` if the *key* does not exist:" +msgstr "" +"Перемістіть наявний *ключ* у будь-який кінець упорядкованого словника. " +"Елемент переміщується в правий кінець, якщо *last* має значення true (за " +"замовчуванням), або на початок, якщо *last* має значення false. Викликає :" +"exc:`KeyError`, якщо *ключ* не існує:" + +msgid "" +">>> d = OrderedDict.fromkeys('abcde')\n" +">>> d.move_to_end('b')\n" +">>> ''.join(d)\n" +"'acdeb'\n" +">>> d.move_to_end('b', last=False)\n" +">>> ''.join(d)\n" +"'bacde'" +msgstr "" + +msgid "" +"In addition to the usual mapping methods, ordered dictionaries also support " +"reverse iteration using :func:`reversed`." +msgstr "" +"На додаток до звичайних методів відображення, упорядковані словники також " +"підтримують зворотну ітерацію за допомогою :func:`reversed`." + +msgid "" +"Equality tests between :class:`OrderedDict` objects are order-sensitive and " +"are roughly equivalent to ``list(od1.items())==list(od2.items())``." +msgstr "" + +msgid "" +"Equality tests between :class:`OrderedDict` objects and other :class:" +"`~collections.abc.Mapping` objects are order-insensitive like regular " +"dictionaries. This allows :class:`OrderedDict` objects to be substituted " +"anywhere a regular dictionary is used." +msgstr "" + +msgid "" +"The items, keys, and values :term:`views ` of :class:" +"`OrderedDict` now support reverse iteration using :func:`reversed`." +msgstr "" +"Елементи, ключі та значення :term:`views ` :class:" +"`OrderedDict` тепер підтримують зворотну ітерацію за допомогою :func:" +"`reversed`." + +msgid "" +"With the acceptance of :pep:`468`, order is retained for keyword arguments " +"passed to the :class:`OrderedDict` constructor and its :meth:`~dict.update` " +"method." +msgstr "" + +msgid ":class:`OrderedDict` Examples and Recipes" +msgstr ":class:`OrderedDict` Приклади та рецепти" + +msgid "" +"It is straightforward to create an ordered dictionary variant that remembers " +"the order the keys were *last* inserted. If a new entry overwrites an " +"existing entry, the original insertion position is changed and moved to the " +"end::" +msgstr "" +"Легко створити впорядкований варіант словника, який запам’ятовує порядок " +"*останнього* введення ключів. Якщо новий запис перезаписує існуючий запис, " +"початкова позиція вставки змінюється та переміщується в кінець::" + +msgid "" +"class LastUpdatedOrderedDict(OrderedDict):\n" +" 'Store items in the order the keys were last added'\n" +"\n" +" def __setitem__(self, key, value):\n" +" super().__setitem__(key, value)\n" +" self.move_to_end(key)" +msgstr "" + +msgid "" +"An :class:`OrderedDict` would also be useful for implementing variants of :" +"func:`functools.lru_cache`:" +msgstr "" +":class:`OrderedDict` також буде корисним для реалізації варіантів :func:" +"`functools.lru_cache`:" + +msgid "" +"from collections import OrderedDict\n" +"from time import time\n" +"\n" +"class TimeBoundedLRU:\n" +" \"LRU Cache that invalidates and refreshes old entries.\"\n" +"\n" +" def __init__(self, func, maxsize=128, maxage=30):\n" +" self.cache = OrderedDict() # { args : (timestamp, result)}\n" +" self.func = func\n" +" self.maxsize = maxsize\n" +" self.maxage = maxage\n" +"\n" +" def __call__(self, *args):\n" +" if args in self.cache:\n" +" self.cache.move_to_end(args)\n" +" timestamp, result = self.cache[args]\n" +" if time() - timestamp <= self.maxage:\n" +" return result\n" +" result = self.func(*args)\n" +" self.cache[args] = time(), result\n" +" if len(self.cache) > self.maxsize:\n" +" self.cache.popitem(last=False)\n" +" return result" +msgstr "" + +msgid "" +"class MultiHitLRUCache:\n" +" \"\"\" LRU cache that defers caching a result until\n" +" it has been requested multiple times.\n" +"\n" +" To avoid flushing the LRU cache with one-time requests,\n" +" we don't cache until a request has been made more than once.\n" +"\n" +" \"\"\"\n" +"\n" +" def __init__(self, func, maxsize=128, maxrequests=4096, cache_after=1):\n" +" self.requests = OrderedDict() # { uncached_key : request_count }\n" +" self.cache = OrderedDict() # { cached_key : function_result }\n" +" self.func = func\n" +" self.maxrequests = maxrequests # max number of uncached requests\n" +" self.maxsize = maxsize # max number of stored return " +"values\n" +" self.cache_after = cache_after\n" +"\n" +" def __call__(self, *args):\n" +" if args in self.cache:\n" +" self.cache.move_to_end(args)\n" +" return self.cache[args]\n" +" result = self.func(*args)\n" +" self.requests[args] = self.requests.get(args, 0) + 1\n" +" if self.requests[args] <= self.cache_after:\n" +" self.requests.move_to_end(args)\n" +" if len(self.requests) > self.maxrequests:\n" +" self.requests.popitem(last=False)\n" +" else:\n" +" self.requests.pop(args, None)\n" +" self.cache[args] = result\n" +" if len(self.cache) > self.maxsize:\n" +" self.cache.popitem(last=False)\n" +" return result" +msgstr "" + +msgid ":class:`UserDict` objects" +msgstr ":class:`UserDict` об'єкти" + +msgid "" +"The class, :class:`UserDict` acts as a wrapper around dictionary objects. " +"The need for this class has been partially supplanted by the ability to " +"subclass directly from :class:`dict`; however, this class can be easier to " +"work with because the underlying dictionary is accessible as an attribute." +msgstr "" +"Клас :class:`UserDict` діє як оболонка навколо об’єктів словника. Потреба в " +"цьому класі була частково витіснена можливістю створювати підклас " +"безпосередньо з :class:`dict`; однак з цим класом може бути легше працювати, " +"оскільки базовий словник доступний як атрибут." + +msgid "" +"Class that simulates a dictionary. The instance's contents are kept in a " +"regular dictionary, which is accessible via the :attr:`data` attribute of :" +"class:`UserDict` instances. If *initialdata* is provided, :attr:`data` is " +"initialized with its contents; note that a reference to *initialdata* will " +"not be kept, allowing it to be used for other purposes." +msgstr "" +"Клас, який імітує словник. Вміст екземпляра зберігається у звичайному " +"словнику, який доступний через атрибут :attr:`data` екземплярів :class:" +"`UserDict`. Якщо надано *initialdata*, :attr:`data` ініціалізується його " +"вмістом; зауважте, що посилання на *ініціальні дані* не буде збережено, що " +"дозволить використовувати його для інших цілей." + +msgid "" +"In addition to supporting the methods and operations of mappings, :class:" +"`UserDict` instances provide the following attribute:" +msgstr "" +"На додаток до підтримки методів і операцій зіставлення, екземпляри :class:" +"`UserDict` забезпечують такий атрибут:" + +msgid "" +"A real dictionary used to store the contents of the :class:`UserDict` class." +msgstr "" +"Справжній словник, який використовується для зберігання вмісту класу :class:" +"`UserDict`." + +msgid ":class:`UserList` objects" +msgstr ":class:`UserList` об’єкти" + +msgid "" +"This class acts as a wrapper around list objects. It is a useful base class " +"for your own list-like classes which can inherit from them and override " +"existing methods or add new ones. In this way, one can add new behaviors to " +"lists." +msgstr "" +"Цей клас діє як оболонка навколо об’єктів списку. Це корисний базовий клас " +"для ваших власних спископодібних класів, які можуть успадковувати їх і " +"перевизначати існуючі методи або додавати нові. Таким чином можна додавати " +"нові моделі поведінки до списків." + +msgid "" +"The need for this class has been partially supplanted by the ability to " +"subclass directly from :class:`list`; however, this class can be easier to " +"work with because the underlying list is accessible as an attribute." +msgstr "" +"Потреба в цьому класі була частково витіснена можливістю створювати підкласи " +"безпосередньо з :class:`list`; однак з цим класом може бути легше працювати, " +"оскільки базовий список доступний як атрибут." + +msgid "" +"Class that simulates a list. The instance's contents are kept in a regular " +"list, which is accessible via the :attr:`data` attribute of :class:" +"`UserList` instances. The instance's contents are initially set to a copy " +"of *list*, defaulting to the empty list ``[]``. *list* can be any iterable, " +"for example a real Python list or a :class:`UserList` object." +msgstr "" +"Клас, що імітує список. Вміст екземпляра зберігається у звичайному списку, " +"який доступний через атрибут :attr:`data` екземплярів :class:`UserList`. " +"Вміст екземпляра спочатку встановлено як копія *списку*, за замовчуванням — " +"порожній список ``[]``. *list* може бути будь-яким ітерованим, наприклад " +"справжнім списком Python або об’єктом :class:`UserList`." + +msgid "" +"In addition to supporting the methods and operations of mutable sequences, :" +"class:`UserList` instances provide the following attribute:" +msgstr "" +"На додаток до підтримки методів і операцій змінних послідовностей, " +"екземпляри :class:`UserList` забезпечують такий атрибут:" + +msgid "" +"A real :class:`list` object used to store the contents of the :class:" +"`UserList` class." +msgstr "" +"Справжній об’єкт :class:`list`, який використовується для зберігання вмісту " +"класу :class:`UserList`." + +msgid "" +"**Subclassing requirements:** Subclasses of :class:`UserList` are expected " +"to offer a constructor which can be called with either no arguments or one " +"argument. List operations which return a new sequence attempt to create an " +"instance of the actual implementation class. To do so, it assumes that the " +"constructor can be called with a single parameter, which is a sequence " +"object used as a data source." +msgstr "" +"**Вимоги до підкласів:** Очікується, що підкласи :class:`UserList` " +"пропонуватимуть конструктор, який можна викликати без аргументів або з одним " +"аргументом. Список операцій, які повертають нову послідовність, намагається " +"створити екземпляр фактичного класу реалізації. Для цього передбачається, що " +"конструктор можна викликати за допомогою одного параметра, який є об’єктом " +"послідовності, що використовується як джерело даних." + +msgid "" +"If a derived class does not wish to comply with this requirement, all of the " +"special methods supported by this class will need to be overridden; please " +"consult the sources for information about the methods which need to be " +"provided in that case." +msgstr "" +"Якщо похідний клас не бажає відповідати цій вимозі, всі спеціальні методи, " +"підтримувані цим класом, повинні бути перевизначені; будь ласка, зверніться " +"до джерел для отримання інформації про методи, які необхідно надати в такому " +"випадку." + +msgid ":class:`UserString` objects" +msgstr ":class:`UserString` об’єкти" + +msgid "" +"The class, :class:`UserString` acts as a wrapper around string objects. The " +"need for this class has been partially supplanted by the ability to subclass " +"directly from :class:`str`; however, this class can be easier to work with " +"because the underlying string is accessible as an attribute." +msgstr "" +"Клас :class:`UserString` діє як оболонка навколо рядкових об’єктів. Потреба " +"в цьому класі була частково витіснена можливістю створювати підклас " +"безпосередньо з :class:`str`; однак з цим класом може бути легше працювати, " +"оскільки базовий рядок доступний як атрибут." + +msgid "" +"Class that simulates a string object. The instance's content is kept in a " +"regular string object, which is accessible via the :attr:`data` attribute " +"of :class:`UserString` instances. The instance's contents are initially set " +"to a copy of *seq*. The *seq* argument can be any object which can be " +"converted into a string using the built-in :func:`str` function." +msgstr "" +"Клас, який імітує рядковий об'єкт. Вміст екземпляра зберігається у " +"звичайному рядковому об’єкті, який доступний через атрибут :attr:`data` " +"екземплярів :class:`UserString`. Для вмісту екземпляра спочатку встановлено " +"копію *seq*. Аргументом *seq* може бути будь-який об’єкт, який можна " +"перетворити на рядок за допомогою вбудованої функції :func:`str`." + +msgid "" +"In addition to supporting the methods and operations of strings, :class:" +"`UserString` instances provide the following attribute:" +msgstr "" +"На додаток до підтримки методів і операцій із рядками, екземпляри :class:" +"`UserString` надають такий атрибут:" + +msgid "" +"A real :class:`str` object used to store the contents of the :class:" +"`UserString` class." +msgstr "" +"Справжній об’єкт :class:`str`, який використовується для зберігання вмісту " +"класу :class:`UserString`." + +msgid "" +"New methods ``__getnewargs__``, ``__rmod__``, ``casefold``, ``format_map``, " +"``isprintable``, and ``maketrans``." +msgstr "" +"Нові методи ``__getnewargs__``, ``__rmod__``, ``casefold``, ``format_map``, " +"``isprintable`` і ``maketrans``." diff --git a/library/collections_abc.po b/library/collections_abc.po new file mode 100644 index 000000000..71a10a6f5 --- /dev/null +++ b/library/collections_abc.po @@ -0,0 +1,668 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-04 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:56+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!collections.abc` --- Abstract Base Classes for Containers" +msgstr "" + +msgid "Formerly, this module was part of the :mod:`collections` module." +msgstr "Раніше цей модуль був частиною модуля :mod:`collections`." + +msgid "**Source code:** :source:`Lib/_collections_abc.py`" +msgstr "**Вихідний код:** :source:`Lib/_collections_abc.py`" + +msgid "" +"This module provides :term:`abstract base classes ` " +"that can be used to test whether a class provides a particular interface; " +"for example, whether it is :term:`hashable` or whether it is a :term:" +"`mapping`." +msgstr "" + +msgid "" +"An :func:`issubclass` or :func:`isinstance` test for an interface works in " +"one of three ways." +msgstr "" +"Тест :func:`issubclass` або :func:`isinstance` для інтерфейсу працює одним " +"із трьох способів." + +msgid "" +"A newly written class can inherit directly from one of the abstract base " +"classes. The class must supply the required abstract methods. The " +"remaining mixin methods come from inheritance and can be overridden if " +"desired. Other methods may be added as needed:" +msgstr "" + +msgid "" +"class C(Sequence): # Direct inheritance\n" +" def __init__(self): ... # Extra method not required by the " +"ABC\n" +" def __getitem__(self, index): ... # Required abstract method\n" +" def __len__(self): ... # Required abstract method\n" +" def count(self, value): ... # Optionally override a mixin method" +msgstr "" + +msgid "" +">>> issubclass(C, Sequence)\n" +"True\n" +">>> isinstance(C(), Sequence)\n" +"True" +msgstr "" + +msgid "" +"Existing classes and built-in classes can be registered as \"virtual " +"subclasses\" of the ABCs. Those classes should define the full API " +"including all of the abstract methods and all of the mixin methods. This " +"lets users rely on :func:`issubclass` or :func:`isinstance` tests to " +"determine whether the full interface is supported. The exception to this " +"rule is for methods that are automatically inferred from the rest of the API:" +msgstr "" + +msgid "" +"class D: # No inheritance\n" +" def __init__(self): ... # Extra method not required by the " +"ABC\n" +" def __getitem__(self, index): ... # Abstract method\n" +" def __len__(self): ... # Abstract method\n" +" def count(self, value): ... # Mixin method\n" +" def index(self, value): ... # Mixin method\n" +"\n" +"Sequence.register(D) # Register instead of inherit" +msgstr "" + +msgid "" +">>> issubclass(D, Sequence)\n" +"True\n" +">>> isinstance(D(), Sequence)\n" +"True" +msgstr "" + +msgid "" +"In this example, class :class:`!D` does not need to define ``__contains__``, " +"``__iter__``, and ``__reversed__`` because the :ref:`in-operator " +"`, the :term:`iteration ` logic, and the :func:" +"`reversed` function automatically fall back to using ``__getitem__`` and " +"``__len__``." +msgstr "" + +msgid "" +"Some simple interfaces are directly recognizable by the presence of the " +"required methods (unless those methods have been set to :const:`None`):" +msgstr "" + +msgid "" +"class E:\n" +" def __iter__(self): ...\n" +" def __next__(self): ..." +msgstr "" + +msgid "" +">>> issubclass(E, Iterable)\n" +"True\n" +">>> isinstance(E(), Iterable)\n" +"True" +msgstr "" + +msgid "" +"Complex interfaces do not support this last technique because an interface " +"is more than just the presence of method names. Interfaces specify " +"semantics and relationships between methods that cannot be inferred solely " +"from the presence of specific method names. For example, knowing that a " +"class supplies ``__getitem__``, ``__len__``, and ``__iter__`` is " +"insufficient for distinguishing a :class:`Sequence` from a :class:`Mapping`." +msgstr "" +"Складні інтерфейси не підтримують цю останню техніку, оскільки інтерфейс — " +"це більше, ніж просто наявність назв методів. Інтерфейси визначають " +"семантику та зв’язки між методами, які не можуть бути виведені лише з " +"наявності конкретних імен методів. Наприклад, відомості про те, що клас " +"надає ``__getitem__``, ``__len__`` і ``__iter__``, недостатньо для того, щоб " +"відрізнити :class:`Sequence` від :class:`Mapping`." + +msgid "" +"These abstract classes now support ``[]``. See :ref:`types-genericalias` " +"and :pep:`585`." +msgstr "" +"Ці абстрактні класи тепер підтримують ``[]``. Див. :ref:`types-genericalias` " +"і :pep:`585`." + +msgid "Collections Abstract Base Classes" +msgstr "Колекції Абстрактні базові класи" + +msgid "" +"The collections module offers the following :term:`ABCs `:" +msgstr "Модуль колекцій пропонує наступне :term:`ABCs `:" + +msgid "ABC" +msgstr "ABC" + +msgid "Inherits from" +msgstr "Успадковує від" + +msgid "Abstract Methods" +msgstr "Методи реферату" + +msgid "Mixin Methods" +msgstr "Методи Міксіна" + +msgid ":class:`Container` [1]_" +msgstr ":class:`Container` [1]_" + +msgid "``__contains__``" +msgstr "``__contains__``" + +msgid ":class:`Hashable` [1]_" +msgstr ":class:`Hashable` [1]_" + +msgid "``__hash__``" +msgstr "``__hash__``" + +msgid ":class:`Iterable` [1]_ [2]_" +msgstr ":class:`Iterable` [1]_ [2]_" + +msgid "``__iter__``" +msgstr "``__iter__``" + +msgid ":class:`Iterator` [1]_" +msgstr ":class:`Iterator` [1]_" + +msgid ":class:`Iterable`" +msgstr ":class:`Iterable`" + +msgid "``__next__``" +msgstr "``__next__``" + +msgid ":class:`Reversible` [1]_" +msgstr ":class:`Reversible` [1]_" + +msgid "``__reversed__``" +msgstr "``__reversed__``" + +msgid ":class:`Generator` [1]_" +msgstr ":class:`Generator` [1]_" + +msgid ":class:`Iterator`" +msgstr ":class:`Iterator`" + +msgid "``send``, ``throw``" +msgstr "``відправити``, ``кинути``" + +msgid "``close``, ``__iter__``, ``__next__``" +msgstr "``закрити``, ``__iter__``, ``__next__``" + +msgid ":class:`Sized` [1]_" +msgstr ":class:`Sized` [1]_" + +msgid "``__len__``" +msgstr "``__len__``" + +msgid ":class:`Callable` [1]_" +msgstr ":class:`Callable` [1]_" + +msgid "``__call__``" +msgstr "``__call__``" + +msgid ":class:`Collection` [1]_" +msgstr ":class:`Collection` [1]_" + +msgid ":class:`Sized`, :class:`Iterable`, :class:`Container`" +msgstr ":class:`Sized`, :class:`Iterable`, :class:`Container`" + +msgid "``__contains__``, ``__iter__``, ``__len__``" +msgstr "``__contains__``, ``__iter__``, ``__len__``" + +msgid ":class:`Sequence`" +msgstr ":class:`Sequence`" + +msgid ":class:`Reversible`, :class:`Collection`" +msgstr ":class:`Reversible`, :class:`Collection`" + +msgid "``__getitem__``, ``__len__``" +msgstr "``__getitem__``, ``__len__``" + +msgid "" +"``__contains__``, ``__iter__``, ``__reversed__``, ``index``, and ``count``" +msgstr "" +"``__contains__``, ``__iter__``, ``__reversed__``, ``index`` і ``count``" + +msgid ":class:`MutableSequence`" +msgstr ":class:`MutableSequence`" + +msgid "" +"``__getitem__``, ``__setitem__``, ``__delitem__``, ``__len__``, ``insert``" +msgstr "" +"``__getitem__``, ``__setitem__``, ``__delitem__``, ``__len__``, ``вставити``" + +msgid "" +"Inherited :class:`Sequence` methods and ``append``, ``clear``, ``reverse``, " +"``extend``, ``pop``, ``remove``, and ``__iadd__``" +msgstr "" + +msgid ":class:`ByteString`" +msgstr ":class:`ByteString`" + +msgid "Inherited :class:`Sequence` methods" +msgstr "Успадковані методи :class:`Sequence`" + +msgid ":class:`Set`" +msgstr ":class:`Set`" + +msgid ":class:`Collection`" +msgstr ":class:`Collection`" + +msgid "" +"``__le__``, ``__lt__``, ``__eq__``, ``__ne__``, ``__gt__``, ``__ge__``, " +"``__and__``, ``__or__``, ``__sub__``, ``__rsub__``, ``__xor__``, " +"``__rxor__`` and ``isdisjoint``" +msgstr "" + +msgid ":class:`MutableSet`" +msgstr ":class:`MutableSet`" + +msgid "``__contains__``, ``__iter__``, ``__len__``, ``add``, ``discard``" +msgstr "``__contains__``, ``__iter__``, ``__len__``, ``add``, ``discard``" + +msgid "" +"Inherited :class:`Set` methods and ``clear``, ``pop``, ``remove``, " +"``__ior__``, ``__iand__``, ``__ixor__``, and ``__isub__``" +msgstr "" +"Успадковані методи :class:`Set` і ``clear``, ``pop``, ``remove``, " +"``__ior__``, ``__iand__``, ``__ixor__`` та ``__isub__``" + +msgid ":class:`Mapping`" +msgstr ":class:`Mapping`" + +msgid "``__getitem__``, ``__iter__``, ``__len__``" +msgstr "``__getitem__``, ``__iter__``, ``__len__``" + +msgid "" +"``__contains__``, ``keys``, ``items``, ``values``, ``get``, ``__eq__``, and " +"``__ne__``" +msgstr "" +"``__contains__``, ``keys``, ``items``, ``values``, ``get``, ``__eq__`` і " +"``__ne__``" + +msgid ":class:`MutableMapping`" +msgstr ":class:`MutableMapping`" + +msgid "" +"``__getitem__``, ``__setitem__``, ``__delitem__``, ``__iter__``, ``__len__``" +msgstr "" +"``__getitem__``, ``__setitem__``, ``__delitem__``, ``__iter__``, ``__len__``" + +msgid "" +"Inherited :class:`Mapping` methods and ``pop``, ``popitem``, ``clear``, " +"``update``, and ``setdefault``" +msgstr "" +"Успадковані методи :class:`Mapping` і ``pop``, ``popitem``, ``clear``, " +"``update`` і ``setdefault``" + +msgid ":class:`MappingView`" +msgstr ":class:`MappingView`" + +msgid ":class:`Sized`" +msgstr ":class:`Sized`" + +msgid "``__init__``, ``__len__`` and ``__repr__``" +msgstr "" + +msgid ":class:`ItemsView`" +msgstr ":class:`ItemsView`" + +msgid ":class:`MappingView`, :class:`Set`" +msgstr ":class:`MappingView`, :class:`Set`" + +msgid "``__contains__``, ``__iter__``" +msgstr "``__contains__``, ``__iter__``" + +msgid ":class:`KeysView`" +msgstr ":class:`KeysView`" + +msgid ":class:`ValuesView`" +msgstr ":class:`ValuesView`" + +msgid ":class:`MappingView`, :class:`Collection`" +msgstr ":class:`MappingView`, :class:`Collection`" + +msgid ":class:`Awaitable` [1]_" +msgstr ":class:`Awaitable` [1]_" + +msgid "``__await__``" +msgstr "``__await__``" + +msgid ":class:`Coroutine` [1]_" +msgstr ":class:`Coroutine` [1]_" + +msgid ":class:`Awaitable`" +msgstr ":class:`Awaitable`" + +msgid "``close``" +msgstr "``закрити``" + +msgid ":class:`AsyncIterable` [1]_" +msgstr ":class:`AsyncIterable` [1]_" + +msgid "``__aiter__``" +msgstr "``__aiter__``" + +msgid ":class:`AsyncIterator` [1]_" +msgstr ":class:`AsyncIterator` [1]_" + +msgid ":class:`AsyncIterable`" +msgstr ":class:`AsyncIterable`" + +msgid "``__anext__``" +msgstr "``__anext__``" + +msgid ":class:`AsyncGenerator` [1]_" +msgstr ":class:`AsyncGenerator` [1]_" + +msgid ":class:`AsyncIterator`" +msgstr ":class:`AsyncIterator`" + +msgid "``asend``, ``athrow``" +msgstr "``asend``, ``athrow``" + +msgid "``aclose``, ``__aiter__``, ``__anext__``" +msgstr "``aclose``, ``__aiter__``, ``__anext__``" + +msgid ":class:`Buffer` [1]_" +msgstr "" + +msgid "``__buffer__``" +msgstr "" + +msgid "Footnotes" +msgstr "Виноски" + +msgid "" +"These ABCs override :meth:`~abc.ABCMeta.__subclasshook__` to support testing " +"an interface by verifying the required methods are present and have not been " +"set to :const:`None`. This only works for simple interfaces. More complex " +"interfaces require registration or direct subclassing." +msgstr "" + +msgid "" +"Checking ``isinstance(obj, Iterable)`` detects classes that are registered " +"as :class:`Iterable` or that have an :meth:`~container.__iter__` method, but " +"it does not detect classes that iterate with the :meth:`~object.__getitem__` " +"method. The only reliable way to determine whether an object is :term:" +"`iterable` is to call ``iter(obj)``." +msgstr "" + +msgid "Collections Abstract Base Classes -- Detailed Descriptions" +msgstr "Колекції абстрактних базових класів -- докладні описи" + +msgid "ABC for classes that provide the :meth:`~object.__contains__` method." +msgstr "" + +msgid "ABC for classes that provide the :meth:`~object.__hash__` method." +msgstr "" + +msgid "ABC for classes that provide the :meth:`~object.__len__` method." +msgstr "" + +msgid "ABC for classes that provide the :meth:`~object.__call__` method." +msgstr "" + +msgid "" +"See :ref:`annotating-callables` for details on how to use :class:`!Callable` " +"in type annotations." +msgstr "" + +msgid "ABC for classes that provide the :meth:`~container.__iter__` method." +msgstr "" + +msgid "" +"Checking ``isinstance(obj, Iterable)`` detects classes that are registered " +"as :class:`Iterable` or that have an :meth:`~container.__iter__` method, but " +"it does not detect classes that iterate with the :meth:`~object.__getitem__` " +"method. The only reliable way to determine whether an object is :term:" +"`iterable` is to call ``iter(obj)``." +msgstr "" + +msgid "ABC for sized iterable container classes." +msgstr "ABC для класів ітерованих контейнерів розміру." + +msgid "" +"ABC for classes that provide the :meth:`~iterator.__iter__` and :meth:" +"`~iterator.__next__` methods. See also the definition of :term:`iterator`." +msgstr "" +"ABC для класів, які забезпечують методи :meth:`~iterator.__iter__` і :meth:" +"`~iterator.__next__`. Дивіться також визначення :term:`iterator`." + +msgid "" +"ABC for iterable classes that also provide the :meth:`~object.__reversed__` " +"method." +msgstr "" + +msgid "" +"ABC for :term:`generator` classes that implement the protocol defined in :" +"pep:`342` that extends :term:`iterators ` with the :meth:" +"`~generator.send`, :meth:`~generator.throw` and :meth:`~generator.close` " +"methods." +msgstr "" + +msgid "" +"See :ref:`annotating-generators-and-coroutines` for details on using :class:" +"`!Generator` in type annotations." +msgstr "" + +msgid "ABCs for read-only and mutable :term:`sequences `." +msgstr "" +"Азбука для доступних лише для читання та змінних :term:`послідовностей " +"`." + +msgid "" +"Implementation note: Some of the mixin methods, such as :meth:`~container." +"__iter__`, :meth:`~object.__reversed__` and :meth:`index`, make repeated " +"calls to the underlying :meth:`~object.__getitem__` method. Consequently, " +"if :meth:`~object.__getitem__` is implemented with constant access speed, " +"the mixin methods will have linear performance; however, if the underlying " +"method is linear (as it would be with a linked list), the mixins will have " +"quadratic performance and will likely need to be overridden." +msgstr "" + +msgid "The index() method added support for *stop* and *start* arguments." +msgstr "Метод index() додав підтримку аргументів *stop* і *start*." + +msgid "" +"The :class:`ByteString` ABC has been deprecated. For use in typing, prefer a " +"union, like ``bytes | bytearray``, or :class:`collections.abc.Buffer`. For " +"use as an ABC, prefer :class:`Sequence` or :class:`collections.abc.Buffer`." +msgstr "" + +msgid "ABCs for read-only and mutable :ref:`sets `." +msgstr "" + +msgid "ABCs for read-only and mutable :term:`mappings `." +msgstr "Азбука лише для читання та змінних :term:`відображення `." + +msgid "" +"ABCs for mapping, items, keys, and values :term:`views `." +msgstr "" +"Азбука зіставлення, елементів, ключів і значень :term:`views `." + +msgid "" +"ABC for :term:`awaitable` objects, which can be used in :keyword:`await` " +"expressions. Custom implementations must provide the :meth:`~object." +"__await__` method." +msgstr "" + +msgid "" +":term:`Coroutine ` objects and instances of the :class:" +"`~collections.abc.Coroutine` ABC are all instances of this ABC." +msgstr "" +":term:`Coroutine ` об’єкти та екземпляри :class:`~collections.abc." +"Coroutine` ABC є екземплярами цього ABC." + +msgid "" +"In CPython, generator-based coroutines (:term:`generators ` " +"decorated with :func:`@types.coroutine `) are *awaitables*, " +"even though they do not have an :meth:`~object.__await__` method. Using " +"``isinstance(gencoro, Awaitable)`` for them will return ``False``. Use :func:" +"`inspect.isawaitable` to detect them." +msgstr "" + +msgid "" +"ABC for :term:`coroutine` compatible classes. These implement the following " +"methods, defined in :ref:`coroutine-objects`: :meth:`~coroutine.send`, :meth:" +"`~coroutine.throw`, and :meth:`~coroutine.close`. Custom implementations " +"must also implement :meth:`~object.__await__`. All :class:`Coroutine` " +"instances are also instances of :class:`Awaitable`." +msgstr "" + +msgid "" +"In CPython, generator-based coroutines (:term:`generators ` " +"decorated with :func:`@types.coroutine `) are *awaitables*, " +"even though they do not have an :meth:`~object.__await__` method. Using " +"``isinstance(gencoro, Coroutine)`` for them will return ``False``. Use :func:" +"`inspect.isawaitable` to detect them." +msgstr "" + +msgid "" +"See :ref:`annotating-generators-and-coroutines` for details on using :class:" +"`!Coroutine` in type annotations. The variance and order of type parameters " +"correspond to those of :class:`Generator`." +msgstr "" + +msgid "" +"ABC for classes that provide an ``__aiter__`` method. See also the " +"definition of :term:`asynchronous iterable`." +msgstr "" + +msgid "" +"ABC for classes that provide ``__aiter__`` and ``__anext__`` methods. See " +"also the definition of :term:`asynchronous iterator`." +msgstr "" +"ABC для класів, які надають методи ``__aiter__`` і ``__anext__``. Дивіться " +"також визначення :term:`asynchronous iterator`." + +msgid "" +"ABC for :term:`asynchronous generator` classes that implement the protocol " +"defined in :pep:`525` and :pep:`492`." +msgstr "" + +msgid "" +"See :ref:`annotating-generators-and-coroutines` for details on using :class:" +"`!AsyncGenerator` in type annotations." +msgstr "" + +msgid "" +"ABC for classes that provide the :meth:`~object.__buffer__` method, " +"implementing the :ref:`buffer protocol `. See :pep:`688`." +msgstr "" + +msgid "Examples and Recipes" +msgstr "Приклади та рецепти" + +msgid "" +"ABCs allow us to ask classes or instances if they provide particular " +"functionality, for example::" +msgstr "" +"ABC дозволяє нам запитувати класи чи екземпляри, чи надають вони певну " +"функціональність, наприклад:" + +msgid "" +"size = None\n" +"if isinstance(myvar, collections.abc.Sized):\n" +" size = len(myvar)" +msgstr "" + +msgid "" +"Several of the ABCs are also useful as mixins that make it easier to develop " +"classes supporting container APIs. For example, to write a class supporting " +"the full :class:`Set` API, it is only necessary to supply the three " +"underlying abstract methods: :meth:`~object.__contains__`, :meth:`~container." +"__iter__`, and :meth:`~object.__len__`. The ABC supplies the remaining " +"methods such as :meth:`!__and__` and :meth:`~frozenset.isdisjoint`::" +msgstr "" + +msgid "" +"class ListBasedSet(collections.abc.Set):\n" +" ''' Alternate set implementation favoring space over speed\n" +" and not requiring the set elements to be hashable. '''\n" +" def __init__(self, iterable):\n" +" self.elements = lst = []\n" +" for value in iterable:\n" +" if value not in lst:\n" +" lst.append(value)\n" +"\n" +" def __iter__(self):\n" +" return iter(self.elements)\n" +"\n" +" def __contains__(self, value):\n" +" return value in self.elements\n" +"\n" +" def __len__(self):\n" +" return len(self.elements)\n" +"\n" +"s1 = ListBasedSet('abcdef')\n" +"s2 = ListBasedSet('defghi')\n" +"overlap = s1 & s2 # The __and__() method is supported " +"automatically" +msgstr "" + +msgid "Notes on using :class:`Set` and :class:`MutableSet` as a mixin:" +msgstr "" +"Примітки щодо використання :class:`Set` і :class:`MutableSet` як міксину:" + +msgid "" +"Since some set operations create new sets, the default mixin methods need a " +"way to create new instances from an :term:`iterable`. The class constructor " +"is assumed to have a signature in the form ``ClassName(iterable)``. That " +"assumption is factored-out to an internal :class:`classmethod` called :meth:" +"`!_from_iterable` which calls ``cls(iterable)`` to produce a new set. If " +"the :class:`Set` mixin is being used in a class with a different constructor " +"signature, you will need to override :meth:`!_from_iterable` with a " +"classmethod or regular method that can construct new instances from an " +"iterable argument." +msgstr "" + +msgid "" +"To override the comparisons (presumably for speed, as the semantics are " +"fixed), redefine :meth:`~object.__le__` and :meth:`~object.__ge__`, then the " +"other operations will automatically follow suit." +msgstr "" + +msgid "" +"The :class:`Set` mixin provides a :meth:`!_hash` method to compute a hash " +"value for the set; however, :meth:`~object.__hash__` is not defined because " +"not all sets are :term:`hashable` or immutable. To add set hashability " +"using mixins, inherit from both :meth:`Set` and :meth:`Hashable`, then " +"define ``__hash__ = Set._hash``." +msgstr "" + +msgid "" +"`OrderedSet recipe `_ for an " +"example built on :class:`MutableSet`." +msgstr "" +"`Рецепт OrderedSet `_ для " +"прикладу, побудованого на :class:`MutableSet`." + +msgid "For more about ABCs, see the :mod:`abc` module and :pep:`3119`." +msgstr "" +"Щоб дізнатися більше про ABC, перегляньте модуль :mod:`abc` і :pep:`3119`." diff --git a/library/colorsys.po b/library/colorsys.po new file mode 100644 index 000000000..e71e655b3 --- /dev/null +++ b/library/colorsys.po @@ -0,0 +1,82 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:57+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!colorsys` --- Conversions between color systems" +msgstr "" + +msgid "**Source code:** :source:`Lib/colorsys.py`" +msgstr "**Вихідний код:** :source:`Lib/colorsys.py`" + +msgid "" +"The :mod:`colorsys` module defines bidirectional conversions of color values " +"between colors expressed in the RGB (Red Green Blue) color space used in " +"computer monitors and three other coordinate systems: YIQ, HLS (Hue " +"Lightness Saturation) and HSV (Hue Saturation Value). Coordinates in all of " +"these color spaces are floating-point values. In the YIQ space, the Y " +"coordinate is between 0 and 1, but the I and Q coordinates can be positive " +"or negative. In all other spaces, the coordinates are all between 0 and 1." +msgstr "" + +msgid "" +"More information about color spaces can be found at https://poynton.ca/" +"ColorFAQ.html and https://www.cambridgeincolour.com/tutorials/color-spaces." +"htm." +msgstr "" +"Більше інформації про колірні простори можна знайти на https://poynton.ca/" +"ColorFAQ.html і https://www.cambridgeincolour.com/tutorials/color-spaces.htm." + +msgid "The :mod:`colorsys` module defines the following functions:" +msgstr "Модуль :mod:`colorsys` визначає такі функції:" + +msgid "Convert the color from RGB coordinates to YIQ coordinates." +msgstr "Перетворення кольору з координат RGB на координати YIQ." + +msgid "Convert the color from YIQ coordinates to RGB coordinates." +msgstr "Перетворення кольору з координат YIQ на координати RGB." + +msgid "Convert the color from RGB coordinates to HLS coordinates." +msgstr "Перетворення кольору з координат RGB на координати HLS." + +msgid "Convert the color from HLS coordinates to RGB coordinates." +msgstr "Перетворення кольору з координат HLS на координати RGB." + +msgid "Convert the color from RGB coordinates to HSV coordinates." +msgstr "Перетворення кольору з координат RGB на координати HSV." + +msgid "Convert the color from HSV coordinates to RGB coordinates." +msgstr "Перетворення кольору з координат HSV на координати RGB." + +msgid "Example::" +msgstr "Приклад::" + +msgid "" +">>> import colorsys\n" +">>> colorsys.rgb_to_hsv(0.2, 0.4, 0.4)\n" +"(0.5, 0.5, 0.4)\n" +">>> colorsys.hsv_to_rgb(0.5, 0.5, 0.4)\n" +"(0.2, 0.4, 0.4)" +msgstr "" diff --git a/library/compileall.po b/library/compileall.po new file mode 100644 index 000000000..31a0d2080 --- /dev/null +++ b/library/compileall.po @@ -0,0 +1,480 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:57+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!compileall` --- Byte-compile Python libraries" +msgstr "" + +msgid "**Source code:** :source:`Lib/compileall.py`" +msgstr "**Вихідний код:** :source:`Lib/compileall.py`" + +msgid "" +"This module provides some utility functions to support installing Python " +"libraries. These functions compile Python source files in a directory tree. " +"This module can be used to create the cached byte-code files at library " +"installation time, which makes them available for use even by users who " +"don't have write permission to the library directories." +msgstr "" +"Цей модуль надає деякі службові функції для підтримки встановлення бібліотек " +"Python. Ці функції компілюють вихідні файли Python у дереві каталогів. Цей " +"модуль можна використовувати для створення кешованих файлів байт-коду під " +"час встановлення бібліотеки, що робить їх доступними для використання навіть " +"користувачами, які не мають дозволу на запис до каталогів бібліотеки." + +msgid "Availability" +msgstr "" + +msgid "" +"This module does not work or is not available on WebAssembly. See :ref:`wasm-" +"availability` for more information." +msgstr "" + +msgid "Command-line use" +msgstr "Використання командного рядка" + +msgid "" +"This module can work as a script (using :program:`python -m compileall`) to " +"compile Python sources." +msgstr "" +"Цей модуль може працювати як сценарій (за допомогою :program:`python -m " +"compileall`) для компіляції вихідних кодів Python." + +msgid "" +"Positional arguments are files to compile or directories that contain source " +"files, traversed recursively. If no argument is given, behave as if the " +"command line was :samp:`-l {}`." +msgstr "" + +msgid "" +"Do not recurse into subdirectories, only compile source code files directly " +"contained in the named or implied directories." +msgstr "" +"Не повертайтеся до підкаталогів, лише компілюйте файли вихідного коду, які " +"безпосередньо містяться в названих або неявних каталогах." + +msgid "Force rebuild even if timestamps are up-to-date." +msgstr "Примусове відновлення, навіть якщо мітки часу актуальні." + +msgid "" +"Do not print the list of files compiled. If passed once, error messages will " +"still be printed. If passed twice (``-qq``), all output is suppressed." +msgstr "" +"Не друкуйте список зібраних файлів. Якщо передати один раз, повідомлення про " +"помилку все одно друкуватимуться. Якщо передати двічі (``-qq``), весь вивід " +"пригнічується." + +msgid "" +"Directory prepended to the path to each file being compiled. This will " +"appear in compilation time tracebacks, and is also compiled in to the byte-" +"code file, where it will be used in tracebacks and other messages in cases " +"where the source file does not exist at the time the byte-code file is " +"executed." +msgstr "" +"Каталог додається до шляху до кожного файлу, що компілюється. Це " +"відображатиметься у відстеженнях під час компіляції, а також буде " +"скомпільовано у файл байт-коду, де воно використовуватиметься у відстеженнях " +"та інших повідомленнях у випадках, коли вихідний файл не існує під час " +"виконання файлу байт-коду." + +msgid "" +"Remove (``-s``) or append (``-p``) the given prefix of paths recorded in the " +"``.pyc`` files. Cannot be combined with ``-d``." +msgstr "" +"Видаліть (``-s``) або додайте (``-p``) заданий префікс шляхів, записаних у " +"файлах ``.pyc``. Не можна поєднувати з ``-d``." + +msgid "" +"regex is used to search the full path to each file considered for " +"compilation, and if the regex produces a match, the file is skipped." +msgstr "" +"регулярний вираз використовується для пошуку повного шляху до кожного файлу, " +"який розглядається для компіляції, і якщо регулярний вираз видає збіг, файл " +"пропускається." + +msgid "" +"Read the file ``list`` and add each line that it contains to the list of " +"files and directories to compile. If ``list`` is ``-``, read lines from " +"``stdin``." +msgstr "" +"Прочитайте файл ``список`` і додайте кожен рядок, який він містить, до " +"списку файлів і каталогів для компіляції. Якщо ``список`` ``-``, читати " +"рядки з ``stdin``." + +msgid "" +"Write the byte-code files to their legacy locations and names, which may " +"overwrite byte-code files created by another version of Python. The default " +"is to write files to their :pep:`3147` locations and names, which allows " +"byte-code files from multiple versions of Python to coexist." +msgstr "" +"Запишіть файли байт-коду в їхні застарілі розташування та імена, які можуть " +"перезаписати файли байт-коду, створені іншою версією Python. За " +"замовчуванням файли записуються в їхні розташування та імена :pep:`3147`, що " +"дозволяє співіснувати файлам байт-коду з кількох версій Python." + +msgid "" +"Control the maximum recursion level for subdirectories. If this is given, " +"then ``-l`` option will not be taken into account. :program:`python -m " +"compileall -r 0` is equivalent to :program:`python -m compileall " +" -l`." +msgstr "" +"Контролюйте максимальний рівень рекурсії для підкаталогів. Якщо це задано, " +"то параметр ``-l`` не буде взято до уваги. :program:`python -m compileall " +" -r 0` еквівалентно :program:`python -m compileall -" +"l`." + +msgid "" +"Use *N* workers to compile the files within the given directory. If ``0`` is " +"used, then the result of :func:`os.process_cpu_count` will be used." +msgstr "" + +msgid "" +"Control how the generated byte-code files are invalidated at runtime. The " +"``timestamp`` value, means that ``.pyc`` files with the source timestamp and " +"size embedded will be generated. The ``checked-hash`` and ``unchecked-hash`` " +"values cause hash-based pycs to be generated. Hash-based pycs embed a hash " +"of the source file contents rather than a timestamp. See :ref:`pyc-" +"invalidation` for more information on how Python validates bytecode cache " +"files at runtime. The default is ``timestamp`` if the :envvar:" +"`SOURCE_DATE_EPOCH` environment variable is not set, and ``checked-hash`` if " +"the ``SOURCE_DATE_EPOCH`` environment variable is set." +msgstr "" +"Керуйте тим, як згенеровані файли байт-коду стають недійсними під час " +"виконання. Значення ``timestamp`` означає, що будуть створені файли ``.pyc`` " +"із вбудованою міткою часу джерела та розміром. Значення ``checked-hash`` і " +"``unchecked-hash`` призводять до генерації pyc на основі хешу. pyc на основі " +"хешу вбудовує хеш вмісту вихідного файлу, а не мітку часу. Перегляньте :ref:" +"`pyc-invalidation` для отримання додаткової інформації про те, як Python " +"перевіряє файли кешу байт-коду під час виконання. Типовим значенням є " +"``timestamp``, якщо змінна середовища :envvar:`SOURCE_DATE_EPOCH` не " +"встановлено, і ``checked-hash``, якщо встановлена змінна середовища " +"``SOURCE_DATE_EPOCH``." + +msgid "" +"Compile with the given optimization level. May be used multiple times to " +"compile for multiple levels at a time (for example, ``compileall -o 1 -o " +"2``)." +msgstr "" +"Зібрати з заданим рівнем оптимізації. Може використовуватися кілька разів " +"для компіляції для кількох рівнів одночасно (наприклад, ``compileall -o 1 -o " +"2``)." + +msgid "Ignore symlinks pointing outside the given directory." +msgstr "Ігноруйте символічні посилання, що вказують за межі даного каталогу." + +msgid "" +"If two ``.pyc`` files with different optimization level have the same " +"content, use hard links to consolidate duplicate files." +msgstr "" +"Якщо два файли ``.pyc`` з різним рівнем оптимізації мають однаковий вміст, " +"використовуйте жорсткі посилання для об’єднання дублікатів файлів." + +msgid "Added the ``-i``, ``-b`` and ``-h`` options." +msgstr "Додано параметри ``-i``, ``-b`` і ``-h``." + +msgid "" +"Added the ``-j``, ``-r``, and ``-qq`` options. ``-q`` option was changed " +"to a multilevel value. ``-b`` will always produce a byte-code file ending " +"in ``.pyc``, never ``.pyo``." +msgstr "" +"Додано параметри ``-j``, ``-r`` і ``-qq``. Опцію ``-q`` було змінено на " +"багаторівневе значення. ``-b`` завжди створюватиме файл байт-коду із " +"закінченням ``.pyc``, ніколи ``.pyo``." + +msgid "Added the ``--invalidation-mode`` option." +msgstr "Додано параметр ``--invalidation-mode``." + +msgid "" +"Added the ``-s``, ``-p``, ``-e`` and ``--hardlink-dupes`` options. Raised " +"the default recursion limit from 10 to :py:func:`sys.getrecursionlimit()`. " +"Added the possibility to specify the ``-o`` option multiple times." +msgstr "" +"Додано параметри ``-s``, ``-p``, ``-e`` і ``--hardlink-dupes``. Ліміт " +"рекурсії за умовчанням збільшено з 10 до :py:func:`sys.getrecursionlimit()`. " +"Додано можливість вказувати опцію ``-o`` кілька разів." + +msgid "" +"There is no command-line option to control the optimization level used by " +"the :func:`compile` function, because the Python interpreter itself already " +"provides the option: :program:`python -O -m compileall`." +msgstr "" +"Немає параметра командного рядка для керування рівнем оптимізації, який " +"використовується функцією :func:`compile`, оскільки сам інтерпретатор Python " +"уже надає параметр: :program:`python -O -m compileall`." + +msgid "" +"Similarly, the :func:`compile` function respects the :data:`sys." +"pycache_prefix` setting. The generated bytecode cache will only be useful " +"if :func:`compile` is run with the same :data:`sys.pycache_prefix` (if any) " +"that will be used at runtime." +msgstr "" + +msgid "Public functions" +msgstr "Громадські функції" + +msgid "" +"Recursively descend the directory tree named by *dir*, compiling all :file:`." +"py` files along the way. Return a true value if all the files compiled " +"successfully, and a false value otherwise." +msgstr "" +"Рекурсивно спустіться за деревом каталогів, названим *dir*, компілюючи всі " +"файли :file:`.py`. Повертає значення true, якщо всі файли скомпільовано " +"успішно, і значення false в іншому випадку." + +msgid "" +"The *maxlevels* parameter is used to limit the depth of the recursion; it " +"defaults to ``sys.getrecursionlimit()``." +msgstr "" +"Параметр *maxlevels* використовується для обмеження глибини рекурсії; за " +"умовчанням встановлено ``sys.getrecursionlimit()``." + +msgid "" +"If *ddir* is given, it is prepended to the path to each file being compiled " +"for use in compilation time tracebacks, and is also compiled in to the byte-" +"code file, where it will be used in tracebacks and other messages in cases " +"where the source file does not exist at the time the byte-code file is " +"executed." +msgstr "" +"Якщо вказано *ddir*, він додається до шляху до кожного файлу, що " +"компілюється для використання в трасуванні часу компіляції, а також " +"компілюється у файл байт-коду, де він використовуватиметься в трасуванні та " +"інших повідомленнях у випадках, коли вихідний файл не існує на момент " +"виконання файлу байт-коду." + +msgid "" +"If *force* is true, modules are re-compiled even if the timestamps are up to " +"date." +msgstr "" +"Якщо *force* має значення true, модулі компілюються повторно, навіть якщо " +"мітки часу актуальні." + +msgid "" +"If *rx* is given, its ``search`` method is called on the complete path to " +"each file considered for compilation, and if it returns a true value, the " +"file is skipped. This can be used to exclude files matching a regular " +"expression, given as a :ref:`re.Pattern ` object." +msgstr "" +"Якщо вказано *rx*, його метод ``search`` викликається на повному шляху до " +"кожного файлу, який розглядається для компіляції, і якщо він повертає " +"справжнє значення, файл пропускається. Це можна використовувати для " +"виключення файлів, які відповідають регулярному виразу, заданому як об’єкт :" +"ref:`re.Pattern `." + +msgid "" +"If *quiet* is ``False`` or ``0`` (the default), the filenames and other " +"information are printed to standard out. Set to ``1``, only errors are " +"printed. Set to ``2``, all output is suppressed." +msgstr "" +"Якщо *quiet* має значення ``False`` або ``0`` (за замовчуванням), назви " +"файлів та інша інформація друкуються стандартно. Установлено на ``1``, " +"друкуються лише помилки. Установлено на ``2``, усі виведення пригнічуються." + +msgid "" +"If *legacy* is true, byte-code files are written to their legacy locations " +"and names, which may overwrite byte-code files created by another version of " +"Python. The default is to write files to their :pep:`3147` locations and " +"names, which allows byte-code files from multiple versions of Python to " +"coexist." +msgstr "" +"Якщо значення *legacy* має значення true, файли з байт-кодом записуються до " +"своїх застарілих розташувань і імен, які можуть перезаписати файли з байт-" +"кодом, створені іншою версією Python. За замовчуванням файли записуються до " +"їхніх :pep:`3147` розташувань та імен, що дозволяє файлам байт-коду з " +"кількох версій Python співіснувати." + +msgid "" +"*optimize* specifies the optimization level for the compiler. It is passed " +"to the built-in :func:`compile` function. Accepts also a sequence of " +"optimization levels which lead to multiple compilations of one :file:`.py` " +"file in one call." +msgstr "" +"*optimize* вказує рівень оптимізації для компілятора. Він передається до " +"вбудованої функції :func:`compile`. Приймає також послідовність рівнів " +"оптимізації, які призводять до кількох компіляцій одного файлу :file:`.py` " +"за один виклик." + +msgid "" +"The argument *workers* specifies how many workers are used to compile files " +"in parallel. The default is to not use multiple workers. If the platform " +"can't use multiple workers and *workers* argument is given, then sequential " +"compilation will be used as a fallback. If *workers* is 0, the number of " +"cores in the system is used. If *workers* is lower than ``0``, a :exc:" +"`ValueError` will be raised." +msgstr "" +"Аргумент *workers* визначає, скільки робітників використовується для " +"паралельної компіляції файлів. За замовчуванням не використовується кілька " +"робітників. Якщо платформа не може використовувати кілька робітників і " +"надано аргумент *workers*, то послідовна компіляція буде використана як " +"запасний варіант. Якщо *workers* дорівнює 0, використовується кількість ядер " +"у системі. Якщо *workers* нижчий за ``0``, буде викликано :exc:`ValueError`." + +msgid "" +"*invalidation_mode* should be a member of the :class:`py_compile." +"PycInvalidationMode` enum and controls how the generated pycs are " +"invalidated at runtime." +msgstr "" +"*invalidation_mode* має бути членом переліку :class:`py_compile." +"PycInvalidationMode` і керувати тим, як згенеровані pyc стають недійсними " +"під час виконання." + +msgid "" +"The *stripdir*, *prependdir* and *limit_sl_dest* arguments correspond to the " +"``-s``, ``-p`` and ``-e`` options described above. They may be specified as " +"``str`` or :py:class:`os.PathLike`." +msgstr "" + +msgid "" +"If *hardlink_dupes* is true and two ``.pyc`` files with different " +"optimization level have the same content, use hard links to consolidate " +"duplicate files." +msgstr "" +"Якщо *hardlink_dupes* має значення true і два файли ``.pyc`` з різним рівнем " +"оптимізації мають однаковий вміст, використовуйте жорсткі посилання для " +"об’єднання дублікатів файлів." + +msgid "Added the *legacy* and *optimize* parameter." +msgstr "Додано параметр *legacy* і *optimize*." + +msgid "Added the *workers* parameter." +msgstr "Додано параметр *workers*." + +msgid "*quiet* parameter was changed to a multilevel value." +msgstr "Параметр *quiet* змінено на багаторівневе значення." + +msgid "" +"The *legacy* parameter only writes out ``.pyc`` files, not ``.pyo`` files no " +"matter what the value of *optimize* is." +msgstr "" +"Параметр *legacy* записує лише файли ``.pyc``, а не файли ``.pyo`` незалежно " +"від значення *optimize*." + +msgid "Accepts a :term:`path-like object`." +msgstr "Приймає :term:`path-like object`." + +msgid "The *invalidation_mode* parameter was added." +msgstr "Додано параметр *invalidation_mode*." + +msgid "" +"The *invalidation_mode* parameter's default value is updated to ``None``." +msgstr "" + +msgid "Setting *workers* to 0 now chooses the optimal number of cores." +msgstr "Встановлення *workers* на 0 тепер вибирає оптимальну кількість ядер." + +msgid "" +"Added *stripdir*, *prependdir*, *limit_sl_dest* and *hardlink_dupes* " +"arguments. Default value of *maxlevels* was changed from ``10`` to ``sys." +"getrecursionlimit()``" +msgstr "" +"Додано аргументи *stripdir*, *prependdir*, *limit_sl_dest* і " +"*hardlink_dupes*. Значення за замовчуванням *maxlevels* змінено з ``10`` на " +"``sys.getrecursionlimit()``" + +msgid "" +"Compile the file with path *fullname*. Return a true value if the file " +"compiled successfully, and a false value otherwise." +msgstr "" +"Скомпілюйте файл із шляхом *fullname*. Повертає значення true, якщо файл " +"скомпільовано успішно, і значення false в іншому випадку." + +msgid "" +"If *ddir* is given, it is prepended to the path to the file being compiled " +"for use in compilation time tracebacks, and is also compiled in to the byte-" +"code file, where it will be used in tracebacks and other messages in cases " +"where the source file does not exist at the time the byte-code file is " +"executed." +msgstr "" +"Якщо вказано *ddir*, він додається до шляху до файлу, що компілюється для " +"використання в відстеженнях часу компіляції, а також компілюється у файл " +"байт-коду, де він використовуватиметься в відстеженнях та інших " +"повідомленнях у випадках, коли вихідний файл не існує на момент виконання " +"файлу байт-коду." + +msgid "" +"If *rx* is given, its ``search`` method is passed the full path name to the " +"file being compiled, and if it returns a true value, the file is not " +"compiled and ``True`` is returned. This can be used to exclude files " +"matching a regular expression, given as a :ref:`re.Pattern ` " +"object." +msgstr "" +"Якщо задано *rx*, його методу ``search`` передається повне ім’я шляху до " +"файлу, що компілюється, і якщо він повертає значення true, файл не " +"скомпільується і повертається ``True``. Це можна використовувати для " +"виключення файлів, які відповідають регулярному виразу, заданому як об’єкт :" +"ref:`re.Pattern `." + +msgid "" +"Added *stripdir*, *prependdir*, *limit_sl_dest* and *hardlink_dupes* " +"arguments." +msgstr "" +"Додано аргументи *stripdir*, *prependdir*, *limit_sl_dest* і " +"*hardlink_dupes*." + +msgid "" +"Byte-compile all the :file:`.py` files found along ``sys.path``. Return a " +"true value if all the files compiled successfully, and a false value " +"otherwise." +msgstr "" +"Байтова компіляція всіх файлів :file:`.py`, знайдених уздовж ``sys.path``. " +"Повертає значення true, якщо всі файли скомпільовано успішно, і значення " +"false в іншому випадку." + +msgid "" +"If *skip_curdir* is true (the default), the current directory is not " +"included in the search. All other parameters are passed to the :func:" +"`compile_dir` function. Note that unlike the other compile functions, " +"``maxlevels`` defaults to ``0``." +msgstr "" +"Якщо *skip_curdir* має значення true (за замовчуванням), поточний каталог не " +"включається в пошук. Усі інші параметри передаються до функції :func:" +"`compile_dir`. Зауважте, що на відміну від інших функцій компіляції, " +"``maxlevels`` за умовчанням має ``0``." + +msgid "" +"To force a recompile of all the :file:`.py` files in the :file:`Lib/` " +"subdirectory and all its subdirectories::" +msgstr "" +"Щоб примусово перекомпілювати всі файли :file:`.py` у підкаталозі :file:`Lib/" +"` та всіх його підкаталогах:" + +msgid "" +"import compileall\n" +"\n" +"compileall.compile_dir('Lib/', force=True)\n" +"\n" +"# Perform same compilation, excluding files in .svn directories.\n" +"import re\n" +"compileall.compile_dir('Lib/', rx=re.compile(r'[/\\\\][.]svn'), force=True)\n" +"\n" +"# pathlib.Path objects can also be used.\n" +"import pathlib\n" +"compileall.compile_dir(pathlib.Path('Lib/'), force=True)" +msgstr "" + +msgid "Module :mod:`py_compile`" +msgstr "Модуль :mod:`py_compile`" + +msgid "Byte-compile a single source file." +msgstr "Байтова компіляція єдиного вихідного файлу." diff --git a/library/concurrency.po b/library/concurrency.po new file mode 100644 index 000000000..23f788527 --- /dev/null +++ b/library/concurrency.po @@ -0,0 +1,45 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:57+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Concurrent Execution" +msgstr "Паралельне виконання" + +msgid "" +"The modules described in this chapter provide support for concurrent " +"execution of code. The appropriate choice of tool will depend on the task to " +"be executed (CPU bound vs IO bound) and preferred style of development " +"(event driven cooperative multitasking vs preemptive multitasking). Here's " +"an overview:" +msgstr "" +"Модулі, описані в цьому розділі, забезпечують підтримку одночасного " +"виконання коду. Відповідний вибір інструменту залежатиме від завдання, яке " +"потрібно виконати (прив’язка до процесора чи прив’язка до вводу-виводу) і " +"бажаного стилю розробки (кооперативна багатозадачність, керована подіями, " +"проти випереджальної багатозадачності). Ось огляд:" + +msgid "The following are support modules for some of the above services:" +msgstr "Нижче наведено модулі підтримки для деяких із зазначених вище служб:" diff --git a/library/concurrent.po b/library/concurrent.po new file mode 100644 index 000000000..cb62f9ca2 --- /dev/null +++ b/library/concurrent.po @@ -0,0 +1,35 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:57+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "The :mod:`!concurrent` package" +msgstr "" + +msgid "Currently, there is only one module in this package:" +msgstr "Наразі в цьому пакеті лише один модуль:" + +msgid ":mod:`concurrent.futures` -- Launching parallel tasks" +msgstr ":mod:`concurrent.futures` -- Запуск паралельних завдань" diff --git a/library/concurrent_futures.po b/library/concurrent_futures.po new file mode 100644 index 000000000..9bb76161b --- /dev/null +++ b/library/concurrent_futures.po @@ -0,0 +1,786 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:57+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!concurrent.futures` --- Launching parallel tasks" +msgstr "" + +msgid "" +"**Source code:** :source:`Lib/concurrent/futures/thread.py` and :source:`Lib/" +"concurrent/futures/process.py`" +msgstr "" +"**Вихідний код:** :source:`Lib/concurrent/futures/thread.py` і :source:`Lib/" +"concurrent/futures/process.py`" + +msgid "" +"The :mod:`concurrent.futures` module provides a high-level interface for " +"asynchronously executing callables." +msgstr "" +"Модуль :mod:`concurrent.futures` забезпечує інтерфейс високого рівня для " +"асинхронного виконання викликів." + +msgid "" +"The asynchronous execution can be performed with threads, using :class:" +"`ThreadPoolExecutor`, or separate processes, using :class:" +"`ProcessPoolExecutor`. Both implement the same interface, which is defined " +"by the abstract :class:`Executor` class." +msgstr "" +"Асинхронне виконання може виконуватися потоками, використовуючи :class:" +"`ThreadPoolExecutor`, або окремими процесами, використовуючи :class:" +"`ProcessPoolExecutor`. Обидва реалізують однаковий інтерфейс, який " +"визначається абстрактним класом :class:`Executor`." + +msgid "Availability" +msgstr "" + +msgid "" +"This module does not work or is not available on WebAssembly. See :ref:`wasm-" +"availability` for more information." +msgstr "" + +msgid "Executor Objects" +msgstr "Об'єкти виконавця" + +msgid "" +"An abstract class that provides methods to execute calls asynchronously. It " +"should not be used directly, but through its concrete subclasses." +msgstr "" +"Абстрактний клас, який надає методи для асинхронного виконання викликів. " +"Його слід використовувати не безпосередньо, а через його конкретні підкласи." + +msgid "" +"Schedules the callable, *fn*, to be executed as ``fn(*args, **kwargs)`` and " +"returns a :class:`Future` object representing the execution of the " +"callable. ::" +msgstr "" +"Планує виконання викликаного, *fn*, як ``fn(*args, **kwargs)`` і повертає " +"об’єкт :class:`Future`, який представляє виконання викликаного. ::" + +msgid "" +"with ThreadPoolExecutor(max_workers=1) as executor:\n" +" future = executor.submit(pow, 323, 1235)\n" +" print(future.result())" +msgstr "" + +msgid "Similar to :func:`map(fn, *iterables) ` except:" +msgstr "" + +msgid "the *iterables* are collected immediately rather than lazily;" +msgstr "*iterables* збираються негайно, а не ліниво;" + +msgid "" +"*fn* is executed asynchronously and several calls to *fn* may be made " +"concurrently." +msgstr "" + +msgid "" +"The returned iterator raises a :exc:`TimeoutError` if :meth:`~iterator." +"__next__` is called and the result isn't available after *timeout* seconds " +"from the original call to :meth:`Executor.map`. *timeout* can be an int or a " +"float. If *timeout* is not specified or ``None``, there is no limit to the " +"wait time." +msgstr "" + +msgid "" +"If a *fn* call raises an exception, then that exception will be raised when " +"its value is retrieved from the iterator." +msgstr "" + +msgid "" +"When using :class:`ProcessPoolExecutor`, this method chops *iterables* into " +"a number of chunks which it submits to the pool as separate tasks. The " +"(approximate) size of these chunks can be specified by setting *chunksize* " +"to a positive integer. For very long iterables, using a large value for " +"*chunksize* can significantly improve performance compared to the default " +"size of 1. With :class:`ThreadPoolExecutor`, *chunksize* has no effect." +msgstr "" +"Під час використання :class:`ProcessPoolExecutor` цей метод розбиває " +"*iterables* на кілька фрагментів, які надсилає до пулу як окремі завдання. " +"(Приблизний) розмір цих фрагментів можна вказати, встановивши для " +"*chunksize* додатне ціле число. Для дуже довгих ітерацій використання " +"великого значення *chunksize* може значно підвищити продуктивність порівняно " +"з розміром за замовчуванням 1. З :class:`ThreadPoolExecutor` *chunksize* не " +"впливає." + +msgid "Added the *chunksize* argument." +msgstr "Додано аргумент *chunksize*." + +msgid "" +"Signal the executor that it should free any resources that it is using when " +"the currently pending futures are done executing. Calls to :meth:`Executor." +"submit` and :meth:`Executor.map` made after shutdown will raise :exc:" +"`RuntimeError`." +msgstr "" +"Дайте сигнал виконавцю, що він повинен звільнити будь-які ресурси, які він " +"використовує, коли завершено виконання поточних ф’ючерсів. Виклики :meth:" +"`Executor.submit` і :meth:`Executor.map`, здійснені після вимкнення, " +"викличуть :exc:`RuntimeError`." + +msgid "" +"If *wait* is ``True`` then this method will not return until all the pending " +"futures are done executing and the resources associated with the executor " +"have been freed. If *wait* is ``False`` then this method will return " +"immediately and the resources associated with the executor will be freed " +"when all pending futures are done executing. Regardless of the value of " +"*wait*, the entire Python program will not exit until all pending futures " +"are done executing." +msgstr "" +"Якщо *wait* має значення ``True``, тоді цей метод не повернеться, доки не " +"буде завершено виконання всіх очікуваних ф’ючерсів і не буде звільнено " +"ресурси, пов’язані з виконавцем. Якщо *wait* має значення ``False``, тоді " +"цей метод повернеться негайно, а ресурси, пов’язані з виконавцем, будуть " +"звільнені, коли завершиться виконання всіх очікуваних ф’ючерсів. Незалежно " +"від значення *wait*, уся програма Python не завершить роботу, доки не буде " +"завершено виконання всіх незавершених ф’ючерсів." + +msgid "" +"If *cancel_futures* is ``True``, this method will cancel all pending futures " +"that the executor has not started running. Any futures that are completed or " +"running won't be cancelled, regardless of the value of *cancel_futures*." +msgstr "" +"Якщо *cancel_futures* має значення ``True``, цей метод скасує всі " +"незавершені ф’ючерси, які виконавець ще не запускав. Будь-які завершені або " +"запущені ф’ючерси не будуть скасовані, незалежно від значення " +"*cancel_futures*." + +msgid "" +"If both *cancel_futures* and *wait* are ``True``, all futures that the " +"executor has started running will be completed prior to this method " +"returning. The remaining futures are cancelled." +msgstr "" +"Якщо і *cancel_futures*, і *wait* мають значення ``True``, усі ф’ючерси, які " +"почав виконувати виконавець, будуть завершені до повернення цього методу. " +"Решта ф'ючерсів скасовано." + +msgid "" +"You can avoid having to call this method explicitly if you use the :keyword:" +"`with` statement, which will shutdown the :class:`Executor` (waiting as if :" +"meth:`Executor.shutdown` were called with *wait* set to ``True``)::" +msgstr "" +"Ви можете уникнути необхідності явного виклику цього методу, якщо " +"використаєте інструкцію :keyword:`with`, яка вимкне :class:`Executor` " +"(очікуючи так, ніби :meth:`Executor.shutdown` викликається з установленим " +"*wait* до ``Правда``)::" + +msgid "" +"import shutil\n" +"with ThreadPoolExecutor(max_workers=4) as e:\n" +" e.submit(shutil.copy, 'src1.txt', 'dest1.txt')\n" +" e.submit(shutil.copy, 'src2.txt', 'dest2.txt')\n" +" e.submit(shutil.copy, 'src3.txt', 'dest3.txt')\n" +" e.submit(shutil.copy, 'src4.txt', 'dest4.txt')" +msgstr "" + +msgid "Added *cancel_futures*." +msgstr "Додано *cancel_futures*." + +msgid "ThreadPoolExecutor" +msgstr "ThreadPoolExecutor" + +msgid "" +":class:`ThreadPoolExecutor` is an :class:`Executor` subclass that uses a " +"pool of threads to execute calls asynchronously." +msgstr "" +":class:`ThreadPoolExecutor` — це підклас :class:`Executor`, який " +"використовує пул потоків для асинхронного виконання викликів." + +msgid "" +"Deadlocks can occur when the callable associated with a :class:`Future` " +"waits on the results of another :class:`Future`. For example::" +msgstr "" +"Взаємоблокування можуть виникати, коли виклик, пов’язаний із :class:" +"`Future`, чекає результатів іншого :class:`Future`. Наприклад::" + +msgid "" +"import time\n" +"def wait_on_b():\n" +" time.sleep(5)\n" +" print(b.result()) # b will never complete because it is waiting on a.\n" +" return 5\n" +"\n" +"def wait_on_a():\n" +" time.sleep(5)\n" +" print(a.result()) # a will never complete because it is waiting on b.\n" +" return 6\n" +"\n" +"\n" +"executor = ThreadPoolExecutor(max_workers=2)\n" +"a = executor.submit(wait_on_b)\n" +"b = executor.submit(wait_on_a)" +msgstr "" + +msgid "And::" +msgstr "І::" + +msgid "" +"def wait_on_future():\n" +" f = executor.submit(pow, 5, 2)\n" +" # This will never complete because there is only one worker thread and\n" +" # it is executing this function.\n" +" print(f.result())\n" +"\n" +"executor = ThreadPoolExecutor(max_workers=1)\n" +"executor.submit(wait_on_future)" +msgstr "" + +msgid "" +"An :class:`Executor` subclass that uses a pool of at most *max_workers* " +"threads to execute calls asynchronously." +msgstr "" +"Підклас :class:`Executor`, який використовує пул щонайбільше *max_workers* " +"потоків для асинхронного виконання викликів." + +msgid "" +"All threads enqueued to ``ThreadPoolExecutor`` will be joined before the " +"interpreter can exit. Note that the exit handler which does this is executed " +"*before* any exit handlers added using ``atexit``. This means exceptions in " +"the main thread must be caught and handled in order to signal threads to " +"exit gracefully. For this reason, it is recommended that " +"``ThreadPoolExecutor`` not be used for long-running tasks." +msgstr "" + +msgid "" +"*initializer* is an optional callable that is called at the start of each " +"worker thread; *initargs* is a tuple of arguments passed to the " +"initializer. Should *initializer* raise an exception, all currently pending " +"jobs will raise a :exc:`~concurrent.futures.thread.BrokenThreadPool`, as " +"well as any attempt to submit more jobs to the pool." +msgstr "" +"*initializer* — необов’язковий виклик, який викликається на початку кожного " +"робочого потоку; *initargs* — це кортеж аргументів, що передається " +"ініціалізатору. Якщо *ініціалізатор* викликає виняток, усі наразі " +"незавершені завдання викличуть :exc:`~concurrent.futures.thread." +"BrokenThreadPool`, а також будь-яка спроба відправити більше завдань до пулу." + +msgid "" +"If *max_workers* is ``None`` or not given, it will default to the number of " +"processors on the machine, multiplied by ``5``, assuming that :class:" +"`ThreadPoolExecutor` is often used to overlap I/O instead of CPU work and " +"the number of workers should be higher than the number of workers for :class:" +"`ProcessPoolExecutor`." +msgstr "" +"Якщо *max_workers* має значення ``None`` або не вказано, за замовчуванням " +"буде використовуватися кількість процесорів на машині, помножена на ``5``, " +"припускаючи, що :class:`ThreadPoolExecutor` часто використовується для " +"перекриття вводу-виводу замість роботи центрального процесора, а кількість " +"робітників має бути більшою за кількість робітників для :class:" +"`ProcessPoolExecutor`." + +msgid "" +"Added the *thread_name_prefix* parameter to allow users to control the :" +"class:`threading.Thread` names for worker threads created by the pool for " +"easier debugging." +msgstr "" + +msgid "Added the *initializer* and *initargs* arguments." +msgstr "Додано аргументи *initializer* і *initargs*." + +msgid "" +"Default value of *max_workers* is changed to ``min(32, os.cpu_count() + " +"4)``. This default value preserves at least 5 workers for I/O bound tasks. " +"It utilizes at most 32 CPU cores for CPU bound tasks which release the GIL. " +"And it avoids using very large resources implicitly on many-core machines." +msgstr "" +"Значення за замовчуванням *max_workers* змінено на ``min(32, os.cpu_count() " +"+ 4)``. Це значення за замовчуванням зберігає принаймні 5 працівників для " +"завдань, пов’язаних із вводом-виводом. Він використовує щонайбільше 32 ядра " +"ЦП для пов’язаних із ЦП завдань, які випускають GIL. І це дозволяє уникнути " +"використання дуже великих ресурсів неявно на багатоядерних машинах." + +msgid "" +"ThreadPoolExecutor now reuses idle worker threads before starting " +"*max_workers* worker threads too." +msgstr "" +"ThreadPoolExecutor тепер повторно використовує неактивні робочі потоки перед " +"запуском робочих потоків *max_workers*." + +msgid "" +"Default value of *max_workers* is changed to ``min(32, (os." +"process_cpu_count() or 1) + 4)``." +msgstr "" + +msgid "ThreadPoolExecutor Example" +msgstr "Приклад ThreadPoolExecutor" + +msgid "" +"import concurrent.futures\n" +"import urllib.request\n" +"\n" +"URLS = ['http://www.foxnews.com/',\n" +" 'http://www.cnn.com/',\n" +" 'http://europe.wsj.com/',\n" +" 'http://www.bbc.co.uk/',\n" +" 'http://nonexistent-subdomain.python.org/']\n" +"\n" +"# Retrieve a single page and report the URL and contents\n" +"def load_url(url, timeout):\n" +" with urllib.request.urlopen(url, timeout=timeout) as conn:\n" +" return conn.read()\n" +"\n" +"# We can use a with statement to ensure threads are cleaned up promptly\n" +"with concurrent.futures.ThreadPoolExecutor(max_workers=5) as executor:\n" +" # Start the load operations and mark each future with its URL\n" +" future_to_url = {executor.submit(load_url, url, 60): url for url in " +"URLS}\n" +" for future in concurrent.futures.as_completed(future_to_url):\n" +" url = future_to_url[future]\n" +" try:\n" +" data = future.result()\n" +" except Exception as exc:\n" +" print('%r generated an exception: %s' % (url, exc))\n" +" else:\n" +" print('%r page is %d bytes' % (url, len(data)))" +msgstr "" + +msgid "ProcessPoolExecutor" +msgstr "ProcessPoolExecutor" + +msgid "" +"The :class:`ProcessPoolExecutor` class is an :class:`Executor` subclass that " +"uses a pool of processes to execute calls asynchronously. :class:" +"`ProcessPoolExecutor` uses the :mod:`multiprocessing` module, which allows " +"it to side-step the :term:`Global Interpreter Lock ` but also means that only picklable objects can be executed and " +"returned." +msgstr "" +"Клас :class:`ProcessPoolExecutor` є підкласом :class:`Executor`, який " +"використовує пул процесів для асинхронного виконання викликів. :class:" +"`ProcessPoolExecutor` використовує модуль :mod:`multiprocessing`, який " +"дозволяє йому обходити :term:`Global Interpreter Lock `, але також означає, що можна виконувати та повертати лише об’єкти, " +"які можна вибрати." + +msgid "" +"The ``__main__`` module must be importable by worker subprocesses. This " +"means that :class:`ProcessPoolExecutor` will not work in the interactive " +"interpreter." +msgstr "" +"Модуль ``__main__`` має бути імпортованим робочими підпроцесами. Це означає, " +"що :class:`ProcessPoolExecutor` не працюватиме в інтерактивному " +"інтерпретаторі." + +msgid "" +"Calling :class:`Executor` or :class:`Future` methods from a callable " +"submitted to a :class:`ProcessPoolExecutor` will result in deadlock." +msgstr "" +"Виклик методів :class:`Executor` або :class:`Future` із виклику, надісланого " +"до :class:`ProcessPoolExecutor`, призведе до взаємоблокування." + +msgid "" +"An :class:`Executor` subclass that executes calls asynchronously using a " +"pool of at most *max_workers* processes. If *max_workers* is ``None`` or " +"not given, it will default to :func:`os.process_cpu_count`. If *max_workers* " +"is less than or equal to ``0``, then a :exc:`ValueError` will be raised. On " +"Windows, *max_workers* must be less than or equal to ``61``. If it is not " +"then :exc:`ValueError` will be raised. If *max_workers* is ``None``, then " +"the default chosen will be at most ``61``, even if more processors are " +"available. *mp_context* can be a :mod:`multiprocessing` context or ``None``. " +"It will be used to launch the workers. If *mp_context* is ``None`` or not " +"given, the default :mod:`multiprocessing` context is used. See :ref:" +"`multiprocessing-start-methods`." +msgstr "" + +msgid "" +"*initializer* is an optional callable that is called at the start of each " +"worker process; *initargs* is a tuple of arguments passed to the " +"initializer. Should *initializer* raise an exception, all currently pending " +"jobs will raise a :exc:`~concurrent.futures.process.BrokenProcessPool`, as " +"well as any attempt to submit more jobs to the pool." +msgstr "" +"*initializer* — необов’язковий виклик, який викликається на початку кожного " +"робочого процесу; *initargs* — це кортеж аргументів, що передається " +"ініціалізатору. Якщо *ініціалізатор* викличе виняток, усі наразі незавершені " +"завдання викличуть :exc:`~concurrent.futures.process.BrokenProcessPool`, а " +"також будь-яка спроба надіслати більше завдань до пулу." + +msgid "" +"*max_tasks_per_child* is an optional argument that specifies the maximum " +"number of tasks a single process can execute before it will exit and be " +"replaced with a fresh worker process. By default *max_tasks_per_child* is " +"``None`` which means worker processes will live as long as the pool. When a " +"max is specified, the \"spawn\" multiprocessing start method will be used by " +"default in absence of a *mp_context* parameter. This feature is incompatible " +"with the \"fork\" start method." +msgstr "" + +msgid "" +"When one of the worker processes terminates abruptly, a :exc:`~concurrent." +"futures.process.BrokenProcessPool` error is now raised. Previously, " +"behaviour was undefined but operations on the executor or its futures would " +"often freeze or deadlock." +msgstr "" + +msgid "" +"The *mp_context* argument was added to allow users to control the " +"start_method for worker processes created by the pool." +msgstr "" +"Аргумент *mp_context* додано, щоб дозволити користувачам керувати " +"start_method для робочих процесів, створених пулом." + +msgid "" +"The default :mod:`multiprocessing` start method (see :ref:`multiprocessing-" +"start-methods`) will change away from *fork* in Python 3.14. Code that " +"requires *fork* be used for their :class:`ProcessPoolExecutor` should " +"explicitly specify that by passing a ``mp_context=multiprocessing." +"get_context(\"fork\")`` parameter." +msgstr "" + +msgid "" +"The *max_tasks_per_child* argument was added to allow users to control the " +"lifetime of workers in the pool." +msgstr "" + +msgid "" +"On POSIX systems, if your application has multiple threads and the :mod:" +"`multiprocessing` context uses the ``\"fork\"`` start method: The :func:`os." +"fork` function called internally to spawn workers may raise a :exc:" +"`DeprecationWarning`. Pass a *mp_context* configured to use a different " +"start method. See the :func:`os.fork` documentation for further explanation." +msgstr "" + +msgid "" +"*max_workers* uses :func:`os.process_cpu_count` by default, instead of :func:" +"`os.cpu_count`." +msgstr "" + +msgid "ProcessPoolExecutor Example" +msgstr "Приклад ProcessPoolExecutor" + +msgid "" +"import concurrent.futures\n" +"import math\n" +"\n" +"PRIMES = [\n" +" 112272535095293,\n" +" 112582705942171,\n" +" 112272535095293,\n" +" 115280095190773,\n" +" 115797848077099,\n" +" 1099726899285419]\n" +"\n" +"def is_prime(n):\n" +" if n < 2:\n" +" return False\n" +" if n == 2:\n" +" return True\n" +" if n % 2 == 0:\n" +" return False\n" +"\n" +" sqrt_n = int(math.floor(math.sqrt(n)))\n" +" for i in range(3, sqrt_n + 1, 2):\n" +" if n % i == 0:\n" +" return False\n" +" return True\n" +"\n" +"def main():\n" +" with concurrent.futures.ProcessPoolExecutor() as executor:\n" +" for number, prime in zip(PRIMES, executor.map(is_prime, PRIMES)):\n" +" print('%d is prime: %s' % (number, prime))\n" +"\n" +"if __name__ == '__main__':\n" +" main()" +msgstr "" + +msgid "Future Objects" +msgstr "Об'єкти майбутнього" + +msgid "" +"The :class:`Future` class encapsulates the asynchronous execution of a " +"callable. :class:`Future` instances are created by :meth:`Executor.submit`." +msgstr "" +"Клас :class:`Future` інкапсулює асинхронне виконання викликаного. :class:" +"`Future` екземпляри створюються :meth:`Executor.submit`." + +msgid "" +"Encapsulates the asynchronous execution of a callable. :class:`Future` " +"instances are created by :meth:`Executor.submit` and should not be created " +"directly except for testing." +msgstr "" +"Інкапсулює асинхронне виконання викликаного. :class:`Future` екземпляри " +"створюються :meth:`Executor.submit` і не повинні створюватися безпосередньо, " +"за винятком тестування." + +msgid "" +"Attempt to cancel the call. If the call is currently being executed or " +"finished running and cannot be cancelled then the method will return " +"``False``, otherwise the call will be cancelled and the method will return " +"``True``." +msgstr "" +"Спроба скасувати виклик. Якщо виклик наразі виконується або завершується і " +"його не можна скасувати, тоді метод поверне ``False``, інакше виклик буде " +"скасовано, а метод поверне ``True``." + +msgid "Return ``True`` if the call was successfully cancelled." +msgstr "Повертає ``True``, якщо виклик було успішно скасовано." + +msgid "" +"Return ``True`` if the call is currently being executed and cannot be " +"cancelled." +msgstr "" +"Повертає ``True``, якщо виклик зараз виконується і не може бути скасований." + +msgid "" +"Return ``True`` if the call was successfully cancelled or finished running." +msgstr "Повертає ``True``, якщо виклик було успішно скасовано або завершено." + +msgid "" +"Return the value returned by the call. If the call hasn't yet completed then " +"this method will wait up to *timeout* seconds. If the call hasn't completed " +"in *timeout* seconds, then a :exc:`TimeoutError` will be raised. *timeout* " +"can be an int or float. If *timeout* is not specified or ``None``, there is " +"no limit to the wait time." +msgstr "" + +msgid "" +"If the future is cancelled before completing then :exc:`.CancelledError` " +"will be raised." +msgstr "" +"Якщо ф'ючерс скасовано до завершення, тоді буде викликано :exc:`." +"CancelledError`." + +msgid "" +"If the call raised an exception, this method will raise the same exception." +msgstr "Якщо виклик викликав виняток, цей метод викличе той самий виняток." + +msgid "" +"Return the exception raised by the call. If the call hasn't yet completed " +"then this method will wait up to *timeout* seconds. If the call hasn't " +"completed in *timeout* seconds, then a :exc:`TimeoutError` will be raised. " +"*timeout* can be an int or float. If *timeout* is not specified or " +"``None``, there is no limit to the wait time." +msgstr "" + +msgid "If the call completed without raising, ``None`` is returned." +msgstr "Якщо виклик завершився без підняття, повертається ``None``." + +msgid "" +"Attaches the callable *fn* to the future. *fn* will be called, with the " +"future as its only argument, when the future is cancelled or finishes " +"running." +msgstr "" +"Приєднує *fn* до майбутнього. *fn* буде викликано з майбутнім як єдиним " +"аргументом, коли майбутнє скасовується або завершує роботу." + +msgid "" +"Added callables are called in the order that they were added and are always " +"called in a thread belonging to the process that added them. If the " +"callable raises an :exc:`Exception` subclass, it will be logged and " +"ignored. If the callable raises a :exc:`BaseException` subclass, the " +"behavior is undefined." +msgstr "" +"Додані виклики викликаються в тому порядку, в якому вони були додані, і " +"завжди викликаються в потоці, що належить до процесу, який їх додав. Якщо " +"виклик викликає підклас :exc:`Exception`, він буде зареєстрований і " +"проігнорований. Якщо виклик викликає підклас :exc:`BaseException`, поведінка " +"не визначена." + +msgid "" +"If the future has already completed or been cancelled, *fn* will be called " +"immediately." +msgstr "Якщо ф'ючерс уже завершено або скасовано, *fn* буде викликано негайно." + +msgid "" +"The following :class:`Future` methods are meant for use in unit tests and :" +"class:`Executor` implementations." +msgstr "" +"Наступні методи :class:`Future` призначені для використання в модульних " +"тестах і реалізаціях :class:`Executor`." + +msgid "" +"This method should only be called by :class:`Executor` implementations " +"before executing the work associated with the :class:`Future` and by unit " +"tests." +msgstr "" +"Цей метод має викликатися лише реалізаціями :class:`Executor` перед " +"виконанням роботи, пов’язаної з :class:`Future` і модульними тестами." + +msgid "" +"If the method returns ``False`` then the :class:`Future` was cancelled, i." +"e. :meth:`Future.cancel` was called and returned ``True``. Any threads " +"waiting on the :class:`Future` completing (i.e. through :func:`as_completed` " +"or :func:`wait`) will be woken up." +msgstr "" + +msgid "" +"If the method returns ``True`` then the :class:`Future` was not cancelled " +"and has been put in the running state, i.e. calls to :meth:`Future.running` " +"will return ``True``." +msgstr "" + +msgid "" +"This method can only be called once and cannot be called after :meth:`Future." +"set_result` or :meth:`Future.set_exception` have been called." +msgstr "" +"Цей метод можна викликати лише один раз і не можна викликати після виклику :" +"meth:`Future.set_result` або :meth:`Future.set_exception`." + +msgid "" +"Sets the result of the work associated with the :class:`Future` to *result*." +msgstr "" +"Встановлює для результату роботи, пов’язаної з :class:`Future` значення " +"*result*." + +msgid "" +"This method should only be used by :class:`Executor` implementations and " +"unit tests." +msgstr "" +"Цей метод має використовуватися лише реалізаціями :class:`Executor` і " +"модульними тестами." + +msgid "" +"This method raises :exc:`concurrent.futures.InvalidStateError` if the :class:" +"`Future` is already done." +msgstr "" +"Цей метод викликає :exc:`concurrent.futures.InvalidStateError`, якщо :class:" +"`Future` вже виконано." + +msgid "" +"Sets the result of the work associated with the :class:`Future` to the :" +"class:`Exception` *exception*." +msgstr "" +"Встановлює для результату роботи, пов’язаної з :class:`Future` значення :" +"class:`Exception` *виняток*." + +msgid "Module Functions" +msgstr "Функції модуля" + +msgid "" +"Wait for the :class:`Future` instances (possibly created by different :class:" +"`Executor` instances) given by *fs* to complete. Duplicate futures given to " +"*fs* are removed and will be returned only once. Returns a named 2-tuple of " +"sets. The first set, named ``done``, contains the futures that completed " +"(finished or cancelled futures) before the wait completed. The second set, " +"named ``not_done``, contains the futures that did not complete (pending or " +"running futures)." +msgstr "" +"Зачекайте, доки екземпляри :class:`Future` (можливо, створені різними " +"екземплярами :class:`Executor`), надані *fs*, завершаться. Подвійні " +"ф’ючерси, надані *fs*, видаляються та повертаються лише один раз. Повертає " +"іменований 2-кортеж наборів. Перший набір, названий ``done``, містить " +"ф'ючерси, які завершилися (завершені або скасовані ф'ючерси) до завершення " +"очікування. Другий набір під назвою ``not_done`` містить ф'ючерси, які не " +"завершилися (ф'ючерси, що очікують або виконуються)." + +msgid "" +"*timeout* can be used to control the maximum number of seconds to wait " +"before returning. *timeout* can be an int or float. If *timeout* is not " +"specified or ``None``, there is no limit to the wait time." +msgstr "" +"*timeout* можна використовувати для контролю максимальної кількості секунд " +"очікування перед поверненням. *timeout* може бути int або float. Якщо " +"*timeout* не вказано або ``None``, час очікування не обмежений." + +msgid "" +"*return_when* indicates when this function should return. It must be one of " +"the following constants:" +msgstr "" +"*return_when* вказує, коли ця функція має повернутися. Це має бути одна з " +"таких констант:" + +msgid "Constant" +msgstr "Постійний" + +msgid "Description" +msgstr "опис" + +msgid "The function will return when any future finishes or is cancelled." +msgstr "" +"Функція повернеться, коли будь-який майбутній завершиться або буде скасовано." + +msgid "" +"The function will return when any future finishes by raising an exception. " +"If no future raises an exception then it is equivalent to :const:" +"`ALL_COMPLETED`." +msgstr "" + +msgid "The function will return when all futures finish or are cancelled." +msgstr "" +"Функція повернеться, коли всі ф’ючерси закінчаться або будуть скасовані." + +msgid "" +"Returns an iterator over the :class:`Future` instances (possibly created by " +"different :class:`Executor` instances) given by *fs* that yields futures as " +"they complete (finished or cancelled futures). Any futures given by *fs* " +"that are duplicated will be returned once. Any futures that completed " +"before :func:`as_completed` is called will be yielded first. The returned " +"iterator raises a :exc:`TimeoutError` if :meth:`~iterator.__next__` is " +"called and the result isn't available after *timeout* seconds from the " +"original call to :func:`as_completed`. *timeout* can be an int or float. If " +"*timeout* is not specified or ``None``, there is no limit to the wait time." +msgstr "" + +msgid ":pep:`3148` -- futures - execute computations asynchronously" +msgstr ":pep:`3148` -- ф'ючерси - виконувати обчислення асинхронно" + +msgid "" +"The proposal which described this feature for inclusion in the Python " +"standard library." +msgstr "" +"Пропозиція, яка описує цю функцію для включення в стандартну бібліотеку " +"Python." + +msgid "Exception classes" +msgstr "Класи винятків" + +msgid "Raised when a future is cancelled." +msgstr "Піднімається, коли ф’ючерс скасовується." + +msgid "" +"A deprecated alias of :exc:`TimeoutError`, raised when a future operation " +"exceeds the given timeout." +msgstr "" + +msgid "This class was made an alias of :exc:`TimeoutError`." +msgstr "Цей клас отримав псевдонім :exc:`TimeoutError`." + +msgid "" +"Derived from :exc:`RuntimeError`, this exception class is raised when an " +"executor is broken for some reason, and cannot be used to submit or execute " +"new tasks." +msgstr "" +"Похідний від :exc:`RuntimeError`, цей клас винятків виникає, коли виконавець " +"з певної причини не працює, і його не можна використовувати для надсилання " +"або виконання нових завдань." + +msgid "" +"Raised when an operation is performed on a future that is not allowed in the " +"current state." +msgstr "" +"Викликається, коли над майбутнім виконується операція, яка не дозволена в " +"поточному стані." + +msgid "" +"Derived from :exc:`~concurrent.futures.BrokenExecutor`, this exception class " +"is raised when one of the workers of a :class:`~concurrent.futures." +"ThreadPoolExecutor` has failed initializing." +msgstr "" + +msgid "" +"Derived from :exc:`~concurrent.futures.BrokenExecutor` (formerly :exc:" +"`RuntimeError`), this exception class is raised when one of the workers of " +"a :class:`~concurrent.futures.ProcessPoolExecutor` has terminated in a non-" +"clean fashion (for example, if it was killed from the outside)." +msgstr "" diff --git a/library/configparser.po b/library/configparser.po new file mode 100644 index 000000000..65211e3d8 --- /dev/null +++ b/library/configparser.po @@ -0,0 +1,1964 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 00:57+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!configparser` --- Configuration file parser" +msgstr "" + +msgid "**Source code:** :source:`Lib/configparser.py`" +msgstr "**Вихідний код:** :source:`Lib/configparser.py`" + +msgid "" +"This module provides the :class:`ConfigParser` class which implements a " +"basic configuration language which provides a structure similar to what's " +"found in Microsoft Windows INI files. You can use this to write Python " +"programs which can be customized by end users easily." +msgstr "" +"Цей модуль надає клас :class:`ConfigParser`, який реалізує базову мову " +"конфігурації, яка забезпечує структуру, подібну до тієї, що міститься у " +"файлах Microsoft Windows INI. Ви можете використовувати це для написання " +"програм на Python, які можуть бути легко налаштовані кінцевими користувачами." + +msgid "" +"This library does *not* interpret or write the value-type prefixes used in " +"the Windows Registry extended version of INI syntax." +msgstr "" +"Ця бібліотека *не* інтерпретує та не записує префікси типу значень, які " +"використовуються в розширеній версії синтаксису INI реєстру Windows." + +msgid "Module :mod:`tomllib`" +msgstr "" + +msgid "" +"TOML is a well-specified format for application configuration files. It is " +"specifically designed to be an improved version of INI." +msgstr "" + +msgid "Module :mod:`shlex`" +msgstr "Модуль :mod:`shlex`" + +msgid "" +"Support for creating Unix shell-like mini-languages which can also be used " +"for application configuration files." +msgstr "" + +msgid "Module :mod:`json`" +msgstr "Модуль :mod:`json`" + +msgid "" +"The ``json`` module implements a subset of JavaScript syntax which is " +"sometimes used for configuration, but does not support comments." +msgstr "" + +msgid "Quick Start" +msgstr "Швидкий початок" + +msgid "Let's take a very basic configuration file that looks like this:" +msgstr "Давайте візьмемо простий файл конфігурації, який виглядає так:" + +msgid "" +"[DEFAULT]\n" +"ServerAliveInterval = 45\n" +"Compression = yes\n" +"CompressionLevel = 9\n" +"ForwardX11 = yes\n" +"\n" +"[forge.example]\n" +"User = hg\n" +"\n" +"[topsecret.server.example]\n" +"Port = 50022\n" +"ForwardX11 = no" +msgstr "" + +msgid "" +"The structure of INI files is described `in the following section " +"<#supported-ini-file-structure>`_. Essentially, the file consists of " +"sections, each of which contains keys with values. :mod:`configparser` " +"classes can read and write such files. Let's start by creating the above " +"configuration file programmatically." +msgstr "" +"Структура файлів INI описана `в наступному розділі <#supported-ini-file-" +"structure>`_. По суті, файл складається з розділів, кожен з яких містить " +"ключі зі значеннями. :mod:`configparser` класи можуть читати та записувати " +"такі файли. Почнемо зі створення наведеного вище файлу конфігурації " +"програмним шляхом." + +msgid "" +">>> import configparser\n" +">>> config = configparser.ConfigParser()\n" +">>> config['DEFAULT'] = {'ServerAliveInterval': '45',\n" +"... 'Compression': 'yes',\n" +"... 'CompressionLevel': '9'}\n" +">>> config['forge.example'] = {}\n" +">>> config['forge.example']['User'] = 'hg'\n" +">>> config['topsecret.server.example'] = {}\n" +">>> topsecret = config['topsecret.server.example']\n" +">>> topsecret['Port'] = '50022' # mutates the parser\n" +">>> topsecret['ForwardX11'] = 'no' # same here\n" +">>> config['DEFAULT']['ForwardX11'] = 'yes'\n" +">>> with open('example.ini', 'w') as configfile:\n" +"... config.write(configfile)\n" +"..." +msgstr "" + +msgid "" +"As you can see, we can treat a config parser much like a dictionary. There " +"are differences, `outlined later <#mapping-protocol-access>`_, but the " +"behavior is very close to what you would expect from a dictionary." +msgstr "" +"Як бачите, ми можемо розглядати аналізатор конфігурації так само, як " +"словник. Є відмінності, `викладені пізніше <#mapping-protocol-access>`_, але " +"поведінка дуже близька до того, що ви очікуєте від словника." + +msgid "" +"Now that we have created and saved a configuration file, let's read it back " +"and explore the data it holds." +msgstr "" +"Тепер, коли ми створили та зберегли файл конфігурації, давайте перечитаємо " +"його та дослідимо дані, які він містить." + +msgid "" +">>> config = configparser.ConfigParser()\n" +">>> config.sections()\n" +"[]\n" +">>> config.read('example.ini')\n" +"['example.ini']\n" +">>> config.sections()\n" +"['forge.example', 'topsecret.server.example']\n" +">>> 'forge.example' in config\n" +"True\n" +">>> 'python.org' in config\n" +"False\n" +">>> config['forge.example']['User']\n" +"'hg'\n" +">>> config['DEFAULT']['Compression']\n" +"'yes'\n" +">>> topsecret = config['topsecret.server.example']\n" +">>> topsecret['ForwardX11']\n" +"'no'\n" +">>> topsecret['Port']\n" +"'50022'\n" +">>> for key in config['forge.example']:\n" +"... print(key)\n" +"user\n" +"compressionlevel\n" +"serveraliveinterval\n" +"compression\n" +"forwardx11\n" +">>> config['forge.example']['ForwardX11']\n" +"'yes'" +msgstr "" + +msgid "" +"As we can see above, the API is pretty straightforward. The only bit of " +"magic involves the ``DEFAULT`` section which provides default values for all " +"other sections [1]_. Note also that keys in sections are case-insensitive " +"and stored in lowercase [1]_." +msgstr "" +"Як ми бачимо вище, API досить простий. Єдина магія стосується розділу " +"``DEFAULT``, який надає значення за умовчанням для всіх інших розділів [1]_. " +"Зауважте також, що ключі в розділах нечутливі до регістру та зберігаються в " +"нижньому регістрі [1]_." + +msgid "" +"It is possible to read several configurations into a single :class:" +"`ConfigParser`, where the most recently added configuration has the highest " +"priority. Any conflicting keys are taken from the more recent configuration " +"while the previously existing keys are retained. The example below reads in " +"an ``override.ini`` file, which will override any conflicting keys from the " +"``example.ini`` file." +msgstr "" + +msgid "" +"[DEFAULT]\n" +"ServerAliveInterval = -1" +msgstr "" + +msgid "" +">>> config_override = configparser.ConfigParser()\n" +">>> config_override['DEFAULT'] = {'ServerAliveInterval': '-1'}\n" +">>> with open('override.ini', 'w') as configfile:\n" +"... config_override.write(configfile)\n" +"...\n" +">>> config_override = configparser.ConfigParser()\n" +">>> config_override.read(['example.ini', 'override.ini'])\n" +"['example.ini', 'override.ini']\n" +">>> print(config_override.get('DEFAULT', 'ServerAliveInterval'))\n" +"-1" +msgstr "" + +msgid "" +"This behaviour is equivalent to a :meth:`ConfigParser.read` call with " +"several files passed to the *filenames* parameter." +msgstr "" +"Така поведінка еквівалентна виклику :meth:`ConfigParser.read` з кількома " +"файлами, переданими в параметр *filenames*." + +msgid "Supported Datatypes" +msgstr "Підтримувані типи даних" + +msgid "" +"Config parsers do not guess datatypes of values in configuration files, " +"always storing them internally as strings. This means that if you need " +"other datatypes, you should convert on your own:" +msgstr "" +"Синтаксичні аналізатори конфігурації не вгадують типи даних значень у файлах " +"конфігурації, завжди зберігаючи їх усередині як рядки. Це означає, що якщо " +"вам потрібні інші типи даних, ви повинні конвертувати самостійно:" + +msgid "" +">>> int(topsecret['Port'])\n" +"50022\n" +">>> float(topsecret['CompressionLevel'])\n" +"9.0" +msgstr "" + +msgid "" +"Since this task is so common, config parsers provide a range of handy getter " +"methods to handle integers, floats and booleans. The last one is the most " +"interesting because simply passing the value to ``bool()`` would do no good " +"since ``bool('False')`` is still ``True``. This is why config parsers also " +"provide :meth:`~ConfigParser.getboolean`. This method is case-insensitive " +"and recognizes Boolean values from ``'yes'``/``'no'``, ``'on'``/``'off'``, " +"``'true'``/``'false'`` and ``'1'``/``'0'`` [1]_. For example:" +msgstr "" +"Оскільки це завдання дуже поширене, аналізатори конфігурації надають ряд " +"зручних методів отримання для обробки цілих чисел, чисел з плаваючою точкою " +"та логічних значень. Останнє є найцікавішим, тому що проста передача " +"значення в ``bool()`` не принесе користі, оскільки ``bool('False')`` все ще " +"``True``. Ось чому аналізатори конфігурації також надають :meth:" +"`~ConfigParser.getboolean`. Цей метод не враховує регістр і розпізнає " +"логічні значення з ``'yes'``/``'no'``, ``'on'``/``'off'``, ``'true'`` /" +"``'false'`` і ``'1'``/``'0'`` [1]_. Наприклад:" + +msgid "" +">>> topsecret.getboolean('ForwardX11')\n" +"False\n" +">>> config['forge.example'].getboolean('ForwardX11')\n" +"True\n" +">>> config.getboolean('forge.example', 'Compression')\n" +"True" +msgstr "" + +msgid "" +"Apart from :meth:`~ConfigParser.getboolean`, config parsers also provide " +"equivalent :meth:`~ConfigParser.getint` and :meth:`~ConfigParser.getfloat` " +"methods. You can register your own converters and customize the provided " +"ones. [1]_" +msgstr "" +"Крім :meth:`~ConfigParser.getboolean`, аналізатори конфігурації також " +"надають еквівалентні методи :meth:`~ConfigParser.getint` і :meth:" +"`~ConfigParser.getfloat`. Ви можете зареєструвати власні конвертери та " +"налаштувати надані. [1]_" + +msgid "Fallback Values" +msgstr "Запасні значення" + +msgid "" +"As with a dictionary, you can use a section's :meth:`~ConfigParser.get` " +"method to provide fallback values:" +msgstr "" + +msgid "" +">>> topsecret.get('Port')\n" +"'50022'\n" +">>> topsecret.get('CompressionLevel')\n" +"'9'\n" +">>> topsecret.get('Cipher')\n" +">>> topsecret.get('Cipher', '3des-cbc')\n" +"'3des-cbc'" +msgstr "" + +msgid "" +"Please note that default values have precedence over fallback values. For " +"instance, in our example the ``'CompressionLevel'`` key was specified only " +"in the ``'DEFAULT'`` section. If we try to get it from the section " +"``'topsecret.server.example'``, we will always get the default, even if we " +"specify a fallback:" +msgstr "" + +msgid "" +">>> topsecret.get('CompressionLevel', '3')\n" +"'9'" +msgstr "" + +msgid "" +"One more thing to be aware of is that the parser-level :meth:`~ConfigParser." +"get` method provides a custom, more complex interface, maintained for " +"backwards compatibility. When using this method, a fallback value can be " +"provided via the ``fallback`` keyword-only argument:" +msgstr "" + +msgid "" +">>> config.get('forge.example', 'monster',\n" +"... fallback='No such things as monsters')\n" +"'No such things as monsters'" +msgstr "" + +msgid "" +"The same ``fallback`` argument can be used with the :meth:`~ConfigParser." +"getint`, :meth:`~ConfigParser.getfloat` and :meth:`~ConfigParser.getboolean` " +"methods, for example:" +msgstr "" +"Той самий резервний аргумент можна використовувати з методами :meth:" +"`~ConfigParser.getint`, :meth:`~ConfigParser.getfloat` і :meth:" +"`~ConfigParser.getboolean`, наприклад:" + +msgid "" +">>> 'BatchMode' in topsecret\n" +"False\n" +">>> topsecret.getboolean('BatchMode', fallback=True)\n" +"True\n" +">>> config['DEFAULT']['BatchMode'] = 'no'\n" +">>> topsecret.getboolean('BatchMode', fallback=True)\n" +"False" +msgstr "" + +msgid "Supported INI File Structure" +msgstr "Підтримувана структура файлу INI" + +msgid "" +"A configuration file consists of sections, each led by a ``[section]`` " +"header, followed by key/value entries separated by a specific string (``=`` " +"or ``:`` by default [1]_). By default, section names are case sensitive but " +"keys are not [1]_. Leading and trailing whitespace is removed from keys and " +"values. Values can be omitted if the parser is configured to allow it [1]_, " +"in which case the key/value delimiter may also be left out. Values can also " +"span multiple lines, as long as they are indented deeper than the first line " +"of the value. Depending on the parser's mode, blank lines may be treated as " +"parts of multiline values or ignored." +msgstr "" +"Файл конфігурації складається з розділів, кожен із яких очолюється " +"заголовком ``[section]``, за яким ідуть записи ключ/значення, розділені " +"певним рядком (``=`` або ``:`` за умовчанням [1]_) . За замовчуванням назви " +"розділів чутливі до регістру, але ключі не [1]_. Пробіли на початку та в " +"кінці видаляються з ключів і значень. Значення можна опустити, якщо " +"синтаксичний аналізатор налаштовано на це дозволено [1]_, у цьому випадку " +"роздільник ключ/значення також може бути пропущений. Значення також можуть " +"охоплювати кілька рядків, якщо вони мають відступ глибший, ніж перший рядок " +"значення. Залежно від режиму аналізатора, порожні рядки можуть розглядатися " +"як частини багаторядкових значень або ігноруватися." + +msgid "" +"By default, a valid section name can be any string that does not contain '\\" +"\\n'. To change this, see :attr:`ConfigParser.SECTCRE`." +msgstr "" + +msgid "" +"The first section name may be omitted if the parser is configured to allow " +"an unnamed top level section with ``allow_unnamed_section=True``. In this " +"case, the keys/values may be retrieved by :const:`UNNAMED_SECTION` as in " +"``config[UNNAMED_SECTION]``." +msgstr "" + +msgid "" +"Configuration files may include comments, prefixed by specific characters " +"(``#`` and ``;`` by default [1]_). Comments may appear on their own on an " +"otherwise empty line, possibly indented. [1]_" +msgstr "" +"Файли конфігурації можуть містити коментарі, перед якими стоять певні " +"символи (``#`` і ``;`` за замовчуванням [1]_). Коментарі можуть з’явитися " +"самостійно в порожньому рядку, можливо, з відступом. [1]_" + +msgid "For example:" +msgstr "Наприклад:" + +msgid "" +"[Simple Values]\n" +"key=value\n" +"spaces in keys=allowed\n" +"spaces in values=allowed as well\n" +"spaces around the delimiter = obviously\n" +"you can also use : to delimit keys from values\n" +"\n" +"[All Values Are Strings]\n" +"values like this: 1000000\n" +"or this: 3.14159265359\n" +"are they treated as numbers? : no\n" +"integers, floats and booleans are held as: strings\n" +"can use the API to get converted values directly: true\n" +"\n" +"[Multiline Values]\n" +"chorus: I'm a lumberjack, and I'm okay\n" +" I sleep all night and I work all day\n" +"\n" +"[No Values]\n" +"key_without_value\n" +"empty string value here =\n" +"\n" +"[You can use comments]\n" +"# like this\n" +"; or this\n" +"\n" +"# By default only in an empty line.\n" +"# Inline comments can be harmful because they prevent users\n" +"# from using the delimiting characters as parts of values.\n" +"# That being said, this can be customized.\n" +"\n" +" [Sections Can Be Indented]\n" +" can_values_be_as_well = True\n" +" does_that_mean_anything_special = False\n" +" purpose = formatting for readability\n" +" multiline_values = are\n" +" handled just fine as\n" +" long as they are indented\n" +" deeper than the first line\n" +" of a value\n" +" # Did I mention we can indent comments, too?" +msgstr "" + +msgid "Unnamed Sections" +msgstr "" + +msgid "" +"The name of the first section (or unique) may be omitted and values " +"retrieved by the :const:`UNNAMED_SECTION` attribute." +msgstr "" + +msgid "" +">>> config = \"\"\"\n" +"... option = value\n" +"...\n" +"... [ Section 2 ]\n" +"... another = val\n" +"... \"\"\"\n" +">>> unnamed = configparser.ConfigParser(allow_unnamed_section=True)\n" +">>> unnamed.read_string(config)\n" +">>> unnamed.get(configparser.UNNAMED_SECTION, 'option')\n" +"'value'" +msgstr "" + +msgid "Interpolation of values" +msgstr "Інтерполяція значень" + +msgid "" +"On top of the core functionality, :class:`ConfigParser` supports " +"interpolation. This means values can be preprocessed before returning them " +"from ``get()`` calls." +msgstr "" +"Окрім основних функцій, :class:`ConfigParser` підтримує інтерполяцію. Це " +"означає, що значення можна попередньо обробити перед поверненням із викликів " +"``get()``." + +msgid "" +"The default implementation used by :class:`ConfigParser`. It enables values " +"to contain format strings which refer to other values in the same section, " +"or values in the special default section [1]_. Additional default values " +"can be provided on initialization." +msgstr "" +"Стандартна реалізація, яку використовує :class:`ConfigParser`. Це дозволяє " +"значенням містити рядки формату, які посилаються на інші значення в тому " +"самому розділі, або значення в спеціальному розділі за замовчуванням [1]_. " +"Під час ініціалізації можна надати додаткові значення за замовчуванням." + +msgid "" +"[Paths]\n" +"home_dir: /Users\n" +"my_dir: %(home_dir)s/lumberjack\n" +"my_pictures: %(my_dir)s/Pictures\n" +"\n" +"[Escape]\n" +"# use a %% to escape the % sign (% is the only character that needs to be " +"escaped):\n" +"gain: 80%%" +msgstr "" + +msgid "" +"In the example above, :class:`ConfigParser` with *interpolation* set to " +"``BasicInterpolation()`` would resolve ``%(home_dir)s`` to the value of " +"``home_dir`` (``/Users`` in this case). ``%(my_dir)s`` in effect would " +"resolve to ``/Users/lumberjack``. All interpolations are done on demand so " +"keys used in the chain of references do not have to be specified in any " +"specific order in the configuration file." +msgstr "" +"У наведеному вище прикладі :class:`ConfigParser` з *інтерполяцією*, " +"встановленою на ``BasicInterpolation()``, перетворює ``%(home_dir)s`` на " +"значення ``home_dir`` (``/Users`` у цьому випадку ). ``%(my_dir)s`` фактично " +"перетворювався б на ``/Users/lumberjack``. Усі інтерполяції виконуються на " +"вимогу, тому ключі, які використовуються в ланцюжку посилань, не потрібно " +"вказувати в певному порядку у файлі конфігурації." + +msgid "" +"With ``interpolation`` set to ``None``, the parser would simply return " +"``%(my_dir)s/Pictures`` as the value of ``my_pictures`` and ``%(home_dir)s/" +"lumberjack`` as the value of ``my_dir``." +msgstr "" +"Якщо ``interpolation`` встановлено на ``None``, аналізатор просто " +"повертатиме ``%(my_dir)s`` як значення ``my_pictures`` і ``%(home_dir)s/" +"lumberjack`` як значення ``my_dir``." + +msgid "" +"An alternative handler for interpolation which implements a more advanced " +"syntax, used for instance in ``zc.buildout``. Extended interpolation is " +"using ``${section:option}`` to denote a value from a foreign section. " +"Interpolation can span multiple levels. For convenience, if the ``section:" +"`` part is omitted, interpolation defaults to the current section (and " +"possibly the default values from the special section)." +msgstr "" +"Альтернативний обробник для інтерполяції, який реалізує розширеніший " +"синтаксис, який використовується, наприклад, у ``zc.buildout``. Розширена " +"інтерполяція використовує ``${section:option}`` для позначення значення з " +"іноземного розділу. Інтерполяція може охоплювати кілька рівнів. Для " +"зручності, якщо частина ``section:`` опущена, інтерполяція за замовчуванням " +"використовується для поточного розділу (і, можливо, до значень за " +"замовчуванням зі спеціального розділу)." + +msgid "" +"For example, the configuration specified above with basic interpolation, " +"would look like this with extended interpolation:" +msgstr "" +"Наприклад, зазначена вище конфігурація з базовою інтерполяцією виглядатиме " +"так з розширеною інтерполяцією:" + +msgid "" +"[Paths]\n" +"home_dir: /Users\n" +"my_dir: ${home_dir}/lumberjack\n" +"my_pictures: ${my_dir}/Pictures\n" +"\n" +"[Escape]\n" +"# use a $$ to escape the $ sign ($ is the only character that needs to be " +"escaped):\n" +"cost: $$80" +msgstr "" + +msgid "Values from other sections can be fetched as well:" +msgstr "Також можна отримати значення з інших розділів:" + +msgid "" +"[Common]\n" +"home_dir: /Users\n" +"library_dir: /Library\n" +"system_dir: /System\n" +"macports_dir: /opt/local\n" +"\n" +"[Frameworks]\n" +"Python: 3.2\n" +"path: ${Common:system_dir}/Library/Frameworks/\n" +"\n" +"[Arthur]\n" +"nickname: Two Sheds\n" +"last_name: Jackson\n" +"my_dir: ${Common:home_dir}/twosheds\n" +"my_pictures: ${my_dir}/Pictures\n" +"python_dir: ${Frameworks:path}/Python/Versions/${Frameworks:Python}" +msgstr "" + +msgid "Mapping Protocol Access" +msgstr "Доступ до протоколу відображення" + +msgid "" +"Mapping protocol access is a generic name for functionality that enables " +"using custom objects as if they were dictionaries. In case of :mod:" +"`configparser`, the mapping interface implementation is using the " +"``parser['section']['option']`` notation." +msgstr "" +"Доступ до протоколу зіставлення — це загальна назва функціональних " +"можливостей, які дають змогу використовувати спеціальні об’єкти як словники. " +"У випадку :mod:`configparser` реалізація інтерфейсу зіставлення використовує " +"нотацію ``parser['section']['option']``." + +msgid "" +"``parser['section']`` in particular returns a proxy for the section's data " +"in the parser. This means that the values are not copied but they are taken " +"from the original parser on demand. What's even more important is that when " +"values are changed on a section proxy, they are actually mutated in the " +"original parser." +msgstr "" +"``parser['section']`` зокрема повертає проксі для даних розділу в " +"аналізаторі. Це означає, що значення не копіюються, а беруться з " +"оригінального аналізатора на вимогу. Ще важливішим є те, що коли значення " +"змінюються на проксі-сервері розділу, вони фактично змінюються в " +"оригінальному парсері." + +msgid "" +":mod:`configparser` objects behave as close to actual dictionaries as " +"possible. The mapping interface is complete and adheres to the :class:" +"`~collections.abc.MutableMapping` ABC. However, there are a few differences " +"that should be taken into account:" +msgstr "" +":mod:`configparser` об’єкти поводяться якомога ближче до справжніх " +"словників. Інтерфейс зіставлення завершений і відповідає :class:" +"`~collections.abc.MutableMapping` ABC. Однак є кілька відмінностей, які слід " +"взяти до уваги:" + +msgid "" +"By default, all keys in sections are accessible in a case-insensitive manner " +"[1]_. E.g. ``for option in parser[\"section\"]`` yields only " +"``optionxform``'ed option key names. This means lowercased keys by " +"default. At the same time, for a section that holds the key ``'a'``, both " +"expressions return ``True``::" +msgstr "" +"За замовчуванням усі ключі в розділах доступні без урахування регістру [1]_. " +"наприклад ``for option in parser[\"section\"]`` дає лише ``optionxform`` " +"імена ключів опцій. Це означає, що ключі в нижньому регістрі за " +"замовчуванням. Водночас для розділу, який містить ключ ``'a``, обидва вирази " +"повертають ``True``::" + +msgid "" +"\"a\" in parser[\"section\"]\n" +"\"A\" in parser[\"section\"]" +msgstr "" + +msgid "" +"All sections include ``DEFAULTSECT`` values as well which means that ``." +"clear()`` on a section may not leave the section visibly empty. This is " +"because default values cannot be deleted from the section (because " +"technically they are not there). If they are overridden in the section, " +"deleting causes the default value to be visible again. Trying to delete a " +"default value causes a :exc:`KeyError`." +msgstr "" +"Усі розділи також містять значення ``DEFAULTSECT``, що означає, що ``." +"clear()`` у розділі не може залишати розділ видимо порожнім. Це тому, що " +"значення за замовчуванням не можна видалити з розділу (оскільки технічно їх " +"там немає). Якщо їх перевизначено в розділі, видалення призведе до того, що " +"значення за замовчуванням знову стане видимим. Спроба видалити значення за " +"замовчуванням викликає :exc:`KeyError`." + +msgid "``DEFAULTSECT`` cannot be removed from the parser:" +msgstr "``DEFAULTSECT`` не можна видалити з аналізатора:" + +msgid "trying to delete it raises :exc:`ValueError`," +msgstr "спроба його видалити викликає :exc:`ValueError`," + +msgid "``parser.clear()`` leaves it intact," +msgstr "``parser.clear()`` залишає його недоторканим," + +msgid "``parser.popitem()`` never returns it." +msgstr "``parser.popitem()`` ніколи не повертає його." + +msgid "" +"``parser.get(section, option, **kwargs)`` - the second argument is **not** a " +"fallback value. Note however that the section-level ``get()`` methods are " +"compatible both with the mapping protocol and the classic configparser API." +msgstr "" +"``parser.get(section, option, **kwargs)`` - другий аргумент **не** є " +"резервним значенням. Однак зауважте, що методи ``get()`` на рівні розділу " +"сумісні як з протоколом відображення, так і з класичним API конфігуратора." + +msgid "" +"``parser.items()`` is compatible with the mapping protocol (returns a list " +"of *section_name*, *section_proxy* pairs including the DEFAULTSECT). " +"However, this method can also be invoked with arguments: ``parser." +"items(section, raw, vars)``. The latter call returns a list of *option*, " +"*value* pairs for a specified ``section``, with all interpolations expanded " +"(unless ``raw=True`` is provided)." +msgstr "" +"``parser.items()`` сумісний із протоколом відображення (повертає список пар " +"*section_name*, *section_proxy*, включаючи DEFAULTSECT). Однак цей метод " +"також можна викликати за допомогою аргументів: ``parser.items(section, raw, " +"vars)``. Останній виклик повертає список пар *option*, *value* для вказаного " +"``розділу`` з усіма розширеними інтерполяціями (якщо не надано ``raw=True``)." + +msgid "" +"The mapping protocol is implemented on top of the existing legacy API so " +"that subclasses overriding the original interface still should have mappings " +"working as expected." +msgstr "" +"Протокол відображення реалізовано поверх існуючого застарілого API, так що " +"підкласи, які замінюють вихідний інтерфейс, все ще повинні мати " +"відображення, що працюють належним чином." + +msgid "Customizing Parser Behaviour" +msgstr "Налаштування поведінки аналізатора" + +msgid "" +"There are nearly as many INI format variants as there are applications using " +"it. :mod:`configparser` goes a long way to provide support for the largest " +"sensible set of INI styles available. The default functionality is mainly " +"dictated by historical background and it's very likely that you will want to " +"customize some of the features." +msgstr "" +"Існує майже стільки ж варіантів формату INI, скільки програм, які його " +"використовують. :mod:`configparser` робить довгий шлях, щоб забезпечити " +"підтримку найбільшого розумного набору доступних стилів INI. " +"Функціональність за замовчуванням здебільшого продиктована історичним " +"минулим, і дуже ймовірно, що ви захочете налаштувати деякі функції." + +msgid "" +"The most common way to change the way a specific config parser works is to " +"use the :meth:`!__init__` options:" +msgstr "" + +msgid "*defaults*, default value: ``None``" +msgstr "*за замовчуванням*, значення за замовчуванням: ``None``" + +msgid "" +"This option accepts a dictionary of key-value pairs which will be initially " +"put in the ``DEFAULT`` section. This makes for an elegant way to support " +"concise configuration files that don't specify values which are the same as " +"the documented default." +msgstr "" +"Цей параметр приймає словник пар ключ-значення, який спочатку буде розміщено " +"в розділі ``DEFAULT``. Це створює елегантний спосіб підтримки стислих " +"конфігураційних файлів, які не вказують значення, які збігаються з " +"документованими за замовчуванням." + +msgid "" +"Hint: if you want to specify default values for a specific section, use :" +"meth:`~ConfigParser.read_dict` before you read the actual file." +msgstr "" + +msgid "*dict_type*, default value: :class:`dict`" +msgstr "*dict_type*, значення за умовчанням: :class:`dict`" + +msgid "" +"This option has a major impact on how the mapping protocol will behave and " +"how the written configuration files look. With the standard dictionary, " +"every section is stored in the order they were added to the parser. Same " +"goes for options within sections." +msgstr "" +"Цей параметр значно впливає на роботу протоколу відображення та вигляд " +"записаних конфігураційних файлів. У стандартному словнику кожен розділ " +"зберігається в порядку їх додавання до синтаксичного аналізатора. Те саме " +"стосується параметрів у розділах." + +msgid "" +"An alternative dictionary type can be used for example to sort sections and " +"options on write-back." +msgstr "" +"Альтернативний тип словника можна використовувати, наприклад, для сортування " +"розділів і параметрів під час зворотного запису." + +msgid "" +"Please note: there are ways to add a set of key-value pairs in a single " +"operation. When you use a regular dictionary in those operations, the order " +"of the keys will be ordered. For example:" +msgstr "" +"Зверніть увагу: є способи додати набір пар ключ-значення за одну операцію. " +"Якщо ви використовуєте звичайний словник у цих операціях, порядок ключів " +"буде впорядкованим. Наприклад:" + +msgid "" +">>> parser = configparser.ConfigParser()\n" +">>> parser.read_dict({'section1': {'key1': 'value1',\n" +"... 'key2': 'value2',\n" +"... 'key3': 'value3'},\n" +"... 'section2': {'keyA': 'valueA',\n" +"... 'keyB': 'valueB',\n" +"... 'keyC': 'valueC'},\n" +"... 'section3': {'foo': 'x',\n" +"... 'bar': 'y',\n" +"... 'baz': 'z'}\n" +"... })\n" +">>> parser.sections()\n" +"['section1', 'section2', 'section3']\n" +">>> [option for option in parser['section3']]\n" +"['foo', 'bar', 'baz']" +msgstr "" + +msgid "*allow_no_value*, default value: ``False``" +msgstr "*allow_no_value*, значення за умовчанням: ``False``" + +msgid "" +"Some configuration files are known to include settings without values, but " +"which otherwise conform to the syntax supported by :mod:`configparser`. The " +"*allow_no_value* parameter to the constructor can be used to indicate that " +"such values should be accepted:" +msgstr "" +"Відомо, що деякі конфігураційні файли містять налаштування без значень, але " +"в іншому випадку вони відповідають синтаксису, який підтримує :mod:" +"`configparser`. Параметр *allow_no_value* для конструктора можна " +"використовувати, щоб вказати, що такі значення повинні бути прийняті:" + +msgid "" +">>> import configparser\n" +"\n" +">>> sample_config = \"\"\"\n" +"... [mysqld]\n" +"... user = mysql\n" +"... pid-file = /var/run/mysqld/mysqld.pid\n" +"... skip-external-locking\n" +"... old_passwords = 1\n" +"... skip-bdb\n" +"... # we don't need ACID today\n" +"... skip-innodb\n" +"... \"\"\"\n" +">>> config = configparser.ConfigParser(allow_no_value=True)\n" +">>> config.read_string(sample_config)\n" +"\n" +">>> # Settings with values are treated as before:\n" +">>> config[\"mysqld\"][\"user\"]\n" +"'mysql'\n" +"\n" +">>> # Settings without values provide None:\n" +">>> config[\"mysqld\"][\"skip-bdb\"]\n" +"\n" +">>> # Settings which aren't specified still raise an error:\n" +">>> config[\"mysqld\"][\"does-not-exist\"]\n" +"Traceback (most recent call last):\n" +" ...\n" +"KeyError: 'does-not-exist'" +msgstr "" + +msgid "*delimiters*, default value: ``('=', ':')``" +msgstr "*роздільники*, значення за умовчанням: ``('=', ':')``" + +msgid "" +"Delimiters are substrings that delimit keys from values within a section. " +"The first occurrence of a delimiting substring on a line is considered a " +"delimiter. This means values (but not keys) can contain the delimiters." +msgstr "" +"Роздільники — це підрядки, які відокремлюють ключі від значень у розділі. " +"Перше входження розділювального підрядка в рядок вважається роздільником. Це " +"означає, що значення (але не ключі) можуть містити розділювачі." + +msgid "" +"See also the *space_around_delimiters* argument to :meth:`ConfigParser." +"write`." +msgstr "" +"Дивіться також аргумент *space_around_delimiters* для :meth:`ConfigParser." +"write`." + +msgid "*comment_prefixes*, default value: ``('#', ';')``" +msgstr "*comment_prefixes*, значення за умовчанням: ``('#', ';')``" + +msgid "*inline_comment_prefixes*, default value: ``None``" +msgstr "*inline_comment_prefixes*, значення за умовчанням: ``None``" + +msgid "" +"Comment prefixes are strings that indicate the start of a valid comment " +"within a config file. *comment_prefixes* are used only on otherwise empty " +"lines (optionally indented) whereas *inline_comment_prefixes* can be used " +"after every valid value (e.g. section names, options and empty lines as " +"well). By default inline comments are disabled and ``'#'`` and ``';'`` are " +"used as prefixes for whole line comments." +msgstr "" +"Префікси коментарів — це рядки, які вказують на початок дійсного коментаря у " +"конфігураційному файлі. *comment_prefixes* використовуються лише в порожніх " +"рядках (необов’язково з відступом), тоді як *inline_comment_prefixes* можна " +"використовувати після кожного дійсного значення (наприклад, назв розділів, " +"параметрів і порожніх рядків). За замовчуванням вбудовані коментарі " +"вимкнено, а ``'#'`` і ``';''`` використовуються як префікси для цілих " +"рядкових коментарів." + +msgid "" +"In previous versions of :mod:`configparser` behaviour matched " +"``comment_prefixes=('#',';')`` and ``inline_comment_prefixes=(';',)``." +msgstr "" +"У попередніх версіях :mod:`configparser` поведінка відповідала " +"``comment_prefixes=('#',';')`` та ``inline_comment_prefixes=(';',)``." + +msgid "" +"Please note that config parsers don't support escaping of comment prefixes " +"so using *inline_comment_prefixes* may prevent users from specifying option " +"values with characters used as comment prefixes. When in doubt, avoid " +"setting *inline_comment_prefixes*. In any circumstances, the only way of " +"storing comment prefix characters at the beginning of a line in multiline " +"values is to interpolate the prefix, for example::" +msgstr "" +"Зауважте, що аналізатори конфігурації не підтримують екранування префіксів " +"коментарів, тому використання *inline_comment_prefixes* може перешкодити " +"користувачам вказувати значення параметрів із символами, які " +"використовуються як префікси коментарів. Якщо сумніваєтеся, уникайте " +"встановлення *inline_comment_prefixes*. За будь-яких обставин єдиний спосіб " +"зберегти символи префікса коментаря на початку рядка в багаторядкових " +"значеннях — це інтерполювати префікс, наприклад::" + +msgid "" +">>> from configparser import ConfigParser, ExtendedInterpolation\n" +">>> parser = ConfigParser(interpolation=ExtendedInterpolation())\n" +">>> # the default BasicInterpolation could be used as well\n" +">>> parser.read_string(\"\"\"\n" +"... [DEFAULT]\n" +"... hash = #\n" +"...\n" +"... [hashes]\n" +"... shebang =\n" +"... ${hash}!/usr/bin/env python\n" +"... ${hash} -*- coding: utf-8 -*-\n" +"...\n" +"... extensions =\n" +"... enabled_extension\n" +"... another_extension\n" +"... #disabled_by_comment\n" +"... yet_another_extension\n" +"...\n" +"... interpolation not necessary = if # is not at line start\n" +"... even in multiline values = line #1\n" +"... line #2\n" +"... line #3\n" +"... \"\"\")\n" +">>> print(parser['hashes']['shebang'])\n" +"\n" +"#!/usr/bin/env python\n" +"# -*- coding: utf-8 -*-\n" +">>> print(parser['hashes']['extensions'])\n" +"\n" +"enabled_extension\n" +"another_extension\n" +"yet_another_extension\n" +">>> print(parser['hashes']['interpolation not necessary'])\n" +"if # is not at line start\n" +">>> print(parser['hashes']['even in multiline values'])\n" +"line #1\n" +"line #2\n" +"line #3" +msgstr "" + +msgid "*strict*, default value: ``True``" +msgstr "*строгий*, значення за умовчанням: ``True``" + +msgid "" +"When set to ``True``, the parser will not allow for any section or option " +"duplicates while reading from a single source (using :meth:`~ConfigParser." +"read_file`, :meth:`~ConfigParser.read_string` or :meth:`~ConfigParser." +"read_dict`). It is recommended to use strict parsers in new applications." +msgstr "" + +msgid "" +"In previous versions of :mod:`configparser` behaviour matched " +"``strict=False``." +msgstr "" +"У попередніх версіях :mod:`configparser` поведінка відповідала " +"``strict=False``." + +msgid "*empty_lines_in_values*, default value: ``True``" +msgstr "*empty_lines_in_values*, значення за умовчанням: ``True``" + +msgid "" +"In config parsers, values can span multiple lines as long as they are " +"indented more than the key that holds them. By default parsers also let " +"empty lines to be parts of values. At the same time, keys can be " +"arbitrarily indented themselves to improve readability. In consequence, " +"when configuration files get big and complex, it is easy for the user to " +"lose track of the file structure. Take for instance:" +msgstr "" +"У синтаксичних аналізаторах конфігурації значення можуть охоплювати кілька " +"рядків, якщо вони мають відступ більше, ніж ключ, який їх містить. За " +"замовчуванням аналізатори також дозволяють порожнім рядкам бути частинами " +"значень. У той же час самі клавіші можуть мати довільний відступ для " +"покращення читабельності. Як наслідок, коли файли конфігурації стають " +"великими та складними, користувачеві легко втратити структуру файлу. " +"Візьмемо, наприклад:" + +msgid "" +"[Section]\n" +"key = multiline\n" +" value with a gotcha\n" +"\n" +" this = is still a part of the multiline value of 'key'" +msgstr "" + +msgid "" +"This can be especially problematic for the user to see if she's using a " +"proportional font to edit the file. That is why when your application does " +"not need values with empty lines, you should consider disallowing them. " +"This will make empty lines split keys every time. In the example above, it " +"would produce two keys, ``key`` and ``this``." +msgstr "" +"Це може бути особливо проблематично для користувача, щоб побачити, чи він " +"використовує пропорційний шрифт для редагування файлу. Ось чому, якщо вашій " +"програмі не потрібні значення з порожніми рядками, вам слід подумати про їх " +"заборону. Це змусить порожні рядки кожного разу розділяти ключі. У " +"наведеному вище прикладі буде створено два ключі, ``key`` і ``this``." + +msgid "" +"*default_section*, default value: ``configparser.DEFAULTSECT`` (that is: " +"``\"DEFAULT\"``)" +msgstr "" +"*default_section*, значення за замовчуванням: ``configparser.DEFAULTSECT`` " +"(тобто: ``\"DEFAULT\"``)" + +msgid "" +"The convention of allowing a special section of default values for other " +"sections or interpolation purposes is a powerful concept of this library, " +"letting users create complex declarative configurations. This section is " +"normally called ``\"DEFAULT\"`` but this can be customized to point to any " +"other valid section name. Some typical values include: ``\"general\"`` or " +"``\"common\"``. The name provided is used for recognizing default sections " +"when reading from any source and is used when writing configuration back to " +"a file. Its current value can be retrieved using the ``parser_instance." +"default_section`` attribute and may be modified at runtime (i.e. to convert " +"files from one format to another)." +msgstr "" +"Угода про дозвіл спеціального розділу значень за замовчуванням для інших " +"розділів або для цілей інтерполяції є потужною концепцією цієї бібліотеки, " +"що дозволяє користувачам створювати складні декларативні конфігурації. Цей " +"розділ зазвичай називається ``\"ЗА УМОВЧУВАННЯМ\"``, але його можна " +"налаштувати так, щоб вказувати на будь-яку іншу дійсну назву розділу. Деякі " +"типові значення включають: ``\"загальний\"`` або ``\"загальний\"``. Надана " +"назва використовується для розпізнавання розділів за замовчуванням під час " +"читання з будь-якого джерела та під час запису конфігурації назад у файл. " +"Його поточне значення можна отримати за допомогою атрибута ``parser_instance." +"default_section`` і можна змінити під час виконання (тобто для перетворення " +"файлів з одного формату в інший)." + +msgid "*interpolation*, default value: ``configparser.BasicInterpolation``" +msgstr "" +"*інтерполяція*, значення за умовчанням: ``configparser.BasicInterpolation``" + +msgid "" +"Interpolation behaviour may be customized by providing a custom handler " +"through the *interpolation* argument. ``None`` can be used to turn off " +"interpolation completely, ``ExtendedInterpolation()`` provides a more " +"advanced variant inspired by ``zc.buildout``. More on the subject in the " +"`dedicated documentation section <#interpolation-of-values>`_. :class:" +"`RawConfigParser` has a default value of ``None``." +msgstr "" +"Поведінку інтерполяції можна налаштувати, надавши спеціальний обробник через " +"аргумент *interpolation*. ``None`` можна використовувати, щоб повністю " +"вимкнути інтерполяцію, ``ExtendedInterpolation()`` надає більш просунутий " +"варіант, натхненний ``zc.buildout``. Більше про цю тему див. у розділі " +"`спеціальної документації <#interpolation-of-values>`_. :class:" +"`RawConfigParser` має значення за замовчуванням ``None``." + +msgid "*converters*, default value: not set" +msgstr "*конвертери*, значення за замовчуванням: не встановлено" + +msgid "" +"Config parsers provide option value getters that perform type conversion. " +"By default :meth:`~ConfigParser.getint`, :meth:`~ConfigParser.getfloat`, " +"and :meth:`~ConfigParser.getboolean` are implemented. Should other getters " +"be desirable, users may define them in a subclass or pass a dictionary where " +"each key is a name of the converter and each value is a callable " +"implementing said conversion. For instance, passing ``{'decimal': decimal." +"Decimal}`` would add :meth:`!getdecimal` on both the parser object and all " +"section proxies. In other words, it will be possible to write both " +"``parser_instance.getdecimal('section', 'key', fallback=0)`` and " +"``parser_instance['section'].getdecimal('key', 0)``." +msgstr "" + +msgid "" +"If the converter needs to access the state of the parser, it can be " +"implemented as a method on a config parser subclass. If the name of this " +"method starts with ``get``, it will be available on all section proxies, in " +"the dict-compatible form (see the ``getdecimal()`` example above)." +msgstr "" +"Якщо конвертеру потрібно отримати доступ до стану аналізатора, його можна " +"реалізувати як метод у підкласі аналізатора конфігурації. Якщо назва цього " +"методу починається з ``get``, він буде доступний на всіх проксі-серверах " +"розділів у формі, сумісній з dict (див. приклад ``getdecimal()`` вище)." + +msgid "" +"More advanced customization may be achieved by overriding default values of " +"these parser attributes. The defaults are defined on the classes, so they " +"may be overridden by subclasses or by attribute assignment." +msgstr "" +"Більш просунуте налаштування можна досягти шляхом заміни значень за " +"замовчуванням цих атрибутів аналізатора. Значення за замовчуванням визначені " +"в класах, тому вони можуть бути замінені підкласами або призначенням " +"атрибутів." + +msgid "" +"By default when using :meth:`~ConfigParser.getboolean`, config parsers " +"consider the following values ``True``: ``'1'``, ``'yes'``, ``'true'``, " +"``'on'`` and the following values ``False``: ``'0'``, ``'no'``, ``'false'``, " +"``'off'``. You can override this by specifying a custom dictionary of " +"strings and their Boolean outcomes. For example:" +msgstr "" +"За замовчуванням під час використання :meth:`~ConfigParser.getboolean` " +"аналізатори конфігурації враховують такі значення ``True``: ``'1'``, " +"``'yes'``, ``'true'``, ``'on'`` і такі значення ``False``: ``'0'``, " +"``'no'``, ``'false'``, ``'off'``. Ви можете перевизначити це, вказавши " +"спеціальний словник рядків та їхніх логічних результатів. Наприклад:" + +msgid "" +">>> custom = configparser.ConfigParser()\n" +">>> custom['section1'] = {'funky': 'nope'}\n" +">>> custom['section1'].getboolean('funky')\n" +"Traceback (most recent call last):\n" +"...\n" +"ValueError: Not a boolean: nope\n" +">>> custom.BOOLEAN_STATES = {'sure': True, 'nope': False}\n" +">>> custom['section1'].getboolean('funky')\n" +"False" +msgstr "" + +msgid "" +"Other typical Boolean pairs include ``accept``/``reject`` or ``enabled``/" +"``disabled``." +msgstr "" +"Інші типові логічні пари включають ``accept``/``reject`` або ``enabled``/" +"``disabled``." + +msgid "" +"This method transforms option names on every read, get, or set operation. " +"The default converts the name to lowercase. This also means that when a " +"configuration file gets written, all keys will be lowercase. Override this " +"method if that's unsuitable. For example:" +msgstr "" +"Цей метод перетворює назви параметрів під час кожної операції читання, " +"отримання або встановлення. За замовчуванням ім'я перетворюється на малі " +"літери. Це також означає, що під час запису файлу конфігурації всі ключі " +"будуть малими літерами. Перевизначте цей метод, якщо він не підходить. " +"Наприклад:" + +msgid "" +">>> config = \"\"\"\n" +"... [Section1]\n" +"... Key = Value\n" +"...\n" +"... [Section2]\n" +"... AnotherKey = Value\n" +"... \"\"\"\n" +">>> typical = configparser.ConfigParser()\n" +">>> typical.read_string(config)\n" +">>> list(typical['Section1'].keys())\n" +"['key']\n" +">>> list(typical['Section2'].keys())\n" +"['anotherkey']\n" +">>> custom = configparser.RawConfigParser()\n" +">>> custom.optionxform = lambda option: option\n" +">>> custom.read_string(config)\n" +">>> list(custom['Section1'].keys())\n" +"['Key']\n" +">>> list(custom['Section2'].keys())\n" +"['AnotherKey']" +msgstr "" + +msgid "" +"The optionxform function transforms option names to a canonical form. This " +"should be an idempotent function: if the name is already in canonical form, " +"it should be returned unchanged." +msgstr "" +"Функція optionxform перетворює назви опцій у канонічну форму. Це має бути " +"ідемпотентна функція: якщо ім’я вже є в канонічній формі, його слід " +"повернути без змін." + +msgid "" +"A compiled regular expression used to parse section headers. The default " +"matches ``[section]`` to the name ``\"section\"``. Whitespace is considered " +"part of the section name, thus ``[ larch ]`` will be read as a section of " +"name ``\" larch \"``. Override this attribute if that's unsuitable. For " +"example:" +msgstr "" +"Зкомпільований регулярний вираз, який використовується для аналізу " +"заголовків розділів. За умовчанням ``[розділ]`` відповідає назві " +"``\"розділ\"``. Пробіли вважаються частиною назви розділу, тому ``[ arch ]`` " +"читатиметься як розділ назви ``\" arch \"``. Перевизначте цей атрибут, якщо " +"він не підходить. Наприклад:" + +msgid "" +">>> import re\n" +">>> config = \"\"\"\n" +"... [Section 1]\n" +"... option = value\n" +"...\n" +"... [ Section 2 ]\n" +"... another = val\n" +"... \"\"\"\n" +">>> typical = configparser.ConfigParser()\n" +">>> typical.read_string(config)\n" +">>> typical.sections()\n" +"['Section 1', ' Section 2 ']\n" +">>> custom = configparser.ConfigParser()\n" +">>> custom.SECTCRE = re.compile(r\"\\[ *(?P
[^]]+?) *\\]\")\n" +">>> custom.read_string(config)\n" +">>> custom.sections()\n" +"['Section 1', 'Section 2']" +msgstr "" + +msgid "" +"While ConfigParser objects also use an ``OPTCRE`` attribute for recognizing " +"option lines, it's not recommended to override it because that would " +"interfere with constructor options *allow_no_value* and *delimiters*." +msgstr "" +"Хоча об’єкти ConfigParser також використовують атрибут ``OPTCRE`` для " +"розпізнавання рядків параметрів, не рекомендується перевизначати його, " +"оскільки це заважало б параметрам конструктора *allow_no_value* і " +"*роздільники*." + +msgid "Legacy API Examples" +msgstr "Приклади застарілих API" + +msgid "" +"Mainly because of backwards compatibility concerns, :mod:`configparser` " +"provides also a legacy API with explicit ``get``/``set`` methods. While " +"there are valid use cases for the methods outlined below, mapping protocol " +"access is preferred for new projects. The legacy API is at times more " +"advanced, low-level and downright counterintuitive." +msgstr "" +"В основному через проблеми зворотної сумісності :mod:`configparser` також " +"надає застарілий API з явними методами ``get``/``set``. Хоча існують дійсні " +"випадки використання описаних нижче методів, для нових проектів перевагу " +"надають доступу до протоколу відображення. Застарілий API часом є " +"досконалішим, низькорівневим і відверто неінтуїтивним." + +msgid "An example of writing to a configuration file::" +msgstr "Приклад запису в конфігураційний файл::" + +msgid "" +"import configparser\n" +"\n" +"config = configparser.RawConfigParser()\n" +"\n" +"# Please note that using RawConfigParser's set functions, you can assign\n" +"# non-string values to keys internally, but will receive an error when\n" +"# attempting to write to a file or when you get it in non-raw mode. Setting\n" +"# values using the mapping protocol or ConfigParser's set() does not allow\n" +"# such assignments to take place.\n" +"config.add_section('Section1')\n" +"config.set('Section1', 'an_int', '15')\n" +"config.set('Section1', 'a_bool', 'true')\n" +"config.set('Section1', 'a_float', '3.1415')\n" +"config.set('Section1', 'baz', 'fun')\n" +"config.set('Section1', 'bar', 'Python')\n" +"config.set('Section1', 'foo', '%(bar)s is %(baz)s!')\n" +"\n" +"# Writing our configuration file to 'example.cfg'\n" +"with open('example.cfg', 'w') as configfile:\n" +" config.write(configfile)" +msgstr "" + +msgid "An example of reading the configuration file again::" +msgstr "Приклад повторного читання конфігураційного файлу::" + +msgid "" +"import configparser\n" +"\n" +"config = configparser.RawConfigParser()\n" +"config.read('example.cfg')\n" +"\n" +"# getfloat() raises an exception if the value is not a float\n" +"# getint() and getboolean() also do this for their respective types\n" +"a_float = config.getfloat('Section1', 'a_float')\n" +"an_int = config.getint('Section1', 'an_int')\n" +"print(a_float + an_int)\n" +"\n" +"# Notice that the next output does not interpolate '%(bar)s' or '%(baz)s'.\n" +"# This is because we are using a RawConfigParser().\n" +"if config.getboolean('Section1', 'a_bool'):\n" +" print(config.get('Section1', 'foo'))" +msgstr "" + +msgid "To get interpolation, use :class:`ConfigParser`::" +msgstr "Щоб отримати інтерполяцію, використовуйте :class:`ConfigParser`::" + +msgid "" +"import configparser\n" +"\n" +"cfg = configparser.ConfigParser()\n" +"cfg.read('example.cfg')\n" +"\n" +"# Set the optional *raw* argument of get() to True if you wish to disable\n" +"# interpolation in a single get operation.\n" +"print(cfg.get('Section1', 'foo', raw=False)) # -> \"Python is fun!\"\n" +"print(cfg.get('Section1', 'foo', raw=True)) # -> \"%(bar)s is %(baz)s!\"\n" +"\n" +"# The optional *vars* argument is a dict with members that will take\n" +"# precedence in interpolation.\n" +"print(cfg.get('Section1', 'foo', vars={'bar': 'Documentation',\n" +" 'baz': 'evil'}))\n" +"\n" +"# The optional *fallback* argument can be used to provide a fallback value\n" +"print(cfg.get('Section1', 'foo'))\n" +" # -> \"Python is fun!\"\n" +"\n" +"print(cfg.get('Section1', 'foo', fallback='Monty is not.'))\n" +" # -> \"Python is fun!\"\n" +"\n" +"print(cfg.get('Section1', 'monster', fallback='No such things as " +"monsters.'))\n" +" # -> \"No such things as monsters.\"\n" +"\n" +"# A bare print(cfg.get('Section1', 'monster')) would raise NoOptionError\n" +"# but we can also use:\n" +"\n" +"print(cfg.get('Section1', 'monster', fallback=None))\n" +" # -> None" +msgstr "" + +msgid "" +"Default values are available in both types of ConfigParsers. They are used " +"in interpolation if an option used is not defined elsewhere. ::" +msgstr "" +"Значення за замовчуванням доступні в обох типах ConfigParsers. Вони " +"використовуються в інтерполяції, якщо використовувана опція не визначена в " +"іншому місці. ::" + +msgid "" +"import configparser\n" +"\n" +"# New instance with 'bar' and 'baz' defaulting to 'Life' and 'hard' each\n" +"config = configparser.ConfigParser({'bar': 'Life', 'baz': 'hard'})\n" +"config.read('example.cfg')\n" +"\n" +"print(config.get('Section1', 'foo')) # -> \"Python is fun!\"\n" +"config.remove_option('Section1', 'bar')\n" +"config.remove_option('Section1', 'baz')\n" +"print(config.get('Section1', 'foo')) # -> \"Life is hard!\"" +msgstr "" + +msgid "ConfigParser Objects" +msgstr "Об’єкти ConfigParser" + +msgid "" +"The main configuration parser. When *defaults* is given, it is initialized " +"into the dictionary of intrinsic defaults. When *dict_type* is given, it " +"will be used to create the dictionary objects for the list of sections, for " +"the options within a section, and for the default values." +msgstr "" +"Основний аналізатор конфігурації. Коли задано *defaults*, воно " +"ініціалізується у словнику внутрішніх типових значень. Якщо вказано " +"*dict_type*, він використовуватиметься для створення об’єктів словника для " +"списку розділів, параметрів у розділі та значень за замовчуванням." + +msgid "" +"When *delimiters* is given, it is used as the set of substrings that divide " +"keys from values. When *comment_prefixes* is given, it will be used as the " +"set of substrings that prefix comments in otherwise empty lines. Comments " +"can be indented. When *inline_comment_prefixes* is given, it will be used " +"as the set of substrings that prefix comments in non-empty lines." +msgstr "" +"Якщо вказано *роздільники*, вони використовуються як набір підрядків, які " +"відділяють ключі від значень. Якщо вказано *comment_prefixes*, він " +"використовуватиметься як набір підрядків, які додають коментарі до порожніх " +"рядків. Коментарі можна робити з відступом. Якщо задано " +"*inline_comment_prefixes*, воно використовуватиметься як набір підрядків, " +"які додають коментарі до непорожніх рядків." + +msgid "" +"When *strict* is ``True`` (the default), the parser won't allow for any " +"section or option duplicates while reading from a single source (file, " +"string or dictionary), raising :exc:`DuplicateSectionError` or :exc:" +"`DuplicateOptionError`. When *empty_lines_in_values* is ``False`` (default: " +"``True``), each empty line marks the end of an option. Otherwise, internal " +"empty lines of a multiline option are kept as part of the value. When " +"*allow_no_value* is ``True`` (default: ``False``), options without values " +"are accepted; the value held for these is ``None`` and they are serialized " +"without the trailing delimiter." +msgstr "" +"Якщо *strict* має значення ``True`` (за замовчуванням), синтаксичний " +"аналізатор не допускатиме жодних дублікатів розділів або параметрів під час " +"читання з одного джерела (файлу, рядка або словника), викликаючи :exc:" +"`DuplicateSectionError` або :exc:`DuplicateOptionError`. Коли " +"*empty_lines_in_values* має значення ``False`` (за замовчуванням: ``True``), " +"кожен порожній рядок позначає кінець параметра. В іншому випадку внутрішні " +"порожні рядки багаторядкового параметра зберігаються як частина значення. " +"Якщо *allow_no_value* має значення ``True`` (за замовчуванням: ``False``), " +"параметри без значень приймаються; значенням, яке зберігається для них, є " +"``None``, і вони серіалізуються без кінцевого розділювача." + +msgid "" +"When *default_section* is given, it specifies the name for the special " +"section holding default values for other sections and interpolation purposes " +"(normally named ``\"DEFAULT\"``). This value can be retrieved and changed " +"at runtime using the ``default_section`` instance attribute. This won't re-" +"evaluate an already parsed config file, but will be used when writing parsed " +"settings to a new config file." +msgstr "" + +msgid "" +"Interpolation behaviour may be customized by providing a custom handler " +"through the *interpolation* argument. ``None`` can be used to turn off " +"interpolation completely, ``ExtendedInterpolation()`` provides a more " +"advanced variant inspired by ``zc.buildout``. More on the subject in the " +"`dedicated documentation section <#interpolation-of-values>`_." +msgstr "" +"Поведінку інтерполяції можна налаштувати, надавши спеціальний обробник через " +"аргумент *interpolation*. ``None`` можна використовувати, щоб повністю " +"вимкнути інтерполяцію, ``ExtendedInterpolation()`` надає більш просунутий " +"варіант, натхненний ``zc.buildout``. Більше про цю тему див. у розділі " +"`спеціальної документації <#interpolation-of-values>`_." + +msgid "" +"All option names used in interpolation will be passed through the :meth:" +"`optionxform` method just like any other option name reference. For " +"example, using the default implementation of :meth:`optionxform` (which " +"converts option names to lower case), the values ``foo %(bar)s`` and ``foo " +"%(BAR)s`` are equivalent." +msgstr "" +"Усі назви опцій, що використовуються в інтерполяції, будуть передані через " +"метод :meth:`optionxform` так само, як і будь-яке інше посилання на назву " +"опції. Наприклад, використовуючи стандартну реалізацію :meth:`optionxform` " +"(яка перетворює назви опцій у нижній регістр), значення ``foo %(bar)s`` і " +"``foo %(BAR)s`` є еквівалентними." + +msgid "" +"When *converters* is given, it should be a dictionary where each key " +"represents the name of a type converter and each value is a callable " +"implementing the conversion from string to the desired datatype. Every " +"converter gets its own corresponding :meth:`!get*` method on the parser " +"object and section proxies." +msgstr "" + +msgid "" +"When *allow_unnamed_section* is ``True`` (default: ``False``), the first " +"section name can be omitted. See the `\"Unnamed Sections\" section <#unnamed-" +"sections>`_." +msgstr "" + +msgid "The default *dict_type* is :class:`collections.OrderedDict`." +msgstr "Типом *dict_type* є :class:`collections.OrderedDict`." + +msgid "" +"*allow_no_value*, *delimiters*, *comment_prefixes*, *strict*, " +"*empty_lines_in_values*, *default_section* and *interpolation* were added." +msgstr "" +"Додано *allow_no_value*, *delimiters*, *comment_prefixes*, *strict*, " +"*empty_lines_in_values*, *default_section* та *interpolation*." + +msgid "The *converters* argument was added." +msgstr "Додано аргумент *конвертери*." + +msgid "" +"The *defaults* argument is read with :meth:`read_dict`, providing consistent " +"behavior across the parser: non-string keys and values are implicitly " +"converted to strings." +msgstr "" + +msgid "" +"The default *dict_type* is :class:`dict`, since it now preserves insertion " +"order." +msgstr "" +"Типом *dict_type* є :class:`dict`, оскільки тепер зберігається порядок " +"вставки." + +msgid "" +"Raise a :exc:`MultilineContinuationError` when *allow_no_value* is ``True``, " +"and a key without a value is continued with an indented line." +msgstr "" + +msgid "The *allow_unnamed_section* argument was added." +msgstr "" + +msgid "Return a dictionary containing the instance-wide defaults." +msgstr "" +"Повертає словник, що містить значення за замовчуванням для всього екземпляра." + +msgid "" +"Return a list of the sections available; the *default section* is not " +"included in the list." +msgstr "" +"Повернути список доступних розділів; *розділ за замовчуванням* не включено " +"до списку." + +msgid "" +"Add a section named *section* to the instance. If a section by the given " +"name already exists, :exc:`DuplicateSectionError` is raised. If the " +"*default section* name is passed, :exc:`ValueError` is raised. The name of " +"the section must be a string; if not, :exc:`TypeError` is raised." +msgstr "" +"Додайте до екземпляра розділ із назвою *section*. Якщо розділ із вказаною " +"назвою вже існує, виникає :exc:`DuplicateSectionError`. Якщо передано назву " +"*розділу за замовчуванням*, виникає помилка :exc:`ValueError`. Назва розділу " +"має бути рядком; якщо ні, виникає :exc:`TypeError`." + +msgid "Non-string section names raise :exc:`TypeError`." +msgstr "Нерядкові назви розділів викликають :exc:`TypeError`." + +msgid "" +"Indicates whether the named *section* is present in the configuration. The " +"*default section* is not acknowledged." +msgstr "" +"Вказує, чи присутній названий *розділ* у конфігурації. Розділ *за " +"замовчуванням* не підтверджується." + +msgid "Return a list of options available in the specified *section*." +msgstr "Повернути список опцій, доступних у вказаному *розділі*." + +msgid "" +"If the given *section* exists, and contains the given *option*, return :" +"const:`True`; otherwise return :const:`False`. If the specified *section* " +"is :const:`None` or an empty string, DEFAULT is assumed." +msgstr "" +"Якщо заданий *розділ* існує та містить вказаний *опціон*, поверніть :const:" +"`True`; інакше повертає :const:`False`. Якщо вказаний *розділ* має значення :" +"const:`None` або порожній рядок, передбачається DEFAULT." + +msgid "" +"Attempt to read and parse an iterable of filenames, returning a list of " +"filenames which were successfully parsed." +msgstr "" +"Спроба прочитати та розібрати ітерацію імен файлів, повертаючи список імен " +"файлів, які були успішно розібрані." + +msgid "" +"If *filenames* is a string, a :class:`bytes` object or a :term:`path-like " +"object`, it is treated as a single filename. If a file named in *filenames* " +"cannot be opened, that file will be ignored. This is designed so that you " +"can specify an iterable of potential configuration file locations (for " +"example, the current directory, the user's home directory, and some system-" +"wide directory), and all existing configuration files in the iterable will " +"be read." +msgstr "" +"Якщо *filenames* є рядком, об’єктом :class:`bytes` або :term:`path-like " +"object`, воно розглядається як одне ім’я файлу. Якщо файл із назвою " +"*filenaname* неможливо відкрити, цей файл буде проігноровано. Це призначено " +"для того, щоб ви могли вказати ітерацію потенційних розташувань файлів " +"конфігурації (наприклад, поточний каталог, домашній каталог користувача та " +"деякий загальносистемний каталог), і всі існуючі файли конфігурації в " +"ітерації будуть прочитані." + +msgid "" +"If none of the named files exist, the :class:`ConfigParser` instance will " +"contain an empty dataset. An application which requires initial values to " +"be loaded from a file should load the required file or files using :meth:" +"`read_file` before calling :meth:`read` for any optional files::" +msgstr "" +"Якщо жоден із названих файлів не існує, екземпляр :class:`ConfigParser` " +"міститиме порожній набір даних. Програма, яка потребує завантаження " +"початкових значень із файлу, має завантажити необхідний файл або файли за " +"допомогою :meth:`read_file` перед викликом :meth:`read` для будь-яких " +"додаткових файлів::" + +msgid "" +"import configparser, os\n" +"\n" +"config = configparser.ConfigParser()\n" +"config.read_file(open('defaults.cfg'))\n" +"config.read(['site.cfg', os.path.expanduser('~/.myapp.cfg')],\n" +" encoding='cp1250')" +msgstr "" + +msgid "" +"Added the *encoding* parameter. Previously, all files were read using the " +"default encoding for :func:`open`." +msgstr "" + +msgid "The *filenames* parameter accepts a :term:`path-like object`." +msgstr "Параметр *filenames* приймає :term:`path-like object`." + +msgid "The *filenames* parameter accepts a :class:`bytes` object." +msgstr "Параметр *filenames* приймає об’єкт :class:`bytes`." + +msgid "" +"Read and parse configuration data from *f* which must be an iterable " +"yielding Unicode strings (for example files opened in text mode)." +msgstr "" +"Читати та аналізувати конфігураційні дані з *f*, які мають бути " +"повторюваними рядками Unicode (наприклад, файли, відкриті в текстовому " +"режимі)." + +msgid "" +"Optional argument *source* specifies the name of the file being read. If " +"not given and *f* has a :attr:`!name` attribute, that is used for *source*; " +"the default is ``''``." +msgstr "" + +msgid "Replaces :meth:`!readfp`." +msgstr "" + +msgid "Parse configuration data from a string." +msgstr "Аналіз даних конфігурації з рядка." + +msgid "" +"Optional argument *source* specifies a context-specific name of the string " +"passed. If not given, ``''`` is used. This should commonly be a " +"filesystem path or a URL." +msgstr "" +"Необов'язковий аргумент *джерело* вказує контекстно-залежну назву переданого " +"рядка. Якщо не вказано, використовується ``' '``. Зазвичай це має " +"бути шлях до файлової системи або URL-адреса." + +msgid "" +"Load configuration from any object that provides a dict-like ``items()`` " +"method. Keys are section names, values are dictionaries with keys and " +"values that should be present in the section. If the used dictionary type " +"preserves order, sections and their keys will be added in order. Values are " +"automatically converted to strings." +msgstr "" +"Завантажте конфігурацію з будь-якого об’єкта, який надає dict-подібний метод " +"``items()``. Ключі - це назви розділів, значення - це словники з ключами та " +"значеннями, які повинні бути присутніми в розділі. Якщо використовуваний тип " +"словника зберігає порядок, розділи та їхні ключі будуть додані в порядку. " +"Значення автоматично перетворюються на рядки." + +msgid "" +"Optional argument *source* specifies a context-specific name of the " +"dictionary passed. If not given, ```` is used." +msgstr "" +"Необов'язковий аргумент *джерело* вказує контекстно-залежну назву переданого " +"словника. Якщо не вказано, використовується ````." + +msgid "This method can be used to copy state between parsers." +msgstr "Цей метод можна використовувати для копіювання стану між парсерами." + +msgid "" +"Get an *option* value for the named *section*. If *vars* is provided, it " +"must be a dictionary. The *option* is looked up in *vars* (if provided), " +"*section*, and in *DEFAULTSECT* in that order. If the key is not found and " +"*fallback* is provided, it is used as a fallback value. ``None`` can be " +"provided as a *fallback* value." +msgstr "" +"Отримайте значення *option* для названого *розділу*. Якщо вказано *vars*, це " +"має бути словник. *Опція* шукається в *vars* (якщо передбачено), *section* і " +"в *DEFAULTSECT* у такому порядку. Якщо ключ не знайдено і надано " +"*резервний*, він використовується як резервне значення. ``None`` можна " +"надати як *резервне* значення." + +msgid "" +"All the ``'%'`` interpolations are expanded in the return values, unless the " +"*raw* argument is true. Values for interpolation keys are looked up in the " +"same manner as the option." +msgstr "" +"Усі інтерполяції ``'%'`` розгортаються у значеннях, що повертаються, якщо " +"аргумент *raw* не має значення true. Значення для ключів інтерполяції " +"шукаються так само, як і параметр." + +msgid "" +"Arguments *raw*, *vars* and *fallback* are keyword only to protect users " +"from trying to use the third argument as the *fallback* fallback (especially " +"when using the mapping protocol)." +msgstr "" +"Аргументи *raw*, *vars* і *fallback* є лише ключовими словами, щоб захистити " +"користувачів від спроб використовувати третій аргумент як *резервний* резерв " +"(особливо під час використання протоколу відображення)." + +msgid "" +"A convenience method which coerces the *option* in the specified *section* " +"to an integer. See :meth:`get` for explanation of *raw*, *vars* and " +"*fallback*." +msgstr "" +"Зручний метод, який приводить *опцію* у вказаному *розділі* до цілого числа. " +"Перегляньте :meth:`get` для пояснення *raw*, *vars* і *fallback*." + +msgid "" +"A convenience method which coerces the *option* in the specified *section* " +"to a floating-point number. See :meth:`get` for explanation of *raw*, " +"*vars* and *fallback*." +msgstr "" + +msgid "" +"A convenience method which coerces the *option* in the specified *section* " +"to a Boolean value. Note that the accepted values for the option are " +"``'1'``, ``'yes'``, ``'true'``, and ``'on'``, which cause this method to " +"return ``True``, and ``'0'``, ``'no'``, ``'false'``, and ``'off'``, which " +"cause it to return ``False``. These string values are checked in a case-" +"insensitive manner. Any other value will cause it to raise :exc:" +"`ValueError`. See :meth:`get` for explanation of *raw*, *vars* and " +"*fallback*." +msgstr "" +"Зручний метод, який приводить *параметр* у вказаному *розділі* до логічного " +"значення. Зауважте, що допустимими значеннями параметра є ``'1'``, " +"``'yes'``, ``'true'`` і ``'on'``, через що цей метод повертає ``True`` і " +"``'0'``, ``'no'``, ``'false'`` і ``'off'``, які повертають ``False``. Ці " +"рядкові значення перевіряються без урахування регістру. Будь-яке інше " +"значення призведе до виникнення :exc:`ValueError`. Перегляньте :meth:`get` " +"для пояснення *raw*, *vars* і *fallback*." + +msgid "" +"When *section* is not given, return a list of *section_name*, " +"*section_proxy* pairs, including DEFAULTSECT." +msgstr "" +"Якщо *section* не вказано, повертає список пар *section_name*, " +"*section_proxy*, включаючи DEFAULTSECT." + +msgid "" +"Otherwise, return a list of *name*, *value* pairs for the options in the " +"given *section*. Optional arguments have the same meaning as for the :meth:" +"`get` method." +msgstr "" +"В іншому випадку поверніть список пар *ім’я*, *значення* для опцій у " +"вказаному *розділі*. Необов’язкові аргументи мають те саме значення, що й " +"для методу :meth:`get`." + +msgid "" +"Items present in *vars* no longer appear in the result. The previous " +"behaviour mixed actual parser options with variables provided for " +"interpolation." +msgstr "" +"Елементи, присутні в *vars*, більше не відображаються в результатах. " +"Попередня поведінка змішувала фактичні параметри аналізатора зі змінними, " +"наданими для інтерполяції." + +msgid "" +"If the given section exists, set the given option to the specified value; " +"otherwise raise :exc:`NoSectionError`. *option* and *value* must be " +"strings; if not, :exc:`TypeError` is raised." +msgstr "" +"Якщо даний розділ існує, установіть для даного параметра вказане значення; " +"інакше підняти :exc:`NoSectionError`. *option* і *value* мають бути рядками; " +"якщо ні, виникає :exc:`TypeError`." + +msgid "" +"Write a representation of the configuration to the specified :term:`file " +"object`, which must be opened in text mode (accepting strings). This " +"representation can be parsed by a future :meth:`read` call. If " +"*space_around_delimiters* is true, delimiters between keys and values are " +"surrounded by spaces." +msgstr "" +"Запишіть представлення конфігурації у вказаний :term:`file object`, який " +"потрібно відкрити в текстовому режимі (приймаючи рядки). Це представлення " +"може бути проаналізовано майбутнім викликом :meth:`read`. Якщо " +"*space_around_delimiters* має значення true, роздільники між ключами та " +"значеннями оточуються пробілами." + +msgid "" +"Comments in the original configuration file are not preserved when writing " +"the configuration back. What is considered a comment, depends on the given " +"values for *comment_prefix* and *inline_comment_prefix*." +msgstr "" +"Коментарі у вихідному файлі конфігурації не зберігаються під час повторного " +"запису конфігурації. Те, що вважається коментарем, залежить від заданих " +"значень для *comment_prefix* і *inline_comment_prefix*." + +msgid "" +"Remove the specified *option* from the specified *section*. If the section " +"does not exist, raise :exc:`NoSectionError`. If the option existed to be " +"removed, return :const:`True`; otherwise return :const:`False`." +msgstr "" +"Видалити вказаний *параметр* із зазначеного *розділу*. Якщо розділ не існує, " +"підніміть :exc:`NoSectionError`. Якщо існувала опція для видалення, " +"поверніть :const:`True`; інакше повертає :const:`False`." + +msgid "" +"Remove the specified *section* from the configuration. If the section in " +"fact existed, return ``True``. Otherwise return ``False``." +msgstr "" +"Видалити вказаний *розділ* із конфігурації. Якщо розділ дійсно існував, " +"поверніть ``True``. Інакше поверніть ``False``." + +msgid "" +"Transforms the option name *option* as found in an input file or as passed " +"in by client code to the form that should be used in the internal " +"structures. The default implementation returns a lower-case version of " +"*option*; subclasses may override this or client code can set an attribute " +"of this name on instances to affect this behavior." +msgstr "" +"Перетворює назву параметра *option*, знайдену у вхідному файлі або передану " +"кодом клієнта, у форму, яка має використовуватися у внутрішніх структурах. " +"Реалізація за замовчуванням повертає версію *option* у нижньому регістрі; " +"підкласи можуть замінити це, або код клієнта може встановити атрибут цього " +"імені в екземплярах, щоб вплинути на цю поведінку." + +msgid "" +"You don't need to subclass the parser to use this method, you can also set " +"it on an instance, to a function that takes a string argument and returns a " +"string. Setting it to ``str``, for example, would make option names case " +"sensitive::" +msgstr "" +"Вам не потрібно створювати підкласи синтаксичного аналізатора, щоб " +"використовувати цей метод, ви також можете встановити його на екземпляр, на " +"функцію, яка приймає рядковий аргумент і повертає рядок. Наприклад, якщо " +"встановити значення ``str``, назви опцій будуть чутливими до регістру:" + +msgid "" +"cfgparser = ConfigParser()\n" +"cfgparser.optionxform = str" +msgstr "" + +msgid "" +"Note that when reading configuration files, whitespace around the option " +"names is stripped before :meth:`optionxform` is called." +msgstr "" +"Зауважте, що під час читання конфігураційних файлів пробіли навколо назв " +"параметрів видаляються перед викликом :meth:`optionxform`." + +msgid "" +"A special object representing a section name used to reference the unnamed " +"section (see :ref:`unnamed-sections`)." +msgstr "" + +msgid "" +"The maximum depth for recursive interpolation for :meth:`~configparser." +"ConfigParser.get` when the *raw* parameter is false. This is relevant only " +"when the default *interpolation* is used." +msgstr "" + +msgid "RawConfigParser Objects" +msgstr "Об’єкти RawConfigParser" + +msgid "" +"Legacy variant of the :class:`ConfigParser`. It has interpolation disabled " +"by default and allows for non-string section names, option names, and values " +"via its unsafe ``add_section`` and ``set`` methods, as well as the legacy " +"``defaults=`` keyword argument handling." +msgstr "" +"Застарілий варіант :class:`ConfigParser`. Він має інтерполяцію вимкнено за " +"замовчуванням і дозволяє використовувати нерядкові назви розділів, назви " +"параметрів і значення за допомогою небезпечних методів ``add_section`` і " +"``set``, а також застарілої обробки аргументів ключового слова " +"``defaults=``. ." + +msgid "" +"Consider using :class:`ConfigParser` instead which checks types of the " +"values to be stored internally. If you don't want interpolation, you can " +"use ``ConfigParser(interpolation=None)``." +msgstr "" +"Розгляньте можливість використання :class:`ConfigParser` натомість, який " +"перевіряє типи значень, які зберігатимуться всередині. Якщо вам не потрібна " +"інтерполяція, ви можете використати ``ConfigParser(interpolation=None)``." + +msgid "" +"Add a section named *section* to the instance. If a section by the given " +"name already exists, :exc:`DuplicateSectionError` is raised. If the " +"*default section* name is passed, :exc:`ValueError` is raised." +msgstr "" +"Додайте до екземпляра розділ із назвою *section*. Якщо розділ із вказаною " +"назвою вже існує, виникає :exc:`DuplicateSectionError`. Якщо передано назву " +"*розділу за замовчуванням*, виникає помилка :exc:`ValueError`." + +msgid "" +"Type of *section* is not checked which lets users create non-string named " +"sections. This behaviour is unsupported and may cause internal errors." +msgstr "" +"Тип *розділу* не позначено, що дозволяє користувачам створювати розділи без " +"рядкових імен. Така поведінка не підтримується та може викликати внутрішні " +"помилки." + +msgid "" +"If the given section exists, set the given option to the specified value; " +"otherwise raise :exc:`NoSectionError`. While it is possible to use :class:" +"`RawConfigParser` (or :class:`ConfigParser` with *raw* parameters set to " +"true) for *internal* storage of non-string values, full functionality " +"(including interpolation and output to files) can only be achieved using " +"string values." +msgstr "" +"Якщо даний розділ існує, установіть для даного параметра вказане значення; " +"інакше підняти :exc:`NoSectionError`. Хоча можна використовувати :class:" +"`RawConfigParser` (або :class:`ConfigParser` з *raw* параметрами, " +"встановленими на true) для *внутрішнього* зберігання нерядкових значень, " +"повна функціональність (включно з інтерполяцією та виведенням у файли) можна " +"досягти лише за допомогою рядкових значень." + +msgid "" +"This method lets users assign non-string values to keys internally. This " +"behaviour is unsupported and will cause errors when attempting to write to a " +"file or get it in non-raw mode. **Use the mapping protocol API** which does " +"not allow such assignments to take place." +msgstr "" +"Цей метод дозволяє користувачам внутрішньо призначати нерядкові значення " +"ключам. Така поведінка не підтримується та спричинить помилки під час спроби " +"запису у файл або отримання його в режимі без обробки. **Використовуйте API " +"протоколу зіставлення**, який не дозволяє виконувати такі призначення." + +msgid "Exceptions" +msgstr "Винятки" + +msgid "Base class for all other :mod:`configparser` exceptions." +msgstr "Базовий клас для всіх інших винятків :mod:`configparser`." + +msgid "Exception raised when a specified section is not found." +msgstr "Виняток виникає, коли вказаний розділ не знайдено." + +msgid "" +"Exception raised if :meth:`~ConfigParser.add_section` is called with the " +"name of a section that is already present or in strict parsers when a " +"section if found more than once in a single input file, string or dictionary." +msgstr "" + +msgid "" +"Added the optional *source* and *lineno* attributes and parameters to :meth:" +"`!__init__`." +msgstr "" + +msgid "" +"Exception raised by strict parsers if a single option appears twice during " +"reading from a single file, string or dictionary. This catches misspellings " +"and case sensitivity-related errors, e.g. a dictionary may have two keys " +"representing the same case-insensitive configuration key." +msgstr "" +"Виняток, створений строгими парсерами, якщо одна опція з’являється двічі під " +"час читання з одного файлу, рядка або словника. Це виявляє орфографічні " +"помилки та помилки, пов’язані з регістром, напр. словник може мати два " +"ключі, що представляють один і той же ключ конфігурації без урахування " +"регістру." + +msgid "" +"Exception raised when a specified option is not found in the specified " +"section." +msgstr "" +"Виняток виникає, коли вказаний параметр не знайдено у вказаному розділі." + +msgid "" +"Base class for exceptions raised when problems occur performing string " +"interpolation." +msgstr "" +"Базовий клас для винятків, які виникають, коли виникають проблеми з " +"виконанням інтерполяції рядків." + +msgid "" +"Exception raised when string interpolation cannot be completed because the " +"number of iterations exceeds :const:`MAX_INTERPOLATION_DEPTH`. Subclass of :" +"exc:`InterpolationError`." +msgstr "" +"Виняток виникає, коли інтерполяцію рядка неможливо завершити, оскільки " +"кількість ітерацій перевищує :const:`MAX_INTERPOLATION_DEPTH`. Підклас :exc:" +"`InterpolationError`." + +msgid "" +"Exception raised when an option referenced from a value does not exist. " +"Subclass of :exc:`InterpolationError`." +msgstr "" +"Виняток виникає, коли параметр, на який посилається значення, не існує. " +"Підклас :exc:`InterpolationError`." + +msgid "" +"Exception raised when the source text into which substitutions are made does " +"not conform to the required syntax. Subclass of :exc:`InterpolationError`." +msgstr "" +"Виняток виникає, коли вихідний текст, у якому зроблено заміни, не відповідає " +"необхідному синтаксису. Підклас :exc:`InterpolationError`." + +msgid "" +"Exception raised when attempting to parse a file which has no section " +"headers." +msgstr "" +"Під час спроби проаналізувати файл, який не має заголовків розділів, виникає " +"виняток." + +msgid "Exception raised when errors occur attempting to parse a file." +msgstr "Виняток виникає, коли виникають помилки під час спроби аналізу файлу." + +msgid "" +"The ``filename`` attribute and :meth:`!__init__` constructor argument were " +"removed. They have been available using the name ``source`` since 3.2." +msgstr "" + +msgid "" +"Exception raised when a key without a corresponding value is continued with " +"an indented line." +msgstr "" + +msgid "Footnotes" +msgstr "Виноски" + +msgid "" +"Config parsers allow for heavy customization. If you are interested in " +"changing the behaviour outlined by the footnote reference, consult the " +"`Customizing Parser Behaviour`_ section." +msgstr "" +"Синтаксичні аналізатори конфігурації дозволяють здійснювати серйозні " +"налаштування. Якщо ви зацікавлені в зміні поведінки, окресленої посиланням " +"на виноску, зверніться до розділу \"Налаштування поведінки аналізатора\" " +"(`Customizing Parser Behaviour`_)." + +msgid ".ini" +msgstr "" + +msgid "file" +msgstr "" + +msgid "configuration" +msgstr "" + +msgid "ini file" +msgstr "" + +msgid "Windows ini file" +msgstr "" + +msgid "% (percent)" +msgstr "" + +msgid "interpolation in configuration files" +msgstr "" + +msgid "$ (dollar)" +msgstr "" diff --git a/library/constants.po b/library/constants.po new file mode 100644 index 000000000..f9e007c0a --- /dev/null +++ b/library/constants.po @@ -0,0 +1,167 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:57+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Built-in Constants" +msgstr "Вбудовані константи" + +msgid "A small number of constants live in the built-in namespace. They are:" +msgstr "Невелика кількість констант живе у вбудованому просторі імен. Вони є:" + +msgid "" +"The false value of the :class:`bool` type. Assignments to ``False`` are " +"illegal and raise a :exc:`SyntaxError`." +msgstr "" +"Помилкове значення типу :class:`bool`. Присвоєння ``False`` є незаконним і " +"викликає :exc:`SyntaxError`." + +msgid "" +"The true value of the :class:`bool` type. Assignments to ``True`` are " +"illegal and raise a :exc:`SyntaxError`." +msgstr "" +"Справжнє значення типу :class:`bool`. Присвоєння ``True`` є незаконним і " +"викликає :exc:`SyntaxError`." + +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." +msgstr "" + +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 "" + +msgid "" +"When a binary (or in-place) method returns :data:`!NotImplemented` the " +"interpreter will try the reflected operation on the other type (or some " +"other fallback, depending on the operator). If all attempts return :data:`!" +"NotImplemented`, the interpreter will raise an appropriate exception. " +"Incorrectly returning :data:`!NotImplemented` will result in a misleading " +"error message or the :data:`!NotImplemented` value being returned to Python " +"code." +msgstr "" + +msgid "See :ref:`implementing-the-arithmetic-operations` for examples." +msgstr "Перегляньте приклади :ref:`implementing-the-arithmetic-operations`." + +msgid "" +":data:`!NotImplemented` and :exc:`!NotImplementedError` are not " +"interchangeable. This constant should only be used as described above; see :" +"exc:`NotImplementedError` for details on correct usage of the exception." +msgstr "" + +msgid "" +"Evaluating :data:`!NotImplemented` in a boolean context is deprecated. While " +"it currently evaluates as true, it will emit a :exc:`DeprecationWarning`. It " +"will raise a :exc:`TypeError` in a future version of Python." +msgstr "" + +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." +msgstr "" +"Те саме, що літерал з крапками \"``...``\". Спеціальне значення, яке " +"використовується переважно разом із розширеним синтаксисом нарізки для " +"визначених користувачем типів даних контейнера. ``Ellipsis`` є єдиним " +"екземпляром типу :data:`types.EllipsisType`." + +msgid "" +"This constant is true if Python was not started with an :option:`-O` option. " +"See also the :keyword:`assert` statement." +msgstr "" +"Ця константа є істинною, якщо Python не було запущено з параметром :option:`-" +"O`. Дивіться також оператор :keyword:`assert`." + +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." +msgstr "" +"Імена :data:`None`, :data:`False`, :data:`True` і :data:`__debug__` не можна " +"перепризначити (присвоєння їм, навіть як імені атрибута, викликає :exc:" +"`SyntaxError` ), тому їх можна вважати \"справжніми\" константами." + +msgid "Constants added by the :mod:`site` module" +msgstr "Константи, додані модулем :mod:`site`" + +msgid "" +"The :mod:`site` module (which is imported automatically during startup, " +"except if the :option:`-S` command-line option is given) adds several " +"constants to the built-in namespace. They are useful for the interactive " +"interpreter shell and should not be used in programs." +msgstr "" +"Модуль :mod:`site` (який імпортується автоматично під час запуску, за " +"винятком випадків, коли задано параметр командного рядка :option:`-S`) додає " +"кілька констант до вбудованого простору імен. Вони корисні для інтерактивної " +"оболонки інтерпретатора і не повинні використовуватися в програмах." + +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." +msgstr "" +"Об’єкти, які під час друку друкують повідомлення на зразок \"Використовуйте " +"quit() або Ctrl-D (тобто EOF) для виходу\", а під час виклику викликають :" +"exc:`SystemExit` із зазначеним кодом виходу." + +msgid "" +"Object that when printed, prints the message \"Type help() for interactive " +"help, or help(object) for help about object.\", and when called, acts as " +"described :func:`elsewhere `." +msgstr "" + +msgid "" +"Objects that when printed or called, print the text of copyright or credits, " +"respectively." +msgstr "" +"Об'єкти, які під час друку або виклику друкують текст авторських прав або " +"кредитів відповідно." + +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 " +"pager-like fashion (one screen at a time)." +msgstr "" +"Об’єкт, який під час друку друкує повідомлення \"Введіть licence(), щоб " +"побачити повний текст ліцензії\", а під час виклику відображає повний текст " +"ліцензії у вигляді пейджера (по одному екрану)." + +msgid "..." +msgstr "" + +msgid "ellipsis literal" +msgstr "" diff --git a/library/contextlib.po b/library/contextlib.po new file mode 100644 index 000000000..42874ba24 --- /dev/null +++ b/library/contextlib.po @@ -0,0 +1,1501 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:57+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "" +":mod:`!contextlib` --- Utilities for :keyword:`!with`\\ -statement contexts" +msgstr "" +":mod:`!contextlib` --- Утиліти для контекстів операторів :keyword:`!with`\\" + +msgid "**Source code:** :source:`Lib/contextlib.py`" +msgstr "**Вихідний код:** :source:`Lib/contextlib.py`" + +msgid "" +"This module provides utilities for common tasks involving the :keyword:" +"`with` statement. For more information see also :ref:`typecontextmanager` " +"and :ref:`context-managers`." +msgstr "" +"Цей модуль надає утиліти для типових завдань, пов’язаних із оператором :" +"keyword:`with`. Для отримання додаткової інформації див. також :ref:" +"`typecontextmanager` і :ref:`context-managers`." + +msgid "Utilities" +msgstr "Комунальні послуги" + +msgid "Functions and classes provided:" +msgstr "Надані функції та класи:" + +msgid "" +"An :term:`abstract base class` for classes that implement :meth:`object." +"__enter__` and :meth:`object.__exit__`. A default implementation for :meth:" +"`object.__enter__` is provided which returns ``self`` while :meth:`object." +"__exit__` is an abstract method which by default returns ``None``. See also " +"the definition of :ref:`typecontextmanager`." +msgstr "" +":term:`abstract base class` для класів, які реалізують :meth:`object." +"__enter__` і :meth:`object.__exit__`. Надається реалізація за замовчуванням " +"для :meth:`object.__enter__`, яка повертає ``self``, тоді як :meth:`object." +"__exit__` є абстрактним методом, який за замовчуванням повертає ``None``. " +"Дивіться також визначення :ref:`typecontextmanager`." + +msgid "" +"An :term:`abstract base class` for classes that implement :meth:`object." +"__aenter__` and :meth:`object.__aexit__`. A default implementation for :meth:" +"`object.__aenter__` is provided which returns ``self`` while :meth:`object." +"__aexit__` is an abstract method which by default returns ``None``. See also " +"the definition of :ref:`async-context-managers`." +msgstr "" +":term:`abstract base class` для класів, які реалізують :meth:`object." +"__aenter__` і :meth:`object.__aexit__`. Надається реалізація за " +"замовчуванням для :meth:`object.__aenter__`, яка повертає ``self``, тоді як :" +"meth:`object.__aexit__` є абстрактним методом, який за замовчуванням " +"повертає ``None``. Дивіться також визначення :ref:`async-context-managers`." + +msgid "" +"This function is a :term:`decorator` that can be used to define a factory " +"function for :keyword:`with` statement context managers, without needing to " +"create a class or separate :meth:`~object.__enter__` and :meth:`~object." +"__exit__` methods." +msgstr "" + +msgid "" +"While many objects natively support use in with statements, sometimes a " +"resource needs to be managed that isn't a context manager in its own right, " +"and doesn't implement a ``close()`` method for use with ``contextlib." +"closing``." +msgstr "" + +msgid "" +"An abstract example would be the following to ensure correct resource " +"management::" +msgstr "" +"Абстрактним прикладом може бути наступне, щоб забезпечити правильне " +"керування ресурсами:" + +msgid "" +"from contextlib import contextmanager\n" +"\n" +"@contextmanager\n" +"def managed_resource(*args, **kwds):\n" +" # Code to acquire resource, e.g.:\n" +" resource = acquire_resource(*args, **kwds)\n" +" try:\n" +" yield resource\n" +" finally:\n" +" # Code to release resource, e.g.:\n" +" release_resource(resource)" +msgstr "" + +msgid "The function can then be used like this::" +msgstr "" + +msgid "" +">>> with managed_resource(timeout=3600) as resource:\n" +"... # Resource is released at the end of this block,\n" +"... # even if code in the block raises an exception" +msgstr "" + +msgid "" +"The function being decorated must return a :term:`generator`-iterator when " +"called. This iterator must yield exactly one value, which will be bound to " +"the targets in the :keyword:`with` statement's :keyword:`!as` clause, if any." +msgstr "" +"Функція, яка декорується, має повертати :term:`generator`-ітератор під час " +"виклику. Цей ітератор має давати рівно одне значення, яке буде прив’язано до " +"цілей у пропозиції :keyword:`!as` інструкції :keyword:`with`, якщо така є." + +msgid "" +"At the point where the generator yields, the block nested in the :keyword:" +"`with` statement is executed. The generator is then resumed after the block " +"is exited. If an unhandled exception occurs in the block, it is reraised " +"inside the generator at the point where the yield occurred. Thus, you can " +"use a :keyword:`try`...\\ :keyword:`except`...\\ :keyword:`finally` " +"statement to trap the error (if any), or ensure that some cleanup takes " +"place. If an exception is trapped merely in order to log it or to perform " +"some action (rather than to suppress it entirely), the generator must " +"reraise that exception. Otherwise the generator context manager will " +"indicate to the :keyword:`!with` statement that the exception has been " +"handled, and execution will resume with the statement immediately following " +"the :keyword:`!with` statement." +msgstr "" +"У точці, де генератор поступається, виконується блок, вкладений у оператор :" +"keyword:`with`. Потім генератор відновлюється після виходу з блоку. Якщо в " +"блоці виникає необроблена виняткова ситуація, вона повторно створюється " +"всередині генератора в точці, де відбувся вихід. Таким чином, ви можете " +"використовувати оператор :keyword:`try`...\\ :keyword:`except`...\\ :keyword:" +"`finally`, щоб перехопити помилку (якщо така є) або забезпечити виконання " +"певного очищення. Якщо виняток перехоплюється лише для того, щоб " +"зареєструвати його або виконати певну дію (а не повністю його придушити), " +"генератор повинен повторно викликати цей виняток. В іншому випадку менеджер " +"контексту генератора вкаже оператору :keyword:`!with`, що виняток було " +"оброблено, і виконання буде відновлено оператором, що слідує безпосередньо " +"за оператором :keyword:`!with`." + +msgid "" +":func:`contextmanager` uses :class:`ContextDecorator` so the context " +"managers it creates can be used as decorators as well as in :keyword:`with` " +"statements. When used as a decorator, a new generator instance is implicitly " +"created on each function call (this allows the otherwise \"one-shot\" " +"context managers created by :func:`contextmanager` to meet the requirement " +"that context managers support multiple invocations in order to be used as " +"decorators)." +msgstr "" +":func:`contextmanager` використовує :class:`ContextDecorator`, тому створені " +"ним менеджери контексту можна використовувати як декоратори, а також у " +"операторах :keyword:`with`. Коли використовується як декоратор, новий " +"екземпляр генератора неявно створюється під час кожного виклику функції (це " +"дозволяє \"одноразовим\" контекстним менеджерам, створеним :func:" +"`contextmanager`, відповідати вимогам, щоб контекстні менеджери підтримували " +"кілька викликів, щоб використовувати як декоратори)." + +msgid "Use of :class:`ContextDecorator`." +msgstr "Використання :class:`ContextDecorator`." + +msgid "" +"Similar to :func:`~contextlib.contextmanager`, but creates an :ref:" +"`asynchronous context manager `." +msgstr "" +"Подібно до :func:`~contextlib.contextmanager`, але створює :ref:`асинхронний " +"менеджер контексту `." + +msgid "" +"This function is a :term:`decorator` that can be used to define a factory " +"function for :keyword:`async with` statement asynchronous context managers, " +"without needing to create a class or separate :meth:`~object.__aenter__` " +"and :meth:`~object.__aexit__` methods. It must be applied to an :term:" +"`asynchronous generator` function." +msgstr "" + +msgid "A simple example::" +msgstr "Простий приклад::" + +msgid "" +"from contextlib import asynccontextmanager\n" +"\n" +"@asynccontextmanager\n" +"async def get_connection():\n" +" conn = await acquire_db_connection()\n" +" try:\n" +" yield conn\n" +" finally:\n" +" await release_db_connection(conn)\n" +"\n" +"async def get_all_users():\n" +" async with get_connection() as conn:\n" +" return conn.query('SELECT ...')" +msgstr "" + +msgid "" +"Context managers defined with :func:`asynccontextmanager` can be used either " +"as decorators or with :keyword:`async with` statements::" +msgstr "" +"Менеджери контексту, визначені за допомогою :func:`asynccontextmanager`, " +"можна використовувати як декоратори або за допомогою операторів :keyword:" +"`async with`::" + +msgid "" +"import time\n" +"from contextlib import asynccontextmanager\n" +"\n" +"@asynccontextmanager\n" +"async def timeit():\n" +" now = time.monotonic()\n" +" try:\n" +" yield\n" +" finally:\n" +" print(f'it took {time.monotonic() - now}s to run')\n" +"\n" +"@timeit()\n" +"async def main():\n" +" # ... async code ..." +msgstr "" + +msgid "" +"When used as a decorator, a new generator instance is implicitly created on " +"each function call. This allows the otherwise \"one-shot\" context managers " +"created by :func:`asynccontextmanager` to meet the requirement that context " +"managers support multiple invocations in order to be used as decorators." +msgstr "" +"При використанні як декоратора новий екземпляр генератора неявно створюється " +"під час кожного виклику функції. Це дозволяє \"одноразовим\" контекстним " +"менеджерам, створеним :func:`asynccontextmanager`, відповідати вимогам, щоб " +"контекстні менеджери підтримували кілька викликів, щоб використовувати їх як " +"декоратори." + +msgid "" +"Async context managers created with :func:`asynccontextmanager` can be used " +"as decorators." +msgstr "" +"Менеджери асинхронного контексту, створені за допомогою :func:" +"`asynccontextmanager`, можна використовувати як декоратори." + +msgid "" +"Return a context manager that closes *thing* upon completion of the block. " +"This is basically equivalent to::" +msgstr "" +"Повертає контекстний менеджер, який закриває *річ* після завершення блоку. " +"Це в основному еквівалентно:" + +msgid "" +"from contextlib import contextmanager\n" +"\n" +"@contextmanager\n" +"def closing(thing):\n" +" try:\n" +" yield thing\n" +" finally:\n" +" thing.close()" +msgstr "" + +msgid "And lets you write code like this::" +msgstr "І дозволяє писати такий код::" + +msgid "" +"from contextlib import closing\n" +"from urllib.request import urlopen\n" +"\n" +"with closing(urlopen('https://www.python.org')) as page:\n" +" for line in page:\n" +" print(line)" +msgstr "" + +msgid "" +"without needing to explicitly close ``page``. Even if an error occurs, " +"``page.close()`` will be called when the :keyword:`with` block is exited." +msgstr "" +"без необхідності явного закриття ``сторінки``. Навіть якщо станеться " +"помилка, ``page.close()`` буде викликано під час виходу з блоку :keyword:" +"`with`." + +msgid "" +"Most types managing resources support the :term:`context manager` protocol, " +"which closes *thing* on leaving the :keyword:`with` statement. As such, :" +"func:`!closing` is most useful for third party types that don't support " +"context managers. This example is purely for illustration purposes, as :func:" +"`~urllib.request.urlopen` would normally be used in a context manager." +msgstr "" + +msgid "" +"Return an async context manager that calls the ``aclose()`` method of " +"*thing* upon completion of the block. This is basically equivalent to::" +msgstr "" +"Повертає менеджер асинхронного контексту, який викликає метод ``aclose()`` " +"*thing* після завершення блоку. Це в основному еквівалентно:" + +msgid "" +"from contextlib import asynccontextmanager\n" +"\n" +"@asynccontextmanager\n" +"async def aclosing(thing):\n" +" try:\n" +" yield thing\n" +" finally:\n" +" await thing.aclose()" +msgstr "" + +msgid "" +"Significantly, ``aclosing()`` supports deterministic cleanup of async " +"generators when they happen to exit early by :keyword:`break` or an " +"exception. For example::" +msgstr "" +"Важливо, що ``aclosing()`` підтримує детерміноване очищення асинхронних " +"генераторів, коли вони виходять раніше через :keyword:`break` або виняток. " +"Наприклад::" + +msgid "" +"from contextlib import aclosing\n" +"\n" +"async with aclosing(my_generator()) as values:\n" +" async for value in values:\n" +" if value == 42:\n" +" break" +msgstr "" + +msgid "" +"This pattern ensures that the generator's async exit code is executed in the " +"same context as its iterations (so that exceptions and context variables " +"work as expected, and the exit code isn't run after the lifetime of some " +"task it depends on)." +msgstr "" +"Цей шаблон гарантує, що асинхронний код виходу генератора виконується в тому " +"самому контексті, що й його ітерації (щоб винятки та контекстні змінні " +"працювали належним чином, а код виходу не запускався після закінчення часу " +"існування певного завдання, від якого він залежить)." + +msgid "" +"Return a context manager that returns *enter_result* from ``__enter__``, but " +"otherwise does nothing. It is intended to be used as a stand-in for an " +"optional context manager, for example::" +msgstr "" +"Повертає контекстний менеджер, який повертає *enter_result* із " +"``__enter__``, але в іншому випадку нічого не робить. Він призначений для " +"використання як резервний для додаткового контекстного менеджера, наприклад:" + +msgid "" +"def myfunction(arg, ignore_exceptions=False):\n" +" if ignore_exceptions:\n" +" # Use suppress to ignore all exceptions.\n" +" cm = contextlib.suppress(Exception)\n" +" else:\n" +" # Do not ignore any exceptions, cm has no effect.\n" +" cm = contextlib.nullcontext()\n" +" with cm:\n" +" # Do something" +msgstr "" + +msgid "An example using *enter_result*::" +msgstr "Приклад використання *enter_result*::" + +msgid "" +"def process_file(file_or_path):\n" +" if isinstance(file_or_path, str):\n" +" # If string, open file\n" +" cm = open(file_or_path)\n" +" else:\n" +" # Caller is responsible for closing file\n" +" cm = nullcontext(file_or_path)\n" +"\n" +" with cm as file:\n" +" # Perform processing on the file" +msgstr "" + +msgid "" +"It can also be used as a stand-in for :ref:`asynchronous context managers " +"`::" +msgstr "" +"Його також можна використовувати як заміну для :ref:`асинхронних контекстних " +"менеджерів `::" + +msgid "" +"async def send_http(session=None):\n" +" if not session:\n" +" # If no http session, create it with aiohttp\n" +" cm = aiohttp.ClientSession()\n" +" else:\n" +" # Caller is responsible for closing the session\n" +" cm = nullcontext(session)\n" +"\n" +" async with cm as session:\n" +" # Send http requests with session" +msgstr "" + +msgid ":term:`asynchronous context manager` support was added." +msgstr "Додано підтримку :term:`asynchronous context manager`." + +msgid "" +"Return a context manager that suppresses any of the specified exceptions if " +"they occur in the body of a :keyword:`!with` statement and then resumes " +"execution with the first statement following the end of the :keyword:`!with` " +"statement." +msgstr "" +"Повертає диспетчер контексту, який пригнічує будь-які з указаних винятків, " +"якщо вони трапляються в тілі оператора :keyword:`!with`, а потім відновлює " +"виконання з першим оператором, що йде після кінця оператора :keyword:`!with`." + +msgid "" +"As with any other mechanism that completely suppresses exceptions, this " +"context manager should be used only to cover very specific errors where " +"silently continuing with program execution is known to be the right thing to " +"do." +msgstr "" +"Як і будь-який інший механізм, який повністю пригнічує винятки, цей менеджер " +"контексту слід використовувати лише для покриття дуже конкретних помилок, " +"коли, як відомо, правильно продовжувати виконання програми." + +msgid "For example::" +msgstr "Наприклад::" + +msgid "" +"from contextlib import suppress\n" +"\n" +"with suppress(FileNotFoundError):\n" +" os.remove('somefile.tmp')\n" +"\n" +"with suppress(FileNotFoundError):\n" +" os.remove('someotherfile.tmp')" +msgstr "" + +msgid "This code is equivalent to::" +msgstr "Цей код еквівалентний:" + +msgid "" +"try:\n" +" os.remove('somefile.tmp')\n" +"except FileNotFoundError:\n" +" pass\n" +"\n" +"try:\n" +" os.remove('someotherfile.tmp')\n" +"except FileNotFoundError:\n" +" pass" +msgstr "" + +msgid "This context manager is :ref:`reentrant `." +msgstr "Цей контекстний менеджер є :ref:`reentrant `." + +msgid "" +"If the code within the :keyword:`!with` block raises a :exc:" +"`BaseExceptionGroup`, suppressed exceptions are removed from the group. Any " +"exceptions of the group which are not suppressed are re-raised in a new " +"group which is created using the original group's :meth:`~BaseExceptionGroup." +"derive` method." +msgstr "" + +msgid "" +"``suppress`` now supports suppressing exceptions raised as part of a :exc:" +"`BaseExceptionGroup`." +msgstr "" + +msgid "" +"Context manager for temporarily redirecting :data:`sys.stdout` to another " +"file or file-like object." +msgstr "" +"Менеджер контексту для тимчасового переспрямування :data:`sys.stdout` на " +"інший файл або файлоподібний об’єкт." + +msgid "" +"This tool adds flexibility to existing functions or classes whose output is " +"hardwired to stdout." +msgstr "" +"Цей інструмент додає гнучкості існуючим функціям або класам, вихід яких " +"підключено до стандартного виводу." + +msgid "" +"For example, the output of :func:`help` normally is sent to *sys.stdout*. " +"You can capture that output in a string by redirecting the output to an :" +"class:`io.StringIO` object. The replacement stream is returned from the " +"``__enter__`` method and so is available as the target of the :keyword:" +"`with` statement::" +msgstr "" +"Наприклад, вихід :func:`help` зазвичай надсилається до *sys.stdout*. Ви " +"можете записати цей вивід у рядок, перенаправивши вивід на об’єкт :class:`io." +"StringIO`. Потік заміни повертається з методу ``__enter__`` і тому доступний " +"як ціль оператора :keyword:`with`::" + +msgid "" +"with redirect_stdout(io.StringIO()) as f:\n" +" help(pow)\n" +"s = f.getvalue()" +msgstr "" + +msgid "" +"To send the output of :func:`help` to a file on disk, redirect the output to " +"a regular file::" +msgstr "" +"Щоб надіслати вивід :func:`help` у файл на диску, перенаправте вивід у " +"звичайний файл::" + +msgid "" +"with open('help.txt', 'w') as f:\n" +" with redirect_stdout(f):\n" +" help(pow)" +msgstr "" + +msgid "To send the output of :func:`help` to *sys.stderr*::" +msgstr "Щоб надіслати результат :func:`help` до *sys.stderr*::" + +msgid "" +"with redirect_stdout(sys.stderr):\n" +" help(pow)" +msgstr "" + +msgid "" +"Note that the global side effect on :data:`sys.stdout` means that this " +"context manager is not suitable for use in library code and most threaded " +"applications. It also has no effect on the output of subprocesses. However, " +"it is still a useful approach for many utility scripts." +msgstr "" +"Зауважте, що глобальний побічний ефект :data:`sys.stdout` означає, що цей " +"контекстний менеджер не підходить для використання в бібліотечному коді та " +"більшості потокових програм. Це також не впливає на вихідні дані " +"підпроцесів. Однак це все ще корисний підхід для багатьох службових " +"сценаріїв." + +msgid "" +"Similar to :func:`~contextlib.redirect_stdout` but redirecting :data:`sys." +"stderr` to another file or file-like object." +msgstr "" +"Подібно до :func:`~contextlib.redirect_stdout`, але перенаправляє :data:`sys." +"stderr` до іншого файлу або файлоподібного об’єкта." + +msgid "" +"Non parallel-safe context manager to change the current working directory. " +"As this changes a global state, the working directory, it is not suitable " +"for use in most threaded or async contexts. It is also not suitable for most " +"non-linear code execution, like generators, where the program execution is " +"temporarily relinquished -- unless explicitly desired, you should not yield " +"when this context manager is active." +msgstr "" + +msgid "" +"This is a simple wrapper around :func:`~os.chdir`, it changes the current " +"working directory upon entering and restores the old one on exit." +msgstr "" + +msgid "" +"A base class that enables a context manager to also be used as a decorator." +msgstr "" +"Базовий клас, який дозволяє менеджеру контексту також використовуватися як " +"декоратор." + +msgid "" +"Context managers inheriting from ``ContextDecorator`` have to implement " +"``__enter__`` and ``__exit__`` as normal. ``__exit__`` retains its optional " +"exception handling even when used as a decorator." +msgstr "" +"Менеджери контексту, успадковані від ``ContextDecorator``, мають реалізувати " +"``__enter__`` і ``__exit__`` як зазвичай. ``__exit__`` зберігає " +"необов'язкову обробку винятків, навіть якщо використовується як декоратор." + +msgid "" +"``ContextDecorator`` is used by :func:`contextmanager`, so you get this " +"functionality automatically." +msgstr "" +"``ContextDecorator`` використовується :func:`contextmanager`, тому ви " +"отримуєте цю функціональність автоматично." + +msgid "Example of ``ContextDecorator``::" +msgstr "Приклад ``ContextDecorator``::" + +msgid "" +"from contextlib import ContextDecorator\n" +"\n" +"class mycontext(ContextDecorator):\n" +" def __enter__(self):\n" +" print('Starting')\n" +" return self\n" +"\n" +" def __exit__(self, *exc):\n" +" print('Finishing')\n" +" return False" +msgstr "" + +msgid "The class can then be used like this::" +msgstr "" + +msgid "" +">>> @mycontext()\n" +"... def function():\n" +"... print('The bit in the middle')\n" +"...\n" +">>> function()\n" +"Starting\n" +"The bit in the middle\n" +"Finishing\n" +"\n" +">>> with mycontext():\n" +"... print('The bit in the middle')\n" +"...\n" +"Starting\n" +"The bit in the middle\n" +"Finishing" +msgstr "" + +msgid "" +"This change is just syntactic sugar for any construct of the following form::" +msgstr "" +"Ця зміна є просто синтаксичним цукром для будь-якої конструкції наступної " +"форми::" + +msgid "" +"def f():\n" +" with cm():\n" +" # Do stuff" +msgstr "" + +msgid "``ContextDecorator`` lets you instead write::" +msgstr "``ContextDecorator`` дозволяє замість цього писати::" + +msgid "" +"@cm()\n" +"def f():\n" +" # Do stuff" +msgstr "" + +msgid "" +"It makes it clear that the ``cm`` applies to the whole function, rather than " +"just a piece of it (and saving an indentation level is nice, too)." +msgstr "" +"Це дає зрозуміти, що ``cm`` застосовується до всієї функції, а не лише до її " +"частини (і зберегти рівень відступу теж добре)." + +msgid "" +"Existing context managers that already have a base class can be extended by " +"using ``ContextDecorator`` as a mixin class::" +msgstr "" +"Існуючі контекстні менеджери, які вже мають базовий клас, можна розширити за " +"допомогою ``ContextDecorator`` як класу mixin::" + +msgid "" +"from contextlib import ContextDecorator\n" +"\n" +"class mycontext(ContextBaseClass, ContextDecorator):\n" +" def __enter__(self):\n" +" return self\n" +"\n" +" def __exit__(self, *exc):\n" +" return False" +msgstr "" + +msgid "" +"As the decorated function must be able to be called multiple times, the " +"underlying context manager must support use in multiple :keyword:`with` " +"statements. If this is not the case, then the original construct with the " +"explicit :keyword:`!with` statement inside the function should be used." +msgstr "" +"Оскільки декорована функція повинна мати можливість викликатися кілька " +"разів, базовий менеджер контексту повинен підтримувати використання в " +"кількох операторах :keyword:`with`. Якщо це не так, тоді слід " +"використовувати оригінальну конструкцію з явним оператором :keyword:`!with` " +"усередині функції." + +msgid "" +"Similar to :class:`ContextDecorator` but only for asynchronous functions." +msgstr "" +"Подібно до :class:`ContextDecorator`, але лише для асинхронних функцій." + +msgid "Example of ``AsyncContextDecorator``::" +msgstr "Приклад ``AsyncContextDecorator``::" + +msgid "" +"from asyncio import run\n" +"from contextlib import AsyncContextDecorator\n" +"\n" +"class mycontext(AsyncContextDecorator):\n" +" async def __aenter__(self):\n" +" print('Starting')\n" +" return self\n" +"\n" +" async def __aexit__(self, *exc):\n" +" print('Finishing')\n" +" return False" +msgstr "" + +msgid "" +">>> @mycontext()\n" +"... async def function():\n" +"... print('The bit in the middle')\n" +"...\n" +">>> run(function())\n" +"Starting\n" +"The bit in the middle\n" +"Finishing\n" +"\n" +">>> async def function():\n" +"... async with mycontext():\n" +"... print('The bit in the middle')\n" +"...\n" +">>> run(function())\n" +"Starting\n" +"The bit in the middle\n" +"Finishing" +msgstr "" + +msgid "" +"A context manager that is designed to make it easy to programmatically " +"combine other context managers and cleanup functions, especially those that " +"are optional or otherwise driven by input data." +msgstr "" +"Менеджер контексту, розроблений для полегшення програмного поєднання інших " +"менеджерів контексту та функцій очищення, особливо тих, які є " +"необов’язковими або іншим чином керуються вхідними даними." + +msgid "" +"For example, a set of files may easily be handled in a single with statement " +"as follows::" +msgstr "" +"Наприклад, набір файлів можна легко обробити в одному операторі with " +"наступним чином:" + +msgid "" +"with ExitStack() as stack:\n" +" files = [stack.enter_context(open(fname)) for fname in filenames]\n" +" # All opened files will automatically be closed at the end of\n" +" # the with statement, even if attempts to open files later\n" +" # in the list raise an exception" +msgstr "" + +msgid "" +"The :meth:`~object.__enter__` method returns the :class:`ExitStack` " +"instance, and performs no additional operations." +msgstr "" + +msgid "" +"Each instance maintains a stack of registered callbacks that are called in " +"reverse order when the instance is closed (either explicitly or implicitly " +"at the end of a :keyword:`with` statement). Note that callbacks are *not* " +"invoked implicitly when the context stack instance is garbage collected." +msgstr "" +"Кожен екземпляр підтримує стек зареєстрованих зворотних викликів, які " +"викликаються у зворотному порядку, коли екземпляр закривається (явно чи " +"неявно в кінці оператора :keyword:`with`). Зауважте, що зворотні виклики " +"*не* викликаються неявно, коли примірник стеку контексту збирається сміттям." + +msgid "" +"This stack model is used so that context managers that acquire their " +"resources in their ``__init__`` method (such as file objects) can be handled " +"correctly." +msgstr "" +"Ця модель стеку використовується для того, щоб контекстні менеджери, які " +"отримують свої ресурси у своєму методі ``__init__`` (наприклад, файлові " +"об’єкти), могли оброблятися правильно." + +msgid "" +"Since registered callbacks are invoked in the reverse order of registration, " +"this ends up behaving as if multiple nested :keyword:`with` statements had " +"been used with the registered set of callbacks. This even extends to " +"exception handling - if an inner callback suppresses or replaces an " +"exception, then outer callbacks will be passed arguments based on that " +"updated state." +msgstr "" +"Оскільки зареєстровані зворотні виклики викликаються в порядку, зворотному " +"реєстрації, це в кінцевому підсумку поводиться так, ніби декілька вкладених " +"операторів :keyword:`with` використовувалися із зареєстрованим набором " +"зворотних викликів. Це навіть поширюється на обробку винятків - якщо " +"внутрішній зворотний виклик пригнічує або замінює виняток, то зовнішнім " +"зворотним викликам будуть передані аргументи на основі цього оновленого " +"стану." + +msgid "" +"This is a relatively low level API that takes care of the details of " +"correctly unwinding the stack of exit callbacks. It provides a suitable " +"foundation for higher level context managers that manipulate the exit stack " +"in application specific ways." +msgstr "" +"Це API відносно низького рівня, який піклується про деталі правильного " +"розгортання стека зворотних викликів виходу. Він забезпечує відповідну " +"основу для контекстних менеджерів вищого рівня, які маніпулюють стеком " +"виходу у специфічних для програми способах." + +msgid "" +"Enters a new context manager and adds its :meth:`~object.__exit__` method to " +"the callback stack. The return value is the result of the context manager's " +"own :meth:`~object.__enter__` method." +msgstr "" + +msgid "" +"These context managers may suppress exceptions just as they normally would " +"if used directly as part of a :keyword:`with` statement." +msgstr "" +"Ці контекстні менеджери можуть придушувати винятки так само, як вони " +"зазвичай робили б, якщо використовувати безпосередньо як частину оператора :" +"keyword:`with`." + +msgid "" +"Raises :exc:`TypeError` instead of :exc:`AttributeError` if *cm* is not a " +"context manager." +msgstr "" + +msgid "" +"Adds a context manager's :meth:`~object.__exit__` method to the callback " +"stack." +msgstr "" + +msgid "" +"As ``__enter__`` is *not* invoked, this method can be used to cover part of " +"an :meth:`~object.__enter__` implementation with a context manager's own :" +"meth:`~object.__exit__` method." +msgstr "" + +msgid "" +"If passed an object that is not a context manager, this method assumes it is " +"a callback with the same signature as a context manager's :meth:`~object." +"__exit__` method and adds it directly to the callback stack." +msgstr "" + +msgid "" +"By returning true values, these callbacks can suppress exceptions the same " +"way context manager :meth:`~object.__exit__` methods can." +msgstr "" + +msgid "" +"The passed in object is returned from the function, allowing this method to " +"be used as a function decorator." +msgstr "" +"Переданий об’єкт повертається функцією, що дозволяє використовувати цей " +"метод як декоратор функції." + +msgid "" +"Accepts an arbitrary callback function and arguments and adds it to the " +"callback stack." +msgstr "" +"Приймає довільну функцію зворотного виклику та аргументи та додає їх до " +"стеку зворотного виклику." + +msgid "" +"Unlike the other methods, callbacks added this way cannot suppress " +"exceptions (as they are never passed the exception details)." +msgstr "" +"На відміну від інших методів, зворотні виклики, додані таким чином, не " +"можуть придушувати винятки (оскільки їм ніколи не передаються деталі " +"винятку)." + +msgid "" +"The passed in callback is returned from the function, allowing this method " +"to be used as a function decorator." +msgstr "" +"Переданий зворотний виклик повертається функцією, що дозволяє " +"використовувати цей метод як декоратор функції." + +msgid "" +"Transfers the callback stack to a fresh :class:`ExitStack` instance and " +"returns it. No callbacks are invoked by this operation - instead, they will " +"now be invoked when the new stack is closed (either explicitly or implicitly " +"at the end of a :keyword:`with` statement)." +msgstr "" +"Передає стек зворотних викликів до нового екземпляра :class:`ExitStack` і " +"повертає його. Жодні зворотні виклики не викликаються цією операцією - " +"замість цього вони тепер будуть викликані, коли новий стек закривається " +"(явно чи неявно в кінці оператора :keyword:`with`)." + +msgid "" +"For example, a group of files can be opened as an \"all or nothing\" " +"operation as follows::" +msgstr "" +"Наприклад, групу файлів можна відкрити за допомогою операції \"все або " +"нічого\" наступним чином:" + +msgid "" +"with ExitStack() as stack:\n" +" files = [stack.enter_context(open(fname)) for fname in filenames]\n" +" # Hold onto the close method, but don't call it yet.\n" +" close_files = stack.pop_all().close\n" +" # If opening any file fails, all previously opened files will be\n" +" # closed automatically. If all files are opened successfully,\n" +" # they will remain open even after the with statement ends.\n" +" # close_files() can then be invoked explicitly to close them all." +msgstr "" + +msgid "" +"Immediately unwinds the callback stack, invoking callbacks in the reverse " +"order of registration. For any context managers and exit callbacks " +"registered, the arguments passed in will indicate that no exception occurred." +msgstr "" +"Негайно розгортає стек зворотних викликів, викликаючи зворотні виклики в " +"порядку, зворотному реєстрації. Для будь-яких менеджерів контексту та " +"зареєстрованих зворотних викликів виходу передані аргументи вказуватимуть, " +"що винятків не сталося." + +msgid "" +"An :ref:`asynchronous context manager `, similar to :" +"class:`ExitStack`, that supports combining both synchronous and asynchronous " +"context managers, as well as having coroutines for cleanup logic." +msgstr "" +":ref:`асинхронний контекстний менеджер `, подібний " +"до :class:`ExitStack`, який підтримує поєднання синхронних і асинхронних " +"контекстних менеджерів, а також має співпрограми для логіки очищення." + +msgid "" +"The :meth:`~ExitStack.close` method is not implemented; :meth:`aclose` must " +"be used instead." +msgstr "" + +msgid "" +"Similar to :meth:`ExitStack.enter_context` but expects an asynchronous " +"context manager." +msgstr "" + +msgid "" +"Raises :exc:`TypeError` instead of :exc:`AttributeError` if *cm* is not an " +"asynchronous context manager." +msgstr "" + +msgid "" +"Similar to :meth:`ExitStack.push` but expects either an asynchronous context " +"manager or a coroutine function." +msgstr "" + +msgid "Similar to :meth:`ExitStack.callback` but expects a coroutine function." +msgstr "" + +msgid "Similar to :meth:`ExitStack.close` but properly handles awaitables." +msgstr "" + +msgid "Continuing the example for :func:`asynccontextmanager`::" +msgstr "Продовжуємо приклад для :func:`asynccontextmanager`::" + +msgid "" +"async with AsyncExitStack() as stack:\n" +" connections = [await stack.enter_async_context(get_connection())\n" +" for i in range(5)]\n" +" # All opened connections will automatically be released at the end of\n" +" # the async with statement, even if attempts to open a connection\n" +" # later in the list raise an exception." +msgstr "" + +msgid "Examples and Recipes" +msgstr "Приклади та рецепти" + +msgid "" +"This section describes some examples and recipes for making effective use of " +"the tools provided by :mod:`contextlib`." +msgstr "" +"У цьому розділі описано деякі приклади та рецепти ефективного використання " +"інструментів, наданих :mod:`contextlib`." + +msgid "Supporting a variable number of context managers" +msgstr "Підтримка змінної кількості контекстних менеджерів" + +msgid "" +"The primary use case for :class:`ExitStack` is the one given in the class " +"documentation: supporting a variable number of context managers and other " +"cleanup operations in a single :keyword:`with` statement. The variability " +"may come from the number of context managers needed being driven by user " +"input (such as opening a user specified collection of files), or from some " +"of the context managers being optional::" +msgstr "" +"Основний варіант використання :class:`ExitStack` — це той, який наведено в " +"документації класу: підтримка змінної кількості контекстних менеджерів та " +"інших операцій очищення в одному операторі :keyword:`with`. Варіативність " +"може виникати через кількість необхідних менеджерів контексту, які керуються " +"введенням користувача (наприклад, відкриття вказаної користувачем колекції " +"файлів), або через те, що деякі менеджери контексту є необов’язковими:" + +msgid "" +"with ExitStack() as stack:\n" +" for resource in resources:\n" +" stack.enter_context(resource)\n" +" if need_special_resource():\n" +" special = acquire_special_resource()\n" +" stack.callback(release_special_resource, special)\n" +" # Perform operations that use the acquired resources" +msgstr "" + +msgid "" +"As shown, :class:`ExitStack` also makes it quite easy to use :keyword:`with` " +"statements to manage arbitrary resources that don't natively support the " +"context management protocol." +msgstr "" +"Як показано, :class:`ExitStack` також дозволяє досить легко використовувати " +"оператори :keyword:`with` для керування довільними ресурсами, які спочатку " +"не підтримують протокол керування контекстом." + +msgid "Catching exceptions from ``__enter__`` methods" +msgstr "Перехоплення винятків із методів ``__enter__``" + +msgid "" +"It is occasionally desirable to catch exceptions from an ``__enter__`` " +"method implementation, *without* inadvertently catching exceptions from the :" +"keyword:`with` statement body or the context manager's ``__exit__`` method. " +"By using :class:`ExitStack` the steps in the context management protocol can " +"be separated slightly in order to allow this::" +msgstr "" +"Час від часу бажано перехоплювати винятки з реалізації методу ``__enter__``, " +"*без* випадкового перехоплення винятків з тіла оператора :keyword:`with` або " +"методу ``__exit__`` контекстного менеджера. За допомогою :class:`ExitStack` " +"кроки в протоколі керування контекстом можна трохи розділити, щоб дозволити " +"це:" + +msgid "" +"stack = ExitStack()\n" +"try:\n" +" x = stack.enter_context(cm)\n" +"except Exception:\n" +" # handle __enter__ exception\n" +"else:\n" +" with stack:\n" +" # Handle normal case" +msgstr "" + +msgid "" +"Actually needing to do this is likely to indicate that the underlying API " +"should be providing a direct resource management interface for use with :" +"keyword:`try`/:keyword:`except`/:keyword:`finally` statements, but not all " +"APIs are well designed in that regard. When a context manager is the only " +"resource management API provided, then :class:`ExitStack` can make it easier " +"to handle various situations that can't be handled directly in a :keyword:" +"`with` statement." +msgstr "" +"Насправді необхідність зробити це означає, що основний API має надавати " +"інтерфейс прямого керування ресурсами для використання з операторами :" +"keyword:`try`/:keyword:`except`/:keyword:`finally`, але не з усіма API добре " +"розроблені в цьому плані. Коли контекстний менеджер є єдиним наданим API " +"керування ресурсами, тоді :class:`ExitStack` може полегшити обробку " +"різноманітних ситуацій, які не можна обробити безпосередньо в операторі :" +"keyword:`with`." + +msgid "Cleaning up in an ``__enter__`` implementation" +msgstr "Очищення в реалізації ``__enter__``" + +msgid "" +"As noted in the documentation of :meth:`ExitStack.push`, this method can be " +"useful in cleaning up an already allocated resource if later steps in the :" +"meth:`~object.__enter__` implementation fail." +msgstr "" + +msgid "" +"Here's an example of doing this for a context manager that accepts resource " +"acquisition and release functions, along with an optional validation " +"function, and maps them to the context management protocol::" +msgstr "" +"Ось приклад виконання цього для контекстного менеджера, який приймає функції " +"отримання та звільнення ресурсів разом із додатковою функцією перевірки та " +"відображає їх у протоколі керування контекстом::" + +msgid "" +"from contextlib import contextmanager, AbstractContextManager, ExitStack\n" +"\n" +"class ResourceManager(AbstractContextManager):\n" +"\n" +" def __init__(self, acquire_resource, release_resource, " +"check_resource_ok=None):\n" +" self.acquire_resource = acquire_resource\n" +" self.release_resource = release_resource\n" +" if check_resource_ok is None:\n" +" def check_resource_ok(resource):\n" +" return True\n" +" self.check_resource_ok = check_resource_ok\n" +"\n" +" @contextmanager\n" +" def _cleanup_on_error(self):\n" +" with ExitStack() as stack:\n" +" stack.push(self)\n" +" yield\n" +" # The validation check passed and didn't raise an exception\n" +" # Accordingly, we want to keep the resource, and pass it\n" +" # back to our caller\n" +" stack.pop_all()\n" +"\n" +" def __enter__(self):\n" +" resource = self.acquire_resource()\n" +" with self._cleanup_on_error():\n" +" if not self.check_resource_ok(resource):\n" +" msg = \"Failed validation for {!r}\"\n" +" raise RuntimeError(msg.format(resource))\n" +" return resource\n" +"\n" +" def __exit__(self, *exc_details):\n" +" # We don't need to duplicate any of our resource release logic\n" +" self.release_resource()" +msgstr "" + +msgid "Replacing any use of ``try-finally`` and flag variables" +msgstr "Заміна будь-якого використання змінних ``try-finally`` і прапорців" + +msgid "" +"A pattern you will sometimes see is a ``try-finally`` statement with a flag " +"variable to indicate whether or not the body of the ``finally`` clause " +"should be executed. In its simplest form (that can't already be handled just " +"by using an ``except`` clause instead), it looks something like this::" +msgstr "" +"Зразок, який ви іноді побачите, — це інструкція ``try-finally`` зі змінною-" +"прапором, яка вказує, чи має бути виконано тіло пропозиції ``finally``. У " +"своїй найпростішій формі (з якою вже не можна впоратися лише за допомогою " +"пропозиції ``except``), це виглядає приблизно так:" + +msgid "" +"cleanup_needed = True\n" +"try:\n" +" result = perform_operation()\n" +" if result:\n" +" cleanup_needed = False\n" +"finally:\n" +" if cleanup_needed:\n" +" cleanup_resources()" +msgstr "" + +msgid "" +"As with any ``try`` statement based code, this can cause problems for " +"development and review, because the setup code and the cleanup code can end " +"up being separated by arbitrarily long sections of code." +msgstr "" +"Як і у випадку з будь-яким кодом, заснованим на інструкціях ``try``, це може " +"спричинити проблеми з розробкою та переглядом, оскільки код налаштування та " +"код очищення можуть бути розділені довільно довгими частинами коду." + +msgid "" +":class:`ExitStack` makes it possible to instead register a callback for " +"execution at the end of a ``with`` statement, and then later decide to skip " +"executing that callback::" +msgstr "" +":class:`ExitStack` дає змогу замість цього зареєструвати зворотний виклик " +"для виконання в кінці оператора ``with``, а потім вирішити пропустити " +"виконання цього зворотного виклику::" + +msgid "" +"from contextlib import ExitStack\n" +"\n" +"with ExitStack() as stack:\n" +" stack.callback(cleanup_resources)\n" +" result = perform_operation()\n" +" if result:\n" +" stack.pop_all()" +msgstr "" + +msgid "" +"This allows the intended cleanup behaviour to be made explicit up front, " +"rather than requiring a separate flag variable." +msgstr "" + +msgid "" +"If a particular application uses this pattern a lot, it can be simplified " +"even further by means of a small helper class::" +msgstr "" +"Якщо певна програма часто використовує цей шаблон, його можна ще більше " +"спростити за допомогою невеликого допоміжного класу:" + +msgid "" +"from contextlib import ExitStack\n" +"\n" +"class Callback(ExitStack):\n" +" def __init__(self, callback, /, *args, **kwds):\n" +" super().__init__()\n" +" self.callback(callback, *args, **kwds)\n" +"\n" +" def cancel(self):\n" +" self.pop_all()\n" +"\n" +"with Callback(cleanup_resources) as cb:\n" +" result = perform_operation()\n" +" if result:\n" +" cb.cancel()" +msgstr "" + +msgid "" +"If the resource cleanup isn't already neatly bundled into a standalone " +"function, then it is still possible to use the decorator form of :meth:" +"`ExitStack.callback` to declare the resource cleanup in advance::" +msgstr "" +"Якщо очищення ресурсу ще не акуратно об’єднано в окрему функцію, то все ще " +"можна використовувати форму декоратора :meth:`ExitStack.callback`, щоб " +"оголосити очищення ресурсу заздалегідь::" + +msgid "" +"from contextlib import ExitStack\n" +"\n" +"with ExitStack() as stack:\n" +" @stack.callback\n" +" def cleanup_resources():\n" +" ...\n" +" result = perform_operation()\n" +" if result:\n" +" stack.pop_all()" +msgstr "" + +msgid "" +"Due to the way the decorator protocol works, a callback function declared " +"this way cannot take any parameters. Instead, any resources to be released " +"must be accessed as closure variables." +msgstr "" +"Через те, як працює протокол декоратора, функція зворотного виклику, " +"оголошена таким чином, не може приймати жодних параметрів. Натомість доступ " +"до будь-яких ресурсів, які потрібно звільнити, має здійснюватися як змінні " +"закриття." + +msgid "Using a context manager as a function decorator" +msgstr "Використання контекстного менеджера як декоратора функції" + +msgid "" +":class:`ContextDecorator` makes it possible to use a context manager in both " +"an ordinary ``with`` statement and also as a function decorator." +msgstr "" +":class:`ContextDecorator` дає змогу використовувати менеджер контексту як у " +"звичайному операторі ``with``, так і як декоратор функції." + +msgid "" +"For example, it is sometimes useful to wrap functions or groups of " +"statements with a logger that can track the time of entry and time of exit. " +"Rather than writing both a function decorator and a context manager for the " +"task, inheriting from :class:`ContextDecorator` provides both capabilities " +"in a single definition::" +msgstr "" +"Наприклад, іноді корисно обернути функції або групи операторів за допомогою " +"реєстратора, який може відстежувати час входу та час виходу. Замість " +"написання як декоратора функції, так і менеджера контексту для завдання, " +"успадкування від :class:`ContextDecorator` надає обидві можливості в одному " +"визначенні::" + +msgid "" +"from contextlib import ContextDecorator\n" +"import logging\n" +"\n" +"logging.basicConfig(level=logging.INFO)\n" +"\n" +"class track_entry_and_exit(ContextDecorator):\n" +" def __init__(self, name):\n" +" self.name = name\n" +"\n" +" def __enter__(self):\n" +" logging.info('Entering: %s', self.name)\n" +"\n" +" def __exit__(self, exc_type, exc, exc_tb):\n" +" logging.info('Exiting: %s', self.name)" +msgstr "" + +msgid "Instances of this class can be used as both a context manager::" +msgstr "Екземпляри цього класу можна використовувати і як менеджер контексту:" + +msgid "" +"with track_entry_and_exit('widget loader'):\n" +" print('Some time consuming activity goes here')\n" +" load_widget()" +msgstr "" + +msgid "And also as a function decorator::" +msgstr "А також як декоратор функцій::" + +msgid "" +"@track_entry_and_exit('widget loader')\n" +"def activity():\n" +" print('Some time consuming activity goes here')\n" +" load_widget()" +msgstr "" + +msgid "" +"Note that there is one additional limitation when using context managers as " +"function decorators: there's no way to access the return value of :meth:" +"`~object.__enter__`. If that value is needed, then it is still necessary to " +"use an explicit ``with`` statement." +msgstr "" + +msgid ":pep:`343` - The \"with\" statement" +msgstr ":pep:`343` - оператор \"з\"." + +msgid "" +"The specification, background, and examples for the Python :keyword:`with` " +"statement." +msgstr "Специфікація, передумови та приклади оператора Python :keyword:`with`." + +msgid "Single use, reusable and reentrant context managers" +msgstr "" +"Менеджери контексту для одноразового, багаторазового та повторного входу" + +msgid "" +"Most context managers are written in a way that means they can only be used " +"effectively in a :keyword:`with` statement once. These single use context " +"managers must be created afresh each time they're used - attempting to use " +"them a second time will trigger an exception or otherwise not work correctly." +msgstr "" +"Більшість контекстних менеджерів написані таким чином, що вони можуть бути " +"ефективно використані в операторі :keyword:`with` лише один раз. Ці " +"одноразові контекстні менеджери потрібно створювати заново кожного разу, " +"коли вони використовуються — спроба використати їх вдруге призведе до " +"виключення або іншим чином не працюватиме належним чином." + +msgid "" +"This common limitation means that it is generally advisable to create " +"context managers directly in the header of the :keyword:`with` statement " +"where they are used (as shown in all of the usage examples above)." +msgstr "" +"Це загальне обмеження означає, що загалом доцільно створювати менеджери " +"контексту безпосередньо в заголовку оператора :keyword:`with`, де вони " +"використовуються (як показано в усіх наведених вище прикладах використання)." + +msgid "" +"Files are an example of effectively single use context managers, since the " +"first :keyword:`with` statement will close the file, preventing any further " +"IO operations using that file object." +msgstr "" +"Файли є прикладом ефективних одноразових контекстних менеджерів, оскільки " +"перший оператор :keyword:`with` закриває файл, запобігаючи будь-яким " +"подальшим операціям вводу-виводу з використанням цього файлового об’єкта." + +msgid "" +"Context managers created using :func:`contextmanager` are also single use " +"context managers, and will complain about the underlying generator failing " +"to yield if an attempt is made to use them a second time::" +msgstr "" +"Менеджери контексту, створені за допомогою :func:`contextmanager`, також є " +"одноразовими менеджерами контексту, і вони скаржаться на те, що базовий " +"генератор не працює, якщо буде зроблена спроба використати їх вдруге:" + +msgid "" +">>> from contextlib import contextmanager\n" +">>> @contextmanager\n" +"... def singleuse():\n" +"... print(\"Before\")\n" +"... yield\n" +"... print(\"After\")\n" +"...\n" +">>> cm = singleuse()\n" +">>> with cm:\n" +"... pass\n" +"...\n" +"Before\n" +"After\n" +">>> with cm:\n" +"... pass\n" +"...\n" +"Traceback (most recent call last):\n" +" ...\n" +"RuntimeError: generator didn't yield" +msgstr "" + +msgid "Reentrant context managers" +msgstr "Реентерабельні контекстні менеджери" + +msgid "" +"More sophisticated context managers may be \"reentrant\". These context " +"managers can not only be used in multiple :keyword:`with` statements, but " +"may also be used *inside* a :keyword:`!with` statement that is already using " +"the same context manager." +msgstr "" +"Більш складні контекстні менеджери можуть бути \"реентерабельними\". Ці " +"менеджери контексту можна використовувати не лише в кількох операторах :" +"keyword:`with`, але також *всередині* оператора :keyword:`!with`, який уже " +"використовує той самий менеджер контексту." + +msgid "" +":class:`threading.RLock` is an example of a reentrant context manager, as " +"are :func:`suppress`, :func:`redirect_stdout`, and :func:`chdir`. Here's a " +"very simple example of reentrant use::" +msgstr "" + +msgid "" +">>> from contextlib import redirect_stdout\n" +">>> from io import StringIO\n" +">>> stream = StringIO()\n" +">>> write_to_stream = redirect_stdout(stream)\n" +">>> with write_to_stream:\n" +"... print(\"This is written to the stream rather than stdout\")\n" +"... with write_to_stream:\n" +"... print(\"This is also written to the stream\")\n" +"...\n" +">>> print(\"This is written directly to stdout\")\n" +"This is written directly to stdout\n" +">>> print(stream.getvalue())\n" +"This is written to the stream rather than stdout\n" +"This is also written to the stream" +msgstr "" + +msgid "" +"Real world examples of reentrancy are more likely to involve multiple " +"functions calling each other and hence be far more complicated than this " +"example." +msgstr "" +"Приклади повторного входу в реальному світі, швидше за все, включають кілька " +"функцій, які викликають одна одну, і, отже, вони набагато складніші, ніж цей " +"приклад." + +msgid "" +"Note also that being reentrant is *not* the same thing as being thread " +"safe. :func:`redirect_stdout`, for example, is definitely not thread safe, " +"as it makes a global modification to the system state by binding :data:`sys." +"stdout` to a different stream." +msgstr "" +"Зауважте також, що реентерабельність — це *не* те саме, що бути " +"потокобезпечною. :func:`redirect_stdout`, наприклад, точно небезпечний для " +"потоків, оскільки він робить глобальну модифікацію стану системи шляхом " +"прив’язки :data:`sys.stdout` до іншого потоку." + +msgid "Reusable context managers" +msgstr "Багаторазові контекстні менеджери" + +msgid "" +"Distinct from both single use and reentrant context managers are " +"\"reusable\" context managers (or, to be completely explicit, \"reusable, " +"but not reentrant\" context managers, since reentrant context managers are " +"also reusable). These context managers support being used multiple times, " +"but will fail (or otherwise not work correctly) if the specific context " +"manager instance has already been used in a containing with statement." +msgstr "" +"Від одноразових і повторних контекстних менеджерів відрізняються \"повторно " +"використовувані\" контекстні менеджери (або, якщо бути повністю явними, " +"\"повторно використовувані, але не повторні\" контекстні менеджери, оскільки " +"повторні контекстні менеджери також багаторазові). Ці контекстні менеджери " +"підтримують багаторазове використання, але не працюватимуть (або не " +"працюватимуть належним чином), якщо конкретний екземпляр контекстного " +"менеджера вже використовувався в операторі containing with." + +msgid "" +":class:`threading.Lock` is an example of a reusable, but not reentrant, " +"context manager (for a reentrant lock, it is necessary to use :class:" +"`threading.RLock` instead)." +msgstr "" +":class:`threading.Lock` є прикладом повторно використовуваного, але не " +"реентрантного, контекстного менеджера (для повторного вхідного блокування " +"замість цього необхідно використовувати :class:`threading.RLock`)." + +msgid "" +"Another example of a reusable, but not reentrant, context manager is :class:" +"`ExitStack`, as it invokes *all* currently registered callbacks when leaving " +"any with statement, regardless of where those callbacks were added::" +msgstr "" +"Іншим прикладом повторно використовуваного, але не реентрантного " +"контекстного менеджера є :class:`ExitStack`, оскільки він викликає *всі* " +"зареєстровані наразі зворотні виклики, коли залишає будь-який оператор with, " +"незалежно від того, де ці зворотні виклики було додано::" + +msgid "" +">>> from contextlib import ExitStack\n" +">>> stack = ExitStack()\n" +">>> with stack:\n" +"... stack.callback(print, \"Callback: from first context\")\n" +"... print(\"Leaving first context\")\n" +"...\n" +"Leaving first context\n" +"Callback: from first context\n" +">>> with stack:\n" +"... stack.callback(print, \"Callback: from second context\")\n" +"... print(\"Leaving second context\")\n" +"...\n" +"Leaving second context\n" +"Callback: from second context\n" +">>> with stack:\n" +"... stack.callback(print, \"Callback: from outer context\")\n" +"... with stack:\n" +"... stack.callback(print, \"Callback: from inner context\")\n" +"... print(\"Leaving inner context\")\n" +"... print(\"Leaving outer context\")\n" +"...\n" +"Leaving inner context\n" +"Callback: from inner context\n" +"Callback: from outer context\n" +"Leaving outer context" +msgstr "" + +msgid "" +"As the output from the example shows, reusing a single stack object across " +"multiple with statements works correctly, but attempting to nest them will " +"cause the stack to be cleared at the end of the innermost with statement, " +"which is unlikely to be desirable behaviour." +msgstr "" +"Як показує вихід із прикладу, повторне використання одного об’єкта стека в " +"кількох інструкціях with працює правильно, але спроба їх вкладення " +"спричинить очищення стека в кінці внутрішнього оператора with, що навряд чи " +"буде бажаною поведінкою." + +msgid "" +"Using separate :class:`ExitStack` instances instead of reusing a single " +"instance avoids that problem::" +msgstr "" +"Використання окремих екземплярів :class:`ExitStack` замість повторного " +"використання одного екземпляра дозволяє уникнути цієї проблеми:" + +msgid "" +">>> from contextlib import ExitStack\n" +">>> with ExitStack() as outer_stack:\n" +"... outer_stack.callback(print, \"Callback: from outer context\")\n" +"... with ExitStack() as inner_stack:\n" +"... inner_stack.callback(print, \"Callback: from inner context\")\n" +"... print(\"Leaving inner context\")\n" +"... print(\"Leaving outer context\")\n" +"...\n" +"Leaving inner context\n" +"Callback: from inner context\n" +"Leaving outer context\n" +"Callback: from outer context" +msgstr "" diff --git a/library/contextvars.po b/library/contextvars.po new file mode 100644 index 000000000..9fa01f95c --- /dev/null +++ b/library/contextvars.po @@ -0,0 +1,401 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 00:57+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!contextvars` --- Context Variables" +msgstr "" + +msgid "" +"This module provides APIs to manage, store, and access context-local state. " +"The :class:`~contextvars.ContextVar` class is used to declare and work with " +"*Context Variables*. The :func:`~contextvars.copy_context` function and " +"the :class:`~contextvars.Context` class should be used to manage the current " +"context in asynchronous frameworks." +msgstr "" +"Цей модуль надає API для керування, зберігання та доступу до контекстно-" +"локального стану. Клас :class:`~contextvars.ContextVar` використовується для " +"оголошення *контекстних змінних* і роботи з ними. Функцію :func:" +"`~contextvars.copy_context` і клас :class:`~contextvars.Context` слід " +"використовувати для керування поточним контекстом в асинхронних структурах." + +msgid "" +"Context managers that have state should use Context Variables instead of :" +"func:`threading.local` to prevent their state from bleeding to other code " +"unexpectedly, when used in concurrent code." +msgstr "" + +msgid "See also :pep:`567` for additional details." +msgstr "Дивіться також :pep:`567` для отримання додаткової інформації." + +msgid "Context Variables" +msgstr "Контекстні змінні" + +msgid "This class is used to declare a new Context Variable, e.g.::" +msgstr "" +"Цей клас використовується для оголошення нової змінної контексту, наприклад::" + +msgid "var: ContextVar[int] = ContextVar('var', default=42)" +msgstr "" + +msgid "" +"The required *name* parameter is used for introspection and debug purposes." +msgstr "" +"Необхідний параметр *name* використовується для самоаналізу та налагодження." + +msgid "" +"The optional keyword-only *default* parameter is returned by :meth:" +"`ContextVar.get` when no value for the variable is found in the current " +"context." +msgstr "" +"Необов’язковий параметр *default*, що містить лише ключове слово, " +"повертається :meth:`ContextVar.get`, якщо значення для змінної не знайдено в " +"поточному контексті." + +msgid "" +"**Important:** Context Variables should be created at the top module level " +"and never in closures. :class:`Context` objects hold strong references to " +"context variables which prevents context variables from being properly " +"garbage collected." +msgstr "" +"**Важливо:** Змінні контексту слід створювати на верхньому рівні модуля, а " +"не в закриттях. Об’єкти :class:`Context` містять сильні посилання на змінні " +"контексту, що перешкоджає правильному збиранню сміття змінним контексту." + +msgid "The name of the variable. This is a read-only property." +msgstr "Ім'я змінної. Це властивість лише для читання." + +msgid "Return a value for the context variable for the current context." +msgstr "Повертає значення контекстної змінної для поточного контексту." + +msgid "" +"If there is no value for the variable in the current context, the method " +"will:" +msgstr "Якщо для змінної немає значення в поточному контексті, метод:" + +msgid "" +"return the value of the *default* argument of the method, if provided; or" +msgstr "повертає значення аргументу *default* методу, якщо він надається; або" + +msgid "" +"return the default value for the context variable, if it was created with " +"one; or" +msgstr "" +"повертає значення за замовчуванням для контекстної змінної, якщо вона була " +"створена за допомогою такої; або" + +msgid "raise a :exc:`LookupError`." +msgstr "викликає :exc:`LookupError`." + +msgid "" +"Call to set a new value for the context variable in the current context." +msgstr "" +"Виклик, щоб встановити нове значення для контекстної змінної в поточному " +"контексті." + +msgid "" +"The required *value* argument is the new value for the context variable." +msgstr "" +"Обов’язковий аргумент *значення* — це нове значення для контекстної змінної." + +msgid "" +"Returns a :class:`~contextvars.Token` object that can be used to restore the " +"variable to its previous value via the :meth:`ContextVar.reset` method." +msgstr "" +"Повертає об’єкт :class:`~contextvars.Token`, який можна використовувати для " +"відновлення попереднього значення змінної за допомогою методу :meth:" +"`ContextVar.reset`." + +msgid "" +"Reset the context variable to the value it had before the :meth:`ContextVar." +"set` that created the *token* was used." +msgstr "" +"Скиньте контекстну змінну до значення, яке воно мало до використання :meth:" +"`ContextVar.set`, який створив *токен*." + +msgid "For example::" +msgstr "Наприклад::" + +msgid "" +"var = ContextVar('var')\n" +"\n" +"token = var.set('new value')\n" +"# code that uses 'var'; var.get() returns 'new value'.\n" +"var.reset(token)\n" +"\n" +"# After the reset call the var has no value again, so\n" +"# var.get() would raise a LookupError." +msgstr "" + +msgid "" +"*Token* objects are returned by the :meth:`ContextVar.set` method. They can " +"be passed to the :meth:`ContextVar.reset` method to revert the value of the " +"variable to what it was before the corresponding *set*." +msgstr "" +"Об’єкти *Token* повертаються методом :meth:`ContextVar.set`. Їх можна " +"передати в метод :meth:`ContextVar.reset`, щоб повернути значення змінної до " +"того, яким воно було до відповідного *set*." + +msgid "" +"A read-only property. Points to the :class:`ContextVar` object that created " +"the token." +msgstr "" +"Властивість лише для читання. Вказує на об’єкт :class:`ContextVar`, який " +"створив маркер." + +msgid "" +"A read-only property. Set to the value the variable had before the :meth:" +"`ContextVar.set` method call that created the token. It points to :attr:" +"`Token.MISSING` if the variable was not set before the call." +msgstr "" + +msgid "A marker object used by :attr:`Token.old_value`." +msgstr "Об’єкт-маркер, який використовується :attr:`Token.old_value`." + +msgid "Manual Context Management" +msgstr "Ручне керування контекстом" + +msgid "Returns a copy of the current :class:`~contextvars.Context` object." +msgstr "Повертає копію поточного об’єкта :class:`~contextvars.Context`." + +msgid "" +"The following snippet gets a copy of the current context and prints all " +"variables and their values that are set in it::" +msgstr "" +"Наступний фрагмент коду отримує копію поточного контексту та друкує всі " +"змінні та їхні значення, встановлені в ньому:" + +msgid "" +"ctx: Context = copy_context()\n" +"print(list(ctx.items()))" +msgstr "" + +msgid "" +"The function has an *O*\\ (1) complexity, i.e. works equally fast for " +"contexts with a few context variables and for contexts that have a lot of " +"them." +msgstr "" + +msgid "A mapping of :class:`ContextVars ` to their values." +msgstr "Відображення :class:`ContextVars ` на їхні значення." + +msgid "" +"``Context()`` creates an empty context with no values in it. To get a copy " +"of the current context use the :func:`~contextvars.copy_context` function." +msgstr "" +"``Context()`` створює порожній контекст без значень у ньому. Щоб отримати " +"копію поточного контексту, використовуйте функцію :func:`~contextvars." +"copy_context`." + +msgid "" +"Each thread has its own effective stack of :class:`!Context` objects. The :" +"term:`current context` is the :class:`!Context` object at the top of the " +"current thread's stack. All :class:`!Context` objects in the stacks are " +"considered to be *entered*." +msgstr "" + +msgid "" +"*Entering* a context, which can be done by calling its :meth:`~Context.run` " +"method, makes the context the current context by pushing it onto the top of " +"the current thread's context stack." +msgstr "" + +msgid "" +"*Exiting* from the current context, which can be done by returning from the " +"callback passed to the :meth:`~Context.run` method, restores the current " +"context to what it was before the context was entered by popping the context " +"off the top of the context stack." +msgstr "" + +msgid "" +"Since each thread has its own context stack, :class:`ContextVar` objects " +"behave in a similar fashion to :func:`threading.local` when values are " +"assigned in different threads." +msgstr "" + +msgid "" +"Attempting to enter an already entered context, including contexts entered " +"in other threads, raises a :exc:`RuntimeError`." +msgstr "" + +msgid "After exiting a context, it can later be re-entered (from any thread)." +msgstr "" + +msgid "" +"Any changes to :class:`ContextVar` values via the :meth:`ContextVar.set` " +"method are recorded in the current context. The :meth:`ContextVar.get` " +"method returns the value associated with the current context. Exiting a " +"context effectively reverts any changes made to context variables while the " +"context was entered (if needed, the values can be restored by re-entering " +"the context)." +msgstr "" + +msgid "Context implements the :class:`collections.abc.Mapping` interface." +msgstr "Context реалізує інтерфейс :class:`collections.abc.Mapping`." + +msgid "" +"Enters the Context, executes ``callable(*args, **kwargs)``, then exits the " +"Context. Returns *callable*'s return value, or propagates an exception if " +"one occurred." +msgstr "" + +msgid "Example:" +msgstr "приклад:" + +msgid "" +"import contextvars\n" +"\n" +"var = contextvars.ContextVar('var')\n" +"var.set('spam')\n" +"print(var.get()) # 'spam'\n" +"\n" +"ctx = contextvars.copy_context()\n" +"\n" +"def main():\n" +" # 'var' was set to 'spam' before\n" +" # calling 'copy_context()' and 'ctx.run(main)', so:\n" +" print(var.get()) # 'spam'\n" +" print(ctx[var]) # 'spam'\n" +"\n" +" var.set('ham')\n" +"\n" +" # Now, after setting 'var' to 'ham':\n" +" print(var.get()) # 'ham'\n" +" print(ctx[var]) # 'ham'\n" +"\n" +"# Any changes that the 'main' function makes to 'var'\n" +"# will be contained in 'ctx'.\n" +"ctx.run(main)\n" +"\n" +"# The 'main()' function was run in the 'ctx' context,\n" +"# so changes to 'var' are contained in it:\n" +"print(ctx[var]) # 'ham'\n" +"\n" +"# However, outside of 'ctx', 'var' is still set to 'spam':\n" +"print(var.get()) # 'spam'" +msgstr "" + +msgid "Return a shallow copy of the context object." +msgstr "Повертає поверхневу копію об’єкта контексту." + +msgid "" +"Return ``True`` if the *context* has a value for *var* set; return ``False`` " +"otherwise." +msgstr "" +"Повертає ``True``, якщо *контекст* має встановлене значення *var*; інакше " +"поверніть ``False``." + +msgid "" +"Return the value of the *var* :class:`ContextVar` variable. If the variable " +"is not set in the context object, a :exc:`KeyError` is raised." +msgstr "" +"Повертає значення змінної *var* :class:`ContextVar`. Якщо змінна не " +"встановлена в об’єкті контексту, виникає :exc:`KeyError`." + +msgid "" +"Return the value for *var* if *var* has the value in the context object. " +"Return *default* otherwise. If *default* is not given, return ``None``." +msgstr "" +"Повертає значення для *var*, якщо *var* має значення в об’єкті контексту. " +"Повернути *за замовчуванням* інакше. Якщо *default* не вказано, поверніть " +"``None``." + +msgid "Return an iterator over the variables stored in the context object." +msgstr "Повертає ітератор над змінними, що зберігаються в об’єкті контексту." + +msgid "Return the number of variables set in the context object." +msgstr "Повертає кількість змінних, встановлених в об’єкті контексту." + +msgid "Return a list of all variables in the context object." +msgstr "Повертає список усіх змінних в об’єкті контексту." + +msgid "Return a list of all variables' values in the context object." +msgstr "Повертає список усіх значень змінних в об’єкті контексту." + +msgid "" +"Return a list of 2-tuples containing all variables and their values in the " +"context object." +msgstr "" +"Повертає список 2-кортежів, що містить усі змінні та їхні значення в " +"контекстному об’єкті." + +msgid "asyncio support" +msgstr "підтримка asyncio" + +msgid "" +"Context variables are natively supported in :mod:`asyncio` and are ready to " +"be used without any extra configuration. For example, here is a simple echo " +"server, that uses a context variable to make the address of a remote client " +"available in the Task that handles that client::" +msgstr "" +"Контекстні змінні підтримуються в :mod:`asyncio` і готові до використання " +"без додаткового налаштування. Наприклад, ось простий ехо-сервер, який " +"використовує контекстну змінну, щоб зробити адресу віддаленого клієнта " +"доступною в Завданні, яке обробляє цього клієнта:" + +msgid "" +"import asyncio\n" +"import contextvars\n" +"\n" +"client_addr_var = contextvars.ContextVar('client_addr')\n" +"\n" +"def render_goodbye():\n" +" # The address of the currently handled client can be accessed\n" +" # without passing it explicitly to this function.\n" +"\n" +" client_addr = client_addr_var.get()\n" +" return f'Good bye, client @ {client_addr}\\r\\n'.encode()\n" +"\n" +"async def handle_request(reader, writer):\n" +" addr = writer.transport.get_extra_info('socket').getpeername()\n" +" client_addr_var.set(addr)\n" +"\n" +" # In any code that we call is now possible to get\n" +" # client's address by calling 'client_addr_var.get()'.\n" +"\n" +" while True:\n" +" line = await reader.readline()\n" +" print(line)\n" +" if not line.strip():\n" +" break\n" +"\n" +" writer.write(b'HTTP/1.1 200 OK\\r\\n') # status line\n" +" writer.write(b'\\r\\n') # headers\n" +" writer.write(render_goodbye()) # body\n" +" writer.close()\n" +"\n" +"async def main():\n" +" srv = await asyncio.start_server(\n" +" handle_request, '127.0.0.1', 8081)\n" +"\n" +" async with srv:\n" +" await srv.serve_forever()\n" +"\n" +"asyncio.run(main())\n" +"\n" +"# To test it you can use telnet or curl:\n" +"# telnet 127.0.0.1 8081\n" +"# curl 127.0.0.1:8081" +msgstr "" diff --git a/library/copy.po b/library/copy.po new file mode 100644 index 000000000..2a04f71c5 --- /dev/null +++ b/library/copy.po @@ -0,0 +1,210 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2023 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 01:03+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2023\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!copy` --- Shallow and deep copy operations" +msgstr "" + +msgid "**Source code:** :source:`Lib/copy.py`" +msgstr "**Вихідний код:** :source:`Lib/copy.py`" + +msgid "" +"Assignment statements in Python do not copy objects, they create bindings " +"between a target and an object. For collections that are mutable or contain " +"mutable items, a copy is sometimes needed so one can change one copy without " +"changing the other. This module provides generic shallow and deep copy " +"operations (explained below)." +msgstr "" +"Оператори присвоєння в Python не копіюють об’єкти, вони створюють прив’язки " +"між метою та об’єктом. Для колекцій, які є змінними або містять змінні " +"елементи, іноді потрібна копія, щоб можна було змінити одну копію, не " +"змінюючи іншу. Цей модуль забезпечує загальні операції поверхневого та " +"глибокого копіювання (пояснення нижче)." + +msgid "Interface summary:" +msgstr "Короткий опис інтерфейсу:" + +msgid "Return a shallow copy of *obj*." +msgstr "" + +msgid "Return a deep copy of *obj*." +msgstr "" + +msgid "" +"Creates a new object of the same type as *obj*, replacing fields with values " +"from *changes*." +msgstr "" + +msgid "Raised for module specific errors." +msgstr "Піднято для конкретних помилок модуля." + +msgid "" +"The difference between shallow and deep copying is only relevant for " +"compound objects (objects that contain other objects, like lists or class " +"instances):" +msgstr "" +"Різниця між поверхневим і глибоким копіюванням актуальна лише для складених " +"об’єктів (об’єктів, які містять інші об’єкти, наприклад списки чи екземпляри " +"класу):" + +msgid "" +"A *shallow copy* constructs a new compound object and then (to the extent " +"possible) inserts *references* into it to the objects found in the original." +msgstr "" +"*Неглибока копія* створює новий складений об’єкт, а потім (наскільки це " +"можливо) вставляє в нього *посилання* на об’єкти, знайдені в оригіналі." + +msgid "" +"A *deep copy* constructs a new compound object and then, recursively, " +"inserts *copies* into it of the objects found in the original." +msgstr "" +"*Глибока копія* створює новий складений об’єкт, а потім рекурсивно вставляє " +"в нього *копії* об’єктів, знайдених в оригіналі." + +msgid "" +"Two problems often exist with deep copy operations that don't exist with " +"shallow copy operations:" +msgstr "" +"З операціями глибокого копіювання часто існують дві проблеми, яких немає з " +"операціями поверхневого копіювання:" + +msgid "" +"Recursive objects (compound objects that, directly or indirectly, contain a " +"reference to themselves) may cause a recursive loop." +msgstr "" +"Рекурсивні об’єкти (складені об’єкти, які прямо чи опосередковано містять " +"посилання на себе) можуть спричинити рекурсивний цикл." + +msgid "" +"Because deep copy copies everything it may copy too much, such as data which " +"is intended to be shared between copies." +msgstr "" +"Оскільки глибока копія копіює все, що може скопіювати занадто багато, " +"наприклад дані, які призначені для спільного використання між копіями." + +msgid "The :func:`deepcopy` function avoids these problems by:" +msgstr "Функція :func:`deepcopy` дозволяє уникнути цих проблем за допомогою:" + +msgid "" +"keeping a ``memo`` dictionary of objects already copied during the current " +"copying pass; and" +msgstr "" +"ведення словника ``memo`` об'єктів, уже скопійованих під час поточного " +"проходу копіювання; і" + +msgid "" +"letting user-defined classes override the copying operation or the set of " +"components copied." +msgstr "" +"дозволяючи визначеним користувачем класам перевизначати операцію копіювання " +"або набір скопійованих компонентів." + +msgid "" +"This module does not copy types like module, method, stack trace, stack " +"frame, file, socket, window, or any similar types. It does \"copy\" " +"functions and classes (shallow and deeply), by returning the original object " +"unchanged; this is compatible with the way these are treated by the :mod:" +"`pickle` module." +msgstr "" +"Цей модуль не копіює такі типи, як модуль, метод, трасування стека, фрейм " +"стека, файл, сокет, вікно або будь-які подібні типи. Він \"копіює\" функції " +"та класи (неглибокі та глибокі), повертаючи вихідний об’єкт без змін; це " +"сумісно з тим, як вони обробляються модулем :mod:`pickle`." + +msgid "" +"Shallow copies of dictionaries can be made using :meth:`dict.copy`, and of " +"lists by assigning a slice of the entire list, for example, ``copied_list = " +"original_list[:]``." +msgstr "" +"Неглибокі копії словників можна зробити за допомогою :meth:`dict.copy`, а " +"списків — шляхом призначення частини всього списку, наприклад, ``copied_list " +"= original_list[:]``." + +msgid "" +"Classes can use the same interfaces to control copying that they use to " +"control pickling. See the description of module :mod:`pickle` for " +"information on these methods. In fact, the :mod:`copy` module uses the " +"registered pickle functions from the :mod:`copyreg` module." +msgstr "" +"Класи можуть використовувати ті самі інтерфейси для керування копіюванням, " +"які вони використовують для керування травленням. Перегляньте опис модуля :" +"mod:`pickle` для отримання інформації про ці методи. Фактично, модуль :mod:" +"`copy` використовує зареєстровані функції pickle з модуля :mod:`copyreg`." + +msgid "" +"In order for a class to define its own copy implementation, it can define " +"special methods :meth:`~object.__copy__` and :meth:`~object.__deepcopy__`." +msgstr "" + +msgid "" +"Called to implement the shallow copy operation; no additional arguments are " +"passed." +msgstr "" + +msgid "" +"Called to implement the deep copy operation; it is passed one argument, the " +"*memo* dictionary. If the ``__deepcopy__`` implementation needs to make a " +"deep copy of a component, it should call the :func:`~copy.deepcopy` function " +"with the component as first argument and the *memo* dictionary as second " +"argument. The *memo* dictionary should be treated as an opaque object." +msgstr "" + +msgid "" +"Function :func:`!copy.replace` is more limited than :func:`~copy.copy` and :" +"func:`~copy.deepcopy`, and only supports named tuples created by :func:" +"`~collections.namedtuple`, :mod:`dataclasses`, and other classes which " +"define method :meth:`~object.__replace__`." +msgstr "" + +msgid "" +"This method should create a new object of the same type, replacing fields " +"with values from *changes*." +msgstr "" + +msgid "Module :mod:`pickle`" +msgstr "Модуль :mod:`pickle`" + +msgid "" +"Discussion of the special methods used to support object state retrieval and " +"restoration." +msgstr "" +"Обговорення спеціальних методів, які використовуються для підтримки пошуку " +"та відновлення стану об'єкта." + +msgid "module" +msgstr "модуль" + +msgid "pickle" +msgstr "маринований огірок" + +msgid "__copy__() (copy protocol)" +msgstr "" + +msgid "__deepcopy__() (copy protocol)" +msgstr "" + +msgid "__replace__() (replace protocol)" +msgstr "" diff --git a/library/copyreg.po b/library/copyreg.po new file mode 100644 index 000000000..89b2726f9 --- /dev/null +++ b/library/copyreg.po @@ -0,0 +1,90 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2023 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 01:03+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2023\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!copyreg` --- Register :mod:`!pickle` support functions" +msgstr "" + +msgid "**Source code:** :source:`Lib/copyreg.py`" +msgstr "**Вихідний код:** :source:`Lib/copyreg.py`" + +msgid "" +"The :mod:`copyreg` module offers a way to define functions used while " +"pickling specific objects. The :mod:`pickle` and :mod:`copy` modules use " +"those functions when pickling/copying those objects. The module provides " +"configuration information about object constructors which are not classes. " +"Such constructors may be factory functions or class instances." +msgstr "" +"Модуль :mod:`copyreg` пропонує спосіб визначення функцій, які " +"використовуються під час маринування конкретних об’єктів. Модулі :mod:" +"`pickle` і :mod:`copy` використовують ці функції під час маринування/" +"копіювання цих об’єктів. Модуль надає конфігураційну інформацію про " +"конструктори об’єктів, які не є класами. Такими конструкторами можуть бути " +"фабричні функції або екземпляри класу." + +msgid "" +"Declares *object* to be a valid constructor. If *object* is not callable " +"(and hence not valid as a constructor), raises :exc:`TypeError`." +msgstr "" +"Оголошує *object* як дійсний конструктор. Якщо *object* не можна викликати " +"(і, отже, недійсний як конструктор), викликає :exc:`TypeError`." + +msgid "" +"Declares that *function* should be used as a \"reduction\" function for " +"objects of type *type*. *function* must return either a string or a tuple " +"containing between two and six elements. See the :attr:`~pickle.Pickler." +"dispatch_table` for more details on the interface of *function*." +msgstr "" + +msgid "" +"The *constructor_ob* parameter is a legacy feature and is now ignored, but " +"if passed it must be a callable." +msgstr "" + +msgid "" +"Note that the :attr:`~pickle.Pickler.dispatch_table` attribute of a pickler " +"object or subclass of :class:`pickle.Pickler` can also be used for declaring " +"reduction functions." +msgstr "" + +msgid "Example" +msgstr "приклад" + +msgid "" +"The example below would like to show how to register a pickle function and " +"how it will be used:" +msgstr "" +"Наведений нижче приклад показує, як зареєструвати функцію pickle і як вона " +"буде використовуватися:" + +msgid "module" +msgstr "модуль" + +msgid "pickle" +msgstr "маринований огірок" + +msgid "copy" +msgstr "" diff --git a/library/crypt.po b/library/crypt.po new file mode 100644 index 000000000..c0c78a2e2 --- /dev/null +++ b/library/crypt.po @@ -0,0 +1,43 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2024-11-19 01:02+0000\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!crypt` --- Function to check Unix passwords" +msgstr "" + +msgid "" +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." +msgstr "" + +msgid "" +"Applications can use the :mod:`hashlib` module from the standard library. " +"Other possible replacements are third-party libraries from PyPI: :pypi:" +"`legacycrypt`, :pypi:`bcrypt`, :pypi:`argon2-cffi`, or :pypi:`passlib`. " +"These are not supported or maintained by the Python core team." +msgstr "" + +msgid "" +"The last version of Python that provided the :mod:`!crypt` module was " +"`Python 3.12 `_." +msgstr "" diff --git a/library/crypto.po b/library/crypto.po new file mode 100644 index 000000000..9abe9dca7 --- /dev/null +++ b/library/crypto.po @@ -0,0 +1,38 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 01:03+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Cryptographic Services" +msgstr "Криптографічні послуги" + +msgid "" +"The modules described in this chapter implement various algorithms of a " +"cryptographic nature. They are available at the discretion of the " +"installation. Here's an overview:" +msgstr "" + +msgid "cryptography" +msgstr "" diff --git a/library/csv.po b/library/csv.po new file mode 100644 index 000000000..074826401 --- /dev/null +++ b/library/csv.po @@ -0,0 +1,823 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2023 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 01:03+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2023\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!csv` --- CSV File Reading and Writing" +msgstr "" + +msgid "**Source code:** :source:`Lib/csv.py`" +msgstr "**Вихідний код:** :source:`Lib/csv.py`" + +msgid "" +"The so-called CSV (Comma Separated Values) format is the most common import " +"and export format for spreadsheets and databases. CSV format was used for " +"many years prior to attempts to describe the format in a standardized way " +"in :rfc:`4180`. The lack of a well-defined standard means that subtle " +"differences often exist in the data produced and consumed by different " +"applications. These differences can make it annoying to process CSV files " +"from multiple sources. Still, while the delimiters and quoting characters " +"vary, the overall format is similar enough that it is possible to write a " +"single module which can efficiently manipulate such data, hiding the details " +"of reading and writing the data from the programmer." +msgstr "" +"Так званий формат CSV (значення, розділені комами) є найпоширенішим форматом " +"імпорту та експорту для електронних таблиць і баз даних. Формат CSV " +"використовувався протягом багатьох років до того, як його спробували описати " +"стандартизованим способом у :rfc:`4180`. Відсутність чітко визначеного " +"стандарту означає, що часто існують тонкі відмінності в даних, які " +"створюються та споживаються різними програмами. Ці відмінності можуть " +"дратувати обробку файлів CSV із кількох джерел. Тим не менш, хоча " +"розділювачі та символи лапок відрізняються, загальний формат досить схожий, " +"щоб можна було написати один модуль, який може ефективно маніпулювати такими " +"даними, приховуючи деталі читання та запису даних від програміста." + +msgid "" +"The :mod:`csv` module implements classes to read and write tabular data in " +"CSV format. It allows programmers to say, \"write this data in the format " +"preferred by Excel,\" or \"read data from this file which was generated by " +"Excel,\" without knowing the precise details of the CSV format used by " +"Excel. Programmers can also describe the CSV formats understood by other " +"applications or define their own special-purpose CSV formats." +msgstr "" +"Модуль :mod:`csv` реалізує класи для читання та запису табличних даних у " +"форматі CSV. Це дозволяє програмістам сказати: \"записати ці дані у форматі, " +"який віддає перевагу Excel\" або \"прочитати дані з цього файлу, створеного " +"Excel\", не знаючи точних деталей формату CSV, який використовує Excel. " +"Програмісти також можуть описувати формати CSV, які розуміють інші програми, " +"або визначати власні формати CSV спеціального призначення." + +msgid "" +"The :mod:`csv` module's :class:`reader` and :class:`writer` objects read and " +"write sequences. Programmers can also read and write data in dictionary " +"form using the :class:`DictReader` and :class:`DictWriter` classes." +msgstr "" +"Об’єкти :class:`reader` і :class:`writer` модуля :mod:`csv` читають і " +"записують послідовності. Програмісти також можуть читати та записувати дані " +"у формі словника за допомогою класів :class:`DictReader` і :class:" +"`DictWriter`." + +msgid ":pep:`305` - CSV File API" +msgstr ":pep:`305` - API файлів CSV" + +msgid "The Python Enhancement Proposal which proposed this addition to Python." +msgstr "Пропозиція вдосконалення Python, яка пропонує це доповнення до Python." + +msgid "Module Contents" +msgstr "Зміст модуля" + +msgid "The :mod:`csv` module defines the following functions:" +msgstr "Модуль :mod:`csv` визначає такі функції:" + +msgid "" +"Return a :ref:`reader object ` that will process lines from " +"the given *csvfile*. A csvfile must be an iterable of strings, each in the " +"reader's defined csv format. A csvfile is most commonly a file-like object " +"or list. If *csvfile* is a file object, it should be opened with " +"``newline=''``. [1]_ An optional *dialect* parameter can be given which is " +"used to define a set of parameters specific to a particular CSV dialect. It " +"may be an instance of a subclass of the :class:`Dialect` class or one of the " +"strings returned by the :func:`list_dialects` function. The other optional " +"*fmtparams* keyword arguments can be given to override individual formatting " +"parameters in the current dialect. For full details about the dialect and " +"formatting parameters, see section :ref:`csv-fmt-params`." +msgstr "" + +msgid "" +"Each row read from the csv file is returned as a list of strings. No " +"automatic data type conversion is performed unless the ``QUOTE_NONNUMERIC`` " +"format option is specified (in which case unquoted fields are transformed " +"into floats)." +msgstr "" +"Кожен рядок, прочитаний із файлу csv, повертається як список рядків. " +"Автоматичне перетворення типу даних не виконується, якщо не вказано параметр " +"формату ``QUOTE_NONNUMERIC`` (у цьому випадку поля без лапок перетворюються " +"на числа з плаваючою точкою)." + +msgid "A short usage example::" +msgstr "Короткий приклад використання::" + +msgid "" +">>> import csv\n" +">>> with open('eggs.csv', newline='') as csvfile:\n" +"... spamreader = csv.reader(csvfile, delimiter=' ', quotechar='|')\n" +"... for row in spamreader:\n" +"... print(', '.join(row))\n" +"Spam, Spam, Spam, Spam, Spam, Baked Beans\n" +"Spam, Lovely Spam, Wonderful Spam" +msgstr "" + +msgid "" +"Return a writer object responsible for converting the user's data into " +"delimited strings on the given file-like object. *csvfile* can be any " +"object with a :meth:`~io.TextIOBase.write` method. If *csvfile* is a file " +"object, it should be opened with ``newline=''`` [1]_. An optional *dialect* " +"parameter can be given which is used to define a set of parameters specific " +"to a particular CSV dialect. It may be an instance of a subclass of the :" +"class:`Dialect` class or one of the strings returned by the :func:" +"`list_dialects` function. The other optional *fmtparams* keyword arguments " +"can be given to override individual formatting parameters in the current " +"dialect. For full details about dialects and formatting parameters, see " +"the :ref:`csv-fmt-params` section. To make it as easy as possible to " +"interface with modules which implement the DB API, the value :const:`None` " +"is written as the empty string. While this isn't a reversible " +"transformation, it makes it easier to dump SQL NULL data values to CSV files " +"without preprocessing the data returned from a ``cursor.fetch*`` call. All " +"other non-string data are stringified with :func:`str` before being written." +msgstr "" + +msgid "" +"import csv\n" +"with open('eggs.csv', 'w', newline='') as csvfile:\n" +" spamwriter = csv.writer(csvfile, delimiter=' ',\n" +" quotechar='|', quoting=csv.QUOTE_MINIMAL)\n" +" spamwriter.writerow(['Spam'] * 5 + ['Baked Beans'])\n" +" spamwriter.writerow(['Spam', 'Lovely Spam', 'Wonderful Spam'])" +msgstr "" + +msgid "" +"Associate *dialect* with *name*. *name* must be a string. The dialect can " +"be specified either by passing a sub-class of :class:`Dialect`, or by " +"*fmtparams* keyword arguments, or both, with keyword arguments overriding " +"parameters of the dialect. For full details about dialects and formatting " +"parameters, see section :ref:`csv-fmt-params`." +msgstr "" +"Пов’яжіть *діалект* з *ім’ям*. *ім’я* має бути рядком. Діалект можна вказати " +"або шляхом передачі підкласу :class:`Dialect`, або за допомогою аргументів " +"ключового слова *fmtparams*, або обох, причому аргументи ключового слова " +"замінюють параметри діалекту. Щоб отримати повну інформацію про діалекти та " +"параметри форматування, перегляньте розділ :ref:`csv-fmt-params`." + +msgid "" +"Delete the dialect associated with *name* from the dialect registry. An :" +"exc:`Error` is raised if *name* is not a registered dialect name." +msgstr "" +"Видаліть діалект, пов’язаний з *name*, із реєстру діалектів. Якщо *name* не " +"є зареєстрованою назвою діалекту, виникає помилка :exc:`Error`." + +msgid "" +"Return the dialect associated with *name*. An :exc:`Error` is raised if " +"*name* is not a registered dialect name. This function returns an " +"immutable :class:`Dialect`." +msgstr "" +"Повертає діалект, пов’язаний з *ім’ям*. Якщо *name* не є зареєстрованою " +"назвою діалекту, виникає помилка :exc:`Error`. Ця функція повертає " +"незмінний :class:`Dialect`." + +msgid "Return the names of all registered dialects." +msgstr "Повернути назви всіх зареєстрованих діалектів." + +msgid "" +"Returns the current maximum field size allowed by the parser. If *new_limit* " +"is given, this becomes the new limit." +msgstr "" +"Повертає поточний максимальний розмір поля, дозволений аналізатором. Якщо " +"задано *new_limit*, це стає новим лімітом." + +msgid "The :mod:`csv` module defines the following classes:" +msgstr "Модуль :mod:`csv` визначає такі класи:" + +msgid "" +"Create an object that operates like a regular reader but maps the " +"information in each row to a :class:`dict` whose keys are given by the " +"optional *fieldnames* parameter." +msgstr "" +"Створіть об’єкт, який працює як звичайний читач, але зіставляє інформацію в " +"кожному рядку з :class:`dict`, ключі якого надаються необов’язковим " +"параметром *fieldnames*." + +msgid "" +"The *fieldnames* parameter is a :term:`sequence`. If *fieldnames* is " +"omitted, the values in the first row of file *f* will be used as the " +"fieldnames and will be omitted from the results. If *fieldnames* is " +"provided, they will be used and the first row will be included in the " +"results. Regardless of how the fieldnames are determined, the dictionary " +"preserves their original ordering." +msgstr "" + +msgid "" +"If a row has more fields than fieldnames, the remaining data is put in a " +"list and stored with the fieldname specified by *restkey* (which defaults to " +"``None``). If a non-blank row has fewer fields than fieldnames, the missing " +"values are filled-in with the value of *restval* (which defaults to " +"``None``)." +msgstr "" +"Якщо рядок містить більше полів, ніж назв полів, дані, що залишилися, " +"поміщаються в список і зберігаються з іменем поля, визначеним *restkey* (за " +"замовчуванням значення \"Немає\"). Якщо непорожній рядок містить менше " +"полів, ніж імена полів, відсутні значення заповнюються значенням *restval* " +"(яке за замовчуванням ``None``)." + +msgid "" +"All other optional or keyword arguments are passed to the underlying :class:" +"`reader` instance." +msgstr "" +"Усі інші необов’язкові або ключові аргументи передаються базовому " +"екземпляру :class:`reader`." + +msgid "" +"If the argument passed to *fieldnames* is an iterator, it will be coerced to " +"a :class:`list`." +msgstr "" + +msgid "Returned rows are now of type :class:`OrderedDict`." +msgstr "Повернені рядки тепер мають тип :class:`OrderedDict`." + +msgid "Returned rows are now of type :class:`dict`." +msgstr "Повернені рядки тепер мають тип :class:`dict`." + +msgid "" +">>> import csv\n" +">>> with open('names.csv', newline='') as csvfile:\n" +"... reader = csv.DictReader(csvfile)\n" +"... for row in reader:\n" +"... print(row['first_name'], row['last_name'])\n" +"...\n" +"Eric Idle\n" +"John Cleese\n" +"\n" +">>> print(row)\n" +"{'first_name': 'John', 'last_name': 'Cleese'}" +msgstr "" + +msgid "" +"Create an object which operates like a regular writer but maps dictionaries " +"onto output rows. The *fieldnames* parameter is a :mod:`sequence " +"` of keys that identify the order in which values in the " +"dictionary passed to the :meth:`~csvwriter.writerow` method are written to " +"file *f*. The optional *restval* parameter specifies the value to be " +"written if the dictionary is missing a key in *fieldnames*. If the " +"dictionary passed to the :meth:`~csvwriter.writerow` method contains a key " +"not found in *fieldnames*, the optional *extrasaction* parameter indicates " +"what action to take. If it is set to ``'raise'``, the default value, a :exc:" +"`ValueError` is raised. If it is set to ``'ignore'``, extra values in the " +"dictionary are ignored. Any other optional or keyword arguments are passed " +"to the underlying :class:`writer` instance." +msgstr "" + +msgid "" +"Note that unlike the :class:`DictReader` class, the *fieldnames* parameter " +"of the :class:`DictWriter` class is not optional." +msgstr "" +"Зауважте, що на відміну від класу :class:`DictReader`, параметр *fieldnames* " +"класу :class:`DictWriter` необов’язковий." + +msgid "" +"import csv\n" +"\n" +"with open('names.csv', 'w', newline='') as csvfile:\n" +" fieldnames = ['first_name', 'last_name']\n" +" writer = csv.DictWriter(csvfile, fieldnames=fieldnames)\n" +"\n" +" writer.writeheader()\n" +" writer.writerow({'first_name': 'Baked', 'last_name': 'Beans'})\n" +" writer.writerow({'first_name': 'Lovely', 'last_name': 'Spam'})\n" +" writer.writerow({'first_name': 'Wonderful', 'last_name': 'Spam'})" +msgstr "" + +msgid "" +"The :class:`Dialect` class is a container class whose attributes contain " +"information for how to handle doublequotes, whitespace, delimiters, etc. Due " +"to the lack of a strict CSV specification, different applications produce " +"subtly different CSV data. :class:`Dialect` instances define how :class:" +"`reader` and :class:`writer` instances behave." +msgstr "" +"Клас :class:`Dialect` — це клас-контейнер, атрибути якого містять інформацію " +"про те, як обробляти подвійні лапки, пробіли, розділювачі тощо. Через " +"відсутність суворої специфікації CSV різні програми створюють дещо різні " +"дані CSV. Екземпляри :class:`Dialect` визначають, як поводитимуться " +"екземпляри :class:`reader` і :class:`writer`." + +msgid "" +"All available :class:`Dialect` names are returned by :func:`list_dialects`, " +"and they can be registered with specific :class:`reader` and :class:`writer` " +"classes through their initializer (``__init__``) functions like this::" +msgstr "" +"Усі доступні назви :class:`Dialect` повертаються :func:`list_dialects`, і їх " +"можна зареєструвати в певних класах :class:`reader` і :class:`writer` через " +"їх ініціалізатор (``__init__``) функціонує так::" + +msgid "" +"import csv\n" +"\n" +"with open('students.csv', 'w', newline='') as csvfile:\n" +" writer = csv.writer(csvfile, dialect='unix')" +msgstr "" + +msgid "" +"The :class:`excel` class defines the usual properties of an Excel-generated " +"CSV file. It is registered with the dialect name ``'excel'``." +msgstr "" +"Клас :class:`excel` визначає звичайні властивості файлу CSV, створеного " +"Excel. Його зареєстровано з діалектною назвою ``'excel``." + +msgid "" +"The :class:`excel_tab` class defines the usual properties of an Excel-" +"generated TAB-delimited file. It is registered with the dialect name " +"``'excel-tab'``." +msgstr "" +"Клас :class:`excel_tab` визначає звичайні властивості створеного Excel файлу " +"з роздільниками TAB. Його зареєстровано з діалектною назвою ``'excel-tab``." + +msgid "" +"The :class:`unix_dialect` class defines the usual properties of a CSV file " +"generated on UNIX systems, i.e. using ``'\\n'`` as line terminator and " +"quoting all fields. It is registered with the dialect name ``'unix'``." +msgstr "" +"Клас :class:`unix_dialect` визначає звичайні властивості файлу CSV, " +"створеного в системах UNIX, тобто використання ``'\\n'`` як символ " +"закінчення рядка та взяття всіх полів у лапки. Він зареєстрований під " +"діалектною назвою ``'unix``." + +msgid "The :class:`Sniffer` class is used to deduce the format of a CSV file." +msgstr "" +"Клас :class:`Sniffer` використовується для визначення формату файлу CSV." + +msgid "The :class:`Sniffer` class provides two methods:" +msgstr "Клас :class:`Sniffer` надає два методи:" + +msgid "" +"Analyze the given *sample* and return a :class:`Dialect` subclass reflecting " +"the parameters found. If the optional *delimiters* parameter is given, it " +"is interpreted as a string containing possible valid delimiter characters." +msgstr "" +"Проаналізуйте поданий *зразок* і поверніть підклас :class:`Dialect`, що " +"відображає знайдені параметри. Якщо вказано необов’язковий параметр " +"*роздільники*, він інтерпретується як рядок, що містить можливі дійсні " +"символи роздільників." + +msgid "" +"Analyze the sample text (presumed to be in CSV format) and return :const:" +"`True` if the first row appears to be a series of column headers. Inspecting " +"each column, one of two key criteria will be considered to estimate if the " +"sample contains a header:" +msgstr "" +"Проаналізуйте зразок тексту (імовірно у форматі CSV) і поверніть :const:" +"`True`, якщо перший рядок виглядає як ряд заголовків стовпців. Перевіряючи " +"кожен стовпець, буде розглянуто один із двох ключових критеріїв, щоб " +"оцінити, чи містить вибірка заголовок:" + +msgid "the second through n-th rows contain numeric values" +msgstr "з другого по n-й рядки містять числові значення" + +msgid "" +"the second through n-th rows contain strings where at least one value's " +"length differs from that of the putative header of that column." +msgstr "" +"рядки з другого по n-й містять рядки, у яких довжина принаймні одного " +"значення відрізняється від довжини передбачуваного заголовка цього стовпця." + +msgid "" +"Twenty rows after the first row are sampled; if more than half of columns + " +"rows meet the criteria, :const:`True` is returned." +msgstr "" +"Через двадцять рядів після першого ряду проводиться вибірка; якщо більше " +"половини стовпців + рядків відповідають критеріям, повертається :const:" +"`True`." + +msgid "" +"This method is a rough heuristic and may produce both false positives and " +"negatives." +msgstr "" +"Цей метод є грубим евристичним і може давати як помилкові позитивні, так і " +"негативні результати." + +msgid "An example for :class:`Sniffer` use::" +msgstr "Приклад використання :class:`Sniffer`::" + +msgid "" +"with open('example.csv', newline='') as csvfile:\n" +" dialect = csv.Sniffer().sniff(csvfile.read(1024))\n" +" csvfile.seek(0)\n" +" reader = csv.reader(csvfile, dialect)\n" +" # ... process CSV file contents here ..." +msgstr "" + +msgid "The :mod:`csv` module defines the following constants:" +msgstr "Модуль :mod:`csv` визначає такі константи:" + +msgid "Instructs :class:`writer` objects to quote all fields." +msgstr "Вказує об’єктам :class:`writer` взяти всі поля в лапки." + +msgid "" +"Instructs :class:`writer` objects to only quote those fields which contain " +"special characters such as *delimiter*, *quotechar* or any of the characters " +"in *lineterminator*." +msgstr "" +"Вказує об’єктам :class:`writer` брати в лапки лише ті поля, які містять " +"спеціальні символи, такі як *роздільник*, *quotechar* або будь-які символи в " +"*lineterminator*." + +msgid "Instructs :class:`writer` objects to quote all non-numeric fields." +msgstr "Вказує об’єктам :class:`writer` взяти в лапки всі нечислові поля." + +msgid "" +"Instructs :class:`reader` objects to convert all non-quoted fields to type " +"*float*." +msgstr "" + +msgid "" +"Instructs :class:`writer` objects to never quote fields. When the current " +"*delimiter* occurs in output data it is preceded by the current *escapechar* " +"character. If *escapechar* is not set, the writer will raise :exc:`Error` " +"if any characters that require escaping are encountered." +msgstr "" +"Наказує об’єктам :class:`writer` ніколи не брати поля в лапки. Коли поточний " +"*роздільник* зустрічається у вихідних даних, йому передує поточний символ " +"*escapechar*. Якщо *escapechar* не встановлено, запис викличе :exc:`Error`, " +"якщо зустрінеться будь-який символ, який потребує екранування." + +msgid "" +"Instructs :class:`reader` objects to perform no special processing of quote " +"characters." +msgstr "" + +msgid "" +"Instructs :class:`writer` objects to quote all fields which are not " +"``None``. This is similar to :data:`QUOTE_ALL`, except that if a field " +"value is ``None`` an empty (unquoted) string is written." +msgstr "" + +msgid "" +"Instructs :class:`reader` objects to interpret an empty (unquoted) field as " +"``None`` and to otherwise behave as :data:`QUOTE_ALL`." +msgstr "" + +msgid "" +"Instructs :class:`writer` objects to always place quotes around fields which " +"are strings. This is similar to :data:`QUOTE_NONNUMERIC`, except that if a " +"field value is ``None`` an empty (unquoted) string is written." +msgstr "" + +msgid "" +"Instructs :class:`reader` objects to interpret an empty (unquoted) string as " +"``None`` and to otherwise behave as :data:`QUOTE_NONNUMERIC`." +msgstr "" + +msgid "The :mod:`csv` module defines the following exception:" +msgstr "Модуль :mod:`csv` визначає такий виняток:" + +msgid "Raised by any of the functions when an error is detected." +msgstr "Викликається будь-якою з функцій у разі виявлення помилки." + +msgid "Dialects and Formatting Parameters" +msgstr "Діалекти та параметри форматування" + +msgid "" +"To make it easier to specify the format of input and output records, " +"specific formatting parameters are grouped together into dialects. A " +"dialect is a subclass of the :class:`Dialect` class containing various " +"attributes describing the format of the CSV file. When creating :class:" +"`reader` or :class:`writer` objects, the programmer can specify a string or " +"a subclass of the :class:`Dialect` class as the dialect parameter. In " +"addition to, or instead of, the *dialect* parameter, the programmer can also " +"specify individual formatting parameters, which have the same names as the " +"attributes defined below for the :class:`Dialect` class." +msgstr "" + +msgid "Dialects support the following attributes:" +msgstr "Діалекти підтримують такі атрибути:" + +msgid "" +"A one-character string used to separate fields. It defaults to ``','``." +msgstr "" +"Односимвольний рядок, який використовується для розділення полів. За " +"замовчуванням ``',''``." + +msgid "" +"Controls how instances of *quotechar* appearing inside a field should " +"themselves be quoted. When :const:`True`, the character is doubled. When :" +"const:`False`, the *escapechar* is used as a prefix to the *quotechar*. It " +"defaults to :const:`True`." +msgstr "" +"Керує тим, як екземпляри *quotechar*, що з’являються всередині поля, повинні " +"братися в лапки. Коли :const:`True`, символ подвоюється. Коли :const:" +"`False`, *escapechar* використовується як префікс до *quotechar*. За " +"замовчуванням :const:`True`." + +msgid "" +"On output, if *doublequote* is :const:`False` and no *escapechar* is set, :" +"exc:`Error` is raised if a *quotechar* is found in a field." +msgstr "" +"Під час виведення, якщо *doublequote* має значення :const:`False` і " +"*escapechar* не встановлено, виникає повідомлення :exc:`Error`, якщо " +"*quotechar* знайдено в полі." + +msgid "" +"A one-character string used by the writer to escape the *delimiter* if " +"*quoting* is set to :const:`QUOTE_NONE` and the *quotechar* if *doublequote* " +"is :const:`False`. On reading, the *escapechar* removes any special meaning " +"from the following character. It defaults to :const:`None`, which disables " +"escaping." +msgstr "" +"Односимвольний рядок, який використовується автором для екранування " +"*роздільника*, якщо *quoting* встановлено як :const:`QUOTE_NONE`, і " +"*quotechar*, якщо *doublequote* має значення :const:`False`. Під час читання " +"*escapechar* видаляє будь-яке спеціальне значення наступного символу. За " +"замовчуванням :const:`None`, що вимикає екранування." + +msgid "An empty *escapechar* is not allowed." +msgstr "" + +msgid "" +"The string used to terminate lines produced by the :class:`writer`. It " +"defaults to ``'\\r\\n'``." +msgstr "" +"Рядок, який використовується для завершення рядків, створених :class:" +"`writer`. За замовчуванням ``'\\r\\n'``." + +msgid "" +"The :class:`reader` is hard-coded to recognise either ``'\\r'`` or ``'\\n'`` " +"as end-of-line, and ignores *lineterminator*. This behavior may change in " +"the future." +msgstr "" +":class:`reader` жорстко розпізнає ``'\\r'`` або ``'\\n'`` як кінець рядка та " +"ігнорує *lineterminator*. Така поведінка може змінитися в майбутньому." + +msgid "" +"A one-character string used to quote fields containing special characters, " +"such as the *delimiter* or *quotechar*, or which contain new-line " +"characters. It defaults to ``'\"'``." +msgstr "" +"Односимвольний рядок, який використовується для взяття в лапки полів, що " +"містять спеціальні символи, такі як *роздільник* або *quotechar*, або які " +"містять символи нового рядка. За замовчуванням ``'\"'``." + +msgid "An empty *quotechar* is not allowed." +msgstr "" + +msgid "" +"Controls when quotes should be generated by the writer and recognised by the " +"reader. It can take on any of the :ref:`QUOTE_\\* constants ` and defaults to :const:`QUOTE_MINIMAL`." +msgstr "" + +msgid "" +"When :const:`True`, spaces immediately following the *delimiter* are " +"ignored. The default is :const:`False`." +msgstr "" + +msgid "" +"When ``True``, raise exception :exc:`Error` on bad CSV input. The default is " +"``False``." +msgstr "" +"Якщо ``True``, викликати виняток :exc:`Error` на неправильному введенні CSV. " +"Типовим значенням є ``False``." + +msgid "Reader Objects" +msgstr "Об’єкти Reader" + +msgid "" +"Reader objects (:class:`DictReader` instances and objects returned by the :" +"func:`reader` function) have the following public methods:" +msgstr "" +"Об’єкти Reader (екземпляри :class:`DictReader` та об’єкти, повернуті " +"функцією :func:`reader`) мають такі публічні методи:" + +msgid "" +"Return the next row of the reader's iterable object as a list (if the object " +"was returned from :func:`reader`) or a dict (if it is a :class:`DictReader` " +"instance), parsed according to the current :class:`Dialect`. Usually you " +"should call this as ``next(reader)``." +msgstr "" +"Повертає наступний рядок повторюваного об’єкта читача як список (якщо об’єкт " +"повернуто з :func:`reader`) або dict (якщо це екземпляр :class:" +"`DictReader`), проаналізований відповідно до поточного :class:`Dialect`. " +"Зазвичай ви повинні називати це як ``next(reader)``." + +msgid "Reader objects have the following public attributes:" +msgstr "Об’єкти Reader мають такі публічні атрибути:" + +msgid "A read-only description of the dialect in use by the parser." +msgstr "" +"Доступний лише для читання опис діалекту, який використовує аналізатор." + +msgid "" +"The number of lines read from the source iterator. This is not the same as " +"the number of records returned, as records can span multiple lines." +msgstr "" +"Кількість рядків, прочитаних із вихідного ітератора. Це не те саме, що " +"кількість повернутих записів, оскільки записи можуть займати кілька рядків." + +msgid "DictReader objects have the following public attribute:" +msgstr "Об’єкти DictReader мають такий публічний атрибут:" + +msgid "" +"If not passed as a parameter when creating the object, this attribute is " +"initialized upon first access or when the first record is read from the file." +msgstr "" +"Якщо не передано як параметр під час створення об’єкта, цей атрибут " +"ініціалізується під час першого доступу або коли перший запис зчитується з " +"файлу." + +msgid "Writer Objects" +msgstr "Об'єкти Writer" + +msgid "" +":class:`writer` objects (:class:`DictWriter` instances and objects returned " +"by the :func:`writer` function) have the following public methods. A *row* " +"must be an iterable of strings or numbers for :class:`writer` objects and a " +"dictionary mapping fieldnames to strings or numbers (by passing them " +"through :func:`str` first) for :class:`DictWriter` objects. Note that " +"complex numbers are written out surrounded by parens. This may cause some " +"problems for other programs which read CSV files (assuming they support " +"complex numbers at all)." +msgstr "" + +msgid "" +"Write the *row* parameter to the writer's file object, formatted according " +"to the current :class:`Dialect`. Return the return value of the call to the " +"*write* method of the underlying file object." +msgstr "" +"Запишіть параметр *row* в об’єкт файлу записувача, відформатований " +"відповідно до поточного :class:`Dialect`. Повертає значення, що повертається " +"викликом методу *write* основного файлового об’єкта." + +msgid "Added support of arbitrary iterables." +msgstr "Додано підтримку довільних ітерацій." + +msgid "" +"Write all elements in *rows* (an iterable of *row* objects as described " +"above) to the writer's file object, formatted according to the current " +"dialect." +msgstr "" +"Запишіть усі елементи в *рядки* (ітерація об’єктів *рядок*, як описано вище) " +"до об’єкта файлу записувача, відформатованого відповідно до поточного " +"діалекту." + +msgid "Writer objects have the following public attribute:" +msgstr "Об’єкти Writer мають такий публічний атрибут:" + +msgid "A read-only description of the dialect in use by the writer." +msgstr "Доступний лише для читання опис діалекту, який використовує автор." + +msgid "DictWriter objects have the following public method:" +msgstr "Об’єкти DictWriter мають такий відкритий метод:" + +msgid "" +"Write a row with the field names (as specified in the constructor) to the " +"writer's file object, formatted according to the current dialect. Return the " +"return value of the :meth:`csvwriter.writerow` call used internally." +msgstr "" +"Запишіть рядок із іменами полів (як зазначено в конструкторі) до об’єкта " +"файлу записувача, відформатованого відповідно до поточного діалекту. " +"Повертає значення, що повертається внутрішнім викликом :meth:`csvwriter." +"writerow`." + +msgid "" +":meth:`writeheader` now also returns the value returned by the :meth:" +"`csvwriter.writerow` method it uses internally." +msgstr "" +":meth:`writeheader` тепер також повертає значення, повернуте методом :meth:" +"`csvwriter.writerow`, який він використовує внутрішньо." + +msgid "Examples" +msgstr "Приклади" + +msgid "The simplest example of reading a CSV file::" +msgstr "Найпростіший приклад читання файлу CSV:" + +msgid "" +"import csv\n" +"with open('some.csv', newline='') as f:\n" +" reader = csv.reader(f)\n" +" for row in reader:\n" +" print(row)" +msgstr "" + +msgid "Reading a file with an alternate format::" +msgstr "Читання файлу в альтернативному форматі::" + +msgid "" +"import csv\n" +"with open('passwd', newline='') as f:\n" +" reader = csv.reader(f, delimiter=':', quoting=csv.QUOTE_NONE)\n" +" for row in reader:\n" +" print(row)" +msgstr "" + +msgid "The corresponding simplest possible writing example is::" +msgstr "Відповідний найпростіший можливий приклад написання:" + +msgid "" +"import csv\n" +"with open('some.csv', 'w', newline='') as f:\n" +" writer = csv.writer(f)\n" +" writer.writerows(someiterable)" +msgstr "" + +msgid "" +"Since :func:`open` is used to open a CSV file for reading, the file will by " +"default be decoded into unicode using the system default encoding (see :func:" +"`locale.getencoding`). To decode a file using a different encoding, use the " +"``encoding`` argument of open::" +msgstr "" + +msgid "" +"import csv\n" +"with open('some.csv', newline='', encoding='utf-8') as f:\n" +" reader = csv.reader(f)\n" +" for row in reader:\n" +" print(row)" +msgstr "" + +msgid "" +"The same applies to writing in something other than the system default " +"encoding: specify the encoding argument when opening the output file." +msgstr "" +"Те саме стосується кодування, відмінного від стандартного системного " +"кодування: укажіть аргумент кодування під час відкриття вихідного файлу." + +msgid "Registering a new dialect::" +msgstr "Реєстрація нового діалекту::" + +msgid "" +"import csv\n" +"csv.register_dialect('unixpwd', delimiter=':', quoting=csv.QUOTE_NONE)\n" +"with open('passwd', newline='') as f:\n" +" reader = csv.reader(f, 'unixpwd')" +msgstr "" + +msgid "" +"A slightly more advanced use of the reader --- catching and reporting " +"errors::" +msgstr "" +"Трохи розширеніше використання читача --- виявлення та повідомлення про " +"помилки::" + +msgid "" +"import csv, sys\n" +"filename = 'some.csv'\n" +"with open(filename, newline='') as f:\n" +" reader = csv.reader(f)\n" +" try:\n" +" for row in reader:\n" +" print(row)\n" +" except csv.Error as e:\n" +" sys.exit('file {}, line {}: {}'.format(filename, reader.line_num, e))" +msgstr "" + +msgid "" +"And while the module doesn't directly support parsing strings, it can easily " +"be done::" +msgstr "" +"І хоча модуль безпосередньо не підтримує розбір рядків, це легко зробити:" + +msgid "" +"import csv\n" +"for row in csv.reader(['one,two,three']):\n" +" print(row)" +msgstr "" + +msgid "Footnotes" +msgstr "Виноски" + +msgid "" +"If ``newline=''`` is not specified, newlines embedded inside quoted fields " +"will not be interpreted correctly, and on platforms that use ``\\r\\n`` " +"linendings on write an extra ``\\r`` will be added. It should always be " +"safe to specify ``newline=''``, since the csv module does its own (:term:" +"`universal `) newline handling." +msgstr "" +"Якщо ``newline=''`` не вказано, нові рядки, вбудовані в поля в лапках, не " +"будуть інтерпретовані належним чином, а на платформах, які використовують " +"``\\r\\n`` розрядки під час запису, буде додатковий ``\\r`` додано. Завжди " +"має бути безпечно вказувати ``newline=''``, оскільки модуль csv виконує " +"власну (:term:`universal `) обробку нового рядка." + +msgid "csv" +msgstr "csv" + +msgid "data" +msgstr "даних" + +msgid "tabular" +msgstr "" + +msgid "universal newlines" +msgstr "універсальні символи нового рядка" + +msgid "csv.reader function" +msgstr "" diff --git a/library/ctypes.po b/library/ctypes.po new file mode 100644 index 000000000..da164fd3d --- /dev/null +++ b/library/ctypes.po @@ -0,0 +1,3689 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 01:03+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!ctypes` --- A foreign function library for Python" +msgstr "" + +msgid "**Source code:** :source:`Lib/ctypes`" +msgstr "" + +msgid "" +":mod:`ctypes` is a foreign function library for Python. It provides C " +"compatible data types, and allows calling functions in DLLs or shared " +"libraries. It can be used to wrap these libraries in pure Python." +msgstr "" +":mod:`ctypes` — це бібліотека зовнішніх функцій для Python. Він надає C-" +"сумісні типи даних і дозволяє викликати функції в DLL або спільних " +"бібліотеках. Його можна використовувати, щоб обернути ці бібліотеки в чистий " +"Python." + +msgid "ctypes tutorial" +msgstr "підручник ctypes" + +msgid "" +"Note: The code samples in this tutorial use :mod:`doctest` to make sure that " +"they actually work. Since some code samples behave differently under Linux, " +"Windows, or macOS, they contain doctest directives in comments." +msgstr "" +"Примітка: зразки коду в цьому підручнику використовують :mod:`doctest`, щоб " +"переконатися, що вони справді працюють. Оскільки деякі зразки коду " +"поводяться по-різному в Linux, Windows або macOS, вони містять директиви " +"doctest у коментарях." + +msgid "" +"Note: Some code samples reference the ctypes :class:`c_int` type. On " +"platforms where ``sizeof(long) == sizeof(int)`` it is an alias to :class:" +"`c_long`. So, you should not be confused if :class:`c_long` is printed if " +"you would expect :class:`c_int` --- they are actually the same type." +msgstr "" +"Примітка. Деякі зразки коду посилаються на тип ctypes :class:`c_int`. На " +"платформах, де ``sizeof(long) == sizeof(int)``, це псевдонім :class:" +"`c_long`. Отже, вас не повинно бентежити, якщо надруковано :class:`c_long`, " +"якщо ви очікуєте :class:`c_int` --- вони насправді одного типу." + +msgid "Loading dynamic link libraries" +msgstr "Завантаження бібліотек динамічних посилань" + +msgid "" +":mod:`ctypes` exports the *cdll*, and on Windows *windll* and *oledll* " +"objects, for loading dynamic link libraries." +msgstr "" +":mod:`ctypes` експортує *cdll*, а в Windows об’єкти *windll* і *oledll* для " +"завантаження бібліотек динамічних посилань." + +msgid "" +"You load libraries by accessing them as attributes of these objects. *cdll* " +"loads libraries which export functions using the standard ``cdecl`` calling " +"convention, while *windll* libraries call functions using the ``stdcall`` " +"calling convention. *oledll* also uses the ``stdcall`` calling convention, " +"and assumes the functions return a Windows :c:type:`!HRESULT` error code. " +"The error code is used to automatically raise an :class:`OSError` exception " +"when the function call fails." +msgstr "" + +msgid "" +"Windows errors used to raise :exc:`WindowsError`, which is now an alias of :" +"exc:`OSError`." +msgstr "" +"Помилки Windows викликали :exc:`WindowsError`, який тепер є псевдонімом :exc:" +"`OSError`." + +msgid "" +"Here are some examples for Windows. Note that ``msvcrt`` is the MS standard " +"C library containing most standard C functions, and uses the ``cdecl`` " +"calling convention::" +msgstr "" + +msgid "" +">>> from ctypes import *\n" +">>> print(windll.kernel32)\n" +"\n" +">>> print(cdll.msvcrt)\n" +"\n" +">>> libc = cdll.msvcrt\n" +">>>" +msgstr "" + +msgid "Windows appends the usual ``.dll`` file suffix automatically." +msgstr "Windows автоматично додає звичайний суфікс файлу ``.dll``." + +msgid "" +"Accessing the standard C library through ``cdll.msvcrt`` will use an " +"outdated version of the library that may be incompatible with the one being " +"used by Python. Where possible, use native Python functionality, or else " +"import and use the ``msvcrt`` module." +msgstr "" +"Доступ до стандартної бібліотеки C через ``cdll.msvcrt`` використовуватиме " +"застарілу версію бібліотеки, яка може бути несумісною з тією, що " +"використовується Python. Якщо можливо, використовуйте власні функції Python " +"або імпортуйте та використовуйте модуль ``msvcrt``." + +msgid "" +"On Linux, it is required to specify the filename *including* the extension " +"to load a library, so attribute access can not be used to load libraries. " +"Either the :meth:`~LibraryLoader.LoadLibrary` method of the dll loaders " +"should be used, or you should load the library by creating an instance of " +"CDLL by calling the constructor::" +msgstr "" + +msgid "" +">>> cdll.LoadLibrary(\"libc.so.6\")\n" +"\n" +">>> libc = CDLL(\"libc.so.6\")\n" +">>> libc\n" +"\n" +">>>" +msgstr "" + +msgid "Accessing functions from loaded dlls" +msgstr "Доступ до функцій із завантажених dll" + +msgid "Functions are accessed as attributes of dll objects::" +msgstr "Доступ до функцій здійснюється як атрибути об’єктів dll::" + +msgid "" +">>> libc.printf\n" +"<_FuncPtr object at 0x...>\n" +">>> print(windll.kernel32.GetModuleHandleA)\n" +"<_FuncPtr object at 0x...>\n" +">>> print(windll.kernel32.MyOwnFunction)\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +" File \"ctypes.py\", line 239, in __getattr__\n" +" func = _StdcallFuncPtr(name, self)\n" +"AttributeError: function 'MyOwnFunction' not found\n" +">>>" +msgstr "" + +msgid "" +"Note that win32 system dlls like ``kernel32`` and ``user32`` often export " +"ANSI as well as UNICODE versions of a function. The UNICODE version is " +"exported with a ``W`` appended to the name, while the ANSI version is " +"exported with an ``A`` appended to the name. The win32 ``GetModuleHandle`` " +"function, which returns a *module handle* for a given module name, has the " +"following C prototype, and a macro is used to expose one of them as " +"``GetModuleHandle`` depending on whether UNICODE is defined or not::" +msgstr "" + +msgid "" +"/* ANSI version */\n" +"HMODULE GetModuleHandleA(LPCSTR lpModuleName);\n" +"/* UNICODE version */\n" +"HMODULE GetModuleHandleW(LPCWSTR lpModuleName);" +msgstr "" + +msgid "" +"*windll* does not try to select one of them by magic, you must access the " +"version you need by specifying ``GetModuleHandleA`` or ``GetModuleHandleW`` " +"explicitly, and then call it with bytes or string objects respectively." +msgstr "" +"*windll* не намагається вибрати одну з них магією, ви повинні отримати " +"доступ до потрібної вам версії, явно вказавши ``GetModuleHandleA`` або " +"``GetModuleHandleW``, а потім викликати його за допомогою байтів або " +"рядкових об’єктів відповідно." + +msgid "" +"Sometimes, dlls export functions with names which aren't valid Python " +"identifiers, like ``\"??2@YAPAXI@Z\"``. In this case you have to use :func:" +"`getattr` to retrieve the function::" +msgstr "" +"Іноді бібліотеки dll експортують функції з іменами, які не є дійсними " +"ідентифікаторами Python, наприклад ``\"??2@YAPAXI@Z\"``. У цьому випадку ви " +"повинні використовувати :func:`getattr`, щоб отримати функцію::" + +msgid "" +">>> getattr(cdll.msvcrt, \"??2@YAPAXI@Z\")\n" +"<_FuncPtr object at 0x...>\n" +">>>" +msgstr "" + +msgid "" +"On Windows, some dlls export functions not by name but by ordinal. These " +"functions can be accessed by indexing the dll object with the ordinal " +"number::" +msgstr "" +"У Windows деякі бібліотеки DLL експортують функції не за назвою, а за " +"порядковим номером. Доступ до цих функцій можна отримати, проіндексувавши " +"об’єкт dll з порядковим номером::" + +msgid "" +">>> cdll.kernel32[1]\n" +"<_FuncPtr object at 0x...>\n" +">>> cdll.kernel32[0]\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +" File \"ctypes.py\", line 310, in __getitem__\n" +" func = _StdcallFuncPtr(name, self)\n" +"AttributeError: function ordinal 0 not found\n" +">>>" +msgstr "" + +msgid "Calling functions" +msgstr "Функції виклику" + +msgid "" +"You can call these functions like any other Python callable. This example " +"uses the ``rand()`` function, which takes no arguments and returns a pseudo-" +"random integer::" +msgstr "" + +msgid "" +">>> print(libc.rand())\n" +"1804289383" +msgstr "" + +msgid "" +"On Windows, you can call the ``GetModuleHandleA()`` function, which returns " +"a win32 module handle (passing ``None`` as single argument to call it with a " +"``NULL`` pointer)::" +msgstr "" + +msgid "" +">>> print(hex(windll.kernel32.GetModuleHandleA(None)))\n" +"0x1d000000\n" +">>>" +msgstr "" + +msgid "" +":exc:`ValueError` is raised when you call an ``stdcall`` function with the " +"``cdecl`` calling convention, or vice versa::" +msgstr "" +":exc:`ValueError` виникає, коли ви викликаєте функцію ``stdcall`` за угодою " +"про виклик ``cdecl``, або навпаки::" + +msgid "" +">>> cdll.kernel32.GetModuleHandleA(None)\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"ValueError: Procedure probably called with not enough arguments (4 bytes " +"missing)\n" +">>>\n" +"\n" +">>> windll.msvcrt.printf(b\"spam\")\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"ValueError: Procedure probably called with too many arguments (4 bytes in " +"excess)\n" +">>>" +msgstr "" + +msgid "" +"To find out the correct calling convention you have to look into the C " +"header file or the documentation for the function you want to call." +msgstr "" +"Щоб дізнатися правильну умову виклику, вам потрібно переглянути файл " +"заголовка C або документацію для функції, яку ви хочете викликати." + +msgid "" +"On Windows, :mod:`ctypes` uses win32 structured exception handling to " +"prevent crashes from general protection faults when functions are called " +"with invalid argument values::" +msgstr "" +"У Windows :mod:`ctypes` використовує структуровану обробку винятків win32, " +"щоб запобігти збоям через загальні помилки захисту, коли функції " +"викликаються з недійсними значеннями аргументів:" + +msgid "" +">>> windll.kernel32.GetModuleHandleA(32)\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"OSError: exception: access violation reading 0x00000020\n" +">>>" +msgstr "" + +msgid "" +"There are, however, enough ways to crash Python with :mod:`ctypes`, so you " +"should be careful anyway. The :mod:`faulthandler` module can be helpful in " +"debugging crashes (e.g. from segmentation faults produced by erroneous C " +"library calls)." +msgstr "" +"Однак існує достатньо способів аварійно завершити роботу Python за " +"допомогою :mod:`ctypes`, тому будьте обережні. Модуль :mod:`faulthandler` " +"може бути корисним для усунення збоїв (наприклад, через помилки сегментації, " +"спричинені помилковими викликами бібліотеки C)." + +msgid "" +"``None``, integers, bytes objects and (unicode) strings are the only native " +"Python objects that can directly be used as parameters in these function " +"calls. ``None`` is passed as a C ``NULL`` pointer, bytes objects and strings " +"are passed as pointer to the memory block that contains their data (:c:expr:" +"`char *` or :c:expr:`wchar_t *`). Python integers are passed as the " +"platform's default C :c:expr:`int` type, their value is masked to fit into " +"the C type." +msgstr "" + +msgid "" +"Before we move on calling functions with other parameter types, we have to " +"learn more about :mod:`ctypes` data types." +msgstr "" +"Перш ніж перейти до виклику функцій з іншими типами параметрів, ми повинні " +"дізнатися більше про типи даних :mod:`ctypes`." + +msgid "Fundamental data types" +msgstr "Основні типи даних" + +msgid ":mod:`ctypes` defines a number of primitive C compatible data types:" +msgstr ":mod:`ctypes` визначає ряд примітивних C-сумісних типів даних:" + +msgid "ctypes type" +msgstr "тип ctypes" + +msgid "C type" +msgstr "тип С" + +msgid "Python type" +msgstr "Тип Python" + +msgid ":class:`c_bool`" +msgstr ":class:`c_bool`" + +msgid ":c:expr:`_Bool`" +msgstr "" + +msgid "bool (1)" +msgstr "bool (1)" + +msgid ":class:`c_char`" +msgstr ":class:`c_char`" + +msgid ":c:expr:`char`" +msgstr "" + +msgid "1-character bytes object" +msgstr "1-символьний об'єкт байтів" + +msgid ":class:`c_wchar`" +msgstr ":class:`c_wchar`" + +msgid ":c:type:`wchar_t`" +msgstr ":c:type:`wchar_t`" + +msgid "1-character string" +msgstr "1-символьний рядок" + +msgid ":class:`c_byte`" +msgstr ":class:`c_byte`" + +msgid "int" +msgstr "внутр" + +msgid ":class:`c_ubyte`" +msgstr ":class:`c_ubyte`" + +msgid ":c:expr:`unsigned char`" +msgstr "" + +msgid ":class:`c_short`" +msgstr ":class:`c_short`" + +msgid ":c:expr:`short`" +msgstr "" + +msgid ":class:`c_ushort`" +msgstr ":class:`c_ushort`" + +msgid ":c:expr:`unsigned short`" +msgstr "" + +msgid ":class:`c_int`" +msgstr ":class:`c_int`" + +msgid ":c:expr:`int`" +msgstr "" + +msgid ":class:`c_uint`" +msgstr ":class:`c_uint`" + +msgid ":c:expr:`unsigned int`" +msgstr "" + +msgid ":class:`c_long`" +msgstr ":class:`c_long`" + +msgid ":c:expr:`long`" +msgstr "" + +msgid ":class:`c_ulong`" +msgstr ":class:`c_ulong`" + +msgid ":c:expr:`unsigned long`" +msgstr "" + +msgid ":class:`c_longlong`" +msgstr ":class:`c_longlong`" + +msgid ":c:expr:`__int64` or :c:expr:`long long`" +msgstr "" + +msgid ":class:`c_ulonglong`" +msgstr ":class:`c_ulonglong`" + +msgid ":c:expr:`unsigned __int64` or :c:expr:`unsigned long long`" +msgstr "" + +msgid ":class:`c_size_t`" +msgstr ":class:`c_size_t`" + +msgid ":c:type:`size_t`" +msgstr ":c:type:`size_t`" + +msgid ":class:`c_ssize_t`" +msgstr ":class:`c_ssize_t`" + +msgid ":c:type:`ssize_t` or :c:expr:`Py_ssize_t`" +msgstr "" + +msgid ":class:`c_time_t`" +msgstr "" + +msgid ":c:type:`time_t`" +msgstr "" + +msgid ":class:`c_float`" +msgstr ":class:`c_float`" + +msgid ":c:expr:`float`" +msgstr "" + +msgid "float" +msgstr "плавати" + +msgid ":class:`c_double`" +msgstr ":class:`c_double`" + +msgid ":c:expr:`double`" +msgstr "" + +msgid ":class:`c_longdouble`" +msgstr ":class:`c_longdouble`" + +msgid ":c:expr:`long double`" +msgstr "" + +msgid ":class:`c_char_p`" +msgstr ":class:`c_char_p`" + +msgid ":c:expr:`char *` (NUL terminated)" +msgstr "" + +msgid "bytes object or ``None``" +msgstr "bytes або ``None``" + +msgid ":class:`c_wchar_p`" +msgstr ":class:`c_wchar_p`" + +msgid ":c:expr:`wchar_t *` (NUL terminated)" +msgstr "" + +msgid "string or ``None``" +msgstr "рядок або ``None``" + +msgid ":class:`c_void_p`" +msgstr ":class:`c_void_p`" + +msgid ":c:expr:`void *`" +msgstr "" + +msgid "int or ``None``" +msgstr "int або ``None``" + +msgid "The constructor accepts any object with a truth value." +msgstr "Конструктор приймає будь-який об’єкт зі значенням істинності." + +msgid "" +"All these types can be created by calling them with an optional initializer " +"of the correct type and value::" +msgstr "" +"Усі ці типи можна створити, викликавши їх із необов’язковим ініціалізатором " +"правильного типу та значення::" + +msgid "" +">>> c_int()\n" +"c_long(0)\n" +">>> c_wchar_p(\"Hello, World\")\n" +"c_wchar_p(140018365411392)\n" +">>> c_ushort(-3)\n" +"c_ushort(65533)\n" +">>>" +msgstr "" + +msgid "" +"Since these types are mutable, their value can also be changed afterwards::" +msgstr "Оскільки ці типи є змінними, їх значення також можна змінити пізніше:" + +msgid "" +">>> i = c_int(42)\n" +">>> print(i)\n" +"c_long(42)\n" +">>> print(i.value)\n" +"42\n" +">>> i.value = -99\n" +">>> print(i.value)\n" +"-99\n" +">>>" +msgstr "" + +msgid "" +"Assigning a new value to instances of the pointer types :class:`c_char_p`, :" +"class:`c_wchar_p`, and :class:`c_void_p` changes the *memory location* they " +"point to, *not the contents* of the memory block (of course not, because " +"Python string objects are immutable)::" +msgstr "" + +msgid "" +">>> s = \"Hello, World\"\n" +">>> c_s = c_wchar_p(s)\n" +">>> print(c_s)\n" +"c_wchar_p(139966785747344)\n" +">>> print(c_s.value)\n" +"Hello World\n" +">>> c_s.value = \"Hi, there\"\n" +">>> print(c_s) # the memory location has changed\n" +"c_wchar_p(139966783348904)\n" +">>> print(c_s.value)\n" +"Hi, there\n" +">>> print(s) # first object is unchanged\n" +"Hello, World\n" +">>>" +msgstr "" + +msgid "" +"You should be careful, however, not to pass them to functions expecting " +"pointers to mutable memory. If you need mutable memory blocks, ctypes has a :" +"func:`create_string_buffer` function which creates these in various ways. " +"The current memory block contents can be accessed (or changed) with the " +"``raw`` property; if you want to access it as NUL terminated string, use the " +"``value`` property::" +msgstr "" +"Однак ви повинні бути обережними, щоб не передавати їх функціям, які " +"очікують покажчиків на змінну пам’ять. Якщо вам потрібні змінні блоки " +"пам’яті, ctypes має функцію :func:`create_string_buffer`, яка створює їх " +"різними способами. Доступ до поточного вмісту блоку пам’яті можна отримати " +"(або змінити) за допомогою властивості ``raw``; якщо ви бажаєте отримати до " +"нього доступ як до рядка з закінченням NUL, використовуйте властивість " +"``value``::" + +msgid "" +">>> from ctypes import *\n" +">>> p = create_string_buffer(3) # create a 3 byte buffer, " +"initialized to NUL bytes\n" +">>> print(sizeof(p), repr(p.raw))\n" +"3 b'\\x00\\x00\\x00'\n" +">>> p = create_string_buffer(b\"Hello\") # create a buffer containing a " +"NUL terminated string\n" +">>> print(sizeof(p), repr(p.raw))\n" +"6 b'Hello\\x00'\n" +">>> print(repr(p.value))\n" +"b'Hello'\n" +">>> p = create_string_buffer(b\"Hello\", 10) # create a 10 byte buffer\n" +">>> print(sizeof(p), repr(p.raw))\n" +"10 b'Hello\\x00\\x00\\x00\\x00\\x00'\n" +">>> p.value = b\"Hi\"\n" +">>> print(sizeof(p), repr(p.raw))\n" +"10 b'Hi\\x00lo\\x00\\x00\\x00\\x00\\x00'\n" +">>>" +msgstr "" + +msgid "" +"The :func:`create_string_buffer` function replaces the old :func:`!c_buffer` " +"function (which is still available as an alias). To create a mutable memory " +"block containing unicode characters of the C type :c:type:`wchar_t`, use " +"the :func:`create_unicode_buffer` function." +msgstr "" + +msgid "Calling functions, continued" +msgstr "Функції виклику, продовження" + +msgid "" +"Note that printf prints to the real standard output channel, *not* to :data:" +"`sys.stdout`, so these examples will only work at the console prompt, not " +"from within *IDLE* or *PythonWin*::" +msgstr "" +"Зауважте, що printf друкує на справжній стандартний канал виводу, *а не* на :" +"data:`sys.stdout`, тому ці приклади працюватимуть лише у підказці консолі, а " +"не з *IDLE* або *PythonWin*::" + +msgid "" +">>> printf = libc.printf\n" +">>> printf(b\"Hello, %s\\n\", b\"World!\")\n" +"Hello, World!\n" +"14\n" +">>> printf(b\"Hello, %S\\n\", \"World!\")\n" +"Hello, World!\n" +"14\n" +">>> printf(b\"%d bottles of beer\\n\", 42)\n" +"42 bottles of beer\n" +"19\n" +">>> printf(b\"%f bottles of beer\\n\", 42.5)\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"ctypes.ArgumentError: argument 2: TypeError: Don't know how to convert " +"parameter 2\n" +">>>" +msgstr "" + +msgid "" +"As has been mentioned before, all Python types except integers, strings, and " +"bytes objects have to be wrapped in their corresponding :mod:`ctypes` type, " +"so that they can be converted to the required C data type::" +msgstr "" +"Як уже згадувалося раніше, усі типи Python, окрім цілих, рядкових і байтових " +"об’єктів, мають бути загорнуті у відповідний тип :mod:`ctypes`, щоб їх можна " +"було перетворити на необхідний тип даних C::" + +msgid "" +">>> printf(b\"An int %d, a double %f\\n\", 1234, c_double(3.14))\n" +"An int 1234, a double 3.140000\n" +"31\n" +">>>" +msgstr "" + +msgid "Calling variadic functions" +msgstr "" + +msgid "" +"On a lot of platforms calling variadic functions through ctypes is exactly " +"the same as calling functions with a fixed number of parameters. On some " +"platforms, and in particular ARM64 for Apple Platforms, the calling " +"convention for variadic functions is different than that for regular " +"functions." +msgstr "" + +msgid "" +"On those platforms it is required to specify the :attr:`~_CFuncPtr.argtypes` " +"attribute for the regular, non-variadic, function arguments:" +msgstr "" + +msgid "libc.printf.argtypes = [ctypes.c_char_p]" +msgstr "" + +msgid "" +"Because specifying the attribute does not inhibit portability it is advised " +"to always specify :attr:`~_CFuncPtr.argtypes` for all variadic functions." +msgstr "" + +msgid "Calling functions with your own custom data types" +msgstr "Виклик функцій із власними типами даних" + +msgid "" +"You can also customize :mod:`ctypes` argument conversion to allow instances " +"of your own classes be used as function arguments. :mod:`ctypes` looks for " +"an :attr:`!_as_parameter_` attribute and uses this as the function argument. " +"The attribute must be an integer, string, bytes, a :mod:`ctypes` instance, " +"or an object with an :attr:`!_as_parameter_` attribute::" +msgstr "" + +msgid "" +">>> class Bottles:\n" +"... def __init__(self, number):\n" +"... self._as_parameter_ = number\n" +"...\n" +">>> bottles = Bottles(42)\n" +">>> printf(b\"%d bottles of beer\\n\", bottles)\n" +"42 bottles of beer\n" +"19\n" +">>>" +msgstr "" + +msgid "" +"If you don't want to store the instance's data in the :attr:`!" +"_as_parameter_` instance variable, you could define a :class:`property` " +"which makes the attribute available on request." +msgstr "" + +msgid "Specifying the required argument types (function prototypes)" +msgstr "Вказівка необхідних типів аргументів (прототипів функцій)" + +msgid "" +"It is possible to specify the required argument types of functions exported " +"from DLLs by setting the :attr:`~_CFuncPtr.argtypes` attribute." +msgstr "" + +msgid "" +":attr:`~_CFuncPtr.argtypes` must be a sequence of C data types (the :func:`!" +"printf` function is probably not a good example here, because it takes a " +"variable number and different types of parameters depending on the format " +"string, on the other hand this is quite handy to experiment with this " +"feature)::" +msgstr "" + +msgid "" +">>> printf.argtypes = [c_char_p, c_char_p, c_int, c_double]\n" +">>> printf(b\"String '%s', Int %d, Double %f\\n\", b\"Hi\", 10, 2.2)\n" +"String 'Hi', Int 10, Double 2.200000\n" +"37\n" +">>>" +msgstr "" + +msgid "" +"Specifying a format protects against incompatible argument types (just as a " +"prototype for a C function), and tries to convert the arguments to valid " +"types::" +msgstr "" +"Зазначення формату захищає від несумісних типів аргументів (як прототип для " +"функції C) і намагається перетворити аргументи на дійсні типи:" + +msgid "" +">>> printf(b\"%d %d %d\", 1, 2, 3)\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"ctypes.ArgumentError: argument 2: TypeError: 'int' object cannot be " +"interpreted as ctypes.c_char_p\n" +">>> printf(b\"%s %d %f\\n\", b\"X\", 2, 3)\n" +"X 2 3.000000\n" +"13\n" +">>>" +msgstr "" + +msgid "" +"If you have defined your own classes which you pass to function calls, you " +"have to implement a :meth:`~_CData.from_param` class method for them to be " +"able to use them in the :attr:`~_CFuncPtr.argtypes` sequence. The :meth:" +"`~_CData.from_param` class method receives the Python object passed to the " +"function call, it should do a typecheck or whatever is needed to make sure " +"this object is acceptable, and then return the object itself, its :attr:`!" +"_as_parameter_` attribute, or whatever you want to pass as the C function " +"argument in this case. Again, the result should be an integer, string, " +"bytes, a :mod:`ctypes` instance, or an object with an :attr:`!" +"_as_parameter_` attribute." +msgstr "" + +msgid "Return types" +msgstr "Типи повернення" + +msgid "" +"By default functions are assumed to return the C :c:expr:`int` type. Other " +"return types can be specified by setting the :attr:`~_CFuncPtr.restype` " +"attribute of the function object." +msgstr "" + +msgid "" +"The C prototype of :c:func:`time` is ``time_t time(time_t *)``. Because :c:" +"type:`time_t` might be of a different type than the default return type :c:" +"expr:`int`, you should specify the :attr:`!restype` attribute::" +msgstr "" + +msgid ">>> libc.time.restype = c_time_t" +msgstr "" + +msgid "The argument types can be specified using :attr:`~_CFuncPtr.argtypes`::" +msgstr "" + +msgid ">>> libc.time.argtypes = (POINTER(c_time_t),)" +msgstr "" + +msgid "" +"To call the function with a ``NULL`` pointer as first argument, use " +"``None``::" +msgstr "" + +msgid "" +">>> print(libc.time(None))\n" +"1150640792" +msgstr "" + +msgid "" +"Here is a more advanced example, it uses the :func:`!strchr` function, which " +"expects a string pointer and a char, and returns a pointer to a string::" +msgstr "" + +msgid "" +">>> strchr = libc.strchr\n" +">>> strchr(b\"abcdef\", ord(\"d\"))\n" +"8059983\n" +">>> strchr.restype = c_char_p # c_char_p is a pointer to a string\n" +">>> strchr(b\"abcdef\", ord(\"d\"))\n" +"b'def'\n" +">>> print(strchr(b\"abcdef\", ord(\"x\")))\n" +"None\n" +">>>" +msgstr "" + +msgid "" +"If you want to avoid the :func:`ord(\"x\") ` calls above, you can set " +"the :attr:`~_CFuncPtr.argtypes` attribute, and the second argument will be " +"converted from a single character Python bytes object into a C char:" +msgstr "" + +msgid "" +">>> strchr.restype = c_char_p\n" +">>> strchr.argtypes = [c_char_p, c_char]\n" +">>> strchr(b\"abcdef\", b\"d\")\n" +"b'def'\n" +">>> strchr(b\"abcdef\", b\"def\")\n" +"Traceback (most recent call last):\n" +"ctypes.ArgumentError: argument 2: TypeError: one character bytes, bytearray " +"or integer expected\n" +">>> print(strchr(b\"abcdef\", b\"x\"))\n" +"None\n" +">>> strchr(b\"abcdef\", b\"d\")\n" +"b'def'\n" +">>>" +msgstr "" + +msgid "" +"You can also use a callable Python object (a function or a class for " +"example) as the :attr:`~_CFuncPtr.restype` attribute, if the foreign " +"function returns an integer. The callable will be called with the *integer* " +"the C function returns, and the result of this call will be used as the " +"result of your function call. This is useful to check for error return " +"values and automatically raise an exception::" +msgstr "" + +msgid "" +">>> GetModuleHandle = windll.kernel32.GetModuleHandleA\n" +">>> def ValidHandle(value):\n" +"... if value == 0:\n" +"... raise WinError()\n" +"... return value\n" +"...\n" +">>>\n" +">>> GetModuleHandle.restype = ValidHandle\n" +">>> GetModuleHandle(None)\n" +"486539264\n" +">>> GetModuleHandle(\"something silly\")\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +" File \"\", line 3, in ValidHandle\n" +"OSError: [Errno 126] The specified module could not be found.\n" +">>>" +msgstr "" + +msgid "" +"``WinError`` is a function which will call Windows ``FormatMessage()`` api " +"to get the string representation of an error code, and *returns* an " +"exception. ``WinError`` takes an optional error code parameter, if no one is " +"used, it calls :func:`GetLastError` to retrieve it." +msgstr "" +"``WinError`` — це функція, яка викликає Windows ``FormatMessage()`` API, щоб " +"отримати рядкове представлення коду помилки, і *повертає* виняткову " +"ситуацію. ``WinError`` приймає додатковий параметр коду помилки, якщо ніхто " +"не використовується, він викликає :func:`GetLastError`, щоб отримати його." + +msgid "" +"Please note that a much more powerful error checking mechanism is available " +"through the :attr:`~_CFuncPtr.errcheck` attribute; see the reference manual " +"for details." +msgstr "" + +msgid "Passing pointers (or: passing parameters by reference)" +msgstr "Передача покажчиків (або: передача параметрів за посиланням)" + +msgid "" +"Sometimes a C api function expects a *pointer* to a data type as parameter, " +"probably to write into the corresponding location, or if the data is too " +"large to be passed by value. This is also known as *passing parameters by " +"reference*." +msgstr "" +"Іноді функція C API очікує *вказівника* на тип даних як параметр, ймовірно, " +"для запису у відповідне розташування або якщо дані завеликі для передачі за " +"значенням. Це також відомо як *передача параметрів за посиланням*." + +msgid "" +":mod:`ctypes` exports the :func:`byref` function which is used to pass " +"parameters by reference. The same effect can be achieved with the :func:" +"`pointer` function, although :func:`pointer` does a lot more work since it " +"constructs a real pointer object, so it is faster to use :func:`byref` if " +"you don't need the pointer object in Python itself::" +msgstr "" +":mod:`ctypes` експортує функцію :func:`byref`, яка використовується для " +"передачі параметрів за посиланням. Такого ж ефекту можна досягти за " +"допомогою функції :func:`pointer`, хоча :func:`pointer` виконує набагато " +"більше роботи, оскільки створює справжній об’єкт-вказівник, тому " +"використовувати :func:`byref` швидше не потрібен об’єкт покажчика в самому " +"Python::" + +msgid "" +">>> i = c_int()\n" +">>> f = c_float()\n" +">>> s = create_string_buffer(b'\\000' * 32)\n" +">>> print(i.value, f.value, repr(s.value))\n" +"0 0.0 b''\n" +">>> libc.sscanf(b\"1 3.14 Hello\", b\"%d %f %s\",\n" +"... byref(i), byref(f), s)\n" +"3\n" +">>> print(i.value, f.value, repr(s.value))\n" +"1 3.1400001049 b'Hello'\n" +">>>" +msgstr "" + +msgid "Structures and unions" +msgstr "Структури та спілки" + +msgid "" +"Structures and unions must derive from the :class:`Structure` and :class:" +"`Union` base classes which are defined in the :mod:`ctypes` module. Each " +"subclass must define a :attr:`~Structure._fields_` attribute. :attr:`!" +"_fields_` must be a list of *2-tuples*, containing a *field name* and a " +"*field type*." +msgstr "" + +msgid "" +"The field type must be a :mod:`ctypes` type like :class:`c_int`, or any " +"other derived :mod:`ctypes` type: structure, union, array, pointer." +msgstr "" +"Тип поля має бути типу :mod:`ctypes`, наприклад :class:`c_int`, або будь-" +"якого іншого похідного типу :mod:`ctypes`: структура, об’єднання, масив, " +"покажчик." + +msgid "" +"Here is a simple example of a POINT structure, which contains two integers " +"named *x* and *y*, and also shows how to initialize a structure in the " +"constructor::" +msgstr "" +"Ось простий приклад структури POINT, яка містить два цілі числа з іменами " +"*x* і *y*, а також показує, як ініціалізувати структуру в конструкторі::" + +msgid "" +">>> from ctypes import *\n" +">>> class POINT(Structure):\n" +"... _fields_ = [(\"x\", c_int),\n" +"... (\"y\", c_int)]\n" +"...\n" +">>> point = POINT(10, 20)\n" +">>> print(point.x, point.y)\n" +"10 20\n" +">>> point = POINT(y=5)\n" +">>> print(point.x, point.y)\n" +"0 5\n" +">>> POINT(1, 2, 3)\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"TypeError: too many initializers\n" +">>>" +msgstr "" + +msgid "" +"You can, however, build much more complicated structures. A structure can " +"itself contain other structures by using a structure as a field type." +msgstr "" +"Однак можна будувати набагато складніші конструкції. Структура може сама " +"містити інші структури, використовуючи структуру як тип поля." + +msgid "" +"Here is a RECT structure which contains two POINTs named *upperleft* and " +"*lowerright*::" +msgstr "" +"Ось структура RECT, яка містить дві ТОЧКИ з іменами *upperleft* і " +"*lowerright*::" + +msgid "" +">>> class RECT(Structure):\n" +"... _fields_ = [(\"upperleft\", POINT),\n" +"... (\"lowerright\", POINT)]\n" +"...\n" +">>> rc = RECT(point)\n" +">>> print(rc.upperleft.x, rc.upperleft.y)\n" +"0 5\n" +">>> print(rc.lowerright.x, rc.lowerright.y)\n" +"0 0\n" +">>>" +msgstr "" + +msgid "" +"Nested structures can also be initialized in the constructor in several " +"ways::" +msgstr "" +"Вкладені структури також можна ініціалізувати в конструкторі кількома " +"способами:" + +msgid "" +">>> r = RECT(POINT(1, 2), POINT(3, 4))\n" +">>> r = RECT((1, 2), (3, 4))" +msgstr "" + +msgid "" +"Field :term:`descriptor`\\s can be retrieved from the *class*, they are " +"useful for debugging because they can provide useful information::" +msgstr "" +"Поля :term:`descriptor`\\s можна отримати з *класу*, вони корисні для " +"налагодження, оскільки можуть надати корисну інформацію::" + +msgid "" +">>> print(POINT.x)\n" +"\n" +">>> print(POINT.y)\n" +"\n" +">>>" +msgstr "" + +msgid "" +":mod:`ctypes` does not support passing unions or structures with bit-fields " +"to functions by value. While this may work on 32-bit x86, it's not " +"guaranteed by the library to work in the general case. Unions and " +"structures with bit-fields should always be passed to functions by pointer." +msgstr "" +":mod:`ctypes` не підтримує передачу об’єднань або структур із бітовими " +"полями функціям за значенням. Хоча це може працювати на 32-розрядних x86, " +"бібліотека не гарантує роботу в загальному випадку. Об’єднання та структури " +"з бітовими полями слід завжди передавати функціям за вказівником." + +msgid "Structure/union alignment and byte order" +msgstr "Вирівнювання структури/об'єднання та порядок байтів" + +msgid "" +"By default, Structure and Union fields are aligned in the same way the C " +"compiler does it. It is possible to override this behavior by specifying a :" +"attr:`~Structure._pack_` class attribute in the subclass definition. This " +"must be set to a positive integer and specifies the maximum alignment for " +"the fields. This is what ``#pragma pack(n)`` also does in MSVC. It is also " +"possible to set a minimum alignment for how the subclass itself is packed in " +"the same way ``#pragma align(n)`` works in MSVC. This can be achieved by " +"specifying a :attr:`~Structure._align_` class attribute in the subclass " +"definition." +msgstr "" + +msgid "" +":mod:`ctypes` uses the native byte order for Structures and Unions. To " +"build structures with non-native byte order, you can use one of the :class:" +"`BigEndianStructure`, :class:`LittleEndianStructure`, :class:" +"`BigEndianUnion`, and :class:`LittleEndianUnion` base classes. These " +"classes cannot contain pointer fields." +msgstr "" +":mod:`ctypes` використовує власний порядок байтів для структур і об’єднань. " +"Щоб створити структури з невласним порядком байтів, ви можете " +"використовувати один із базових класів :class:`BigEndianStructure`, :class:" +"`LittleEndianStructure`, :class:`BigEndianUnion` і :class:" +"`LittleEndianUnion`. Ці класи не можуть містити поля вказівників." + +msgid "Bit fields in structures and unions" +msgstr "Бітові поля в структурах і об'єднаннях" + +msgid "" +"It is possible to create structures and unions containing bit fields. Bit " +"fields are only possible for integer fields, the bit width is specified as " +"the third item in the :attr:`~Structure._fields_` tuples::" +msgstr "" + +msgid "" +">>> class Int(Structure):\n" +"... _fields_ = [(\"first_16\", c_int, 16),\n" +"... (\"second_16\", c_int, 16)]\n" +"...\n" +">>> print(Int.first_16)\n" +"\n" +">>> print(Int.second_16)\n" +"\n" +">>>" +msgstr "" + +msgid "Arrays" +msgstr "Масиви" + +msgid "" +"Arrays are sequences, containing a fixed number of instances of the same " +"type." +msgstr "" +"Масиви - це послідовності, що містять фіксовану кількість екземплярів одного " +"типу." + +msgid "" +"The recommended way to create array types is by multiplying a data type with " +"a positive integer::" +msgstr "" +"Рекомендований спосіб створення типів масивів – це множення типу даних на " +"додатне ціле:" + +msgid "TenPointsArrayType = POINT * 10" +msgstr "" + +msgid "" +"Here is an example of a somewhat artificial data type, a structure " +"containing 4 POINTs among other stuff::" +msgstr "" +"Ось приклад дещо штучного типу даних, структура, яка містить 4 ТОЧКИ серед " +"іншого:" + +msgid "" +">>> from ctypes import *\n" +">>> class POINT(Structure):\n" +"... _fields_ = (\"x\", c_int), (\"y\", c_int)\n" +"...\n" +">>> class MyStruct(Structure):\n" +"... _fields_ = [(\"a\", c_int),\n" +"... (\"b\", c_float),\n" +"... (\"point_array\", POINT * 4)]\n" +">>>\n" +">>> print(len(MyStruct().point_array))\n" +"4\n" +">>>" +msgstr "" + +msgid "Instances are created in the usual way, by calling the class::" +msgstr "Екземпляри створюються звичайним способом за допомогою виклику класу::" + +msgid "" +"arr = TenPointsArrayType()\n" +"for pt in arr:\n" +" print(pt.x, pt.y)" +msgstr "" + +msgid "" +"The above code print a series of ``0 0`` lines, because the array contents " +"is initialized to zeros." +msgstr "" +"Наведений вище код друкує серію рядків ``0 0``, оскільки вміст масиву " +"ініціалізовано нулями." + +msgid "Initializers of the correct type can also be specified::" +msgstr "Також можна вказати ініціалізатори правильного типу:" + +msgid "" +">>> from ctypes import *\n" +">>> TenIntegers = c_int * 10\n" +">>> ii = TenIntegers(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)\n" +">>> print(ii)\n" +"\n" +">>> for i in ii: print(i, end=\" \")\n" +"...\n" +"1 2 3 4 5 6 7 8 9 10\n" +">>>" +msgstr "" + +msgid "Pointers" +msgstr "Покажчики" + +msgid "" +"Pointer instances are created by calling the :func:`pointer` function on a :" +"mod:`ctypes` type::" +msgstr "" +"Екземпляри вказівника створюються шляхом виклику функції :func:`pointer` для " +"типу :mod:`ctypes`::" + +msgid "" +">>> from ctypes import *\n" +">>> i = c_int(42)\n" +">>> pi = pointer(i)\n" +">>>" +msgstr "" + +msgid "" +"Pointer instances have a :attr:`~_Pointer.contents` attribute which returns " +"the object to which the pointer points, the ``i`` object above::" +msgstr "" +"Екземпляри вказівника мають атрибут :attr:`~_Pointer.contents`, який " +"повертає об’єкт, на який вказує вказівник, об’єкт ``i`` вище::" + +msgid "" +">>> pi.contents\n" +"c_long(42)\n" +">>>" +msgstr "" + +msgid "" +"Note that :mod:`ctypes` does not have OOR (original object return), it " +"constructs a new, equivalent object each time you retrieve an attribute::" +msgstr "" +"Зауважте, що :mod:`ctypes` не має OOR (повернення вихідного об’єкта), він " +"створює новий, еквівалентний об’єкт кожного разу, коли ви отримуєте атрибут::" + +msgid "" +">>> pi.contents is i\n" +"False\n" +">>> pi.contents is pi.contents\n" +"False\n" +">>>" +msgstr "" + +msgid "" +"Assigning another :class:`c_int` instance to the pointer's contents " +"attribute would cause the pointer to point to the memory location where this " +"is stored::" +msgstr "" +"Призначення іншого екземпляра :class:`c_int` атрибуту contents вказівника " +"призведе до того, що вказівник вказуватиме на місце пам’яті, де це " +"зберігається::" + +msgid "" +">>> i = c_int(99)\n" +">>> pi.contents = i\n" +">>> pi.contents\n" +"c_long(99)\n" +">>>" +msgstr "" + +msgid "Pointer instances can also be indexed with integers::" +msgstr "Екземпляри вказівників також можна індексувати цілими числами::" + +msgid "" +">>> pi[0]\n" +"99\n" +">>>" +msgstr "" + +msgid "Assigning to an integer index changes the pointed to value::" +msgstr "Присвоєння цілочисельному індексу змінює вказане значення::" + +msgid "" +">>> print(i)\n" +"c_long(99)\n" +">>> pi[0] = 22\n" +">>> print(i)\n" +"c_long(22)\n" +">>>" +msgstr "" + +msgid "" +"It is also possible to use indexes different from 0, but you must know what " +"you're doing, just as in C: You can access or change arbitrary memory " +"locations. Generally you only use this feature if you receive a pointer from " +"a C function, and you *know* that the pointer actually points to an array " +"instead of a single item." +msgstr "" +"Також можна використовувати індекси, відмінні від 0, але ви повинні знати, " +"що ви робите, так само як у C: ви можете отримати доступ або змінити " +"довільні місця пам'яті. Зазвичай ви використовуєте цю функцію, лише якщо " +"отримуєте вказівник від функції C і *знаєте*, що вказівник насправді вказує " +"на масив, а не на один елемент." + +msgid "" +"Behind the scenes, the :func:`pointer` function does more than simply create " +"pointer instances, it has to create pointer *types* first. This is done with " +"the :func:`POINTER` function, which accepts any :mod:`ctypes` type, and " +"returns a new type::" +msgstr "" +"За лаштунками функція :func:`pointer` робить більше, ніж просто створює " +"екземпляри вказівників, вона повинна спочатку створити *типи* вказівників. " +"Це робиться за допомогою функції :func:`POINTER`, яка приймає будь-який тип :" +"mod:`ctypes` і повертає новий тип::" + +msgid "" +">>> PI = POINTER(c_int)\n" +">>> PI\n" +"\n" +">>> PI(42)\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"TypeError: expected c_long instead of int\n" +">>> PI(c_int(42))\n" +"\n" +">>>" +msgstr "" + +msgid "" +"Calling the pointer type without an argument creates a ``NULL`` pointer. " +"``NULL`` pointers have a ``False`` boolean value::" +msgstr "" +"Виклик типу покажчика без аргументу створює покажчик ``NULL``. Покажчики " +"``NULL`` мають логічне значення ``False``::" + +msgid "" +">>> null_ptr = POINTER(c_int)()\n" +">>> print(bool(null_ptr))\n" +"False\n" +">>>" +msgstr "" + +msgid "" +":mod:`ctypes` checks for ``NULL`` when dereferencing pointers (but " +"dereferencing invalid non-\\ ``NULL`` pointers would crash Python)::" +msgstr "" +":mod:`ctypes` перевіряє ``NULL`` під час розіменування вказівників (але " +"розіменування недійсних не\\ ``NULL`` вказівників призведе до збою Python)::" + +msgid "" +">>> null_ptr[0]\n" +"Traceback (most recent call last):\n" +" ....\n" +"ValueError: NULL pointer access\n" +">>>\n" +"\n" +">>> null_ptr[0] = 1234\n" +"Traceback (most recent call last):\n" +" ....\n" +"ValueError: NULL pointer access\n" +">>>" +msgstr "" + +msgid "Type conversions" +msgstr "Перетворення типів" + +msgid "" +"Usually, ctypes does strict type checking. This means, if you have " +"``POINTER(c_int)`` in the :attr:`~_CFuncPtr.argtypes` list of a function or " +"as the type of a member field in a structure definition, only instances of " +"exactly the same type are accepted. There are some exceptions to this rule, " +"where ctypes accepts other objects. For example, you can pass compatible " +"array instances instead of pointer types. So, for ``POINTER(c_int)``, " +"ctypes accepts an array of c_int::" +msgstr "" + +msgid "" +">>> class Bar(Structure):\n" +"... _fields_ = [(\"count\", c_int), (\"values\", POINTER(c_int))]\n" +"...\n" +">>> bar = Bar()\n" +">>> bar.values = (c_int * 3)(1, 2, 3)\n" +">>> bar.count = 3\n" +">>> for i in range(bar.count):\n" +"... print(bar.values[i])\n" +"...\n" +"1\n" +"2\n" +"3\n" +">>>" +msgstr "" + +msgid "" +"In addition, if a function argument is explicitly declared to be a pointer " +"type (such as ``POINTER(c_int)``) in :attr:`~_CFuncPtr.argtypes`, an object " +"of the pointed type (``c_int`` in this case) can be passed to the function. " +"ctypes will apply the required :func:`byref` conversion in this case " +"automatically." +msgstr "" + +msgid "To set a POINTER type field to ``NULL``, you can assign ``None``::" +msgstr "" +"Щоб встановити для поля типу POINTER значення ``NULL``, ви можете призначити " +"``None``::" + +msgid "" +">>> bar.values = None\n" +">>>" +msgstr "" + +msgid "" +"Sometimes you have instances of incompatible types. In C, you can cast one " +"type into another type. :mod:`ctypes` provides a :func:`cast` function " +"which can be used in the same way. The ``Bar`` structure defined above " +"accepts ``POINTER(c_int)`` pointers or :class:`c_int` arrays for its " +"``values`` field, but not instances of other types::" +msgstr "" +"Іноді у вас є екземпляри несумісних типів. У C ви можете привести один тип " +"до іншого. :mod:`ctypes` надає функцію :func:`cast`, яку можна " +"використовувати таким же чином. Структура ``Bar``, визначена вище, приймає " +"покажчики ``POINTER(c_int)`` або :class:`c_int` масиви для свого поля " +"``values``, але не примірники інших типів::" + +msgid "" +">>> bar.values = (c_byte * 4)()\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"TypeError: incompatible types, c_byte_Array_4 instance instead of LP_c_long " +"instance\n" +">>>" +msgstr "" + +msgid "For these cases, the :func:`cast` function is handy." +msgstr "Для цих випадків зручна функція :func:`cast`." + +msgid "" +"The :func:`cast` function can be used to cast a ctypes instance into a " +"pointer to a different ctypes data type. :func:`cast` takes two parameters, " +"a ctypes object that is or can be converted to a pointer of some kind, and a " +"ctypes pointer type. It returns an instance of the second argument, which " +"references the same memory block as the first argument::" +msgstr "" +"Функцію :func:`cast` можна використати для приведення екземпляра ctypes до " +"покажчика на інший тип даних ctypes. :func:`cast` приймає два параметри: " +"об’єкт ctypes, який є чи може бути перетворений на певний вказівник, і тип " +"вказівника ctypes. Він повертає екземпляр другого аргументу, який " +"посилається на той самий блок пам’яті, що й перший аргумент::" + +msgid "" +">>> a = (c_byte * 4)()\n" +">>> cast(a, POINTER(c_int))\n" +"\n" +">>>" +msgstr "" + +msgid "" +"So, :func:`cast` can be used to assign to the ``values`` field of ``Bar`` " +"the structure::" +msgstr "" +"Отже, :func:`cast` можна використовувати для призначення полю ``values`` " +"``Bar`` структури::" + +msgid "" +">>> bar = Bar()\n" +">>> bar.values = cast((c_byte * 4)(), POINTER(c_int))\n" +">>> print(bar.values[0])\n" +"0\n" +">>>" +msgstr "" + +msgid "Incomplete Types" +msgstr "Неповні типи" + +msgid "" +"*Incomplete Types* are structures, unions or arrays whose members are not " +"yet specified. In C, they are specified by forward declarations, which are " +"defined later::" +msgstr "" +"*Неповні типи* — це структури, об’єднання або масиви, члени яких ще не " +"визначено. У C вони визначені прямими оголошеннями, які визначені пізніше:" + +msgid "" +"struct cell; /* forward declaration */\n" +"\n" +"struct cell {\n" +" char *name;\n" +" struct cell *next;\n" +"};" +msgstr "" + +msgid "" +"The straightforward translation into ctypes code would be this, but it does " +"not work::" +msgstr "Прямий переклад у код ctypes буде таким, але він не працює:" + +msgid "" +">>> class cell(Structure):\n" +"... _fields_ = [(\"name\", c_char_p),\n" +"... (\"next\", POINTER(cell))]\n" +"...\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +" File \"\", line 2, in cell\n" +"NameError: name 'cell' is not defined\n" +">>>" +msgstr "" + +msgid "" +"because the new ``class cell`` is not available in the class statement " +"itself. In :mod:`ctypes`, we can define the ``cell`` class and set the :attr:" +"`~Structure._fields_` attribute later, after the class statement::" +msgstr "" + +msgid "" +">>> from ctypes import *\n" +">>> class cell(Structure):\n" +"... pass\n" +"...\n" +">>> cell._fields_ = [(\"name\", c_char_p),\n" +"... (\"next\", POINTER(cell))]\n" +">>>" +msgstr "" + +msgid "" +"Let's try it. We create two instances of ``cell``, and let them point to " +"each other, and finally follow the pointer chain a few times::" +msgstr "" +"Давайте спробуємо. Ми створюємо два екземпляри ``cell`` і дозволяємо їм " +"вказувати один на одного, і, нарешті, слідуємо за ланцюжком вказівників " +"кілька разів::" + +msgid "" +">>> c1 = cell()\n" +">>> c1.name = b\"foo\"\n" +">>> c2 = cell()\n" +">>> c2.name = b\"bar\"\n" +">>> c1.next = pointer(c2)\n" +">>> c2.next = pointer(c1)\n" +">>> p = c1\n" +">>> for i in range(8):\n" +"... print(p.name, end=\" \")\n" +"... p = p.next[0]\n" +"...\n" +"foo bar foo bar foo bar foo bar\n" +">>>" +msgstr "" + +msgid "Callback functions" +msgstr "Функції зворотного виклику" + +msgid "" +":mod:`ctypes` allows creating C callable function pointers from Python " +"callables. These are sometimes called *callback functions*." +msgstr "" +":mod:`ctypes` дозволяє створювати вказівники на функції C із викликів " +"Python. Іноді їх називають *функціями зворотного виклику*." + +msgid "" +"First, you must create a class for the callback function. The class knows " +"the calling convention, the return type, and the number and types of " +"arguments this function will receive." +msgstr "" +"По-перше, ви повинні створити клас для функції зворотного виклику. Клас знає " +"угоду про виклики, тип повернення, а також кількість і типи аргументів, які " +"ця функція отримає." + +msgid "" +"The :func:`CFUNCTYPE` factory function creates types for callback functions " +"using the ``cdecl`` calling convention. On Windows, the :func:`WINFUNCTYPE` " +"factory function creates types for callback functions using the ``stdcall`` " +"calling convention." +msgstr "" +"Фабрична функція :func:`CFUNCTYPE` створює типи для функцій зворотного " +"виклику за допомогою угоди про виклики ``cdecl``. У Windows фабрична " +"функція :func:`WINFUNCTYPE` створює типи для функцій зворотного виклику за " +"допомогою угоди про виклики ``stdcall``." + +msgid "" +"Both of these factory functions are called with the result type as first " +"argument, and the callback functions expected argument types as the " +"remaining arguments." +msgstr "" +"Обидві ці фабричні функції викликаються з типом результату як першим " +"аргументом, а функції зворотного виклику – очікуваними типами аргументів як " +"рештою аргументів." + +msgid "" +"I will present an example here which uses the standard C library's :c:func:`!" +"qsort` function, that is used to sort items with the help of a callback " +"function. :c:func:`!qsort` will be used to sort an array of integers::" +msgstr "" + +msgid "" +">>> IntArray5 = c_int * 5\n" +">>> ia = IntArray5(5, 1, 7, 33, 99)\n" +">>> qsort = libc.qsort\n" +">>> qsort.restype = None\n" +">>>" +msgstr "" + +msgid "" +":func:`!qsort` must be called with a pointer to the data to sort, the number " +"of items in the data array, the size of one item, and a pointer to the " +"comparison function, the callback. The callback will then be called with two " +"pointers to items, and it must return a negative integer if the first item " +"is smaller than the second, a zero if they are equal, and a positive integer " +"otherwise." +msgstr "" + +msgid "" +"So our callback function receives pointers to integers, and must return an " +"integer. First we create the ``type`` for the callback function::" +msgstr "" +"Таким чином, наша функція зворотного виклику отримує покажчики на цілі числа " +"та повинна повертати ціле число. Спочатку ми створюємо ``type`` для функції " +"зворотного виклику::" + +msgid "" +">>> CMPFUNC = CFUNCTYPE(c_int, POINTER(c_int), POINTER(c_int))\n" +">>>" +msgstr "" + +msgid "" +"To get started, here is a simple callback that shows the values it gets " +"passed::" +msgstr "" +"Щоб почати, ось простий зворотний виклик, який показує значення, які він " +"отримує:" + +msgid "" +">>> def py_cmp_func(a, b):\n" +"... print(\"py_cmp_func\", a[0], b[0])\n" +"... return 0\n" +"...\n" +">>> cmp_func = CMPFUNC(py_cmp_func)\n" +">>>" +msgstr "" + +msgid "The result::" +msgstr "Результат::" + +msgid "" +">>> qsort(ia, len(ia), sizeof(c_int), cmp_func)\n" +"py_cmp_func 5 1\n" +"py_cmp_func 33 99\n" +"py_cmp_func 7 33\n" +"py_cmp_func 5 7\n" +"py_cmp_func 1 7\n" +">>>" +msgstr "" + +msgid "Now we can actually compare the two items and return a useful result::" +msgstr "" +"Тепер ми фактично можемо порівняти два елементи та повернути корисний " +"результат:" + +msgid "" +">>> def py_cmp_func(a, b):\n" +"... print(\"py_cmp_func\", a[0], b[0])\n" +"... return a[0] - b[0]\n" +"...\n" +">>>\n" +">>> qsort(ia, len(ia), sizeof(c_int), CMPFUNC(py_cmp_func))\n" +"py_cmp_func 5 1\n" +"py_cmp_func 33 99\n" +"py_cmp_func 7 33\n" +"py_cmp_func 1 7\n" +"py_cmp_func 5 7\n" +">>>" +msgstr "" + +msgid "As we can easily check, our array is sorted now::" +msgstr "Як ми можемо легко перевірити, наш масив зараз відсортовано::" + +msgid "" +">>> for i in ia: print(i, end=\" \")\n" +"...\n" +"1 5 7 33 99\n" +">>>" +msgstr "" + +msgid "" +"The function factories can be used as decorator factories, so we may as well " +"write::" +msgstr "" +"Фабрики функцій можна використовувати як фабрики декораторів, тому ми також " +"можемо написати::" + +msgid "" +">>> @CFUNCTYPE(c_int, POINTER(c_int), POINTER(c_int))\n" +"... def py_cmp_func(a, b):\n" +"... print(\"py_cmp_func\", a[0], b[0])\n" +"... return a[0] - b[0]\n" +"...\n" +">>> qsort(ia, len(ia), sizeof(c_int), py_cmp_func)\n" +"py_cmp_func 5 1\n" +"py_cmp_func 33 99\n" +"py_cmp_func 7 33\n" +"py_cmp_func 1 7\n" +"py_cmp_func 5 7\n" +">>>" +msgstr "" + +msgid "" +"Make sure you keep references to :func:`CFUNCTYPE` objects as long as they " +"are used from C code. :mod:`ctypes` doesn't, and if you don't, they may be " +"garbage collected, crashing your program when a callback is made." +msgstr "" +"Переконайтеся, що ви зберігаєте посилання на об’єкти :func:`CFUNCTYPE`, доки " +"вони використовуються з коду C. :mod:`ctypes` не працює, і якщо ви цього не " +"зробите, вони можуть збиратися як сміття, що призведе до збою вашої програми " +"під час зворотного виклику." + +msgid "" +"Also, note that if the callback function is called in a thread created " +"outside of Python's control (e.g. by the foreign code that calls the " +"callback), ctypes creates a new dummy Python thread on every invocation. " +"This behavior is correct for most purposes, but it means that values stored " +"with :class:`threading.local` will *not* survive across different callbacks, " +"even when those calls are made from the same C thread." +msgstr "" +"Також зауважте, що якщо функція зворотнього виклику викликається в потоці, " +"створеному поза контролем Python (наприклад, зовнішнім кодом, який викликає " +"зворотній виклик), ctypes створює новий фіктивний потік Python під час " +"кожного виклику. Така поведінка є правильною для більшості цілей, але це " +"означає, що значення, збережені в :class:`threading.local` *не* збережуться " +"в різних зворотних викликах, навіть якщо ці виклики здійснюються з того " +"самого потоку C." + +msgid "Accessing values exported from dlls" +msgstr "Доступ до значень, експортованих із dll" + +msgid "" +"Some shared libraries not only export functions, they also export variables. " +"An example in the Python library itself is the :c:data:`Py_Version`, Python " +"runtime version number encoded in a single constant integer." +msgstr "" + +msgid "" +":mod:`ctypes` can access values like this with the :meth:`~_CData.in_dll` " +"class methods of the type. *pythonapi* is a predefined symbol giving access " +"to the Python C api::" +msgstr "" + +msgid "" +">>> version = ctypes.c_int.in_dll(ctypes.pythonapi, \"Py_Version\")\n" +">>> print(hex(version.value))\n" +"0x30c00a0" +msgstr "" + +msgid "" +"An extended example which also demonstrates the use of pointers accesses " +"the :c:data:`PyImport_FrozenModules` pointer exported by Python." +msgstr "" +"Розширений приклад, який також демонструє використання покажчиків, " +"звертається до покажчика :c:data:`PyImport_FrozenModules`, експортованого " +"Python." + +msgid "Quoting the docs for that value:" +msgstr "Цитування документів для цього значення:" + +msgid "" +"This pointer is initialized to point to an array of :c:struct:`_frozen` " +"records, terminated by one whose members are all ``NULL`` or zero. When a " +"frozen module is imported, it is searched in this table. Third-party code " +"could play tricks with this to provide a dynamically created collection of " +"frozen modules." +msgstr "" + +msgid "" +"So manipulating this pointer could even prove useful. To restrict the " +"example size, we show only how this table can be read with :mod:`ctypes`::" +msgstr "" +"Тож маніпулювання цим покажчиком може навіть виявитися корисним. Щоб " +"обмежити розмір прикладу, ми показуємо лише те, як цю таблицю можна " +"прочитати за допомогою :mod:`ctypes`::" + +msgid "" +">>> from ctypes import *\n" +">>>\n" +">>> class struct_frozen(Structure):\n" +"... _fields_ = [(\"name\", c_char_p),\n" +"... (\"code\", POINTER(c_ubyte)),\n" +"... (\"size\", c_int),\n" +"... (\"get_code\", POINTER(c_ubyte)), # Function pointer\n" +"... ]\n" +"...\n" +">>>" +msgstr "" + +msgid "" +"We have defined the :c:struct:`_frozen` data type, so we can get the pointer " +"to the table::" +msgstr "" + +msgid "" +">>> FrozenTable = POINTER(struct_frozen)\n" +">>> table = FrozenTable.in_dll(pythonapi, \"_PyImport_FrozenBootstrap\")\n" +">>>" +msgstr "" + +msgid "" +"Since ``table`` is a ``pointer`` to the array of ``struct_frozen`` records, " +"we can iterate over it, but we just have to make sure that our loop " +"terminates, because pointers have no size. Sooner or later it would probably " +"crash with an access violation or whatever, so it's better to break out of " +"the loop when we hit the ``NULL`` entry::" +msgstr "" +"Оскільки ``table`` є ``покажчиком`` на масив ``struct_frozen`` записів, ми " +"можемо перебирати його, але нам просто потрібно переконатися, що наш цикл " +"завершується, оскільки покажчики не мають розміру. Рано чи пізно він, " +"ймовірно, вийде з ладу через порушення прав доступу чи щось інше, тому краще " +"вийти з циклу, коли ми натиснемо запис ``NULL``::" + +msgid "" +">>> for item in table:\n" +"... if item.name is None:\n" +"... break\n" +"... print(item.name.decode(\"ascii\"), item.size)\n" +"...\n" +"_frozen_importlib 31764\n" +"_frozen_importlib_external 41499\n" +"zipimport 12345\n" +">>>" +msgstr "" + +msgid "" +"The fact that standard Python has a frozen module and a frozen package " +"(indicated by the negative ``size`` member) is not well known, it is only " +"used for testing. Try it out with ``import __hello__`` for example." +msgstr "" +"Той факт, що стандартний Python має заморожений модуль і заморожений пакет " +"(позначений від’ємним елементом ``size``), невідомий, він використовується " +"лише для тестування. Спробуйте, наприклад, ``import __hello__``." + +msgid "Surprises" +msgstr "Сюрпризи" + +msgid "" +"There are some edges in :mod:`ctypes` where you might expect something other " +"than what actually happens." +msgstr "" +"У :mod:`ctypes` є деякі переваги, де ви можете очікувати щось інше, ніж те, " +"що відбувається насправді." + +msgid "Consider the following example::" +msgstr "Розглянемо такий приклад:" + +msgid "" +">>> from ctypes import *\n" +">>> class POINT(Structure):\n" +"... _fields_ = (\"x\", c_int), (\"y\", c_int)\n" +"...\n" +">>> class RECT(Structure):\n" +"... _fields_ = (\"a\", POINT), (\"b\", POINT)\n" +"...\n" +">>> p1 = POINT(1, 2)\n" +">>> p2 = POINT(3, 4)\n" +">>> rc = RECT(p1, p2)\n" +">>> print(rc.a.x, rc.a.y, rc.b.x, rc.b.y)\n" +"1 2 3 4\n" +">>> # now swap the two points\n" +">>> rc.a, rc.b = rc.b, rc.a\n" +">>> print(rc.a.x, rc.a.y, rc.b.x, rc.b.y)\n" +"3 4 3 4\n" +">>>" +msgstr "" + +msgid "" +"Hm. We certainly expected the last statement to print ``3 4 1 2``. What " +"happened? Here are the steps of the ``rc.a, rc.b = rc.b, rc.a`` line above::" +msgstr "" +"Хм Ми, безумовно, очікували, що останній оператор виведе ``3 4 1 2``. Що " +"трапилось? Ось кроки рядка ``rc.a, rc.b = rc.b, rc.a``:" + +msgid "" +">>> temp0, temp1 = rc.b, rc.a\n" +">>> rc.a = temp0\n" +">>> rc.b = temp1\n" +">>>" +msgstr "" + +msgid "" +"Note that ``temp0`` and ``temp1`` are objects still using the internal " +"buffer of the ``rc`` object above. So executing ``rc.a = temp0`` copies the " +"buffer contents of ``temp0`` into ``rc`` 's buffer. This, in turn, changes " +"the contents of ``temp1``. So, the last assignment ``rc.b = temp1``, doesn't " +"have the expected effect." +msgstr "" +"Зауважте, що ``temp0`` і ``temp1`` є об’єктами, які все ще використовують " +"внутрішній буфер об’єкта ``rc`` вище. Отже, виконання ``rc.a = temp0`` " +"копіює вміст буфера ``temp0`` у буфер ``rc``. Це, у свою чергу, змінює вміст " +"``temp1``. Отже, останнє призначення ``rc.b = temp1`` не має очікуваного " +"ефекту." + +msgid "" +"Keep in mind that retrieving sub-objects from Structure, Unions, and Arrays " +"doesn't *copy* the sub-object, instead it retrieves a wrapper object " +"accessing the root-object's underlying buffer." +msgstr "" +"Майте на увазі, що отримання підоб’єктів зі структур, об’єднань і масивів не " +"*копіює* підоб’єкт, натомість отримує обгортку об’єкта, який отримує доступ " +"до основного буфера кореневого об’єкта." + +msgid "" +"Another example that may behave differently from what one would expect is " +"this::" +msgstr "Інший приклад, який може поводитися інакше, ніж очікувалося, це:" + +msgid "" +">>> s = c_char_p()\n" +">>> s.value = b\"abc def ghi\"\n" +">>> s.value\n" +"b'abc def ghi'\n" +">>> s.value is s.value\n" +"False\n" +">>>" +msgstr "" + +msgid "" +"Objects instantiated from :class:`c_char_p` can only have their value set to " +"bytes or integers." +msgstr "" +"Об’єкти, створені з :class:`c_char_p`, можуть мати значення лише байтів або " +"цілих чисел." + +msgid "" +"Why is it printing ``False``? ctypes instances are objects containing a " +"memory block plus some :term:`descriptor`\\s accessing the contents of the " +"memory. Storing a Python object in the memory block does not store the " +"object itself, instead the ``contents`` of the object is stored. Accessing " +"the contents again constructs a new Python object each time!" +msgstr "" +"Чому він друкує ``False``? Екземпляри ctypes — це об’єкти, що містять блок " +"пам’яті плюс деякі :term:`descriptor`\\, що мають доступ до вмісту пам’яті. " +"Зберігання об’єкта Python у блоці пам’яті не зберігає сам об’єкт, натомість " +"зберігається ``вміст`` об’єкта. Повторний доступ до вмісту щоразу створює " +"новий об’єкт Python!" + +msgid "Variable-sized data types" +msgstr "Типи даних змінного розміру" + +msgid "" +":mod:`ctypes` provides some support for variable-sized arrays and structures." +msgstr "" +":mod:`ctypes` забезпечує деяку підтримку для масивів і структур змінного " +"розміру." + +msgid "" +"The :func:`resize` function can be used to resize the memory buffer of an " +"existing ctypes object. The function takes the object as first argument, " +"and the requested size in bytes as the second argument. The memory block " +"cannot be made smaller than the natural memory block specified by the " +"objects type, a :exc:`ValueError` is raised if this is tried::" +msgstr "" +"Функцію :func:`resize` можна використовувати для зміни розміру буфера " +"пам’яті існуючого об’єкта ctypes. Функція приймає об’єкт як перший аргумент, " +"а запитуваний розмір у байтах як другий аргумент. Блок пам’яті не може бути " +"меншим, ніж природний блок пам’яті, визначений типом об’єкта, :exc:" +"`ValueError` виникає, якщо це спробувати::" + +msgid "" +">>> short_array = (c_short * 4)()\n" +">>> print(sizeof(short_array))\n" +"8\n" +">>> resize(short_array, 4)\n" +"Traceback (most recent call last):\n" +" ...\n" +"ValueError: minimum size is 8\n" +">>> resize(short_array, 32)\n" +">>> sizeof(short_array)\n" +"32\n" +">>> sizeof(type(short_array))\n" +"8\n" +">>>" +msgstr "" + +msgid "" +"This is nice and fine, but how would one access the additional elements " +"contained in this array? Since the type still only knows about 4 elements, " +"we get errors accessing other elements::" +msgstr "" +"Це гарно і добре, але як отримати доступ до додаткових елементів, що " +"містяться в цьому масиві? Оскільки тип все ще знає лише про 4 елементи, ми " +"отримуємо помилки під час доступу до інших елементів::" + +msgid "" +">>> short_array[:]\n" +"[0, 0, 0, 0]\n" +">>> short_array[7]\n" +"Traceback (most recent call last):\n" +" ...\n" +"IndexError: invalid index\n" +">>>" +msgstr "" + +msgid "" +"Another way to use variable-sized data types with :mod:`ctypes` is to use " +"the dynamic nature of Python, and (re-)define the data type after the " +"required size is already known, on a case by case basis." +msgstr "" +"Інший спосіб використання типів даних змінного розміру з :mod:`ctypes` — це " +"використання динамічної природи Python і (повторне) визначення типу даних " +"після того, як потрібний розмір уже відомий, у кожному конкретному випадку." + +msgid "ctypes reference" +msgstr "посилання на ctypes" + +msgid "Finding shared libraries" +msgstr "Пошук спільних бібліотек" + +msgid "" +"When programming in a compiled language, shared libraries are accessed when " +"compiling/linking a program, and when the program is run." +msgstr "" +"Під час програмування скомпільованою мовою доступ до спільних бібліотек " +"здійснюється під час компіляції/зв’язування програми та під час виконання " +"програми." + +msgid "" +"The purpose of the :func:`~ctypes.util.find_library` function is to locate a " +"library in a way similar to what the compiler or runtime loader does (on " +"platforms with several versions of a shared library the most recent should " +"be loaded), while the ctypes library loaders act like when a program is run, " +"and call the runtime loader directly." +msgstr "" + +msgid "" +"The :mod:`!ctypes.util` module provides a function which can help to " +"determine the library to load." +msgstr "" + +msgid "" +"Try to find a library and return a pathname. *name* is the library name " +"without any prefix like *lib*, suffix like ``.so``, ``.dylib`` or version " +"number (this is the form used for the posix linker option :option:`!-l`). " +"If no library can be found, returns ``None``." +msgstr "" +"Спробуйте знайти бібліотеку та повернути шлях. *name* — це назва бібліотеки " +"без будь-якого префікса, як-от *lib*, суфікса, як-от ``.so``, ``.dylib`` або " +"номера версії (це форма, яка використовується для параметра компонування " +"posix :option:`!- l`). Якщо бібліотеки не знайдено, повертає ``None``." + +msgid "The exact functionality is system dependent." +msgstr "Точна функція залежить від системи." + +msgid "" +"On Linux, :func:`~ctypes.util.find_library` tries to run external programs " +"(``/sbin/ldconfig``, ``gcc``, ``objdump`` and ``ld``) to find the library " +"file. It returns the filename of the library file." +msgstr "" + +msgid "" +"On Linux, the value of the environment variable ``LD_LIBRARY_PATH`` is used " +"when searching for libraries, if a library cannot be found by any other " +"means." +msgstr "" +"У Linux значення змінної середовища ``LD_LIBRARY_PATH`` використовується під " +"час пошуку бібліотек, якщо бібліотеку неможливо знайти будь-яким іншим " +"способом." + +msgid "Here are some examples::" +msgstr "Ось кілька прикладів:" + +msgid "" +">>> from ctypes.util import find_library\n" +">>> find_library(\"m\")\n" +"'libm.so.6'\n" +">>> find_library(\"c\")\n" +"'libc.so.6'\n" +">>> find_library(\"bz2\")\n" +"'libbz2.so.1.0'\n" +">>>" +msgstr "" + +msgid "" +"On macOS and Android, :func:`~ctypes.util.find_library` uses the system's " +"standard naming schemes and paths to locate the library, and returns a full " +"pathname if successful::" +msgstr "" + +msgid "" +">>> from ctypes.util import find_library\n" +">>> find_library(\"c\")\n" +"'/usr/lib/libc.dylib'\n" +">>> find_library(\"m\")\n" +"'/usr/lib/libm.dylib'\n" +">>> find_library(\"bz2\")\n" +"'/usr/lib/libbz2.dylib'\n" +">>> find_library(\"AGL\")\n" +"'/System/Library/Frameworks/AGL.framework/AGL'\n" +">>>" +msgstr "" + +msgid "" +"On Windows, :func:`~ctypes.util.find_library` searches along the system " +"search path, and returns the full pathname, but since there is no predefined " +"naming scheme a call like ``find_library(\"c\")`` will fail and return " +"``None``." +msgstr "" + +msgid "" +"If wrapping a shared library with :mod:`ctypes`, it *may* be better to " +"determine the shared library name at development time, and hardcode that " +"into the wrapper module instead of using :func:`~ctypes.util.find_library` " +"to locate the library at runtime." +msgstr "" + +msgid "Loading shared libraries" +msgstr "Завантаження спільних бібліотек" + +msgid "" +"There are several ways to load shared libraries into the Python process. " +"One way is to instantiate one of the following classes:" +msgstr "" +"Є кілька способів завантажити спільні бібліотеки в процес Python. Одним із " +"способів є створення екземпляра одного з наступних класів:" + +msgid "" +"Instances of this class represent loaded shared libraries. Functions in " +"these libraries use the standard C calling convention, and are assumed to " +"return :c:expr:`int`." +msgstr "" + +msgid "" +"On Windows creating a :class:`CDLL` instance may fail even if the DLL name " +"exists. When a dependent DLL of the loaded DLL is not found, a :exc:" +"`OSError` error is raised with the message *\"[WinError 126] The specified " +"module could not be found\".* This error message does not contain the name " +"of the missing DLL because the Windows API does not return this information " +"making this error hard to diagnose. To resolve this error and determine " +"which DLL is not found, you need to find the list of dependent DLLs and " +"determine which one is not found using Windows debugging and tracing tools." +msgstr "" +"У Windows створення екземпляра :class:`CDLL` може завершитися помилкою, " +"навіть якщо ім’я DLL існує. Якщо залежну DLL від завантаженої DLL не " +"знайдено, виникає помилка :exc:`OSError` із повідомленням *\"[WinError 126] " +"Не вдалося знайти вказаний модуль\".* Це повідомлення про помилку не містить " +"назви відсутня DLL, оскільки Windows API не повертає цю інформацію, що " +"ускладнює діагностику цієї помилки. Щоб усунути цю помилку та визначити, яку " +"DLL не знайдено, потрібно знайти список залежних DLL і визначити, яка з них " +"не знайдена, за допомогою засобів налагодження та трасування Windows." + +msgid "The *name* parameter can now be a :term:`path-like object`." +msgstr "" + +msgid "" +"`Microsoft DUMPBIN tool `_ -- A tool to find DLL dependents." +msgstr "" +"`Інструмент Microsoft DUMPBIN `_ -- Інструмент для пошуку залежних DLL." + +msgid "" +"Instances of this class represent loaded shared libraries, functions in " +"these libraries use the ``stdcall`` calling convention, and are assumed to " +"return the windows specific :class:`HRESULT` code. :class:`HRESULT` values " +"contain information specifying whether the function call failed or " +"succeeded, together with additional error code. If the return value signals " +"a failure, an :class:`OSError` is automatically raised." +msgstr "" + +msgid "Availability" +msgstr "" + +msgid "" +":exc:`WindowsError` used to be raised, which is now an alias of :exc:" +"`OSError`." +msgstr "" + +msgid "" +"Instances of this class represent loaded shared libraries, functions in " +"these libraries use the ``stdcall`` calling convention, and are assumed to " +"return :c:expr:`int` by default." +msgstr "" + +msgid "" +"The Python :term:`global interpreter lock` is released before calling any " +"function exported by these libraries, and reacquired afterwards." +msgstr "" +":term:`global interpreter lock` Python знімається перед викликом будь-якої " +"функції, експортованої цими бібліотеками, і знову отримується після цього." + +msgid "" +"Instances of this class behave like :class:`CDLL` instances, except that the " +"Python GIL is *not* released during the function call, and after the " +"function execution the Python error flag is checked. If the error flag is " +"set, a Python exception is raised." +msgstr "" +"Екземпляри цього класу поводяться як екземпляри :class:`CDLL`, за винятком " +"того, що GIL Python *не* звільняється під час виклику функції, а після " +"виконання функції перевіряється позначка помилки Python. Якщо встановлено " +"позначку помилки, виникає виняток Python." + +msgid "Thus, this is only useful to call Python C api functions directly." +msgstr "Таким чином, це корисно лише для прямого виклику API-функцій Python C." + +msgid "" +"All these classes can be instantiated by calling them with at least one " +"argument, the pathname of the shared library. If you have an existing " +"handle to an already loaded shared library, it can be passed as the " +"``handle`` named parameter, otherwise the underlying platform's :c:func:`!" +"dlopen` or :c:func:`!LoadLibrary` function is used to load the library into " +"the process, and to get a handle to it." +msgstr "" + +msgid "" +"The *mode* parameter can be used to specify how the library is loaded. For " +"details, consult the :manpage:`dlopen(3)` manpage. On Windows, *mode* is " +"ignored. On posix systems, RTLD_NOW is always added, and is not " +"configurable." +msgstr "" +"Параметр *mode* можна використовувати для визначення способу завантаження " +"бібліотеки. Додаткову інформацію див. на сторінці довідки :manpage:" +"`dlopen(3)`. У Windows *режим* ігнорується. У системах posix RTLD_NOW завжди " +"додається та не налаштовується." + +msgid "" +"The *use_errno* parameter, when set to true, enables a ctypes mechanism that " +"allows accessing the system :data:`errno` error number in a safe way. :mod:" +"`ctypes` maintains a thread-local copy of the system's :data:`errno` " +"variable; if you call foreign functions created with ``use_errno=True`` then " +"the :data:`errno` value before the function call is swapped with the ctypes " +"private copy, the same happens immediately after the function call." +msgstr "" + +msgid "" +"The function :func:`ctypes.get_errno` returns the value of the ctypes " +"private copy, and the function :func:`ctypes.set_errno` changes the ctypes " +"private copy to a new value and returns the former value." +msgstr "" +"Функція :func:`ctypes.get_errno` повертає значення приватної копії ctypes, а " +"функція :func:`ctypes.set_errno` змінює приватну копію ctypes на нове " +"значення та повертає попереднє значення." + +msgid "" +"The *use_last_error* parameter, when set to true, enables the same mechanism " +"for the Windows error code which is managed by the :func:`GetLastError` and :" +"func:`!SetLastError` Windows API functions; :func:`ctypes.get_last_error` " +"and :func:`ctypes.set_last_error` are used to request and change the ctypes " +"private copy of the windows error code." +msgstr "" + +msgid "" +"The *winmode* parameter is used on Windows to specify how the library is " +"loaded (since *mode* is ignored). It takes any value that is valid for the " +"Win32 API ``LoadLibraryEx`` flags parameter. When omitted, the default is to " +"use the flags that result in the most secure DLL load, which avoids issues " +"such as DLL hijacking. Passing the full path to the DLL is the safest way to " +"ensure the correct library and dependencies are loaded." +msgstr "" + +msgid "Added *winmode* parameter." +msgstr "Додано параметр *winmode*." + +msgid "" +"Flag to use as *mode* parameter. On platforms where this flag is not " +"available, it is defined as the integer zero." +msgstr "" +"Прапор для використання як параметр *mode*. На платформах, де цей прапорець " +"недоступний, він визначається як цілий нуль." + +msgid "" +"Flag to use as *mode* parameter. On platforms where this is not available, " +"it is the same as *RTLD_GLOBAL*." +msgstr "" +"Прапор для використання як параметр *mode*. На платформах, де це недоступно, " +"це те саме, що *RTLD_GLOBAL*." + +msgid "" +"The default mode which is used to load shared libraries. On OSX 10.3, this " +"is *RTLD_GLOBAL*, otherwise it is the same as *RTLD_LOCAL*." +msgstr "" +"Типовий режим, який використовується для завантаження спільних бібліотек. В " +"OSX 10.3 це *RTLD_GLOBAL*, інакше це те саме, що *RTLD_LOCAL*." + +msgid "" +"Instances of these classes have no public methods. Functions exported by " +"the shared library can be accessed as attributes or by index. Please note " +"that accessing the function through an attribute caches the result and " +"therefore accessing it repeatedly returns the same object each time. On the " +"other hand, accessing it through an index returns a new object each time::" +msgstr "" +"Екземпляри цих класів не мають відкритих методів. Доступ до функцій, " +"експортованих спільною бібліотекою, можна отримати як за атрибутами або за " +"індексом. Будь ласка, зверніть увагу, що доступ до функції через атрибут " +"кешує результат, тому повторний доступ повертає той самий об’єкт щоразу. З " +"іншого боку, доступ до нього через індекс кожного разу повертає новий " +"об’єкт::" + +msgid "" +">>> from ctypes import CDLL\n" +">>> libc = CDLL(\"libc.so.6\") # On Linux\n" +">>> libc.time == libc.time\n" +"True\n" +">>> libc['time'] == libc['time']\n" +"False" +msgstr "" + +msgid "" +"The following public attributes are available, their name starts with an " +"underscore to not clash with exported function names:" +msgstr "" +"Доступні такі загальнодоступні атрибути, їх імена починаються з " +"підкреслення, щоб не суперечити ім’ям експортованих функцій:" + +msgid "The system handle used to access the library." +msgstr "Системний дескриптор, який використовується для доступу до бібліотеки." + +msgid "The name of the library passed in the constructor." +msgstr "Ім'я бібліотеки, передане в конструктор." + +msgid "" +"Shared libraries can also be loaded by using one of the prefabricated " +"objects, which are instances of the :class:`LibraryLoader` class, either by " +"calling the :meth:`~LibraryLoader.LoadLibrary` method, or by retrieving the " +"library as attribute of the loader instance." +msgstr "" + +msgid "" +"Class which loads shared libraries. *dlltype* should be one of the :class:" +"`CDLL`, :class:`PyDLL`, :class:`WinDLL`, or :class:`OleDLL` types." +msgstr "" +"Клас, який завантажує спільні бібліотеки. *dlltype* має бути одним із типів :" +"class:`CDLL`, :class:`PyDLL`, :class:`WinDLL` або :class:`OleDLL`." + +msgid "" +":meth:`!__getattr__` has special behavior: It allows loading a shared " +"library by accessing it as attribute of a library loader instance. The " +"result is cached, so repeated attribute accesses return the same library " +"each time." +msgstr "" + +msgid "" +"Load a shared library into the process and return it. This method always " +"returns a new instance of the library." +msgstr "" +"Завантажте спільну бібліотеку в процес і поверніть її. Цей метод завжди " +"повертає новий екземпляр бібліотеки." + +msgid "These prefabricated library loaders are available:" +msgstr "Ці збірні бібліотечні завантажувачі доступні:" + +msgid "Creates :class:`CDLL` instances." +msgstr "Створює екземпляри :class:`CDLL`." + +msgid "Creates :class:`WinDLL` instances." +msgstr "" + +msgid "Creates :class:`OleDLL` instances." +msgstr "" + +msgid "Creates :class:`PyDLL` instances." +msgstr "Створює екземпляри :class:`PyDLL`." + +msgid "" +"For accessing the C Python api directly, a ready-to-use Python shared " +"library object is available:" +msgstr "" +"Для прямого доступу до API C Python доступний готовий до використання об’єкт " +"спільної бібліотеки Python:" + +msgid "" +"An instance of :class:`PyDLL` that exposes Python C API functions as " +"attributes. Note that all these functions are assumed to return C :c:expr:" +"`int`, which is of course not always the truth, so you have to assign the " +"correct :attr:`!restype` attribute to use these functions." +msgstr "" + +msgid "" +"Loading a library through any of these objects raises an :ref:`auditing " +"event ` ``ctypes.dlopen`` with string argument ``name``, the name " +"used to load the library." +msgstr "" +"Завантаження бібліотеки через будь-який із цих об’єктів викликає :ref:`подію " +"аудиту ` ``ctypes.dlopen`` з рядковим аргументом ``name``, іменем, " +"яке використовується для завантаження бібліотеки." + +msgid "" +"Accessing a function on a loaded library raises an auditing event ``ctypes." +"dlsym`` with arguments ``library`` (the library object) and ``name`` (the " +"symbol's name as a string or integer)." +msgstr "" +"Доступ до функції у завантаженій бібліотеці викликає подію аудиту ``ctypes." +"dlsym`` з аргументами ``library`` (об’єкт бібліотеки) і ``name`` (ім’я " +"символу у вигляді рядка або цілого числа)." + +msgid "" +"In cases when only the library handle is available rather than the object, " +"accessing a function raises an auditing event ``ctypes.dlsym/handle`` with " +"arguments ``handle`` (the raw library handle) and ``name``." +msgstr "" +"У випадках, коли доступний лише дескриптор бібліотеки, а не об’єкт, доступ " +"до функції викликає подію аудиту ``ctypes.dlsym/handle`` з аргументами " +"``handle`` (необроблений дескриптор бібліотеки) і ``name``." + +msgid "Foreign functions" +msgstr "Іноземні функції" + +msgid "" +"As explained in the previous section, foreign functions can be accessed as " +"attributes of loaded shared libraries. The function objects created in this " +"way by default accept any number of arguments, accept any ctypes data " +"instances as arguments, and return the default result type specified by the " +"library loader." +msgstr "" + +msgid "" +"They are instances of a private local class :class:`!_FuncPtr` (not exposed " +"in :mod:`!ctypes`) which inherits from the private :class:`_CFuncPtr` class:" +msgstr "" + +msgid "" +">>> import ctypes\n" +">>> lib = ctypes.CDLL(None)\n" +">>> issubclass(lib._FuncPtr, ctypes._CFuncPtr)\n" +"True\n" +">>> lib._FuncPtr is ctypes._CFuncPtr\n" +"False" +msgstr "" + +msgid "Base class for C callable foreign functions." +msgstr "Базовий клас для зовнішніх функцій C, що викликаються." + +msgid "" +"Instances of foreign functions are also C compatible data types; they " +"represent C function pointers." +msgstr "" +"Примірники сторонніх функцій також є C-сумісними типами даних; вони " +"представляють покажчики функцій C." + +msgid "" +"This behavior can be customized by assigning to special attributes of the " +"foreign function object." +msgstr "" +"Цю поведінку можна налаштувати шляхом призначення спеціальних атрибутів " +"стороннього функціонального об’єкта." + +msgid "" +"Assign a ctypes type to specify the result type of the foreign function. Use " +"``None`` for :c:expr:`void`, a function not returning anything." +msgstr "" + +msgid "" +"It is possible to assign a callable Python object that is not a ctypes type, " +"in this case the function is assumed to return a C :c:expr:`int`, and the " +"callable will be called with this integer, allowing further processing or " +"error checking. Using this is deprecated, for more flexible post processing " +"or error checking use a ctypes data type as :attr:`!restype` and assign a " +"callable to the :attr:`errcheck` attribute." +msgstr "" + +msgid "" +"Assign a tuple of ctypes types to specify the argument types that the " +"function accepts. Functions using the ``stdcall`` calling convention can " +"only be called with the same number of arguments as the length of this " +"tuple; functions using the C calling convention accept additional, " +"unspecified arguments as well." +msgstr "" +"Призначте кортеж типів ctypes, щоб указати типи аргументів, які приймає " +"функція. Функції, які використовують угоду про виклики ``stdcall``, можуть " +"бути викликані лише з тією ж кількістю аргументів, що й довжина цього " +"кортежу; функції, що використовують угоду про виклики C, також приймають " +"додаткові, невизначені аргументи." + +msgid "" +"When a foreign function is called, each actual argument is passed to the :" +"meth:`~_CData.from_param` class method of the items in the :attr:`argtypes` " +"tuple, this method allows adapting the actual argument to an object that the " +"foreign function accepts. For example, a :class:`c_char_p` item in the :" +"attr:`argtypes` tuple will convert a string passed as argument into a bytes " +"object using ctypes conversion rules." +msgstr "" + +msgid "" +"New: It is now possible to put items in argtypes which are not ctypes types, " +"but each item must have a :meth:`~_CData.from_param` method which returns a " +"value usable as argument (integer, string, ctypes instance). This allows " +"defining adapters that can adapt custom objects as function parameters." +msgstr "" + +msgid "" +"Assign a Python function or another callable to this attribute. The callable " +"will be called with three or more arguments:" +msgstr "" +"Призначте цьому атрибуту функцію Python або інший виклик. Викликається з " +"трьома або більше аргументами:" + +msgid "" +"*result* is what the foreign function returns, as specified by the :attr:`!" +"restype` attribute." +msgstr "" + +msgid "" +"*func* is the foreign function object itself, this allows reusing the same " +"callable object to check or post process the results of several functions." +msgstr "" +"*func* — це сам зовнішній об’єкт функції, це дозволяє повторно " +"використовувати той самий об’єкт, що викликається, для перевірки або " +"постобробки результатів кількох функцій." + +msgid "" +"*arguments* is a tuple containing the parameters originally passed to the " +"function call, this allows specializing the behavior on the arguments used." +msgstr "" +"*Аргументи* — це кортеж, що містить параметри, спочатку передані до виклику " +"функції, що дозволяє спеціалізувати поведінку на використовуваних аргументах." + +msgid "" +"The object that this function returns will be returned from the foreign " +"function call, but it can also check the result value and raise an exception " +"if the foreign function call failed." +msgstr "" +"Об’єкт, який повертає ця функція, буде повернено з виклику зовнішньої " +"функції, але він також може перевірити значення результату та викликати " +"виняток, якщо виклик зовнішньої функції не вдався." + +msgid "" +"This exception is raised when a foreign function call cannot convert one of " +"the passed arguments." +msgstr "" +"Цей виняток виникає, коли зовнішній виклик функції не може перетворити один " +"із переданих аргументів." + +msgid "" +"On Windows, when a foreign function call raises a system exception (for " +"example, due to an access violation), it will be captured and replaced with " +"a suitable Python exception. Further, an auditing event ``ctypes." +"set_exception`` with argument ``code`` will be raised, allowing an audit " +"hook to replace the exception with its own." +msgstr "" + +msgid "" +"Some ways to invoke foreign function calls may raise an auditing event " +"``ctypes.call_function`` with arguments ``function pointer`` and " +"``arguments``." +msgstr "" +"Деякі способи виклику зовнішніх викликів функцій можуть викликати подію " +"аудиту ``ctypes.call_function`` з аргументами ``вказівник функції`` і " +"``аргументи``." + +msgid "Function prototypes" +msgstr "Прототипи функцій" + +msgid "" +"Foreign functions can also be created by instantiating function prototypes. " +"Function prototypes are similar to function prototypes in C; they describe a " +"function (return type, argument types, calling convention) without defining " +"an implementation. The factory functions must be called with the desired " +"result type and the argument types of the function, and can be used as " +"decorator factories, and as such, be applied to functions through the " +"``@wrapper`` syntax. See :ref:`ctypes-callback-functions` for examples." +msgstr "" +"Сторонні функції також можуть бути створені шляхом інстанціювання прототипів " +"функцій. Прототипи функцій подібні до прототипів функцій у C; вони описують " +"функцію (тип повернення, типи аргументів, угоду про виклики) без визначення " +"реалізації. Фабричні функції мають викликатися з потрібним типом результату " +"та типами аргументів функції, і їх можна використовувати як фабрики " +"декораторів, і як такі застосовувати до функцій за допомогою синтаксису " +"``@wrapper``. Перегляньте :ref:`ctypes-callback-functions` для прикладів." + +msgid "" +"The returned function prototype creates functions that use the standard C " +"calling convention. The function will release the GIL during the call. If " +"*use_errno* is set to true, the ctypes private copy of the system :data:" +"`errno` variable is exchanged with the real :data:`errno` value before and " +"after the call; *use_last_error* does the same for the Windows error code." +msgstr "" +"Повернений прототип функції створює функції, які використовують стандартну " +"угоду про виклик C. Функція звільнить GIL під час виклику. Якщо *use_errno* " +"має значення true, приватна копія ctypes системної змінної :data:`errno` " +"обмінюється справжнім значенням :data:`errno` до і після виклику; " +"*use_last_error* робить те саме для коду помилки Windows." + +msgid "" +"The returned function prototype creates functions that use the ``stdcall`` " +"calling convention. The function will release the GIL during the call. " +"*use_errno* and *use_last_error* have the same meaning as above." +msgstr "" + +msgid "" +"The returned function prototype creates functions that use the Python " +"calling convention. The function will *not* release the GIL during the call." +msgstr "" +"Повернений прототип функції створює функції, які використовують угоду про " +"виклики Python. Функція *не* звільняє GIL під час виклику." + +msgid "" +"Function prototypes created by these factory functions can be instantiated " +"in different ways, depending on the type and number of the parameters in the " +"call:" +msgstr "" +"Прототипи функцій, створені цими фабричними функціями, можуть бути створені " +"різними способами, залежно від типу та кількості параметрів у виклику:" + +msgid "" +"Returns a foreign function at the specified address which must be an integer." +msgstr "" +"Повертає зовнішню функцію за вказаною адресою, яка має бути цілим числом." + +msgid "" +"Create a C callable function (a callback function) from a Python *callable*." +msgstr "" +"Створіть функцію виклику C (функцію зворотного виклику) з Python *callable*." + +msgid "" +"Returns a foreign function exported by a shared library. *func_spec* must be " +"a 2-tuple ``(name_or_ordinal, library)``. The first item is the name of the " +"exported function as string, or the ordinal of the exported function as " +"small integer. The second item is the shared library instance." +msgstr "" +"Повертає зовнішню функцію, експортовану спільною бібліотекою. *func_spec* " +"має бути 2-кортежем ``(name_or_ordinal, library)``. Перший елемент — це ім’я " +"експортованої функції у вигляді рядка або порядковий номер експортованої " +"функції у вигляді малого цілого числа. Другий елемент — екземпляр спільної " +"бібліотеки." + +msgid "" +"Returns a foreign function that will call a COM method. *vtbl_index* is the " +"index into the virtual function table, a small non-negative integer. *name* " +"is name of the COM method. *iid* is an optional pointer to the interface " +"identifier which is used in extended error reporting." +msgstr "" +"Повертає зовнішню функцію, яка викликає метод COM. *vtbl_index* — це індекс " +"у таблиці віртуальних функцій, мале невід’ємне ціле число. *ім’я* — це ім’я " +"методу COM. *iid* — це додатковий покажчик на ідентифікатор інтерфейсу, який " +"використовується в розширеному звіті про помилки." + +msgid "" +"COM methods use a special calling convention: They require a pointer to the " +"COM interface as first argument, in addition to those parameters that are " +"specified in the :attr:`!argtypes` tuple." +msgstr "" + +msgid "" +"The optional *paramflags* parameter creates foreign function wrappers with " +"much more functionality than the features described above." +msgstr "" +"Необов’язковий параметр *paramflags* створює зовнішні обгортки функцій із " +"набагато більшою функціональністю, ніж функції, описані вище." + +msgid "" +"*paramflags* must be a tuple of the same length as :attr:`~_CFuncPtr." +"argtypes`." +msgstr "" + +msgid "" +"Each item in this tuple contains further information about a parameter, it " +"must be a tuple containing one, two, or three items." +msgstr "" +"Кожен елемент у цьому кортежі містить додаткову інформацію про параметр, це " +"має бути кортеж, що містить один, два або три елементи." + +msgid "" +"The first item is an integer containing a combination of direction flags for " +"the parameter:" +msgstr "" +"Перший елемент є цілим числом, що містить комбінацію прапорів напрямку для " +"параметра:" + +msgid "1" +msgstr "1" + +msgid "Specifies an input parameter to the function." +msgstr "Визначає вхідний параметр для функції." + +msgid "2" +msgstr "2" + +msgid "Output parameter. The foreign function fills in a value." +msgstr "Вихідний параметр. Стороння функція заповнює значення." + +msgid "4" +msgstr "4" + +msgid "Input parameter which defaults to the integer zero." +msgstr "Вхідний параметр, який за умовчанням дорівнює нулю." + +msgid "" +"The optional second item is the parameter name as string. If this is " +"specified, the foreign function can be called with named parameters." +msgstr "" +"Другим необов’язковим елементом є назва параметра у вигляді рядка. Якщо це " +"вказано, зовнішня функція може бути викликана з іменованими параметрами." + +msgid "The optional third item is the default value for this parameter." +msgstr "" +"Додатковий третій елемент є значенням за замовчуванням для цього параметра." + +msgid "" +"The following example demonstrates how to wrap the Windows ``MessageBoxW`` " +"function so that it supports default parameters and named arguments. The C " +"declaration from the windows header file is this::" +msgstr "" + +msgid "" +"WINUSERAPI int WINAPI\n" +"MessageBoxW(\n" +" HWND hWnd,\n" +" LPCWSTR lpText,\n" +" LPCWSTR lpCaption,\n" +" UINT uType);" +msgstr "" + +msgid "Here is the wrapping with :mod:`ctypes`::" +msgstr "Ось обгортка за допомогою :mod:`ctypes`::" + +msgid "" +">>> from ctypes import c_int, WINFUNCTYPE, windll\n" +">>> from ctypes.wintypes import HWND, LPCWSTR, UINT\n" +">>> prototype = WINFUNCTYPE(c_int, HWND, LPCWSTR, LPCWSTR, UINT)\n" +">>> paramflags = (1, \"hwnd\", 0), (1, \"text\", \"Hi\"), (1, \"caption\", " +"\"Hello from ctypes\"), (1, \"flags\", 0)\n" +">>> MessageBox = prototype((\"MessageBoxW\", windll.user32), paramflags)" +msgstr "" + +msgid "The ``MessageBox`` foreign function can now be called in these ways::" +msgstr "" +"Сторонню функцію ``MessageBox`` тепер можна викликати такими способами:" + +msgid "" +">>> MessageBox()\n" +">>> MessageBox(text=\"Spam, spam, spam\")\n" +">>> MessageBox(flags=2, text=\"foo bar\")" +msgstr "" + +msgid "" +"A second example demonstrates output parameters. The win32 " +"``GetWindowRect`` function retrieves the dimensions of a specified window by " +"copying them into ``RECT`` structure that the caller has to supply. Here is " +"the C declaration::" +msgstr "" +"Другий приклад демонструє вихідні параметри. Функція ``GetWindowRect`` win32 " +"отримує розміри вказаного вікна шляхом копіювання їх у структуру ``RECT``, " +"яку має надати абонент. Ось оголошення C::" + +msgid "" +"WINUSERAPI BOOL WINAPI\n" +"GetWindowRect(\n" +" HWND hWnd,\n" +" LPRECT lpRect);" +msgstr "" + +msgid "" +">>> from ctypes import POINTER, WINFUNCTYPE, windll, WinError\n" +">>> from ctypes.wintypes import BOOL, HWND, RECT\n" +">>> prototype = WINFUNCTYPE(BOOL, HWND, POINTER(RECT))\n" +">>> paramflags = (1, \"hwnd\"), (2, \"lprect\")\n" +">>> GetWindowRect = prototype((\"GetWindowRect\", windll.user32), " +"paramflags)\n" +">>>" +msgstr "" + +msgid "" +"Functions with output parameters will automatically return the output " +"parameter value if there is a single one, or a tuple containing the output " +"parameter values when there are more than one, so the GetWindowRect function " +"now returns a RECT instance, when called." +msgstr "" +"Функції з вихідними параметрами автоматично повертатимуть значення вихідного " +"параметра, якщо є одне, або кортеж, що містить значення вихідних параметрів, " +"якщо їх декілька, тому функція GetWindowRect тепер повертає екземпляр RECT " +"під час виклику." + +msgid "" +"Output parameters can be combined with the :attr:`~_CFuncPtr.errcheck` " +"protocol to do further output processing and error checking. The win32 " +"``GetWindowRect`` api function returns a ``BOOL`` to signal success or " +"failure, so this function could do the error checking, and raises an " +"exception when the api call failed::" +msgstr "" + +msgid "" +">>> def errcheck(result, func, args):\n" +"... if not result:\n" +"... raise WinError()\n" +"... return args\n" +"...\n" +">>> GetWindowRect.errcheck = errcheck\n" +">>>" +msgstr "" + +msgid "" +"If the :attr:`~_CFuncPtr.errcheck` function returns the argument tuple it " +"receives unchanged, :mod:`ctypes` continues the normal processing it does on " +"the output parameters. If you want to return a tuple of window coordinates " +"instead of a ``RECT`` instance, you can retrieve the fields in the function " +"and return them instead, the normal processing will no longer take place::" +msgstr "" + +msgid "" +">>> def errcheck(result, func, args):\n" +"... if not result:\n" +"... raise WinError()\n" +"... rc = args[1]\n" +"... return rc.left, rc.top, rc.bottom, rc.right\n" +"...\n" +">>> GetWindowRect.errcheck = errcheck\n" +">>>" +msgstr "" + +msgid "Utility functions" +msgstr "Функції корисності" + +msgid "" +"Returns the address of the memory buffer as integer. *obj* must be an " +"instance of a ctypes type." +msgstr "" +"Повертає адресу буфера пам'яті як ціле число. *obj* має бути екземпляром " +"типу ctypes." + +msgid "" +"Raises an :ref:`auditing event ` ``ctypes.addressof`` with " +"argument ``obj``." +msgstr "" +"Викликає :ref:`подію аудиту ` ``ctypes.addressof`` з аргументом " +"``obj``." + +msgid "" +"Returns the alignment requirements of a ctypes type. *obj_or_type* must be a " +"ctypes type or instance." +msgstr "" +"Повертає вимоги до вирівнювання типу ctypes. *obj_or_type* має бути типом " +"або екземпляром ctypes." + +msgid "" +"Returns a light-weight pointer to *obj*, which must be an instance of a " +"ctypes type. *offset* defaults to zero, and must be an integer that will be " +"added to the internal pointer value." +msgstr "" +"Повертає легкий вказівник на *obj*, який має бути екземпляром типу ctypes. " +"*offset* за замовчуванням дорівнює нулю і має бути цілим числом, яке буде " +"додано до значення внутрішнього покажчика." + +msgid "``byref(obj, offset)`` corresponds to this C code::" +msgstr "``byref(obj, offset)`` відповідає цьому коду C::" + +msgid "(((char *)&obj) + offset)" +msgstr "" + +msgid "" +"The returned object can only be used as a foreign function call parameter. " +"It behaves similar to ``pointer(obj)``, but the construction is a lot faster." +msgstr "" +"Повернений об’єкт можна використовувати лише як параметр виклику зовнішньої " +"функції. Він поводиться подібно до ``pointer(obj)``, але будівництво " +"відбувається набагато швидше." + +msgid "" +"This function is similar to the cast operator in C. It returns a new " +"instance of *type* which points to the same memory block as *obj*. *type* " +"must be a pointer type, and *obj* must be an object that can be interpreted " +"as a pointer." +msgstr "" +"Ця функція схожа на оператор приведення в C. Вона повертає новий екземпляр " +"*type*, який вказує на той самий блок пам’яті, що й *obj*. *type* має бути " +"типом покажчика, а *obj* має бути об’єктом, який можна інтерпретувати як " +"покажчик." + +msgid "" +"This function creates a mutable character buffer. The returned object is a " +"ctypes array of :class:`c_char`." +msgstr "" +"Ця функція створює змінний символьний буфер. Повернений об’єкт є масивом " +"ctypes :class:`c_char`." + +msgid "" +"*init_or_size* must be an integer which specifies the size of the array, or " +"a bytes object which will be used to initialize the array items." +msgstr "" +"*init_or_size* має бути цілим числом, яке визначає розмір масиву, або " +"об’єктом bytes, який використовуватиметься для ініціалізації елементів " +"масиву." + +msgid "" +"If a bytes object is specified as first argument, the buffer is made one " +"item larger than its length so that the last element in the array is a NUL " +"termination character. An integer can be passed as second argument which " +"allows specifying the size of the array if the length of the bytes should " +"not be used." +msgstr "" +"Якщо в якості першого аргументу вказано об’єкт bytes, буфер стає на один " +"елемент більшим, ніж його довжина, так що останній елемент у масиві є " +"завершальним символом NUL. Ціле число може бути передане як другий аргумент, " +"що дозволяє вказати розмір масиву, якщо довжина байтів не повинна " +"використовуватися." + +msgid "" +"Raises an :ref:`auditing event ` ``ctypes.create_string_buffer`` " +"with arguments ``init``, ``size``." +msgstr "" +"Викликає :ref:`подію аудиту ` ``ctypes.create_string_buffer`` з " +"аргументами ``init``, ``size``." + +msgid "" +"This function creates a mutable unicode character buffer. The returned " +"object is a ctypes array of :class:`c_wchar`." +msgstr "" +"Ця функція створює змінний буфер символів Unicode. Повернений об’єкт є " +"масивом ctypes :class:`c_wchar`." + +msgid "" +"*init_or_size* must be an integer which specifies the size of the array, or " +"a string which will be used to initialize the array items." +msgstr "" +"*init_or_size* має бути цілим числом, що вказує розмір масиву, або рядком, " +"який використовуватиметься для ініціалізації елементів масиву." + +msgid "" +"If a string is specified as first argument, the buffer is made one item " +"larger than the length of the string so that the last element in the array " +"is a NUL termination character. An integer can be passed as second argument " +"which allows specifying the size of the array if the length of the string " +"should not be used." +msgstr "" +"Якщо рядок вказано як перший аргумент, буфер робиться на один елемент " +"більшим, ніж довжина рядка, так що останній елемент у масиві є завершальним " +"символом NUL. Ціле число може бути передане як другий аргумент, що дозволяє " +"вказати розмір масиву, якщо довжина рядка не повинна використовуватися." + +msgid "" +"Raises an :ref:`auditing event ` ``ctypes.create_unicode_buffer`` " +"with arguments ``init``, ``size``." +msgstr "" +"Викликає :ref:`подію аудиту ` ``ctypes.create_unicode_buffer`` з " +"аргументами ``init``, ``size``." + +msgid "" +"This function is a hook which allows implementing in-process COM servers " +"with ctypes. It is called from the DllCanUnloadNow function that the " +"_ctypes extension dll exports." +msgstr "" + +msgid "" +"This function is a hook which allows implementing in-process COM servers " +"with ctypes. It is called from the DllGetClassObject function that the " +"``_ctypes`` extension dll exports." +msgstr "" + +msgid "" +"Try to find a library and return a pathname. *name* is the library name " +"without any prefix like ``lib``, suffix like ``.so``, ``.dylib`` or version " +"number (this is the form used for the posix linker option :option:`!-l`). " +"If no library can be found, returns ``None``." +msgstr "" +"Спробуйте знайти бібліотеку та повернути шлях. *ім’я* — це ім’я бібліотеки " +"без будь-яких префіксів, як-от ``lib``, суфіксів, як-от ``.so``, ``.dylib`` " +"або номера версії (це форма, яка використовується для параметра " +"компонувальника posix :option:`!-l`). Якщо бібліотеки не знайдено, повертає " +"``None``." + +msgid "" +"Returns the filename of the VC runtime library used by Python, and by the " +"extension modules. If the name of the library cannot be determined, " +"``None`` is returned." +msgstr "" + +msgid "" +"If you need to free memory, for example, allocated by an extension module " +"with a call to the ``free(void *)``, it is important that you use the " +"function in the same library that allocated the memory." +msgstr "" +"Якщо вам потрібно звільнити пам’ять, наприклад, виділену модулем розширення " +"за допомогою виклику ``free(void *)``, важливо, щоб ви використовували " +"функцію в тій самій бібліотеці, яка виділила пам’ять." + +msgid "" +"Returns a textual description of the error code *code*. If no error code is " +"specified, the last error code is used by calling the Windows api function " +"GetLastError." +msgstr "" + +msgid "" +"Returns the last error code set by Windows in the calling thread. This " +"function calls the Windows ``GetLastError()`` function directly, it does not " +"return the ctypes-private copy of the error code." +msgstr "" + +msgid "" +"Returns the current value of the ctypes-private copy of the system :data:" +"`errno` variable in the calling thread." +msgstr "" +"Повертає поточне значення ctypes-private копії системної змінної :data:" +"`errno` у потоці виклику." + +msgid "" +"Raises an :ref:`auditing event ` ``ctypes.get_errno`` with no " +"arguments." +msgstr "" +"Викликає :ref:`подію аудиту ` ``ctypes.get_errno`` без аргументів." + +msgid "" +"Returns the current value of the ctypes-private copy of the system :data:`!" +"LastError` variable in the calling thread." +msgstr "" + +msgid "" +"Raises an :ref:`auditing event ` ``ctypes.get_last_error`` with no " +"arguments." +msgstr "" +"Викликає :ref:`подію аудиту ` ``ctypes.get_last_error`` без " +"аргументів." + +msgid "" +"Same as the standard C memmove library function: copies *count* bytes from " +"*src* to *dst*. *dst* and *src* must be integers or ctypes instances that " +"can be converted to pointers." +msgstr "" +"Те саме, що стандартна функція бібліотеки C memmove: копіює *count* байти з " +"*src* до *dst*. *dst* і *src* мають бути цілими числами або екземплярами " +"ctypes, які можна перетворити на покажчики." + +msgid "" +"Same as the standard C memset library function: fills the memory block at " +"address *dst* with *count* bytes of value *c*. *dst* must be an integer " +"specifying an address, or a ctypes instance." +msgstr "" +"Те саме, що стандартна функція бібліотеки memset C: заповнює блок пам’яті за " +"адресою *dst* *count* байтами зі значенням *c*. *dst* має бути цілим числом, " +"що визначає адресу, або екземпляр ctypes." + +msgid "" +"Create and return a new ctypes pointer type. Pointer types are cached and " +"reused internally, so calling this function repeatedly is cheap. *type* must " +"be a ctypes type." +msgstr "" + +msgid "" +"Create a new pointer instance, pointing to *obj*. The returned object is of " +"the type ``POINTER(type(obj))``." +msgstr "" + +msgid "" +"Note: If you just want to pass a pointer to an object to a foreign function " +"call, you should use ``byref(obj)`` which is much faster." +msgstr "" +"Примітка. Якщо ви просто хочете передати вказівник на об’єкт у зовнішній " +"виклик функції, вам слід використовувати ``byref(obj)``, що набагато швидше." + +msgid "" +"This function resizes the internal memory buffer of *obj*, which must be an " +"instance of a ctypes type. It is not possible to make the buffer smaller " +"than the native size of the objects type, as given by ``sizeof(type(obj))``, " +"but it is possible to enlarge the buffer." +msgstr "" +"Ця функція змінює розмір буфера внутрішньої пам’яті *obj*, який має бути " +"екземпляром типу ctypes. Неможливо зробити буфер меншим, ніж власний розмір " +"типу об’єктів, як задано ``sizeof(type(obj))``, але можна збільшити буфер." + +msgid "" +"Set the current value of the ctypes-private copy of the system :data:`errno` " +"variable in the calling thread to *value* and return the previous value." +msgstr "" +"Установіть поточне значення ctypes-private копії системної змінної :data:" +"`errno` у викликаючому потоці на *value* і поверніть попереднє значення." + +msgid "" +"Raises an :ref:`auditing event ` ``ctypes.set_errno`` with " +"argument ``errno``." +msgstr "" +"Викликає :ref:`подію аудиту ` ``ctypes.set_errno`` з аргументом " +"``errno``." + +msgid "" +"Sets the current value of the ctypes-private copy of the system :data:`!" +"LastError` variable in the calling thread to *value* and return the previous " +"value." +msgstr "" + +msgid "" +"Raises an :ref:`auditing event ` ``ctypes.set_last_error`` with " +"argument ``error``." +msgstr "" +"Викликає :ref:`подію аудиту ` ``ctypes.set_last_error`` з " +"аргументом ``помилка``." + +msgid "" +"Returns the size in bytes of a ctypes type or instance memory buffer. Does " +"the same as the C ``sizeof`` operator." +msgstr "" +"Повертає розмір у байтах типу ctypes або буфера пам’яті примірника. Діє так " +"само, як і оператор C ``sizeof``." + +msgid "" +"Return the byte string at *void \\*ptr*. If *size* is specified, it is used " +"as size, otherwise the string is assumed to be zero-terminated." +msgstr "" + +msgid "" +"Raises an :ref:`auditing event ` ``ctypes.string_at`` with " +"arguments ``ptr``, ``size``." +msgstr "" + +msgid "" +"This function is probably the worst-named thing in ctypes. It creates an " +"instance of :exc:`OSError`. If *code* is not specified, ``GetLastError`` is " +"called to determine the error code. If *descr* is not specified, :func:" +"`FormatError` is called to get a textual description of the error." +msgstr "" + +msgid "" +"An instance of :exc:`WindowsError` used to be created, which is now an alias " +"of :exc:`OSError`." +msgstr "" + +msgid "" +"Return the wide-character string at *void \\*ptr*. If *size* is specified, " +"it is used as the number of characters of the string, otherwise the string " +"is assumed to be zero-terminated." +msgstr "" + +msgid "" +"Raises an :ref:`auditing event ` ``ctypes.wstring_at`` with " +"arguments ``ptr``, ``size``." +msgstr "" + +msgid "Data types" +msgstr "Типи даних" + +msgid "" +"This non-public class is the common base class of all ctypes data types. " +"Among other things, all ctypes type instances contain a memory block that " +"hold C compatible data; the address of the memory block is returned by the :" +"func:`addressof` helper function. Another instance variable is exposed as :" +"attr:`_objects`; this contains other Python objects that need to be kept " +"alive in case the memory block contains pointers." +msgstr "" +"Цей непублічний клас є загальним базовим класом для всіх типів даних ctypes. " +"Серед іншого, усі екземпляри типу ctypes містять блок пам’яті, який містить " +"C-сумісні дані; адреса блоку пам'яті повертається допоміжною функцією :func:" +"`addressof`. Інша змінна екземпляра представлена як :attr:`_objects`; це " +"містить інші об’єкти Python, які потрібно підтримувати в активному стані, " +"якщо блок пам’яті містить покажчики." + +msgid "" +"Common methods of ctypes data types, these are all class methods (to be " +"exact, they are methods of the :term:`metaclass`):" +msgstr "" +"Загальні методи типів даних ctypes, це всі методи класу (точніше, це методи :" +"term:`metaclass`):" + +msgid "" +"This method returns a ctypes instance that shares the buffer of the *source* " +"object. The *source* object must support the writeable buffer interface. " +"The optional *offset* parameter specifies an offset into the source buffer " +"in bytes; the default is zero. If the source buffer is not large enough a :" +"exc:`ValueError` is raised." +msgstr "" +"Цей метод повертає екземпляр ctypes, який спільно використовує буфер об’єкта " +"*source*. Об'єкт *джерело* має підтримувати інтерфейс буфера з можливістю " +"запису. Необов'язковий параметр *offset* визначає зсув у вихідному буфері в " +"байтах; за замовчуванням дорівнює нулю. Якщо вихідний буфер недостатньо " +"великий, виникає :exc:`ValueError`." + +msgid "" +"Raises an :ref:`auditing event ` ``ctypes.cdata/buffer`` with " +"arguments ``pointer``, ``size``, ``offset``." +msgstr "" +"Викликає :ref:`подію аудиту ` ``ctypes.cdata/buffer`` з " +"аргументами ``pointer``, ``size``, ``offset``." + +msgid "" +"This method creates a ctypes instance, copying the buffer from the *source* " +"object buffer which must be readable. The optional *offset* parameter " +"specifies an offset into the source buffer in bytes; the default is zero. " +"If the source buffer is not large enough a :exc:`ValueError` is raised." +msgstr "" +"Цей метод створює екземпляр ctypes, копіюючи буфер із буфера *джерельного* " +"об’єкта, який має бути читабельним. Необов'язковий параметр *offset* " +"визначає зсув у вихідному буфері в байтах; за замовчуванням дорівнює нулю. " +"Якщо вихідний буфер недостатньо великий, виникає :exc:`ValueError`." + +msgid "" +"This method returns a ctypes type instance using the memory specified by " +"*address* which must be an integer." +msgstr "" +"Цей метод повертає екземпляр типу ctypes, використовуючи пам’ять, визначену " +"*адресою*, яка має бути цілим числом." + +msgid "" +"This method, and others that indirectly call this method, raises an :ref:" +"`auditing event ` ``ctypes.cdata`` with argument ``address``." +msgstr "" +"Цей метод та інші, які опосередковано викликають цей метод, викликають :ref:" +"`подію аудиту ` ``ctypes.cdata`` з аргументом ``адреса``." + +msgid "" +"This method adapts *obj* to a ctypes type. It is called with the actual " +"object used in a foreign function call when the type is present in the " +"foreign function's :attr:`~_CFuncPtr.argtypes` tuple; it must return an " +"object that can be used as a function call parameter." +msgstr "" + +msgid "" +"All ctypes data types have a default implementation of this classmethod that " +"normally returns *obj* if that is an instance of the type. Some types " +"accept other objects as well." +msgstr "" +"Усі типи даних ctypes мають стандартну реалізацію цього методу класу, який " +"зазвичай повертає *obj*, якщо це екземпляр типу. Деякі типи також приймають " +"інші об’єкти." + +msgid "" +"This method returns a ctypes type instance exported by a shared library. " +"*name* is the name of the symbol that exports the data, *library* is the " +"loaded shared library." +msgstr "" +"Цей метод повертає екземпляр типу ctypes, експортований спільною " +"бібліотекою. *name* — це ім’я символу, який експортує дані, *library* — це " +"завантажена спільна бібліотека." + +msgid "Common instance variables of ctypes data types:" +msgstr "Загальні змінні екземплярів типів даних ctypes:" + +msgid "" +"Sometimes ctypes data instances do not own the memory block they contain, " +"instead they share part of the memory block of a base object. The :attr:" +"`_b_base_` read-only member is the root ctypes object that owns the memory " +"block." +msgstr "" +"Іноді екземпляри даних ctypes не володіють блоком пам’яті, який вони " +"містять, натомість вони спільно використовують частину блоку пам’яті " +"базового об’єкта. Член :attr:`_b_base_` лише для читання є кореневим " +"об’єктом ctypes, якому належить блок пам’яті." + +msgid "" +"This read-only variable is true when the ctypes data instance has allocated " +"the memory block itself, false otherwise." +msgstr "" +"Ця змінна лише для читання є істиною, коли екземпляр даних ctypes сам " +"виділив блок пам’яті, інакше – false." + +msgid "" +"This member is either ``None`` or a dictionary containing Python objects " +"that need to be kept alive so that the memory block contents is kept valid. " +"This object is only exposed for debugging; never modify the contents of this " +"dictionary." +msgstr "" +"Цей член або ``None``, або словник, що містить об’єкти Python, які потрібно " +"підтримувати в активному стані, щоб вміст блоку пам’яті залишався дійсним. " +"Цей об’єкт доступний лише для налагодження; ніколи не змінюйте вміст цього " +"словника." + +msgid "" +"This non-public class is the base class of all fundamental ctypes data " +"types. It is mentioned here because it contains the common attributes of the " +"fundamental ctypes data types. :class:`_SimpleCData` is a subclass of :" +"class:`_CData`, so it inherits their methods and attributes. ctypes data " +"types that are not and do not contain pointers can now be pickled." +msgstr "" +"Цей закритий клас є базовим класом усіх основних типів даних ctypes. Він " +"згадується тут, оскільки він містить загальні атрибути основних типів даних " +"ctypes. :class:`_SimpleCData` є підкласом :class:`_CData`, тому він " +"успадковує їхні методи та атрибути. Типи даних ctypes, які не є та не " +"містять покажчиків, тепер можна маринувати." + +msgid "Instances have a single attribute:" +msgstr "Екземпляри мають один атрибут:" + +msgid "" +"This attribute contains the actual value of the instance. For integer and " +"pointer types, it is an integer, for character types, it is a single " +"character bytes object or string, for character pointer types it is a Python " +"bytes object or string." +msgstr "" +"Цей атрибут містить фактичне значення екземпляра. Для цілочисельних типів і " +"типів покажчиків це ціле число, для типів символів – об’єкт або рядок із " +"одним символом у байтах, для типів покажчиків на символи – це об’єкт або " +"рядок Python bytes." + +msgid "" +"When the ``value`` attribute is retrieved from a ctypes instance, usually a " +"new object is returned each time. :mod:`ctypes` does *not* implement " +"original object return, always a new object is constructed. The same is " +"true for all other ctypes object instances." +msgstr "" +"Коли атрибут ``value`` отримується з екземпляра ctypes, зазвичай щоразу " +"повертається новий об’єкт. :mod:`ctypes` *не* реалізує повернення " +"оригінального об’єкта, завжди створюється новий об’єкт. Те саме стосується " +"всіх інших екземплярів об’єктів ctypes." + +msgid "" +"Fundamental data types, when returned as foreign function call results, or, " +"for example, by retrieving structure field members or array items, are " +"transparently converted to native Python types. In other words, if a " +"foreign function has a :attr:`~_CFuncPtr.restype` of :class:`c_char_p`, you " +"will always receive a Python bytes object, *not* a :class:`c_char_p` " +"instance." +msgstr "" + +msgid "" +"Subclasses of fundamental data types do *not* inherit this behavior. So, if " +"a foreign functions :attr:`!restype` is a subclass of :class:`c_void_p`, you " +"will receive an instance of this subclass from the function call. Of course, " +"you can get the value of the pointer by accessing the ``value`` attribute." +msgstr "" + +msgid "These are the fundamental ctypes data types:" +msgstr "Ось основні типи даних ctypes:" + +msgid "" +"Represents the C :c:expr:`signed char` datatype, and interprets the value as " +"small integer. The constructor accepts an optional integer initializer; no " +"overflow checking is done." +msgstr "" + +msgid "" +"Represents the C :c:expr:`char` datatype, and interprets the value as a " +"single character. The constructor accepts an optional string initializer, " +"the length of the string must be exactly one character." +msgstr "" + +msgid "" +"Represents the C :c:expr:`char *` datatype when it points to a zero-" +"terminated string. For a general character pointer that may also point to " +"binary data, ``POINTER(c_char)`` must be used. The constructor accepts an " +"integer address, or a bytes object." +msgstr "" + +msgid "" +"Represents the C :c:expr:`double` datatype. The constructor accepts an " +"optional float initializer." +msgstr "" + +msgid "" +"Represents the C :c:expr:`long double` datatype. The constructor accepts an " +"optional float initializer. On platforms where ``sizeof(long double) == " +"sizeof(double)`` it is an alias to :class:`c_double`." +msgstr "" + +msgid "" +"Represents the C :c:expr:`float` datatype. The constructor accepts an " +"optional float initializer." +msgstr "" + +msgid "" +"Represents the C :c:expr:`signed int` datatype. The constructor accepts an " +"optional integer initializer; no overflow checking is done. On platforms " +"where ``sizeof(int) == sizeof(long)`` it is an alias to :class:`c_long`." +msgstr "" + +msgid "" +"Represents the C 8-bit :c:expr:`signed int` datatype. Usually an alias for :" +"class:`c_byte`." +msgstr "" + +msgid "" +"Represents the C 16-bit :c:expr:`signed int` datatype. Usually an alias " +"for :class:`c_short`." +msgstr "" + +msgid "" +"Represents the C 32-bit :c:expr:`signed int` datatype. Usually an alias " +"for :class:`c_int`." +msgstr "" + +msgid "" +"Represents the C 64-bit :c:expr:`signed int` datatype. Usually an alias " +"for :class:`c_longlong`." +msgstr "" + +msgid "" +"Represents the C :c:expr:`signed long` datatype. The constructor accepts an " +"optional integer initializer; no overflow checking is done." +msgstr "" + +msgid "" +"Represents the C :c:expr:`signed long long` datatype. The constructor " +"accepts an optional integer initializer; no overflow checking is done." +msgstr "" + +msgid "" +"Represents the C :c:expr:`signed short` datatype. The constructor accepts " +"an optional integer initializer; no overflow checking is done." +msgstr "" + +msgid "Represents the C :c:type:`size_t` datatype." +msgstr "Представляє тип даних C :c:type:`size_t`." + +msgid "Represents the C :c:type:`ssize_t` datatype." +msgstr "Представляє тип даних C :c:type:`ssize_t`." + +msgid "Represents the C :c:type:`time_t` datatype." +msgstr "" + +msgid "" +"Represents the C :c:expr:`unsigned char` datatype, it interprets the value " +"as small integer. The constructor accepts an optional integer initializer; " +"no overflow checking is done." +msgstr "" + +msgid "" +"Represents the C :c:expr:`unsigned int` datatype. The constructor accepts " +"an optional integer initializer; no overflow checking is done. On platforms " +"where ``sizeof(int) == sizeof(long)`` it is an alias for :class:`c_ulong`." +msgstr "" + +msgid "" +"Represents the C 8-bit :c:expr:`unsigned int` datatype. Usually an alias " +"for :class:`c_ubyte`." +msgstr "" + +msgid "" +"Represents the C 16-bit :c:expr:`unsigned int` datatype. Usually an alias " +"for :class:`c_ushort`." +msgstr "" + +msgid "" +"Represents the C 32-bit :c:expr:`unsigned int` datatype. Usually an alias " +"for :class:`c_uint`." +msgstr "" + +msgid "" +"Represents the C 64-bit :c:expr:`unsigned int` datatype. Usually an alias " +"for :class:`c_ulonglong`." +msgstr "" + +msgid "" +"Represents the C :c:expr:`unsigned long` datatype. The constructor accepts " +"an optional integer initializer; no overflow checking is done." +msgstr "" + +msgid "" +"Represents the C :c:expr:`unsigned long long` datatype. The constructor " +"accepts an optional integer initializer; no overflow checking is done." +msgstr "" + +msgid "" +"Represents the C :c:expr:`unsigned short` datatype. The constructor accepts " +"an optional integer initializer; no overflow checking is done." +msgstr "" + +msgid "" +"Represents the C :c:expr:`void *` type. The value is represented as " +"integer. The constructor accepts an optional integer initializer." +msgstr "" + +msgid "" +"Represents the C :c:type:`wchar_t` datatype, and interprets the value as a " +"single character unicode string. The constructor accepts an optional string " +"initializer, the length of the string must be exactly one character." +msgstr "" +"Представляє тип даних C :c:type:`wchar_t` і інтерпретує значення як " +"односимвольний рядок Unicode. Конструктор приймає необов’язковий " +"ініціалізатор рядка, довжина рядка має бути рівно одному символу." + +msgid "" +"Represents the C :c:expr:`wchar_t *` datatype, which must be a pointer to a " +"zero-terminated wide character string. The constructor accepts an integer " +"address, or a string." +msgstr "" + +msgid "" +"Represent the C :c:expr:`bool` datatype (more accurately, :c:expr:`_Bool` " +"from C99). Its value can be ``True`` or ``False``, and the constructor " +"accepts any object that has a truth value." +msgstr "" + +msgid "" +"Represents a :c:type:`!HRESULT` value, which contains success or error " +"information for a function or method call." +msgstr "" + +msgid "" +"Represents the C :c:expr:`PyObject *` datatype. Calling this without an " +"argument creates a ``NULL`` :c:expr:`PyObject *` pointer." +msgstr "" + +msgid "" +"The :mod:`!ctypes.wintypes` module provides quite some other Windows " +"specific data types, for example :c:type:`!HWND`, :c:type:`!WPARAM`, or :c:" +"type:`!DWORD`. Some useful structures like :c:type:`!MSG` or :c:type:`!RECT` " +"are also defined." +msgstr "" + +msgid "Structured data types" +msgstr "Структуровані типи даних" + +msgid "Abstract base class for unions in native byte order." +msgstr "Абстрактний базовий клас для об’єднань у рідному порядку байтів." + +msgid "Abstract base class for unions in *big endian* byte order." +msgstr "" + +msgid "Abstract base class for unions in *little endian* byte order." +msgstr "" + +msgid "Abstract base class for structures in *big endian* byte order." +msgstr "Абстрактний базовий клас для структур у *великому порядку байтів*." + +msgid "Abstract base class for structures in *little endian* byte order." +msgstr "" +"Абстрактний базовий клас для структур у порядку байтів *little endian*." + +msgid "" +"Structures and unions with non-native byte order cannot contain pointer type " +"fields, or any other data types containing pointer type fields." +msgstr "" + +msgid "Abstract base class for structures in *native* byte order." +msgstr "Абстрактний базовий клас для структур у *власному* порядку байтів." + +msgid "" +"Concrete structure and union types must be created by subclassing one of " +"these types, and at least define a :attr:`_fields_` class variable. :mod:" +"`ctypes` will create :term:`descriptor`\\s which allow reading and writing " +"the fields by direct attribute accesses. These are the" +msgstr "" +"Конкретні типи структури та об’єднання мають бути створені шляхом створення " +"підкласу одного з цих типів і принаймні визначення змінної класу :attr:" +"`_fields_`. :mod:`ctypes` створить :term:`descriptor`\\s, які дозволяють " +"читати та записувати поля за допомогою прямого доступу до атрибутів. Це" + +msgid "" +"A sequence defining the structure fields. The items must be 2-tuples or 3-" +"tuples. The first item is the name of the field, the second item specifies " +"the type of the field; it can be any ctypes data type." +msgstr "" +"Послідовність, що визначає поля структури. Елементи мають бути 2-кортежними " +"або 3-кортежними. Перший пункт – ім’я поля, другий – тип поля; це може бути " +"будь-який тип даних ctypes." + +msgid "" +"For integer type fields like :class:`c_int`, a third optional item can be " +"given. It must be a small positive integer defining the bit width of the " +"field." +msgstr "" +"Для полів цілого типу, таких як :class:`c_int`, можна вказати третій " +"необов’язковий елемент. Це має бути маленьке позитивне ціле число, що " +"визначає розрядність поля." + +msgid "" +"Field names must be unique within one structure or union. This is not " +"checked, only one field can be accessed when names are repeated." +msgstr "" +"Імена полів мають бути унікальними в межах однієї структури чи об’єднання. " +"Це не позначено, лише одне поле доступне, якщо імена повторюються." + +msgid "" +"It is possible to define the :attr:`_fields_` class variable *after* the " +"class statement that defines the Structure subclass, this allows creating " +"data types that directly or indirectly reference themselves::" +msgstr "" +"Можна визначити змінну класу :attr:`_fields_` *після* оператора класу, який " +"визначає підклас Structure, це дозволяє створювати типи даних, які прямо чи " +"опосередковано посилаються на себе::" + +msgid "" +"class List(Structure):\n" +" pass\n" +"List._fields_ = [(\"pnext\", POINTER(List)),\n" +" ...\n" +" ]" +msgstr "" + +msgid "" +"The :attr:`_fields_` class variable must, however, be defined before the " +"type is first used (an instance is created, :func:`sizeof` is called on it, " +"and so on). Later assignments to the :attr:`_fields_` class variable will " +"raise an AttributeError." +msgstr "" +"Однак змінну класу :attr:`_fields_` потрібно визначити перед першим " +"використанням типу (створюється екземпляр, для нього викликається :func:" +"`sizeof` і так далі). Пізніше призначення змінній класу :attr:`_fields_` " +"призведе до помилки AttributeError." + +msgid "" +"It is possible to define sub-subclasses of structure types, they inherit the " +"fields of the base class plus the :attr:`_fields_` defined in the sub-" +"subclass, if any." +msgstr "" +"Можна визначити під-підкласи структурних типів, вони успадковують поля " +"базового класу плюс :attr:`_fields_`, визначені в під-підкласі, якщо такі є." + +msgid "" +"An optional small integer that allows overriding the alignment of structure " +"fields in the instance. :attr:`_pack_` must already be defined when :attr:" +"`_fields_` is assigned, otherwise it will have no effect. Setting this " +"attribute to 0 is the same as not setting it at all." +msgstr "" + +msgid "" +"An optional small integer that allows overriding the alignment of the " +"structure when being packed or unpacked to/from memory. Setting this " +"attribute to 0 is the same as not setting it at all." +msgstr "" + +msgid "" +"An optional sequence that lists the names of unnamed (anonymous) fields. :" +"attr:`_anonymous_` must be already defined when :attr:`_fields_` is " +"assigned, otherwise it will have no effect." +msgstr "" +"Необов’язкова послідовність, яка містить імена безіменних (анонімних) " +"полів. :attr:`_anonymous_` має бути вже визначено під час призначення :attr:" +"`_fields_`, інакше це не матиме ефекту." + +msgid "" +"The fields listed in this variable must be structure or union type fields. :" +"mod:`ctypes` will create descriptors in the structure type that allows " +"accessing the nested fields directly, without the need to create the " +"structure or union field." +msgstr "" +"Поля, перелічені в цій змінній, мають бути структурними або об’єднаними. :" +"mod:`ctypes` створить дескриптори у структурному типі, що дозволяє отримати " +"доступ до вкладених полів безпосередньо, без необхідності створювати " +"структуру чи поле об’єднання." + +msgid "Here is an example type (Windows)::" +msgstr "Ось приклад типу (Windows):" + +msgid "" +"class _U(Union):\n" +" _fields_ = [(\"lptdesc\", POINTER(TYPEDESC)),\n" +" (\"lpadesc\", POINTER(ARRAYDESC)),\n" +" (\"hreftype\", HREFTYPE)]\n" +"\n" +"class TYPEDESC(Structure):\n" +" _anonymous_ = (\"u\",)\n" +" _fields_ = [(\"u\", _U),\n" +" (\"vt\", VARTYPE)]" +msgstr "" + +msgid "" +"The ``TYPEDESC`` structure describes a COM data type, the ``vt`` field " +"specifies which one of the union fields is valid. Since the ``u`` field is " +"defined as anonymous field, it is now possible to access the members " +"directly off the TYPEDESC instance. ``td.lptdesc`` and ``td.u.lptdesc`` are " +"equivalent, but the former is faster since it does not need to create a " +"temporary union instance::" +msgstr "" +"Структура ``TYPEDESC`` описує тип даних COM, поле ``vt`` визначає, яке з " +"полів об’єднання є дійсним. Оскільки поле ``u`` визначено як анонімне поле, " +"тепер можна отримати доступ до членів безпосередньо з примірника TYPEDESC. " +"``td.lptdesc`` і ``td.u.lptdesc`` еквівалентні, але перший швидший, оскільки " +"йому не потрібно створювати тимчасовий екземпляр об’єднання::" + +msgid "" +"td = TYPEDESC()\n" +"td.vt = VT_PTR\n" +"td.lptdesc = POINTER(some_type)\n" +"td.u.lptdesc = POINTER(some_type)" +msgstr "" + +msgid "" +"It is possible to define sub-subclasses of structures, they inherit the " +"fields of the base class. If the subclass definition has a separate :attr:" +"`_fields_` variable, the fields specified in this are appended to the fields " +"of the base class." +msgstr "" +"Є можливість визначення суб-підкласів структур, вони успадковують поля " +"базового класу. Якщо визначення підкласу має окрему змінну :attr:`_fields_`, " +"поля, зазначені в ній, додаються до полів базового класу." + +msgid "" +"Structure and union constructors accept both positional and keyword " +"arguments. Positional arguments are used to initialize member fields in the " +"same order as they are appear in :attr:`_fields_`. Keyword arguments in the " +"constructor are interpreted as attribute assignments, so they will " +"initialize :attr:`_fields_` with the same name, or create new attributes for " +"names not present in :attr:`_fields_`." +msgstr "" +"Конструктори структури та об’єднання приймають як позиційні, так і ключові " +"аргументи. Позиційні аргументи використовуються для ініціалізації полів-" +"членів у такому самому порядку, як вони з’являються в :attr:`_fields_`. " +"Аргументи ключових слів у конструкторі інтерпретуються як призначення " +"атрибутів, тому вони ініціалізують :attr:`_fields_` з тим же іменем або " +"створять нові атрибути для імен, яких немає в :attr:`_fields_`." + +msgid "Arrays and pointers" +msgstr "Масиви та покажчики" + +msgid "Abstract base class for arrays." +msgstr "Абстрактний базовий клас для масивів." + +msgid "" +"The recommended way to create concrete array types is by multiplying any :" +"mod:`ctypes` data type with a non-negative integer. Alternatively, you can " +"subclass this type and define :attr:`_length_` and :attr:`_type_` class " +"variables. Array elements can be read and written using standard subscript " +"and slice accesses; for slice reads, the resulting object is *not* itself " +"an :class:`Array`." +msgstr "" +"Рекомендований спосіб створення конкретних типів масивів — це множення будь-" +"якого типу даних :mod:`ctypes` на невід’ємне ціле число. Крім того, ви " +"можете створити підклас цього типу та визначити змінні класу :attr:" +"`_length_` і :attr:`_type_`. Елементи масиву можна читати та записувати за " +"допомогою стандартного підрядкового і зрізного доступу; для зчитування " +"фрагментів результуючий об’єкт *не* сам є :class:`Array`." + +msgid "" +"A positive integer specifying the number of elements in the array. Out-of-" +"range subscripts result in an :exc:`IndexError`. Will be returned by :func:" +"`len`." +msgstr "" +"Додатне ціле число, що визначає кількість елементів у масиві. Індекси поза " +"діапазоном призводять до :exc:`IndexError`. Буде повернено :func:`len`." + +msgid "Specifies the type of each element in the array." +msgstr "Визначає тип кожного елемента в масиві." + +msgid "" +"Array subclass constructors accept positional arguments, used to initialize " +"the elements in order." +msgstr "" +"Конструктори підкласу масиву приймають позиційні аргументи, які " +"використовуються для ініціалізації елементів у порядку." + +msgid "" +"Create an array. Equivalent to ``type * length``, where *type* is a :mod:" +"`ctypes` data type and *length* an integer." +msgstr "" + +msgid "" +"This function is :term:`soft deprecated` in favor of multiplication. There " +"are no plans to remove it." +msgstr "" + +msgid "Private, abstract base class for pointers." +msgstr "Приватний, абстрактний базовий клас для вказівників." + +msgid "" +"Concrete pointer types are created by calling :func:`POINTER` with the type " +"that will be pointed to; this is done automatically by :func:`pointer`." +msgstr "" +"Конкретні типи вказівників створюються шляхом виклику :func:`POINTER` із " +"типом, на який буде вказувати; це робиться автоматично за допомогою :func:" +"`pointer`." + +msgid "" +"If a pointer points to an array, its elements can be read and written using " +"standard subscript and slice accesses. Pointer objects have no size, so :" +"func:`len` will raise :exc:`TypeError`. Negative subscripts will read from " +"the memory *before* the pointer (as in C), and out-of-range subscripts will " +"probably crash with an access violation (if you're lucky)." +msgstr "" +"Якщо вказівник вказує на масив, його елементи можна читати та записувати за " +"допомогою стандартного підрядкового і зрізного доступу. Об’єкти-вказівники " +"не мають розміру, тому :func:`len` викличе :exc:`TypeError`. Негативні " +"індекси читатимуться з пам’яті *перед* вказівником (як у C), а індекси поза " +"межами діапазону, ймовірно, впадуть із порушенням доступу (якщо вам " +"пощастить)." + +msgid "Specifies the type pointed to." +msgstr "Визначає тип, на який вказується." + +msgid "" +"Returns the object to which to pointer points. Assigning to this attribute " +"changes the pointer to point to the assigned object." +msgstr "" +"Повертає об’єкт, на який вказує вказівник. Призначення цьому атрибуту змінює " +"вказівник на призначений об’єкт." diff --git a/library/curses.po b/library/curses.po new file mode 100644 index 000000000..02bbf0bb1 --- /dev/null +++ b/library/curses.po @@ -0,0 +1,2681 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 01:03+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!curses` --- Terminal handling for character-cell displays" +msgstr "" + +msgid "**Source code:** :source:`Lib/curses`" +msgstr "" + +msgid "" +"The :mod:`curses` module provides an interface to the curses library, the de-" +"facto standard for portable advanced terminal handling." +msgstr "" +"Модуль :mod:`curses` надає інтерфейс до бібліотеки curses, де-факто " +"стандарту для портативної розширеної обробки терміналів." + +msgid "" +"While curses is most widely used in the Unix environment, versions are " +"available for Windows, DOS, and possibly other systems as well. This " +"extension module is designed to match the API of ncurses, an open-source " +"curses library hosted on Linux and the BSD variants of Unix." +msgstr "" +"Хоча curses найбільш широко використовується в середовищі Unix, версії " +"доступні для Windows, DOS і, можливо, також для інших систем. Цей модуль " +"розширення розроблено відповідно до API ncurses, бібліотеки curses з " +"відкритим кодом, розміщеної в Linux, і BSD-варіантів Unix." + +msgid "Availability" +msgstr "" + +msgid "" +"This module is not supported on :ref:`mobile platforms ` or :ref:`WebAssembly platforms `." +msgstr "" + +msgid "" +"Whenever the documentation mentions a *character* it can be specified as an " +"integer, a one-character Unicode string or a one-byte byte string." +msgstr "" +"Кожного разу, коли в документації згадується *символ*, його можна вказати як " +"ціле число, односимвольний рядок Unicode або однобайтовий рядок байтів." + +msgid "" +"Whenever the documentation mentions a *character string* it can be specified " +"as a Unicode string or a byte string." +msgstr "" +"Кожного разу, коли в документації згадується *рядок символів*, його можна " +"вказати як рядок Unicode або рядок байтів." + +msgid "Module :mod:`curses.ascii`" +msgstr "Модуль :mod:`curses.ascii`" + +msgid "" +"Utilities for working with ASCII characters, regardless of your locale " +"settings." +msgstr "" +"Утиліти для роботи з символами ASCII, незалежно від ваших налаштувань мови." + +msgid "Module :mod:`curses.panel`" +msgstr "Модуль :mod:`curses.panel`" + +msgid "A panel stack extension that adds depth to curses windows." +msgstr "Розширення стеку панелей, яке додає глибини вікнам curses." + +msgid "Module :mod:`curses.textpad`" +msgstr "Модуль :mod:`curses.textpad`" + +msgid "" +"Editable text widget for curses supporting :program:`Emacs`\\ -like " +"bindings." +msgstr "" +"Редагований текстовий віджет для curses, що підтримує :program:`Emacs`\\ -" +"подібні прив’язки." + +msgid ":ref:`curses-howto`" +msgstr ":ref:`curses-howto`" + +msgid "" +"Tutorial material on using curses with Python, by Andrew Kuchling and Eric " +"Raymond." +msgstr "" +"Навчальний матеріал із використання curses у Python, Ендрю Кухлінг та Ерік " +"Реймонд." + +msgid "Functions" +msgstr "Функції" + +msgid "The module :mod:`curses` defines the following exception:" +msgstr "Модуль :mod:`curses` визначає такий виняток:" + +msgid "Exception raised when a curses library function returns an error." +msgstr "Виняток виникає, коли функція бібліотеки curses повертає помилку." + +msgid "" +"Whenever *x* or *y* arguments to a function or a method are optional, they " +"default to the current cursor location. Whenever *attr* is optional, it " +"defaults to :const:`A_NORMAL`." +msgstr "" +"Щоразу, коли аргументи *x* або *y* для функції чи методу є необов’язковими, " +"вони за замовчуванням вказують на поточне розташування курсора. Якщо *attr* " +"є необов’язковим, за замовчуванням він :const:`A_NORMAL`." + +msgid "The module :mod:`curses` defines the following functions:" +msgstr "Модуль :mod:`curses` визначає такі функції:" + +msgid "" +"Return the output speed of the terminal in bits per second. On software " +"terminal emulators it will have a fixed high value. Included for historical " +"reasons; in former times, it was used to write output loops for time delays " +"and occasionally to change interfaces depending on the line speed." +msgstr "" +"Повертає вихідну швидкість терміналу в бітах за секунду. На програмних " +"емуляторах терміналів воно матиме фіксоване високе значення. Включено з " +"історичних причин; раніше він використовувався для запису циклів виведення " +"для затримок часу та іноді для зміни інтерфейсів залежно від швидкості лінії." + +msgid "Emit a short attention sound." +msgstr "Видайте короткий звук уваги." + +msgid "" +"Return ``True`` or ``False``, depending on whether the programmer can change " +"the colors displayed by the terminal." +msgstr "" +"Повертає ``True`` або ``False``, залежно від того, чи може програміст " +"змінювати кольори, що відображаються терміналом." + +msgid "" +"Enter cbreak mode. In cbreak mode (sometimes called \"rare\" mode) normal " +"tty line buffering is turned off and characters are available to be read one " +"by one. However, unlike raw mode, special characters (interrupt, quit, " +"suspend, and flow control) retain their effects on the tty driver and " +"calling program. Calling first :func:`raw` then :func:`cbreak` leaves the " +"terminal in cbreak mode." +msgstr "" +"Увійдіть у режим cbreak. У режимі cbreak (іноді його називають \"рідкісним\" " +"режимом) звичайна буферизація рядка tty вимкнена, і символи доступні для " +"читання по одному. Однак, на відміну від необробленого режиму, спеціальні " +"символи (переривання, вихід, призупинення та керування потоком) зберігають " +"свій вплив на драйвер tty та програму виклику. Виклик спочатку :func:`raw`, " +"а потім :func:`cbreak` залишає термінал у режимі cbreak." + +msgid "" +"Return the intensity of the red, green, and blue (RGB) components in the " +"color *color_number*, which must be between ``0`` and ``COLORS - 1``. " +"Return a 3-tuple, containing the R,G,B values for the given color, which " +"will be between ``0`` (no component) and ``1000`` (maximum amount of " +"component)." +msgstr "" +"Повертає інтенсивність червоного, зеленого та синього (RGB) компонентів у " +"кольорі *color_number*, який має бути між ``0`` і ``COLORS - 1``. Повертає 3-" +"кортеж, що містить значення R, G, B для заданого кольору, який буде між " +"\"0\" (без компонента) і \"1000\" (максимальна кількість компонента)." + +msgid "" +"Return the attribute value for displaying text in the specified color pair. " +"Only the first 256 color pairs are supported. This attribute value can be " +"combined with :const:`A_STANDOUT`, :const:`A_REVERSE`, and the other :const:" +"`!A_\\*` attributes. :func:`pair_number` is the counterpart to this " +"function." +msgstr "" + +msgid "" +"Set the cursor state. *visibility* can be set to ``0``, ``1``, or ``2``, " +"for invisible, normal, or very visible. If the terminal supports the " +"visibility requested, return the previous cursor state; otherwise raise an " +"exception. On many terminals, the \"visible\" mode is an underline cursor " +"and the \"very visible\" mode is a block cursor." +msgstr "" +"Встановити стан курсору. *видимість* може бути встановлена на ``0``, ``1`` " +"або ``2``, для невидимого, нормального або дуже видимого. Якщо термінал " +"підтримує запитану видимість, повернути попередній стан курсору; інакше " +"створіть виняток. На багатьох терміналах \"видимий\" режим — це підкреслений " +"курсор, а \"дуже видимий\" — блоковий курсор." + +msgid "" +"Save the current terminal mode as the \"program\" mode, the mode when the " +"running program is using curses. (Its counterpart is the \"shell\" mode, " +"for when the program is not in curses.) Subsequent calls to :func:" +"`reset_prog_mode` will restore this mode." +msgstr "" +"Збережіть поточний режим терміналу як режим \"програми\", режим, коли " +"запущена програма використовує curses. (Його відповідником є режим " +"\"оболонки\", коли програма не перебуває в curses.) Подальші виклики :func:" +"`reset_prog_mode` відновлять цей режим." + +msgid "" +"Save the current terminal mode as the \"shell\" mode, the mode when the " +"running program is not using curses. (Its counterpart is the \"program\" " +"mode, when the program is using curses capabilities.) Subsequent calls to :" +"func:`reset_shell_mode` will restore this mode." +msgstr "" +"Збережіть поточний режим терміналу як режим \"оболонки\", режим, коли " +"запущена програма не використовує curses. (Його відповідником є " +"\"програмний\" режим, коли програма використовує можливості curses.) " +"Подальші виклики :func:`reset_shell_mode` відновлять цей режим." + +msgid "Insert an *ms* millisecond pause in output." +msgstr "Вставте *ms* мілісекундну паузу у вивід." + +msgid "" +"Update the physical screen. The curses library keeps two data structures, " +"one representing the current physical screen contents and a virtual screen " +"representing the desired next state. The :func:`doupdate` ground updates " +"the physical screen to match the virtual screen." +msgstr "" +"Оновіть фізичний екран. Бібліотека curses зберігає дві структури даних: одна " +"представляє поточний фізичний вміст екрана, а віртуальний екран представляє " +"бажаний наступний стан. Основа :func:`doupdate` оновлює фізичний екран " +"відповідно до віртуального." + +msgid "" +"The virtual screen may be updated by a :meth:`~window.noutrefresh` call " +"after write operations such as :meth:`~window.addstr` have been performed on " +"a window. The normal :meth:`~window.refresh` call is simply :meth:`!" +"noutrefresh` followed by :func:`!doupdate`; if you have to update multiple " +"windows, you can speed performance and perhaps reduce screen flicker by " +"issuing :meth:`!noutrefresh` calls on all windows, followed by a single :" +"func:`!doupdate`." +msgstr "" +"Віртуальний екран може бути оновлений за допомогою виклику :meth:`~window." +"noutrefresh` після виконання операцій запису, таких як :meth:`~window." +"addstr` у вікні. Звичайний виклик :meth:`~window.refresh` — це просто :meth:" +"`!noutrefresh`, за яким слідує :func:`!doupdate`; якщо вам потрібно оновити " +"кілька вікон, ви можете прискорити продуктивність і, можливо, зменшити " +"мерехтіння екрана, виконуючи виклики :meth:`!noutrefresh` для всіх вікон, а " +"потім один :func:`!doupdate`." + +msgid "" +"Enter echo mode. In echo mode, each character input is echoed to the screen " +"as it is entered." +msgstr "" +"Увійдіть в режим відлуння. У режимі відлуння кожен введений символ " +"відтворюється на екрані під час введення." + +msgid "De-initialize the library, and return terminal to normal status." +msgstr "Деініціалізуйте бібліотеку та поверніть термінал до нормального стану." + +msgid "" +"Return the user's current erase character as a one-byte bytes object. Under " +"Unix operating systems this is a property of the controlling tty of the " +"curses program, and is not set by the curses library itself." +msgstr "" +"Повертає поточний символ стирання користувача як однобайтовий об’єкт байтів. " +"В операційних системах Unix це властивість керуючого tty програми curses і " +"не встановлюється самою бібліотекою curses." + +msgid "" +"The :func:`.filter` routine, if used, must be called before :func:`initscr` " +"is called. The effect is that, during those calls, :envvar:`LINES` is set " +"to ``1``; the capabilities ``clear``, ``cup``, ``cud``, ``cud1``, ``cuu1``, " +"``cuu``, ``vpa`` are disabled; and the ``home`` string is set to the value " +"of ``cr``. The effect is that the cursor is confined to the current line, " +"and so are screen updates. This may be used for enabling character-at-a-" +"time line editing without touching the rest of the screen." +msgstr "" +"Процедуру :func:`.filter`, якщо вона використовується, потрібно викликати " +"перед викликом :func:`initscr`. Результат полягає в тому, що під час цих " +"викликів :envvar:`LINES` встановлюється на ``1``; вимкнено можливості clear, " +"cup, cud1, cuu1, cuu, vpa; і рядок ``home`` має значення ``cr``. Ефект " +"полягає в тому, що курсор обмежено поточним рядком, а також оновлення " +"екрана. Це можна використовувати для ввімкнення посимвольного редагування " +"рядків, не торкаючись решти екрана." + +msgid "" +"Flash the screen. That is, change it to reverse-video and then change it " +"back in a short interval. Some people prefer such as 'visible bell' to the " +"audible attention signal produced by :func:`beep`." +msgstr "" +"Спалах екрану. Тобто змініть його на зворотне відео, а потім знову змініть " +"його через короткий проміжок часу. Деякі люди віддають перевагу \"видимому " +"дзвону\" перед звуковим сигналом уваги, створюваним :func:`beep`." + +msgid "" +"Flush all input buffers. This throws away any typeahead that has been " +"typed by the user and has not yet been processed by the program." +msgstr "" +"Очистити всі вхідні буфери. Це відкидає будь-яке попереднє введення, яке " +"було введено користувачем і ще не було оброблено програмою." + +msgid "" +"After :meth:`~window.getch` returns :const:`KEY_MOUSE` to signal a mouse " +"event, this method should be called to retrieve the queued mouse event, " +"represented as a 5-tuple ``(id, x, y, z, bstate)``. *id* is an ID value used " +"to distinguish multiple devices, and *x*, *y*, *z* are the event's " +"coordinates. (*z* is currently unused.) *bstate* is an integer value whose " +"bits will be set to indicate the type of event, and will be the bitwise OR " +"of one or more of the following constants, where *n* is the button number " +"from 1 to 5: :const:`BUTTONn_PRESSED`, :const:`BUTTONn_RELEASED`, :const:" +"`BUTTONn_CLICKED`, :const:`BUTTONn_DOUBLE_CLICKED`, :const:" +"`BUTTONn_TRIPLE_CLICKED`, :const:`BUTTON_SHIFT`, :const:`BUTTON_CTRL`, :" +"const:`BUTTON_ALT`." +msgstr "" +"Після того, як :meth:`~window.getch` повертає :const:`KEY_MOUSE`, щоб " +"повідомити про подію миші, цей метод слід викликати, щоб отримати подію миші " +"в черзі, представлену як 5-кортеж ``(id, x, y, z, bstate)``. *id* – це " +"значення ID, яке використовується для розрізнення кількох пристроїв, а *x*, " +"*y*, *z* – це координати події. (*z* наразі не використовується.) *bstate* — " +"це ціле число, біти якого будуть встановлені для вказівки типу події та " +"будуть порозрядним АБО однієї чи кількох наступних констант, де *n* — кнопка " +"число від 1 до 5: :const:`BUTTONn_PRESSED`, :const:`BUTTONn_RELEASED`, :" +"const:`BUTTONn_CLICKED`, :const:`BUTTONn_DOUBLE_LICKED`, :const:" +"`BUTTONn_TRIPLE_LICKED`, :const:`BUTTON_SHIFT`, :const:`BUTTON_CTRL`, :const:" +"`BUTTON_ALT`." + +msgid "" +"The ``BUTTON5_*`` constants are now exposed if they are provided by the " +"underlying curses library." +msgstr "" +"Константи ``BUTTON5_*`` тепер доступні, якщо вони надані основною " +"бібліотекою curses." + +msgid "" +"Return the current coordinates of the virtual screen cursor as a tuple ``(y, " +"x)``. If :meth:`leaveok ` is currently ``True``, then " +"return ``(-1, -1)``." +msgstr "" +"Повертає поточні координати віртуального екранного курсору як кортеж ``(y, " +"x)``. Якщо :meth:`leaveok ` наразі має значення ``True``, " +"тоді повертається ``(-1, -1)``." + +msgid "" +"Read window related data stored in the file by an earlier :func:`window." +"putwin` call. The routine then creates and initializes a new window using " +"that data, returning the new window object." +msgstr "" + +msgid "" +"Return ``True`` if the terminal can display colors; otherwise, return " +"``False``." +msgstr "" +"Повертає ``True``, якщо термінал може відображати кольори; інакше поверніть " +"``False``." + +msgid "" +"Return ``True`` if the module supports extended colors; otherwise, return " +"``False``. Extended color support allows more than 256 color pairs for " +"terminals that support more than 16 colors (e.g. xterm-256color)." +msgstr "" +"Повертає ``True``, якщо модуль підтримує розширені кольори; інакше поверніть " +"``False``. Розширена підтримка кольорів дозволяє використовувати більше 256 " +"пар кольорів для терміналів, які підтримують більше 16 кольорів (наприклад, " +"xterm-256color)." + +msgid "Extended color support requires ncurses version 6.1 or later." +msgstr "Розширена підтримка кольорів вимагає ncurses версії 6.1 або новішої." + +msgid "" +"Return ``True`` if the terminal has insert- and delete-character " +"capabilities. This function is included for historical reasons only, as all " +"modern software terminal emulators have such capabilities." +msgstr "" +"Повертає ``True``, якщо термінал має можливості вставляти та видаляти " +"символи. Ця функція включена лише з історичних причин, оскільки всі сучасні " +"програмні емулятори терміналу мають такі можливості." + +msgid "" +"Return ``True`` if the terminal has insert- and delete-line capabilities, or " +"can simulate them using scrolling regions. This function is included for " +"historical reasons only, as all modern software terminal emulators have such " +"capabilities." +msgstr "" +"Повертає ``True``, якщо термінал має можливості вставляти та видаляти рядки " +"або може імітувати їх за допомогою областей прокручування. Ця функція " +"включена лише з історичних причин, оскільки всі сучасні програмні емулятори " +"терміналу мають такі можливості." + +msgid "" +"Take a key value *ch*, and return ``True`` if the current terminal type " +"recognizes a key with that value." +msgstr "" +"Візьміть значення ключа *ch* і поверніть ``True``, якщо поточний тип " +"терміналу розпізнає ключ із таким значенням." + +msgid "" +"Used for half-delay mode, which is similar to cbreak mode in that characters " +"typed by the user are immediately available to the program. However, after " +"blocking for *tenths* tenths of seconds, raise an exception if nothing has " +"been typed. The value of *tenths* must be a number between ``1`` and " +"``255``. Use :func:`nocbreak` to leave half-delay mode." +msgstr "" +"Використовується для режиму половинної затримки, який подібний до режиму " +"cbreak тим, що символи, введені користувачем, одразу стають доступними для " +"програми. Однак після блокування протягом *десятих* десятих секунди, " +"викликайте виняток, якщо нічого не було введено. Значення *десятих* має бути " +"числом від \"1\" до \"255\". Використовуйте :func:`nocbreak`, щоб вийти з " +"режиму половинної затримки." + +msgid "" +"Change the definition of a color, taking the number of the color to be " +"changed followed by three RGB values (for the amounts of red, green, and " +"blue components). The value of *color_number* must be between ``0`` and " +"``COLORS - 1``. Each of *r*, *g*, *b*, must be a value between ``0`` and " +"``1000``. When :func:`init_color` is used, all occurrences of that color on " +"the screen immediately change to the new definition. This function is a no-" +"op on most terminals; it is active only if :func:`can_change_color` returns " +"``True``." +msgstr "" + +msgid "" +"Change the definition of a color-pair. It takes three arguments: the number " +"of the color-pair to be changed, the foreground color number, and the " +"background color number. The value of *pair_number* must be between ``1`` " +"and ``COLOR_PAIRS - 1`` (the ``0`` color pair is wired to white on black and " +"cannot be changed). The value of *fg* and *bg* arguments must be between " +"``0`` and ``COLORS - 1``, or, after calling :func:`use_default_colors`, " +"``-1``. If the color-pair was previously initialized, the screen is " +"refreshed and all occurrences of that color-pair are changed to the new " +"definition." +msgstr "" +"Змініть визначення пари кольорів. Для цього потрібні три аргументи: номер " +"пари кольорів, яку потрібно змінити, номер кольору переднього плану та номер " +"кольору фону. Значення *pair_number* має бути між ``1`` і ``COLOR_PAIRS - " +"1`` (пара кольорів ``0`` пов’язана з білим на чорному і не може бути " +"змінена). Значення аргументів *fg* і *bg* має бути між ``0`` і ``COLORS - " +"1`` або, після виклику :func:`use_default_colors`, ``-1``. Якщо пара " +"кольорів була раніше ініціалізована, екран оновлюється, і всі випадки цієї " +"пари кольорів змінюються на нове визначення." + +msgid "" +"Initialize the library. Return a :ref:`window ` " +"object which represents the whole screen." +msgstr "" +"Ініціалізація бібліотеки. Повертає об’єкт :ref:`window `, який представляє весь екран." + +msgid "" +"If there is an error opening the terminal, the underlying curses library may " +"cause the interpreter to exit." +msgstr "" +"Якщо сталася помилка під час відкриття терміналу, базова бібліотека curses " +"може спричинити вихід інтерпретатора." + +msgid "" +"Return ``True`` if :func:`resize_term` would modify the window structure, " +"``False`` otherwise." +msgstr "" +"Повертає ``True``, якщо :func:`resize_term` змінює структуру вікна, " +"``False`` інакше." + +msgid "" +"Return ``True`` if :func:`endwin` has been called (that is, the curses " +"library has been deinitialized)." +msgstr "" +"Повертає ``True``, якщо було викликано :func:`endwin` (тобто бібліотеку " +"curses було деініціалізовано)." + +msgid "" +"Return the name of the key numbered *k* as a bytes object. The name of a " +"key generating printable ASCII character is the key's character. The name " +"of a control-key combination is a two-byte bytes object consisting of a " +"caret (``b'^'``) followed by the corresponding printable ASCII character. " +"The name of an alt-key combination (128--255) is a bytes object consisting " +"of the prefix ``b'M-'`` followed by the name of the corresponding ASCII " +"character." +msgstr "" +"Повертає назву ключа з номером *k* як об’єкт bytes. Назва ключа, що генерує " +"друкований символ ASCII, є символом ключа. Ім’я комбінації клавіш керування " +"— це двобайтовий байтовий об’єкт, що складається з каретки (``b'^'``), після " +"якої йде відповідний друкований символ ASCII. Ім'я комбінації клавіш Alt " +"(128--255) є об'єктом байтів, що складається з префікса ``b'M-''``, за яким " +"слідує назва відповідного символу ASCII." + +msgid "" +"Return the user's current line kill character as a one-byte bytes object. " +"Under Unix operating systems this is a property of the controlling tty of " +"the curses program, and is not set by the curses library itself." +msgstr "" +"Повертає поточний символ анулювання рядка користувача як однобайтовий " +"байтовий об’єкт. В операційних системах Unix це властивість керуючого tty " +"програми curses і не встановлюється самою бібліотекою curses." + +msgid "" +"Return a bytes object containing the terminfo long name field describing the " +"current terminal. The maximum length of a verbose description is 128 " +"characters. It is defined only after the call to :func:`initscr`." +msgstr "" +"Повертає об’єкт bytes, що містить поле довгої назви terminfo, що описує " +"поточний термінал. Максимальна довжина докладного опису становить 128 " +"символів. Він визначається лише після виклику :func:`initscr`." + +msgid "" +"If *flag* is ``True``, allow 8-bit characters to be input. If *flag* is " +"``False``, allow only 7-bit chars." +msgstr "" +"Якщо *flag* має значення ``True``, дозволяється введення 8-бітових символів. " +"Якщо *flag* має значення ``False``, дозволяйте лише 7-бітні символи." + +msgid "" +"Set the maximum time in milliseconds that can elapse between press and " +"release events in order for them to be recognized as a click, and return the " +"previous interval value. The default value is 200 milliseconds, or one " +"fifth of a second." +msgstr "" + +msgid "" +"Set the mouse events to be reported, and return a tuple ``(availmask, " +"oldmask)``. *availmask* indicates which of the specified mouse events can " +"be reported; on complete failure it returns ``0``. *oldmask* is the " +"previous value of the given window's mouse event mask. If this function is " +"never called, no mouse events are ever reported." +msgstr "" +"Встановіть події миші, про які потрібно повідомляти, і поверніть кортеж " +"``(availmask, oldmask)``. *availmask* вказує, про яку з указаних подій миші " +"можна повідомити; у разі повної помилки повертає ``0``. *oldmask* — це " +"попереднє значення маски події миші даного вікна. Якщо ця функція ніколи не " +"викликається, жодні події миші не повідомляються." + +msgid "Sleep for *ms* milliseconds." +msgstr "Сплячий режим на *мс* мілісекунди." + +msgid "" +"Create and return a pointer to a new pad data structure with the given " +"number of lines and columns. Return a pad as a window object." +msgstr "" +"Створіть і поверніть вказівник на нову структуру даних із заданою кількістю " +"рядків і стовпців. Повертає блокнот як віконний об’єкт." + +msgid "" +"A pad is like a window, except that it is not restricted by the screen size, " +"and is not necessarily associated with a particular part of the screen. " +"Pads can be used when a large window is needed, and only a part of the " +"window will be on the screen at one time. Automatic refreshes of pads (such " +"as from scrolling or echoing of input) do not occur. The :meth:`~window." +"refresh` and :meth:`~window.noutrefresh` methods of a pad require 6 " +"arguments to specify the part of the pad to be displayed and the location on " +"the screen to be used for the display. The arguments are *pminrow*, " +"*pmincol*, *sminrow*, *smincol*, *smaxrow*, *smaxcol*; the *p* arguments " +"refer to the upper left corner of the pad region to be displayed and the *s* " +"arguments define a clipping box on the screen within which the pad region is " +"to be displayed." +msgstr "" +"Панель схожа на вікно, за винятком того, що вона не обмежена розміром екрана " +"та не обов’язково пов’язана з певною частиною екрана. Підкладки можна " +"використовувати, коли потрібне велике вікно, і на екрані одночасно буде лише " +"частина вікна. Автоматичне оновлення панелей (наприклад, прокручування або " +"відлуння введення) не відбувається. Методи панелі :meth:`~window.refresh` і :" +"meth:`~window.noutrefresh` вимагають 6 аргументів для визначення частини " +"панелі, яка буде відображатися, і місця на екрані, яке буде " +"використовуватися для відображення. Аргументи: *pminrow*, *pmincol*, " +"*sminrow*, *smincol*, *smaxrow*, *smaxcol*; Аргументи *p* стосуються " +"верхнього лівого кута області панелі, яка має відображатися, а аргументи *s* " +"визначають рамку відсікання на екрані, в межах якої має відображатися " +"область панелі." + +msgid "" +"Return a new :ref:`window `, whose left-upper corner " +"is at ``(begin_y, begin_x)``, and whose height/width is *nlines*/*ncols*." +msgstr "" +"Повертає нове :ref:`вікно `, лівий верхній кут якого " +"знаходиться в ``(begin_y, begin_x)``, а висота/ширина — *nlines*/*ncols*." + +msgid "" +"By default, the window will extend from the specified position to the lower " +"right corner of the screen." +msgstr "" +"За замовчуванням вікно розширюється від зазначеної позиції до правого " +"нижнього кута екрана." + +msgid "" +"Enter newline mode. This mode translates the return key into newline on " +"input, and translates newline into return and line-feed on output. Newline " +"mode is initially on." +msgstr "" +"Увійдіть у режим нового рядка. Цей режим перетворює клавішу повернення на " +"новий рядок під час введення та перетворює новий рядок на повернення та " +"переведення рядка під час виведення. Спочатку ввімкнено режим нового рядка." + +msgid "" +"Leave cbreak mode. Return to normal \"cooked\" mode with line buffering." +msgstr "" +"Вийти з режиму cbreak. Повернутися до звичайного режиму \"приготування\" з " +"буферизацією рядків." + +msgid "Leave echo mode. Echoing of input characters is turned off." +msgstr "Вийти з режиму відлуння. Ехо введених символів вимкнено." + +msgid "" +"Leave newline mode. Disable translation of return into newline on input, " +"and disable low-level translation of newline into newline/return on output " +"(but this does not change the behavior of ``addch('\\n')``, which always " +"does the equivalent of return and line feed on the virtual screen). With " +"translation off, curses can sometimes speed up vertical motion a little; " +"also, it will be able to detect the return key on input." +msgstr "" +"Вийти з режиму нового рядка. Вимкнути переклад повернення на новий рядок під " +"час введення та вимкнути низькорівневий переклад нового рядка на новий рядок/" +"повернення на виході (але це не змінює поведінку ``addch('\\n')``, який " +"завжди виконує еквівалент повернення та переклад рядка на віртуальному " +"екрані). Якщо переклад вимкнено, прокляття іноді можуть трохи пришвидшити " +"вертикальний рух; також він зможе виявити ключ повернення під час введення." + +msgid "" +"When the :func:`!noqiflush` routine is used, normal flush of input and " +"output queues associated with the ``INTR``, ``QUIT`` and ``SUSP`` characters " +"will not be done. You may want to call :func:`!noqiflush` in a signal " +"handler if you want output to continue as though the interrupt had not " +"occurred, after the handler exits." +msgstr "" +"Коли використовується процедура :func:`!noqiflush`, звичайне очищення черг " +"введення та виведення, пов’язаних із символами ``INTR``, ``QUIT`` і " +"``SUSP``, не виконуватиметься. Ви можете викликати :func:`!noqiflush` в " +"обробнику сигналу, якщо ви бажаєте, щоб виведення продовжувалося так, ніби " +"переривання не було, після завершення роботи обробника." + +msgid "Leave raw mode. Return to normal \"cooked\" mode with line buffering." +msgstr "" +"Вийти з режиму raw. Повернутися до звичайного режиму \"приготування\" з " +"буферизацією рядків." + +msgid "" +"Return a tuple ``(fg, bg)`` containing the colors for the requested color " +"pair. The value of *pair_number* must be between ``0`` and ``COLOR_PAIRS - " +"1``." +msgstr "" +"Повертає кортеж ``(fg, bg)``, що містить кольори для запитаної пари " +"кольорів. Значення *pair_number* має бути між ``0`` і ``COLOR_PAIRS - 1``." + +msgid "" +"Return the number of the color-pair set by the attribute value *attr*. :func:" +"`color_pair` is the counterpart to this function." +msgstr "" +"Повертає номер пари кольорів, заданий значенням атрибута *attr*. :func:" +"`color_pair` є аналогом цієї функції." + +msgid "" +"Equivalent to ``tputs(str, 1, putchar)``; emit the value of a specified " +"terminfo capability for the current terminal. Note that the output of :func:" +"`putp` always goes to standard output." +msgstr "" +"Еквівалент ``tputs(str, 1, putchar)``; видавати значення вказаної можливості " +"terminfo для поточного терміналу. Зауважте, що вивід :func:`putp` завжди " +"переходить у стандартний вивід." + +msgid "" +"If *flag* is ``False``, the effect is the same as calling :func:`noqiflush`. " +"If *flag* is ``True``, or no argument is provided, the queues will be " +"flushed when these control characters are read." +msgstr "" +"Якщо *flag* має значення ``False``, ефект такий самий, як виклик :func:" +"`noqiflush`. Якщо *flag* має значення ``True`` або аргумент не надано, черги " +"будуть скинуті під час читання цих керуючих символів." + +msgid "" +"Enter raw mode. In raw mode, normal line buffering and processing of " +"interrupt, quit, suspend, and flow control keys are turned off; characters " +"are presented to curses input functions one by one." +msgstr "" +"Увійдіть у режим raw. У необробленому режимі звичайна буферизація лінії та " +"обробка клавіш переривання, виходу, призупинення та керування потоком " +"вимкнено; символи представлені функціям введення curses один за одним." + +msgid "" +"Restore the terminal to \"program\" mode, as previously saved by :func:" +"`def_prog_mode`." +msgstr "" +"Відновіть термінал у \"програмний\" режим, який раніше зберіг :func:" +"`def_prog_mode`." + +msgid "" +"Restore the terminal to \"shell\" mode, as previously saved by :func:" +"`def_shell_mode`." +msgstr "" +"Відновіть термінал у режим \"оболонки\", який раніше зберіг :func:" +"`def_shell_mode`." + +msgid "" +"Restore the state of the terminal modes to what it was at the last call to :" +"func:`savetty`." +msgstr "" +"Відновити стан режимів терміналу до того, яким він був під час останнього " +"виклику :func:`savetty`." + +msgid "" +"Backend function used by :func:`resizeterm`, performing most of the work; " +"when resizing the windows, :func:`resize_term` blank-fills the areas that " +"are extended. The calling application should fill in these areas with " +"appropriate data. The :func:`!resize_term` function attempts to resize all " +"windows. However, due to the calling convention of pads, it is not possible " +"to resize these without additional interaction with the application." +msgstr "" +"Функція серверної частини, яку використовує :func:`resizeterm`, виконує " +"більшу частину роботи; під час зміни розміру вікна :func:`resize_term` " +"заповнює порожніми області, які розширені. Додаток, що викликає, має " +"заповнити ці області відповідними даними. Функція :func:`!resize_term` " +"намагається змінити розмір усіх вікон. Однак через правила виклику планшетів " +"неможливо змінити їх розмір без додаткової взаємодії з програмою." + +msgid "" +"Resize the standard and current windows to the specified dimensions, and " +"adjusts other bookkeeping data used by the curses library that record the " +"window dimensions (in particular the SIGWINCH handler)." +msgstr "" +"Змінює розміри стандартних і поточних вікон до вказаних розмірів і " +"налаштовує інші облікові дані, які використовуються бібліотекою curses, яка " +"записує розміри вікон (зокрема, обробник SIGWINCH)." + +msgid "" +"Save the current state of the terminal modes in a buffer, usable by :func:" +"`resetty`." +msgstr "" +"Збережіть поточний стан режимів терміналу в буфері, який можна " +"використовувати :func:`resetty`." + +msgid "Retrieves the value set by :func:`set_escdelay`." +msgstr "Отримує значення, встановлене :func:`set_escdelay`." + +msgid "" +"Sets the number of milliseconds to wait after reading an escape character, " +"to distinguish between an individual escape character entered on the " +"keyboard from escape sequences sent by cursor and function keys." +msgstr "" +"Встановлює кількість мілісекунд очікування після читання керуючого символу, " +"щоб відрізнити окремий керуючий символ, введений на клавіатурі, від керуючих " +"послідовностей, надісланих курсором і функціональними клавішами." + +msgid "Retrieves the value set by :func:`set_tabsize`." +msgstr "Отримує значення, встановлене :func:`set_tabsize`." + +msgid "" +"Sets the number of columns used by the curses library when converting a tab " +"character to spaces as it adds the tab to a window." +msgstr "" +"Встановлює кількість стовпців, які використовуються бібліотекою curses під " +"час перетворення символу табуляції на пробіли, коли вона додає табуляцію до " +"вікна." + +msgid "" +"Set the virtual screen cursor to *y*, *x*. If *y* and *x* are both ``-1``, " +"then :meth:`leaveok ` is set ``True``." +msgstr "" +"Встановіть віртуальний екранний курсор на *y*, *x*. Якщо *y* і *x* мають " +"значення ``-1``, тоді :meth:`leaveok ` встановлюється " +"``True``." + +msgid "" +"Initialize the terminal. *term* is a string giving the terminal name, or " +"``None``; if omitted or ``None``, the value of the :envvar:`TERM` " +"environment variable will be used. *fd* is the file descriptor to which any " +"initialization sequences will be sent; if not supplied or ``-1``, the file " +"descriptor for ``sys.stdout`` will be used." +msgstr "" +"Ініціалізуйте термінал. *термін* - це рядок, що дає назву терміналу, або " +"``None``; якщо опущено або ``None``, буде використано значення змінної " +"середовища :envvar:`TERM`. *fd* — це дескриптор файлу, до якого будуть " +"надіслані будь-які послідовності ініціалізації; якщо не вказано або ``-1``, " +"буде використано файловий дескриптор для ``sys.stdout``." + +msgid "" +"Must be called if the programmer wants to use colors, and before any other " +"color manipulation routine is called. It is good practice to call this " +"routine right after :func:`initscr`." +msgstr "" +"Необхідно викликати, якщо програміст хоче використовувати кольори, і перед " +"викликом будь-якої іншої процедури маніпулювання кольором. Рекомендується " +"викликати цю процедуру одразу після :func:`initscr`." + +msgid "" +":func:`start_color` initializes eight basic colors (black, red, green, " +"yellow, blue, magenta, cyan, and white), and two global variables in the :" +"mod:`curses` module, :const:`COLORS` and :const:`COLOR_PAIRS`, containing " +"the maximum number of colors and color-pairs the terminal can support. It " +"also restores the colors on the terminal to the values they had when the " +"terminal was just turned on." +msgstr "" +":func:`start_color` ініціалізує вісім основних кольорів (чорний, червоний, " +"зелений, жовтий, синій, пурпуровий, блакитний і білий) і дві глобальні " +"змінні в модулі :mod:`curses`, :const:`COLORS` і :const:`COLOR_PAIRS`, що " +"містить максимальну кількість кольорів і пар кольорів, які може підтримувати " +"термінал. Він також відновлює кольори на терміналі до значень, які вони мали " +"під час увімкнення терміналу." + +msgid "" +"Return a logical OR of all video attributes supported by the terminal. This " +"information is useful when a curses program needs complete control over the " +"appearance of the screen." +msgstr "" +"Повертає логічне АБО всіх атрибутів відео, які підтримує термінал. Ця " +"інформація корисна, коли програма curses потребує повного контролю над " +"виглядом екрана." + +msgid "" +"Return the value of the environment variable :envvar:`TERM`, as a bytes " +"object, truncated to 14 characters." +msgstr "" +"Повертає значення змінної середовища :envvar:`TERM` як об’єкт bytes, " +"скорочений до 14 символів." + +msgid "" +"Return the value of the Boolean capability corresponding to the terminfo " +"capability name *capname* as an integer. Return the value ``-1`` if " +"*capname* is not a Boolean capability, or ``0`` if it is canceled or absent " +"from the terminal description." +msgstr "" +"Повертає значення логічної можливості, що відповідає назві можливості " +"terminfo *capname* як ціле число. Повертає значення ``-1``, якщо *capname* " +"не є логічною можливістю, або ``0``, якщо вона скасована або відсутня в " +"описі терміналу." + +msgid "" +"Return the value of the numeric capability corresponding to the terminfo " +"capability name *capname* as an integer. Return the value ``-2`` if " +"*capname* is not a numeric capability, or ``-1`` if it is canceled or absent " +"from the terminal description." +msgstr "" +"Повертає значення числової можливості, що відповідає назві можливості " +"terminfo *capname* як ціле число. Повертає значення ``-2``, якщо *capname* " +"не є числовою можливістю, або ``-1``, якщо вона скасована або відсутня в " +"описі терміналу." + +msgid "" +"Return the value of the string capability corresponding to the terminfo " +"capability name *capname* as a bytes object. Return ``None`` if *capname* " +"is not a terminfo \"string capability\", or is canceled or absent from the " +"terminal description." +msgstr "" +"Повертає значення можливості рядка, що відповідає назві можливості terminfo " +"*capname* як об’єкт bytes. Повертає ``None``, якщо *capname* не є " +"\"можливістю рядка terminfo\", або його скасовано чи немає в описі терміналу." + +msgid "" +"Instantiate the bytes object *str* with the supplied parameters, where *str* " +"should be a parameterized string obtained from the terminfo database. E.g. " +"``tparm(tigetstr(\"cup\"), 5, 3)`` could result in ``b'\\033[6;4H'``, the " +"exact result depending on terminal type." +msgstr "" +"Створіть екземпляр об’єкта bytes *str* із наданими параметрами, де *str* має " +"бути параметризованим рядком, отриманим із бази даних terminfo. наприклад " +"``tparm(tigetstr(\"cup\"), 5, 3)`` може привести до ``b'\\033[6;4H''``, " +"точний результат залежить від типу терміналу." + +msgid "" +"Specify that the file descriptor *fd* be used for typeahead checking. If " +"*fd* is ``-1``, then no typeahead checking is done." +msgstr "" +"Вкажіть, що дескриптор файлу *fd* використовується для перевірки наперед. " +"Якщо *fd* дорівнює ``-1``, то попередня перевірка не виконується." + +msgid "" +"The curses library does \"line-breakout optimization\" by looking for " +"typeahead periodically while updating the screen. If input is found, and it " +"is coming from a tty, the current update is postponed until refresh or " +"doupdate is called again, allowing faster response to commands typed in " +"advance. This function allows specifying a different file descriptor for " +"typeahead checking." +msgstr "" +"Бібліотека curses виконує \"оптимізацію розриву рядків\", періодично шукаючи " +"попереднє введення під час оновлення екрана. Якщо вхідні дані знайдено, і " +"вони надходять із tty, поточне оновлення відкладається до повторного виклику " +"refresh або doupdate, що дозволяє швидше відповідати на команди, введені " +"заздалегідь. Ця функція дозволяє вказати інший дескриптор файлу для " +"попередньої перевірки." + +msgid "" +"Return a bytes object which is a printable representation of the character " +"*ch*. Control characters are represented as a caret followed by the " +"character, for example as ``b'^C'``. Printing characters are left as they " +"are." +msgstr "" +"Повертає об’єкт bytes, який є представленням символу *ch* для друку. Керуючі " +"символи представлені у вигляді каретки, за якою йде символ, наприклад " +"``b'^C'``. Друковані символи залишаються без змін." + +msgid "Push *ch* so the next :meth:`~window.getch` will return it." +msgstr "Натисніть *ch*, щоб наступний :meth:`~window.getch` повернув його." + +msgid "Only one *ch* can be pushed before :meth:`!getch` is called." +msgstr "Лише один *ch* можна ввести перед викликом :meth:`!getch`." + +msgid "" +"Update the :const:`LINES` and :const:`COLS` module variables. Useful for " +"detecting manual screen resize." +msgstr "" + +msgid "Push *ch* so the next :meth:`~window.get_wch` will return it." +msgstr "Натисніть *ch*, щоб наступний :meth:`~window.get_wch` повернув його." + +msgid "Only one *ch* can be pushed before :meth:`!get_wch` is called." +msgstr "Лише один *ch* можна надіслати перед викликом :meth:`!get_wch`." + +msgid "" +"Push a :const:`KEY_MOUSE` event onto the input queue, associating the given " +"state data with it." +msgstr "" +"Надішліть подію :const:`KEY_MOUSE` до черги введення, пов’язавши з нею дані " +"стану." + +msgid "" +"If used, this function should be called before :func:`initscr` or newterm " +"are called. When *flag* is ``False``, the values of lines and columns " +"specified in the terminfo database will be used, even if environment " +"variables :envvar:`LINES` and :envvar:`COLUMNS` (used by default) are set, " +"or if curses is running in a window (in which case default behavior would be " +"to use the window size if :envvar:`LINES` and :envvar:`COLUMNS` are not set)." +msgstr "" +"Якщо використовується, цю функцію слід викликати перед викликом :func:" +"`initscr` або newterm. Якщо *flag* має значення ``False``, " +"використовуватимуться значення рядків і стовпців, указані в базі даних " +"terminfo, навіть якщо встановлено змінні середовища :envvar:`LINES` і :" +"envvar:`COLUMNS` (використовуються за умовчанням). , або якщо curses " +"запущено у вікні (у цьому випадку типовою поведінкою буде використання " +"розміру вікна, якщо :envvar:`LINES` і :envvar:`COLUMNS` не встановлено)." + +msgid "" +"Allow use of default values for colors on terminals supporting this feature. " +"Use this to support transparency in your application. The default color is " +"assigned to the color number ``-1``. After calling this function, " +"``init_pair(x, curses.COLOR_RED, -1)`` initializes, for instance, color pair " +"*x* to a red foreground color on the default background." +msgstr "" +"Дозволити використовувати значення за замовчуванням для кольорів на " +"терміналах, які підтримують цю функцію. Використовуйте це для підтримки " +"прозорості у своїй програмі. Кольору за замовчуванням призначається номер " +"кольору ``-1``. Після виклику цієї функції ``init_pair(x, curses.COLOR_RED, " +"-1)`` ініціалізує, наприклад, пару кольорів *x* червоним кольором переднього " +"плану на фоні за замовчуванням." + +msgid "" +"Initialize curses and call another callable object, *func*, which should be " +"the rest of your curses-using application. If the application raises an " +"exception, this function will restore the terminal to a sane state before re-" +"raising the exception and generating a traceback. The callable object " +"*func* is then passed the main window 'stdscr' as its first argument, " +"followed by any other arguments passed to :func:`!wrapper`. Before calling " +"*func*, :func:`!wrapper` turns on cbreak mode, turns off echo, enables the " +"terminal keypad, and initializes colors if the terminal has color support. " +"On exit (whether normally or by exception) it restores cooked mode, turns on " +"echo, and disables the terminal keypad." +msgstr "" +"Ініціалізуйте curses і викличте інший об’єкт, який можна викликати, *func*, " +"який має бути рештою вашої програми, що використовує curses. Якщо програма " +"викликає виняток, ця функція відновить термінал до працездатного стану перед " +"тим, як повторно викликати виняток і створити зворотне відстеження. " +"Викликаний об’єкт *func* потім передається головному вікну \"stdscr\" як " +"перший аргумент, а потім будь-які інші аргументи, передані :func:`!wrapper`. " +"Перед викликом *func* :func:`!wrapper` вмикає режим cbreak, вимикає " +"відлуння, вмикає клавіатуру терміналу та ініціалізує кольори, якщо термінал " +"підтримує кольори. Після виходу (звичайно чи за винятком) він відновлює " +"режим приготування, вмикає відлуння та вимикає клавіатуру терміналу." + +msgid "Window Objects" +msgstr "Об'єкти вікна" + +msgid "" +"Window objects, as returned by :func:`initscr` and :func:`newwin` above, " +"have the following methods and attributes:" +msgstr "" +"Об’єкти Window, які повертаються :func:`initscr` і :func:`newwin` вище, " +"мають такі методи та атрибути:" + +msgid "" +"Paint character *ch* at ``(y, x)`` with attributes *attr*, overwriting any " +"character previously painted at that location. By default, the character " +"position and attributes are the current settings for the window object." +msgstr "" +"Зафарбувати символ *ch* у ``(y, x)`` за допомогою атрибутів *attr*, " +"перезаписавши будь-який символ, попередньо намальований у цьому місці. За " +"замовчуванням позиція символу та атрибути є поточними налаштуваннями об’єкта " +"вікна." + +msgid "" +"Writing outside the window, subwindow, or pad raises a :exc:`curses.error`. " +"Attempting to write to the lower right corner of a window, subwindow, or pad " +"will cause an exception to be raised after the character is printed." +msgstr "" +"Написання поза вікном, підвікном або блокнотом викликає :exc:`curses.error`. " +"Спроба написати в нижньому правому куті вікна, підвікна або панелі призведе " +"до виникнення виняткової ситуації після друку символу." + +msgid "" +"Paint at most *n* characters of the character string *str* at ``(y, x)`` " +"with attributes *attr*, overwriting anything previously on the display." +msgstr "" +"Зафарбуйте щонайбільше *n* символів рядка символів *str* у ``(y, x)`` з " +"атрибутами *attr*, перезаписуючи все, що було раніше на дисплеї." + +msgid "" +"Paint the character string *str* at ``(y, x)`` with attributes *attr*, " +"overwriting anything previously on the display." +msgstr "" +"Зафарбуйте рядок символів *str* у ``(y, x)`` атрибутами *attr*, " +"перезаписуючи все, що було раніше на дисплеї." + +msgid "" +"Writing outside the window, subwindow, or pad raises :exc:`curses.error`. " +"Attempting to write to the lower right corner of a window, subwindow, or pad " +"will cause an exception to be raised after the string is printed." +msgstr "" +"Написання поза вікном, підвікном або блокнотом викликає :exc:`curses.error`. " +"Спроба написати в нижньому правому куті вікна, підвікна або панелі призведе " +"до виникнення виняткової ситуації після друку рядка." + +msgid "" +"A `bug in ncurses `_, the backend for " +"this Python module, can cause SegFaults when resizing windows. This is fixed " +"in ncurses-6.1-20190511. If you are stuck with an earlier ncurses, you can " +"avoid triggering this if you do not call :func:`addstr` with a *str* that " +"has embedded newlines. Instead, call :func:`addstr` separately for each " +"line." +msgstr "" +"`Помилка в ncurses `_, серверній частині " +"цього модуля Python, може викликати SegFaults під час зміни розміру вікон. " +"Це виправлено в ncurses-6.1-20190511. Якщо ви застрягли на попередній " +"ncurses, ви можете уникнути цього, якщо не викличете :func:`addstr` з *str*, " +"який має вбудовані символи нового рядка. Натомість викликайте :func:`addstr` " +"окремо для кожного рядка." + +msgid "" +"Remove attribute *attr* from the \"background\" set applied to all writes to " +"the current window." +msgstr "" +"Видалити атрибут *attr* із набору \"фон\", застосованого до всіх записів у " +"поточному вікні." + +msgid "" +"Add attribute *attr* from the \"background\" set applied to all writes to " +"the current window." +msgstr "" +"Додайте атрибут *attr* із набору \"фон\", застосованого до всіх записів у " +"поточному вікні." + +msgid "" +"Set the \"background\" set of attributes to *attr*. This set is initially " +"``0`` (no attributes)." +msgstr "" +"Встановіть для набору атрибутів \"фон\" значення *attr*. Цей набір початково " +"``0`` (без атрибутів)." + +msgid "" +"Set the background property of the window to the character *ch*, with " +"attributes *attr*. The change is then applied to every character position " +"in that window:" +msgstr "" +"Встановіть для властивості фону вікна символ *ch* з атрибутами *attr*. Потім " +"зміни застосовуються до кожної позиції символу у цьому вікні:" + +msgid "" +"The attribute of every character in the window is changed to the new " +"background attribute." +msgstr "Атрибут кожного символу у вікні змінено на новий атрибут фону." + +msgid "" +"Wherever the former background character appears, it is changed to the new " +"background character." +msgstr "" +"Усюди, де з’являється попередній фоновий символ, він змінюється на новий " +"фоновий символ." + +msgid "" +"Set the window's background. A window's background consists of a character " +"and any combination of attributes. The attribute part of the background is " +"combined (OR'ed) with all non-blank characters that are written into the " +"window. Both the character and attribute parts of the background are " +"combined with the blank characters. The background becomes a property of " +"the character and moves with the character through any scrolling and insert/" +"delete line/character operations." +msgstr "" +"Встановити фон вікна. Фон вікна складається з символу та будь-якої " +"комбінації атрибутів. Атрибутна частина фону поєднується (оперується АБО) з " +"усіма непробілами, які записуються у вікно. Частини фону символів і " +"атрибутів поєднуються з порожніми символами. Фон стає властивістю символу та " +"переміщується разом із символом під час будь-яких операцій прокручування та " +"вставлення/видалення рядків/символів." + +msgid "" +"Draw a border around the edges of the window. Each parameter specifies the " +"character to use for a specific part of the border; see the table below for " +"more details." +msgstr "" +"Намалюйте рамку по краях вікна. Кожен параметр визначає символ для " +"використання для певної частини рамки; дивіться таблицю нижче для більш " +"детальної інформації." + +msgid "" +"A ``0`` value for any parameter will cause the default character to be used " +"for that parameter. Keyword parameters can *not* be used. The defaults are " +"listed in this table:" +msgstr "" +"Значення ``0`` для будь-якого параметра призведе до використання символу за " +"замовчуванням для цього параметра. Параметри ключових слів *не* можна " +"використовувати. Значення за замовчуванням наведено в цій таблиці:" + +msgid "Parameter" +msgstr "Параметр" + +msgid "Description" +msgstr "опис" + +msgid "Default value" +msgstr "Значення за замовчуванням" + +msgid "*ls*" +msgstr "*ls*" + +msgid "Left side" +msgstr "Ліва сторона" + +msgid ":const:`ACS_VLINE`" +msgstr ":const:`ACS_VLINE`" + +msgid "*rs*" +msgstr "*rs*" + +msgid "Right side" +msgstr "Права сторона" + +msgid "*ts*" +msgstr "*ts*" + +msgid "Top" +msgstr "Топ" + +msgid ":const:`ACS_HLINE`" +msgstr ":const:`ACS_HLINE`" + +msgid "*bs*" +msgstr "*bs*" + +msgid "Bottom" +msgstr "Дно" + +msgid "*tl*" +msgstr "*tl*" + +msgid "Upper-left corner" +msgstr "Лівий верхній кут" + +msgid ":const:`ACS_ULCORNER`" +msgstr ":const:`ACS_ULCORNER`" + +msgid "*tr*" +msgstr "*tr*" + +msgid "Upper-right corner" +msgstr "Правий верхній кут" + +msgid ":const:`ACS_URCORNER`" +msgstr ":const:`ACS_URCORNER`" + +msgid "*bl*" +msgstr "*bl*" + +msgid "Bottom-left corner" +msgstr "Нижній лівий кут" + +msgid ":const:`ACS_LLCORNER`" +msgstr ":const:`ACS_LLCORNER`" + +msgid "*br*" +msgstr "*br*" + +msgid "Bottom-right corner" +msgstr "Правий нижній кут" + +msgid ":const:`ACS_LRCORNER`" +msgstr ":const:`ACS_LRCORNER`" + +msgid "" +"Similar to :meth:`border`, but both *ls* and *rs* are *vertch* and both *ts* " +"and *bs* are *horch*. The default corner characters are always used by this " +"function." +msgstr "" +"Подібно до :meth:`border`, але *ls* і *rs* є *vertch*, а *ts* і *bs* є " +"*horch*. Ця функція завжди використовує стандартні кутові символи." + +msgid "" +"Set the attributes of *num* characters at the current cursor position, or at " +"position ``(y, x)`` if supplied. If *num* is not given or is ``-1``, the " +"attribute will be set on all the characters to the end of the line. This " +"function moves cursor to position ``(y, x)`` if supplied. The changed line " +"will be touched using the :meth:`touchline` method so that the contents will " +"be redisplayed by the next window refresh." +msgstr "" +"Встановіть атрибути *кількість* символів у поточній позиції курсору або в " +"позиції ``(y, x)``, якщо надається. Якщо *num* не вказано або має значення " +"``-1``, атрибут буде встановлено для всіх символів до кінця рядка. Ця " +"функція переміщує курсор у позицію ``(y, x)``, якщо вона надана. Змінений " +"рядок буде торкнуто за допомогою методу :meth:`touchline`, щоб вміст знову " +"відображався під час наступного оновлення вікна." + +msgid "" +"Like :meth:`erase`, but also cause the whole window to be repainted upon " +"next call to :meth:`refresh`." +msgstr "" +"Подібно до :meth:`erase`, але також призведе до перефарбування всього вікна " +"під час наступного виклику :meth:`refresh`." + +msgid "" +"If *flag* is ``True``, the next call to :meth:`refresh` will clear the " +"window completely." +msgstr "" +"Якщо *flag* має значення ``True``, наступний виклик :meth:`refresh` повністю " +"очистить вікно." + +msgid "" +"Erase from cursor to the end of the window: all lines below the cursor are " +"deleted, and then the equivalent of :meth:`clrtoeol` is performed." +msgstr "" +"Видалити від курсора до кінця вікна: усі рядки під курсором видаляються, а " +"потім виконується еквівалент :meth:`clrtoeol`." + +msgid "Erase from cursor to the end of the line." +msgstr "Стерти від курсора до кінця рядка." + +msgid "" +"Update the current cursor position of all the ancestors of the window to " +"reflect the current cursor position of the window." +msgstr "" +"Оновити поточну позицію курсору всіх предків вікна, щоб відобразити поточну " +"позицію курсору вікна." + +msgid "Delete any character at ``(y, x)``." +msgstr "Видаліть будь-який символ у ``(y, x)``." + +msgid "" +"Delete the line under the cursor. All following lines are moved up by one " +"line." +msgstr "" +"Видалити рядок під курсором. Усі наступні рядки переносяться на один рядок " +"вгору." + +msgid "" +"An abbreviation for \"derive window\", :meth:`derwin` is the same as " +"calling :meth:`subwin`, except that *begin_y* and *begin_x* are relative to " +"the origin of the window, rather than relative to the entire screen. Return " +"a window object for the derived window." +msgstr "" +"Абревіатура від \"вихідного вікна\", :meth:`derwin` — це те саме, що виклик :" +"meth:`subwin`, за винятком того, що *begin_y* і *begin_x* відносяться до " +"джерела вікна, а не до всього екран. Повертає віконний об’єкт для похідного " +"вікна." + +msgid "" +"Add character *ch* with attribute *attr*, and immediately call :meth:" +"`refresh` on the window." +msgstr "" +"Додайте символ *ch* з атрибутом *attr* і негайно викличте :meth:`refresh` у " +"вікні." + +msgid "" +"Test whether the given pair of screen-relative character-cell coordinates " +"are enclosed by the given window, returning ``True`` or ``False``. It is " +"useful for determining what subset of the screen windows enclose the " +"location of a mouse event." +msgstr "" +"Перевірте, чи задана пара координат символів клітинок, що відносяться до " +"екрану, включена даним вікном, повертаючи ``True`` або ``False``. Це корисно " +"для визначення того, яка підмножина вікон екрана містить місце події миші." + +msgid "Previously it returned ``1`` or ``0`` instead of ``True`` or ``False``." +msgstr "Раніше він повертав ``1`` або ``0`` замість ``True`` або ``False``." + +msgid "" +"Encoding used to encode method arguments (Unicode strings and characters). " +"The encoding attribute is inherited from the parent window when a subwindow " +"is created, for example with :meth:`window.subwin`. By default, current " +"locale encoding is used (see :func:`locale.getencoding`)." +msgstr "" + +msgid "Clear the window." +msgstr "Очистіть вікно." + +msgid "Return a tuple ``(y, x)`` of coordinates of upper-left corner." +msgstr "" + +msgid "Return the given window's current background character/attribute pair." +msgstr "Повертає поточну пару символ/атрибут тла даного вікна." + +msgid "" +"Get a character. Note that the integer returned does *not* have to be in " +"ASCII range: function keys, keypad keys and so on are represented by numbers " +"higher than 255. In no-delay mode, return ``-1`` if there is no input, " +"otherwise wait until a key is pressed." +msgstr "" +"Отримати персонажа. Зауважте, що повернуте ціле число *не* має бути в " +"діапазоні ASCII: функціональні клавіші, клавіші клавіатури тощо позначаються " +"числами, вищими за 255. У режимі без затримки поверніть ``-1``, якщо немає " +"введення. , інакше зачекайте, доки не буде натиснуто клавішу." + +msgid "" +"Get a wide character. Return a character for most keys, or an integer for " +"function keys, keypad keys, and other special keys. In no-delay mode, raise " +"an exception if there is no input." +msgstr "" +"Отримайте широкий характер. Повертає символ для більшості клавіш або ціле " +"число для функціональних клавіш, клавіш клавіатури та інших спеціальних " +"клавіш. У режимі без затримки викликати виняток, якщо немає введення." + +msgid "" +"Get a character, returning a string instead of an integer, as :meth:`getch` " +"does. Function keys, keypad keys and other special keys return a multibyte " +"string containing the key name. In no-delay mode, raise an exception if " +"there is no input." +msgstr "" +"Отримати символ, повертаючи рядок замість цілого числа, як це робить :meth:" +"`getch`. Функціональні клавіші, клавіші клавіатури та інші спеціальні " +"клавіші повертають багатобайтовий рядок, що містить назву клавіші. У режимі " +"без затримки викликати виняток, якщо немає введення." + +msgid "Return a tuple ``(y, x)`` of the height and width of the window." +msgstr "Повертає кортеж ``(y, x)`` висоти та ширини вікна." + +msgid "" +"Return the beginning coordinates of this window relative to its parent " +"window as a tuple ``(y, x)``. Return ``(-1, -1)`` if this window has no " +"parent." +msgstr "" +"Повертає початкові координати цього вікна відносно його батьківського вікна " +"як кортеж ``(y, x)``. Повертає ``(-1, -1)``, якщо це вікно не має " +"батьківського елемента." + +msgid "" +"Read a bytes object from the user, with primitive line editing capacity." +msgstr "" +"Читання байтового об’єкта від користувача з примітивною можливістю " +"редагування рядків." + +msgid "" +"Return a tuple ``(y, x)`` of current cursor position relative to the " +"window's upper-left corner." +msgstr "" +"Повертає кортеж ``(y, x)`` поточної позиції курсору відносно лівого " +"верхнього кута вікна." + +msgid "" +"Display a horizontal line starting at ``(y, x)`` with length *n* consisting " +"of the character *ch*." +msgstr "" +"Відобразити горизонтальну лінію, починаючи з ``(y, x)`` довжиною *n*, яка " +"складається з символу *ch*." + +msgid "" +"If *flag* is ``False``, curses no longer considers using the hardware insert/" +"delete character feature of the terminal; if *flag* is ``True``, use of " +"character insertion and deletion is enabled. When curses is first " +"initialized, use of character insert/delete is enabled by default." +msgstr "" +"Якщо *flag* має значення ``False``, curses більше не розглядає використання " +"апаратної функції вставки/видалення символів терміналу; якщо *flag* має " +"значення ``True``, увімкнено використання вставки та видалення символів. " +"Коли curses вперше ініціалізовано, використання вставки/видалення символів " +"увімкнено за замовчуванням." + +msgid "" +"If *flag* is ``True``, :mod:`curses` will try and use hardware line editing " +"facilities. Otherwise, line insertion/deletion are disabled." +msgstr "" +"Якщо *flag* має значення ``True``, :mod:`curses` спробує використати " +"апаратні засоби редагування рядків. В іншому випадку вставлення/видалення " +"рядків буде вимкнено." + +msgid "" +"If *flag* is ``True``, any change in the window image automatically causes " +"the window to be refreshed; you no longer have to call :meth:`refresh` " +"yourself. However, it may degrade performance considerably, due to repeated " +"calls to wrefresh. This option is disabled by default." +msgstr "" +"Якщо *flag* має значення ``True``, будь-яка зміна зображення вікна " +"автоматично спричиняє оновлення вікна; вам більше не потрібно викликати :" +"meth:`refresh` самостійно. Однак це може значно погіршити продуктивність " +"через повторні виклики оновлення. Цей параметр вимкнено за замовчуванням." + +msgid "" +"Return the character at the given position in the window. The bottom 8 bits " +"are the character proper, and upper bits are the attributes." +msgstr "" +"Повернути символ у задану позицію у вікні. Нижні 8 бітів є власне символом, " +"а верхні біти є атрибутами." + +msgid "" +"Paint character *ch* at ``(y, x)`` with attributes *attr*, moving the line " +"from position *x* right by one character." +msgstr "" +"Зафарбуйте символ *ch* у ``(y, x)`` з атрибутами *attr*, перемістивши лінію " +"з позиції *x* праворуч на один символ." + +msgid "" +"Insert *nlines* lines into the specified window above the current line. The " +"*nlines* bottom lines are lost. For negative *nlines*, delete *nlines* " +"lines starting with the one under the cursor, and move the remaining lines " +"up. The bottom *nlines* lines are cleared. The current cursor position " +"remains the same." +msgstr "" +"Вставте рядки *nlines* у вказане вікно над поточним рядком. Нижні рядки " +"*nlines* втрачені. Для негативних *nlines* видаліть *nlines* рядки, " +"починаючи з того, що знаходиться під курсором, і перемістіть інші рядки " +"вгору. Нижні рядки *nlines* очищаються. Поточна позиція курсору залишається " +"незмінною." + +msgid "" +"Insert a blank line under the cursor. All following lines are moved down by " +"one line." +msgstr "" +"Вставте порожній рядок під курсором. Усі наступні рядки пересуваються на " +"один рядок вниз." + +msgid "" +"Insert a character string (as many characters as will fit on the line) " +"before the character under the cursor, up to *n* characters. If *n* is " +"zero or negative, the entire string is inserted. All characters to the right " +"of the cursor are shifted right, with the rightmost characters on the line " +"being lost. The cursor position does not change (after moving to *y*, *x*, " +"if specified)." +msgstr "" +"Вставте рядок символів (стільки символів, скільки поміститься в рядку) перед " +"символом під курсором, до *n* символів. Якщо *n* дорівнює нулю або від’ємне " +"значення, вставляється весь рядок. Усі символи праворуч від курсору " +"зсуваються праворуч, а крайні праві символи в рядку втрачаються. Положення " +"курсору не змінюється (після переходу на *y*, *x*, якщо вказано)." + +msgid "" +"Insert a character string (as many characters as will fit on the line) " +"before the character under the cursor. All characters to the right of the " +"cursor are shifted right, with the rightmost characters on the line being " +"lost. The cursor position does not change (after moving to *y*, *x*, if " +"specified)." +msgstr "" +"Вставте рядок символів (стільки символів, скільки поміститься в рядку) перед " +"символом під курсором. Усі символи праворуч від курсору зсуваються праворуч, " +"а крайні праві символи в рядку втрачаються. Положення курсору не змінюється " +"(після переходу на *y*, *x*, якщо вказано)." + +msgid "" +"Return a bytes object of characters, extracted from the window starting at " +"the current cursor position, or at *y*, *x* if specified. Attributes are " +"stripped from the characters. If *n* is specified, :meth:`instr` returns a " +"string at most *n* characters long (exclusive of the trailing NUL)." +msgstr "" +"Повертає байтовий об’єкт із символами, отриманими з вікна, починаючи з " +"поточної позиції курсору або з *y*, *x*, якщо вказано. Атрибути позбавлені " +"символів. Якщо вказано *n*, :meth:`instr` повертає рядок довжиною " +"щонайбільше *n* символів (за винятком кінцевого NUL)." + +msgid "" +"Return ``True`` if the specified line was modified since the last call to :" +"meth:`refresh`; otherwise return ``False``. Raise a :exc:`curses.error` " +"exception if *line* is not valid for the given window." +msgstr "" +"Повертає ``True``, якщо вказаний рядок було змінено після останнього " +"виклику :meth:`refresh`; інакше повертає ``False``. Викликати виняток :exc:" +"`curses.error`, якщо *рядок* недійсний для даного вікна." + +msgid "" +"Return ``True`` if the specified window was modified since the last call to :" +"meth:`refresh`; otherwise return ``False``." +msgstr "" +"Повертає ``True``, якщо вказане вікно було змінено після останнього виклику :" +"meth:`refresh`; інакше повертає ``False``." + +msgid "" +"If *flag* is ``True``, escape sequences generated by some keys (keypad, " +"function keys) will be interpreted by :mod:`curses`. If *flag* is ``False``, " +"escape sequences will be left as is in the input stream." +msgstr "" +"Якщо *flag* має значення ``True``, escape-послідовності, згенеровані деякими " +"клавішами (клавіатура, функціональні клавіші), будуть інтерпретовані :mod:" +"`curses`. Якщо *flag* має значення ``False``, керуючі послідовності будуть " +"залишені у вхідному потоці." + +msgid "" +"If *flag* is ``True``, cursor is left where it is on update, instead of " +"being at \"cursor position.\" This reduces cursor movement where possible. " +"If possible the cursor will be made invisible." +msgstr "" +"Якщо *flag* має значення ``True``, курсор залишається там, де він " +"знаходиться під час оновлення, замість того, щоб бути в \"положенні " +"курсору\". Це зменшує рух курсору, де це можливо. Якщо можливо, курсор буде " +"зроблено невидимим." + +msgid "" +"If *flag* is ``False``, cursor will always be at \"cursor position\" after " +"an update." +msgstr "" +"Якщо *flag* має значення ``False``, курсор завжди буде в \"положенні " +"курсора\" після оновлення." + +msgid "Move cursor to ``(new_y, new_x)``." +msgstr "Перемістіть курсор до ``(новий_y, новий_x)``." + +msgid "" +"Move the window inside its parent window. The screen-relative parameters of " +"the window are not changed. This routine is used to display different parts " +"of the parent window at the same physical position on the screen." +msgstr "" +"Перемістити вікно всередину його батьківського вікна. Відносні до екрана " +"параметри вікна не змінюються. Ця процедура використовується для " +"відображення різних частин батьківського вікна в одній фізичній позиції на " +"екрані." + +msgid "Move the window so its upper-left corner is at ``(new_y, new_x)``." +msgstr "" +"Перемістіть вікно так, щоб його верхній лівий кут знаходився на ``(new_y, " +"new_x)``." + +msgid "If *flag* is ``True``, :meth:`getch` will be non-blocking." +msgstr "Якщо *flag* має значення ``True``, :meth:`getch` буде неблокуючим." + +msgid "If *flag* is ``True``, escape sequences will not be timed out." +msgstr "" +"Якщо *flag* має значення ``True``, escape-послідовності не будуть вичерпані." + +msgid "" +"If *flag* is ``False``, after a few milliseconds, an escape sequence will " +"not be interpreted, and will be left in the input stream as is." +msgstr "" +"Якщо *flag* має значення ``False``, через кілька мілісекунд escape-" +"послідовність не буде інтерпретовано та залишиться у вхідному потоці як є." + +msgid "" +"Mark for refresh but wait. This function updates the data structure " +"representing the desired state of the window, but does not force an update " +"of the physical screen. To accomplish that, call :func:`doupdate`." +msgstr "" +"Позначте для оновлення, але зачекайте. Ця функція оновлює структуру даних, " +"що представляє потрібний стан вікна, але не примусово оновлює фізичний " +"екран. Для цього викличте :func:`doupdate`." + +msgid "" +"Overlay the window on top of *destwin*. The windows need not be the same " +"size, only the overlapping region is copied. This copy is non-destructive, " +"which means that the current background character does not overwrite the old " +"contents of *destwin*." +msgstr "" +"Накладіть вікно поверх *destwin*. Вікна не обов’язково мають бути однакового " +"розміру, копіюється лише область, що перекривається. Ця копія є неруйнівною, " +"що означає, що поточний фоновий символ не перезаписує старий вміст *destwin*." + +msgid "" +"To get fine-grained control over the copied region, the second form of :meth:" +"`overlay` can be used. *sminrow* and *smincol* are the upper-left " +"coordinates of the source window, and the other variables mark a rectangle " +"in the destination window." +msgstr "" +"Щоб отримати детальний контроль над скопійованою областю, можна " +"використовувати другу форму :meth:`overlay`. *sminrow* і *smincol* — верхні " +"ліві координати вікна джерела, а інші змінні позначають прямокутник у вікні " +"призначення." + +msgid "" +"Overwrite the window on top of *destwin*. The windows need not be the same " +"size, in which case only the overlapping region is copied. This copy is " +"destructive, which means that the current background character overwrites " +"the old contents of *destwin*." +msgstr "" +"Перезаписати вікно поверх *destwin*. Вікна не обов’язково мають бути " +"однакового розміру, у цьому випадку копіюється лише область, що " +"перекривається. Ця копія є деструктивною, що означає, що поточний фоновий " +"символ перезаписує старий вміст *destwin*." + +msgid "" +"To get fine-grained control over the copied region, the second form of :meth:" +"`overwrite` can be used. *sminrow* and *smincol* are the upper-left " +"coordinates of the source window, the other variables mark a rectangle in " +"the destination window." +msgstr "" +"Щоб отримати детальний контроль над скопійованою областю, можна використати " +"другу форму :meth:`overwrite`. *sminrow* і *smincol* — верхні ліві " +"координати вікна джерела, інші змінні позначають прямокутник у вікні " +"призначення." + +msgid "" +"Write all data associated with the window into the provided file object. " +"This information can be later retrieved using the :func:`getwin` function." +msgstr "" +"Запишіть усі дані, пов’язані з вікном, у наданий файловий об’єкт. Пізніше цю " +"інформацію можна отримати за допомогою функції :func:`getwin`." + +msgid "" +"Indicate that the *num* screen lines, starting at line *beg*, are corrupted " +"and should be completely redrawn on the next :meth:`refresh` call." +msgstr "" +"Вказує, що *num* рядків екрана, починаючи з рядка *beg*, пошкоджені та мають " +"бути повністю перемальовані під час наступного виклику :meth:`refresh`." + +msgid "" +"Touch the entire window, causing it to be completely redrawn on the next :" +"meth:`refresh` call." +msgstr "" +"Торкніться всього вікна, щоб його повністю перемалювати під час наступного " +"виклику :meth:`refresh`." + +msgid "" +"Update the display immediately (sync actual screen with previous drawing/" +"deleting methods)." +msgstr "" +"Негайно оновіть дисплей (синхронізуйте фактичний екран із попередніми " +"методами малювання/видалення)." + +msgid "" +"The 6 optional arguments can only be specified when the window is a pad " +"created with :func:`newpad`. The additional parameters are needed to " +"indicate what part of the pad and screen are involved. *pminrow* and " +"*pmincol* specify the upper left-hand corner of the rectangle to be " +"displayed in the pad. *sminrow*, *smincol*, *smaxrow*, and *smaxcol* " +"specify the edges of the rectangle to be displayed on the screen. The lower " +"right-hand corner of the rectangle to be displayed in the pad is calculated " +"from the screen coordinates, since the rectangles must be the same size. " +"Both rectangles must be entirely contained within their respective " +"structures. Negative values of *pminrow*, *pmincol*, *sminrow*, or " +"*smincol* are treated as if they were zero." +msgstr "" +"6 необов’язкових аргументів можна вказати лише тоді, коли вікно є панеллю, " +"створеною за допомогою :func:`newpad`. Додаткові параметри потрібні, щоб " +"вказати, яка частина панелі та екрану задіяна. *pminrow* і *pmincol* " +"визначають верхній лівий кут прямокутника, який буде відображатися на " +"панелі. *sminrow*, *smincol*, *smaxrow* і *smaxcol* визначають краї " +"прямокутника, який буде відображатися на екрані. Правий нижній кут " +"прямокутника, який відображатиметься на панелі, обчислюється за координатами " +"на екрані, оскільки прямокутники мають бути однакового розміру. Обидва " +"прямокутники мають повністю міститися у відповідних структурах. Від’ємні " +"значення *pminrow*, *pmincol*, *sminrow* або *smincol* розглядаються як " +"нульові." + +msgid "" +"Reallocate storage for a curses window to adjust its dimensions to the " +"specified values. If either dimension is larger than the current values, " +"the window's data is filled with blanks that have the current background " +"rendition (as set by :meth:`bkgdset`) merged into them." +msgstr "" +"Перерозподіліть сховище для вікна curses, щоб налаштувати його розміри до " +"вказаних значень. Якщо будь-який з розмірів більший за поточні значення, " +"дані вікна заповнюються пробілами, у яких об’єднано поточне фонове " +"відтворення (як установлено :meth:`bkgdset`)." + +msgid "Scroll the screen or scrolling region upward by *lines* lines." +msgstr "Прокрутіть екран або область прокручування вгору на *лінії* лінії." + +msgid "" +"Control what happens when the cursor of a window is moved off the edge of " +"the window or scrolling region, either as a result of a newline action on " +"the bottom line, or typing the last character of the last line. If *flag* " +"is ``False``, the cursor is left on the bottom line. If *flag* is ``True``, " +"the window is scrolled up one line. Note that in order to get the physical " +"scrolling effect on the terminal, it is also necessary to call :meth:`idlok`." +msgstr "" +"Керуйте тим, що відбувається, коли курсор вікна переміщується за межі вікна " +"чи області прокручування в результаті дії нового рядка в нижньому рядку або " +"введення останнього символу останнього рядка. Якщо *flag* має значення " +"``False``, курсор залишається в нижньому рядку. Якщо *flag* має значення " +"``True``, вікно прокручується на один рядок вгору. Зауважте, що для того, " +"щоб отримати ефект фізичної прокрутки на терміналі, також необхідно " +"викликати :meth:`idlok`." + +msgid "" +"Set the scrolling region from line *top* to line *bottom*. All scrolling " +"actions will take place in this region." +msgstr "" +"Встановіть область прокручування від рядка *верхнього* до рядка *нижнього*. " +"Усі дії прокручування відбуватимуться в цьому регіоні." + +msgid "" +"Turn off the standout attribute. On some terminals this has the side effect " +"of turning off all attributes." +msgstr "" +"Вимкніть атрибут standout. На деяких терміналах це має побічним ефектом " +"вимкнення всіх атрибутів." + +msgid "Turn on attribute *A_STANDOUT*." +msgstr "Увімкніть атрибут *A_STANDOUT*." + +msgid "" +"Return a sub-window, whose upper-left corner is at ``(begin_y, begin_x)``, " +"and whose width/height is *ncols*/*nlines*." +msgstr "" +"Повертає підвікно, верхній лівий кут якого знаходиться в ``(begin_y, " +"begin_x)``, а ширина/висота *ncols*/*nlines*." + +msgid "" +"By default, the sub-window will extend from the specified position to the " +"lower right corner of the window." +msgstr "" +"За замовчуванням підвікно розширюватиметься від зазначеної позиції до " +"нижнього правого кута вікна." + +msgid "" +"Touch each location in the window that has been touched in any of its " +"ancestor windows. This routine is called by :meth:`refresh`, so it should " +"almost never be necessary to call it manually." +msgstr "" +"Торкніться кожного місця у вікні, яке було торкано в будь-якому з попередніх " +"вікон. Ця процедура викликається :meth:`refresh`, тому майже ніколи не " +"потрібно викликати її вручну." + +msgid "" +"If *flag* is ``True``, then :meth:`syncup` is called automatically whenever " +"there is a change in the window." +msgstr "" +"Якщо *flag* має значення ``True``, тоді :meth:`syncup` викликається " +"автоматично щоразу, коли відбувається зміна у вікні." + +msgid "" +"Touch all locations in ancestors of the window that have been changed in " +"the window." +msgstr "Торкніться всіх розташувань у предках вікна, які були змінені у вікні." + +msgid "" +"Set blocking or non-blocking read behavior for the window. If *delay* is " +"negative, blocking read is used (which will wait indefinitely for input). " +"If *delay* is zero, then non-blocking read is used, and :meth:`getch` will " +"return ``-1`` if no input is waiting. If *delay* is positive, then :meth:" +"`getch` will block for *delay* milliseconds, and return ``-1`` if there is " +"still no input at the end of that time." +msgstr "" +"Встановити блокуючу або неблокуючу поведінку читання для вікна. Якщо " +"*затримка* має від’ємне значення, використовується блокування читання (що " +"нескінченно чекатиме введення). Якщо *затримка* дорівнює нулю, то " +"використовується неблокуюче читання, і :meth:`getch` поверне ``-1``, якщо " +"введення не очікується. Якщо *затримка* позитивна, тоді :meth:`getch` " +"блокуватиметься на *затримку* мілісекунд і повертатиме ``-1``, якщо в кінці " +"цього часу все ще немає введення." + +msgid "" +"Pretend *count* lines have been changed, starting with line *start*. If " +"*changed* is supplied, it specifies whether the affected lines are marked as " +"having been changed (*changed*\\ ``=True``) or unchanged (*changed*\\ " +"``=False``)." +msgstr "" +"Уявіть, що *кількість* рядків змінено, починаючи з рядка *початок*. Якщо " +"вказано *changed*, це визначає, чи позначаються відповідні рядки як змінені " +"(*changed*\\ ``=True``) чи незмінені (*changed*\\ ``=False``)." + +msgid "" +"Pretend the whole window has been changed, for purposes of drawing " +"optimizations." +msgstr "Уявіть, що все вікно було змінено з метою оптимізації малюнка." + +msgid "" +"Mark all lines in the window as unchanged since the last call to :meth:" +"`refresh`." +msgstr "" +"Позначте всі рядки у вікні як незмінні з часу останнього виклику :meth:" +"`refresh`." + +msgid "" +"Display a vertical line starting at ``(y, x)`` with length *n* consisting of " +"the character *ch* with attributes *attr*." +msgstr "" + +msgid "Constants" +msgstr "Константи" + +msgid "The :mod:`curses` module defines the following data members:" +msgstr "Модуль :mod:`curses` визначає такі елементи даних:" + +msgid "" +"Some curses routines that return an integer, such as :meth:`~window." +"getch`, return :const:`ERR` upon failure." +msgstr "" +"Деякі процедури curses, які повертають ціле число, наприклад :meth:`~window." +"getch`, повертають :const:`ERR` у разі помилки." + +msgid "" +"Some curses routines that return an integer, such as :func:`napms`, " +"return :const:`OK` upon success." +msgstr "" +"Деякі процедури curses, які повертають ціле число, наприклад :func:`napms`, " +"повертають :const:`OK` після успіху." + +msgid "A bytes object representing the current version of the module." +msgstr "" + +msgid "" +"A named tuple containing the three components of the ncurses library " +"version: *major*, *minor*, and *patch*. All values are integers. The " +"components can also be accessed by name, so ``curses.ncurses_version[0]`` " +"is equivalent to ``curses.ncurses_version.major`` and so on." +msgstr "" +"Іменований кортеж, що містить три компоненти версії бібліотеки ncurses: " +"*major*, *minor* і *patch*. Усі значення є цілими. До компонентів також " +"можна отримати доступ за іменем, тому ``curses.ncurses_version[0]`` " +"еквівалентно ``curses.ncurses_version.major`` і так далі." + +msgid "Availability: if the ncurses library is used." +msgstr "Доступність: якщо використовується бібліотека ncurses." + +msgid "" +"The maximum number of colors the terminal can support. It is defined only " +"after the call to :func:`start_color`." +msgstr "" + +msgid "" +"The maximum number of color pairs the terminal can support. It is defined " +"only after the call to :func:`start_color`." +msgstr "" + +msgid "" +"The width of the screen, i.e., the number of columns. It is defined only " +"after the call to :func:`initscr`. Updated by :func:`update_lines_cols`, :" +"func:`resizeterm` and :func:`resize_term`." +msgstr "" + +msgid "" +"The height of the screen, i.e., the number of lines. It is defined only " +"after the call to :func:`initscr`. Updated by :func:`update_lines_cols`, :" +"func:`resizeterm` and :func:`resize_term`." +msgstr "" + +msgid "" +"Some constants are available to specify character cell attributes. The exact " +"constants available are system dependent." +msgstr "" +"Деякі константи доступні для визначення атрибутів клітинок символів. " +"Доступні точні константи залежать від системи." + +msgid "Attribute" +msgstr "Атрибут" + +msgid "Meaning" +msgstr "Значення" + +msgid "Alternate character set mode" +msgstr "Режим альтернативного набору символів" + +msgid "Blink mode" +msgstr "Режим моргання" + +msgid "Bold mode" +msgstr "Жирний режим" + +msgid "Dim mode" +msgstr "Режим затемнення" + +msgid "Invisible or blank mode" +msgstr "Невидимий або порожній режим" + +msgid "Italic mode" +msgstr "Курсив" + +msgid "Normal attribute" +msgstr "Нормальний атрибут" + +msgid "Protected mode" +msgstr "Захищений режим" + +msgid "Reverse background and foreground colors" +msgstr "Зворотні кольори фону та переднього плану" + +msgid "Standout mode" +msgstr "Режим видатного" + +msgid "Underline mode" +msgstr "Режим підкреслення" + +msgid "Horizontal highlight" +msgstr "Горизонтальне виділення" + +msgid "Left highlight" +msgstr "Виділення зліва" + +msgid "Low highlight" +msgstr "Низьке виділення" + +msgid "Right highlight" +msgstr "Виділіть праворуч" + +msgid "Top highlight" +msgstr "Верхня підсвітка" + +msgid "Vertical highlight" +msgstr "Вертикальне виділення" + +msgid "``A_ITALIC`` was added." +msgstr "Додано ``A_ITALIC``." + +msgid "" +"Several constants are available to extract corresponding attributes returned " +"by some methods." +msgstr "" +"Для отримання відповідних атрибутів, які повертаються деякими методами, " +"доступно кілька констант." + +msgid "Bit-mask" +msgstr "Біт-маска" + +msgid "Bit-mask to extract attributes" +msgstr "Бітова маска для вилучення атрибутів" + +msgid "Bit-mask to extract a character" +msgstr "Бітова маска для вилучення символу" + +msgid "Bit-mask to extract color-pair field information" +msgstr "Бітова маска для отримання інформації про поле пари кольорів" + +msgid "" +"Keys are referred to by integer constants with names starting with " +"``KEY_``. The exact keycaps available are system dependent." +msgstr "" +"На ключі посилаються цілі константи з іменами, що починаються з ``KEY_``. " +"Точні доступні клавіші залежать від системи." + +msgid "Key constant" +msgstr "Ключова константа" + +msgid "Key" +msgstr "ключ" + +msgid "Minimum key value" +msgstr "Мінімальне значення ключа" + +msgid "Break key (unreliable)" +msgstr "Розривний ключ (ненадійний)" + +msgid "Down-arrow" +msgstr "Стрілка вниз" + +msgid "Up-arrow" +msgstr "Стрілка вгору" + +msgid "Left-arrow" +msgstr "Стрілка вліво" + +msgid "Right-arrow" +msgstr "Стрілка вправо" + +msgid "Home key (upward+left arrow)" +msgstr "Клавіша \"Додому\" (стрілка вгору+ліворуч)" + +msgid "Backspace (unreliable)" +msgstr "Backspace (ненадійно)" + +msgid "Function keys. Up to 64 function keys are supported." +msgstr "Функціональні клавіші. Підтримується до 64 функціональних клавіш." + +msgid "Value of function key *n*" +msgstr "Значення функціональної клавіші *n*" + +msgid "Delete line" +msgstr "Видалити рядок" + +msgid "Insert line" +msgstr "Вставити рядок" + +msgid "Delete character" +msgstr "Видалити символ" + +msgid "Insert char or enter insert mode" +msgstr "Вставити символ або перейти в режим вставки" + +msgid "Exit insert char mode" +msgstr "Вийти з режиму вставки символів" + +msgid "Clear screen" +msgstr "Очистити екран" + +msgid "Clear to end of screen" +msgstr "Очистити до кінця екрана" + +msgid "Clear to end of line" +msgstr "Очистити до кінця рядка" + +msgid "Scroll 1 line forward" +msgstr "Прокрутити на 1 рядок вперед" + +msgid "Scroll 1 line backward (reverse)" +msgstr "Прокрутити на 1 рядок назад (назад)" + +msgid "Next page" +msgstr "Наступна сторінка" + +msgid "Previous page" +msgstr "Попередня сторінка" + +msgid "Set tab" +msgstr "Встановити вкладку" + +msgid "Clear tab" +msgstr "Очистити вкладку" + +msgid "Clear all tabs" +msgstr "Очистити всі вкладки" + +msgid "Enter or send (unreliable)" +msgstr "Введіть або надішліть (ненадійно)" + +msgid "Soft (partial) reset (unreliable)" +msgstr "М'яке (часткове) скидання (ненадійне)" + +msgid "Reset or hard reset (unreliable)" +msgstr "Скидання або апаратне скидання (ненадійно)" + +msgid "Print" +msgstr "Роздрукувати" + +msgid "Home down or bottom (lower left)" +msgstr "Головна внизу або внизу (внизу ліворуч)" + +msgid "Upper left of keypad" +msgstr "Верхній лівий кут клавіатури" + +msgid "Upper right of keypad" +msgstr "Правий верхній кут клавіатури" + +msgid "Center of keypad" +msgstr "Центр клавіатури" + +msgid "Lower left of keypad" +msgstr "Ліворуч внизу від клавіатури" + +msgid "Lower right of keypad" +msgstr "Правий нижній кут клавіатури" + +msgid "Back tab" +msgstr "Задня вкладка" + +msgid "Beg (beginning)" +msgstr "Бег (початок)" + +msgid "Cancel" +msgstr "Скасувати" + +msgid "Close" +msgstr "Закрити" + +msgid "Cmd (command)" +msgstr "Cmd (команда)" + +msgid "Copy" +msgstr "Копія" + +msgid "Create" +msgstr "Створити" + +msgid "End" +msgstr "Кінець" + +msgid "Exit" +msgstr "Вихід" + +msgid "Find" +msgstr "знайти" + +msgid "Help" +msgstr "Довідка" + +msgid "Mark" +msgstr "Марк" + +msgid "Message" +msgstr "повідомлення" + +msgid "Move" +msgstr "рухатися" + +msgid "Next" +msgstr "Далі" + +msgid "Open" +msgstr "ВІДЧИНЕНО" + +msgid "Options" +msgstr "Опції" + +msgid "Prev (previous)" +msgstr "Prev (попередній)" + +msgid "Redo" +msgstr "Повторити" + +msgid "Ref (reference)" +msgstr "Ref (посилання)" + +msgid "Refresh" +msgstr "Оновити" + +msgid "Replace" +msgstr "Замінити" + +msgid "Restart" +msgstr "Перезапустіть" + +msgid "Resume" +msgstr "Резюме" + +msgid "Save" +msgstr "зберегти" + +msgid "Shifted Beg (beginning)" +msgstr "Зміщений початок (початок)" + +msgid "Shifted Cancel" +msgstr "Скасування зі зсувом" + +msgid "Shifted Command" +msgstr "Зміщена команда" + +msgid "Shifted Copy" +msgstr "Зміщена копія" + +msgid "Shifted Create" +msgstr "Зсув Створити" + +msgid "Shifted Delete char" +msgstr "Зміщений Видалити символ" + +msgid "Shifted Delete line" +msgstr "Зміщений рядок \"Видалити\"." + +msgid "Select" +msgstr "Виберіть" + +msgid "Shifted End" +msgstr "Зміщений кінець" + +msgid "Shifted Clear line" +msgstr "Зміщена чиста лінія" + +msgid "Shifted Exit" +msgstr "Зміщений вихід" + +msgid "Shifted Find" +msgstr "Зміщений пошук" + +msgid "Shifted Help" +msgstr "Зміщена довідка" + +msgid "Shifted Home" +msgstr "Перенесено додому" + +msgid "Shifted Input" +msgstr "Зміщений вхід" + +msgid "Shifted Left arrow" +msgstr "Зміщена стрілка вліво" + +msgid "Shifted Message" +msgstr "Зміщене повідомлення" + +msgid "Shifted Move" +msgstr "Зміщений хід" + +msgid "Shifted Next" +msgstr "Зсув Далі" + +msgid "Shifted Options" +msgstr "Зміщені параметри" + +msgid "Shifted Prev" +msgstr "Зміщено Поперед" + +msgid "Shifted Print" +msgstr "Зміщений друк" + +msgid "Shifted Redo" +msgstr "Зміщений повтор" + +msgid "Shifted Replace" +msgstr "Зміщена заміна" + +msgid "Shifted Right arrow" +msgstr "Зміщена стрілка вправо" + +msgid "Shifted Resume" +msgstr "Зміщене резюме" + +msgid "Shifted Save" +msgstr "Зміщене збереження" + +msgid "Shifted Suspend" +msgstr "Зміщене призупинення" + +msgid "Shifted Undo" +msgstr "Зміщене скасування" + +msgid "Suspend" +msgstr "Призупинити" + +msgid "Undo" +msgstr "Скасувати" + +msgid "Mouse event has occurred" +msgstr "Сталася подія миші" + +msgid "Terminal resize event" +msgstr "Подія зміни розміру терміналу" + +msgid "Maximum key value" +msgstr "Максимальне значення ключа" + +msgid "" +"On VT100s and their software emulations, such as X terminal emulators, there " +"are normally at least four function keys (:const:`KEY_F1 `, :const:" +"`KEY_F2 `, :const:`KEY_F3 `, :const:`KEY_F4 `) " +"available, and the arrow keys mapped to :const:`KEY_UP`, :const:`KEY_DOWN`, :" +"const:`KEY_LEFT` and :const:`KEY_RIGHT` in the obvious way. If your machine " +"has a PC keyboard, it is safe to expect arrow keys and twelve function keys " +"(older PC keyboards may have only ten function keys); also, the following " +"keypad mappings are standard:" +msgstr "" + +msgid "Keycap" +msgstr "Клавіатура" + +msgid "Constant" +msgstr "Постійний" + +msgid ":kbd:`Insert`" +msgstr ":kbd:`Insert`" + +msgid "KEY_IC" +msgstr "KEY_IC" + +msgid ":kbd:`Delete`" +msgstr ":kbd:`Delete`" + +msgid "KEY_DC" +msgstr "KEY_DC" + +msgid ":kbd:`Home`" +msgstr ":kbd:`Home`" + +msgid "KEY_HOME" +msgstr "KEY_HOME" + +msgid ":kbd:`End`" +msgstr ":kbd:`End`" + +msgid "KEY_END" +msgstr "KEY_END" + +msgid ":kbd:`Page Up`" +msgstr ":kbd:`Page Up`" + +msgid "KEY_PPAGE" +msgstr "KEY_PPAGE" + +msgid ":kbd:`Page Down`" +msgstr ":kbd:`Page Down`" + +msgid "KEY_NPAGE" +msgstr "KEY_NPAGE" + +msgid "" +"The following table lists characters from the alternate character set. These " +"are inherited from the VT100 terminal, and will generally be available on " +"software emulations such as X terminals. When there is no graphic " +"available, curses falls back on a crude printable ASCII approximation." +msgstr "" +"У наведеній нижче таблиці наведено символи з альтернативного набору " +"символів. Вони успадковані від терміналу VT100 і, як правило, будуть " +"доступні на програмних емуляціях, таких як термінали X. Якщо немає доступної " +"графіки, curses повертається до грубого наближення для друку ASCII." + +msgid "These are available only after :func:`initscr` has been called." +msgstr "Вони доступні лише після виклику :func:`initscr`." + +msgid "ACS code" +msgstr "код ACS" + +msgid "alternate name for upper right corner" +msgstr "альтернативна назва для верхнього правого кута" + +msgid "solid square block" +msgstr "суцільний квадратний блок" + +msgid "board of squares" +msgstr "дошка з квадратів" + +msgid "alternate name for horizontal line" +msgstr "альтернативна назва горизонтальної лінії" + +msgid "alternate name for upper left corner" +msgstr "альтернативна назва для верхнього лівого кута" + +msgid "alternate name for top tee" +msgstr "альтернативна назва верхнього трійника" + +msgid "bottom tee" +msgstr "нижній трійник" + +msgid "bullet" +msgstr "куля" + +msgid "checker board (stipple)" +msgstr "шашка (пунктир)" + +msgid "arrow pointing down" +msgstr "стрілка вниз" + +msgid "degree symbol" +msgstr "символ ступеня" + +msgid "diamond" +msgstr "діамант" + +msgid "greater-than-or-equal-to" +msgstr "більший або рівний" + +msgid "horizontal line" +msgstr "горизонтальна лінія" + +msgid "lantern symbol" +msgstr "символ ліхтаря" + +msgid "left arrow" +msgstr "стрілка вліво" + +msgid "less-than-or-equal-to" +msgstr "менше або дорівнює" + +msgid "lower left-hand corner" +msgstr "нижній лівий кут" + +msgid "lower right-hand corner" +msgstr "нижній правий кут" + +msgid "left tee" +msgstr "лівий трійник" + +msgid "not-equal sign" +msgstr "знак нерівності" + +msgid "letter pi" +msgstr "літера пі" + +msgid "plus-or-minus sign" +msgstr "знак плюс або мінус" + +msgid "big plus sign" +msgstr "великий плюс" + +msgid "right arrow" +msgstr "стрілка вправо" + +msgid "right tee" +msgstr "правий трійник" + +msgid "scan line 1" +msgstr "сканувати рядок 1" + +msgid "scan line 3" +msgstr "рядок сканування 3" + +msgid "scan line 7" +msgstr "сканувати рядок 7" + +msgid "scan line 9" +msgstr "сканувати рядок 9" + +msgid "alternate name for lower right corner" +msgstr "альтернативна назва для нижнього правого кута" + +msgid "alternate name for vertical line" +msgstr "альтернативна назва для вертикальної лінії" + +msgid "alternate name for right tee" +msgstr "альтернативна назва правого трійника" + +msgid "alternate name for lower left corner" +msgstr "альтернативна назва для нижнього лівого кута" + +msgid "alternate name for bottom tee" +msgstr "альтернативна назва нижнього трійника" + +msgid "alternate name for left tee" +msgstr "альтернативна назва лівого трійника" + +msgid "alternate name for crossover or big plus" +msgstr "альтернативна назва для кросовера або великий плюс" + +msgid "pound sterling" +msgstr "фунт стерлінгів" + +msgid "top tee" +msgstr "верхній трійник" + +msgid "up arrow" +msgstr "стрілка вгору" + +msgid "upper left corner" +msgstr "верхній лівий кут" + +msgid "upper right corner" +msgstr "верхній правий кут" + +msgid "vertical line" +msgstr "вертикальна лінія" + +msgid "" +"The following table lists mouse button constants used by :meth:`getmouse`:" +msgstr "" + +msgid "Mouse button constant" +msgstr "" + +msgid "Mouse button *n* pressed" +msgstr "" + +msgid "Mouse button *n* released" +msgstr "" + +msgid "Mouse button *n* clicked" +msgstr "" + +msgid "Mouse button *n* double clicked" +msgstr "" + +msgid "Mouse button *n* triple clicked" +msgstr "" + +msgid "Shift was down during button state change" +msgstr "" + +msgid "Control was down during button state change" +msgstr "" + +msgid "The following table lists the predefined colors:" +msgstr "У наведеній нижче таблиці перераховано попередньо визначені кольори:" + +msgid "Color" +msgstr "колір" + +msgid "Black" +msgstr "чорний" + +msgid "Blue" +msgstr "Синій" + +msgid "Cyan (light greenish blue)" +msgstr "Блакитний (світло-зеленувато-блакитний)" + +msgid "Green" +msgstr "Зелений" + +msgid "Magenta (purplish red)" +msgstr "Маджента (багряно-червоний)" + +msgid "Red" +msgstr "Червоний" + +msgid "White" +msgstr "Білий" + +msgid "Yellow" +msgstr "Жовтий" + +msgid ":mod:`curses.textpad` --- Text input widget for curses programs" +msgstr ":mod:`curses.textpad` --- Віджет введення тексту для програм curses" + +msgid "" +"The :mod:`curses.textpad` module provides a :class:`Textbox` class that " +"handles elementary text editing in a curses window, supporting a set of " +"keybindings resembling those of Emacs (thus, also of Netscape Navigator, " +"BBedit 6.x, FrameMaker, and many other programs). The module also provides " +"a rectangle-drawing function useful for framing text boxes or for other " +"purposes." +msgstr "" +"Модуль :mod:`curses.textpad` надає клас :class:`Textbox`, який обробляє " +"елементарне редагування тексту у вікні curses, підтримуючи набір прив’язок " +"клавіш, схожих на Emacs (тобто, також у Netscape Navigator, BBedit 6.x). , " +"FrameMaker та багато інших програм). Модуль також надає функцію малювання " +"прямокутника, корисну для обрамлення текстових полів або для інших цілей." + +msgid "The module :mod:`curses.textpad` defines the following function:" +msgstr "Модуль :mod:`curses.textpad` визначає таку функцію:" + +msgid "" +"Draw a rectangle. The first argument must be a window object; the remaining " +"arguments are coordinates relative to that window. The second and third " +"arguments are the y and x coordinates of the upper left hand corner of the " +"rectangle to be drawn; the fourth and fifth arguments are the y and x " +"coordinates of the lower right hand corner. The rectangle will be drawn " +"using VT100/IBM PC forms characters on terminals that make this possible " +"(including xterm and most other software terminal emulators). Otherwise it " +"will be drawn with ASCII dashes, vertical bars, and plus signs." +msgstr "" +"Намалюйте прямокутник. Першим аргументом має бути вікно; решта аргументів є " +"координатами відносно цього вікна. Другим і третім аргументами є координати " +"y і x верхнього лівого кута прямокутника, який буде намальовано; четвертий і " +"п'ятий аргументи - це координати y і x у нижньому правому куті. Прямокутник " +"буде намальовано за допомогою символів форм VT100/IBM PC на терміналах, які " +"це роблять можливим (включаючи xterm та більшість інших програмних " +"емуляторів терміналу). Інакше він буде намальований з дефісами ASCII, " +"вертикальними смужками та знаками плюса." + +msgid "Textbox objects" +msgstr "Об'єкти текстового поля" + +msgid "You can instantiate a :class:`Textbox` object as follows:" +msgstr "Ви можете створити об’єкт :class:`Textbox` наступним чином:" + +msgid "" +"Return a textbox widget object. The *win* argument should be a curses :ref:" +"`window ` object in which the textbox is to be " +"contained. The edit cursor of the textbox is initially located at the upper " +"left hand corner of the containing window, with coordinates ``(0, 0)``. The " +"instance's :attr:`stripspaces` flag is initially on." +msgstr "" +"Повертає об’єкт віджета текстового поля. Аргумент *win* має бути об’єктом " +"curses :ref:`window `, у якому має міститися текстове " +"поле. Курсор редагування текстового поля спочатку розташований у верхньому " +"лівому куті вікна, що містить, із координатами ``(0, 0)``. Прапор :attr:" +"`stripspaces` екземпляра спочатку ввімкнено." + +msgid ":class:`Textbox` objects have the following methods:" +msgstr "Об’єкти :class:`Textbox` мають такі методи:" + +msgid "" +"This is the entry point you will normally use. It accepts editing " +"keystrokes until one of the termination keystrokes is entered. If " +"*validator* is supplied, it must be a function. It will be called for each " +"keystroke entered with the keystroke as a parameter; command dispatch is " +"done on the result. This method returns the window contents as a string; " +"whether blanks in the window are included is affected by the :attr:" +"`stripspaces` attribute." +msgstr "" +"Це точка входу, яку ви зазвичай використовуєте. Він дозволяє редагувати " +"натискання клавіш, доки не буде введено одне з натискань клавіш завершення. " +"Якщо вказано *валідатор*, це має бути функція. Він буде викликаний для " +"кожного натискання клавіші, введеного з натисканням клавіші як параметром; " +"відправка команди виконується за результатом. Цей метод повертає вміст вікна " +"у вигляді рядка; атрибут :attr:`stripspaces` впливає на те, чи будуть " +"включені порожні місця у вікні." + +msgid "" +"Process a single command keystroke. Here are the supported special " +"keystrokes:" +msgstr "" +"Обробка натискання однієї команди. Ось підтримувані спеціальні натискання " +"клавіш:" + +msgid "Keystroke" +msgstr "натискання клавіші" + +msgid "Action" +msgstr "Дія" + +msgid ":kbd:`Control-A`" +msgstr ":kbd:`Control-A`" + +msgid "Go to left edge of window." +msgstr "Перейдіть до лівого краю вікна." + +msgid ":kbd:`Control-B`" +msgstr ":kbd:`Control-B`" + +msgid "Cursor left, wrapping to previous line if appropriate." +msgstr "Курсор ліворуч, перенесення на попередній рядок, якщо потрібно." + +msgid ":kbd:`Control-D`" +msgstr ":kbd:`Control-D`" + +msgid "Delete character under cursor." +msgstr "Видалити символ під курсором." + +msgid ":kbd:`Control-E`" +msgstr ":kbd:`Control-E`" + +msgid "Go to right edge (stripspaces off) or end of line (stripspaces on)." +msgstr "" +"Перейдіть до правого краю (пробілі вимкнено) або кінець рядка (пробілі " +"увімкнено)." + +msgid ":kbd:`Control-F`" +msgstr ":kbd:`Control-F`" + +msgid "Cursor right, wrapping to next line when appropriate." +msgstr "Курсор праворуч, перенесення на наступний рядок, якщо потрібно." + +msgid ":kbd:`Control-G`" +msgstr ":kbd:`Control-G`" + +msgid "Terminate, returning the window contents." +msgstr "Завершити, повернувши вміст вікна." + +msgid ":kbd:`Control-H`" +msgstr ":kbd:`Control-H`" + +msgid "Delete character backward." +msgstr "Видалити символ назад." + +msgid ":kbd:`Control-J`" +msgstr ":kbd:`Control-J`" + +msgid "Terminate if the window is 1 line, otherwise insert newline." +msgstr "" +"Завершити, якщо вікно складається з 1 рядка, інакше вставити новий рядок." + +msgid ":kbd:`Control-K`" +msgstr ":kbd:`Control-K`" + +msgid "If line is blank, delete it, otherwise clear to end of line." +msgstr "Якщо рядок порожній, видаліть його, інакше очистіть до кінця рядка." + +msgid ":kbd:`Control-L`" +msgstr ":kbd:`Control-L`" + +msgid "Refresh screen." +msgstr "Оновити екран." + +msgid ":kbd:`Control-N`" +msgstr ":kbd:`Control-N`" + +msgid "Cursor down; move down one line." +msgstr "Курсор вниз; переміститися на один рядок вниз." + +msgid ":kbd:`Control-O`" +msgstr ":kbd:`Control-O`" + +msgid "Insert a blank line at cursor location." +msgstr "Вставте порожній рядок у місці курсора." + +msgid ":kbd:`Control-P`" +msgstr ":kbd:`Control-P`" + +msgid "Cursor up; move up one line." +msgstr "Курсор вгору; переміститися на один рядок вгору." + +msgid "" +"Move operations do nothing if the cursor is at an edge where the movement is " +"not possible. The following synonyms are supported where possible:" +msgstr "" +"Операції переміщення нічого не роблять, якщо курсор знаходиться на краю, де " +"переміщення неможливе. За можливості підтримуються такі синоніми:" + +msgid ":const:`~curses.KEY_LEFT`" +msgstr "" + +msgid ":const:`~curses.KEY_RIGHT`" +msgstr "" + +msgid ":const:`~curses.KEY_UP`" +msgstr "" + +msgid ":const:`~curses.KEY_DOWN`" +msgstr "" + +msgid ":const:`~curses.KEY_BACKSPACE`" +msgstr "" + +msgid ":kbd:`Control-h`" +msgstr ":kbd:`Control-h`" + +msgid "" +"All other keystrokes are treated as a command to insert the given character " +"and move right (with line wrapping)." +msgstr "" +"Усі інші натискання клавіш сприймаються як команда вставити вказаний символ " +"і переміститися вправо (з переносом рядка)." + +msgid "" +"Return the window contents as a string; whether blanks in the window are " +"included is affected by the :attr:`stripspaces` member." +msgstr "" +"Повертає вміст вікна у вигляді рядка; член :attr:`stripspaces` впливає на " +"те, чи будуть включені порожні місця у вікні." + +msgid "" +"This attribute is a flag which controls the interpretation of blanks in the " +"window. When it is on, trailing blanks on each line are ignored; any cursor " +"motion that would land the cursor on a trailing blank goes to the end of " +"that line instead, and trailing blanks are stripped when the window contents " +"are gathered." +msgstr "" +"Цей атрибут є прапорцем, який керує інтерпретацією прогалин у вікні. Коли " +"його ввімкнено, пробіли в кінці кожного рядка ігноруються; будь-який рух " +"курсору, який призведе до переходу курсора на порожнє місце в кінці, " +"натомість переходить у кінець цього рядка, а кінцеві порожні місця " +"видаляються, коли вміст вікна збирається." diff --git a/library/curses_ascii.po b/library/curses_ascii.po new file mode 100644 index 000000000..b83cad6b6 --- /dev/null +++ b/library/curses_ascii.po @@ -0,0 +1,323 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 01:03+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!curses.ascii` --- Utilities for ASCII characters" +msgstr "" + +msgid "**Source code:** :source:`Lib/curses/ascii.py`" +msgstr "" + +msgid "" +"The :mod:`curses.ascii` module supplies name constants for ASCII characters " +"and functions to test membership in various ASCII character classes. The " +"constants supplied are names for control characters as follows:" +msgstr "" +"Модуль :mod:`curses.ascii` надає константи імен для символів ASCII і функції " +"для перевірки належності до різних класів символів ASCII. Надані константи є " +"такими іменами керуючих символів:" + +msgid "Name" +msgstr "Ім'я" + +msgid "Meaning" +msgstr "Значення" + +msgid "Start of heading, console interrupt" +msgstr "Початок заголовка, переривання консолі" + +msgid "Start of text" +msgstr "Початок тексту" + +msgid "End of text" +msgstr "Кінець тексту" + +msgid "End of transmission" +msgstr "Кінець передачі" + +msgid "Enquiry, goes with :const:`ACK` flow control" +msgstr "Запит, іде з керуванням потоком :const:`ACK`" + +msgid "Acknowledgement" +msgstr "Подяка" + +msgid "Bell" +msgstr "дзвоник" + +msgid "Backspace" +msgstr "Backspace" + +msgid "Tab" +msgstr "вкладка" + +msgid "Alias for :const:`TAB`: \"Horizontal tab\"" +msgstr "Псевдонім для :const:`TAB`: \"Горизонтальна вкладка\"" + +msgid "Line feed" +msgstr "Передача рядка" + +msgid "Alias for :const:`LF`: \"New line\"" +msgstr "Псевдонім для :const:`LF`: \"Новий рядок\"" + +msgid "Vertical tab" +msgstr "Вертикальна вкладка" + +msgid "Form feed" +msgstr "Подача форми" + +msgid "Carriage return" +msgstr "Повернення каретки" + +msgid "Shift-out, begin alternate character set" +msgstr "Shift-out, початок альтернативного набору символів" + +msgid "Shift-in, resume default character set" +msgstr "Shift-in, відновлення стандартного набору символів" + +msgid "Data-link escape" +msgstr "Вихід каналу даних" + +msgid "XON, for flow control" +msgstr "XON, для керування потоком" + +msgid "Device control 2, block-mode flow control" +msgstr "Управління пристроєм 2, блочне керування потоком" + +msgid "XOFF, for flow control" +msgstr "XOFF, для керування потоком" + +msgid "Device control 4" +msgstr "Контроль пристрою 4" + +msgid "Negative acknowledgement" +msgstr "Негативне визнання" + +msgid "Synchronous idle" +msgstr "Синхронний холостий хід" + +msgid "End transmission block" +msgstr "Кінцевий блок передачі" + +msgid "Cancel" +msgstr "Скасувати" + +msgid "End of medium" +msgstr "Кінець середнього" + +msgid "Substitute" +msgstr "Замінник" + +msgid "Escape" +msgstr "Втеча" + +msgid "File separator" +msgstr "Роздільник файлів" + +msgid "Group separator" +msgstr "Роздільник груп" + +msgid "Record separator, block-mode terminator" +msgstr "Роздільник записів, термінатор блокового режиму" + +msgid "Unit separator" +msgstr "Роздільник одиниць" + +msgid "Space" +msgstr "космос" + +msgid "Delete" +msgstr "Видалити" + +msgid "" +"Note that many of these have little practical significance in modern usage. " +"The mnemonics derive from teleprinter conventions that predate digital " +"computers." +msgstr "" +"Зверніть увагу, що багато з них не мають практичного значення в сучасному " +"використанні. Мнемоніка походить від телепринтерів, які передували цифровим " +"комп’ютерам." + +msgid "" +"The module supplies the following functions, patterned on those in the " +"standard C library:" +msgstr "" +"Модуль надає такі функції, створені за зразком стандартної бібліотеки C:" + +msgid "" +"Checks for an ASCII alphanumeric character; it is equivalent to ``isalpha(c) " +"or isdigit(c)``." +msgstr "" +"Перевіряє наявність буквено-цифрового символу ASCII; це еквівалентно " +"``isalpha(c) або isdigit(c)``." + +msgid "" +"Checks for an ASCII alphabetic character; it is equivalent to ``isupper(c) " +"or islower(c)``." +msgstr "" +"Перевіряє наявність літер ASCII; це еквівалентно ``isupper(c) або " +"islower(c)``." + +msgid "Checks for a character value that fits in the 7-bit ASCII set." +msgstr "Перевіряє значення символу, яке відповідає 7-бітовому набору ASCII." + +msgid "Checks for an ASCII whitespace character; space or horizontal tab." +msgstr "Перевіряє пробіл ASCII; пробіл або горизонтальну табуляцію." + +msgid "" +"Checks for an ASCII control character (in the range 0x00 to 0x1f or 0x7f)." +msgstr "" +"Перевіряє контрольний символ ASCII (у діапазоні від 0x00 до 0x1f або 0x7f)." + +msgid "" +"Checks for an ASCII decimal digit, ``'0'`` through ``'9'``. This is " +"equivalent to ``c in string.digits``." +msgstr "" +"Перевіряє десяткову цифру ASCII від ``'0'`` до ``'9'``. Це еквівалентно ``c " +"в string.digits``." + +msgid "Checks for ASCII any printable character except space." +msgstr "Перевіряє ASCII будь-який друкований символ, крім пробілу." + +msgid "Checks for an ASCII lower-case character." +msgstr "Перевіряє символ ASCII у нижньому регістрі." + +msgid "Checks for any ASCII printable character including space." +msgstr "Перевіряє будь-який друкований символ ASCII, включаючи пробіл." + +msgid "" +"Checks for any printable ASCII character which is not a space or an " +"alphanumeric character." +msgstr "" +"Перевіряє будь-який друкований символ ASCII, який не є пробілом або буквено-" +"цифровим символом." + +msgid "" +"Checks for ASCII white-space characters; space, line feed, carriage return, " +"form feed, horizontal tab, vertical tab." +msgstr "" +"Перевіряє пробіли ASCII; пробіл, переведення рядка, повернення каретки, " +"передача форми, горизонтальна табуляція, вертикальна табуляція." + +msgid "Checks for an ASCII uppercase letter." +msgstr "Перевіряє наявність великої літери ASCII." + +msgid "" +"Checks for an ASCII hexadecimal digit. This is equivalent to ``c in string." +"hexdigits``." +msgstr "" +"Перевіряє шістнадцяткову цифру ASCII. Це еквівалентно ``c в string." +"hexdigits``." + +msgid "Checks for an ASCII control character (ordinal values 0 to 31)." +msgstr "Перевіряє контрольний символ ASCII (порядкові значення від 0 до 31)." + +msgid "Checks for a non-ASCII character (ordinal values 0x80 and above)." +msgstr "" +"Перевіряє символи, відмінні від ASCII (порядкові значення 0x80 і вище)." + +msgid "" +"These functions accept either integers or single-character strings; when the " +"argument is a string, it is first converted using the built-in function :" +"func:`ord`." +msgstr "" +"Ці функції приймають або цілі числа, або односимвольні рядки; коли аргумент " +"є рядком, він спочатку перетворюється за допомогою вбудованої функції :func:" +"`ord`." + +msgid "" +"Note that all these functions check ordinal bit values derived from the " +"character of the string you pass in; they do not actually know anything " +"about the host machine's character encoding." +msgstr "" +"Зауважте, що всі ці функції перевіряють порядкові значення бітів, отримані " +"від символу рядка, який ви передаєте; вони насправді нічого не знають про " +"кодування символів хост-машини." + +msgid "" +"The following two functions take either a single-character string or integer " +"byte value; they return a value of the same type." +msgstr "" +"Наступні дві функції приймають односимвольний рядок або ціле байтове " +"значення; вони повертають значення того самого типу." + +msgid "Return the ASCII value corresponding to the low 7 bits of *c*." +msgstr "Повертає значення ASCII, що відповідає молодшим 7 бітам *c*." + +msgid "" +"Return the control character corresponding to the given character (the " +"character bit value is bitwise-anded with 0x1f)." +msgstr "" +"Повертає керуючий символ, що відповідає заданому символу (значення біта " +"символу порозрядно додається до 0x1f)." + +msgid "" +"Return the 8-bit character corresponding to the given ASCII character (the " +"character bit value is bitwise-ored with 0x80)." +msgstr "" +"Повертає 8-бітовий символ, що відповідає даному символу ASCII (значення біта " +"символу порозрядно упорядковується з 0x80)." + +msgid "" +"The following function takes either a single-character string or integer " +"value; it returns a string." +msgstr "" +"Наступна функція приймає односимвольний рядок або ціле число; він повертає " +"рядок." + +msgid "" +"Return a string representation of the ASCII character *c*. If *c* is " +"printable, this string is the character itself. If the character is a " +"control character (0x00--0x1f) the string consists of a caret (``'^'``) " +"followed by the corresponding uppercase letter. If the character is an ASCII " +"delete (0x7f) the string is ``'^?'``. If the character has its meta bit " +"(0x80) set, the meta bit is stripped, the preceding rules applied, and " +"``'!'`` prepended to the result." +msgstr "" +"Повертає рядкове представлення символу ASCII *c*. Якщо *c* можна " +"надрукувати, цей рядок є самим символом. Якщо символ є керуючим " +"(0x00--0x1f), рядок складається з каретки (``'^'``), за якою йде відповідна " +"велика літера. Якщо символ видалення ASCII (0x7f), рядок має вигляд " +"``'^?''``. Якщо для символу встановлено мета-біт (0x80), мета-біт " +"видаляється, застосовуються попередні правила та перед результатом додається " +"``'!'``." + +msgid "" +"A 33-element string array that contains the ASCII mnemonics for the thirty-" +"two ASCII control characters from 0 (NUL) to 0x1f (US), in order, plus the " +"mnemonic ``SP`` for the space character." +msgstr "" +"33-елементний рядковий масив, який містить мнемоніку ASCII для тридцяти двох " +"керуючих символів ASCII від 0 (NUL) до 0x1f (США), по порядку, а також " +"мнемоніку SP для символу пробілу." + +msgid "^ (caret)" +msgstr "" + +msgid "in curses module" +msgstr "" + +msgid "! (exclamation)" +msgstr "! (знак оклику)" diff --git a/library/curses_panel.po b/library/curses_panel.po new file mode 100644 index 000000000..9f03def70 --- /dev/null +++ b/library/curses_panel.po @@ -0,0 +1,133 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 01:03+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!curses.panel` --- A panel stack extension for curses" +msgstr "" + +msgid "" +"Panels are windows with the added feature of depth, so they can be stacked " +"on top of each other, and only the visible portions of each window will be " +"displayed. Panels can be added, moved up or down in the stack, and removed." +msgstr "" +"Панелі — це вікна з додатковою функцією глибини, тому їх можна накладати " +"одна на одну, і відображатимуться лише видимі частини кожного вікна. Панелі " +"можна додавати, переміщувати вгору або вниз у стеку та видаляти." + +msgid "Functions" +msgstr "Функції" + +msgid "The module :mod:`curses.panel` defines the following functions:" +msgstr "Модуль :mod:`curses.panel` визначає такі функції:" + +msgid "Returns the bottom panel in the panel stack." +msgstr "Повертає нижню панель у стеку панелей." + +msgid "" +"Returns a panel object, associating it with the given window *win*. Be aware " +"that you need to keep the returned panel object referenced explicitly. If " +"you don't, the panel object is garbage collected and removed from the panel " +"stack." +msgstr "" +"Повертає об’єкт панелі, пов’язуючи його з даним вікном *win*. Майте на " +"увазі, що ви повинні зберегти явне посилання на повернутий об’єкт панелі. " +"Якщо ви цього не зробите, об’єкт панелі збирається як сміття та видаляється " +"зі стека панелей." + +msgid "Returns the top panel in the panel stack." +msgstr "Повертає верхню панель у стеку панелей." + +msgid "" +"Updates the virtual screen after changes in the panel stack. This does not " +"call :func:`curses.doupdate`, so you'll have to do this yourself." +msgstr "" +"Оновлює віртуальний екран після змін у стеку панелей. Це не викликає :func:" +"`curses.doupdate`, тому вам доведеться зробити це самостійно." + +msgid "Panel Objects" +msgstr "Об'єкти панелі" + +msgid "" +"Panel objects, as returned by :func:`new_panel` above, are windows with a " +"stacking order. There's always a window associated with a panel which " +"determines the content, while the panel methods are responsible for the " +"window's depth in the panel stack." +msgstr "" +"Об’єкти панелі, які повертає :func:`new_panel` вище, є вікнами з порядком " +"укладання. Завжди існує вікно, пов’язане з панеллю, яке визначає вміст, тоді " +"як методи панелі відповідають за глибину вікна в стеку панелей." + +msgid "Panel objects have the following methods:" +msgstr "Панельні об’єкти мають такі методи:" + +msgid "Returns the panel above the current panel." +msgstr "Повертає панель над поточною панеллю." + +msgid "Returns the panel below the current panel." +msgstr "Повертає панель під поточною панеллю." + +msgid "Push the panel to the bottom of the stack." +msgstr "Натисніть панель на дно стосу." + +msgid "" +"Returns ``True`` if the panel is hidden (not visible), ``False`` otherwise." +msgstr "Повертає ``True``, якщо панель прихована (невидима), ``False`` інакше." + +msgid "" +"Hide the panel. This does not delete the object, it just makes the window on " +"screen invisible." +msgstr "" +"Сховати панель. Це не видаляє об’єкт, а лише робить вікно на екрані " +"невидимим." + +msgid "Move the panel to the screen coordinates ``(y, x)``." +msgstr "Перемістіть панель до екранних координат ``(y, x)``." + +msgid "Change the window associated with the panel to the window *win*." +msgstr "Змініть вікно, пов’язане з панеллю, на вікно *win*." + +msgid "" +"Set the panel's user pointer to *obj*. This is used to associate an " +"arbitrary piece of data with the panel, and can be any Python object." +msgstr "" +"Встановіть покажчик користувача панелі на *obj*. Це використовується для " +"зв’язування довільної частини даних із панеллю та може бути будь-яким " +"об’єктом Python." + +msgid "Display the panel (which might have been hidden)." +msgstr "Відобразити панель (яка могла бути прихованою)." + +msgid "Push panel to the top of the stack." +msgstr "Посуньте панель до верхньої частини стека." + +msgid "" +"Returns the user pointer for the panel. This might be any Python object." +msgstr "" +"Повертає вказівник користувача для панелі. Це може бути будь-який об’єкт " +"Python." + +msgid "Returns the window object associated with the panel." +msgstr "Повертає об’єкт вікна, пов’язаний із панеллю." diff --git a/library/custominterp.po b/library/custominterp.po new file mode 100644 index 000000000..c4380f5d4 --- /dev/null +++ b/library/custominterp.po @@ -0,0 +1,40 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 01:03+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Custom Python Interpreters" +msgstr "Спеціальні інтерпретатори Python" + +msgid "" +"The modules described in this chapter allow writing interfaces similar to " +"Python's interactive interpreter. If you want a Python interpreter that " +"supports some special feature in addition to the Python language, you should " +"look at the :mod:`code` module. (The :mod:`codeop` module is lower-level, " +"used to support compiling a possibly incomplete chunk of Python code.)" +msgstr "" + +msgid "The full list of modules described in this chapter is:" +msgstr "Повний перелік модулів, описаних у цьому розділі:" diff --git a/library/dataclasses.po b/library/dataclasses.po new file mode 100644 index 000000000..52d442925 --- /dev/null +++ b/library/dataclasses.po @@ -0,0 +1,1096 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 01:03+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!dataclasses` --- Data Classes" +msgstr "" + +msgid "**Source code:** :source:`Lib/dataclasses.py`" +msgstr "**Вихідний код:** :source:`Lib/dataclasses.py`" + +msgid "" +"This module provides a decorator and functions for automatically adding " +"generated :term:`special methods ` such as :meth:`~object." +"__init__` and :meth:`~object.__repr__` to user-defined classes. It was " +"originally described in :pep:`557`." +msgstr "" + +msgid "" +"The member variables to use in these generated methods are defined using :" +"pep:`526` type annotations. For example, this code::" +msgstr "" +"Змінні-члени для використання в цих згенерованих методах визначаються за " +"допомогою анотацій типу :pep:`526`. Наприклад, цей код::" + +msgid "" +"from dataclasses import dataclass\n" +"\n" +"@dataclass\n" +"class InventoryItem:\n" +" \"\"\"Class for keeping track of an item in inventory.\"\"\"\n" +" name: str\n" +" unit_price: float\n" +" quantity_on_hand: int = 0\n" +"\n" +" def total_cost(self) -> float:\n" +" return self.unit_price * self.quantity_on_hand" +msgstr "" + +msgid "will add, among other things, a :meth:`!__init__` that looks like::" +msgstr "" + +msgid "" +"def __init__(self, name: str, unit_price: float, quantity_on_hand: int = " +"0):\n" +" self.name = name\n" +" self.unit_price = unit_price\n" +" self.quantity_on_hand = quantity_on_hand" +msgstr "" + +msgid "" +"Note that this method is automatically added to the class: it is not " +"directly specified in the :class:`!InventoryItem` definition shown above." +msgstr "" + +msgid "Module contents" +msgstr "Зміст модуля" + +msgid "" +"This function is a :term:`decorator` that is used to add generated :term:" +"`special methods ` to classes, as described below." +msgstr "" + +msgid "" +"The ``@dataclass`` decorator examines the class to find ``field``\\s. A " +"``field`` is defined as a class variable that has a :term:`type annotation " +"`. With two exceptions described below, nothing in " +"``@dataclass`` examines the type specified in the variable annotation." +msgstr "" + +msgid "" +"The order of the fields in all of the generated methods is the order in " +"which they appear in the class definition." +msgstr "" +"Порядок полів у всіх згенерованих методах – це порядок, у якому вони " +"з’являються у визначенні класу." + +msgid "" +"The ``@dataclass`` decorator will add various \"dunder\" methods to the " +"class, described below. If any of the added methods already exist in the " +"class, the behavior depends on the parameter, as documented below. The " +"decorator returns the same class that it is called on; no new class is " +"created." +msgstr "" + +msgid "" +"If ``@dataclass`` is used just as a simple decorator with no parameters, it " +"acts as if it has the default values documented in this signature. That is, " +"these three uses of ``@dataclass`` are equivalent::" +msgstr "" + +msgid "" +"@dataclass\n" +"class C:\n" +" ...\n" +"\n" +"@dataclass()\n" +"class C:\n" +" ...\n" +"\n" +"@dataclass(init=True, repr=True, eq=True, order=False, unsafe_hash=False, " +"frozen=False,\n" +" match_args=True, kw_only=False, slots=False, weakref_slot=False)\n" +"class C:\n" +" ..." +msgstr "" + +msgid "The parameters to ``@dataclass`` are:" +msgstr "" + +msgid "" +"*init*: If true (the default), a :meth:`~object.__init__` method will be " +"generated." +msgstr "" + +msgid "" +"If the class already defines :meth:`!__init__`, this parameter is ignored." +msgstr "" + +msgid "" +"*repr*: If true (the default), a :meth:`~object.__repr__` method will be " +"generated. The generated repr string will have the class name and the name " +"and repr of each field, in the order they are defined in the class. Fields " +"that are marked as being excluded from the repr are not included. For " +"example: ``InventoryItem(name='widget', unit_price=3.0, " +"quantity_on_hand=10)``." +msgstr "" + +msgid "" +"If the class already defines :meth:`!__repr__`, this parameter is ignored." +msgstr "" + +msgid "" +"*eq*: If true (the default), an :meth:`~object.__eq__` method will be " +"generated. This method compares the class as if it were a tuple of its " +"fields, in order. Both instances in the comparison must be of the identical " +"type." +msgstr "" + +msgid "" +"If the class already defines :meth:`!__eq__`, this parameter is ignored." +msgstr "" + +msgid "" +"*order*: If true (the default is ``False``), :meth:`~object.__lt__`, :meth:" +"`~object.__le__`, :meth:`~object.__gt__`, and :meth:`~object.__ge__` methods " +"will be generated. These compare the class as if it were a tuple of its " +"fields, in order. Both instances in the comparison must be of the identical " +"type. If *order* is true and *eq* is false, a :exc:`ValueError` is raised." +msgstr "" + +msgid "" +"If the class already defines any of :meth:`!__lt__`, :meth:`!__le__`, :meth:" +"`!__gt__`, or :meth:`!__ge__`, then :exc:`TypeError` is raised." +msgstr "" + +msgid "" +"*unsafe_hash*: If ``False`` (the default), a :meth:`~object.__hash__` method " +"is generated according to how *eq* and *frozen* are set." +msgstr "" + +msgid "" +":meth:`!__hash__` is used by built-in :meth:`hash`, and when objects are " +"added to hashed collections such as dictionaries and sets. Having a :meth:`!" +"__hash__` implies that instances of the class are immutable. Mutability is a " +"complicated property that depends on the programmer's intent, the existence " +"and behavior of :meth:`!__eq__`, and the values of the *eq* and *frozen* " +"flags in the ``@dataclass`` decorator." +msgstr "" + +msgid "" +"By default, ``@dataclass`` will not implicitly add a :meth:`~object." +"__hash__` method unless it is safe to do so. Neither will it add or change " +"an existing explicitly defined :meth:`!__hash__` method. Setting the class " +"attribute ``__hash__ = None`` has a specific meaning to Python, as described " +"in the :meth:`!__hash__` documentation." +msgstr "" + +msgid "" +"If :meth:`!__hash__` is not explicitly defined, or if it is set to ``None``, " +"then ``@dataclass`` *may* add an implicit :meth:`!__hash__` method. Although " +"not recommended, you can force ``@dataclass`` to create a :meth:`!__hash__` " +"method with ``unsafe_hash=True``. This might be the case if your class is " +"logically immutable but can still be mutated. This is a specialized use case " +"and should be considered carefully." +msgstr "" + +msgid "" +"Here are the rules governing implicit creation of a :meth:`!__hash__` " +"method. Note that you cannot both have an explicit :meth:`!__hash__` method " +"in your dataclass and set ``unsafe_hash=True``; this will result in a :exc:" +"`TypeError`." +msgstr "" + +msgid "" +"If *eq* and *frozen* are both true, by default ``@dataclass`` will generate " +"a :meth:`!__hash__` method for you. If *eq* is true and *frozen* is false, :" +"meth:`!__hash__` will be set to ``None``, marking it unhashable (which it " +"is, since it is mutable). If *eq* is false, :meth:`!__hash__` will be left " +"untouched meaning the :meth:`!__hash__` method of the superclass will be " +"used (if the superclass is :class:`object`, this means it will fall back to " +"id-based hashing)." +msgstr "" + +msgid "" +"*frozen*: If true (the default is ``False``), assigning to fields will " +"generate an exception. This emulates read-only frozen instances. If :meth:" +"`~object.__setattr__` or :meth:`~object.__delattr__` is defined in the " +"class, then :exc:`TypeError` is raised. See the discussion below." +msgstr "" + +msgid "" +"*match_args*: If true (the default is ``True``), the :attr:`~object." +"__match_args__` tuple will be created from the list of non keyword-only " +"parameters to the generated :meth:`~object.__init__` method (even if :meth:`!" +"__init__` is not generated, see above). If false, or if :attr:`!" +"__match_args__` is already defined in the class, then :attr:`!" +"__match_args__` will not be generated." +msgstr "" + +msgid "" +"*kw_only*: If true (the default value is ``False``), then all fields will be " +"marked as keyword-only. If a field is marked as keyword-only, then the only " +"effect is that the :meth:`~object.__init__` parameter generated from a " +"keyword-only field must be specified with a keyword when :meth:`!__init__` " +"is called. See the :term:`parameter` glossary entry for details. Also see " +"the :const:`KW_ONLY` section." +msgstr "" + +msgid "Keyword-only fields are not included in :attr:`!__match_args__`." +msgstr "" + +msgid "" +"*slots*: If true (the default is ``False``), :attr:`~object.__slots__` " +"attribute will be generated and new class will be returned instead of the " +"original one. If :attr:`!__slots__` is already defined in the class, then :" +"exc:`TypeError` is raised." +msgstr "" + +msgid "" +"Calling no-arg :func:`super` in dataclasses using ``slots=True`` will result " +"in the following exception being raised: ``TypeError: super(type, obj): obj " +"must be an instance or subtype of type``. The two-arg :func:`super` is a " +"valid workaround. See :gh:`90562` for full details." +msgstr "" + +msgid "" +"Passing parameters to a base class :meth:`~object.__init_subclass__` when " +"using ``slots=True`` will result in a :exc:`TypeError`. Either use " +"``__init_subclass__`` with no parameters or use default values as a " +"workaround. See :gh:`91126` for full details." +msgstr "" + +msgid "" +"If a field name is already included in the :attr:`!__slots__` of a base " +"class, it will not be included in the generated :attr:`!__slots__` to " +"prevent :ref:`overriding them `. Therefore, do not " +"use :attr:`!__slots__` to retrieve the field names of a dataclass. Use :func:" +"`fields` instead. To be able to determine inherited slots, base class :attr:" +"`!__slots__` may be any iterable, but *not* an iterator." +msgstr "" + +msgid "" +"*weakref_slot*: If true (the default is ``False``), add a slot named " +"\"__weakref__\", which is required to make an instance :func:`weakref-able " +"`. It is an error to specify ``weakref_slot=True`` without also " +"specifying ``slots=True``." +msgstr "" + +msgid "" +"``field``\\s may optionally specify a default value, using normal Python " +"syntax::" +msgstr "" +"``field``\\s може додатково вказати значення за замовчуванням, " +"використовуючи звичайний синтаксис Python:" + +msgid "" +"@dataclass\n" +"class C:\n" +" a: int # 'a' has no default value\n" +" b: int = 0 # assign a default value for 'b'" +msgstr "" + +msgid "" +"In this example, both :attr:`!a` and :attr:`!b` will be included in the " +"added :meth:`~object.__init__` method, which will be defined as::" +msgstr "" + +msgid "def __init__(self, a: int, b: int = 0):" +msgstr "" + +msgid "" +":exc:`TypeError` will be raised if a field without a default value follows a " +"field with a default value. This is true whether this occurs in a single " +"class, or as a result of class inheritance." +msgstr "" +":exc:`TypeError` буде викликано, якщо поле без значення за замовчуванням " +"слідує за полем зі значенням за замовчуванням. Це вірно незалежно від того, " +"чи відбувається це в одному класі, чи в результаті успадкування класу." + +msgid "" +"For common and simple use cases, no other functionality is required. There " +"are, however, some dataclass features that require additional per-field " +"information. To satisfy this need for additional information, you can " +"replace the default field value with a call to the provided :func:`!field` " +"function. For example::" +msgstr "" + +msgid "" +"@dataclass\n" +"class C:\n" +" mylist: list[int] = field(default_factory=list)\n" +"\n" +"c = C()\n" +"c.mylist += [1, 2, 3]" +msgstr "" + +msgid "" +"As shown above, the :const:`MISSING` value is a sentinel object used to " +"detect if some parameters are provided by the user. This sentinel is used " +"because ``None`` is a valid value for some parameters with a distinct " +"meaning. No code should directly use the :const:`MISSING` value." +msgstr "" +"Як показано вище, значення :const:`MISSING` є дозорним об’єктом, який " +"використовується для визначення того, чи деякі параметри надає користувач. " +"Цей контрольний сигнал використовується, оскільки ``None`` є дійсним " +"значенням для деяких параметрів з чітким значенням. Жоден код не повинен " +"безпосередньо використовувати значення :const:`MISSING`." + +msgid "The parameters to :func:`!field` are:" +msgstr "" + +msgid "" +"*default*: If provided, this will be the default value for this field. This " +"is needed because the :func:`!field` call itself replaces the normal " +"position of the default value." +msgstr "" + +msgid "" +"*default_factory*: If provided, it must be a zero-argument callable that " +"will be called when a default value is needed for this field. Among other " +"purposes, this can be used to specify fields with mutable default values, as " +"discussed below. It is an error to specify both *default* and " +"*default_factory*." +msgstr "" + +msgid "" +"*init*: If true (the default), this field is included as a parameter to the " +"generated :meth:`~object.__init__` method." +msgstr "" + +msgid "" +"*repr*: If true (the default), this field is included in the string returned " +"by the generated :meth:`~object.__repr__` method." +msgstr "" + +msgid "" +"*hash*: This can be a bool or ``None``. If true, this field is included in " +"the generated :meth:`~object.__hash__` method. If false, this field is " +"excluded from the generated :meth:`~object.__hash__`. If ``None`` (the " +"default), use the value of *compare*: this would normally be the expected " +"behavior, since a field should be included in the hash if it's used for " +"comparisons. Setting this value to anything other than ``None`` is " +"discouraged." +msgstr "" + +msgid "" +"One possible reason to set ``hash=False`` but ``compare=True`` would be if a " +"field is expensive to compute a hash value for, that field is needed for " +"equality testing, and there are other fields that contribute to the type's " +"hash value. Even if a field is excluded from the hash, it will still be " +"used for comparisons." +msgstr "" +"Однією з можливих причин встановити ``hash=False``, але ``compare=True`` " +"було б, якщо поле є дорогим для обчислення хеш-значення, це поле потрібне " +"для перевірки рівності, і є інші поля, які сприяють хеш-значення типу. " +"Навіть якщо поле виключено з хешу, воно все одно використовуватиметься для " +"порівнянь." + +msgid "" +"*compare*: If true (the default), this field is included in the generated " +"equality and comparison methods (:meth:`~object.__eq__`, :meth:`~object." +"__gt__`, et al.)." +msgstr "" + +msgid "" +"*metadata*: This can be a mapping or ``None``. ``None`` is treated as an " +"empty dict. This value is wrapped in :func:`~types.MappingProxyType` to " +"make it read-only, and exposed on the :class:`Field` object. It is not used " +"at all by Data Classes, and is provided as a third-party extension " +"mechanism. Multiple third-parties can each have their own key, to use as a " +"namespace in the metadata." +msgstr "" + +msgid "" +"*kw_only*: If true, this field will be marked as keyword-only. This is used " +"when the generated :meth:`~object.__init__` method's parameters are computed." +msgstr "" + +msgid "Keyword-only fields are also not included in :attr:`!__match_args__`." +msgstr "" + +msgid "" +"If the default value of a field is specified by a call to :func:`!field`, " +"then the class attribute for this field will be replaced by the specified " +"*default* value. If *default* is not provided, then the class attribute " +"will be deleted. The intent is that after the :func:`@dataclass " +"` decorator runs, the class attributes will all contain the " +"default values for the fields, just as if the default value itself were " +"specified. For example, after::" +msgstr "" + +msgid "" +"@dataclass\n" +"class C:\n" +" x: int\n" +" y: int = field(repr=False)\n" +" z: int = field(repr=False, default=10)\n" +" t: int = 20" +msgstr "" + +msgid "" +"The class attribute :attr:`!C.z` will be ``10``, the class attribute :attr:`!" +"C.t` will be ``20``, and the class attributes :attr:`!C.x` and :attr:`!C.y` " +"will not be set." +msgstr "" + +msgid "" +":class:`!Field` objects describe each defined field. These objects are " +"created internally, and are returned by the :func:`fields` module-level " +"method (see below). Users should never instantiate a :class:`!Field` object " +"directly. Its documented attributes are:" +msgstr "" + +msgid ":attr:`!name`: The name of the field." +msgstr "" + +msgid ":attr:`!type`: The type of the field." +msgstr "" + +msgid "" +":attr:`!default`, :attr:`!default_factory`, :attr:`!init`, :attr:`!repr`, :" +"attr:`!hash`, :attr:`!compare`, :attr:`!metadata`, and :attr:`!kw_only` have " +"the identical meaning and values as they do in the :func:`field` function." +msgstr "" + +msgid "" +"Other attributes may exist, but they are private and must not be inspected " +"or relied on." +msgstr "" +"Інші атрибути можуть існувати, але вони є приватними, і їх не можна " +"перевіряти чи покладатися на них." + +msgid "" +"``InitVar[T]`` type annotations describe variables that are :ref:`init-only " +"`. Fields annotated with :class:`!InitVar` " +"are considered pseudo-fields, and thus are neither returned by the :func:" +"`fields` function nor used in any way except adding them as parameters to :" +"meth:`~object.__init__` and an optional :meth:`__post_init__`." +msgstr "" + +msgid "" +"Returns a tuple of :class:`Field` objects that define the fields for this " +"dataclass. Accepts either a dataclass, or an instance of a dataclass. " +"Raises :exc:`TypeError` if not passed a dataclass or instance of one. Does " +"not return pseudo-fields which are ``ClassVar`` or ``InitVar``." +msgstr "" +"Повертає кортеж об’єктів :class:`Field`, які визначають поля для цього класу " +"даних. Приймає або клас даних, або екземпляр класу даних. Викликає :exc:" +"`TypeError`, якщо не передано клас даних або його екземпляр. Не повертає " +"псевдополя, які є ``ClassVar`` або ``InitVar``." + +msgid "" +"Converts the dataclass *obj* to a dict (by using the factory function " +"*dict_factory*). Each dataclass is converted to a dict of its fields, as " +"``name: value`` pairs. dataclasses, dicts, lists, and tuples are recursed " +"into. Other objects are copied with :func:`copy.deepcopy`." +msgstr "" + +msgid "Example of using :func:`!asdict` on nested dataclasses::" +msgstr "" + +msgid "" +"@dataclass\n" +"class Point:\n" +" x: int\n" +" y: int\n" +"\n" +"@dataclass\n" +"class C:\n" +" mylist: list[Point]\n" +"\n" +"p = Point(10, 20)\n" +"assert asdict(p) == {'x': 10, 'y': 20}\n" +"\n" +"c = C([Point(0, 0), Point(10, 4)])\n" +"assert asdict(c) == {'mylist': [{'x': 0, 'y': 0}, {'x': 10, 'y': 4}]}" +msgstr "" + +msgid "To create a shallow copy, the following workaround may be used::" +msgstr "Щоб створити дрібну копію, можна використати такий обхідний шлях:" + +msgid "{field.name: getattr(obj, field.name) for field in fields(obj)}" +msgstr "" + +msgid "" +":func:`!asdict` raises :exc:`TypeError` if *obj* is not a dataclass instance." +msgstr "" + +msgid "" +"Converts the dataclass *obj* to a tuple (by using the factory function " +"*tuple_factory*). Each dataclass is converted to a tuple of its field " +"values. dataclasses, dicts, lists, and tuples are recursed into. Other " +"objects are copied with :func:`copy.deepcopy`." +msgstr "" + +msgid "Continuing from the previous example::" +msgstr "Продовжуючи попередній приклад:" + +msgid "" +"assert astuple(p) == (10, 20)\n" +"assert astuple(c) == ([(0, 0), (10, 4)],)" +msgstr "" + +msgid "tuple(getattr(obj, field.name) for field in dataclasses.fields(obj))" +msgstr "" + +msgid "" +":func:`!astuple` raises :exc:`TypeError` if *obj* is not a dataclass " +"instance." +msgstr "" + +msgid "" +"Creates a new dataclass with name *cls_name*, fields as defined in *fields*, " +"base classes as given in *bases*, and initialized with a namespace as given " +"in *namespace*. *fields* is an iterable whose elements are each either " +"``name``, ``(name, type)``, or ``(name, type, Field)``. If just ``name`` is " +"supplied, :data:`typing.Any` is used for ``type``. The values of *init*, " +"*repr*, *eq*, *order*, *unsafe_hash*, *frozen*, *match_args*, *kw_only*, " +"*slots*, and *weakref_slot* have the same meaning as they do in :func:" +"`@dataclass `." +msgstr "" + +msgid "" +"If *module* is defined, the :attr:`!__module__` attribute of the dataclass " +"is set to that value. By default, it is set to the module name of the caller." +msgstr "" + +msgid "" +"This function is not strictly required, because any Python mechanism for " +"creating a new class with :attr:`!__annotations__` can then apply the :func:" +"`@dataclass ` function to convert that class to a dataclass. " +"This function is provided as a convenience. For example::" +msgstr "" + +msgid "" +"C = make_dataclass('C',\n" +" [('x', int),\n" +" 'y',\n" +" ('z', int, field(default=5))],\n" +" namespace={'add_one': lambda self: self.x + 1})" +msgstr "" + +msgid "Is equivalent to::" +msgstr "Еквівалентно::" + +msgid "" +"@dataclass\n" +"class C:\n" +" x: int\n" +" y: 'typing.Any'\n" +" z: int = 5\n" +"\n" +" def add_one(self):\n" +" return self.x + 1" +msgstr "" + +msgid "" +"Creates a new object of the same type as *obj*, replacing fields with values " +"from *changes*. If *obj* is not a Data Class, raises :exc:`TypeError`. If " +"keys in *changes* are not field names of the given dataclass, raises :exc:" +"`TypeError`." +msgstr "" + +msgid "" +"The newly returned object is created by calling the :meth:`~object.__init__` " +"method of the dataclass. This ensures that :meth:`__post_init__`, if " +"present, is also called." +msgstr "" + +msgid "" +"Init-only variables without default values, if any exist, must be specified " +"on the call to :func:`!replace` so that they can be passed to :meth:`!" +"__init__` and :meth:`__post_init__`." +msgstr "" + +msgid "" +"It is an error for *changes* to contain any fields that are defined as " +"having ``init=False``. A :exc:`ValueError` will be raised in this case." +msgstr "" + +msgid "" +"Be forewarned about how ``init=False`` fields work during a call to :func:`!" +"replace`. They are not copied from the source object, but rather are " +"initialized in :meth:`__post_init__`, if they're initialized at all. It is " +"expected that ``init=False`` fields will be rarely and judiciously used. If " +"they are used, it might be wise to have alternate class constructors, or " +"perhaps a custom :func:`!replace` (or similarly named) method which handles " +"instance copying." +msgstr "" + +msgid "" +"Dataclass instances are also supported by generic function :func:`copy." +"replace`." +msgstr "" + +msgid "" +"Return ``True`` if its parameter is a dataclass (including subclasses of a " +"dataclass) or an instance of one, otherwise return ``False``." +msgstr "" + +msgid "" +"If you need to know if a class is an instance of a dataclass (and not a " +"dataclass itself), then add a further check for ``not isinstance(obj, " +"type)``::" +msgstr "" +"Якщо вам потрібно знати, чи є клас екземпляром класу даних (а не самим " +"класом даних), тоді додайте додаткову перевірку для ``not isinstance(obj, " +"type)``::" + +msgid "" +"def is_dataclass_instance(obj):\n" +" return is_dataclass(obj) and not isinstance(obj, type)" +msgstr "" + +msgid "A sentinel value signifying a missing default or default_factory." +msgstr "" +"Дозорне значення, яке вказує на відсутність параметра default або " +"default_factory." + +msgid "" +"A sentinel value used as a type annotation. Any fields after a pseudo-field " +"with the type of :const:`!KW_ONLY` are marked as keyword-only fields. Note " +"that a pseudo-field of type :const:`!KW_ONLY` is otherwise completely " +"ignored. This includes the name of such a field. By convention, a name of " +"``_`` is used for a :const:`!KW_ONLY` field. Keyword-only fields signify :" +"meth:`~object.__init__` parameters that must be specified as keywords when " +"the class is instantiated." +msgstr "" + +msgid "" +"In this example, the fields ``y`` and ``z`` will be marked as keyword-only " +"fields::" +msgstr "" +"У цьому прикладі поля ``y`` і ``z`` будуть позначені як поля лише для " +"ключових слів:" + +msgid "" +"@dataclass\n" +"class Point:\n" +" x: float\n" +" _: KW_ONLY\n" +" y: float\n" +" z: float\n" +"\n" +"p = Point(0, y=1.5, z=2.0)" +msgstr "" + +msgid "" +"In a single dataclass, it is an error to specify more than one field whose " +"type is :const:`!KW_ONLY`." +msgstr "" + +msgid "" +"Raised when an implicitly defined :meth:`~object.__setattr__` or :meth:" +"`~object.__delattr__` is called on a dataclass which was defined with " +"``frozen=True``. It is a subclass of :exc:`AttributeError`." +msgstr "" + +msgid "Post-init processing" +msgstr "Обробка після ініціалізації" + +msgid "" +"When defined on the class, it will be called by the generated :meth:`~object." +"__init__`, normally as :meth:`!self.__post_init__`. However, if any " +"``InitVar`` fields are defined, they will also be passed to :meth:`!" +"__post_init__` in the order they were defined in the class. If no :meth:`!" +"__init__` method is generated, then :meth:`!__post_init__` will not " +"automatically be called." +msgstr "" + +msgid "" +"Among other uses, this allows for initializing field values that depend on " +"one or more other fields. For example::" +msgstr "" +"Серед іншого використання це дозволяє ініціалізувати значення полів, які " +"залежать від одного або кількох інших полів. Наприклад::" + +msgid "" +"@dataclass\n" +"class C:\n" +" a: float\n" +" b: float\n" +" c: float = field(init=False)\n" +"\n" +" def __post_init__(self):\n" +" self.c = self.a + self.b" +msgstr "" + +msgid "" +"The :meth:`~object.__init__` method generated by :func:`@dataclass " +"` does not call base class :meth:`!__init__` methods. If the base " +"class has an :meth:`!__init__` method that has to be called, it is common to " +"call this method in a :meth:`__post_init__` method::" +msgstr "" + +msgid "" +"class Rectangle:\n" +" def __init__(self, height, width):\n" +" self.height = height\n" +" self.width = width\n" +"\n" +"@dataclass\n" +"class Square(Rectangle):\n" +" side: float\n" +"\n" +" def __post_init__(self):\n" +" super().__init__(self.side, self.side)" +msgstr "" + +msgid "" +"Note, however, that in general the dataclass-generated :meth:`!__init__` " +"methods don't need to be called, since the derived dataclass will take care " +"of initializing all fields of any base class that is a dataclass itself." +msgstr "" + +msgid "" +"See the section below on init-only variables for ways to pass parameters to :" +"meth:`!__post_init__`. Also see the warning about how :func:`replace` " +"handles ``init=False`` fields." +msgstr "" + +msgid "Class variables" +msgstr "Змінні класу" + +msgid "" +"One of the few places where :func:`@dataclass ` actually inspects " +"the type of a field is to determine if a field is a class variable as " +"defined in :pep:`526`. It does this by checking if the type of the field " +"is :data:`typing.ClassVar`. If a field is a ``ClassVar``, it is excluded " +"from consideration as a field and is ignored by the dataclass mechanisms. " +"Such ``ClassVar`` pseudo-fields are not returned by the module-level :func:" +"`fields` function." +msgstr "" + +msgid "Init-only variables" +msgstr "Змінні лише для ініціалізації" + +msgid "" +"Another place where :func:`@dataclass ` inspects a type " +"annotation is to determine if a field is an init-only variable. It does " +"this by seeing if the type of a field is of type :class:`InitVar`. If a " +"field is an :class:`InitVar`, it is considered a pseudo-field called an init-" +"only field. As it is not a true field, it is not returned by the module-" +"level :func:`fields` function. Init-only fields are added as parameters to " +"the generated :meth:`~object.__init__` method, and are passed to the " +"optional :meth:`__post_init__` method. They are not otherwise used by " +"dataclasses." +msgstr "" + +msgid "" +"For example, suppose a field will be initialized from a database, if a value " +"is not provided when creating the class::" +msgstr "" +"Наприклад, припустимо, що поле буде ініціалізовано з бази даних, якщо під " +"час створення класу не вказано значення::" + +msgid "" +"@dataclass\n" +"class C:\n" +" i: int\n" +" j: int | None = None\n" +" database: InitVar[DatabaseType | None] = None\n" +"\n" +" def __post_init__(self, database):\n" +" if self.j is None and database is not None:\n" +" self.j = database.lookup('j')\n" +"\n" +"c = C(10, database=my_database)" +msgstr "" + +msgid "" +"In this case, :func:`fields` will return :class:`Field` objects for :attr:`!" +"i` and :attr:`!j`, but not for :attr:`!database`." +msgstr "" + +msgid "Frozen instances" +msgstr "Заморожені екземпляри" + +msgid "" +"It is not possible to create truly immutable Python objects. However, by " +"passing ``frozen=True`` to the :func:`@dataclass ` decorator you " +"can emulate immutability. In that case, dataclasses will add :meth:`~object." +"__setattr__` and :meth:`~object.__delattr__` methods to the class. These " +"methods will raise a :exc:`FrozenInstanceError` when invoked." +msgstr "" + +msgid "" +"There is a tiny performance penalty when using ``frozen=True``: :meth:" +"`~object.__init__` cannot use simple assignment to initialize fields, and " +"must use :meth:`!object.__setattr__`." +msgstr "" + +msgid "Inheritance" +msgstr "Спадщина" + +msgid "" +"When the dataclass is being created by the :func:`@dataclass ` " +"decorator, it looks through all of the class's base classes in reverse MRO " +"(that is, starting at :class:`object`) and, for each dataclass that it " +"finds, adds the fields from that base class to an ordered mapping of fields. " +"After all of the base class fields are added, it adds its own fields to the " +"ordered mapping. All of the generated methods will use this combined, " +"calculated ordered mapping of fields. Because the fields are in insertion " +"order, derived classes override base classes. An example::" +msgstr "" + +msgid "" +"@dataclass\n" +"class Base:\n" +" x: Any = 15.0\n" +" y: int = 0\n" +"\n" +"@dataclass\n" +"class C(Base):\n" +" z: int = 10\n" +" x: int = 15" +msgstr "" + +msgid "" +"The final list of fields is, in order, :attr:`!x`, :attr:`!y`, :attr:`!z`. " +"The final type of :attr:`!x` is :class:`int`, as specified in class :class:`!" +"C`." +msgstr "" + +msgid "" +"The generated :meth:`~object.__init__` method for :class:`!C` will look " +"like::" +msgstr "" + +msgid "def __init__(self, x: int = 15, y: int = 0, z: int = 10):" +msgstr "" + +msgid "Re-ordering of keyword-only parameters in :meth:`!__init__`" +msgstr "" + +msgid "" +"After the parameters needed for :meth:`~object.__init__` are computed, any " +"keyword-only parameters are moved to come after all regular (non-keyword-" +"only) parameters. This is a requirement of how keyword-only parameters are " +"implemented in Python: they must come after non-keyword-only parameters." +msgstr "" + +msgid "" +"In this example, :attr:`!Base.y`, :attr:`!Base.w`, and :attr:`!D.t` are " +"keyword-only fields, and :attr:`!Base.x` and :attr:`!D.z` are regular " +"fields::" +msgstr "" + +msgid "" +"@dataclass\n" +"class Base:\n" +" x: Any = 15.0\n" +" _: KW_ONLY\n" +" y: int = 0\n" +" w: int = 1\n" +"\n" +"@dataclass\n" +"class D(Base):\n" +" z: int = 10\n" +" t: int = field(kw_only=True, default=0)" +msgstr "" + +msgid "The generated :meth:`!__init__` method for :class:`!D` will look like::" +msgstr "" + +msgid "" +"def __init__(self, x: Any = 15.0, z: int = 10, *, y: int = 0, w: int = 1, t: " +"int = 0):" +msgstr "" + +msgid "" +"Note that the parameters have been re-ordered from how they appear in the " +"list of fields: parameters derived from regular fields are followed by " +"parameters derived from keyword-only fields." +msgstr "" +"Зауважте, що порядок параметрів змінено відповідно до того, як вони " +"відображаються в списку полів: за параметрами, отриманими зі звичайних " +"полів, слідують параметри, отримані з полів лише з ключовими словами." + +msgid "" +"The relative ordering of keyword-only parameters is maintained in the re-" +"ordered :meth:`!__init__` parameter list." +msgstr "" + +msgid "Default factory functions" +msgstr "Стандартні заводські функції" + +msgid "" +"If a :func:`field` specifies a *default_factory*, it is called with zero " +"arguments when a default value for the field is needed. For example, to " +"create a new instance of a list, use::" +msgstr "" + +msgid "mylist: list = field(default_factory=list)" +msgstr "" + +msgid "" +"If a field is excluded from :meth:`~object.__init__` (using ``init=False``) " +"and the field also specifies *default_factory*, then the default factory " +"function will always be called from the generated :meth:`!__init__` " +"function. This happens because there is no other way to give the field an " +"initial value." +msgstr "" + +msgid "Mutable default values" +msgstr "Змінні значення за замовчуванням" + +msgid "" +"Python stores default member variable values in class attributes. Consider " +"this example, not using dataclasses::" +msgstr "" +"Python зберігає значення змінних членів за замовчуванням в атрибутах класу. " +"Розглянемо цей приклад, не використовуючи класи даних::" + +msgid "" +"class C:\n" +" x = []\n" +" def add(self, element):\n" +" self.x.append(element)\n" +"\n" +"o1 = C()\n" +"o2 = C()\n" +"o1.add(1)\n" +"o2.add(2)\n" +"assert o1.x == [1, 2]\n" +"assert o1.x is o2.x" +msgstr "" + +msgid "" +"Note that the two instances of class :class:`!C` share the same class " +"variable :attr:`!x`, as expected." +msgstr "" + +msgid "Using dataclasses, *if* this code was valid::" +msgstr "Використання класів даних, *якщо* цей код дійсний::" + +msgid "" +"@dataclass\n" +"class D:\n" +" x: list = [] # This code raises ValueError\n" +" def add(self, element):\n" +" self.x.append(element)" +msgstr "" + +msgid "it would generate code similar to::" +msgstr "це створить код, подібний до::" + +msgid "" +"class D:\n" +" x = []\n" +" def __init__(self, x=x):\n" +" self.x = x\n" +" def add(self, element):\n" +" self.x.append(element)\n" +"\n" +"assert D().x is D().x" +msgstr "" + +msgid "" +"This has the same issue as the original example using class :class:`!C`. " +"That is, two instances of class :class:`!D` that do not specify a value for :" +"attr:`!x` when creating a class instance will share the same copy of :attr:`!" +"x`. Because dataclasses just use normal Python class creation they also " +"share this behavior. There is no general way for Data Classes to detect " +"this condition. Instead, the :func:`@dataclass ` decorator will " +"raise a :exc:`ValueError` if it detects an unhashable default parameter. " +"The assumption is that if a value is unhashable, it is mutable. This is a " +"partial solution, but it does protect against many common errors." +msgstr "" + +msgid "" +"Using default factory functions is a way to create new instances of mutable " +"types as default values for fields::" +msgstr "" +"Використання заводських функцій за замовчуванням — це спосіб створення нових " +"екземплярів змінних типів як значень за замовчуванням для полів::" + +msgid "" +"@dataclass\n" +"class D:\n" +" x: list = field(default_factory=list)\n" +"\n" +"assert D().x is not D().x" +msgstr "" + +msgid "" +"Instead of looking for and disallowing objects of type :class:`list`, :class:" +"`dict`, or :class:`set`, unhashable objects are now not allowed as default " +"values. Unhashability is used to approximate mutability." +msgstr "" + +msgid "Descriptor-typed fields" +msgstr "" + +msgid "" +"Fields that are assigned :ref:`descriptor objects ` as their " +"default value have the following special behaviors:" +msgstr "" + +msgid "" +"The value for the field passed to the dataclass's :meth:`~object.__init__` " +"method is passed to the descriptor's :meth:`~object.__set__` method rather " +"than overwriting the descriptor object." +msgstr "" + +msgid "" +"Similarly, when getting or setting the field, the descriptor's :meth:" +"`~object.__get__` or :meth:`!__set__` method is called rather than returning " +"or overwriting the descriptor object." +msgstr "" + +msgid "" +"To determine whether a field contains a default value, :func:`@dataclass " +"` will call the descriptor's :meth:`!__get__` method using its " +"class access form: ``descriptor.__get__(obj=None, type=cls)``. If the " +"descriptor returns a value in this case, it will be used as the field's " +"default. On the other hand, if the descriptor raises :exc:`AttributeError` " +"in this situation, no default value will be provided for the field." +msgstr "" + +msgid "" +"class IntConversionDescriptor:\n" +" def __init__(self, *, default):\n" +" self._default = default\n" +"\n" +" def __set_name__(self, owner, name):\n" +" self._name = \"_\" + name\n" +"\n" +" def __get__(self, obj, type):\n" +" if obj is None:\n" +" return self._default\n" +"\n" +" return getattr(obj, self._name, self._default)\n" +"\n" +" def __set__(self, obj, value):\n" +" setattr(obj, self._name, int(value))\n" +"\n" +"@dataclass\n" +"class InventoryItem:\n" +" quantity_on_hand: IntConversionDescriptor = " +"IntConversionDescriptor(default=100)\n" +"\n" +"i = InventoryItem()\n" +"print(i.quantity_on_hand) # 100\n" +"i.quantity_on_hand = 2.5 # calls __set__ with 2.5\n" +"print(i.quantity_on_hand) # 2" +msgstr "" + +msgid "" +"Note that if a field is annotated with a descriptor type, but is not " +"assigned a descriptor object as its default value, the field will act like a " +"normal field." +msgstr "" diff --git a/library/datatypes.po b/library/datatypes.po new file mode 100644 index 000000000..0de05c10e --- /dev/null +++ b/library/datatypes.po @@ -0,0 +1,52 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 01:04+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Data Types" +msgstr "Типи даних" + +msgid "" +"The modules described in this chapter provide a variety of specialized data " +"types such as dates and times, fixed-type arrays, heap queues, double-ended " +"queues, and enumerations." +msgstr "" +"Модулі, описані в цьому розділі, надають різні спеціалізовані типи даних, " +"такі як дати та час, масиви фіксованого типу, черги купи, двосторонні черги " +"та перерахування." + +msgid "" +"Python also provides some built-in data types, in particular, :class:" +"`dict`, :class:`list`, :class:`set` and :class:`frozenset`, and :class:" +"`tuple`. The :class:`str` class is used to hold Unicode strings, and the :" +"class:`bytes` and :class:`bytearray` classes are used to hold binary data." +msgstr "" +"Python також надає деякі вбудовані типи даних, зокрема :class:`dict`, :class:" +"`list`, :class:`set` і :class:`frozenset` і :class:`tuple`. Клас :class:" +"`str` використовується для зберігання рядків Unicode, а класи :class:`bytes` " +"і :class:`bytearray` використовуються для зберігання двійкових даних." + +msgid "The following modules are documented in this chapter:" +msgstr "У цьому розділі описано наступні модулі:" diff --git a/library/datetime.po b/library/datetime.po new file mode 100644 index 000000000..f851380a0 --- /dev/null +++ b/library/datetime.po @@ -0,0 +1,4027 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2025 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 01:04+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2025\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!datetime` --- Basic date and time types" +msgstr ":mod:`!datetime` --- Базові типи дати і часу" + +msgid "**Source code:** :source:`Lib/datetime.py`" +msgstr "**Вихідний код:** :source:`Lib/datetime.py`" + +msgid "" +"The :mod:`!datetime` module supplies classes for manipulating dates and " +"times." +msgstr "Модуль :mod:`!datetime` постачає класи для маніпуляції датою і часом." + +msgid "" +"While date and time arithmetic is supported, the focus of the implementation " +"is on efficient attribute extraction for output formatting and manipulation." +msgstr "" +"Хоча арифметика дати й часу підтримується, основна увага при реалізації " +"зосереджена на ефективному отриманні атрибутів для форматування виводу та " +"обробки." + +msgid "Skip to :ref:`the format codes `." +msgstr "Пропустити до :ref:`кодів формату `." + +msgid "Module :mod:`calendar`" +msgstr "Модуль :mod:`calendar`" + +msgid "General calendar related functions." +msgstr "Загальні функції, пов’язані з календарем." + +msgid "Module :mod:`time`" +msgstr "Модуль :mod:`time`" + +msgid "Time access and conversions." +msgstr "Доступ до часу та перетворення." + +msgid "Module :mod:`zoneinfo`" +msgstr "Модуль :mod:`zoneinfo`" + +msgid "Concrete time zones representing the IANA time zone database." +msgstr "Конкретні часові пояси, що представляють базу часових поясів IANA." + +msgid "Package `dateutil `_" +msgstr "Пакет `dateutil `_" + +msgid "Third-party library with expanded time zone and parsing support." +msgstr "" +"Бібліотека третьої сторони з розширеним часовим поясом і підтримкою аналізу." + +msgid "Package :pypi:`DateType`" +msgstr "Пакет :pypi:`DateType`" + +msgid "" +"Third-party library that introduces distinct static types to e.g. allow :" +"term:`static type checkers ` to differentiate between " +"naive and aware datetimes." +msgstr "" + +msgid "Aware and Naive Objects" +msgstr "Обізнані та наївні об’єкти" + +msgid "" +"Date and time objects may be categorized as \"aware\" or \"naive\" depending " +"on whether or not they include time zone information." +msgstr "" + +msgid "" +"With sufficient knowledge of applicable algorithmic and political time " +"adjustments, such as time zone and daylight saving time information, an " +"**aware** object can locate itself relative to other aware objects. An aware " +"object represents a specific moment in time that is not open to " +"interpretation. [#]_" +msgstr "" +"Завдяки достатнім знанням застосовних алгоритмів і політичних коригувань " +"часу, таких як інформація про часовий пояс і літній час, **свідомий** об’єкт " +"може визначити своє місцезнаходження відносно інших обізнаних об’єктів. " +"Усвідомлюваний об'єкт представляє конкретний момент часу, який не піддається " +"інтерпретації. [#]_" + +msgid "" +"A **naive** object does not contain enough information to unambiguously " +"locate itself relative to other date/time objects. Whether a naive object " +"represents Coordinated Universal Time (UTC), local time, or time in some " +"other time zone is purely up to the program, just like it is up to the " +"program whether a particular number represents metres, miles, or mass. Naive " +"objects are easy to understand and to work with, at the cost of ignoring " +"some aspects of reality." +msgstr "" + +msgid "" +"For applications requiring aware objects, :class:`.datetime` and :class:`." +"time` objects have an optional time zone information attribute, :attr:`!" +"tzinfo`, that can be set to an instance of a subclass of the abstract :class:" +"`tzinfo` class. These :class:`tzinfo` objects capture information about the " +"offset from UTC time, the time zone name, and whether daylight saving time " +"is in effect." +msgstr "" +"Для додатків, яким потрібні об’єкти, об’єкти :class:`.datetime` і :class:`." +"time` мають необов’язковий атрибут інформації про часовий пояс, :attr:`!" +"tzinfo`, який можна встановити як екземпляр підкласу абстрактний :class:" +"`tzinfo` клас. Ці об’єкти :class:`tzinfo` зберігають інформацію про зміщення " +"від часу UTC, назву часового поясу та чи діє літній час." + +msgid "" +"Only one concrete :class:`tzinfo` class, the :class:`timezone` class, is " +"supplied by the :mod:`!datetime` module. The :class:`!timezone` class can " +"represent simple time zones with fixed offsets from UTC, such as UTC itself " +"or North American EST and EDT time zones. Supporting time zones at deeper " +"levels of detail is up to the application. The rules for time adjustment " +"across the world are more political than rational, change frequently, and " +"there is no standard suitable for every application aside from UTC." +msgstr "" + +msgid "Constants" +msgstr "Константи" + +msgid "The :mod:`!datetime` module exports the following constants:" +msgstr "" + +msgid "" +"The smallest year number allowed in a :class:`date` or :class:`.datetime` " +"object. :const:`MINYEAR` is 1." +msgstr "" + +msgid "" +"The largest year number allowed in a :class:`date` or :class:`.datetime` " +"object. :const:`MAXYEAR` is 9999." +msgstr "" + +msgid "Alias for the UTC time zone singleton :attr:`datetime.timezone.utc`." +msgstr "" + +msgid "Available Types" +msgstr "Доступні типи" + +msgid "" +"An idealized naive date, assuming the current Gregorian calendar always was, " +"and always will be, in effect. Attributes: :attr:`year`, :attr:`month`, and :" +"attr:`day`." +msgstr "" +"Ідеалізована наївна дата, припускаючи, що поточний григоріанський календар " +"завжди був і завжди буде в силі. Атрибути: :attr:`year`, :attr:`month` і :" +"attr:`day`." + +msgid "" +"An idealized time, independent of any particular day, assuming that every " +"day has exactly 24\\*60\\*60 seconds. (There is no notion of \"leap " +"seconds\" here.) Attributes: :attr:`hour`, :attr:`minute`, :attr:`second`, :" +"attr:`microsecond`, and :attr:`.tzinfo`." +msgstr "" +"Ідеалізований час, незалежний від будь-якого конкретного дня, припускаючи, " +"що кожен день має рівно 24\\*60\\*60 секунд. (Тут немає поняття \"високосні " +"секунди\".) Атрибути: :attr:`hour`, :attr:`minute`, :attr:`second`, :attr:" +"`microsecond` і :attr:`.tzinfo`." + +msgid "" +"A combination of a date and a time. Attributes: :attr:`year`, :attr:" +"`month`, :attr:`day`, :attr:`hour`, :attr:`minute`, :attr:`second`, :attr:" +"`microsecond`, and :attr:`.tzinfo`." +msgstr "" +"Поєднання дати й часу. Атрибути: :attr:`year`, :attr:`month`, :attr:`day`, :" +"attr:`hour`, :attr:`minute`, :attr:`second`, :attr:`microsecond` і :attr:`." +"tzinfo`." + +msgid "" +"A duration expressing the difference between two :class:`.datetime` or :" +"class:`date` instances to microsecond resolution." +msgstr "" + +msgid "" +"An abstract base class for time zone information objects. These are used by " +"the :class:`.datetime` and :class:`.time` classes to provide a customizable " +"notion of time adjustment (for example, to account for time zone and/or " +"daylight saving time)." +msgstr "" +"Абстрактний базовий клас для інформаційних об’єктів часового поясу. Вони " +"використовуються класами :class:`.datetime` і :class:`.time` для надання " +"настроюваного поняття коригування часу (наприклад, для врахування часового " +"поясу та/або літнього часу)." + +msgid "" +"A class that implements the :class:`tzinfo` abstract base class as a fixed " +"offset from the UTC." +msgstr "" +"Клас, який реалізує :class:`tzinfo` абстрактний базовий клас як фіксоване " +"зміщення від UTC." + +msgid "Objects of these types are immutable." +msgstr "Об'єкти цих типів незмінні." + +msgid "Subclass relationships::" +msgstr "Відносини підкласів::" + +msgid "" +"object\n" +" timedelta\n" +" tzinfo\n" +" timezone\n" +" time\n" +" date\n" +" datetime" +msgstr "" + +msgid "Common Properties" +msgstr "Загальні властивості" + +msgid "" +"The :class:`date`, :class:`.datetime`, :class:`.time`, and :class:`timezone` " +"types share these common features:" +msgstr "" +"Типи :class:`date`, :class:`.datetime`, :class:`.time` і :class:`timezone` " +"мають такі спільні риси:" + +msgid "" +"Objects of these types are :term:`hashable`, meaning that they can be used " +"as dictionary keys." +msgstr "" + +msgid "" +"Objects of these types support efficient pickling via the :mod:`pickle` " +"module." +msgstr "" +"Об’єкти цих типів підтримують ефективне маринування за допомогою модуля :mod:" +"`pickle`." + +msgid "Determining if an Object is Aware or Naive" +msgstr "Визначення того, чи є об’єкт усвідомленим чи наївним" + +msgid "Objects of the :class:`date` type are always naive." +msgstr "Об’єкти типу :class:`date` завжди наївні." + +msgid "" +"An object of type :class:`.time` or :class:`.datetime` may be aware or naive." +msgstr "" +"Об’єкт типу :class:`.time` або :class:`.datetime` може бути обізнаним або " +"наївним." + +msgid "" +"A :class:`.datetime` object ``d`` is aware if both of the following hold:" +msgstr "" + +msgid "``d.tzinfo`` is not ``None``" +msgstr "``d.tzinfo`` не є ``None``" + +msgid "``d.tzinfo.utcoffset(d)`` does not return ``None``" +msgstr "``d.tzinfo.utcoffset(d)`` не повертає ``None``" + +msgid "Otherwise, ``d`` is naive." +msgstr "" + +msgid "A :class:`.time` object ``t`` is aware if both of the following hold:" +msgstr "" + +msgid "``t.tzinfo`` is not ``None``" +msgstr "``t.tzinfo`` не є ``None``" + +msgid "``t.tzinfo.utcoffset(None)`` does not return ``None``." +msgstr "``t.tzinfo.utcoffset(None)`` не повертає ``None``." + +msgid "Otherwise, ``t`` is naive." +msgstr "" + +msgid "" +"The distinction between aware and naive doesn't apply to :class:`timedelta` " +"objects." +msgstr "" +"Розрізнення між обізнаним і наївним не стосується об’єктів :class:" +"`timedelta`." + +msgid ":class:`timedelta` Objects" +msgstr ":class:`timedelta` Об'єкти" + +msgid "" +"A :class:`timedelta` object represents a duration, the difference between " +"two :class:`.datetime` or :class:`date` instances." +msgstr "" + +msgid "" +"All arguments are optional and default to 0. Arguments may be integers or " +"floats, and may be positive or negative." +msgstr "" + +msgid "" +"Only *days*, *seconds* and *microseconds* are stored internally. Arguments " +"are converted to those units:" +msgstr "" +"Усередині зберігаються лише *дні*, *секунди* та *мікросекунди*. Аргументи " +"конвертуються в такі одиниці:" + +msgid "A millisecond is converted to 1000 microseconds." +msgstr "Мілісекунда перетворюється на 1000 мікросекунд." + +msgid "A minute is converted to 60 seconds." +msgstr "Хвилина перетворюється на 60 секунд." + +msgid "An hour is converted to 3600 seconds." +msgstr "Година перетворюється на 3600 секунд." + +msgid "A week is converted to 7 days." +msgstr "Тиждень перетворюється на 7 днів." + +msgid "" +"and days, seconds and microseconds are then normalized so that the " +"representation is unique, with" +msgstr "" +"і дні, секунди та мікросекунди потім нормалізуються, щоб представлення було " +"унікальним, з" + +msgid "``0 <= microseconds < 1000000``" +msgstr "``0 <= мікросекунди < 1000000``" + +msgid "``0 <= seconds < 3600*24`` (the number of seconds in one day)" +msgstr "``0 <= секунд < 3600*24`` (кількість секунд в одному дні)" + +msgid "``-999999999 <= days <= 999999999``" +msgstr "``-999999999 <= днів <= 999999999``" + +msgid "" +"The following example illustrates how any arguments besides *days*, " +"*seconds* and *microseconds* are \"merged\" and normalized into those three " +"resulting attributes::" +msgstr "" +"У наступному прикладі показано, як будь-які аргументи, окрім *днів*, " +"*секунд* і *мікросекунд*, \"об’єднуються\" та нормалізуються в ці три " +"отримані атрибути:" + +msgid "" +">>> from datetime import timedelta\n" +">>> delta = timedelta(\n" +"... days=50,\n" +"... seconds=27,\n" +"... microseconds=10,\n" +"... milliseconds=29000,\n" +"... minutes=5,\n" +"... hours=8,\n" +"... weeks=2\n" +"... )\n" +">>> # Only days, seconds, and microseconds remain\n" +">>> delta\n" +"datetime.timedelta(days=64, seconds=29156, microseconds=10)" +msgstr "" + +msgid "" +"If any argument is a float and there are fractional microseconds, the " +"fractional microseconds left over from all arguments are combined and their " +"sum is rounded to the nearest microsecond using round-half-to-even " +"tiebreaker. If no argument is a float, the conversion and normalization " +"processes are exact (no information is lost)." +msgstr "" +"Якщо будь-який аргумент є числом із плаваючою точкою та є дробові " +"мікросекунди, дробові мікросекунди, що залишилися від усіх аргументів, " +"об’єднуються, а їхня сума округлюється до найближчої мікросекунди за " +"допомогою тай-брейку округлення від половини до навіть. Якщо жоден аргумент " +"не є числом з плаваючою речовиною, процеси перетворення та нормалізації є " +"точними (інформація не втрачається)." + +msgid "" +"If the normalized value of days lies outside the indicated range, :exc:" +"`OverflowError` is raised." +msgstr "" +"Якщо нормалізоване значення днів лежить за межами зазначеного діапазону, " +"виникає :exc:`OverflowError`." + +msgid "" +"Note that normalization of negative values may be surprising at first. For " +"example::" +msgstr "" +"Зверніть увагу, що нормалізація від’ємних значень спочатку може викликати " +"подив. Наприклад::" + +msgid "" +">>> from datetime import timedelta\n" +">>> d = timedelta(microseconds=-1)\n" +">>> (d.days, d.seconds, d.microseconds)\n" +"(-1, 86399, 999999)" +msgstr "" +">>> from datetime import timedelta\n" +">>> d = timedelta(microseconds=-1)\n" +">>> (d.days, d.seconds, d.microseconds)\n" +"(-1, 86399, 999999)" + +msgid "Class attributes:" +msgstr "Атрибути класу:" + +msgid "The most negative :class:`timedelta` object, ``timedelta(-999999999)``." +msgstr "" +"Найбільш негативний об’єкт :class:`timedelta`, ``timedelta(-999999999)``." + +msgid "" +"The most positive :class:`timedelta` object, ``timedelta(days=999999999, " +"hours=23, minutes=59, seconds=59, microseconds=999999)``." +msgstr "" +"Найбільш позитивний об’єкт :class:`timedelta`, ``timedelta(days=999999999, " +"hours=23, minutes=59, seconds=59, microseconds=999999)``." + +msgid "" +"The smallest possible difference between non-equal :class:`timedelta` " +"objects, ``timedelta(microseconds=1)``." +msgstr "" +"Найменша можлива різниця між нерівними об’єктами :class:`timedelta`, " +"``timedelta(microseconds=1)``." + +msgid "" +"Note that, because of normalization, ``timedelta.max`` is greater than ``-" +"timedelta.min``. ``-timedelta.max`` is not representable as a :class:" +"`timedelta` object." +msgstr "" + +msgid "Instance attributes (read-only):" +msgstr "Атрибути екземпляра (тільки для читання):" + +msgid "Between -999,999,999 and 999,999,999 inclusive." +msgstr "Між -999,999,999 та 999,999,999 включно." + +msgid "Between 0 and 86,399 inclusive." +msgstr "Між 0 та 86,399 включно." + +msgid "" +"It is a somewhat common bug for code to unintentionally use this attribute " +"when it is actually intended to get a :meth:`~timedelta.total_seconds` value " +"instead:" +msgstr "" + +msgid "" +">>> from datetime import timedelta\n" +">>> duration = timedelta(seconds=11235813)\n" +">>> duration.days, duration.seconds\n" +"(130, 3813)\n" +">>> duration.total_seconds()\n" +"11235813.0" +msgstr "" +">>> from datetime import timedelta\n" +">>> duration = timedelta(seconds=11235813)\n" +">>> duration.days, duration.seconds\n" +"(130, 3813)\n" +">>> duration.total_seconds()\n" +"11235813.0" + +msgid "Between 0 and 999,999 inclusive." +msgstr "Між 0 та 999,999 включно." + +msgid "Supported operations:" +msgstr "Підтримувані операції:" + +msgid "Operation" +msgstr "Операція" + +msgid "Result" +msgstr "Результат" + +msgid "``t1 = t2 + t3``" +msgstr "``t1 = t2 + t3``" + +msgid "" +"Sum of ``t2`` and ``t3``. Afterwards ``t1 - t2 == t3`` and ``t1 - t3 == t2`` " +"are true. (1)" +msgstr "" + +msgid "``t1 = t2 - t3``" +msgstr "``t1 = t2 - t3``" + +msgid "" +"Difference of ``t2`` and ``t3``. Afterwards ``t1 == t2 - t3`` and ``t2 == " +"t1 + t3`` are true. (1)(6)" +msgstr "" + +msgid "``t1 = t2 * i or t1 = i * t2``" +msgstr "``t1 = t2 * i або t1 = i * t2``" + +msgid "" +"Delta multiplied by an integer. Afterwards ``t1 // i == t2`` is true, " +"provided ``i != 0``." +msgstr "" + +msgid "In general, ``t1 * i == t1 * (i-1) + t1`` is true. (1)" +msgstr "" + +msgid "``t1 = t2 * f or t1 = f * t2``" +msgstr "``t1 = t2 * f або t1 = f * t2``" + +msgid "" +"Delta multiplied by a float. The result is rounded to the nearest multiple " +"of timedelta.resolution using round-half-to-even." +msgstr "" +"Дельта, помножена на float. Результат округлюється до найближчого кратного " +"timedelta.resolution за допомогою округлення від половини до навіть." + +msgid "``f = t2 / t3``" +msgstr "``f = t2 / t3``" + +msgid "" +"Division (3) of overall duration ``t2`` by interval unit ``t3``. Returns a :" +"class:`float` object." +msgstr "" + +msgid "``t1 = t2 / f or t1 = t2 / i``" +msgstr "``t1 = t2 / f або t1 = t2 / i``" + +msgid "" +"Delta divided by a float or an int. The result is rounded to the nearest " +"multiple of timedelta.resolution using round-half-to-even." +msgstr "" +"Дельта, поділена на float або int. Результат округлюється до найближчого " +"кратного timedelta.resolution за допомогою округлення від половини до навіть." + +msgid "``t1 = t2 // i`` or ``t1 = t2 // t3``" +msgstr "``t1 = t2 // i`` або ``t1 = t2 // t3``" + +msgid "" +"The floor is computed and the remainder (if any) is thrown away. In the " +"second case, an integer is returned. (3)" +msgstr "" +"Підлога обчислюється, а залишок (якщо є) викидається. У другому випадку " +"повертається ціле число. (3)" + +msgid "``t1 = t2 % t3``" +msgstr "``t1 = t2 % t3``" + +msgid "The remainder is computed as a :class:`timedelta` object. (3)" +msgstr "Залишок обчислюється як об’єкт :class:`timedelta`. (3)" + +msgid "``q, r = divmod(t1, t2)``" +msgstr "``q, r = divmod(t1, t2)``" + +msgid "" +"Computes the quotient and the remainder: ``q = t1 // t2`` (3) and ``r = t1 % " +"t2``. ``q`` is an integer and ``r`` is a :class:`timedelta` object." +msgstr "" + +msgid "``+t1``" +msgstr "``+t1``" + +msgid "Returns a :class:`timedelta` object with the same value. (2)" +msgstr "Повертає об’єкт :class:`timedelta` з тим самим значенням. (2)" + +msgid "``-t1``" +msgstr "``-t1``" + +msgid "" +"Equivalent to ``timedelta(-t1.days, -t1.seconds, -t1.microseconds)``, and to " +"``t1 * -1``. (1)(4)" +msgstr "" + +msgid "``abs(t)``" +msgstr "``abs(t)``" + +msgid "" +"Equivalent to ``+t`` when ``t.days >= 0``, and to ``-t`` when ``t.days < " +"0``. (2)" +msgstr "" + +msgid "``str(t)``" +msgstr "``str(t)``" + +msgid "" +"Returns a string in the form ``[D day[s], ][H]H:MM:SS[.UUUUUU]``, where D is " +"negative for negative ``t``. (5)" +msgstr "" +"Повертає рядок у формі ``[D day[s], ][H]H:MM:SS[.UUUUUU]``, де D є від’ємним " +"для від’ємного ``t``. (5)" + +msgid "``repr(t)``" +msgstr "``repr(t)``" + +msgid "" +"Returns a string representation of the :class:`timedelta` object as a " +"constructor call with canonical attribute values." +msgstr "" +"Повертає рядкове представлення об’єкта :class:`timedelta` як виклик " +"конструктора з канонічними значеннями атрибутів." + +msgid "Notes:" +msgstr "Примітки:" + +msgid "This is exact but may overflow." +msgstr "Це точно, але може переповнюватись." + +msgid "This is exact and cannot overflow." +msgstr "Це точно і не може переповнюватися." + +msgid "Division by zero raises :exc:`ZeroDivisionError`." +msgstr "" + +msgid "``-timedelta.max`` is not representable as a :class:`timedelta` object." +msgstr "" + +msgid "" +"String representations of :class:`timedelta` objects are normalized " +"similarly to their internal representation. This leads to somewhat unusual " +"results for negative timedeltas. For example::" +msgstr "" +"Рядкові представлення об’єктів :class:`timedelta` нормалізуються подібно до " +"їх внутрішнього представлення. Це призводить до дещо незвичайних результатів " +"для негативних часових дельт. Наприклад::" + +msgid "" +">>> timedelta(hours=-5)\n" +"datetime.timedelta(days=-1, seconds=68400)\n" +">>> print(_)\n" +"-1 day, 19:00:00" +msgstr "" + +msgid "" +"The expression ``t2 - t3`` will always be equal to the expression ``t2 + (-" +"t3)`` except when t3 is equal to ``timedelta.max``; in that case the former " +"will produce a result while the latter will overflow." +msgstr "" +"Вираз ``t2 - t3`` завжди дорівнюватиме виразу ``t2 + (-t3)``, за винятком " +"випадків, коли t3 дорівнює ``timedelta.max``; у цьому випадку перший дасть " +"результат, а другий переповниться." + +msgid "" +"In addition to the operations listed above, :class:`timedelta` objects " +"support certain additions and subtractions with :class:`date` and :class:`." +"datetime` objects (see below)." +msgstr "" +"Окрім перерахованих вище операцій, об’єкти :class:`timedelta` підтримують " +"певні додавання та віднімання за допомогою об’єктів :class:`date` і :class:`." +"datetime` (див. нижче)." + +msgid "" +"Floor division and true division of a :class:`timedelta` object by another :" +"class:`timedelta` object are now supported, as are remainder operations and " +"the :func:`divmod` function. True division and multiplication of a :class:" +"`timedelta` object by a :class:`float` object are now supported." +msgstr "" +"Тепер підтримується поділ на поверх і справжній поділ об’єкта :class:" +"`timedelta` на інший об’єкт :class:`timedelta`, а також операції з залишком " +"і функція :func:`divmod`. Тепер підтримується справжнє ділення та множення " +"об’єкта :class:`timedelta` на об’єкт :class:`float`." + +msgid ":class:`timedelta` objects support equality and order comparisons." +msgstr "" + +msgid "" +"In Boolean contexts, a :class:`timedelta` object is considered to be true if " +"and only if it isn't equal to ``timedelta(0)``." +msgstr "" +"У логічних контекстах об’єкт :class:`timedelta` вважається істинним тоді і " +"тільки тоді, коли він не дорівнює ``timedelta(0)``." + +msgid "Instance methods:" +msgstr "Методи екземплярів:" + +msgid "" +"Return the total number of seconds contained in the duration. Equivalent to " +"``td / timedelta(seconds=1)``. For interval units other than seconds, use " +"the division form directly (e.g. ``td / timedelta(microseconds=1)``)." +msgstr "" +"Повертає загальну кількість секунд, що міститься в тривалості. Еквівалент " +"``td / timedelta(seconds=1)``. Для одиниць інтервалу, відмінних від секунд, " +"використовуйте напряму форму ділення (наприклад, ``td / " +"timedelta(microseconds=1)``)." + +msgid "" +"Note that for very large time intervals (greater than 270 years on most " +"platforms) this method will lose microsecond accuracy." +msgstr "" +"Зауважте, що для дуже великих інтервалів часу (понад 270 років на більшості " +"платформ) цей метод втратить мікросекундну точність." + +msgid "Examples of usage: :class:`timedelta`" +msgstr "Приклади використання: :class:`timedelta`" + +msgid "An additional example of normalization::" +msgstr "Додатковий приклад нормалізації::" + +msgid "" +">>> # Components of another_year add up to exactly 365 days\n" +">>> from datetime import timedelta\n" +">>> year = timedelta(days=365)\n" +">>> another_year = timedelta(weeks=40, days=84, hours=23,\n" +"... minutes=50, seconds=600)\n" +">>> year == another_year\n" +"True\n" +">>> year.total_seconds()\n" +"31536000.0" +msgstr "" + +msgid "Examples of :class:`timedelta` arithmetic::" +msgstr "Приклади арифметики :class:`timedelta`::" + +msgid "" +">>> from datetime import timedelta\n" +">>> year = timedelta(days=365)\n" +">>> ten_years = 10 * year\n" +">>> ten_years\n" +"datetime.timedelta(days=3650)\n" +">>> ten_years.days // 365\n" +"10\n" +">>> nine_years = ten_years - year\n" +">>> nine_years\n" +"datetime.timedelta(days=3285)\n" +">>> three_years = nine_years // 3\n" +">>> three_years, three_years.days // 365\n" +"(datetime.timedelta(days=1095), 3)" +msgstr "" + +msgid ":class:`date` Objects" +msgstr ":class:`date` Об'єкти" + +msgid "" +"A :class:`date` object represents a date (year, month and day) in an " +"idealized calendar, the current Gregorian calendar indefinitely extended in " +"both directions." +msgstr "" +"Об’єкт :class:`date` представляє дату (рік, місяць і день) в ідеалізованому " +"календарі, поточний григоріанський календар необмежено розширений в обох " +"напрямках." + +msgid "" +"January 1 of year 1 is called day number 1, January 2 of year 1 is called " +"day number 2, and so on. [#]_" +msgstr "" +"1 січня року 1 називається днем номер 1, 2 січня року 1 називається днем " +"номер 2 і так далі. [#]_" + +msgid "" +"All arguments are required. Arguments must be integers, in the following " +"ranges:" +msgstr "" +"Всі аргументи необхідні. Аргументи мають бути цілими числами в таких " +"діапазонах:" + +msgid "``MINYEAR <= year <= MAXYEAR``" +msgstr "``MINYEAR <= рік <= MAXYEAR``" + +msgid "``1 <= month <= 12``" +msgstr "``1 <= місяць <= 12``" + +msgid "``1 <= day <= number of days in the given month and year``" +msgstr "``1 <= день <= кількість днів у заданому місяці та році``" + +msgid "" +"If an argument outside those ranges is given, :exc:`ValueError` is raised." +msgstr "" +"Якщо вказано аргумент поза цими діапазонами, виникає :exc:`ValueError`." + +msgid "Other constructors, all class methods:" +msgstr "Інші конструктори, усі методи класу:" + +msgid "Return the current local date." +msgstr "Повернути поточну місцеву дату." + +msgid "This is equivalent to ``date.fromtimestamp(time.time())``." +msgstr "Це еквівалентно ``date.fromtimestamp(time.time())``." + +msgid "" +"Return the local date corresponding to the POSIX timestamp, such as is " +"returned by :func:`time.time`." +msgstr "" +"Повертає місцеву дату, що відповідає мітці часу POSIX, наприклад, яку " +"повертає :func:`time.time`." + +msgid "" +"This may raise :exc:`OverflowError`, if the timestamp is out of the range of " +"values supported by the platform C :c:func:`localtime` function, and :exc:" +"`OSError` on :c:func:`localtime` failure. It's common for this to be " +"restricted to years from 1970 through 2038. Note that on non-POSIX systems " +"that include leap seconds in their notion of a timestamp, leap seconds are " +"ignored by :meth:`fromtimestamp`." +msgstr "" +"Це може спричинити помилку :exc:`OverflowError`, якщо позначка часу виходить " +"за межі діапазону значень, які підтримує функція C :c:func:`localtime`, і :" +"exc:`OSError` у :c:func:`localtime` невдача. Зазвичай це обмежується роками " +"з 1970 по 2038 рік. Зауважте, що в системах без POSIX, які включають " +"високосні секунди в своє поняття позначки часу, високосні секунди " +"ігноруються :meth:`fromtimestamp`." + +msgid "" +"Raise :exc:`OverflowError` instead of :exc:`ValueError` if the timestamp is " +"out of the range of values supported by the platform C :c:func:`localtime` " +"function. Raise :exc:`OSError` instead of :exc:`ValueError` on :c:func:" +"`localtime` failure." +msgstr "" +"Викликайте :exc:`OverflowError` замість :exc:`ValueError`, якщо позначка " +"часу виходить за межі діапазону значень, які підтримує функція C :c:func:" +"`localtime` платформи. Викликати :exc:`OSError` замість :exc:`ValueError` у " +"разі помилки :c:func:`localtime`." + +msgid "" +"Return the date corresponding to the proleptic Gregorian ordinal, where " +"January 1 of year 1 has ordinal 1." +msgstr "" +"Повертає дату, що відповідає пролептичному григоріанському порядковому " +"номеру, де 1 січня 1 року має порядковий номер 1." + +msgid "" +":exc:`ValueError` is raised unless ``1 <= ordinal <= date.max.toordinal()``. " +"For any date ``d``, ``date.fromordinal(d.toordinal()) == d``." +msgstr "" + +msgid "" +"Return a :class:`date` corresponding to a *date_string* given in any valid " +"ISO 8601 format, with the following exceptions:" +msgstr "" + +msgid "" +"Reduced precision dates are not currently supported (``YYYY-MM``, ``YYYY``)." +msgstr "" + +msgid "" +"Extended date representations are not currently supported (``±YYYYYY-MM-" +"DD``)." +msgstr "" + +msgid "Ordinal dates are not currently supported (``YYYY-OOO``)." +msgstr "" + +msgid "Examples::" +msgstr "Приклади::" + +msgid "" +">>> from datetime import date\n" +">>> date.fromisoformat('2019-12-04')\n" +"datetime.date(2019, 12, 4)\n" +">>> date.fromisoformat('20191204')\n" +"datetime.date(2019, 12, 4)\n" +">>> date.fromisoformat('2021-W01-1')\n" +"datetime.date(2021, 1, 4)" +msgstr "" + +msgid "Previously, this method only supported the format ``YYYY-MM-DD``." +msgstr "" + +msgid "" +"Return a :class:`date` corresponding to the ISO calendar date specified by " +"year, week and day. This is the inverse of the function :meth:`date." +"isocalendar`." +msgstr "" +"Повертає :class:`date`, що відповідає календарній даті ISO, визначеній " +"роком, тижнем і днем. Це зворотна функція :meth:`date.isocalendar`." + +msgid "The earliest representable date, ``date(MINYEAR, 1, 1)``." +msgstr "Найраніша дата, яку можна представити, ``date(MINYEAR, 1, 1)``." + +msgid "The latest representable date, ``date(MAXYEAR, 12, 31)``." +msgstr "Остання представлена дата, ``date(MAXYEAR, 12, 31)``." + +msgid "" +"The smallest possible difference between non-equal date objects, " +"``timedelta(days=1)``." +msgstr "" +"Найменша можлива різниця між об’єктами нерівних дат, ``timedelta(days=1)``." + +msgid "Between :const:`MINYEAR` and :const:`MAXYEAR` inclusive." +msgstr "Між :const:`MINYEAR` і :const:`MAXYEAR` включно." + +msgid "Between 1 and 12 inclusive." +msgstr "Від 1 до 12 включно." + +msgid "Between 1 and the number of days in the given month of the given year." +msgstr "Від 1 до числа днів у даному місяці даного року." + +msgid "``date2 = date1 + timedelta``" +msgstr "``дата2 = дата1 + дельта часу``" + +msgid "``date2`` will be ``timedelta.days`` days after ``date1``. (1)" +msgstr "" + +msgid "``date2 = date1 - timedelta``" +msgstr "``дата2 = дата1 - дельта часу``" + +msgid "Computes ``date2`` such that ``date2 + timedelta == date1``. (2)" +msgstr "" + +msgid "``timedelta = date1 - date2``" +msgstr "``timedelta = дата1 - дата2``" + +msgid "\\(3)" +msgstr "\\(3)" + +msgid "``date1 == date2``" +msgstr "" + +msgid "``date1 != date2``" +msgstr "" + +msgid "Equality comparison. (4)" +msgstr "" + +msgid "``date1 < date2``" +msgstr "``дата1 < дата2``" + +msgid "``date1 > date2``" +msgstr "" + +msgid "``date1 <= date2``" +msgstr "" + +msgid "``date1 >= date2``" +msgstr "" + +msgid "Order comparison. (5)" +msgstr "" + +msgid "" +"*date2* is moved forward in time if ``timedelta.days > 0``, or backward if " +"``timedelta.days < 0``. Afterward ``date2 - date1 == timedelta.days``. " +"``timedelta.seconds`` and ``timedelta.microseconds`` are ignored. :exc:" +"`OverflowError` is raised if ``date2.year`` would be smaller than :const:" +"`MINYEAR` or larger than :const:`MAXYEAR`." +msgstr "" +"*date2* пересувається вперед у часі, якщо ``timedelta.days > 0``, або назад, " +"``timedelta.days < 0``. Після цього ``date2 - date1 == timedelta.days``. " +"``timedelta.seconds`` і ``timedelta.microseconds`` ігноруються. :exc:" +"`OverflowError` виникає, якщо ``date2.year`` буде меншим за :const:`MINYEAR` " +"або більшим за :const:`MAXYEAR`." + +msgid "``timedelta.seconds`` and ``timedelta.microseconds`` are ignored." +msgstr "``timedelta.seconds`` і ``timedelta.microseconds`` ігноруються." + +msgid "" +"This is exact, and cannot overflow. ``timedelta.seconds`` and ``timedelta." +"microseconds`` are 0, and ``date2 + timedelta == date1`` after." +msgstr "" + +msgid ":class:`date` objects are equal if they represent the same date." +msgstr "" + +msgid "" +":class:`!date` objects that are not also :class:`.datetime` instances are " +"never equal to :class:`!datetime` objects, even if they represent the same " +"date." +msgstr "" + +msgid "" +"*date1* is considered less than *date2* when *date1* precedes *date2* in " +"time. In other words, ``date1 < date2`` if and only if ``date1.toordinal() < " +"date2.toordinal()``." +msgstr "" + +msgid "" +"Order comparison between a :class:`!date` object that is not also a :class:`." +"datetime` instance and a :class:`!datetime` object raises :exc:`TypeError`." +msgstr "" + +msgid "" +"Comparison between :class:`.datetime` object and an instance of the :class:" +"`date` subclass that is not a :class:`!datetime` subclass no longer converts " +"the latter to :class:`!date`, ignoring the time part and the time zone. The " +"default behavior can be changed by overriding the special comparison methods " +"in subclasses." +msgstr "" + +msgid "" +"In Boolean contexts, all :class:`date` objects are considered to be true." +msgstr "У логічних контекстах усі об’єкти :class:`date` вважаються істинними." + +msgid "" +"Return a new :class:`date` object with the same values, but with specified " +"parameters updated." +msgstr "" + +msgid "Example::" +msgstr "Приклад::" + +msgid "" +">>> from datetime import date\n" +">>> d = date(2002, 12, 31)\n" +">>> d.replace(day=26)\n" +"datetime.date(2002, 12, 26)" +msgstr "" + +msgid "" +"The generic function :func:`copy.replace` also supports :class:`date` " +"objects." +msgstr "" + +msgid "" +"Return a :class:`time.struct_time` such as returned by :func:`time." +"localtime`." +msgstr "" +"Повертає :class:`time.struct_time`, наприклад, повертає :func:`time." +"localtime`." + +msgid "The hours, minutes and seconds are 0, and the DST flag is -1." +msgstr "" +"Години, хвилини та секунди дорівнюють 0, а позначка літнього часу дорівнює " +"-1." + +msgid "``d.timetuple()`` is equivalent to::" +msgstr "``d.timetuple()`` еквівалентний:" + +msgid "" +"time.struct_time((d.year, d.month, d.day, 0, 0, 0, d.weekday(), yday, -1))" +msgstr "" + +msgid "" +"where ``yday = d.toordinal() - date(d.year, 1, 1).toordinal() + 1`` is the " +"day number within the current year starting with 1 for January 1st." +msgstr "" + +msgid "" +"Return the proleptic Gregorian ordinal of the date, where January 1 of year " +"1 has ordinal 1. For any :class:`date` object ``d``, ``date.fromordinal(d." +"toordinal()) == d``." +msgstr "" + +msgid "" +"Return the day of the week as an integer, where Monday is 0 and Sunday is 6. " +"For example, ``date(2002, 12, 4).weekday() == 2``, a Wednesday. See also :" +"meth:`isoweekday`." +msgstr "" +"Повертає день тижня як ціле число, де понеділок — 0, а неділя — 6. " +"Наприклад, ``date(2002, 12, 4).weekday() == 2``, середа. Дивіться також :" +"meth:`isoweekday`." + +msgid "" +"Return the day of the week as an integer, where Monday is 1 and Sunday is 7. " +"For example, ``date(2002, 12, 4).isoweekday() == 3``, a Wednesday. See also :" +"meth:`weekday`, :meth:`isocalendar`." +msgstr "" +"Повертає день тижня як ціле число, де понеділок — 1, а неділя — 7. " +"Наприклад, ``date(2002, 12, 4).isoweekday() == 3``, середа. Дивіться також :" +"meth:`weekday`, :meth:`isocalendar`." + +msgid "" +"Return a :term:`named tuple` object with three components: ``year``, " +"``week`` and ``weekday``." +msgstr "" +"Повертає об’єкт :term:`named tuple` із трьома компонентами: ``year``, " +"``week`` і ``weekday``." + +msgid "" +"The ISO calendar is a widely used variant of the Gregorian calendar. [#]_" +msgstr "" +"Календар ISO є широко використовуваним варіантом григоріанського календаря. " +"[#]_" + +msgid "" +"The ISO year consists of 52 or 53 full weeks, and where a week starts on a " +"Monday and ends on a Sunday. The first week of an ISO year is the first " +"(Gregorian) calendar week of a year containing a Thursday. This is called " +"week number 1, and the ISO year of that Thursday is the same as its " +"Gregorian year." +msgstr "" +"Рік ISO складається з 52 або 53 повних тижнів, де тиждень починається в " +"понеділок і закінчується в неділю. Перший тиждень року ISO — це перший " +"(григоріанський) календарний тиждень року, що містить четвер. Це називається " +"тижнем номер 1, і рік ISO того четверга такий же, як його григоріанський рік." + +msgid "" +"For example, 2004 begins on a Thursday, so the first week of ISO year 2004 " +"begins on Monday, 29 Dec 2003 and ends on Sunday, 4 Jan 2004::" +msgstr "" +"Наприклад, 2004 рік починається в четвер, тому перший тиждень 2004 року ISO " +"починається в понеділок, 29 грудня 2003 року, і закінчується в неділю, 4 " +"січня 2004 року:" + +msgid "" +">>> from datetime import date\n" +">>> date(2003, 12, 29).isocalendar()\n" +"datetime.IsoCalendarDate(year=2004, week=1, weekday=1)\n" +">>> date(2004, 1, 4).isocalendar()\n" +"datetime.IsoCalendarDate(year=2004, week=1, weekday=7)" +msgstr "" + +msgid "Result changed from a tuple to a :term:`named tuple`." +msgstr "Результат змінено з кортежу на :term:`named tuple`." + +msgid "" +"Return a string representing the date in ISO 8601 format, ``YYYY-MM-DD``::" +msgstr "" +"Повертає рядок, що представляє дату у форматі ISO 8601, ``РРРР-ММ-ДД``::" + +msgid "" +">>> from datetime import date\n" +">>> date(2002, 12, 4).isoformat()\n" +"'2002-12-04'" +msgstr "" + +msgid "For a date ``d``, ``str(d)`` is equivalent to ``d.isoformat()``." +msgstr "" + +msgid "Return a string representing the date::" +msgstr "Повертає рядок, що представляє дату::" + +msgid "" +">>> from datetime import date\n" +">>> date(2002, 12, 4).ctime()\n" +"'Wed Dec 4 00:00:00 2002'" +msgstr "" + +msgid "``d.ctime()`` is equivalent to::" +msgstr "``d.ctime()`` еквівалентний:" + +msgid "time.ctime(time.mktime(d.timetuple()))" +msgstr "" + +msgid "" +"on platforms where the native C :c:func:`ctime` function (which :func:`time." +"ctime` invokes, but which :meth:`date.ctime` does not invoke) conforms to " +"the C standard." +msgstr "" +"на платформах, де рідна функція C :c:func:`ctime` (яку :func:`time.ctime` " +"викликає, але яку :meth:`date.ctime` не викликає) відповідає стандарту C." + +msgid "" +"Return a string representing the date, controlled by an explicit format " +"string. Format codes referring to hours, minutes or seconds will see 0 " +"values. See also :ref:`strftime-strptime-behavior` and :meth:`date." +"isoformat`." +msgstr "" + +msgid "" +"Same as :meth:`.date.strftime`. This makes it possible to specify a format " +"string for a :class:`.date` object in :ref:`formatted string literals ` and when using :meth:`str.format`. See also :ref:`strftime-" +"strptime-behavior` and :meth:`date.isoformat`." +msgstr "" + +msgid "Examples of Usage: :class:`date`" +msgstr "Приклади використання: :class:`date`" + +msgid "Example of counting days to an event::" +msgstr "Приклад підрахунку днів до події::" + +msgid "" +">>> import time\n" +">>> from datetime import date\n" +">>> today = date.today()\n" +">>> today\n" +"datetime.date(2007, 12, 5)\n" +">>> today == date.fromtimestamp(time.time())\n" +"True\n" +">>> my_birthday = date(today.year, 6, 24)\n" +">>> if my_birthday < today:\n" +"... my_birthday = my_birthday.replace(year=today.year + 1)\n" +"...\n" +">>> my_birthday\n" +"datetime.date(2008, 6, 24)\n" +">>> time_to_birthday = abs(my_birthday - today)\n" +">>> time_to_birthday.days\n" +"202" +msgstr "" + +msgid "More examples of working with :class:`date`:" +msgstr "Ще приклади роботи з :class:`date`:" + +msgid "" +">>> from datetime import date\n" +">>> d = date.fromordinal(730920) # 730920th day after 1. 1. 0001\n" +">>> d\n" +"datetime.date(2002, 3, 11)\n" +"\n" +">>> # Methods related to formatting string output\n" +">>> d.isoformat()\n" +"'2002-03-11'\n" +">>> d.strftime(\"%d/%m/%y\")\n" +"'11/03/02'\n" +">>> d.strftime(\"%A %d. %B %Y\")\n" +"'Monday 11. March 2002'\n" +">>> d.ctime()\n" +"'Mon Mar 11 00:00:00 2002'\n" +">>> 'The {1} is {0:%d}, the {2} is {0:%B}.'.format(d, \"day\", \"month\")\n" +"'The day is 11, the month is March.'\n" +"\n" +">>> # Methods for to extracting 'components' under different calendars\n" +">>> t = d.timetuple()\n" +">>> for i in t:\n" +"... print(i)\n" +"2002 # year\n" +"3 # month\n" +"11 # day\n" +"0\n" +"0\n" +"0\n" +"0 # weekday (0 = Monday)\n" +"70 # 70th day in the year\n" +"-1\n" +">>> ic = d.isocalendar()\n" +">>> for i in ic:\n" +"... print(i)\n" +"2002 # ISO year\n" +"11 # ISO week number\n" +"1 # ISO day number ( 1 = Monday )\n" +"\n" +">>> # A date object is immutable; all operations produce a new object\n" +">>> d.replace(year=2005)\n" +"datetime.date(2005, 3, 11)" +msgstr "" + +msgid ":class:`.datetime` Objects" +msgstr ":class:`.datetime` Об'єкти" + +msgid "" +"A :class:`.datetime` object is a single object containing all the " +"information from a :class:`date` object and a :class:`.time` object." +msgstr "" +"Об’єкт :class:`.datetime` — це єдиний об’єкт, який містить всю інформацію з " +"об’єктів :class:`date` і :class:`.time`." + +msgid "" +"Like a :class:`date` object, :class:`.datetime` assumes the current " +"Gregorian calendar extended in both directions; like a :class:`.time` " +"object, :class:`.datetime` assumes there are exactly 3600\\*24 seconds in " +"every day." +msgstr "" +"Як і об’єкт :class:`date`, :class:`.datetime` передбачає поточний " +"григоріанський календар, розширений в обох напрямках; як і об’єкт :class:`." +"time`, :class:`.datetime` припускає, що кожен день становить рівно 3600\\*24 " +"секунди." + +msgid "Constructor:" +msgstr "Конструктор:" + +msgid "" +"The *year*, *month* and *day* arguments are required. *tzinfo* may be " +"``None``, or an instance of a :class:`tzinfo` subclass. The remaining " +"arguments must be integers in the following ranges:" +msgstr "" +"Аргументи *рік*, *місяць* і *день* є обов’язковими. *tzinfo* може бути " +"``None`` або екземпляром підкласу :class:`tzinfo`. Решта аргументів мають " +"бути цілими числами в таких діапазонах:" + +msgid "``MINYEAR <= year <= MAXYEAR``," +msgstr "``MINYEAR <= рік <= MAXYEAR``," + +msgid "``1 <= month <= 12``," +msgstr "``1 <= місяць <= 12``," + +msgid "``1 <= day <= number of days in the given month and year``," +msgstr "``1 <= день <= кількість днів у заданому місяці та році``," + +msgid "``0 <= hour < 24``," +msgstr "``0 <= година < 24``," + +msgid "``0 <= minute < 60``," +msgstr "``0 <= хвилина < 60``," + +msgid "``0 <= second < 60``," +msgstr "``0 <= секунда < 60``," + +msgid "``0 <= microsecond < 1000000``," +msgstr "``0 <= мікросекунда < 1000000``," + +msgid "``fold in [0, 1]``." +msgstr "``згорнути [0, 1]``." + +msgid "Added the *fold* parameter." +msgstr "" + +msgid "Return the current local date and time, with :attr:`.tzinfo` ``None``." +msgstr "" + +msgid "Equivalent to::" +msgstr "Дорівнює::" + +msgid "datetime.fromtimestamp(time.time())" +msgstr "" + +msgid "See also :meth:`now`, :meth:`fromtimestamp`." +msgstr "Дивіться також :meth:`now`, :meth:`fromtimestamp`." + +msgid "" +"This method is functionally equivalent to :meth:`now`, but without a ``tz`` " +"parameter." +msgstr "" +"Цей метод функціонально еквівалентний :meth:`now`, але без параметра ``tz``." + +msgid "Return the current local date and time." +msgstr "Повернути поточну місцеву дату й час." + +msgid "" +"If optional argument *tz* is ``None`` or not specified, this is like :meth:" +"`today`, but, if possible, supplies more precision than can be gotten from " +"going through a :func:`time.time` timestamp (for example, this may be " +"possible on platforms supplying the C :c:func:`gettimeofday` function)." +msgstr "" +"Якщо необов’язковий аргумент *tz* має значення ``None`` або не вказано, це " +"схоже на :meth:`today`, але, якщо можливо, надає більшу точність, ніж можна " +"отримати, пройшовши через :func:`time.time` мітка часу (наприклад, це " +"можливо на платформах, що забезпечують функцію C :c:func:`gettimeofday`)." + +msgid "" +"If *tz* is not ``None``, it must be an instance of a :class:`tzinfo` " +"subclass, and the current date and time are converted to *tz*’s time zone." +msgstr "" +"Якщо *tz* не є ``None``, він має бути екземпляром підкласу :class:`tzinfo`, " +"а поточні дата й час перетворюються на часовий пояс *tz*." + +msgid "This function is preferred over :meth:`today` and :meth:`utcnow`." +msgstr "Цій функції надається перевага над :meth:`today` і :meth:`utcnow`." + +msgid "" +"Subsequent calls to :meth:`!datetime.now` may return the same instant " +"depending on the precision of the underlying clock." +msgstr "" + +msgid "Return the current UTC date and time, with :attr:`.tzinfo` ``None``." +msgstr "" +"Повертає поточну дату й час за UTC за допомогою :attr:`.tzinfo` ``None``." + +msgid "" +"This is like :meth:`now`, but returns the current UTC date and time, as a " +"naive :class:`.datetime` object. An aware current UTC datetime can be " +"obtained by calling ``datetime.now(timezone.utc)``. See also :meth:`now`." +msgstr "" +"Це схоже на :meth:`now`, але повертає поточну дату та час у форматі UTC як " +"простий об’єкт :class:`.datetime`. Відомий поточний UTC datetime можна " +"отримати, викликавши ``datetime.now(timezone.utc)``. Дивіться також :meth:" +"`now`." + +msgid "" +"Because naive ``datetime`` objects are treated by many ``datetime`` methods " +"as local times, it is preferred to use aware datetimes to represent times in " +"UTC. As such, the recommended way to create an object representing the " +"current time in UTC is by calling ``datetime.now(timezone.utc)``." +msgstr "" +"Оскільки наївні об’єкти ``datetime`` розглядаються багатьма методами " +"``datetime`` як місцевий час, бажано використовувати відомі дати для " +"представлення часу в UTC. Таким чином, рекомендований спосіб створити " +"об’єкт, що представляє поточний час у UTC, — це викликати ``datetime." +"now(timezone.utc)``." + +msgid "Use :meth:`datetime.now` with :const:`UTC` instead." +msgstr "" + +msgid "" +"Return the local date and time corresponding to the POSIX timestamp, such as " +"is returned by :func:`time.time`. If optional argument *tz* is ``None`` or " +"not specified, the timestamp is converted to the platform's local date and " +"time, and the returned :class:`.datetime` object is naive." +msgstr "" +"Повертає локальну дату й час, що відповідають мітці часу POSIX, наприклад, " +"повертає :func:`time.time`. Якщо необов’язковий аргумент *tz* має значення " +"``None`` або не вказано, позначка часу перетворюється на локальну дату й час " +"платформи, а повернутий об’єкт :class:`.datetime` є простим." + +msgid "" +"If *tz* is not ``None``, it must be an instance of a :class:`tzinfo` " +"subclass, and the timestamp is converted to *tz*’s time zone." +msgstr "" +"Якщо *tz* не є ``None``, він має бути екземпляром підкласу :class:`tzinfo`, " +"а мітка часу перетворюється на часовий пояс *tz*." + +msgid "" +":meth:`fromtimestamp` may raise :exc:`OverflowError`, if the timestamp is " +"out of the range of values supported by the platform C :c:func:`localtime` " +"or :c:func:`gmtime` functions, and :exc:`OSError` on :c:func:`localtime` or :" +"c:func:`gmtime` failure. It's common for this to be restricted to years in " +"1970 through 2038. Note that on non-POSIX systems that include leap seconds " +"in their notion of a timestamp, leap seconds are ignored by :meth:" +"`fromtimestamp`, and then it's possible to have two timestamps differing by " +"a second that yield identical :class:`.datetime` objects. This method is " +"preferred over :meth:`utcfromtimestamp`." +msgstr "" +":meth:`fromtimestamp` може викликати :exc:`OverflowError`, якщо мітка часу " +"виходить за межі діапазону значень, які підтримуються функціями платформи C :" +"c:func:`localtime` або :c:func:`gmtime`, і :exc:`OSError` під час помилки :c:" +"func:`localtime` або :c:func:`gmtime`. Зазвичай це обмежується роками з 1970 " +"по 2038 рік. Зауважте, що в системах без POSIX, які включають високосні " +"секунди в своє поняття позначки часу, високосні секунди ігноруються :meth:" +"`fromtimestamp`, і тоді можна мати дві мітки часу, що відрізняються на " +"секунду, що дає ідентичні об’єкти :class:`.datetime`. Цей метод є кращим " +"перед :meth:`utcfromtimestamp`." + +msgid "" +"Raise :exc:`OverflowError` instead of :exc:`ValueError` if the timestamp is " +"out of the range of values supported by the platform C :c:func:`localtime` " +"or :c:func:`gmtime` functions. Raise :exc:`OSError` instead of :exc:" +"`ValueError` on :c:func:`localtime` or :c:func:`gmtime` failure." +msgstr "" +"Викликайте :exc:`OverflowError` замість :exc:`ValueError`, якщо позначка " +"часу виходить за межі діапазону значень, які підтримують функції C :c:func:" +"`localtime` або :c:func:`gmtime` платформи. Викликати :exc:`OSError` " +"замість :exc:`ValueError` у разі помилки :c:func:`localtime` або :c:func:" +"`gmtime`." + +msgid ":meth:`fromtimestamp` may return instances with :attr:`.fold` set to 1." +msgstr "" +":meth:`fromtimestamp` може повертати екземпляри з :attr:`.fold`, " +"встановленим на 1." + +msgid "" +"Return the UTC :class:`.datetime` corresponding to the POSIX timestamp, " +"with :attr:`.tzinfo` ``None``. (The resulting object is naive.)" +msgstr "" +"Повертає UTC :class:`.datetime`, що відповідає мітці часу POSIX, з :attr:`." +"tzinfo` ``None``. (Отриманий об’єкт наївний.)" + +msgid "" +"This may raise :exc:`OverflowError`, if the timestamp is out of the range of " +"values supported by the platform C :c:func:`gmtime` function, and :exc:" +"`OSError` on :c:func:`gmtime` failure. It's common for this to be restricted " +"to years in 1970 through 2038." +msgstr "" +"Це може спричинити помилку :exc:`OverflowError`, якщо позначка часу виходить " +"за межі значень, які підтримує функція платформи C :c:func:`gmtime`, і :exc:" +"`OSError` на :c:func:`gmtime` невдача. Зазвичай це обмежується роками з 1970 " +"по 2038 рік." + +msgid "To get an aware :class:`.datetime` object, call :meth:`fromtimestamp`::" +msgstr "" +"Щоб отримати відомий об’єкт :class:`.datetime`, викличте :meth:" +"`fromtimestamp`::" + +msgid "datetime.fromtimestamp(timestamp, timezone.utc)" +msgstr "" + +msgid "" +"On the POSIX compliant platforms, it is equivalent to the following " +"expression::" +msgstr "На POSIX-сумісних платформах це еквівалентно такому виразу::" + +msgid "" +"datetime(1970, 1, 1, tzinfo=timezone.utc) + timedelta(seconds=timestamp)" +msgstr "" + +msgid "" +"except the latter formula always supports the full years range: between :" +"const:`MINYEAR` and :const:`MAXYEAR` inclusive." +msgstr "" +"за винятком останньої формули, яка завжди підтримує повний діапазон років: " +"від :const:`MINYEAR` до :const:`MAXYEAR` включно." + +msgid "" +"Because naive ``datetime`` objects are treated by many ``datetime`` methods " +"as local times, it is preferred to use aware datetimes to represent times in " +"UTC. As such, the recommended way to create an object representing a " +"specific timestamp in UTC is by calling ``datetime.fromtimestamp(timestamp, " +"tz=timezone.utc)``." +msgstr "" +"Оскільки наївні об’єкти ``datetime`` розглядаються багатьма методами " +"``datetime`` як місцевий час, бажано використовувати відомі дати для " +"представлення часу в UTC. Таким чином, рекомендований спосіб створити " +"об’єкт, що представляє конкретну позначку часу в UTC, — це викликати " +"``datetime.fromtimestamp(timestamp, tz=timezone.utc)``." + +msgid "" +"Raise :exc:`OverflowError` instead of :exc:`ValueError` if the timestamp is " +"out of the range of values supported by the platform C :c:func:`gmtime` " +"function. Raise :exc:`OSError` instead of :exc:`ValueError` on :c:func:" +"`gmtime` failure." +msgstr "" +"Викликайте :exc:`OverflowError` замість :exc:`ValueError`, якщо позначка " +"часу виходить за межі діапазону значень, які підтримує функція C :c:func:" +"`gmtime` платформи. Викликати :exc:`OSError` замість :exc:`ValueError` у " +"разі помилки :c:func:`gmtime`." + +msgid "Use :meth:`datetime.fromtimestamp` with :const:`UTC` instead." +msgstr "" + +msgid "" +"Return the :class:`.datetime` corresponding to the proleptic Gregorian " +"ordinal, where January 1 of year 1 has ordinal 1. :exc:`ValueError` is " +"raised unless ``1 <= ordinal <= datetime.max.toordinal()``. The hour, " +"minute, second and microsecond of the result are all 0, and :attr:`.tzinfo` " +"is ``None``." +msgstr "" +"Повертає :class:`.datetime`, що відповідає пролептичному григоріанському " +"порядковому номеру, де 1 січня року 1 має порядковий номер 1. :exc:" +"`ValueError` виникає, якщо не ``1 <= порядковий <= datetime.max." +"toordinal()``. Година, хвилина, секунда та мікросекунда результату " +"дорівнюють 0, а :attr:`.tzinfo` — ``None``." + +msgid "" +"Return a new :class:`.datetime` object whose date components are equal to " +"the given :class:`date` object's, and whose time components are equal to the " +"given :class:`.time` object's. If the *tzinfo* argument is provided, its " +"value is used to set the :attr:`.tzinfo` attribute of the result, otherwise " +"the :attr:`~.time.tzinfo` attribute of the *time* argument is used. If the " +"*date* argument is a :class:`.datetime` object, its time components and :" +"attr:`.tzinfo` attributes are ignored." +msgstr "" + +msgid "" +"For any :class:`.datetime` object ``d``, ``d == datetime.combine(d.date(), d." +"time(), d.tzinfo)``." +msgstr "" + +msgid "Added the *tzinfo* argument." +msgstr "Додано аргумент *tzinfo*." + +msgid "" +"Return a :class:`.datetime` corresponding to a *date_string* in any valid " +"ISO 8601 format, with the following exceptions:" +msgstr "" + +msgid "Time zone offsets may have fractional seconds." +msgstr "" + +msgid "The ``T`` separator may be replaced by any single unicode character." +msgstr "" + +msgid "Fractional hours and minutes are not supported." +msgstr "" + +msgid "" +">>> from datetime import datetime\n" +">>> datetime.fromisoformat('2011-11-04')\n" +"datetime.datetime(2011, 11, 4, 0, 0)\n" +">>> datetime.fromisoformat('20111104')\n" +"datetime.datetime(2011, 11, 4, 0, 0)\n" +">>> datetime.fromisoformat('2011-11-04T00:05:23')\n" +"datetime.datetime(2011, 11, 4, 0, 5, 23)\n" +">>> datetime.fromisoformat('2011-11-04T00:05:23Z')\n" +"datetime.datetime(2011, 11, 4, 0, 5, 23, tzinfo=datetime.timezone.utc)\n" +">>> datetime.fromisoformat('20111104T000523')\n" +"datetime.datetime(2011, 11, 4, 0, 5, 23)\n" +">>> datetime.fromisoformat('2011-W01-2T00:05:23.283')\n" +"datetime.datetime(2011, 1, 4, 0, 5, 23, 283000)\n" +">>> datetime.fromisoformat('2011-11-04 00:05:23.283')\n" +"datetime.datetime(2011, 11, 4, 0, 5, 23, 283000)\n" +">>> datetime.fromisoformat('2011-11-04 00:05:23.283+00:00')\n" +"datetime.datetime(2011, 11, 4, 0, 5, 23, 283000, tzinfo=datetime.timezone." +"utc)\n" +">>> datetime.fromisoformat('2011-11-04T00:05:23+04:00')\n" +"datetime.datetime(2011, 11, 4, 0, 5, 23,\n" +" tzinfo=datetime.timezone(datetime.timedelta(seconds=14400)))" +msgstr "" + +msgid "" +"Previously, this method only supported formats that could be emitted by :" +"meth:`date.isoformat` or :meth:`datetime.isoformat`." +msgstr "" + +msgid "" +"Return a :class:`.datetime` corresponding to the ISO calendar date specified " +"by year, week and day. The non-date components of the datetime are populated " +"with their normal default values. This is the inverse of the function :meth:" +"`datetime.isocalendar`." +msgstr "" +"Повертає :class:`.datetime`, що відповідає календарній даті ISO, визначеній " +"роком, тижнем і днем. Компоненти datetime, що не є датою, заповнюються " +"стандартними значеннями за замовчуванням. Це зворотна функція :meth:" +"`datetime.isocalendar`." + +msgid "" +"Return a :class:`.datetime` corresponding to *date_string*, parsed according " +"to *format*." +msgstr "" +"Повертає :class:`.datetime`, що відповідає *рядку_дати*, розібраному " +"відповідно до *формату*." + +msgid "" +"If *format* does not contain microseconds or time zone information, this is " +"equivalent to::" +msgstr "" + +msgid "datetime(*(time.strptime(date_string, format)[0:6]))" +msgstr "" + +msgid "" +":exc:`ValueError` is raised if the date_string and format can't be parsed " +"by :func:`time.strptime` or if it returns a value which isn't a time tuple. " +"See also :ref:`strftime-strptime-behavior` and :meth:`datetime." +"fromisoformat`." +msgstr "" + +msgid "" +"If *format* specifies a day of month without a year a :exc:" +"`DeprecationWarning` is now emitted. This is to avoid a quadrennial leap " +"year bug in code seeking to parse only a month and day as the default year " +"used in absence of one in the format is not a leap year. Such *format* " +"values may raise an error as of Python 3.15. The workaround is to always " +"include a year in your *format*. If parsing *date_string* values that do " +"not have a year, explicitly add a year that is a leap year before parsing:" +msgstr "" + +msgid "" +">>> from datetime import datetime\n" +">>> date_string = \"02/29\"\n" +">>> when = datetime.strptime(f\"{date_string};1984\", \"%m/%d;%Y\") # " +"Avoids leap year bug.\n" +">>> when.strftime(\"%B %d\")\n" +"'February 29'" +msgstr "" + +msgid "" +"The earliest representable :class:`.datetime`, ``datetime(MINYEAR, 1, 1, " +"tzinfo=None)``." +msgstr "" +"Найраніший репрезентований :class:`.datetime`, ``datetime(MINYEAR, 1, 1, " +"tzinfo=None)``." + +msgid "" +"The latest representable :class:`.datetime`, ``datetime(MAXYEAR, 12, 31, 23, " +"59, 59, 999999, tzinfo=None)``." +msgstr "" +"Останній представлений :class:`.datetime`, ``datetime(MAXYEAR, 12, 31, 23, " +"59, 59, 999999, tzinfo=None)``." + +msgid "" +"The smallest possible difference between non-equal :class:`.datetime` " +"objects, ``timedelta(microseconds=1)``." +msgstr "" +"Найменша можлива різниця між нерівними об’єктами :class:`.datetime`, " +"``timedelta(microseconds=1)``." + +msgid "In ``range(24)``." +msgstr "У діапазоні (24)." + +msgid "In ``range(60)``." +msgstr "У ``діапазоні (60)``." + +msgid "In ``range(1000000)``." +msgstr "У ``діапазоні (1000 000)``." + +msgid "" +"The object passed as the *tzinfo* argument to the :class:`.datetime` " +"constructor, or ``None`` if none was passed." +msgstr "" +"Об’єкт передається як аргумент *tzinfo* конструктору :class:`.datetime` або " +"``None``, якщо жодного не було передано." + +msgid "" +"In ``[0, 1]``. Used to disambiguate wall times during a repeated interval. " +"(A repeated interval occurs when clocks are rolled back at the end of " +"daylight saving time or when the UTC offset for the current zone is " +"decreased for political reasons.) The values 0 and 1 represent, " +"respectively, the earlier and later of the two moments with the same wall " +"time representation." +msgstr "" + +msgid "``datetime2 = datetime1 + timedelta``" +msgstr "``datetime2 = datetime1 + timedelta``" + +msgid "\\(1)" +msgstr "\\(1)" + +msgid "``datetime2 = datetime1 - timedelta``" +msgstr "``datetime2 = datetime1 - timedelta``" + +msgid "\\(2)" +msgstr "\\(2)" + +msgid "``timedelta = datetime1 - datetime2``" +msgstr "``timedelta = datetime1 - datetime2``" + +msgid "``datetime1 == datetime2``" +msgstr "" + +msgid "``datetime1 != datetime2``" +msgstr "" + +msgid "``datetime1 < datetime2``" +msgstr "``датачас1 < датачас2``" + +msgid "``datetime1 > datetime2``" +msgstr "" + +msgid "``datetime1 <= datetime2``" +msgstr "" + +msgid "``datetime1 >= datetime2``" +msgstr "" + +msgid "" +"``datetime2`` is a duration of ``timedelta`` removed from ``datetime1``, " +"moving forward in time if ``timedelta.days > 0``, or backward if ``timedelta." +"days < 0``. The result has the same :attr:`~.datetime.tzinfo` attribute as " +"the input datetime, and ``datetime2 - datetime1 == timedelta`` after. :exc:" +"`OverflowError` is raised if ``datetime2.year`` would be smaller than :const:" +"`MINYEAR` or larger than :const:`MAXYEAR`. Note that no time zone " +"adjustments are done even if the input is an aware object." +msgstr "" + +msgid "" +"Computes the ``datetime2`` such that ``datetime2 + timedelta == datetime1``. " +"As for addition, the result has the same :attr:`~.datetime.tzinfo` attribute " +"as the input datetime, and no time zone adjustments are done even if the " +"input is aware." +msgstr "" + +msgid "" +"Subtraction of a :class:`.datetime` from a :class:`.datetime` is defined " +"only if both operands are naive, or if both are aware. If one is aware and " +"the other is naive, :exc:`TypeError` is raised." +msgstr "" +"Віднімання :class:`.datetime` від :class:`.datetime` визначається, лише якщо " +"обидва операнди наївні, або якщо обидва знають. Якщо один знає, а інший " +"наївний, виникає :exc:`TypeError`." + +msgid "" +"If both are naive, or both are aware and have the same :attr:`~.datetime." +"tzinfo` attribute, the :attr:`~.datetime.tzinfo` attributes are ignored, and " +"the result is a :class:`timedelta` object ``t`` such that ``datetime2 + t == " +"datetime1``. No time zone adjustments are done in this case." +msgstr "" + +msgid "" +"If both are aware and have different :attr:`~.datetime.tzinfo` attributes, " +"``a-b`` acts as if ``a`` and ``b`` were first converted to naive UTC " +"datetimes. The result is ``(a.replace(tzinfo=None) - a.utcoffset()) - (b." +"replace(tzinfo=None) - b.utcoffset())`` except that the implementation never " +"overflows." +msgstr "" + +msgid "" +":class:`.datetime` objects are equal if they represent the same date and " +"time, taking into account the time zone." +msgstr "" + +msgid "Naive and aware :class:`!datetime` objects are never equal." +msgstr "" + +msgid "" +"If both comparands are aware, and have the same :attr:`!tzinfo` attribute, " +"the :attr:`!tzinfo` and :attr:`~.datetime.fold` attributes are ignored and " +"the base datetimes are compared. If both comparands are aware and have " +"different :attr:`~.datetime.tzinfo` attributes, the comparison acts as " +"comparands were first converted to UTC datetimes except that the " +"implementation never overflows. :class:`!datetime` instances in a repeated " +"interval are never equal to :class:`!datetime` instances in other time zone." +msgstr "" + +msgid "" +"*datetime1* is considered less than *datetime2* when *datetime1* precedes " +"*datetime2* in time, taking into account the time zone." +msgstr "" + +msgid "" +"Order comparison between naive and aware :class:`.datetime` objects raises :" +"exc:`TypeError`." +msgstr "" + +msgid "" +"If both comparands are aware, and have the same :attr:`!tzinfo` attribute, " +"the :attr:`!tzinfo` and :attr:`~.datetime.fold` attributes are ignored and " +"the base datetimes are compared. If both comparands are aware and have " +"different :attr:`~.datetime.tzinfo` attributes, the comparison acts as " +"comparands were first converted to UTC datetimes except that the " +"implementation never overflows." +msgstr "" + +msgid "" +"Equality comparisons between aware and naive :class:`.datetime` instances " +"don't raise :exc:`TypeError`." +msgstr "" +"Порівняння рівності між обізнаними та наївними екземплярами :class:`." +"datetime` не викликає :exc:`TypeError`." + +msgid "Return :class:`date` object with same year, month and day." +msgstr "Повертає об’єкт :class:`date` з тим самим роком, місяцем і днем." + +msgid "" +"Return :class:`.time` object with same hour, minute, second, microsecond and " +"fold. :attr:`.tzinfo` is ``None``. See also method :meth:`timetz`." +msgstr "" +"Повертає об’єкт :class:`.time` із тією самою годиною, хвилиною, секундою, " +"мікросекундою та згортанням. :attr:`.tzinfo` — це ``None``. Дивіться також " +"метод :meth:`timetz`." + +msgid "The fold value is copied to the returned :class:`.time` object." +msgstr "Значення згортання копіюється до повернутого об’єкта :class:`.time`." + +msgid "" +"Return :class:`.time` object with same hour, minute, second, microsecond, " +"fold, and tzinfo attributes. See also method :meth:`time`." +msgstr "" +"Повертає об’єкт :class:`.time` з такими самими атрибутами: година, хвилина, " +"секунда, мікросекунда, згортання та tzinfo. Дивіться також метод :meth:" +"`time`." + +msgid "" +"Return a new :class:`datetime` object with the same attributes, but with " +"specified parameters updated. Note that ``tzinfo=None`` can be specified to " +"create a naive datetime from an aware datetime with no conversion of date " +"and time data." +msgstr "" + +msgid "" +":class:`.datetime` objects are also supported by generic function :func:" +"`copy.replace`." +msgstr "" + +msgid "" +"Return a :class:`.datetime` object with new :attr:`.tzinfo` attribute *tz*, " +"adjusting the date and time data so the result is the same UTC time as " +"*self*, but in *tz*'s local time." +msgstr "" +"Повертає об’єкт :class:`.datetime` з новим атрибутом :attr:`.tzinfo` *tz*, " +"регулюючи дані дати й часу таким чином, щоб результат був таким самим часом " +"UTC, як *self*, але в *tz* місцевий час." + +msgid "" +"If provided, *tz* must be an instance of a :class:`tzinfo` subclass, and " +"its :meth:`utcoffset` and :meth:`dst` methods must not return ``None``. If " +"*self* is naive, it is presumed to represent time in the system time zone." +msgstr "" + +msgid "" +"If called without arguments (or with ``tz=None``) the system local time zone " +"is assumed for the target time zone. The ``.tzinfo`` attribute of the " +"converted datetime instance will be set to an instance of :class:`timezone` " +"with the zone name and offset obtained from the OS." +msgstr "" + +msgid "" +"If ``self.tzinfo`` is *tz*, ``self.astimezone(tz)`` is equal to *self*: no " +"adjustment of date or time data is performed. Else the result is local time " +"in the time zone *tz*, representing the same UTC time as *self*: after " +"``astz = dt.astimezone(tz)``, ``astz - astz.utcoffset()`` will have the same " +"date and time data as ``dt - dt.utcoffset()``." +msgstr "" + +msgid "" +"If you merely want to attach a :class:`timezone` object *tz* to a datetime " +"*dt* without adjustment of date and time data, use ``dt." +"replace(tzinfo=tz)``. If you merely want to remove the :class:`!timezone` " +"object from an aware datetime *dt* without conversion of date and time data, " +"use ``dt.replace(tzinfo=None)``." +msgstr "" + +msgid "" +"Note that the default :meth:`tzinfo.fromutc` method can be overridden in a :" +"class:`tzinfo` subclass to affect the result returned by :meth:`astimezone`. " +"Ignoring error cases, :meth:`astimezone` acts like::" +msgstr "" +"Зауважте, що стандартний метод :meth:`tzinfo.fromutc` можна замінити в " +"підкласі :class:`tzinfo`, щоб вплинути на результат, який повертає :meth:" +"`astimezone`. Ігноруючи випадки помилок, :meth:`astimezone` діє як:" + +msgid "" +"def astimezone(self, tz):\n" +" if self.tzinfo is tz:\n" +" return self\n" +" # Convert self to UTC, and attach the new timezone object.\n" +" utc = (self - self.utcoffset()).replace(tzinfo=tz)\n" +" # Convert from UTC to tz's local time.\n" +" return tz.fromutc(utc)" +msgstr "" + +msgid "*tz* now can be omitted." +msgstr "*tz* тепер можна опустити." + +msgid "" +"The :meth:`astimezone` method can now be called on naive instances that are " +"presumed to represent system local time." +msgstr "" +"Метод :meth:`astimezone` тепер можна викликати в простих екземплярах, які, " +"як припускається, представляють місцевий час системи." + +msgid "" +"If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." +"utcoffset(self)``, and raises an exception if the latter doesn't return " +"``None`` or a :class:`timedelta` object with magnitude less than one day." +msgstr "" +"Якщо :attr:`.tzinfo` має значення ``None``, повертає ``None``, інакше " +"повертає ``self.tzinfo.utcoffset(self)`` і викликає виняток, якщо останній " +"не повертає ``None`` або об’єкт :class:`timedelta` з величиною менше одного " +"дня." + +msgid "The UTC offset is not restricted to a whole number of minutes." +msgstr "Зсув UTC не обмежений цілою кількістю хвилин." + +msgid "" +"If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." +"dst(self)``, and raises an exception if the latter doesn't return ``None`` " +"or a :class:`timedelta` object with magnitude less than one day." +msgstr "" +"Якщо :attr:`.tzinfo` має значення ``None``, повертає ``None``, інакше " +"повертає ``self.tzinfo.dst(self)`` і викликає виняток, якщо останній не " +"повертає ``None`` або об’єкт :class:`timedelta` з величиною менше одного дня." + +msgid "The DST offset is not restricted to a whole number of minutes." +msgstr "Зміщення літнього часу не обмежується цілою кількістю хвилин." + +msgid "" +"If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." +"tzname(self)``, raises an exception if the latter doesn't return ``None`` or " +"a string object," +msgstr "" +"Якщо :attr:`.tzinfo` має значення ``None``, повертає ``None``, інакше " +"повертає ``self.tzinfo.tzname(self)``, викликає виняток, якщо останній не " +"повертає ``None`` або рядковий об’єкт," + +msgid "" +"time.struct_time((d.year, d.month, d.day,\n" +" d.hour, d.minute, d.second,\n" +" d.weekday(), yday, dst))" +msgstr "" + +msgid "" +"where ``yday = d.toordinal() - date(d.year, 1, 1).toordinal() + 1`` is the " +"day number within the current year starting with 1 for January 1st. The :" +"attr:`~time.struct_time.tm_isdst` flag of the result is set according to " +"the :meth:`dst` method: :attr:`.tzinfo` is ``None`` or :meth:`dst` returns " +"``None``, :attr:`!tm_isdst` is set to ``-1``; else if :meth:`dst` returns a " +"non-zero value, :attr:`!tm_isdst` is set to 1; else :attr:`!tm_isdst` is set " +"to 0." +msgstr "" + +msgid "" +"If :class:`.datetime` instance ``d`` is naive, this is the same as ``d." +"timetuple()`` except that :attr:`~.time.struct_time.tm_isdst` is forced to 0 " +"regardless of what ``d.dst()`` returns. DST is never in effect for a UTC " +"time." +msgstr "" + +msgid "" +"If ``d`` is aware, ``d`` is normalized to UTC time, by subtracting ``d." +"utcoffset()``, and a :class:`time.struct_time` for the normalized time is " +"returned. :attr:`!tm_isdst` is forced to 0. Note that an :exc:" +"`OverflowError` may be raised if ``d.year`` was ``MINYEAR`` or ``MAXYEAR`` " +"and UTC adjustment spills over a year boundary." +msgstr "" + +msgid "" +"Because naive ``datetime`` objects are treated by many ``datetime`` methods " +"as local times, it is preferred to use aware datetimes to represent times in " +"UTC; as a result, using :meth:`datetime.utctimetuple` may give misleading " +"results. If you have a naive ``datetime`` representing UTC, use ``datetime." +"replace(tzinfo=timezone.utc)`` to make it aware, at which point you can use :" +"meth:`.datetime.timetuple`." +msgstr "" + +msgid "" +"Return the proleptic Gregorian ordinal of the date. The same as ``self." +"date().toordinal()``." +msgstr "" +"Повертає пролептичний григоріанський порядковий номер дати. Те саме, що " +"``self.date().toordinal()``." + +msgid "" +"Return POSIX timestamp corresponding to the :class:`.datetime` instance. The " +"return value is a :class:`float` similar to that returned by :func:`time." +"time`." +msgstr "" +"Повертає позначку часу POSIX, що відповідає екземпляру :class:`.datetime`. " +"Значення, що повертається, є :class:`float`, подібне до того, яке повертає :" +"func:`time.time`." + +msgid "" +"Naive :class:`.datetime` instances are assumed to represent local time and " +"this method relies on the platform C :c:func:`mktime` function to perform " +"the conversion. Since :class:`.datetime` supports wider range of values " +"than :c:func:`mktime` on many platforms, this method may raise :exc:" +"`OverflowError` or :exc:`OSError` for times far in the past or far in the " +"future." +msgstr "" + +msgid "" +"For aware :class:`.datetime` instances, the return value is computed as::" +msgstr "" +"Для екземплярів aware :class:`.datetime` значення, що повертається, " +"обчислюється як:" + +msgid "(dt - datetime(1970, 1, 1, tzinfo=timezone.utc)).total_seconds()" +msgstr "" + +msgid "" +"The :meth:`timestamp` method uses the :attr:`.fold` attribute to " +"disambiguate the times during a repeated interval." +msgstr "" +"Метод :meth:`timestamp` використовує атрибут :attr:`.fold`, щоб усунути " +"неоднозначність часу протягом повторюваного інтервалу." + +msgid "" +"There is no method to obtain the POSIX timestamp directly from a naive :" +"class:`.datetime` instance representing UTC time. If your application uses " +"this convention and your system time zone is not set to UTC, you can obtain " +"the POSIX timestamp by supplying ``tzinfo=timezone.utc``::" +msgstr "" + +msgid "timestamp = dt.replace(tzinfo=timezone.utc).timestamp()" +msgstr "" + +msgid "or by calculating the timestamp directly::" +msgstr "або шляхом безпосереднього обчислення позначки часу:" + +msgid "timestamp = (dt - datetime(1970, 1, 1)) / timedelta(seconds=1)" +msgstr "" + +msgid "" +"Return the day of the week as an integer, where Monday is 0 and Sunday is 6. " +"The same as ``self.date().weekday()``. See also :meth:`isoweekday`." +msgstr "" +"Повертає день тижня як ціле число, де понеділок дорівнює 0, а неділя – 6. Те " +"саме, що ``self.date().weekday()``. Дивіться також :meth:`isoweekday`." + +msgid "" +"Return the day of the week as an integer, where Monday is 1 and Sunday is 7. " +"The same as ``self.date().isoweekday()``. See also :meth:`weekday`, :meth:" +"`isocalendar`." +msgstr "" +"Повертає день тижня як ціле число, де понеділок — 1, а неділя — 7. Те саме, " +"що ``self.date().isoweekday()``. Дивіться також :meth:`weekday`, :meth:" +"`isocalendar`." + +msgid "" +"Return a :term:`named tuple` with three components: ``year``, ``week`` and " +"``weekday``. The same as ``self.date().isocalendar()``." +msgstr "" +"Повертає :term:`named tuple` із трьома компонентами: ``рік``, ``тиждень`` і " +"``день тижня``. Те саме, що ``self.date().isocalendar()``." + +msgid "Return a string representing the date and time in ISO 8601 format:" +msgstr "Повертає рядок, що представляє дату й час у форматі ISO 8601:" + +msgid "``YYYY-MM-DDTHH:MM:SS.ffffff``, if :attr:`microsecond` is not 0" +msgstr "``РРРР-ММ-ДДТГГ:ММ:СС.ffffff``, якщо :attr:`microsecond` не дорівнює 0" + +msgid "``YYYY-MM-DDTHH:MM:SS``, if :attr:`microsecond` is 0" +msgstr "``РРРР-ММ-ДДТГГ:ХМ:СС``, якщо :attr:`microsecond` дорівнює 0" + +msgid "" +"If :meth:`utcoffset` does not return ``None``, a string is appended, giving " +"the UTC offset:" +msgstr "" +"Якщо :meth:`utcoffset` не повертає ``None``, додається рядок із зміщенням " +"UTC:" + +msgid "" +"``YYYY-MM-DDTHH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` " +"is not 0" +msgstr "" +"``РРРР-ММ-ДДТГГ:ММ:СС.ffffff+ГГ:ММ[:СС[.ffffff]]``, якщо :attr:`microsecond` " +"не дорівнює 0" + +msgid "" +"``YYYY-MM-DDTHH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0" +msgstr "" +"``РРРР-ММ-ДДТГГ:ММ:СС+ГГ:ХМ[:СС[.ffffff]]``, якщо :attr:`microsecond` " +"дорівнює 0" + +msgid "" +">>> from datetime import datetime, timezone\n" +">>> datetime(2019, 5, 18, 15, 17, 8, 132263).isoformat()\n" +"'2019-05-18T15:17:08.132263'\n" +">>> datetime(2019, 5, 18, 15, 17, tzinfo=timezone.utc).isoformat()\n" +"'2019-05-18T15:17:00+00:00'" +msgstr "" + +msgid "" +"The optional argument *sep* (default ``'T'``) is a one-character separator, " +"placed between the date and time portions of the result. For example::" +msgstr "" +"Необов’язковий аргумент *sep* (за замовчуванням ``'T'``) є односимвольним " +"роздільником, який розміщується між частинами дати та часу результату. " +"Наприклад::" + +msgid "" +">>> from datetime import tzinfo, timedelta, datetime\n" +">>> class TZ(tzinfo):\n" +"... \"\"\"A time zone with an arbitrary, constant -06:39 offset.\"\"\"\n" +"... def utcoffset(self, dt):\n" +"... return timedelta(hours=-6, minutes=-39)\n" +"...\n" +">>> datetime(2002, 12, 25, tzinfo=TZ()).isoformat(' ')\n" +"'2002-12-25 00:00:00-06:39'\n" +">>> datetime(2009, 11, 27, microsecond=100, tzinfo=TZ()).isoformat()\n" +"'2009-11-27T00:00:00.000100-06:39'" +msgstr "" + +msgid "" +"The optional argument *timespec* specifies the number of additional " +"components of the time to include (the default is ``'auto'``). It can be one " +"of the following:" +msgstr "" +"Необов'язковий аргумент *timespec* визначає кількість додаткових компонентів " +"часу, які потрібно включити (за замовчуванням це ``'auto'``). Це може бути " +"одне з наступного:" + +msgid "" +"``'auto'``: Same as ``'seconds'`` if :attr:`microsecond` is 0, same as " +"``'microseconds'`` otherwise." +msgstr "" +"``'auto'``: те саме, що ``'seconds'``, якщо :attr:`microsecond` дорівнює 0, " +"те ж саме, що ``'microseconds'`` інакше." + +msgid "``'hours'``: Include the :attr:`hour` in the two-digit ``HH`` format." +msgstr "``'hours'``: Додайте :attr:`hour` у двозначному форматі ``HH``." + +msgid "" +"``'minutes'``: Include :attr:`hour` and :attr:`minute` in ``HH:MM`` format." +msgstr "" +"``'хвилини'``: включайте :attr:`hour` і :attr:`minute` у форматі ``ГГ:ХХ``." + +msgid "" +"``'seconds'``: Include :attr:`hour`, :attr:`minute`, and :attr:`second` in " +"``HH:MM:SS`` format." +msgstr "" +"``'seconds'``: включайте :attr:`hour`, :attr:`minute` і :attr:`second` у " +"форматі ``HH:MM:SS``." + +msgid "" +"``'milliseconds'``: Include full time, but truncate fractional second part " +"to milliseconds. ``HH:MM:SS.sss`` format." +msgstr "" +"``'milliseconds'``: включити повний час, але скоротити дробову другу частину " +"до мілісекунд. Формат ``HH:MM:SS.sss``." + +msgid "``'microseconds'``: Include full time in ``HH:MM:SS.ffffff`` format." +msgstr "``'microseconds'``: включіть повний час у форматі ``HH:MM:SS.ffffff``." + +msgid "Excluded time components are truncated, not rounded." +msgstr "Виключені компоненти часу скорочуються, а не округлюються." + +msgid ":exc:`ValueError` will be raised on an invalid *timespec* argument::" +msgstr ":exc:`ValueError` буде викликано через недійсний аргумент *timespec*::" + +msgid "" +">>> from datetime import datetime\n" +">>> datetime.now().isoformat(timespec='minutes')\n" +"'2002-12-25T00:00'\n" +">>> dt = datetime(2015, 1, 1, 12, 30, 59, 0)\n" +">>> dt.isoformat(timespec='microseconds')\n" +"'2015-01-01T12:30:59.000000'" +msgstr "" + +msgid "Added the *timespec* parameter." +msgstr "Додано параметр *специфікації часу*." + +msgid "" +"For a :class:`.datetime` instance ``d``, ``str(d)`` is equivalent to ``d." +"isoformat(' ')``." +msgstr "" +"Для екземпляра :class:`.datetime` ``d``, ``str(d)`` є еквівалентним до ``d." +"isoformat(' ')``." + +msgid "Return a string representing the date and time::" +msgstr "Повертає рядок, що представляє дату й час::" + +msgid "" +">>> from datetime import datetime\n" +">>> datetime(2002, 12, 4, 20, 30, 40).ctime()\n" +"'Wed Dec 4 20:30:40 2002'" +msgstr "" +">>> from datetime import datetime\n" +">>> datetime(2002, 12, 4, 20, 30, 40).ctime()\n" +"'Wed Dec 4 20:30:40 2002'" + +msgid "" +"The output string will *not* include time zone information, regardless of " +"whether the input is aware or naive." +msgstr "" +"Рядок виводу *не* включатиме інформацію про часовий пояс, незалежно від " +"того, чи є введення відомим чи простим." + +msgid "" +"on platforms where the native C :c:func:`ctime` function (which :func:`time." +"ctime` invokes, but which :meth:`datetime.ctime` does not invoke) conforms " +"to the C standard." +msgstr "" +"на платформах, де рідна функція C :c:func:`ctime` (яку :func:`time.ctime` " +"викликає, але яку :meth:`datetime.ctime` не викликає) відповідає стандарту C." + +msgid "" +"Return a string representing the date and time, controlled by an explicit " +"format string. See also :ref:`strftime-strptime-behavior` and :meth:" +"`datetime.isoformat`." +msgstr "" + +msgid "" +"Same as :meth:`.datetime.strftime`. This makes it possible to specify a " +"format string for a :class:`.datetime` object in :ref:`formatted string " +"literals ` and when using :meth:`str.format`. See also :ref:" +"`strftime-strptime-behavior` and :meth:`datetime.isoformat`." +msgstr "" + +msgid "Examples of Usage: :class:`.datetime`" +msgstr "Приклади використання: :class:`.datetime`" + +msgid "Examples of working with :class:`.datetime` objects:" +msgstr "" + +msgid "" +">>> from datetime import datetime, date, time, timezone\n" +"\n" +">>> # Using datetime.combine()\n" +">>> d = date(2005, 7, 14)\n" +">>> t = time(12, 30)\n" +">>> datetime.combine(d, t)\n" +"datetime.datetime(2005, 7, 14, 12, 30)\n" +"\n" +">>> # Using datetime.now()\n" +">>> datetime.now()\n" +"datetime.datetime(2007, 12, 6, 16, 29, 43, 79043) # GMT +1\n" +">>> datetime.now(timezone.utc)\n" +"datetime.datetime(2007, 12, 6, 15, 29, 43, 79060, tzinfo=datetime.timezone." +"utc)\n" +"\n" +">>> # Using datetime.strptime()\n" +">>> dt = datetime.strptime(\"21/11/06 16:30\", \"%d/%m/%y %H:%M\")\n" +">>> dt\n" +"datetime.datetime(2006, 11, 21, 16, 30)\n" +"\n" +">>> # Using datetime.timetuple() to get tuple of all attributes\n" +">>> tt = dt.timetuple()\n" +">>> for it in tt:\n" +"... print(it)\n" +"...\n" +"2006 # year\n" +"11 # month\n" +"21 # day\n" +"16 # hour\n" +"30 # minute\n" +"0 # second\n" +"1 # weekday (0 = Monday)\n" +"325 # number of days since 1st January\n" +"-1 # dst - method tzinfo.dst() returned None\n" +"\n" +">>> # Date in ISO format\n" +">>> ic = dt.isocalendar()\n" +">>> for it in ic:\n" +"... print(it)\n" +"...\n" +"2006 # ISO year\n" +"47 # ISO week\n" +"2 # ISO weekday\n" +"\n" +">>> # Formatting a datetime\n" +">>> dt.strftime(\"%A, %d. %B %Y %I:%M%p\")\n" +"'Tuesday, 21. November 2006 04:30PM'\n" +">>> 'The {1} is {0:%d}, the {2} is {0:%B}, the {3} is {0:%I:%M%p}.'." +"format(dt, \"day\", \"month\", \"time\")\n" +"'The day is 21, the month is November, the time is 04:30PM.'" +msgstr "" + +msgid "" +"The example below defines a :class:`tzinfo` subclass capturing time zone " +"information for Kabul, Afghanistan, which used +4 UTC until 1945 and then " +"+4:30 UTC thereafter::" +msgstr "" +"У наведеному нижче прикладі визначено підклас :class:`tzinfo`, який збирає " +"інформацію про часовий пояс для Кабула, Афганістан, який використовував +4 " +"UTC до 1945 року, а потім +4:30 UTC після цього::" + +msgid "" +"from datetime import timedelta, datetime, tzinfo, timezone\n" +"\n" +"class KabulTz(tzinfo):\n" +" # Kabul used +4 until 1945, when they moved to +4:30\n" +" UTC_MOVE_DATE = datetime(1944, 12, 31, 20, tzinfo=timezone.utc)\n" +"\n" +" def utcoffset(self, dt):\n" +" if dt.year < 1945:\n" +" return timedelta(hours=4)\n" +" elif (1945, 1, 1, 0, 0) <= dt.timetuple()[:5] < (1945, 1, 1, 0, " +"30):\n" +" # An ambiguous (\"imaginary\") half-hour range representing\n" +" # a 'fold' in time due to the shift from +4 to +4:30.\n" +" # If dt falls in the imaginary range, use fold to decide how\n" +" # to resolve. See PEP495.\n" +" return timedelta(hours=4, minutes=(30 if dt.fold else 0))\n" +" else:\n" +" return timedelta(hours=4, minutes=30)\n" +"\n" +" def fromutc(self, dt):\n" +" # Follow same validations as in datetime.tzinfo\n" +" if not isinstance(dt, datetime):\n" +" raise TypeError(\"fromutc() requires a datetime argument\")\n" +" if dt.tzinfo is not self:\n" +" raise ValueError(\"dt.tzinfo is not self\")\n" +"\n" +" # A custom implementation is required for fromutc as\n" +" # the input to this function is a datetime with utc values\n" +" # but with a tzinfo set to self.\n" +" # See datetime.astimezone or fromtimestamp.\n" +" if dt.replace(tzinfo=timezone.utc) >= self.UTC_MOVE_DATE:\n" +" return dt + timedelta(hours=4, minutes=30)\n" +" else:\n" +" return dt + timedelta(hours=4)\n" +"\n" +" def dst(self, dt):\n" +" # Kabul does not observe daylight saving time.\n" +" return timedelta(0)\n" +"\n" +" def tzname(self, dt):\n" +" if dt >= self.UTC_MOVE_DATE:\n" +" return \"+04:30\"\n" +" return \"+04\"" +msgstr "" +"from datetime import timedelta, datetime, tzinfo, timezone\n" +"\n" +"class KabulTz(tzinfo):\n" +" # Kabul used +4 until 1945, when they moved to +4:30\n" +" UTC_MOVE_DATE = datetime(1944, 12, 31, 20, tzinfo=timezone.utc)\n" +"\n" +" def utcoffset(self, dt):\n" +" if dt.year < 1945:\n" +" return timedelta(hours=4)\n" +" elif (1945, 1, 1, 0, 0) <= dt.timetuple()[:5] < (1945, 1, 1, 0, " +"30):\n" +" # An ambiguous (\"imaginary\") half-hour range representing\n" +" # a 'fold' in time due to the shift from +4 to +4:30.\n" +" # If dt falls in the imaginary range, use fold to decide how\n" +" # to resolve. See PEP495.\n" +" return timedelta(hours=4, minutes=(30 if dt.fold else 0))\n" +" else:\n" +" return timedelta(hours=4, minutes=30)\n" +"\n" +" def fromutc(self, dt):\n" +" # Follow same validations as in datetime.tzinfo\n" +" if not isinstance(dt, datetime):\n" +" raise TypeError(\"fromutc() requires a datetime argument\")\n" +" if dt.tzinfo is not self:\n" +" raise ValueError(\"dt.tzinfo is not self\")\n" +"\n" +" # A custom implementation is required for fromutc as\n" +" # the input to this function is a datetime with utc values\n" +" # but with a tzinfo set to self.\n" +" # See datetime.astimezone or fromtimestamp.\n" +" if dt.replace(tzinfo=timezone.utc) >= self.UTC_MOVE_DATE:\n" +" return dt + timedelta(hours=4, minutes=30)\n" +" else:\n" +" return dt + timedelta(hours=4)\n" +"\n" +" def dst(self, dt):\n" +" # Kabul does not observe daylight saving time.\n" +" return timedelta(0)\n" +"\n" +" def tzname(self, dt):\n" +" if dt >= self.UTC_MOVE_DATE:\n" +" return \"+04:30\"\n" +" return \"+04\"" + +msgid "Usage of ``KabulTz`` from above::" +msgstr "Використання ``KabulTz`` зверху::" + +msgid "" +">>> tz1 = KabulTz()\n" +"\n" +">>> # Datetime before the change\n" +">>> dt1 = datetime(1900, 11, 21, 16, 30, tzinfo=tz1)\n" +">>> print(dt1.utcoffset())\n" +"4:00:00\n" +"\n" +">>> # Datetime after the change\n" +">>> dt2 = datetime(2006, 6, 14, 13, 0, tzinfo=tz1)\n" +">>> print(dt2.utcoffset())\n" +"4:30:00\n" +"\n" +">>> # Convert datetime to another time zone\n" +">>> dt3 = dt2.astimezone(timezone.utc)\n" +">>> dt3\n" +"datetime.datetime(2006, 6, 14, 8, 30, tzinfo=datetime.timezone.utc)\n" +">>> dt2\n" +"datetime.datetime(2006, 6, 14, 13, 0, tzinfo=KabulTz())\n" +">>> dt2 == dt3\n" +"True" +msgstr "" +">>> tz1 = KabulTz()\n" +"\n" +">>> # Datetime before the change\n" +">>> dt1 = datetime(1900, 11, 21, 16, 30, tzinfo=tz1)\n" +">>> print(dt1.utcoffset())\n" +"4:00:00\n" +"\n" +">>> # Datetime after the change\n" +">>> dt2 = datetime(2006, 6, 14, 13, 0, tzinfo=tz1)\n" +">>> print(dt2.utcoffset())\n" +"4:30:00\n" +"\n" +">>> # Convert datetime to another time zone\n" +">>> dt3 = dt2.astimezone(timezone.utc)\n" +">>> dt3\n" +"datetime.datetime(2006, 6, 14, 8, 30, tzinfo=datetime.timezone.utc)\n" +">>> dt2\n" +"datetime.datetime(2006, 6, 14, 13, 0, tzinfo=KabulTz())\n" +">>> dt2 == dt3\n" +"True" + +msgid ":class:`.time` Objects" +msgstr ":class:`.time` Об'єкти" + +msgid "" +"A :class:`.time` object represents a (local) time of day, independent of any " +"particular day, and subject to adjustment via a :class:`tzinfo` object." +msgstr "" + +msgid "" +"All arguments are optional. *tzinfo* may be ``None``, or an instance of a :" +"class:`tzinfo` subclass. The remaining arguments must be integers in the " +"following ranges:" +msgstr "" +"Усі аргументи необов’язкові. *tzinfo* може бути ``None`` або екземпляром " +"підкласу :class:`tzinfo`. Решта аргументів мають бути цілими числами в таких " +"діапазонах:" + +msgid "" +"If an argument outside those ranges is given, :exc:`ValueError` is raised. " +"All default to 0 except *tzinfo*, which defaults to ``None``." +msgstr "" + +msgid "The earliest representable :class:`.time`, ``time(0, 0, 0, 0)``." +msgstr "Найперший представлений :class:`.time`, ``time(0, 0, 0, 0)``." + +msgid "The latest representable :class:`.time`, ``time(23, 59, 59, 999999)``." +msgstr "Останній представлений :class:`.time`, ``time(23, 59, 59, 999999)``." + +msgid "" +"The smallest possible difference between non-equal :class:`.time` objects, " +"``timedelta(microseconds=1)``, although note that arithmetic on :class:`." +"time` objects is not supported." +msgstr "" +"Найменша можлива різниця між нерівними об’єктами :class:`.time`, " +"``timedelta(microseconds=1)``, хоча зауважте, що арифметика в об’єктах :" +"class:`.time` не підтримується." + +msgid "" +"The object passed as the tzinfo argument to the :class:`.time` constructor, " +"or ``None`` if none was passed." +msgstr "" +"Об’єкт, переданий як аргумент tzinfo конструктору :class:`.time`, або " +"``None``, якщо жодного не було передано." + +msgid "" +":class:`.time` objects support equality and order comparisons, where ``a`` " +"is considered less than ``b`` when ``a`` precedes ``b`` in time." +msgstr "" + +msgid "" +"Naive and aware :class:`!time` objects are never equal. Order comparison " +"between naive and aware :class:`!time` objects raises :exc:`TypeError`." +msgstr "" + +msgid "" +"If both comparands are aware, and have the same :attr:`~.time.tzinfo` " +"attribute, the :attr:`!tzinfo` and :attr:`!fold` attributes are ignored and " +"the base times are compared. If both comparands are aware and have " +"different :attr:`!tzinfo` attributes, the comparands are first adjusted by " +"subtracting their UTC offsets (obtained from ``self.utcoffset()``)." +msgstr "" + +msgid "" +"Equality comparisons between aware and naive :class:`.time` instances don't " +"raise :exc:`TypeError`." +msgstr "" + +msgid "" +"In Boolean contexts, a :class:`.time` object is always considered to be true." +msgstr "" +"У логічних контекстах об’єкт :class:`.time` завжди вважається істинним." + +msgid "" +"Before Python 3.5, a :class:`.time` object was considered to be false if it " +"represented midnight in UTC. This behavior was considered obscure and error-" +"prone and has been removed in Python 3.5. See :issue:`13936` for full " +"details." +msgstr "" +"До Python 3.5 об’єкт :class:`.time` вважався хибним, якщо він представляв " +"північ за UTC. Така поведінка вважалася незрозумілою та спроможною до " +"помилок, і її було видалено в Python 3.5. Дивіться :issue:`13936` для " +"отримання повної інформації." + +msgid "Other constructor:" +msgstr "Інший конструктор:" + +msgid "" +"Return a :class:`.time` corresponding to a *time_string* in any valid ISO " +"8601 format, with the following exceptions:" +msgstr "" + +msgid "" +"The leading ``T``, normally required in cases where there may be ambiguity " +"between a date and a time, is not required." +msgstr "" + +msgid "" +"Fractional seconds may have any number of digits (anything beyond 6 will be " +"truncated)." +msgstr "" + +msgid "Examples:" +msgstr "Приклади:" + +msgid "" +">>> from datetime import time\n" +">>> time.fromisoformat('04:23:01')\n" +"datetime.time(4, 23, 1)\n" +">>> time.fromisoformat('T04:23:01')\n" +"datetime.time(4, 23, 1)\n" +">>> time.fromisoformat('T042301')\n" +"datetime.time(4, 23, 1)\n" +">>> time.fromisoformat('04:23:01.000384')\n" +"datetime.time(4, 23, 1, 384)\n" +">>> time.fromisoformat('04:23:01,000384')\n" +"datetime.time(4, 23, 1, 384)\n" +">>> time.fromisoformat('04:23:01+04:00')\n" +"datetime.time(4, 23, 1, tzinfo=datetime.timezone(datetime." +"timedelta(seconds=14400)))\n" +">>> time.fromisoformat('04:23:01Z')\n" +"datetime.time(4, 23, 1, tzinfo=datetime.timezone.utc)\n" +">>> time.fromisoformat('04:23:01+00:00')\n" +"datetime.time(4, 23, 1, tzinfo=datetime.timezone.utc)" +msgstr "" +">>> from datetime import time\n" +">>> time.fromisoformat('04:23:01')\n" +"datetime.time(4, 23, 1)\n" +">>> time.fromisoformat('T04:23:01')\n" +"datetime.time(4, 23, 1)\n" +">>> time.fromisoformat('T042301')\n" +"datetime.time(4, 23, 1)\n" +">>> time.fromisoformat('04:23:01.000384')\n" +"datetime.time(4, 23, 1, 384)\n" +">>> time.fromisoformat('04:23:01,000384')\n" +"datetime.time(4, 23, 1, 384)\n" +">>> time.fromisoformat('04:23:01+04:00')\n" +"datetime.time(4, 23, 1, tzinfo=datetime.timezone(datetime." +"timedelta(seconds=14400)))\n" +">>> time.fromisoformat('04:23:01Z')\n" +"datetime.time(4, 23, 1, tzinfo=datetime.timezone.utc)\n" +">>> time.fromisoformat('04:23:01+00:00')\n" +"datetime.time(4, 23, 1, tzinfo=datetime.timezone.utc)" + +msgid "" +"Previously, this method only supported formats that could be emitted by :" +"meth:`time.isoformat`." +msgstr "" + +msgid "" +"Return a new :class:`.time` with the same values, but with specified " +"parameters updated. Note that ``tzinfo=None`` can be specified to create a " +"naive :class:`.time` from an aware :class:`.time`, without conversion of the " +"time data." +msgstr "" + +msgid "" +":class:`.time` objects are also supported by generic function :func:`copy." +"replace`." +msgstr "" + +msgid "Return a string representing the time in ISO 8601 format, one of:" +msgstr "Повертає рядок, що представляє час у форматі ISO 8601, один із:" + +msgid "``HH:MM:SS.ffffff``, if :attr:`microsecond` is not 0" +msgstr "``HH:MM:SS.ffffff``, якщо :attr:`microsecond` не дорівнює 0" + +msgid "``HH:MM:SS``, if :attr:`microsecond` is 0" +msgstr "``ГГ:ХХ:СС``, якщо :attr:`microsecond` дорівнює 0" + +msgid "" +"``HH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :meth:`utcoffset` does not " +"return ``None``" +msgstr "" +"``HH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, якщо :meth:`utcoffset` не повертає " +"``None``" + +msgid "" +"``HH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0 and :meth:" +"`utcoffset` does not return ``None``" +msgstr "" +"``ГГ:ХМ:СС+ГГ:ХМ[:СС[.ffffff]]``, якщо :attr:`microsecond` дорівнює 0 і :" +"meth:`utcoffset` не повертає ``None``" + +msgid ":exc:`ValueError` will be raised on an invalid *timespec* argument." +msgstr ":exc:`ValueError` буде викликано через недійсний аргумент *timespec*." + +msgid "" +">>> from datetime import time\n" +">>> time(hour=12, minute=34, second=56, microsecond=123456)." +"isoformat(timespec='minutes')\n" +"'12:34'\n" +">>> dt = time(hour=12, minute=34, second=56, microsecond=0)\n" +">>> dt.isoformat(timespec='microseconds')\n" +"'12:34:56.000000'\n" +">>> dt.isoformat(timespec='auto')\n" +"'12:34:56'" +msgstr "" +">>> from datetime import time\n" +">>> time(hour=12, minute=34, second=56, microsecond=123456)." +"isoformat(timespec='minutes')\n" +"'12:34'\n" +">>> dt = time(hour=12, minute=34, second=56, microsecond=0)\n" +">>> dt.isoformat(timespec='microseconds')\n" +"'12:34:56.000000'\n" +">>> dt.isoformat(timespec='auto')\n" +"'12:34:56'" + +msgid "For a time ``t``, ``str(t)`` is equivalent to ``t.isoformat()``." +msgstr "" + +msgid "" +"Return a string representing the time, controlled by an explicit format " +"string. See also :ref:`strftime-strptime-behavior` and :meth:`time." +"isoformat`." +msgstr "" + +msgid "" +"Same as :meth:`.time.strftime`. This makes it possible to specify a format " +"string for a :class:`.time` object in :ref:`formatted string literals ` and when using :meth:`str.format`. See also :ref:`strftime-" +"strptime-behavior` and :meth:`time.isoformat`." +msgstr "" + +msgid "" +"If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." +"utcoffset(None)``, and raises an exception if the latter doesn't return " +"``None`` or a :class:`timedelta` object with magnitude less than one day." +msgstr "" +"Якщо :attr:`.tzinfo` має значення ``None``, повертає ``None``, інакше " +"повертає ``self.tzinfo.utcoffset(None)`` і викликає виняток, якщо останній " +"не повертає ``None`` або об’єкт :class:`timedelta` з величиною менше одного " +"дня." + +msgid "" +"If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." +"dst(None)``, and raises an exception if the latter doesn't return ``None``, " +"or a :class:`timedelta` object with magnitude less than one day." +msgstr "" +"Якщо :attr:`.tzinfo` має значення ``None``, повертає ``None``, інакше " +"повертає ``self.tzinfo.dst(None)`` і викликає виняток, якщо останній не " +"повертає ``None`` або об’єкт :class:`timedelta` з величиною менше одного дня." + +msgid "" +"If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." +"tzname(None)``, or raises an exception if the latter doesn't return ``None`` " +"or a string object." +msgstr "" +"Якщо :attr:`.tzinfo` має значення ``None``, повертає ``None``, інакше " +"повертає ``self.tzinfo.tzname(None)`` або викликає виняток, якщо останній не " +"повертає ``None`` або рядковий об’єкт." + +msgid "Examples of Usage: :class:`.time`" +msgstr "Приклади використання: :class:`.time`" + +msgid "Examples of working with a :class:`.time` object::" +msgstr "Приклади роботи з об'єктом :class:`.time`::" + +msgid "" +">>> from datetime import time, tzinfo, timedelta\n" +">>> class TZ1(tzinfo):\n" +"... def utcoffset(self, dt):\n" +"... return timedelta(hours=1)\n" +"... def dst(self, dt):\n" +"... return timedelta(0)\n" +"... def tzname(self,dt):\n" +"... return \"+01:00\"\n" +"... def __repr__(self):\n" +"... return f\"{self.__class__.__name__}()\"\n" +"...\n" +">>> t = time(12, 10, 30, tzinfo=TZ1())\n" +">>> t\n" +"datetime.time(12, 10, 30, tzinfo=TZ1())\n" +">>> t.isoformat()\n" +"'12:10:30+01:00'\n" +">>> t.dst()\n" +"datetime.timedelta(0)\n" +">>> t.tzname()\n" +"'+01:00'\n" +">>> t.strftime(\"%H:%M:%S %Z\")\n" +"'12:10:30 +01:00'\n" +">>> 'The {} is {:%H:%M}.'.format(\"time\", t)\n" +"'The time is 12:10.'" +msgstr "" +">>> from datetime import time, tzinfo, timedelta\n" +">>> class TZ1(tzinfo):\n" +"... def utcoffset(self, dt):\n" +"... return timedelta(hours=1)\n" +"... def dst(self, dt):\n" +"... return timedelta(0)\n" +"... def tzname(self,dt):\n" +"... return \"+01:00\"\n" +"... def __repr__(self):\n" +"... return f\"{self.__class__.__name__}()\"\n" +"...\n" +">>> t = time(12, 10, 30, tzinfo=TZ1())\n" +">>> t\n" +"datetime.time(12, 10, 30, tzinfo=TZ1())\n" +">>> t.isoformat()\n" +"'12:10:30+01:00'\n" +">>> t.dst()\n" +"datetime.timedelta(0)\n" +">>> t.tzname()\n" +"'+01:00'\n" +">>> t.strftime(\"%H:%M:%S %Z\")\n" +"'12:10:30 +01:00'\n" +">>> 'The {} is {:%H:%M}.'.format(\"time\", t)\n" +"'The time is 12:10.'" + +msgid ":class:`tzinfo` Objects" +msgstr ":class:`tzinfo` Об'єкти" + +msgid "" +"This is an abstract base class, meaning that this class should not be " +"instantiated directly. Define a subclass of :class:`tzinfo` to capture " +"information about a particular time zone." +msgstr "" +"Це абстрактний базовий клас, що означає, що цей клас не повинен створюватися " +"безпосередньо. Визначте підклас :class:`tzinfo` для отримання інформації про " +"певний часовий пояс." + +msgid "" +"An instance of (a concrete subclass of) :class:`tzinfo` can be passed to the " +"constructors for :class:`.datetime` and :class:`.time` objects. The latter " +"objects view their attributes as being in local time, and the :class:" +"`tzinfo` object supports methods revealing offset of local time from UTC, " +"the name of the time zone, and DST offset, all relative to a date or time " +"object passed to them." +msgstr "" +"Екземпляр (конкретного підкласу) :class:`tzinfo` можна передати " +"конструкторам для об’єктів :class:`.datetime` і :class:`.time`. Останні " +"об’єкти розглядають свої атрибути як місцевий час, а об’єкт :class:`tzinfo` " +"підтримує методи, які виявляють зміщення місцевого часу від UTC, назви " +"часового поясу та зміщення літнього часу, усе відносно об’єкта дати чи часу " +"передано їм." + +msgid "" +"You need to derive a concrete subclass, and (at least) supply " +"implementations of the standard :class:`tzinfo` methods needed by the :class:" +"`.datetime` methods you use. The :mod:`!datetime` module provides :class:" +"`timezone`, a simple concrete subclass of :class:`tzinfo` which can " +"represent time zones with fixed offset from UTC such as UTC itself or North " +"American EST and EDT." +msgstr "" + +msgid "" +"Special requirement for pickling: A :class:`tzinfo` subclass must have an :" +"meth:`~object.__init__` method that can be called with no arguments, " +"otherwise it can be pickled but possibly not unpickled again. This is a " +"technical requirement that may be relaxed in the future." +msgstr "" + +msgid "" +"A concrete subclass of :class:`tzinfo` may need to implement the following " +"methods. Exactly which methods are needed depends on the uses made of aware :" +"mod:`!datetime` objects. If in doubt, simply implement all of them." +msgstr "" + +msgid "" +"Return offset of local time from UTC, as a :class:`timedelta` object that is " +"positive east of UTC. If local time is west of UTC, this should be negative." +msgstr "" +"Повертає зміщення місцевого часу від UTC, як об’єкт :class:`timedelta`, який " +"є позитивним на схід від UTC. Якщо місцевий час на захід від UTC, це " +"значення має бути від’ємним." + +msgid "" +"This represents the *total* offset from UTC; for example, if a :class:" +"`tzinfo` object represents both time zone and DST adjustments, :meth:" +"`utcoffset` should return their sum. If the UTC offset isn't known, return " +"``None``. Else the value returned must be a :class:`timedelta` object " +"strictly between ``-timedelta(hours=24)`` and ``timedelta(hours=24)`` (the " +"magnitude of the offset must be less than one day). Most implementations of :" +"meth:`utcoffset` will probably look like one of these two::" +msgstr "" +"Це *загальне* зміщення від UTC; наприклад, якщо об’єкт :class:`tzinfo` " +"представляє коригування часового поясу та літнього часу, :meth:`utcoffset` " +"має повернути їх суму. Якщо зсув UTC невідомий, поверніть ``None``. Інакше " +"повернене значення має бути об’єктом :class:`timedelta` строго між ``-" +"timedelta(hours=24)`` і ``timedelta(hours=24)`` (величина зміщення має бути " +"меншою за один день ). Більшість реалізацій :meth:`utcoffset`, ймовірно, " +"виглядатимуть як одне з цих двох:" + +msgid "" +"return CONSTANT # fixed-offset class\n" +"return CONSTANT + self.dst(dt) # daylight-aware class" +msgstr "" + +msgid "" +"If :meth:`utcoffset` does not return ``None``, :meth:`dst` should not return " +"``None`` either." +msgstr "" +"Якщо :meth:`utcoffset` не повертає ``None``, :meth:`dst` також не має " +"повертати ``None``." + +msgid "" +"The default implementation of :meth:`utcoffset` raises :exc:" +"`NotImplementedError`." +msgstr "" +"Стандартна реалізація :meth:`utcoffset` викликає :exc:`NotImplementedError`." + +msgid "" +"Return the daylight saving time (DST) adjustment, as a :class:`timedelta` " +"object or ``None`` if DST information isn't known." +msgstr "" +"Повертає коригування літнього часу (DST) як об’єкт :class:`timedelta` або " +"``None``, якщо інформація про літній час невідома." + +msgid "" +"Return ``timedelta(0)`` if DST is not in effect. If DST is in effect, return " +"the offset as a :class:`timedelta` object (see :meth:`utcoffset` for " +"details). Note that DST offset, if applicable, has already been added to the " +"UTC offset returned by :meth:`utcoffset`, so there's no need to consult :" +"meth:`dst` unless you're interested in obtaining DST info separately. For " +"example, :meth:`datetime.timetuple` calls its :attr:`~.datetime.tzinfo` " +"attribute's :meth:`dst` method to determine how the :attr:`~time.struct_time." +"tm_isdst` flag should be set, and :meth:`tzinfo.fromutc` calls :meth:`dst` " +"to account for DST changes when crossing time zones." +msgstr "" + +msgid "" +"An instance *tz* of a :class:`tzinfo` subclass that models both standard and " +"daylight times must be consistent in this sense:" +msgstr "" +"Екземпляр *tz* підкласу :class:`tzinfo`, який моделює як стандартний, так і " +"денний час, має бути послідовним у цьому сенсі:" + +msgid "``tz.utcoffset(dt) - tz.dst(dt)``" +msgstr "``tz.utcoffset(dt) - tz.dst(dt)``" + +msgid "" +"must return the same result for every :class:`.datetime` *dt* with ``dt." +"tzinfo == tz``. For sane :class:`tzinfo` subclasses, this expression yields " +"the time zone's \"standard offset\", which should not depend on the date or " +"the time, but only on geographic location. The implementation of :meth:" +"`datetime.astimezone` relies on this, but cannot detect violations; it's the " +"programmer's responsibility to ensure it. If a :class:`tzinfo` subclass " +"cannot guarantee this, it may be able to override the default implementation " +"of :meth:`tzinfo.fromutc` to work correctly with :meth:`~.datetime." +"astimezone` regardless." +msgstr "" + +msgid "" +"Most implementations of :meth:`dst` will probably look like one of these " +"two::" +msgstr "" +"Більшість реалізацій :meth:`dst`, ймовірно, виглядатимуть як одна з цих двох:" + +msgid "" +"def dst(self, dt):\n" +" # a fixed-offset class: doesn't account for DST\n" +" return timedelta(0)" +msgstr "" + +msgid "or::" +msgstr "або::" + +msgid "" +"def dst(self, dt):\n" +" # Code to set dston and dstoff to the time zone's DST\n" +" # transition times based on the input dt.year, and expressed\n" +" # in standard local time.\n" +"\n" +" if dston <= dt.replace(tzinfo=None) < dstoff:\n" +" return timedelta(hours=1)\n" +" else:\n" +" return timedelta(0)" +msgstr "" + +msgid "" +"The default implementation of :meth:`dst` raises :exc:`NotImplementedError`." +msgstr "Стандартна реалізація :meth:`dst` викликає :exc:`NotImplementedError`." + +msgid "" +"Return the time zone name corresponding to the :class:`.datetime` object " +"*dt*, as a string. Nothing about string names is defined by the :mod:`!" +"datetime` module, and there's no requirement that it mean anything in " +"particular. For example, ``\"GMT\"``, ``\"UTC\"``, ``\"-500\"``, " +"``\"-5:00\"``, ``\"EDT\"``, ``\"US/Eastern\"``, ``\"America/New York\"`` are " +"all valid replies. Return ``None`` if a string name isn't known. Note that " +"this is a method rather than a fixed string primarily because some :class:" +"`tzinfo` subclasses will wish to return different names depending on the " +"specific value of *dt* passed, especially if the :class:`tzinfo` class is " +"accounting for daylight time." +msgstr "" + +msgid "" +"The default implementation of :meth:`tzname` raises :exc:" +"`NotImplementedError`." +msgstr "" +"Стандартна реалізація :meth:`tzname` викликає :exc:`NotImplementedError`." + +msgid "" +"These methods are called by a :class:`.datetime` or :class:`.time` object, " +"in response to their methods of the same names. A :class:`.datetime` object " +"passes itself as the argument, and a :class:`.time` object passes ``None`` " +"as the argument. A :class:`tzinfo` subclass's methods should therefore be " +"prepared to accept a *dt* argument of ``None``, or of class :class:`." +"datetime`." +msgstr "" +"Ці методи викликаються об’єктом :class:`.datetime` або :class:`.time` у " +"відповідь на їх однойменні методи. Об’єкт :class:`.datetime` передає себе як " +"аргумент, а об’єкт :class:`.time` передає ``None`` як аргумент. Таким чином, " +"методи підкласу :class:`tzinfo` повинні бути готові прийняти аргумент *dt* " +"``None`` або клас :class:`.datetime`." + +msgid "" +"When ``None`` is passed, it's up to the class designer to decide the best " +"response. For example, returning ``None`` is appropriate if the class wishes " +"to say that time objects don't participate in the :class:`tzinfo` protocols. " +"It may be more useful for ``utcoffset(None)`` to return the standard UTC " +"offset, as there is no other convention for discovering the standard offset." +msgstr "" +"Коли передається ``None``, розробник класу вирішує найкращу відповідь. " +"Наприклад, повернення ``None`` є доцільним, якщо клас хоче сказати, що " +"об’єкти часу не беруть участі в протоколах :class:`tzinfo`. Може бути " +"кориснішим для ``utcoffset(None)`` повертати стандартне зміщення UTC, " +"оскільки немає іншої угоди для виявлення стандартного зсуву." + +msgid "" +"When a :class:`.datetime` object is passed in response to a :class:`." +"datetime` method, ``dt.tzinfo`` is the same object as *self*. :class:" +"`tzinfo` methods can rely on this, unless user code calls :class:`tzinfo` " +"methods directly. The intent is that the :class:`tzinfo` methods interpret " +"*dt* as being in local time, and not need worry about objects in other time " +"zones." +msgstr "" + +msgid "" +"There is one more :class:`tzinfo` method that a subclass may wish to " +"override:" +msgstr "" +"Є ще один метод :class:`tzinfo`, який підклас може захотіти перевизначити:" + +msgid "" +"This is called from the default :meth:`datetime.astimezone` implementation. " +"When called from that, ``dt.tzinfo`` is *self*, and *dt*'s date and time " +"data are to be viewed as expressing a UTC time. The purpose of :meth:" +"`fromutc` is to adjust the date and time data, returning an equivalent " +"datetime in *self*'s local time." +msgstr "" + +msgid "" +"Most :class:`tzinfo` subclasses should be able to inherit the default :meth:" +"`fromutc` implementation without problems. It's strong enough to handle " +"fixed-offset time zones, and time zones accounting for both standard and " +"daylight time, and the latter even if the DST transition times differ in " +"different years. An example of a time zone the default :meth:`fromutc` " +"implementation may not handle correctly in all cases is one where the " +"standard offset (from UTC) depends on the specific date and time passed, " +"which can happen for political reasons. The default implementations of :meth:" +"`~.datetime.astimezone` and :meth:`fromutc` may not produce the result you " +"want if the result is one of the hours straddling the moment the standard " +"offset changes." +msgstr "" + +msgid "" +"Skipping code for error cases, the default :meth:`fromutc` implementation " +"acts like::" +msgstr "" +"Пропускаючи код для випадків помилки, реалізація за замовчуванням :meth:" +"`fromutc` діє як:" + +msgid "" +"def fromutc(self, dt):\n" +" # raise ValueError error if dt.tzinfo is not self\n" +" dtoff = dt.utcoffset()\n" +" dtdst = dt.dst()\n" +" # raise ValueError if dtoff is None or dtdst is None\n" +" delta = dtoff - dtdst # this is self's standard offset\n" +" if delta:\n" +" dt += delta # convert to standard local time\n" +" dtdst = dt.dst()\n" +" # raise ValueError if dtdst is None\n" +" if dtdst:\n" +" return dt + dtdst\n" +" else:\n" +" return dt" +msgstr "" + +msgid "" +"In the following :download:`tzinfo_examples.py <../includes/tzinfo_examples." +"py>` file there are some examples of :class:`tzinfo` classes:" +msgstr "" +"У наступному файлі :download:`tzinfo_examples.py <../includes/" +"tzinfo_examples.py>` є кілька прикладів класів :class:`tzinfo`:" + +msgid "" +"from datetime import tzinfo, timedelta, datetime\n" +"\n" +"ZERO = timedelta(0)\n" +"HOUR = timedelta(hours=1)\n" +"SECOND = timedelta(seconds=1)\n" +"\n" +"# A class capturing the platform's idea of local time.\n" +"# (May result in wrong values on historical times in\n" +"# timezones where UTC offset and/or the DST rules had\n" +"# changed in the past.)\n" +"import time as _time\n" +"\n" +"STDOFFSET = timedelta(seconds = -_time.timezone)\n" +"if _time.daylight:\n" +" DSTOFFSET = timedelta(seconds = -_time.altzone)\n" +"else:\n" +" DSTOFFSET = STDOFFSET\n" +"\n" +"DSTDIFF = DSTOFFSET - STDOFFSET\n" +"\n" +"class LocalTimezone(tzinfo):\n" +"\n" +" def fromutc(self, dt):\n" +" assert dt.tzinfo is self\n" +" stamp = (dt - datetime(1970, 1, 1, tzinfo=self)) // SECOND\n" +" args = _time.localtime(stamp)[:6]\n" +" dst_diff = DSTDIFF // SECOND\n" +" # Detect fold\n" +" fold = (args == _time.localtime(stamp - dst_diff))\n" +" return datetime(*args, microsecond=dt.microsecond,\n" +" tzinfo=self, fold=fold)\n" +"\n" +" def utcoffset(self, dt):\n" +" if self._isdst(dt):\n" +" return DSTOFFSET\n" +" else:\n" +" return STDOFFSET\n" +"\n" +" def dst(self, dt):\n" +" if self._isdst(dt):\n" +" return DSTDIFF\n" +" else:\n" +" return ZERO\n" +"\n" +" def tzname(self, dt):\n" +" return _time.tzname[self._isdst(dt)]\n" +"\n" +" def _isdst(self, dt):\n" +" tt = (dt.year, dt.month, dt.day,\n" +" dt.hour, dt.minute, dt.second,\n" +" dt.weekday(), 0, 0)\n" +" stamp = _time.mktime(tt)\n" +" tt = _time.localtime(stamp)\n" +" return tt.tm_isdst > 0\n" +"\n" +"Local = LocalTimezone()\n" +"\n" +"\n" +"# A complete implementation of current DST rules for major US time zones.\n" +"\n" +"def first_sunday_on_or_after(dt):\n" +" days_to_go = 6 - dt.weekday()\n" +" if days_to_go:\n" +" dt += timedelta(days_to_go)\n" +" return dt\n" +"\n" +"\n" +"# US DST Rules\n" +"#\n" +"# This is a simplified (i.e., wrong for a few cases) set of rules for US\n" +"# DST start and end times. For a complete and up-to-date set of DST rules\n" +"# and timezone definitions, visit the Olson Database (or try pytz):\n" +"# http://www.twinsun.com/tz/tz-link.htm\n" +"# https://sourceforge.net/projects/pytz/ (might not be up-to-date)\n" +"#\n" +"# In the US, since 2007, DST starts at 2am (standard time) on the second\n" +"# Sunday in March, which is the first Sunday on or after Mar 8.\n" +"DSTSTART_2007 = datetime(1, 3, 8, 2)\n" +"# and ends at 2am (DST time) on the first Sunday of Nov.\n" +"DSTEND_2007 = datetime(1, 11, 1, 2)\n" +"# From 1987 to 2006, DST used to start at 2am (standard time) on the first\n" +"# Sunday in April and to end at 2am (DST time) on the last\n" +"# Sunday of October, which is the first Sunday on or after Oct 25.\n" +"DSTSTART_1987_2006 = datetime(1, 4, 1, 2)\n" +"DSTEND_1987_2006 = datetime(1, 10, 25, 2)\n" +"# From 1967 to 1986, DST used to start at 2am (standard time) on the last\n" +"# Sunday in April (the one on or after April 24) and to end at 2am (DST " +"time)\n" +"# on the last Sunday of October, which is the first Sunday\n" +"# on or after Oct 25.\n" +"DSTSTART_1967_1986 = datetime(1, 4, 24, 2)\n" +"DSTEND_1967_1986 = DSTEND_1987_2006\n" +"\n" +"def us_dst_range(year):\n" +" # Find start and end times for US DST. For years before 1967, return\n" +" # start = end for no DST.\n" +" if 2006 < year:\n" +" dststart, dstend = DSTSTART_2007, DSTEND_2007\n" +" elif 1986 < year < 2007:\n" +" dststart, dstend = DSTSTART_1987_2006, DSTEND_1987_2006\n" +" elif 1966 < year < 1987:\n" +" dststart, dstend = DSTSTART_1967_1986, DSTEND_1967_1986\n" +" else:\n" +" return (datetime(year, 1, 1), ) * 2\n" +"\n" +" start = first_sunday_on_or_after(dststart.replace(year=year))\n" +" end = first_sunday_on_or_after(dstend.replace(year=year))\n" +" return start, end\n" +"\n" +"\n" +"class USTimeZone(tzinfo):\n" +"\n" +" def __init__(self, hours, reprname, stdname, dstname):\n" +" self.stdoffset = timedelta(hours=hours)\n" +" self.reprname = reprname\n" +" self.stdname = stdname\n" +" self.dstname = dstname\n" +"\n" +" def __repr__(self):\n" +" return self.reprname\n" +"\n" +" def tzname(self, dt):\n" +" if self.dst(dt):\n" +" return self.dstname\n" +" else:\n" +" return self.stdname\n" +"\n" +" def utcoffset(self, dt):\n" +" return self.stdoffset + self.dst(dt)\n" +"\n" +" def dst(self, dt):\n" +" if dt is None or dt.tzinfo is None:\n" +" # An exception may be sensible here, in one or both cases.\n" +" # It depends on how you want to treat them. The default\n" +" # fromutc() implementation (called by the default astimezone()\n" +" # implementation) passes a datetime with dt.tzinfo is self.\n" +" return ZERO\n" +" assert dt.tzinfo is self\n" +" start, end = us_dst_range(dt.year)\n" +" # Can't compare naive to aware objects, so strip the timezone from\n" +" # dt first.\n" +" dt = dt.replace(tzinfo=None)\n" +" if start + HOUR <= dt < end - HOUR:\n" +" # DST is in effect.\n" +" return HOUR\n" +" if end - HOUR <= dt < end:\n" +" # Fold (an ambiguous hour): use dt.fold to disambiguate.\n" +" return ZERO if dt.fold else HOUR\n" +" if start <= dt < start + HOUR:\n" +" # Gap (a non-existent hour): reverse the fold rule.\n" +" return HOUR if dt.fold else ZERO\n" +" # DST is off.\n" +" return ZERO\n" +"\n" +" def fromutc(self, dt):\n" +" assert dt.tzinfo is self\n" +" start, end = us_dst_range(dt.year)\n" +" start = start.replace(tzinfo=self)\n" +" end = end.replace(tzinfo=self)\n" +" std_time = dt + self.stdoffset\n" +" dst_time = std_time + HOUR\n" +" if end <= dst_time < end + HOUR:\n" +" # Repeated hour\n" +" return std_time.replace(fold=1)\n" +" if std_time < start or dst_time >= end:\n" +" # Standard time\n" +" return std_time\n" +" if start <= std_time < end - HOUR:\n" +" # Daylight saving time\n" +" return dst_time\n" +"\n" +"\n" +"Eastern = USTimeZone(-5, \"Eastern\", \"EST\", \"EDT\")\n" +"Central = USTimeZone(-6, \"Central\", \"CST\", \"CDT\")\n" +"Mountain = USTimeZone(-7, \"Mountain\", \"MST\", \"MDT\")\n" +"Pacific = USTimeZone(-8, \"Pacific\", \"PST\", \"PDT\")\n" +msgstr "" + +msgid "" +"Note that there are unavoidable subtleties twice per year in a :class:" +"`tzinfo` subclass accounting for both standard and daylight time, at the DST " +"transition points. For concreteness, consider US Eastern (UTC -0500), where " +"EDT begins the minute after 1:59 (EST) on the second Sunday in March, and " +"ends the minute after 1:59 (EDT) on the first Sunday in November::" +msgstr "" +"Зауважте, що є неминучі тонкощі двічі на рік у підкласі :class:`tzinfo`, що " +"враховує як стандартний, так і денний час, у точках переходу на літній час. " +"Для конкретності розглянемо Східну США (UTC -0500), де EDT починається через " +"хвилину після 1:59 (EST) у другу неділю березня та закінчується через " +"хвилину після 1:59 (EST) у першу неділю листопада:" + +msgid "" +" UTC 3:MM 4:MM 5:MM 6:MM 7:MM 8:MM\n" +" EST 22:MM 23:MM 0:MM 1:MM 2:MM 3:MM\n" +" EDT 23:MM 0:MM 1:MM 2:MM 3:MM 4:MM\n" +"\n" +"start 22:MM 23:MM 0:MM 1:MM 3:MM 4:MM\n" +"\n" +" end 23:MM 0:MM 1:MM 1:MM 2:MM 3:MM" +msgstr "" + +msgid "" +"When DST starts (the \"start\" line), the local wall clock leaps from 1:59 " +"to 3:00. A wall time of the form 2:MM doesn't really make sense on that day, " +"so ``astimezone(Eastern)`` won't deliver a result with ``hour == 2`` on the " +"day DST begins. For example, at the Spring forward transition of 2016, we " +"get::" +msgstr "" +"Коли починається літній час (рядок \"початок\"), місцевий настінний годинник " +"переходить з 1:59 на 3:00. Настінний час у формі 2:MM насправді не має сенсу " +"в цей день, тому ``astimezone(Eastern)`` не надасть результат з ``hour == " +"2`` у день початку літнього часу. Наприклад, під час весняного переходу " +"вперед 2016 року ми отримуємо:" + +msgid "" +">>> from datetime import datetime, timezone\n" +">>> from tzinfo_examples import HOUR, Eastern\n" +">>> u0 = datetime(2016, 3, 13, 5, tzinfo=timezone.utc)\n" +">>> for i in range(4):\n" +"... u = u0 + i*HOUR\n" +"... t = u.astimezone(Eastern)\n" +"... print(u.time(), 'UTC =', t.time(), t.tzname())\n" +"...\n" +"05:00:00 UTC = 00:00:00 EST\n" +"06:00:00 UTC = 01:00:00 EST\n" +"07:00:00 UTC = 03:00:00 EDT\n" +"08:00:00 UTC = 04:00:00 EDT" +msgstr "" + +msgid "" +"When DST ends (the \"end\" line), there's a potentially worse problem: " +"there's an hour that can't be spelled unambiguously in local wall time: the " +"last hour of daylight time. In Eastern, that's times of the form 5:MM UTC on " +"the day daylight time ends. The local wall clock leaps from 1:59 (daylight " +"time) back to 1:00 (standard time) again. Local times of the form 1:MM are " +"ambiguous. :meth:`~.datetime.astimezone` mimics the local clock's behavior " +"by mapping two adjacent UTC hours into the same local hour then. In the " +"Eastern example, UTC times of the form 5:MM and 6:MM both map to 1:MM when " +"converted to Eastern, but earlier times have the :attr:`~.datetime.fold` " +"attribute set to 0 and the later times have it set to 1. For example, at the " +"Fall back transition of 2016, we get::" +msgstr "" + +msgid "" +">>> u0 = datetime(2016, 11, 6, 4, tzinfo=timezone.utc)\n" +">>> for i in range(4):\n" +"... u = u0 + i*HOUR\n" +"... t = u.astimezone(Eastern)\n" +"... print(u.time(), 'UTC =', t.time(), t.tzname(), t.fold)\n" +"...\n" +"04:00:00 UTC = 00:00:00 EDT 0\n" +"05:00:00 UTC = 01:00:00 EDT 0\n" +"06:00:00 UTC = 01:00:00 EST 1\n" +"07:00:00 UTC = 02:00:00 EST 0" +msgstr "" + +msgid "" +"Note that the :class:`.datetime` instances that differ only by the value of " +"the :attr:`~.datetime.fold` attribute are considered equal in comparisons." +msgstr "" + +msgid "" +"Applications that can't bear wall-time ambiguities should explicitly check " +"the value of the :attr:`~.datetime.fold` attribute or avoid using hybrid :" +"class:`tzinfo` subclasses; there are no ambiguities when using :class:" +"`timezone`, or any other fixed-offset :class:`tzinfo` subclass (such as a " +"class representing only EST (fixed offset -5 hours), or only EDT (fixed " +"offset -4 hours))." +msgstr "" + +msgid ":mod:`zoneinfo`" +msgstr ":mod:`zoneinfo`" + +msgid "" +"The :mod:`!datetime` module has a basic :class:`timezone` class (for " +"handling arbitrary fixed offsets from UTC) and its :attr:`timezone.utc` " +"attribute (a UTC :class:`!timezone` instance)." +msgstr "" + +msgid "" +"``zoneinfo`` brings the *IANA time zone database* (also known as the Olson " +"database) to Python, and its usage is recommended." +msgstr "" + +msgid "`IANA time zone database `_" +msgstr "" + +msgid "" +"The Time Zone Database (often called tz, tzdata or zoneinfo) contains code " +"and data that represent the history of local time for many representative " +"locations around the globe. It is updated periodically to reflect changes " +"made by political bodies to time zone boundaries, UTC offsets, and daylight-" +"saving rules." +msgstr "" +"База даних часових поясів (часто називається tz, tzdata або zoneinfo) " +"містить код і дані, які представляють історію місцевого часу для багатьох " +"репрезентативних місць у всьому світі. Він періодично оновлюється, щоб " +"відобразити зміни, внесені політичними органами в межі часових поясів, " +"зміщення UTC і правила переходу на літній час." + +msgid ":class:`timezone` Objects" +msgstr ":class:`timezone` Об'єкти" + +msgid "" +"The :class:`timezone` class is a subclass of :class:`tzinfo`, each instance " +"of which represents a time zone defined by a fixed offset from UTC." +msgstr "" + +msgid "" +"Objects of this class cannot be used to represent time zone information in " +"the locations where different offsets are used in different days of the year " +"or where historical changes have been made to civil time." +msgstr "" + +msgid "" +"The *offset* argument must be specified as a :class:`timedelta` object " +"representing the difference between the local time and UTC. It must be " +"strictly between ``-timedelta(hours=24)`` and ``timedelta(hours=24)``, " +"otherwise :exc:`ValueError` is raised." +msgstr "" +"Аргумент *offset* має бути вказаний як об’єкт :class:`timedelta`, що " +"представляє різницю між місцевим часом і UTC. Воно має бути між ``-" +"timedelta(hours=24)`` і ``timedelta(hours=24)``, інакше :exc:`ValueError` " +"викликається." + +msgid "" +"The *name* argument is optional. If specified it must be a string that will " +"be used as the value returned by the :meth:`datetime.tzname` method." +msgstr "" +"Аргумент *name* необов’язковий. Якщо вказано, це має бути рядок, який " +"використовуватиметься як значення, яке повертає метод :meth:`datetime." +"tzname`." + +msgid "" +"Return the fixed value specified when the :class:`timezone` instance is " +"constructed." +msgstr "" +"Повертає фіксоване значення, указане під час створення екземпляра :class:" +"`timezone`." + +msgid "" +"The *dt* argument is ignored. The return value is a :class:`timedelta` " +"instance equal to the difference between the local time and UTC." +msgstr "" +"Аргумент *dt* ігнорується. Повернене значення є екземпляром :class:" +"`timedelta`, що дорівнює різниці між місцевим часом і UTC." + +msgid "" +"If *name* is not provided in the constructor, the name returned by " +"``tzname(dt)`` is generated from the value of the ``offset`` as follows. If " +"*offset* is ``timedelta(0)``, the name is \"UTC\", otherwise it is a string " +"in the format ``UTC±HH:MM``, where ± is the sign of ``offset``, HH and MM " +"are two digits of ``offset.hours`` and ``offset.minutes`` respectively." +msgstr "" +"Якщо *name* не вказано в конструкторі, ім’я, яке повертає ``tzname(dt)``, " +"генерується зі значення ``offset`` наступним чином. Якщо *offset* дорівнює " +"``timedelta(0)``, ім'я - \"UTC\", інакше це рядок у форматі ``UTC±HH:MM``, " +"де ± є знаком ``offset`` , HH і MM – це дві цифри ``offset.hours`` і " +"``offset.minutes`` відповідно." + +msgid "" +"Name generated from ``offset=timedelta(0)`` is now plain ``'UTC'``, not " +"``'UTC+00:00'``." +msgstr "" + +msgid "Always returns ``None``." +msgstr "Завжди повертає ``None``." + +msgid "" +"Return ``dt + offset``. The *dt* argument must be an aware :class:`." +"datetime` instance, with ``tzinfo`` set to ``self``." +msgstr "" +"Повернути ``dt + offset``. Аргумент *dt* має бути відомим екземпляром :class:" +"`.datetime` із значенням ``tzinfo`` значення ``self``." + +msgid "The UTC time zone, ``timezone(timedelta(0))``." +msgstr "" + +msgid ":meth:`~.datetime.strftime` and :meth:`~.datetime.strptime` Behavior" +msgstr "" + +msgid "" +":class:`date`, :class:`.datetime`, and :class:`.time` objects all support a " +"``strftime(format)`` method, to create a string representing the time under " +"the control of an explicit format string." +msgstr "" +"Об’єкти :class:`date`, :class:`.datetime` і :class:`.time` підтримують метод " +"``strftime(format)`` для створення рядка, що представляє час під контролем " +"явного рядок форматування." + +msgid "" +"Conversely, the :meth:`datetime.strptime` class method creates a :class:`." +"datetime` object from a string representing a date and time and a " +"corresponding format string." +msgstr "" +"І навпаки, метод класу :meth:`datetime.strptime` створює об’єкт :class:`." +"datetime` із рядка, що представляє дату й час, і відповідного рядка формату." + +msgid "" +"The table below provides a high-level comparison of :meth:`~.datetime." +"strftime` versus :meth:`~.datetime.strptime`:" +msgstr "" + +msgid "``strftime``" +msgstr "``strftime``" + +msgid "``strptime``" +msgstr "``strptime``" + +msgid "Usage" +msgstr "Використання" + +msgid "Convert object to a string according to a given format" +msgstr "Перетворити об’єкт на рядок відповідно до заданого формату" + +msgid "" +"Parse a string into a :class:`.datetime` object given a corresponding format" +msgstr "Розібрати рядок у об’єкт :class:`.datetime` із відповідним форматом" + +msgid "Type of method" +msgstr "Тип методу" + +msgid "Instance method" +msgstr "Метод екземпляра" + +msgid "Class method" +msgstr "Метод класу" + +msgid "Method of" +msgstr "Метод" + +msgid ":class:`date`; :class:`.datetime`; :class:`.time`" +msgstr ":class:`date`; :class:`.datetime`; :class:`.time`" + +msgid ":class:`.datetime`" +msgstr ":class:`.datetime`" + +msgid "Signature" +msgstr "Підпис" + +msgid "``strftime(format)``" +msgstr "``strftime(format)``" + +msgid "``strptime(date_string, format)``" +msgstr "``strptime(date_string, format)``" + +msgid "" +":meth:`~.datetime.strftime` and :meth:`~.datetime.strptime` Format Codes" +msgstr "" + +msgid "" +"These methods accept format codes that can be used to parse and format " +"dates::" +msgstr "" + +msgid "" +">>> datetime.strptime('31/01/22 23:59:59.999999',\n" +"... '%d/%m/%y %H:%M:%S.%f')\n" +"datetime.datetime(2022, 1, 31, 23, 59, 59, 999999)\n" +">>> _.strftime('%a %d %b %Y, %I:%M%p')\n" +"'Mon 31 Jan 2022, 11:59PM'" +msgstr "" + +msgid "" +"The following is a list of all the format codes that the 1989 C standard " +"requires, and these work on all platforms with a standard C implementation." +msgstr "" +"Нижче наведено список усіх кодів форматів, яких вимагає стандарт C 1989 " +"року, і вони працюють на всіх платформах зі стандартною реалізацією C." + +msgid "Directive" +msgstr "Директива" + +msgid "Meaning" +msgstr "Значення" + +msgid "Example" +msgstr "приклад" + +msgid "Notes" +msgstr "Примітки" + +msgid "``%a``" +msgstr "``%a``" + +msgid "Weekday as locale's abbreviated name." +msgstr "День тижня як скорочена назва локалі." + +msgid "Sun, Mon, ..., Sat (en_US);" +msgstr "Нд, Пн, ..., Сб (en_US);" + +msgid "So, Mo, ..., Sa (de_DE)" +msgstr "Отже, Пн, ..., Сб (de_DE)" + +msgid "``%A``" +msgstr "``%A``" + +msgid "Weekday as locale's full name." +msgstr "День тижня як повна назва локалі." + +msgid "Sunday, Monday, ..., Saturday (en_US);" +msgstr "неділя, понеділок, ..., субота (en_US);" + +msgid "Sonntag, Montag, ..., Samstag (de_DE)" +msgstr "Sonntag, Montag, ..., Samstag (de_DE)" + +msgid "``%w``" +msgstr "``%w``" + +msgid "Weekday as a decimal number, where 0 is Sunday and 6 is Saturday." +msgstr "День тижня як десяткове число, де 0 – неділя, а 6 – субота." + +msgid "0, 1, ..., 6" +msgstr "0, 1, ..., 6" + +msgid "``%d``" +msgstr "``%d``" + +msgid "Day of the month as a zero-padded decimal number." +msgstr "День місяця як десяткове число з доповненням нуля." + +msgid "01, 02, ..., 31" +msgstr "01, 02, ..., 31" + +msgid "\\(9)" +msgstr "\\(9)" + +msgid "``%b``" +msgstr "``%b``" + +msgid "Month as locale's abbreviated name." +msgstr "Місяць як скорочена назва локалі." + +msgid "Jan, Feb, ..., Dec (en_US);" +msgstr "січ, лютий, ..., грудень (en_US);" + +msgid "Jan, Feb, ..., Dez (de_DE)" +msgstr "січ, лютий, ..., дек (de_DE)" + +msgid "``%B``" +msgstr "``%B``" + +msgid "Month as locale's full name." +msgstr "Місяць як повна назва локалі." + +msgid "January, February, ..., December (en_US);" +msgstr "січень, лютий, ..., грудень (en_US);" + +msgid "Januar, Februar, ..., Dezember (de_DE)" +msgstr "січень, лютий, ..., грудень (de_DE)" + +msgid "``%m``" +msgstr "``%m``" + +msgid "Month as a zero-padded decimal number." +msgstr "Місяць як десяткове число з доповненням нуля." + +msgid "01, 02, ..., 12" +msgstr "01, 02, ..., 12" + +msgid "``%y``" +msgstr "``%y``" + +msgid "Year without century as a zero-padded decimal number." +msgstr "Рік без століття як десяткове число з доповненням нуля." + +msgid "00, 01, ..., 99" +msgstr "00, 01, ..., 99" + +msgid "``%Y``" +msgstr "``%Y``" + +msgid "Year with century as a decimal number." +msgstr "Рік із століттям як десяткове число." + +msgid "0001, 0002, ..., 2013, 2014, ..., 9998, 9999" +msgstr "0001, 0002, ..., 2013, 2014, ..., 9998, 9999" + +msgid "``%H``" +msgstr "``%H``" + +msgid "Hour (24-hour clock) as a zero-padded decimal number." +msgstr "Година (24-годинний формат) як десяткове число з доповненням нуля." + +msgid "00, 01, ..., 23" +msgstr "00, 01, ..., 23" + +msgid "``%I``" +msgstr "``%I``" + +msgid "Hour (12-hour clock) as a zero-padded decimal number." +msgstr "Година (12-годинний годинник) як десяткове число з доповненням нуля." + +msgid "``%p``" +msgstr "``%p``" + +msgid "Locale's equivalent of either AM or PM." +msgstr "Локальний еквівалент AM або PM." + +msgid "AM, PM (en_US);" +msgstr "AM, PM (en_US);" + +msgid "am, pm (de_DE)" +msgstr "am, pm (de_DE)" + +msgid "\\(1), \\(3)" +msgstr "\\(1), \\(3)" + +msgid "``%M``" +msgstr "``%M``" + +msgid "Minute as a zero-padded decimal number." +msgstr "Хвилина як десяткове число з доповненням нуля." + +msgid "00, 01, ..., 59" +msgstr "00, 01, ..., 59" + +msgid "``%S``" +msgstr "``%S``" + +msgid "Second as a zero-padded decimal number." +msgstr "Секунда як десяткове число з доповненням нуля." + +msgid "\\(4), \\(9)" +msgstr "\\(4), \\(9)" + +msgid "``%f``" +msgstr "``%f``" + +msgid "Microsecond as a decimal number, zero-padded to 6 digits." +msgstr "Мікросекунда як десяткове число, доповнене нулями до 6 цифр." + +msgid "000000, 000001, ..., 999999" +msgstr "000000, 000001, ..., 999999" + +msgid "\\(5)" +msgstr "\\(5)" + +msgid "``%z``" +msgstr "``%z``" + +msgid "" +"UTC offset in the form ``±HHMM[SS[.ffffff]]`` (empty string if the object is " +"naive)." +msgstr "" +"Зміщення UTC у формі ``±HHMM[SS[.ffffff]]`` (порожній рядок, якщо об’єкт " +"наївний)." + +msgid "(empty), +0000, -0400, +1030, +063415, -030712.345216" +msgstr "(порожній), +0000, -0400, +1030, +063415, -030712.345216" + +msgid "\\(6)" +msgstr "\\(6)" + +msgid "``%Z``" +msgstr "``%Z``" + +msgid "Time zone name (empty string if the object is naive)." +msgstr "Назва часового поясу (пустий рядок, якщо об’єкт наївний)." + +msgid "(empty), UTC, GMT" +msgstr "(пусто), UTC, GMT" + +msgid "``%j``" +msgstr "``%j``" + +msgid "Day of the year as a zero-padded decimal number." +msgstr "День року як десяткове число з доповненням нуля." + +msgid "001, 002, ..., 366" +msgstr "001, 002, ..., 366" + +msgid "``%U``" +msgstr "``%U``" + +msgid "" +"Week number of the year (Sunday as the first day of the week) as a zero-" +"padded decimal number. All days in a new year preceding the first Sunday are " +"considered to be in week 0." +msgstr "" +"Номер тижня року (неділя як перший день тижня) як десяткове число з " +"доповненням нуля. Усі дні в новому році, що передують першій неділі, " +"вважаються нульовим тижнем." + +msgid "00, 01, ..., 53" +msgstr "00, 01, ..., 53" + +msgid "\\(7), \\(9)" +msgstr "\\(7), \\(9)" + +msgid "``%W``" +msgstr "``%W``" + +msgid "" +"Week number of the year (Monday as the first day of the week) as a zero-" +"padded decimal number. All days in a new year preceding the first Monday are " +"considered to be in week 0." +msgstr "" +"Номер тижня року (понеділок як перший день тижня) як десяткове число з " +"доповненням нуля. Усі дні в новому році, що передують першому понеділку, " +"вважаються нульовим тижнем." + +msgid "``%c``" +msgstr "``%c``" + +msgid "Locale's appropriate date and time representation." +msgstr "Відповідне представлення дати та часу в локалі." + +msgid "Tue Aug 16 21:30:00 1988 (en_US);" +msgstr "Tue Aug 16 21:30:00 1988 (en_US);" + +msgid "Di 16 Aug 21:30:00 1988 (de_DE)" +msgstr "16 серпня 21:30:00 1988 (de_DE)" + +msgid "``%x``" +msgstr "``%x``" + +msgid "Locale's appropriate date representation." +msgstr "Відповідне представлення дати в локалі." + +msgid "08/16/88 (None);" +msgstr "16.08.88 (немає);" + +msgid "08/16/1988 (en_US);" +msgstr "16.08.1988 (en_US);" + +msgid "16.08.1988 (de_DE)" +msgstr "16.08.1988 (de_DE)" + +msgid "``%X``" +msgstr "``%X``" + +msgid "Locale's appropriate time representation." +msgstr "Відповідне представлення часу локалі." + +msgid "21:30:00 (en_US);" +msgstr "21:30:00 (en_US);" + +msgid "21:30:00 (de_DE)" +msgstr "21:30:00 (de_DE)" + +msgid "``%%``" +msgstr "``%%``" + +msgid "A literal ``'%'`` character." +msgstr "Буквальний символ ``'%''``." + +msgid "%" +msgstr "%" + +msgid "" +"Several additional directives not required by the C89 standard are included " +"for convenience. These parameters all correspond to ISO 8601 date values." +msgstr "" +"Для зручності включено кілька додаткових директив, які не вимагаються " +"стандартом C89. Усі ці параметри відповідають значенням дати ISO 8601." + +msgid "``%G``" +msgstr "``%G``" + +msgid "" +"ISO 8601 year with century representing the year that contains the greater " +"part of the ISO week (``%V``)." +msgstr "" +"Рік ISO 8601 із століттям, що представляє рік, який містить більшу частину " +"тижня ISO (``%V``)." + +msgid "\\(8)" +msgstr "\\(8)" + +msgid "``%u``" +msgstr "``%u``" + +msgid "ISO 8601 weekday as a decimal number where 1 is Monday." +msgstr "День тижня ISO 8601 як десяткове число, де 1 означає понеділок." + +msgid "1, 2, ..., 7" +msgstr "1, 2, ..., 7" + +msgid "``%V``" +msgstr "``%V``" + +msgid "" +"ISO 8601 week as a decimal number with Monday as the first day of the week. " +"Week 01 is the week containing Jan 4." +msgstr "" +"ISO 8601 тиждень як десяткове число з понеділком як першим днем тижня. " +"Тиждень 01 – це тиждень, що містить 4 січня." + +msgid "01, 02, ..., 53" +msgstr "01, 02, ..., 53" + +msgid "\\(8), \\(9)" +msgstr "\\(8), \\(9)" + +msgid "``%:z``" +msgstr "" + +msgid "" +"UTC offset in the form ``±HH:MM[:SS[.ffffff]]`` (empty string if the object " +"is naive)." +msgstr "" + +msgid "(empty), +00:00, -04:00, +10:30, +06:34:15, -03:07:12.345216" +msgstr "" + +msgid "" +"These may not be available on all platforms when used with the :meth:`~." +"datetime.strftime` method. The ISO 8601 year and ISO 8601 week directives " +"are not interchangeable with the year and week number directives above. " +"Calling :meth:`~.datetime.strptime` with incomplete or ambiguous ISO 8601 " +"directives will raise a :exc:`ValueError`." +msgstr "" + +msgid "" +"The full set of format codes supported varies across platforms, because " +"Python calls the platform C library's :c:func:`strftime` function, and " +"platform variations are common. To see the full set of format codes " +"supported on your platform, consult the :manpage:`strftime(3)` " +"documentation. There are also differences between platforms in handling of " +"unsupported format specifiers." +msgstr "" + +msgid "``%G``, ``%u`` and ``%V`` were added." +msgstr "Додано ``%G``, ``%u`` і ``%V``." + +msgid "``%:z`` was added." +msgstr "" + +msgid "Technical Detail" +msgstr "Технічні деталі" + +msgid "" +"Broadly speaking, ``d.strftime(fmt)`` acts like the :mod:`time` module's " +"``time.strftime(fmt, d.timetuple())`` although not all objects support a :" +"meth:`~date.timetuple` method." +msgstr "" + +msgid "" +"For the :meth:`.datetime.strptime` class method, the default value is " +"``1900-01-01T00:00:00.000``: any components not specified in the format " +"string will be pulled from the default value. [#]_" +msgstr "" + +msgid "Using ``datetime.strptime(date_string, format)`` is equivalent to::" +msgstr "Використання ``datetime.strptime(date_string, format)`` еквівалентно:" + +msgid "" +"except when the format includes sub-second components or time zone offset " +"information, which are supported in ``datetime.strptime`` but are discarded " +"by ``time.strptime``." +msgstr "" + +msgid "" +"For :class:`.time` objects, the format codes for year, month, and day should " +"not be used, as :class:`!time` objects have no such values. If they're used " +"anyway, 1900 is substituted for the year, and 1 for the month and day." +msgstr "" + +msgid "" +"For :class:`date` objects, the format codes for hours, minutes, seconds, and " +"microseconds should not be used, as :class:`date` objects have no such " +"values. If they're used anyway, 0 is substituted for them." +msgstr "" + +msgid "" +"For the same reason, handling of format strings containing Unicode code " +"points that can't be represented in the charset of the current locale is " +"also platform-dependent. On some platforms such code points are preserved " +"intact in the output, while on others ``strftime`` may raise :exc:" +"`UnicodeError` or return an empty string instead." +msgstr "" +"З тієї ж причини обробка рядків формату, що містять кодові точки Юнікоду, " +"які не можуть бути представлені в наборі символів поточної локалі, також " +"залежить від платформи. На деяких платформах такі кодові точки зберігаються " +"недоторканими у виводі, тоді як на інших ``strftime`` може викликати :exc:" +"`UnicodeError` або замість цього повертати порожній рядок." + +msgid "" +"Because the format depends on the current locale, care should be taken when " +"making assumptions about the output value. Field orderings will vary (for " +"example, \"month/day/year\" versus \"day/month/year\"), and the output may " +"contain non-ASCII characters." +msgstr "" + +msgid "" +"The :meth:`~.datetime.strptime` method can parse years in the full [1, 9999] " +"range, but years < 1000 must be zero-filled to 4-digit width." +msgstr "" + +msgid "" +"In previous versions, :meth:`~.datetime.strftime` method was restricted to " +"years >= 1900." +msgstr "" + +msgid "" +"In version 3.2, :meth:`~.datetime.strftime` method was restricted to years " +">= 1000." +msgstr "" + +msgid "" +"When used with the :meth:`~.datetime.strptime` method, the ``%p`` directive " +"only affects the output hour field if the ``%I`` directive is used to parse " +"the hour." +msgstr "" + +msgid "" +"Unlike the :mod:`time` module, the :mod:`!datetime` module does not support " +"leap seconds." +msgstr "" + +msgid "" +"When used with the :meth:`~.datetime.strptime` method, the ``%f`` directive " +"accepts from one to six digits and zero pads on the right. ``%f`` is an " +"extension to the set of format characters in the C standard (but implemented " +"separately in datetime objects, and therefore always available)." +msgstr "" + +msgid "" +"For a naive object, the ``%z``, ``%:z`` and ``%Z`` format codes are replaced " +"by empty strings." +msgstr "" + +msgid "For an aware object:" +msgstr "Для обізнаного об’єкта:" + +msgid "" +":meth:`~.datetime.utcoffset` is transformed into a string of the form " +"``±HHMM[SS[.ffffff]]``, where ``HH`` is a 2-digit string giving the number " +"of UTC offset hours, ``MM`` is a 2-digit string giving the number of UTC " +"offset minutes, ``SS`` is a 2-digit string giving the number of UTC offset " +"seconds and ``ffffff`` is a 6-digit string giving the number of UTC offset " +"microseconds. The ``ffffff`` part is omitted when the offset is a whole " +"number of seconds and both the ``ffffff`` and the ``SS`` part is omitted " +"when the offset is a whole number of minutes. For example, if :meth:`~." +"datetime.utcoffset` returns ``timedelta(hours=-3, minutes=-30)``, ``%z`` is " +"replaced with the string ``'-0330'``." +msgstr "" + +msgid "" +"When the ``%z`` directive is provided to the :meth:`~.datetime.strptime` " +"method, the UTC offsets can have a colon as a separator between hours, " +"minutes and seconds. For example, ``'+01:00:00'`` will be parsed as an " +"offset of one hour. In addition, providing ``'Z'`` is identical to " +"``'+00:00'``." +msgstr "" + +msgid "" +"Behaves exactly as ``%z``, but has a colon separator added between hours, " +"minutes and seconds." +msgstr "" + +msgid "" +"In :meth:`~.datetime.strftime`, ``%Z`` is replaced by an empty string if :" +"meth:`~.datetime.tzname` returns ``None``; otherwise ``%Z`` is replaced by " +"the returned value, which must be a string." +msgstr "" + +msgid ":meth:`~.datetime.strptime` only accepts certain values for ``%Z``:" +msgstr "" + +msgid "any value in ``time.tzname`` for your machine's locale" +msgstr "будь-яке значення в ``time.tzname`` для локалі вашої машини" + +msgid "the hard-coded values ``UTC`` and ``GMT``" +msgstr "закодовані значення ``UTC`` і ``GMT``" + +msgid "" +"So someone living in Japan may have ``JST``, ``UTC``, and ``GMT`` as valid " +"values, but probably not ``EST``. It will raise ``ValueError`` for invalid " +"values." +msgstr "" +"Тому хтось, хто живе в Японії, може мати дійсні значення ``JST``, ``UTC`` і " +"``GMT``, але, ймовірно, не ``EST``. Це викличе ``ValueError`` для недійсних " +"значень." + +msgid "" +"When the ``%z`` directive is provided to the :meth:`~.datetime.strptime` " +"method, an aware :class:`.datetime` object will be produced. The ``tzinfo`` " +"of the result will be set to a :class:`timezone` instance." +msgstr "" + +msgid "" +"When used with the :meth:`~.datetime.strptime` method, ``%U`` and ``%W`` are " +"only used in calculations when the day of the week and the calendar year " +"(``%Y``) are specified." +msgstr "" + +msgid "" +"Similar to ``%U`` and ``%W``, ``%V`` is only used in calculations when the " +"day of the week and the ISO year (``%G``) are specified in a :meth:`~." +"datetime.strptime` format string. Also note that ``%G`` and ``%Y`` are not " +"interchangeable." +msgstr "" + +msgid "" +"When used with the :meth:`~.datetime.strptime` method, the leading zero is " +"optional for formats ``%d``, ``%m``, ``%H``, ``%I``, ``%M``, ``%S``, " +"``%j``, ``%U``, ``%W``, and ``%V``. Format ``%y`` does require a leading " +"zero." +msgstr "" + +msgid "" +"When parsing a month and day using :meth:`~.datetime.strptime`, always " +"include a year in the format. If the value you need to parse lacks a year, " +"append an explicit dummy leap year. Otherwise your code will raise an " +"exception when it encounters leap day because the default year used by the " +"parser is not a leap year. Users run into this bug every four years..." +msgstr "" + +msgid "" +">>> month_day = \"02/29\"\n" +">>> datetime.strptime(f\"{month_day};1984\", \"%m/%d;%Y\") # No leap year " +"bug.\n" +"datetime.datetime(1984, 2, 29, 0, 0)" +msgstr "" + +msgid "" +":meth:`~.datetime.strptime` calls using a format string containing a day of " +"month without a year now emit a :exc:`DeprecationWarning`. In 3.15 or later " +"we may change this into an error or change the default year to a leap year. " +"See :gh:`70647`." +msgstr "" + +msgid "Footnotes" +msgstr "Виноски" + +msgid "If, that is, we ignore the effects of Relativity" +msgstr "Якщо, тобто, ми ігноруємо ефекти відносності" + +msgid "" +"This matches the definition of the \"proleptic Gregorian\" calendar in " +"Dershowitz and Reingold's book *Calendrical Calculations*, where it's the " +"base calendar for all computations. See the book for algorithms for " +"converting between proleptic Gregorian ordinals and many other calendar " +"systems." +msgstr "" +"Це збігається з визначенням \"пролептичного григоріанського\" календаря в " +"книзі Дершовіца та Рейнгольда \"Календарні розрахунки*\", де це базовий " +"календар для всіх обчислень. Перегляньте книгу для алгоритмів перетворення " +"між пролептичними григоріанськими ординалами та багатьма іншими календарними " +"системами." + +msgid "" +"See R. H. van Gent's `guide to the mathematics of the ISO 8601 calendar " +"`_ for a good explanation." +msgstr "" + +msgid "" +"Passing ``datetime.strptime('Feb 29', '%b %d')`` will fail since 1900 is not " +"a leap year." +msgstr "" + +msgid "% (percent)" +msgstr "" + +msgid "datetime format" +msgstr "" diff --git a/library/dbm.po b/library/dbm.po new file mode 100644 index 000000000..8b9cffff0 --- /dev/null +++ b/library/dbm.po @@ -0,0 +1,528 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 01:04+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!dbm` --- Interfaces to Unix \"databases\"" +msgstr "" + +msgid "**Source code:** :source:`Lib/dbm/__init__.py`" +msgstr "**Вихідний код:** :source:`Lib/dbm/__init__.py`" + +msgid ":mod:`dbm` is a generic interface to variants of the DBM database:" +msgstr "" + +msgid ":mod:`dbm.sqlite3`" +msgstr "" + +msgid ":mod:`dbm.gnu`" +msgstr "" + +msgid ":mod:`dbm.ndbm`" +msgstr "" + +msgid "" +"If none of these modules are installed, the slow-but-simple implementation " +"in module :mod:`dbm.dumb` will be used. There is a `third party interface " +"`_ to the Oracle Berkeley DB." +msgstr "" + +msgid "" +"A tuple containing the exceptions that can be raised by each of the " +"supported modules, with a unique exception also named :exc:`dbm.error` as " +"the first item --- the latter is used when :exc:`dbm.error` is raised." +msgstr "" +"Кортеж, що містить винятки, які можуть бути викликані кожним із " +"підтримуваних модулів, з унікальним винятком, який також називається :exc:" +"`dbm.error` як перший елемент --- останній елемент використовується, коли :" +"exc:`dbm.error` піднято." + +msgid "" +"This function attempts to guess which of the several simple database modules " +"available --- :mod:`dbm.sqlite3`, :mod:`dbm.gnu`, :mod:`dbm.ndbm`, or :mod:" +"`dbm.dumb` --- should be used to open a given file." +msgstr "" + +msgid "Return one of the following values:" +msgstr "" + +msgid "" +"``None`` if the file can't be opened because it's unreadable or doesn't exist" +msgstr "" + +msgid "the empty string (``''``) if the file's format can't be guessed" +msgstr "" + +msgid "" +"a string containing the required module name, such as ``'dbm.ndbm'`` or " +"``'dbm.gnu'``" +msgstr "" + +msgid "*filename* accepts a :term:`path-like object`." +msgstr "" + +msgid "Open a database and return the corresponding database object." +msgstr "" + +msgid "Parameters" +msgstr "Параметри" + +msgid "" +"The database file to open. If the database file already exists, the :func:" +"`whichdb` function is used to determine its type and the appropriate module " +"is used; if it does not exist, the first submodule listed above that can be " +"imported is used." +msgstr "" + +msgid "The database file to open." +msgstr "" + +msgid "" +"If the database file already exists, the :func:`whichdb` function is used to " +"determine its type and the appropriate module is used; if it does not exist, " +"the first submodule listed above that can be imported is used." +msgstr "" + +msgid "" +"* ``'r'`` (default): |flag_r| * ``'w'``: |flag_w| * ``'c'``: |flag_c| * " +"``'n'``: |flag_n|" +msgstr "" + +msgid "``'r'`` (default): |flag_r|" +msgstr "" + +msgid "``'w'``: |flag_w|" +msgstr "" + +msgid "``'c'``: |flag_c|" +msgstr "" + +msgid "``'n'``: |flag_n|" +msgstr "" + +msgid "|mode_param_doc|" +msgstr "" + +msgid "*file* accepts a :term:`path-like object`." +msgstr "" + +msgid "" +"The object returned by :func:`~dbm.open` supports the same basic " +"functionality as a :class:`dict`; keys and their corresponding values can be " +"stored, retrieved, and deleted, and the :keyword:`in` operator and the :meth:" +"`!keys` method are available, as well as :meth:`!get` and :meth:`!" +"setdefault` methods." +msgstr "" + +msgid "" +"Key and values are always stored as :class:`bytes`. This means that when " +"strings are used they are implicitly converted to the default encoding " +"before being stored." +msgstr "" + +msgid "" +"These objects also support being used in a :keyword:`with` statement, which " +"will automatically close them when done." +msgstr "" +"Ці об’єкти також підтримують використання в операторі :keyword:`with`, який " +"автоматично закриє їх після завершення." + +msgid "" +":meth:`!get` and :meth:`!setdefault` methods are now available for all :mod:" +"`dbm` backends." +msgstr "" + +msgid "" +"Added native support for the context management protocol to the objects " +"returned by :func:`~dbm.open`." +msgstr "" + +msgid "" +"Deleting a key from a read-only database raises a database module specific " +"exception instead of :exc:`KeyError`." +msgstr "" + +msgid "" +"The following example records some hostnames and a corresponding title, and " +"then prints out the contents of the database::" +msgstr "" +"У наступному прикладі записуються деякі імена хостів і відповідний " +"заголовок, а потім друкується вміст бази даних:" + +msgid "" +"import dbm\n" +"\n" +"# Open database, creating it if necessary.\n" +"with dbm.open('cache', 'c') as db:\n" +"\n" +" # Record some values\n" +" db[b'hello'] = b'there'\n" +" db['www.python.org'] = 'Python Website'\n" +" db['www.cnn.com'] = 'Cable News Network'\n" +"\n" +" # Note that the keys are considered bytes now.\n" +" assert db[b'www.python.org'] == b'Python Website'\n" +" # Notice how the value is now in bytes.\n" +" assert db['www.cnn.com'] == b'Cable News Network'\n" +"\n" +" # Often-used methods of the dict interface work too.\n" +" print(db.get('python.org', b'not present'))\n" +"\n" +" # Storing a non-string key or value will raise an exception (most\n" +" # likely a TypeError).\n" +" db['www.yahoo.com'] = 4\n" +"\n" +"# db is automatically closed when leaving the with statement." +msgstr "" + +msgid "Module :mod:`shelve`" +msgstr "Модуль :mod:`shelve`" + +msgid "Persistence module which stores non-string data." +msgstr "Модуль постійності, який зберігає нерядкові дані." + +msgid "The individual submodules are described in the following sections." +msgstr "Окремі субмодулі описані в наступних розділах." + +msgid ":mod:`dbm.sqlite3` --- SQLite backend for dbm" +msgstr "" + +msgid "**Source code:** :source:`Lib/dbm/sqlite3.py`" +msgstr "" + +msgid "" +"This module uses the standard library :mod:`sqlite3` module to provide an " +"SQLite backend for the :mod:`dbm` module. The files created by :mod:`dbm." +"sqlite3` can thus be opened by :mod:`sqlite3`, or any other SQLite browser, " +"including the SQLite CLI." +msgstr "" + +msgid "Availability" +msgstr "" + +msgid "" +"This module does not work or is not available on WebAssembly. See :ref:`wasm-" +"availability` for more information." +msgstr "" + +msgid "" +"Open an SQLite database. The returned object behaves like a :term:`mapping`, " +"implements a :meth:`!close` method, and supports a \"closing\" context " +"manager via the :keyword:`with` keyword." +msgstr "" + +msgid "The path to the database to be opened." +msgstr "" + +msgid "" +"The Unix file access mode of the file (default: octal ``0o666``), used only " +"when the database has to be created." +msgstr "" + +msgid ":mod:`dbm.gnu` --- GNU database manager" +msgstr "" + +msgid "**Source code:** :source:`Lib/dbm/gnu.py`" +msgstr "**Вихідний код:** :source:`Lib/dbm/gnu.py`" + +msgid "" +"The :mod:`dbm.gnu` module provides an interface to the :abbr:`GDBM (GNU " +"dbm)` library, similar to the :mod:`dbm.ndbm` module, but with additional " +"functionality like crash tolerance." +msgstr "" + +msgid "" +"The file formats created by :mod:`dbm.gnu` and :mod:`dbm.ndbm` are " +"incompatible and can not be used interchangeably." +msgstr "" + +msgid "" +"This module is not supported on :ref:`mobile platforms ` or :ref:`WebAssembly platforms `." +msgstr "" + +msgid "" +"Raised on :mod:`dbm.gnu`-specific errors, such as I/O errors. :exc:" +"`KeyError` is raised for general mapping errors like specifying an incorrect " +"key." +msgstr "" +"Виникає через специфічні помилки :mod:`dbm.gnu`, такі як помилки введення/" +"виведення. :exc:`KeyError` виникає для загальних помилок зіставлення, як-от " +"введення неправильного ключа." + +msgid "Open a GDBM database and return a :class:`!gdbm` object." +msgstr "" + +msgid "" +"* ``'r'`` (default): |flag_r| * ``'w'``: |flag_w| * ``'c'``: |flag_c| * " +"``'n'``: |flag_n| The following additional characters may be appended to " +"control how the database is opened: * ``'f'``: Open the database in fast " +"mode. Writes to the database will not be synchronized. * ``'s'``: " +"Synchronized mode. Changes to the database will be written immediately to " +"the file. * ``'u'``: Do not lock database. Not all flags are valid for all " +"versions of GDBM. See the :data:`open_flags` member for a list of supported " +"flag characters." +msgstr "" + +msgid "" +"The following additional characters may be appended to control how the " +"database is opened:" +msgstr "" + +msgid "" +"``'f'``: Open the database in fast mode. Writes to the database will not be " +"synchronized." +msgstr "" + +msgid "" +"``'s'``: Synchronized mode. Changes to the database will be written " +"immediately to the file." +msgstr "" + +msgid "``'u'``: Do not lock database." +msgstr "" + +msgid "" +"Not all flags are valid for all versions of GDBM. See the :data:`open_flags` " +"member for a list of supported flag characters." +msgstr "" + +msgid "Raises" +msgstr "" + +msgid "If an invalid *flag* argument is passed." +msgstr "" + +msgid "" +"A string of characters the *flag* parameter of :meth:`~dbm.gnu.open` " +"supports." +msgstr "" + +msgid "" +":class:`!gdbm` objects behave similar to :term:`mappings `, but :" +"meth:`!items` and :meth:`!values` methods are not supported. The following " +"methods are also provided:" +msgstr "" + +msgid "" +"It's possible to loop over every key in the database using this method and " +"the :meth:`nextkey` method. The traversal is ordered by GDBM's internal " +"hash values, and won't be sorted by the key values. This method returns the " +"starting key." +msgstr "" + +msgid "" +"Returns the key that follows *key* in the traversal. The following code " +"prints every key in the database ``db``, without having to create a list in " +"memory that contains them all::" +msgstr "" +"Повертає ключ, який слідує за *key* під час обходу. Наступний код друкує " +"кожен ключ у базі даних ``db`` без необхідності створювати в пам’яті список, " +"який містить їх усі:" + +msgid "" +"k = db.firstkey()\n" +"while k is not None:\n" +" print(k)\n" +" k = db.nextkey(k)" +msgstr "" + +msgid "" +"If you have carried out a lot of deletions and would like to shrink the " +"space used by the GDBM file, this routine will reorganize the database. :" +"class:`!gdbm` objects will not shorten the length of a database file except " +"by using this reorganization; otherwise, deleted file space will be kept and " +"reused as new (key, value) pairs are added." +msgstr "" + +msgid "" +"When the database has been opened in fast mode, this method forces any " +"unwritten data to be written to the disk." +msgstr "" +"Коли базу даних відкрито у швидкому режимі, цей метод примусово записує на " +"диск будь-які незаписані дані." + +msgid "Close the GDBM database." +msgstr "" + +msgid "Remove all items from the GDBM database." +msgstr "" + +msgid ":mod:`dbm.ndbm` --- New Database Manager" +msgstr "" + +msgid "**Source code:** :source:`Lib/dbm/ndbm.py`" +msgstr "**Вихідний код:** :source:`Lib/dbm/ndbm.py`" + +msgid "" +"The :mod:`dbm.ndbm` module provides an interface to the :abbr:`NDBM (New " +"Database Manager)` library. This module can be used with the \"classic\" " +"NDBM interface or the :abbr:`GDBM (GNU dbm)` compatibility interface." +msgstr "" + +msgid "" +"The NDBM library shipped as part of macOS has an undocumented limitation on " +"the size of values, which can result in corrupted database files when " +"storing values larger than this limit. Reading such corrupted files can " +"result in a hard crash (segmentation fault)." +msgstr "" + +msgid "" +"Raised on :mod:`dbm.ndbm`-specific errors, such as I/O errors. :exc:" +"`KeyError` is raised for general mapping errors like specifying an incorrect " +"key." +msgstr "" +"Виникає через :mod:`dbm.ndbm`-специфічні помилки, такі як помилки введення/" +"виведення. :exc:`KeyError` виникає для загальних помилок зіставлення, як-от " +"введення неправильного ключа." + +msgid "Name of the NDBM implementation library used." +msgstr "" + +msgid "Open an NDBM database and return an :class:`!ndbm` object." +msgstr "" + +msgid "" +"The basename of the database file (without the :file:`.dir` or :file:`.pag` " +"extensions)." +msgstr "" + +msgid "" +":class:`!ndbm` objects behave similar to :term:`mappings `, but :" +"meth:`!items` and :meth:`!values` methods are not supported. The following " +"methods are also provided:" +msgstr "" + +msgid "Accepts :term:`path-like object` for filename." +msgstr "" + +msgid "Close the NDBM database." +msgstr "" + +msgid "Remove all items from the NDBM database." +msgstr "" + +msgid ":mod:`dbm.dumb` --- Portable DBM implementation" +msgstr ":mod:`dbm.dumb` --- Переносна реалізація DBM" + +msgid "**Source code:** :source:`Lib/dbm/dumb.py`" +msgstr "**Вихідний код:** :source:`Lib/dbm/dumb.py`" + +msgid "" +"The :mod:`dbm.dumb` module is intended as a last resort fallback for the :" +"mod:`dbm` module when a more robust module is not available. The :mod:`dbm." +"dumb` module is not written for speed and is not nearly as heavily used as " +"the other database modules." +msgstr "" +"Модуль :mod:`dbm.dumb` призначений як остання альтернатива для модуля :mod:" +"`dbm`, коли більш надійний модуль недоступний. Модуль :mod:`dbm.dumb` не " +"створений для швидкості і використовується не так активно, як інші модулі " +"бази даних." + +msgid "" +"The :mod:`dbm.dumb` module provides a persistent :class:`dict`-like " +"interface which is written entirely in Python. Unlike other :mod:`dbm` " +"backends, such as :mod:`dbm.gnu`, no external library is required." +msgstr "" + +msgid "The :mod:`!dbm.dumb` module defines the following:" +msgstr "" + +msgid "" +"Raised on :mod:`dbm.dumb`-specific errors, such as I/O errors. :exc:" +"`KeyError` is raised for general mapping errors like specifying an incorrect " +"key." +msgstr "" +"Виникає через :mod:`dbm.dumb`-специфічні помилки, такі як помилки введення/" +"виведення. :exc:`KeyError` виникає для загальних помилок зіставлення, як-от " +"введення неправильного ключа." + +msgid "" +"Open a :mod:`!dbm.dumb` database. The returned database object behaves " +"similar to a :term:`mapping`, in addition to providing :meth:`~dumbdbm.sync` " +"and :meth:`~dumbdbm.close` methods." +msgstr "" + +msgid "" +"The basename of the database file (without extensions). A new database " +"creates the following files: - :file:`{filename}.dat` - :file:`{filename}." +"dir`" +msgstr "" + +msgid "" +"The basename of the database file (without extensions). A new database " +"creates the following files:" +msgstr "" + +msgid ":file:`{filename}.dat`" +msgstr "" + +msgid ":file:`{filename}.dir`" +msgstr "" + +msgid "" +"* ``'r'``: |flag_r| * ``'w'``: |flag_w| * ``'c'`` (default): |flag_c| * " +"``'n'``: |flag_n|" +msgstr "" + +msgid "``'r'``: |flag_r|" +msgstr "" + +msgid "``'c'`` (default): |flag_c|" +msgstr "" + +msgid "" +"It is possible to crash the Python interpreter when loading a database with " +"a sufficiently large/complex entry due to stack depth limitations in " +"Python's AST compiler." +msgstr "" +"Можливий збій інтерпретатора Python під час завантаження бази даних із " +"достатньо великим/складним записом через обмеження глибини стеку в " +"компіляторі AST Python." + +msgid "" +":func:`~dbm.dumb.open` always creates a new database when *flag* is ``'n'``." +msgstr "" + +msgid "" +"A database opened read-only if *flag* is ``'r'``. A database is not created " +"if it does not exist if *flag* is ``'r'`` or ``'w'``." +msgstr "" + +msgid "" +"In addition to the methods provided by the :class:`collections.abc." +"MutableMapping` class, the following methods are provided:" +msgstr "" + +msgid "" +"Synchronize the on-disk directory and data files. This method is called by " +"the :meth:`shelve.Shelf.sync` method." +msgstr "" + +msgid "Close the database." +msgstr "" + +msgid "databases" +msgstr "" diff --git a/library/debug.po b/library/debug.po new file mode 100644 index 000000000..42b39d41a --- /dev/null +++ b/library/debug.po @@ -0,0 +1,44 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 01:04+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Debugging and Profiling" +msgstr "Налагодження та профілювання" + +msgid "" +"These libraries help you with Python development: the debugger enables you " +"to step through code, analyze stack frames and set breakpoints etc., and the " +"profilers run code and give you a detailed breakdown of execution times, " +"allowing you to identify bottlenecks in your programs. Auditing events " +"provide visibility into runtime behaviors that would otherwise require " +"intrusive debugging or patching." +msgstr "" +"Ці бібліотеки допомагають вам у розробці Python: налагоджувач дає змогу " +"покроково переглядати код, аналізувати фрейми стеку та встановлювати точки " +"зупину тощо, а профайлери запускають код і надають детальну розбивку часу " +"виконання, дозволяючи вам визначати вузькі місця у ваших програмах. Події " +"аудиту забезпечують видимість поведінки під час виконання, яка інакше " +"вимагала б нав’язливого налагодження або виправлення." diff --git a/library/decimal.po b/library/decimal.po new file mode 100644 index 000000000..05f4c1a44 --- /dev/null +++ b/library/decimal.po @@ -0,0 +1,2779 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 01:04+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!decimal` --- Decimal fixed-point and floating-point arithmetic" +msgstr "" + +msgid "**Source code:** :source:`Lib/decimal.py`" +msgstr "**Вихідний код:** :source:`Lib/decimal.py`" + +msgid "" +"The :mod:`decimal` module provides support for fast correctly rounded " +"decimal floating-point arithmetic. It offers several advantages over the :" +"class:`float` datatype:" +msgstr "" + +msgid "" +"Decimal \"is based on a floating-point model which was designed with people " +"in mind, and necessarily has a paramount guiding principle -- computers must " +"provide an arithmetic that works in the same way as the arithmetic that " +"people learn at school.\" -- excerpt from the decimal arithmetic " +"specification." +msgstr "" +"Decimal \"базується на моделі з плаваючою комою, яка була розроблена з " +"урахуванням людей, і обов'язково має головний керівний принцип - комп'ютери " +"повинні забезпечувати арифметику, яка працює так само, як арифметика, яку " +"люди вивчають у школі\". -- витяг із специфікації десяткової арифметики." + +msgid "" +"Decimal numbers can be represented exactly. In contrast, numbers like " +"``1.1`` and ``2.2`` do not have exact representations in binary floating " +"point. End users typically would not expect ``1.1 + 2.2`` to display as " +"``3.3000000000000003`` as it does with binary floating point." +msgstr "" + +msgid "" +"The exactness carries over into arithmetic. In decimal floating point, " +"``0.1 + 0.1 + 0.1 - 0.3`` is exactly equal to zero. In binary floating " +"point, the result is ``5.5511151231257827e-017``. While near to zero, the " +"differences prevent reliable equality testing and differences can " +"accumulate. For this reason, decimal is preferred in accounting applications " +"which have strict equality invariants." +msgstr "" + +msgid "" +"The decimal module incorporates a notion of significant places so that " +"``1.30 + 1.20`` is ``2.50``. The trailing zero is kept to indicate " +"significance. This is the customary presentation for monetary applications. " +"For multiplication, the \"schoolbook\" approach uses all the figures in the " +"multiplicands. For instance, ``1.3 * 1.2`` gives ``1.56`` while ``1.30 * " +"1.20`` gives ``1.5600``." +msgstr "" + +msgid "" +"Unlike hardware based binary floating point, the decimal module has a user " +"alterable precision (defaulting to 28 places) which can be as large as " +"needed for a given problem:" +msgstr "" +"На відміну від двійкового числа з плаваючою комою на апаратній основі, " +"десятковий модуль має змінну користувачем точність (за замовчуванням 28 " +"знаків), яка може бути настільки великою, наскільки це потрібно для даної " +"проблеми:" + +msgid "" +"Both binary and decimal floating point are implemented in terms of published " +"standards. While the built-in float type exposes only a modest portion of " +"its capabilities, the decimal module exposes all required parts of the " +"standard. When needed, the programmer has full control over rounding and " +"signal handling. This includes an option to enforce exact arithmetic by " +"using exceptions to block any inexact operations." +msgstr "" +"І двійкові, і десяткові числа з плаваючою комою реалізовані відповідно до " +"опублікованих стандартів. У той час як вбудований тип float відкриває лише " +"скромну частину своїх можливостей, десятковий модуль відкриває всі необхідні " +"частини стандарту. За потреби програміст має повний контроль над округленням " +"і обробкою сигналу. Це включає в себе опцію для застосування точної " +"арифметики за допомогою винятків для блокування будь-яких неточних операцій." + +msgid "" +"The decimal module was designed to support \"without prejudice, both exact " +"unrounded decimal arithmetic (sometimes called fixed-point arithmetic) and " +"rounded floating-point arithmetic.\" -- excerpt from the decimal arithmetic " +"specification." +msgstr "" +"Десятковий модуль був розроблений для підтримки \"без шкоди як точної " +"неокругленої десяткової арифметики (іноді її називають арифметикою з " +"фіксованою комою), так і округленої арифметики з плаваючою комою\". -- витяг " +"із специфікації десяткової арифметики." + +msgid "" +"The module design is centered around three concepts: the decimal number, " +"the context for arithmetic, and signals." +msgstr "" +"Конструкція модуля зосереджена навколо трьох понять: десяткове число, " +"контекст для арифметики та сигнали." + +msgid "" +"A decimal number is immutable. It has a sign, coefficient digits, and an " +"exponent. To preserve significance, the coefficient digits do not truncate " +"trailing zeros. Decimals also include special values such as ``Infinity``, " +"``-Infinity``, and ``NaN``. The standard also differentiates ``-0`` from " +"``+0``." +msgstr "" + +msgid "" +"The context for arithmetic is an environment specifying precision, rounding " +"rules, limits on exponents, flags indicating the results of operations, and " +"trap enablers which determine whether signals are treated as exceptions. " +"Rounding options include :const:`ROUND_CEILING`, :const:`ROUND_DOWN`, :const:" +"`ROUND_FLOOR`, :const:`ROUND_HALF_DOWN`, :const:`ROUND_HALF_EVEN`, :const:" +"`ROUND_HALF_UP`, :const:`ROUND_UP`, and :const:`ROUND_05UP`." +msgstr "" +"Контекст для арифметики — це середовище, що визначає точність, правила " +"округлення, обмеження на експоненти, прапори, що вказують результати " +"операцій, і засоби перехоплення, які визначають, чи розглядаються сигнали як " +"винятки. Параметри округлення включають :const:`ROUND_CEILING`, :const:" +"`ROUND_DOWN`, :const:`ROUND_FLOOR`, :const:`ROUND_HALF_DOWN`, :const:" +"`ROUND_HALF_EVEN`, :const:`ROUND_HALF_UP`, :const:`ROUND_UP` і :const:" +"`ROUND_05UP`." + +msgid "" +"Signals are groups of exceptional conditions arising during the course of " +"computation. Depending on the needs of the application, signals may be " +"ignored, considered as informational, or treated as exceptions. The signals " +"in the decimal module are: :const:`Clamped`, :const:`InvalidOperation`, :" +"const:`DivisionByZero`, :const:`Inexact`, :const:`Rounded`, :const:" +"`Subnormal`, :const:`Overflow`, :const:`Underflow` and :const:" +"`FloatOperation`." +msgstr "" +"Сигнали - це групи виняткових умов, що виникають під час обчислень. Залежно " +"від потреб програми, сигнали можуть ігноруватися, розглядатися як " +"інформаційні або розглядатися як винятки. Сигнали в десятковому модулі: :" +"const:`Clamped`, :const:`InvalidOperation`, :const:`DivisionByZero`, :const:" +"`Inexact`, :const:`Rounded`, :const:`Subnormal`, :const:`Overflow`, :const:" +"`Underflow` і :const:`FloatOperation`." + +msgid "" +"For each signal there is a flag and a trap enabler. When a signal is " +"encountered, its flag is set to one, then, if the trap enabler is set to " +"one, an exception is raised. Flags are sticky, so the user needs to reset " +"them before monitoring a calculation." +msgstr "" +"Для кожного сигналу є прапорець і активатор пастки. Коли зустрічається " +"сигнал, його прапорець встановлюється на одиницю, тоді, якщо активатор " +"перехоплення встановлений на одиницю, виникає виняток. Прапори є липкими, " +"тому користувачеві потрібно скинути їх, перш ніж контролювати обчислення." + +msgid "" +"IBM's General Decimal Arithmetic Specification, `The General Decimal " +"Arithmetic Specification `_." +msgstr "" + +msgid "Quick-start Tutorial" +msgstr "Короткий підручник" + +msgid "" +"The usual start to using decimals is importing the module, viewing the " +"current context with :func:`getcontext` and, if necessary, setting new " +"values for precision, rounding, or enabled traps::" +msgstr "" +"Звичайним початком використання десяткових дробів є імпортування модуля, " +"перегляд поточного контексту за допомогою :func:`getcontext` і, якщо " +"необхідно, встановлення нових значень для точності, округлення або " +"ввімкнення перехоплень::" + +msgid "" +">>> from decimal import *\n" +">>> getcontext()\n" +"Context(prec=28, rounding=ROUND_HALF_EVEN, Emin=-999999, Emax=999999,\n" +" capitals=1, clamp=0, flags=[], traps=[Overflow, DivisionByZero,\n" +" InvalidOperation])\n" +"\n" +">>> getcontext().prec = 7 # Set a new precision" +msgstr "" + +msgid "" +"Decimal instances can be constructed from integers, strings, floats, or " +"tuples. Construction from an integer or a float performs an exact conversion " +"of the value of that integer or float. Decimal numbers include special " +"values such as ``NaN`` which stands for \"Not a number\", positive and " +"negative ``Infinity``, and ``-0``::" +msgstr "" + +msgid "" +">>> getcontext().prec = 28\n" +">>> Decimal(10)\n" +"Decimal('10')\n" +">>> Decimal('3.14')\n" +"Decimal('3.14')\n" +">>> Decimal(3.14)\n" +"Decimal('3.140000000000000124344978758017532527446746826171875')\n" +">>> Decimal((0, (3, 1, 4), -2))\n" +"Decimal('3.14')\n" +">>> Decimal(str(2.0 ** 0.5))\n" +"Decimal('1.4142135623730951')\n" +">>> Decimal(2) ** Decimal('0.5')\n" +"Decimal('1.414213562373095048801688724')\n" +">>> Decimal('NaN')\n" +"Decimal('NaN')\n" +">>> Decimal('-Infinity')\n" +"Decimal('-Infinity')" +msgstr "" + +msgid "" +"If the :exc:`FloatOperation` signal is trapped, accidental mixing of " +"decimals and floats in constructors or ordering comparisons raises an " +"exception::" +msgstr "" +"Якщо сигнал :exc:`FloatOperation` перехоплюється, випадкове змішування " +"десяткових дробів і чисел з плаваючою точкою в конструкторах або " +"впорядкованих порівняннях викликає виняток:" + +msgid "" +">>> c = getcontext()\n" +">>> c.traps[FloatOperation] = True\n" +">>> Decimal(3.14)\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"decimal.FloatOperation: []\n" +">>> Decimal('3.5') < 3.7\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"decimal.FloatOperation: []\n" +">>> Decimal('3.5') == 3.5\n" +"True" +msgstr "" + +msgid "" +"The significance of a new Decimal is determined solely by the number of " +"digits input. Context precision and rounding only come into play during " +"arithmetic operations." +msgstr "" +"Значення нового десяткового дробу визначається виключно кількістю введених " +"цифр. Точність контексту та округлення застосовуються лише під час " +"арифметичних операцій." + +msgid "" +">>> getcontext().prec = 6\n" +">>> Decimal('3.0')\n" +"Decimal('3.0')\n" +">>> Decimal('3.1415926535')\n" +"Decimal('3.1415926535')\n" +">>> Decimal('3.1415926535') + Decimal('2.7182818285')\n" +"Decimal('5.85987')\n" +">>> getcontext().rounding = ROUND_UP\n" +">>> Decimal('3.1415926535') + Decimal('2.7182818285')\n" +"Decimal('5.85988')" +msgstr "" + +msgid "" +"If the internal limits of the C version are exceeded, constructing a decimal " +"raises :class:`InvalidOperation`::" +msgstr "" +"Якщо внутрішні обмеження версії C перевищено, побудова десяткового числа " +"призводить до :class:`InvalidOperation`::" + +msgid "" +">>> Decimal(\"1e9999999999999999999\")\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"decimal.InvalidOperation: []" +msgstr "" + +msgid "" +"Decimals interact well with much of the rest of Python. Here is a small " +"decimal floating-point flying circus:" +msgstr "" + +msgid "" +">>> data = list(map(Decimal, '1.34 1.87 3.45 2.35 1.00 0.03 9.25'.split()))\n" +">>> max(data)\n" +"Decimal('9.25')\n" +">>> min(data)\n" +"Decimal('0.03')\n" +">>> sorted(data)\n" +"[Decimal('0.03'), Decimal('1.00'), Decimal('1.34'), Decimal('1.87'),\n" +" Decimal('2.35'), Decimal('3.45'), Decimal('9.25')]\n" +">>> sum(data)\n" +"Decimal('19.29')\n" +">>> a,b,c = data[:3]\n" +">>> str(a)\n" +"'1.34'\n" +">>> float(a)\n" +"1.34\n" +">>> round(a, 1)\n" +"Decimal('1.3')\n" +">>> int(a)\n" +"1\n" +">>> a * 5\n" +"Decimal('6.70')\n" +">>> a * b\n" +"Decimal('2.5058')\n" +">>> c % a\n" +"Decimal('0.77')" +msgstr "" + +msgid "And some mathematical functions are also available to Decimal:" +msgstr "І деякі математичні функції також доступні для Decimal:" + +msgid "" +"The :meth:`~Decimal.quantize` method rounds a number to a fixed exponent. " +"This method is useful for monetary applications that often round results to " +"a fixed number of places:" +msgstr "" + +msgid "" +"As shown above, the :func:`getcontext` function accesses the current context " +"and allows the settings to be changed. This approach meets the needs of " +"most applications." +msgstr "" +"Як показано вище, функція :func:`getcontext` отримує доступ до поточного " +"контексту та дозволяє змінювати налаштування. Такий підхід відповідає " +"потребам більшості програм." + +msgid "" +"For more advanced work, it may be useful to create alternate contexts using " +"the Context() constructor. To make an alternate active, use the :func:" +"`setcontext` function." +msgstr "" +"Для більш складної роботи може бути корисним створити альтернативні " +"контексти за допомогою конструктора Context(). Щоб зробити альтернативу " +"активною, використовуйте функцію :func:`setcontext`." + +msgid "" +"In accordance with the standard, the :mod:`decimal` module provides two " +"ready to use standard contexts, :const:`BasicContext` and :const:" +"`ExtendedContext`. The former is especially useful for debugging because " +"many of the traps are enabled:" +msgstr "" +"Відповідно до стандарту, модуль :mod:`decimal` надає два готові до " +"використання стандартні контексти, :const:`BasicContext` і :const:" +"`ExtendedContext`. Перший особливо корисний для налагодження, оскільки " +"багато пасток увімкнено:" + +msgid "" +">>> myothercontext = Context(prec=60, rounding=ROUND_HALF_DOWN)\n" +">>> setcontext(myothercontext)\n" +">>> Decimal(1) / Decimal(7)\n" +"Decimal('0.142857142857142857142857142857142857142857142857142857142857')\n" +"\n" +">>> ExtendedContext\n" +"Context(prec=9, rounding=ROUND_HALF_EVEN, Emin=-999999, Emax=999999,\n" +" capitals=1, clamp=0, flags=[], traps=[])\n" +">>> setcontext(ExtendedContext)\n" +">>> Decimal(1) / Decimal(7)\n" +"Decimal('0.142857143')\n" +">>> Decimal(42) / Decimal(0)\n" +"Decimal('Infinity')\n" +"\n" +">>> setcontext(BasicContext)\n" +">>> Decimal(42) / Decimal(0)\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in -toplevel-\n" +" Decimal(42) / Decimal(0)\n" +"DivisionByZero: x / 0" +msgstr "" + +msgid "" +"Contexts also have signal flags for monitoring exceptional conditions " +"encountered during computations. The flags remain set until explicitly " +"cleared, so it is best to clear the flags before each set of monitored " +"computations by using the :meth:`~Context.clear_flags` method. ::" +msgstr "" + +msgid "" +">>> setcontext(ExtendedContext)\n" +">>> getcontext().clear_flags()\n" +">>> Decimal(355) / Decimal(113)\n" +"Decimal('3.14159292')\n" +">>> getcontext()\n" +"Context(prec=9, rounding=ROUND_HALF_EVEN, Emin=-999999, Emax=999999,\n" +" capitals=1, clamp=0, flags=[Inexact, Rounded], traps=[])" +msgstr "" + +msgid "" +"The *flags* entry shows that the rational approximation to pi was rounded " +"(digits beyond the context precision were thrown away) and that the result " +"is inexact (some of the discarded digits were non-zero)." +msgstr "" + +msgid "" +"Individual traps are set using the dictionary in the :attr:`~Context.traps` " +"attribute of a context:" +msgstr "" + +msgid "" +">>> setcontext(ExtendedContext)\n" +">>> Decimal(1) / Decimal(0)\n" +"Decimal('Infinity')\n" +">>> getcontext().traps[DivisionByZero] = 1\n" +">>> Decimal(1) / Decimal(0)\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in -toplevel-\n" +" Decimal(1) / Decimal(0)\n" +"DivisionByZero: x / 0" +msgstr "" + +msgid "" +"Most programs adjust the current context only once, at the beginning of the " +"program. And, in many applications, data is converted to :class:`Decimal` " +"with a single cast inside a loop. With context set and decimals created, " +"the bulk of the program manipulates the data no differently than with other " +"Python numeric types." +msgstr "" +"Більшість програм коригують поточний контекст лише один раз, на початку " +"програми. І в багатьох програмах дані перетворюються на :class:`Decimal` за " +"допомогою одного приведення всередині циклу. З набором контексту та " +"створеними десятковими знаками основна частина програми маніпулює даними не " +"інакше, як з іншими числовими типами Python." + +msgid "Decimal objects" +msgstr "Десяткові об'єкти" + +msgid "Construct a new :class:`Decimal` object based from *value*." +msgstr "Створіть новий об’єкт :class:`Decimal` на основі *value*." + +msgid "" +"*value* can be an integer, string, tuple, :class:`float`, or another :class:" +"`Decimal` object. If no *value* is given, returns ``Decimal('0')``. If " +"*value* is a string, it should conform to the decimal numeric string syntax " +"after leading and trailing whitespace characters, as well as underscores " +"throughout, are removed::" +msgstr "" +"*значення* може бути цілим числом, рядком, кортежем, :class:`float` або " +"іншим об’єктом :class:`Decimal`. Якщо *значення* не вказано, повертає " +"``Decimal('0')``. Якщо *значення* є рядком, воно має відповідати синтаксису " +"десяткового числового рядка після видалення початкових і кінцевих пробілів, " +"а також символів підкреслення::" + +msgid "" +"sign ::= '+' | '-'\n" +"digit ::= '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | " +"'9'\n" +"indicator ::= 'e' | 'E'\n" +"digits ::= digit [digit]...\n" +"decimal-part ::= digits '.' [digits] | ['.'] digits\n" +"exponent-part ::= indicator [sign] digits\n" +"infinity ::= 'Infinity' | 'Inf'\n" +"nan ::= 'NaN' [digits] | 'sNaN' [digits]\n" +"numeric-value ::= decimal-part [exponent-part] | infinity\n" +"numeric-string ::= [sign] numeric-value | [sign] nan" +msgstr "" + +msgid "" +"Other Unicode decimal digits are also permitted where ``digit`` appears " +"above. These include decimal digits from various other alphabets (for " +"example, Arabic-Indic and Devanāgarī digits) along with the fullwidth digits " +"``'\\uff10'`` through ``'\\uff19'``. Case is not significant, so, for " +"example, ``inf``, ``Inf``, ``INFINITY``, and ``iNfINity`` are all acceptable " +"spellings for positive infinity." +msgstr "" + +msgid "" +"If *value* is a :class:`tuple`, it should have three components, a sign " +"(``0`` for positive or ``1`` for negative), a :class:`tuple` of digits, and " +"an integer exponent. For example, ``Decimal((0, (1, 4, 1, 4), -3))`` returns " +"``Decimal('1.414')``." +msgstr "" + +msgid "" +"If *value* is a :class:`float`, the binary floating-point value is " +"losslessly converted to its exact decimal equivalent. This conversion can " +"often require 53 or more digits of precision. For example, " +"``Decimal(float('1.1'))`` converts to " +"``Decimal('1.100000000000000088817841970012523233890533447265625')``." +msgstr "" + +msgid "" +"The *context* precision does not affect how many digits are stored. That is " +"determined exclusively by the number of digits in *value*. For example, " +"``Decimal('3.00000')`` records all five zeros even if the context precision " +"is only three." +msgstr "" +"Точність *контексту* не впливає на кількість збережених цифр. Це " +"визначається виключно кількістю цифр у *значенні*. Наприклад, " +"``Decimal('3.00000')`` записує всі п'ять нулів, навіть якщо точність " +"контексту становить лише три." + +msgid "" +"The purpose of the *context* argument is determining what to do if *value* " +"is a malformed string. If the context traps :const:`InvalidOperation`, an " +"exception is raised; otherwise, the constructor returns a new Decimal with " +"the value of ``NaN``." +msgstr "" + +msgid "Once constructed, :class:`Decimal` objects are immutable." +msgstr "Після створення об’єкти :class:`Decimal` є незмінними." + +msgid "" +"The argument to the constructor is now permitted to be a :class:`float` " +"instance." +msgstr "" +"Аргументом конструктора тепер дозволено бути екземпляром :class:`float`." + +msgid "" +":class:`float` arguments raise an exception if the :exc:`FloatOperation` " +"trap is set. By default the trap is off." +msgstr "" +"Аргументи :class:`float` викликають виняток, якщо встановлено перехоплення :" +"exc:`FloatOperation`. За замовчуванням перехоплення вимкнено." + +msgid "" +"Underscores are allowed for grouping, as with integral and floating-point " +"literals in code." +msgstr "" +"Підкреслення дозволено для групування, як і з інтегральними літералами та " +"літералами з плаваючою комою в коді." + +msgid "" +"Decimal floating-point objects share many properties with the other built-in " +"numeric types such as :class:`float` and :class:`int`. All of the usual " +"math operations and special methods apply. Likewise, decimal objects can be " +"copied, pickled, printed, used as dictionary keys, used as set elements, " +"compared, sorted, and coerced to another type (such as :class:`float` or :" +"class:`int`)." +msgstr "" + +msgid "" +"There are some small differences between arithmetic on Decimal objects and " +"arithmetic on integers and floats. When the remainder operator ``%`` is " +"applied to Decimal objects, the sign of the result is the sign of the " +"*dividend* rather than the sign of the divisor::" +msgstr "" +"Існують деякі невеликі відмінності між арифметикою на десяткових об’єктах і " +"арифметикою на цілих числах і числах з плаваючою точкою. Коли оператор " +"залишку ``%`` застосовується до десяткових об’єктів, знаком результату є " +"знак *діленого*, а не знак дільника::" + +msgid "" +">>> (-7) % 4\n" +"1\n" +">>> Decimal(-7) % Decimal(4)\n" +"Decimal('-3')" +msgstr "" + +msgid "" +"The integer division operator ``//`` behaves analogously, returning the " +"integer part of the true quotient (truncating towards zero) rather than its " +"floor, so as to preserve the usual identity ``x == (x // y) * y + x % y``::" +msgstr "" +"Оператор цілочисельного ділення ``//`` поводиться аналогічно, повертаючи " +"цілу частину справжньої частки (урізану до нуля), а не її нижню частину, щоб " +"зберегти звичайну тотожність ``x == (x // y) * y + x % y``::" + +msgid "" +">>> -7 // 4\n" +"-2\n" +">>> Decimal(-7) // Decimal(4)\n" +"Decimal('-1')" +msgstr "" + +msgid "" +"The ``%`` and ``//`` operators implement the ``remainder`` and ``divide-" +"integer`` operations (respectively) as described in the specification." +msgstr "" +"Оператори ``%`` і ``//`` реалізують операції ``remainder`` і ``divide-" +"integer`` (відповідно), як описано в специфікації." + +msgid "" +"Decimal objects cannot generally be combined with floats or instances of :" +"class:`fractions.Fraction` in arithmetic operations: an attempt to add a :" +"class:`Decimal` to a :class:`float`, for example, will raise a :exc:" +"`TypeError`. However, it is possible to use Python's comparison operators " +"to compare a :class:`Decimal` instance ``x`` with another number ``y``. " +"This avoids confusing results when doing equality comparisons between " +"numbers of different types." +msgstr "" +"Десяткові об’єкти зазвичай не можна поєднувати з числами з плаваючою точкою " +"або екземплярами :class:`fractions.Fraction` в арифметичних операціях: " +"спроба додати :class:`Decimal` до :class:`float`, наприклад, призведе до :" +"exc:`TypeError`. Однак можна використовувати оператори порівняння Python для " +"порівняння :class:`Decimal` екземпляра ``x`` з іншим числом ``y``. Це " +"дозволяє уникнути плутанини в результатах під час порівняння рівності між " +"числами різних типів." + +msgid "" +"Mixed-type comparisons between :class:`Decimal` instances and other numeric " +"types are now fully supported." +msgstr "" +"Порівняння змішаного типу між екземплярами :class:`Decimal` та іншими " +"числовими типами тепер повністю підтримуються." + +msgid "" +"In addition to the standard numeric properties, decimal floating-point " +"objects also have a number of specialized methods:" +msgstr "" + +msgid "" +"Return the adjusted exponent after shifting out the coefficient's rightmost " +"digits until only the lead digit remains: ``Decimal('321e+5').adjusted()`` " +"returns seven. Used for determining the position of the most significant " +"digit with respect to the decimal point." +msgstr "" +"Повертає скоригований експонент після зміщення крайніх правих цифр " +"коефіцієнта, доки не залишиться лише головна цифра: ``Decimal('321e+5')." +"adjusted()`` повертає сім. Використовується для визначення позиції старшого " +"розряду відносно коми." + +msgid "" +"Return a pair ``(n, d)`` of integers that represent the given :class:" +"`Decimal` instance as a fraction, in lowest terms and with a positive " +"denominator::" +msgstr "" +"Повертає пару ``(n, d)`` цілих чисел, які представляють даний екземпляр :" +"class:`Decimal` у вигляді дробу в найменших членах і з позитивним " +"знаменником::" + +msgid "" +">>> Decimal('-3.14').as_integer_ratio()\n" +"(-157, 50)" +msgstr "" + +msgid "" +"The conversion is exact. Raise OverflowError on infinities and ValueError " +"on NaNs." +msgstr "" +"Перетворення точне. Викликайте OverflowError на нескінченності та ValueError " +"на NaN." + +msgid "" +"Return a :term:`named tuple` representation of the number: " +"``DecimalTuple(sign, digits, exponent)``." +msgstr "" +"Повертає представлення числа :term:`named tuple`: ``DecimalTuple(знак, " +"цифри, експонента)``." + +msgid "" +"Return the canonical encoding of the argument. Currently, the encoding of " +"a :class:`Decimal` instance is always canonical, so this operation returns " +"its argument unchanged." +msgstr "" +"Повертає канонічне кодування аргументу. Наразі кодування екземпляра :class:" +"`Decimal` завжди канонічне, тому ця операція повертає його аргумент без змін." + +msgid "" +"Compare the values of two Decimal instances. :meth:`compare` returns a " +"Decimal instance, and if either operand is a NaN then the result is a NaN::" +msgstr "" +"Порівняйте значення двох екземплярів Decimal. :meth:`compare` повертає " +"екземпляр Decimal, і якщо один із операндів є NaN, то результатом є NaN::" + +msgid "" +"a or b is a NaN ==> Decimal('NaN')\n" +"a < b ==> Decimal('-1')\n" +"a == b ==> Decimal('0')\n" +"a > b ==> Decimal('1')" +msgstr "" + +msgid "" +"This operation is identical to the :meth:`compare` method, except that all " +"NaNs signal. That is, if neither operand is a signaling NaN then any quiet " +"NaN operand is treated as though it were a signaling NaN." +msgstr "" +"Ця операція ідентична методу :meth:`compare`, за винятком того, що " +"сигналізують усі NaN. Тобто, якщо жоден операнд не є сигнальним NaN, тоді " +"будь-який тихий NaN операнд розглядається як сигнальний NaN." + +msgid "" +"Compare two operands using their abstract representation rather than their " +"numerical value. Similar to the :meth:`compare` method, but the result " +"gives a total ordering on :class:`Decimal` instances. Two :class:`Decimal` " +"instances with the same numeric value but different representations compare " +"unequal in this ordering:" +msgstr "" +"Порівняйте два операнди, використовуючи їх абстрактне представлення, а не " +"числове значення. Подібно до методу :meth:`compare`, але результат дає " +"загальне впорядкування екземплярів :class:`Decimal`. Два екземпляри :class:" +"`Decimal` з однаковим числовим значенням, але різними представленнями " +"порівнюються нерівномірно в такому порядку:" + +msgid "" +"Quiet and signaling NaNs are also included in the total ordering. The " +"result of this function is ``Decimal('0')`` if both operands have the same " +"representation, ``Decimal('-1')`` if the first operand is lower in the total " +"order than the second, and ``Decimal('1')`` if the first operand is higher " +"in the total order than the second operand. See the specification for " +"details of the total order." +msgstr "" +"Безшумні та сигнальні NaN також включені в загальне замовлення. Результатом " +"цієї функції є ``Decimal('0')``, якщо обидва операнди мають однакове " +"представлення, ``Decimal('-1')``, якщо перший операнд є нижчим у загальному " +"порядку, ніж другий, і ``Decimal('1')``, якщо перший операнд вищий у " +"загальному порядку, ніж другий операнд. Дивіться специфікацію для детальної " +"інформації про загальне замовлення." + +msgid "" +"This operation is unaffected by context and is quiet: no flags are changed " +"and no rounding is performed. As an exception, the C version may raise " +"InvalidOperation if the second operand cannot be converted exactly." +msgstr "" +"Ця операція не залежить від контексту та є тихою: прапорці не змінюються та " +"округлення не виконується. Як виняток, версія C може викликати " +"InvalidOperation, якщо другий операнд не може бути точно перетворений." + +msgid "" +"Compare two operands using their abstract representation rather than their " +"value as in :meth:`compare_total`, but ignoring the sign of each operand. " +"``x.compare_total_mag(y)`` is equivalent to ``x.copy_abs().compare_total(y." +"copy_abs())``." +msgstr "" +"Порівняйте два операнди, використовуючи їх абстрактне представлення, а не " +"значення, як у :meth:`compare_total`, але ігноруючи знак кожного операнда. " +"``x.compare_total_mag(y)`` еквівалентно ``x.copy_abs().compare_total(y." +"copy_abs())``." + +msgid "" +"Just returns self, this method is only to comply with the Decimal " +"Specification." +msgstr "" +"Просто повертає self, цей метод призначений лише для відповідності " +"десятковій специфікації." + +msgid "" +"Return the absolute value of the argument. This operation is unaffected by " +"the context and is quiet: no flags are changed and no rounding is performed." +msgstr "" +"Повертає абсолютне значення аргументу. Ця операція не залежить від контексту " +"та є тихою: прапорці не змінюються та округлення не виконується." + +msgid "" +"Return the negation of the argument. This operation is unaffected by the " +"context and is quiet: no flags are changed and no rounding is performed." +msgstr "" +"Повернути заперечення аргументу. Ця операція не залежить від контексту та є " +"тихою: прапорці не змінюються та округлення не виконується." + +msgid "" +"Return a copy of the first operand with the sign set to be the same as the " +"sign of the second operand. For example:" +msgstr "" +"Повертає копію першого операнда зі знаком, який збігається зі знаком другого " +"операнда. Наприклад:" + +msgid "" +"Return the value of the (natural) exponential function ``e**x`` at the given " +"number. The result is correctly rounded using the :const:`ROUND_HALF_EVEN` " +"rounding mode." +msgstr "" +"Повертає значення (натуральної) експоненціальної функції ``e**x`` за заданим " +"числом. Результат правильно округлюється за допомогою режиму округлення :" +"const:`ROUND_HALF_EVEN`." + +msgid "" +"Alternative constructor that only accepts instances of :class:`float` or :" +"class:`int`." +msgstr "" +"Альтернативний конструктор, який приймає лише екземпляри :class:`float` або :" +"class:`int`." + +msgid "" +"Note ``Decimal.from_float(0.1)`` is not the same as ``Decimal('0.1')``. " +"Since 0.1 is not exactly representable in binary floating point, the value " +"is stored as the nearest representable value which is " +"``0x1.999999999999ap-4``. That equivalent value in decimal is " +"``0.1000000000000000055511151231257827021181583404541015625``." +msgstr "" + +msgid "" +"From Python 3.2 onwards, a :class:`Decimal` instance can also be constructed " +"directly from a :class:`float`." +msgstr "" +"Починаючи з Python 3.2 і далі, екземпляр :class:`Decimal` також можна " +"створити безпосередньо з :class:`float`." + +msgid "" +">>> Decimal.from_float(0.1)\n" +"Decimal('0.1000000000000000055511151231257827021181583404541015625')\n" +">>> Decimal.from_float(float('nan'))\n" +"Decimal('NaN')\n" +">>> Decimal.from_float(float('inf'))\n" +"Decimal('Infinity')\n" +">>> Decimal.from_float(float('-inf'))\n" +"Decimal('-Infinity')" +msgstr "" + +msgid "" +"Fused multiply-add. Return self*other+third with no rounding of the " +"intermediate product self*other." +msgstr "" +"Злитий множення-додавання. Повертає self*other+third без округлення " +"проміжного продукту self*other." + +msgid "" +"Return :const:`True` if the argument is canonical and :const:`False` " +"otherwise. Currently, a :class:`Decimal` instance is always canonical, so " +"this operation always returns :const:`True`." +msgstr "" +"Повертає :const:`True`, якщо аргумент є канонічним, і :const:`False` в " +"іншому випадку. Наразі екземпляр :class:`Decimal` завжди є канонічним, тому " +"ця операція завжди повертає :const:`True`." + +msgid "" +"Return :const:`True` if the argument is a finite number, and :const:`False` " +"if the argument is an infinity or a NaN." +msgstr "" +"Повертає :const:`True`, якщо аргумент є скінченним числом, і :const:`False`, " +"якщо аргументом є нескінченність або NaN." + +msgid "" +"Return :const:`True` if the argument is either positive or negative infinity " +"and :const:`False` otherwise." +msgstr "" +"Повертає :const:`True`, якщо аргумент є додатною або від’ємною " +"нескінченністю, і :const:`False` в іншому випадку." + +msgid "" +"Return :const:`True` if the argument is a (quiet or signaling) NaN and :" +"const:`False` otherwise." +msgstr "" +"Повертає :const:`True`, якщо аргумент є (тихим або сигнальним) NaN, і :const:" +"`False` в іншому випадку." + +msgid "" +"Return :const:`True` if the argument is a *normal* finite number. Return :" +"const:`False` if the argument is zero, subnormal, infinite or a NaN." +msgstr "" +"Повертає :const:`True`, якщо аргумент є *звичайним* кінцевим числом. " +"Повертає :const:`False`, якщо аргумент нульовий, субнормальний, нескінченний " +"або NaN." + +msgid "" +"Return :const:`True` if the argument is a quiet NaN, and :const:`False` " +"otherwise." +msgstr "" +"Повертає :const:`True`, якщо аргумент є тихим NaN, і :const:`False` в іншому " +"випадку." + +msgid "" +"Return :const:`True` if the argument has a negative sign and :const:`False` " +"otherwise. Note that zeros and NaNs can both carry signs." +msgstr "" +"Повертає :const:`True`, якщо аргумент має негативний знак, і :const:`False` " +"в іншому випадку. Зауважте, що і нулі, і NaN можуть мати знаки." + +msgid "" +"Return :const:`True` if the argument is a signaling NaN and :const:`False` " +"otherwise." +msgstr "" +"Повертає :const:`True`, якщо аргумент є сигнальним NaN, і :const:`False` в " +"іншому випадку." + +msgid "" +"Return :const:`True` if the argument is subnormal, and :const:`False` " +"otherwise." +msgstr "" +"Повертає :const:`True`, якщо аргумент ненормальний, і :const:`False` в " +"іншому випадку." + +msgid "" +"Return :const:`True` if the argument is a (positive or negative) zero and :" +"const:`False` otherwise." +msgstr "" +"Повертає :const:`True`, якщо аргумент є (позитивним або від’ємним) нулем, і :" +"const:`False` в іншому випадку." + +msgid "" +"Return the natural (base e) logarithm of the operand. The result is " +"correctly rounded using the :const:`ROUND_HALF_EVEN` rounding mode." +msgstr "" +"Повертає натуральний (за основою e) логарифм операнда. Результат правильно " +"округлюється за допомогою режиму округлення :const:`ROUND_HALF_EVEN`." + +msgid "" +"Return the base ten logarithm of the operand. The result is correctly " +"rounded using the :const:`ROUND_HALF_EVEN` rounding mode." +msgstr "" +"Повертає десятий логарифм операнда. Результат правильно округлюється за " +"допомогою режиму округлення :const:`ROUND_HALF_EVEN`." + +msgid "" +"For a nonzero number, return the adjusted exponent of its operand as a :" +"class:`Decimal` instance. If the operand is a zero then ``Decimal('-" +"Infinity')`` is returned and the :const:`DivisionByZero` flag is raised. If " +"the operand is an infinity then ``Decimal('Infinity')`` is returned." +msgstr "" +"Для відмінного від нуля числа поверніть скоригований експонент його операнда " +"як екземпляр :class:`Decimal`. Якщо операнд дорівнює нулю, повертається " +"``Decimal('-Infinity')`` і піднімається прапор :const:`DivisionByZero`. Якщо " +"операнд є нескінченністю, тоді повертається ``Decimal('Infinity')``." + +msgid "" +":meth:`logical_and` is a logical operation which takes two *logical " +"operands* (see :ref:`logical_operands_label`). The result is the digit-wise " +"``and`` of the two operands." +msgstr "" +":meth:`logical_and` — це логічна операція, яка приймає два *логічних " +"операнда* (див. :ref:`logical_operands_label`). Результатом є порозрядне " +"``і`` двох операндів." + +msgid "" +":meth:`logical_invert` is a logical operation. The result is the digit-wise " +"inversion of the operand." +msgstr "" +":meth:`logical_invert` є логічною операцією. Результатом є порозрядна " +"інверсія операнда." + +msgid "" +":meth:`logical_or` is a logical operation which takes two *logical operands* " +"(see :ref:`logical_operands_label`). The result is the digit-wise ``or`` of " +"the two operands." +msgstr "" +":meth:`logical_or` — це логічна операція, яка приймає два *логічних " +"операнда* (див. :ref:`logical_operands_label`). Результатом є порозрядне " +"\"або\" двох операндів." + +msgid "" +":meth:`logical_xor` is a logical operation which takes two *logical " +"operands* (see :ref:`logical_operands_label`). The result is the digit-wise " +"exclusive or of the two operands." +msgstr "" +":meth:`logical_xor` — це логічна операція, яка приймає два *логічних " +"операнда* (див. :ref:`logical_operands_label`). Результатом є розрядний " +"виключний або двох операндів." + +msgid "" +"Like ``max(self, other)`` except that the context rounding rule is applied " +"before returning and that ``NaN`` values are either signaled or ignored " +"(depending on the context and whether they are signaling or quiet)." +msgstr "" + +msgid "" +"Similar to the :meth:`.max` method, but the comparison is done using the " +"absolute values of the operands." +msgstr "" +"Подібно до методу :meth:`.max`, але порівняння виконується з використанням " +"абсолютних значень операндів." + +msgid "" +"Like ``min(self, other)`` except that the context rounding rule is applied " +"before returning and that ``NaN`` values are either signaled or ignored " +"(depending on the context and whether they are signaling or quiet)." +msgstr "" + +msgid "" +"Similar to the :meth:`.min` method, but the comparison is done using the " +"absolute values of the operands." +msgstr "" +"Подібно до методу :meth:`.min`, але порівняння виконується з використанням " +"абсолютних значень операндів." + +msgid "" +"Return the largest number representable in the given context (or in the " +"current thread's context if no context is given) that is smaller than the " +"given operand." +msgstr "" +"Повертає найбільше число, яке можна представити в заданому контексті (або в " +"контексті поточного потоку, якщо контекст не задано), яке є меншим за " +"заданий операнд." + +msgid "" +"Return the smallest number representable in the given context (or in the " +"current thread's context if no context is given) that is larger than the " +"given operand." +msgstr "" +"Повертає найменше число, яке можна представити в заданому контексті (або в " +"контексті поточного потоку, якщо контекст не задано), яке більше заданого " +"операнда." + +msgid "" +"If the two operands are unequal, return the number closest to the first " +"operand in the direction of the second operand. If both operands are " +"numerically equal, return a copy of the first operand with the sign set to " +"be the same as the sign of the second operand." +msgstr "" +"Якщо два операнди нерівні, поверніть число, найближче до першого операнду в " +"напрямку другого операнда. Якщо обидва операнди чисельно рівні, поверніть " +"копію першого операнда зі знаком, встановленим таким самим, як знак другого " +"операнда." + +msgid "" +"Used for producing canonical values of an equivalence class within either " +"the current context or the specified context." +msgstr "" + +msgid "" +"This has the same semantics as the unary plus operation, except that if the " +"final result is finite it is reduced to its simplest form, with all trailing " +"zeros removed and its sign preserved. That is, while the coefficient is non-" +"zero and a multiple of ten the coefficient is divided by ten and the " +"exponent is incremented by 1. Otherwise (the coefficient is zero) the " +"exponent is set to 0. In all cases the sign is unchanged." +msgstr "" + +msgid "" +"For example, ``Decimal('32.100')`` and ``Decimal('0.321000e+2')`` both " +"normalize to the equivalent value ``Decimal('32.1')``." +msgstr "" + +msgid "Note that rounding is applied *before* reducing to simplest form." +msgstr "" + +msgid "" +"In the latest versions of the specification, this operation is also known as " +"``reduce``." +msgstr "" + +msgid "" +"Return a string describing the *class* of the operand. The returned value " +"is one of the following ten strings." +msgstr "" +"Повертає рядок, що описує *клас* операнда. Повернене значення є одним із " +"наступних десяти рядків." + +msgid "``\"-Infinity\"``, indicating that the operand is negative infinity." +msgstr "``\"-Infinity\"``, що вказує, що операнд є негативною нескінченністю." + +msgid "" +"``\"-Normal\"``, indicating that the operand is a negative normal number." +msgstr "``\"-Normal\"``, вказуючи, що операнд є від’ємним нормальним числом." + +msgid "" +"``\"-Subnormal\"``, indicating that the operand is negative and subnormal." +msgstr "" +"``\"-Subnormal\"``, що вказує на те, що операнд від'ємний і ненормальний." + +msgid "``\"-Zero\"``, indicating that the operand is a negative zero." +msgstr "``\"-Zero\"``, вказуючи, що операнд є від’ємним нулем." + +msgid "``\"+Zero\"``, indicating that the operand is a positive zero." +msgstr "``\"+Zero\"``, вказуючи, що операнд є позитивним нулем." + +msgid "" +"``\"+Subnormal\"``, indicating that the operand is positive and subnormal." +msgstr "``\"+Subnormal\"``, що вказує, що операнд є додатним і субнормальним." + +msgid "" +"``\"+Normal\"``, indicating that the operand is a positive normal number." +msgstr "``\"+Normal\"``, вказуючи, що операнд є додатним нормальним числом." + +msgid "``\"+Infinity\"``, indicating that the operand is positive infinity." +msgstr "``\"+Infinity\"``, що вказує, що операнд є позитивною нескінченністю." + +msgid "``\"NaN\"``, indicating that the operand is a quiet NaN (Not a Number)." +msgstr "``\"NaN\"``, вказуючи, що операнд є тихим NaN (не числом)." + +msgid "``\"sNaN\"``, indicating that the operand is a signaling NaN." +msgstr "``\"sNaN\"``, вказуючи, що операнд є сигнальним NaN." + +msgid "" +"Return a value equal to the first operand after rounding and having the " +"exponent of the second operand." +msgstr "" +"Повертає значення, що дорівнює першому операнду після округлення та має " +"експоненту другого операнда." + +msgid "" +"Unlike other operations, if the length of the coefficient after the quantize " +"operation would be greater than precision, then an :const:`InvalidOperation` " +"is signaled. This guarantees that, unless there is an error condition, the " +"quantized exponent is always equal to that of the right-hand operand." +msgstr "" +"На відміну від інших операцій, якщо довжина коефіцієнта після операції " +"квантування буде більшою за точність, тоді сигналізується :const:" +"`InvalidOperation`. Це гарантує, що, якщо немає умови помилки, квантований " +"показник степеня завжди дорівнює показнику правого операнда." + +msgid "" +"Also unlike other operations, quantize never signals Underflow, even if the " +"result is subnormal and inexact." +msgstr "" +"Крім того, на відміну від інших операцій, квантування ніколи не сигналізує " +"про переповнення, навіть якщо результат ненормальний і неточний." + +msgid "" +"If the exponent of the second operand is larger than that of the first then " +"rounding may be necessary. In this case, the rounding mode is determined by " +"the ``rounding`` argument if given, else by the given ``context`` argument; " +"if neither argument is given the rounding mode of the current thread's " +"context is used." +msgstr "" +"Якщо експонента другого операнда більша, ніж експонента першого, може " +"знадобитися округлення. У цьому випадку режим округлення визначається " +"аргументом ``округлення``, якщо задано, інакше заданим аргументом " +"``контексту``; якщо жоден аргумент не задано, використовується режим " +"округлення контексту поточного потоку." + +msgid "" +"An error is returned whenever the resulting exponent is greater than :attr:" +"`~Context.Emax` or less than :meth:`~Context.Etiny`." +msgstr "" + +msgid "" +"Return ``Decimal(10)``, the radix (base) in which the :class:`Decimal` class " +"does all its arithmetic. Included for compatibility with the specification." +msgstr "" +"Повертає ``Decimal(10)``, основу (базу), у якій клас :class:`Decimal` " +"виконує всю свою арифметику. Включено для сумісності зі специфікацією." + +msgid "" +"Return the remainder from dividing *self* by *other*. This differs from " +"``self % other`` in that the sign of the remainder is chosen so as to " +"minimize its absolute value. More precisely, the return value is ``self - n " +"* other`` where ``n`` is the integer nearest to the exact value of ``self / " +"other``, and if two integers are equally near then the even one is chosen." +msgstr "" +"Повертає залишок від ділення *self* на *other*. Це відрізняється від ``self " +"% other`` тим, що знак залишку вибрано таким чином, щоб мінімізувати його " +"абсолютне значення. Точніше, повертається значення ``self - n * other``, де " +"``n`` є цілим числом, найближчим до точного значення ``self / other``, і " +"якщо два цілі числа однаково близькі, то парне вибрано." + +msgid "If the result is zero then its sign will be the sign of *self*." +msgstr "Якщо результат дорівнює нулю, то його знак буде знаком *self*." + +msgid "" +"Return the result of rotating the digits of the first operand by an amount " +"specified by the second operand. The second operand must be an integer in " +"the range -precision through precision. The absolute value of the second " +"operand gives the number of places to rotate. If the second operand is " +"positive then rotation is to the left; otherwise rotation is to the right. " +"The coefficient of the first operand is padded on the left with zeros to " +"length precision if necessary. The sign and exponent of the first operand " +"are unchanged." +msgstr "" +"Повертає результат повороту цифр першого операнда на величину, визначену " +"другим операндом. Другий операнд має бути цілим числом у діапазоні від " +"точності до точності. Абсолютне значення другого операнда дає кількість " +"місць для обертання. Якщо другий операнд додатний, то обертання відбувається " +"вліво; інакше обертання праворуч. Коефіцієнт першого операнда доповнюється " +"зліва нулями з точністю до довжини, якщо необхідно. Знак і експонента " +"першого операнда не змінюються." + +msgid "" +"Test whether self and other have the same exponent or whether both are " +"``NaN``." +msgstr "" + +msgid "" +"Return the first operand with exponent adjusted by the second. Equivalently, " +"return the first operand multiplied by ``10**other``. The second operand " +"must be an integer." +msgstr "" +"Повертає перший операнд з експонентою, скоригованою другим. Аналогічно " +"повертає перший операнд, помножений на ``10**other``. Другий операнд має " +"бути цілим числом." + +msgid "" +"Return the result of shifting the digits of the first operand by an amount " +"specified by the second operand. The second operand must be an integer in " +"the range -precision through precision. The absolute value of the second " +"operand gives the number of places to shift. If the second operand is " +"positive then the shift is to the left; otherwise the shift is to the " +"right. Digits shifted into the coefficient are zeros. The sign and " +"exponent of the first operand are unchanged." +msgstr "" +"Повертає результат зсуву цифр першого операнда на величину, визначену другим " +"операндом. Другий операнд має бути цілим числом у діапазоні від точності до " +"точності. Абсолютне значення другого операнда дає кількість місць для зсуву. " +"Якщо другий операнд позитивний, то зсув виконується вліво; інакше зсув " +"відбувається вправо. Цифри, зсунуті в коефіцієнт, є нулями. Знак і " +"експонента першого операнда не змінюються." + +msgid "Return the square root of the argument to full precision." +msgstr "Повертає квадратний корінь аргументу з повною точністю." + +msgid "" +"Convert to a string, using engineering notation if an exponent is needed." +msgstr "" +"Перетворіть на рядок, використовуючи технічну нотацію, якщо потрібен " +"експонент." + +msgid "" +"Engineering notation has an exponent which is a multiple of 3. This can " +"leave up to 3 digits to the left of the decimal place and may require the " +"addition of either one or two trailing zeros." +msgstr "" +"Інженерна нотація має експоненту, кратну 3. Це може залишати до 3 цифр " +"ліворуч від десяткового знака та може потребувати додавання одного або двох " +"нулів у кінці." + +msgid "" +"For example, this converts ``Decimal('123E+1')`` to ``Decimal('1.23E+3')``." +msgstr "" +"Наприклад, це перетворює ``Decimal('123E+1')`` на ``Decimal('1.23E+3')``." + +msgid "" +"Identical to the :meth:`to_integral_value` method. The ``to_integral`` name " +"has been kept for compatibility with older versions." +msgstr "" +"Ідентичний методу :meth:`to_integral_value`. Ім'я ``to_integral`` було " +"збережено для сумісності зі старими версіями." + +msgid "" +"Round to the nearest integer, signaling :const:`Inexact` or :const:`Rounded` " +"as appropriate if rounding occurs. The rounding mode is determined by the " +"``rounding`` parameter if given, else by the given ``context``. If neither " +"parameter is given then the rounding mode of the current context is used." +msgstr "" +"Округлити до найближчого цілого числа, сигналізуючи :const:`Inexact` або :" +"const:`Rounded` відповідно, якщо відбувається округлення. Режим округлення " +"визначається параметром ``rounding``, якщо він заданий, інакше заданим " +"``context``. Якщо жоден параметр не вказано, використовується режим " +"округлення поточного контексту." + +msgid "" +"Round to the nearest integer without signaling :const:`Inexact` or :const:" +"`Rounded`. If given, applies *rounding*; otherwise, uses the rounding " +"method in either the supplied *context* or the current context." +msgstr "" +"Округлення до найближчого цілого без сигналізації :const:`Inexact` або :" +"const:`Rounded`. Якщо вказано, застосовує *округлення*; інакше використовує " +"метод округлення або в наданому *контексті*, або в поточному контексті." + +msgid "Decimal numbers can be rounded using the :func:`.round` function:" +msgstr "" + +msgid "" +"If *ndigits* is not given or ``None``, returns the nearest :class:`int` to " +"*number*, rounding ties to even, and ignoring the rounding mode of the :" +"class:`Decimal` context. Raises :exc:`OverflowError` if *number* is an " +"infinity or :exc:`ValueError` if it is a (quiet or signaling) NaN." +msgstr "" + +msgid "" +"If *ndigits* is an :class:`int`, the context's rounding mode is respected " +"and a :class:`Decimal` representing *number* rounded to the nearest multiple " +"of ``Decimal('1E-ndigits')`` is returned; in this case, ``round(number, " +"ndigits)`` is equivalent to ``self.quantize(Decimal('1E-ndigits'))``. " +"Returns ``Decimal('NaN')`` if *number* is a quiet NaN. Raises :class:" +"`InvalidOperation` if *number* is an infinity, a signaling NaN, or if the " +"length of the coefficient after the quantize operation would be greater than " +"the current context's precision. In other words, for the non-corner cases:" +msgstr "" + +msgid "" +"if *ndigits* is positive, return *number* rounded to *ndigits* decimal " +"places;" +msgstr "" + +msgid "if *ndigits* is zero, return *number* rounded to the nearest integer;" +msgstr "" + +msgid "" +"if *ndigits* is negative, return *number* rounded to the nearest multiple of " +"``10**abs(ndigits)``." +msgstr "" + +msgid "For example::" +msgstr "Наприклад::" + +msgid "" +">>> from decimal import Decimal, getcontext, ROUND_DOWN\n" +">>> getcontext().rounding = ROUND_DOWN\n" +">>> round(Decimal('3.75')) # context rounding ignored\n" +"4\n" +">>> round(Decimal('3.5')) # round-ties-to-even\n" +"4\n" +">>> round(Decimal('3.75'), 0) # uses the context rounding\n" +"Decimal('3')\n" +">>> round(Decimal('3.75'), 1)\n" +"Decimal('3.7')\n" +">>> round(Decimal('3.75'), -1)\n" +"Decimal('0E+1')" +msgstr "" + +msgid "Logical operands" +msgstr "Логічні операнди" + +msgid "" +"The :meth:`~Decimal.logical_and`, :meth:`~Decimal.logical_invert`, :meth:" +"`~Decimal.logical_or`, and :meth:`~Decimal.logical_xor` methods expect their " +"arguments to be *logical operands*. A *logical operand* is a :class:" +"`Decimal` instance whose exponent and sign are both zero, and whose digits " +"are all either ``0`` or ``1``." +msgstr "" + +msgid "Context objects" +msgstr "Об'єкти контексту" + +msgid "" +"Contexts are environments for arithmetic operations. They govern precision, " +"set rules for rounding, determine which signals are treated as exceptions, " +"and limit the range for exponents." +msgstr "" +"Контексти - це середовища для арифметичних операцій. Вони керують точністю, " +"встановлюють правила округлення, визначають, які сигнали розглядаються як " +"винятки, і обмежують діапазон для експонент." + +msgid "" +"Each thread has its own current context which is accessed or changed using " +"the :func:`getcontext` and :func:`setcontext` functions:" +msgstr "" +"Кожен потік має власний поточний контекст, до якого можна отримати доступ " +"або змінити його за допомогою функцій :func:`getcontext` і :func:" +"`setcontext`:" + +msgid "Return the current context for the active thread." +msgstr "Повертає поточний контекст для активного потоку." + +msgid "Set the current context for the active thread to *c*." +msgstr "Установіть поточний контекст для активного потоку на *c*." + +msgid "" +"You can also use the :keyword:`with` statement and the :func:`localcontext` " +"function to temporarily change the active context." +msgstr "" +"Ви також можете використовувати оператор :keyword:`with` і функцію :func:" +"`localcontext`, щоб тимчасово змінити активний контекст." + +msgid "" +"Return a context manager that will set the current context for the active " +"thread to a copy of *ctx* on entry to the with-statement and restore the " +"previous context when exiting the with-statement. If no context is " +"specified, a copy of the current context is used. The *kwargs* argument is " +"used to set the attributes of the new context." +msgstr "" + +msgid "" +"For example, the following code sets the current decimal precision to 42 " +"places, performs a calculation, and then automatically restores the previous " +"context::" +msgstr "" +"Наприклад, наступний код встановлює поточну десяткову точність на 42 знаки, " +"виконує обчислення, а потім автоматично відновлює попередній контекст::" + +msgid "" +"from decimal import localcontext\n" +"\n" +"with localcontext() as ctx:\n" +" ctx.prec = 42 # Perform a high precision calculation\n" +" s = calculate_something()\n" +"s = +s # Round the final result back to the default precision" +msgstr "" + +msgid "Using keyword arguments, the code would be the following::" +msgstr "" + +msgid "" +"from decimal import localcontext\n" +"\n" +"with localcontext(prec=42) as ctx:\n" +" s = calculate_something()\n" +"s = +s" +msgstr "" + +msgid "" +"Raises :exc:`TypeError` if *kwargs* supplies an attribute that :class:" +"`Context` doesn't support. Raises either :exc:`TypeError` or :exc:" +"`ValueError` if *kwargs* supplies an invalid value for an attribute." +msgstr "" + +msgid "" +":meth:`localcontext` now supports setting context attributes through the use " +"of keyword arguments." +msgstr "" + +msgid "" +"New contexts can also be created using the :class:`Context` constructor " +"described below. In addition, the module provides three pre-made contexts:" +msgstr "" +"Нові контексти також можна створити за допомогою конструктора :class:" +"`Context`, описаного нижче. Крім того, модуль надає три готові контексти:" + +msgid "" +"This is a standard context defined by the General Decimal Arithmetic " +"Specification. Precision is set to nine. Rounding is set to :const:" +"`ROUND_HALF_UP`. All flags are cleared. All traps are enabled (treated as " +"exceptions) except :const:`Inexact`, :const:`Rounded`, and :const:" +"`Subnormal`." +msgstr "" +"Це стандартний контекст, визначений Загальною специфікацією десяткової " +"арифметики. Точність встановлена на дев'ять. Округлення встановлено на :" +"const:`ROUND_HALF_UP`. Усі прапори видалено. Усі перехоплення ввімкнено " +"(розглядаються як винятки), крім :const:`Inexact`, :const:`Rounded` і :const:" +"`Subnormal`." + +msgid "" +"Because many of the traps are enabled, this context is useful for debugging." +msgstr "" +"Оскільки багато пасток увімкнено, цей контекст корисний для налагодження." + +msgid "" +"This is a standard context defined by the General Decimal Arithmetic " +"Specification. Precision is set to nine. Rounding is set to :const:" +"`ROUND_HALF_EVEN`. All flags are cleared. No traps are enabled (so that " +"exceptions are not raised during computations)." +msgstr "" +"Це стандартний контекст, визначений Загальною специфікацією десяткової " +"арифметики. Точність встановлена на дев'ять. Округлення встановлено на :" +"const:`ROUND_HALF_EVEN`. Усі прапори видалено. Перехоплення не ввімкнено " +"(щоб винятки не виникали під час обчислень)." + +msgid "" +"Because the traps are disabled, this context is useful for applications that " +"prefer to have result value of ``NaN`` or ``Infinity`` instead of raising " +"exceptions. This allows an application to complete a run in the presence of " +"conditions that would otherwise halt the program." +msgstr "" + +msgid "" +"This context is used by the :class:`Context` constructor as a prototype for " +"new contexts. Changing a field (such a precision) has the effect of " +"changing the default for new contexts created by the :class:`Context` " +"constructor." +msgstr "" +"Цей контекст використовується конструктором :class:`Context` як прототип для " +"нових контекстів. Зміна поля (така точність) призводить до зміни типового " +"значення для нових контекстів, створених конструктором :class:`Context`." + +msgid "" +"This context is most useful in multi-threaded environments. Changing one of " +"the fields before threads are started has the effect of setting system-wide " +"defaults. Changing the fields after threads have started is not recommended " +"as it would require thread synchronization to prevent race conditions." +msgstr "" +"Цей контекст найбільш корисний у багатопоточних середовищах. Зміна одного з " +"полів перед запуском потоків призводить до встановлення загальносистемних " +"значень за замовчуванням. Змінювати поля після початку потоків не " +"рекомендується, оскільки це потребуватиме синхронізації потоків, щоб " +"запобігти конкуренції." + +msgid "" +"In single threaded environments, it is preferable to not use this context at " +"all. Instead, simply create contexts explicitly as described below." +msgstr "" +"В однопотокових середовищах краще взагалі не використовувати цей контекст. " +"Натомість просто створіть контексти явно, як описано нижче." + +msgid "" +"The default values are :attr:`Context.prec`\\ =\\ ``28``, :attr:`Context." +"rounding`\\ =\\ :const:`ROUND_HALF_EVEN`, and enabled traps for :class:" +"`Overflow`, :class:`InvalidOperation`, and :class:`DivisionByZero`." +msgstr "" + +msgid "" +"In addition to the three supplied contexts, new contexts can be created with " +"the :class:`Context` constructor." +msgstr "" +"На додаток до трьох наданих контекстів, нові контексти можна створювати за " +"допомогою конструктора :class:`Context`." + +msgid "" +"Creates a new context. If a field is not specified or is :const:`None`, the " +"default values are copied from the :const:`DefaultContext`. If the *flags* " +"field is not specified or is :const:`None`, all flags are cleared." +msgstr "" +"Створює новий контекст. Якщо поле не вказано або має значення :const:`None`, " +"значення за замовчуванням копіюються з :const:`DefaultContext`. Якщо поле " +"*flags* не вказано або має значення :const:`None`, усі прапорці скидаються." + +msgid "" +"*prec* is an integer in the range [``1``, :const:`MAX_PREC`] that sets the " +"precision for arithmetic operations in the context." +msgstr "" + +msgid "" +"The *rounding* option is one of the constants listed in the section " +"`Rounding Modes`_." +msgstr "" +"Опція *округлення* є однією з констант, перелічених у розділі `Режими " +"округлення`_." + +msgid "" +"The *traps* and *flags* fields list any signals to be set. Generally, new " +"contexts should only set traps and leave the flags clear." +msgstr "" +"У полях *traps* і *flags* перелічено всі сигнали, які потрібно встановити. " +"Загалом, нові контексти мають лише встановлювати пастки та залишати прапорці " +"вільними." + +msgid "" +"The *Emin* and *Emax* fields are integers specifying the outer limits " +"allowable for exponents. *Emin* must be in the range [:const:`MIN_EMIN`, " +"``0``], *Emax* in the range [``0``, :const:`MAX_EMAX`]." +msgstr "" + +msgid "" +"The *capitals* field is either ``0`` or ``1`` (the default). If set to " +"``1``, exponents are printed with a capital ``E``; otherwise, a lowercase " +"``e`` is used: ``Decimal('6.02e+23')``." +msgstr "" + +msgid "" +"The *clamp* field is either ``0`` (the default) or ``1``. If set to ``1``, " +"the exponent ``e`` of a :class:`Decimal` instance representable in this " +"context is strictly limited to the range ``Emin - prec + 1 <= e <= Emax - " +"prec + 1``. If *clamp* is ``0`` then a weaker condition holds: the adjusted " +"exponent of the :class:`Decimal` instance is at most :attr:`~Context.Emax`. " +"When *clamp* is ``1``, a large normal number will, where possible, have its " +"exponent reduced and a corresponding number of zeros added to its " +"coefficient, in order to fit the exponent constraints; this preserves the " +"value of the number but loses information about significant trailing zeros. " +"For example::" +msgstr "" + +msgid "" +">>> Context(prec=6, Emax=999, clamp=1).create_decimal('1.23e999')\n" +"Decimal('1.23000E+999')" +msgstr "" + +msgid "" +"A *clamp* value of ``1`` allows compatibility with the fixed-width decimal " +"interchange formats specified in IEEE 754." +msgstr "" + +msgid "" +"The :class:`Context` class defines several general purpose methods as well " +"as a large number of methods for doing arithmetic directly in a given " +"context. In addition, for each of the :class:`Decimal` methods described " +"above (with the exception of the :meth:`~Decimal.adjusted` and :meth:" +"`~Decimal.as_tuple` methods) there is a corresponding :class:`Context` " +"method. For example, for a :class:`Context` instance ``C`` and :class:" +"`Decimal` instance ``x``, ``C.exp(x)`` is equivalent to ``x." +"exp(context=C)``. Each :class:`Context` method accepts a Python integer (an " +"instance of :class:`int`) anywhere that a Decimal instance is accepted." +msgstr "" + +msgid "Resets all of the flags to ``0``." +msgstr "" + +msgid "Resets all of the traps to ``0``." +msgstr "" + +msgid "Return a duplicate of the context." +msgstr "Повернути дублікат контексту." + +msgid "Return a copy of the Decimal instance num." +msgstr "Повернути копію екземпляра Decimal num." + +msgid "" +"Creates a new Decimal instance from *num* but using *self* as context. " +"Unlike the :class:`Decimal` constructor, the context precision, rounding " +"method, flags, and traps are applied to the conversion." +msgstr "" +"Створює новий екземпляр Decimal з *num*, але використовуючи *self* як " +"контекст. На відміну від конструктора :class:`Decimal`, до перетворення " +"застосовуються точність контексту, метод округлення, прапорці та " +"перехоплення." + +msgid "" +"This is useful because constants are often given to a greater precision than " +"is needed by the application. Another benefit is that rounding immediately " +"eliminates unintended effects from digits beyond the current precision. In " +"the following example, using unrounded inputs means that adding zero to a " +"sum can change the result:" +msgstr "" +"Це корисно, оскільки константи часто надаються з більшою точністю, ніж це " +"потрібно програмі. Ще одна перевага полягає в тому, що округлення негайно " +"усуває ненавмисні ефекти від цифр, що перевищують поточну точність. У " +"наступному прикладі використання неокруглених вхідних даних означає, що " +"додавання нуля до суми може змінити результат:" + +msgid "" +">>> getcontext().prec = 3\n" +">>> Decimal('3.4445') + Decimal('1.0023')\n" +"Decimal('4.45')\n" +">>> Decimal('3.4445') + Decimal(0) + Decimal('1.0023')\n" +"Decimal('4.44')" +msgstr "" + +msgid "" +"This method implements the to-number operation of the IBM specification. If " +"the argument is a string, no leading or trailing whitespace or underscores " +"are permitted." +msgstr "" +"Цей метод реалізує операцію до числа специфікації IBM. Якщо аргумент є " +"рядком, пробіли чи підкреслення на початку або в кінці не допускаються." + +msgid "" +"Creates a new Decimal instance from a float *f* but rounding using *self* as " +"the context. Unlike the :meth:`Decimal.from_float` class method, the " +"context precision, rounding method, flags, and traps are applied to the " +"conversion." +msgstr "" +"Створює новий екземпляр Decimal із числа з плаваючою точкою *f*, але " +"округляючи, використовуючи *self* як контекст. На відміну від методу класу :" +"meth:`Decimal.from_float`, до перетворення застосовуються точність " +"контексту, метод округлення, прапорці та перехоплення." + +msgid "" +">>> context = Context(prec=5, rounding=ROUND_DOWN)\n" +">>> context.create_decimal_from_float(math.pi)\n" +"Decimal('3.1415')\n" +">>> context = Context(prec=5, traps=[Inexact])\n" +">>> context.create_decimal_from_float(math.pi)\n" +"Traceback (most recent call last):\n" +" ...\n" +"decimal.Inexact: None" +msgstr "" + +msgid "" +"Returns a value equal to ``Emin - prec + 1`` which is the minimum exponent " +"value for subnormal results. When underflow occurs, the exponent is set to :" +"const:`Etiny`." +msgstr "" +"Повертає значення, що дорівнює ``Emin - prec + 1``, що є мінімальним " +"значенням експоненти для субнормальних результатів. Коли відбувається " +"переповнення, експонента встановлюється на :const:`Etiny`." + +msgid "Returns a value equal to ``Emax - prec + 1``." +msgstr "Повертає значення, рівне ``Emax - prec + 1``." + +msgid "" +"The usual approach to working with decimals is to create :class:`Decimal` " +"instances and then apply arithmetic operations which take place within the " +"current context for the active thread. An alternative approach is to use " +"context methods for calculating within a specific context. The methods are " +"similar to those for the :class:`Decimal` class and are only briefly " +"recounted here." +msgstr "" +"Звичайним підходом до роботи з десятковими числами є створення :class:" +"`Decimal` екземплярів, а потім застосування арифметичних операцій, які " +"виконуються в поточному контексті для активного потоку. Альтернативним " +"підходом є використання контекстних методів для обчислення в конкретному " +"контексті. Методи подібні до методів класу :class:`Decimal` і тут лише " +"коротко перераховані." + +msgid "Returns the absolute value of *x*." +msgstr "Повертає абсолютне значення *x*." + +msgid "Return the sum of *x* and *y*." +msgstr "Повертає суму *x* і *y*." + +msgid "Returns the same Decimal object *x*." +msgstr "Повертає той самий об’єкт Decimal *x*." + +msgid "Compares *x* and *y* numerically." +msgstr "Чисельно порівнює *x* і *y*." + +msgid "Compares the values of the two operands numerically." +msgstr "Чисельно порівнює значення двох операндів." + +msgid "Compares two operands using their abstract representation." +msgstr "Порівнює два операнди, використовуючи їх абстрактне представлення." + +msgid "" +"Compares two operands using their abstract representation, ignoring sign." +msgstr "" +"Порівнює два операнди, використовуючи їх абстрактне представлення, ігноруючи " +"знак." + +msgid "Returns a copy of *x* with the sign set to 0." +msgstr "Повертає копію *x* зі знаком 0." + +msgid "Returns a copy of *x* with the sign inverted." +msgstr "Повертає копію *x* з перевернутим знаком." + +msgid "Copies the sign from *y* to *x*." +msgstr "Копіює знак з *y* на *x*." + +msgid "Return *x* divided by *y*." +msgstr "Повертає *x*, поділене на *y*." + +msgid "Return *x* divided by *y*, truncated to an integer." +msgstr "Повертає *x*, поділене на *y*, усічене до цілого числа." + +msgid "Divides two numbers and returns the integer part of the result." +msgstr "Ділить два числа та повертає цілу частину результату." + +msgid "Returns ``e ** x``." +msgstr "" + +msgid "Returns *x* multiplied by *y*, plus *z*." +msgstr "Повертає *x*, помножене на *y*, плюс *z*." + +msgid "Returns ``True`` if *x* is canonical; otherwise returns ``False``." +msgstr "Повертає ``True``, якщо *x* канонічний; інакше повертає ``False``." + +msgid "Returns ``True`` if *x* is finite; otherwise returns ``False``." +msgstr "Повертає ``True``, якщо *x* є кінцевим; інакше повертає ``False``." + +msgid "Returns ``True`` if *x* is infinite; otherwise returns ``False``." +msgstr "Повертає ``True``, якщо *x* є нескінченним; інакше повертає ``False``." + +msgid "Returns ``True`` if *x* is a qNaN or sNaN; otherwise returns ``False``." +msgstr "" +"Повертає ``True``, якщо *x* є qNaN або sNaN; інакше повертає ``False``." + +msgid "" +"Returns ``True`` if *x* is a normal number; otherwise returns ``False``." +msgstr "" +"Повертає ``True``, якщо *x* є нормальним числом; інакше повертає ``False``." + +msgid "Returns ``True`` if *x* is a quiet NaN; otherwise returns ``False``." +msgstr "Повертає ``True``, якщо *x* є тихим NaN; інакше повертає ``False``." + +msgid "Returns ``True`` if *x* is negative; otherwise returns ``False``." +msgstr "Повертає ``True``, якщо *x* від'ємне; інакше повертає ``False``." + +msgid "" +"Returns ``True`` if *x* is a signaling NaN; otherwise returns ``False``." +msgstr "" +"Повертає ``True``, якщо *x* є сигнальним NaN; інакше повертає ``False``." + +msgid "Returns ``True`` if *x* is subnormal; otherwise returns ``False``." +msgstr "" +"Повертає ``True``, якщо *x* є субнормальним; інакше повертає ``False``." + +msgid "Returns ``True`` if *x* is a zero; otherwise returns ``False``." +msgstr "Повертає ``True``, якщо *x* дорівнює нулю; інакше повертає ``False``." + +msgid "Returns the natural (base e) logarithm of *x*." +msgstr "Повертає натуральний (за основою e) логарифм *x*." + +msgid "Returns the base 10 logarithm of *x*." +msgstr "Повертає логарифм *x* за основою 10." + +msgid "Returns the exponent of the magnitude of the operand's MSD." +msgstr "Повертає експоненту величини MSD операнда." + +msgid "Applies the logical operation *and* between each operand's digits." +msgstr "Застосовує логічну операцію *і* між цифрами кожного операнда." + +msgid "Invert all the digits in *x*." +msgstr "Інвертуйте всі цифри в *x*." + +msgid "Applies the logical operation *or* between each operand's digits." +msgstr "Застосовує логічну операцію *або* між цифрами кожного операнда." + +msgid "Applies the logical operation *xor* between each operand's digits." +msgstr "Застосовує логічну операцію *xor* між цифрами кожного операнда." + +msgid "Compares two values numerically and returns the maximum." +msgstr "Чисельно порівнює два значення та повертає максимальне значення." + +msgid "Compares the values numerically with their sign ignored." +msgstr "Числово порівнює значення без урахування знака." + +msgid "Compares two values numerically and returns the minimum." +msgstr "Чисельно порівнює два значення та повертає мінімум." + +msgid "Minus corresponds to the unary prefix minus operator in Python." +msgstr "Мінус відповідає унарному префіксному оператору мінус у Python." + +msgid "Return the product of *x* and *y*." +msgstr "Поверніть добуток *x* і *y*." + +msgid "Returns the largest representable number smaller than *x*." +msgstr "Повертає найбільше представлене число, менше за *x*." + +msgid "Returns the smallest representable number larger than *x*." +msgstr "Повертає найменше число, яке можна представити, більше за *x*." + +msgid "Returns the number closest to *x*, in direction towards *y*." +msgstr "Повертає число, найближче до *x*, у напрямку до *y*." + +msgid "Reduces *x* to its simplest form." +msgstr "Зводить *x* до найпростішої форми." + +msgid "Returns an indication of the class of *x*." +msgstr "Повертає вказівник класу *x*." + +msgid "" +"Plus corresponds to the unary prefix plus operator in Python. This " +"operation applies the context precision and rounding, so it is *not* an " +"identity operation." +msgstr "" +"Плюс відповідає унарному префіксу плюс-оператор у Python. Ця операція " +"застосовує точність контексту та округлення, тому це *не* операція " +"ідентифікації." + +msgid "Return ``x`` to the power of ``y``, reduced modulo ``modulo`` if given." +msgstr "" +"Повертає ``x`` до степеня ``y``, зменшеного за модулем ``modulo``, якщо " +"задано." + +msgid "" +"With two arguments, compute ``x**y``. If ``x`` is negative then ``y`` must " +"be integral. The result will be inexact unless ``y`` is integral and the " +"result is finite and can be expressed exactly in 'precision' digits. The " +"rounding mode of the context is used. Results are always correctly rounded " +"in the Python version." +msgstr "" + +msgid "" +"``Decimal(0) ** Decimal(0)`` results in ``InvalidOperation``, and if " +"``InvalidOperation`` is not trapped, then results in ``Decimal('NaN')``." +msgstr "" +"``Decimal(0) ** Decimal(0)`` призводить до ``InvalidOperation``, і якщо " +"``InvalidOperation`` не перехоплюється, то призводить до ``Decimal('NaN')``." + +msgid "" +"The C module computes :meth:`power` in terms of the correctly rounded :meth:" +"`exp` and :meth:`ln` functions. The result is well-defined but only \"almost " +"always correctly rounded\"." +msgstr "" + +msgid "" +"With three arguments, compute ``(x**y) % modulo``. For the three argument " +"form, the following restrictions on the arguments hold:" +msgstr "" +"З трьома аргументами обчисліть ``(x**y) % по модулю``. Для форми з трьома " +"аргументами діють такі обмеження на аргументи:" + +msgid "all three arguments must be integral" +msgstr "всі три аргументи повинні бути цілими" + +msgid "``y`` must be nonnegative" +msgstr "\"y\" має бути невід'ємним" + +msgid "at least one of ``x`` or ``y`` must be nonzero" +msgstr "принаймні один із ``x`` або ``y`` має бути ненульовим" + +msgid "``modulo`` must be nonzero and have at most 'precision' digits" +msgstr "``modulo`` має бути ненульовим і мати щонайбільше цифр \"точності\"." + +msgid "" +"The value resulting from ``Context.power(x, y, modulo)`` is equal to the " +"value that would be obtained by computing ``(x**y) % modulo`` with unbounded " +"precision, but is computed more efficiently. The exponent of the result is " +"zero, regardless of the exponents of ``x``, ``y`` and ``modulo``. The " +"result is always exact." +msgstr "" +"Значення, отримане за допомогою ``Context.power(x, y, modulo)``, дорівнює " +"значенню, яке було б отримано шляхом обчислення ``(x**y) % по модулю`` з " +"необмеженою точністю, але обчислюється ефективніше . Показник ступеня " +"результату дорівнює нулю, незалежно від показників ``x``, ``y`` і " +"``modulo``. Результат завжди точний." + +msgid "Returns a value equal to *x* (rounded), having the exponent of *y*." +msgstr "Повертає значення, яке дорівнює *x* (округлене), має експоненту *y*." + +msgid "Just returns 10, as this is Decimal, :)" +msgstr "Просто повертає 10, оскільки це десяткове значення :)" + +msgid "Returns the remainder from integer division." +msgstr "Повертає залишок від цілочисельного ділення." + +msgid "" +"The sign of the result, if non-zero, is the same as that of the original " +"dividend." +msgstr "" +"Знак результату, якщо він відмінний від нуля, такий самий, як у вихідного " +"дивіденда." + +msgid "" +"Returns ``x - y * n``, where *n* is the integer nearest the exact value of " +"``x / y`` (if the result is 0 then its sign will be the sign of *x*)." +msgstr "" +"Повертає ``x - y * n``, де *n* — це ціле число, найближче до точного " +"значення ``x / y`` (якщо результат дорівнює 0, то його знаком буде знак *x*)." + +msgid "Returns a rotated copy of *x*, *y* times." +msgstr "Повертає повернуту копію *x*, *y* разів." + +msgid "Returns ``True`` if the two operands have the same exponent." +msgstr "Повертає ``True``, якщо два операнди мають однаковий експонент." + +msgid "Returns the first operand after adding the second value its exp." +msgstr "Повертає перший операнд після додавання другого значення його виразу." + +msgid "Returns a shifted copy of *x*, *y* times." +msgstr "Повертає зміщену копію *x*, *y* разів." + +msgid "Square root of a non-negative number to context precision." +msgstr "Квадратний корінь із невід’ємного числа до точності контексту." + +msgid "Return the difference between *x* and *y*." +msgstr "Повертає різницю між *x* і *y*." + +msgid "Rounds to an integer." +msgstr "Округлює до цілого числа." + +msgid "Converts a number to a string using scientific notation." +msgstr "Перетворює число на рядок, використовуючи наукову нотацію." + +msgid "Constants" +msgstr "Константи" + +msgid "" +"The constants in this section are only relevant for the C module. They are " +"also included in the pure Python version for compatibility." +msgstr "" +"Константи в цьому розділі актуальні лише для модуля C. Вони також включені в " +"чисту версію Python для сумісності." + +msgid "32-bit" +msgstr "32-розрядний" + +msgid "64-bit" +msgstr "64-розрядний" + +msgid "``425000000``" +msgstr "" + +msgid "``999999999999999999``" +msgstr "" + +msgid "``-425000000``" +msgstr "" + +msgid "``-999999999999999999``" +msgstr "" + +msgid "``-849999999``" +msgstr "" + +msgid "``-1999999999999999997``" +msgstr "" + +msgid "" +"The value is ``True``. Deprecated, because Python now always has threads." +msgstr "" +"Значенням є ``True``. Застаріло, оскільки Python тепер завжди має потоки." + +msgid "" +"The default value is ``True``. If Python is :option:`configured using the --" +"without-decimal-contextvar option <--without-decimal-contextvar>`, the C " +"version uses a thread-local rather than a coroutine-local context and the " +"value is ``False``. This is slightly faster in some nested context " +"scenarios." +msgstr "" +"Значення за замовчуванням – ``True``. Якщо Python :option:`налаштовано за " +"допомогою параметра --without-decimal-contextvar <--without-decimal-" +"contextvar>`, версія C використовує локальний контекст потоку, а не " +"локальний контекст співпрограми, а значенням є ``False``. Це трохи швидше в " +"деяких сценаріях вкладеного контексту." + +msgid "Rounding modes" +msgstr "Режими округлення" + +msgid "Round towards ``Infinity``." +msgstr "" + +msgid "Round towards zero." +msgstr "Округлити в бік нуля." + +msgid "Round towards ``-Infinity``." +msgstr "" + +msgid "Round to nearest with ties going towards zero." +msgstr "Округліть до найближчого із рівністю до нуля." + +msgid "Round to nearest with ties going to nearest even integer." +msgstr "" +"Округліть до найближчого зі зв’язками до найближчого парного цілого числа." + +msgid "Round to nearest with ties going away from zero." +msgstr "Округліть до найближчого із рівнем від нуля." + +msgid "Round away from zero." +msgstr "Округлити від нуля." + +msgid "" +"Round away from zero if last digit after rounding towards zero would have " +"been 0 or 5; otherwise round towards zero." +msgstr "" +"Округлити від нуля, якщо остання цифра після округлення до нуля була б 0 або " +"5; інакше округліть до нуля." + +msgid "Signals" +msgstr "Сигнали" + +msgid "" +"Signals represent conditions that arise during computation. Each corresponds " +"to one context flag and one context trap enabler." +msgstr "" +"Сигнали представляють умови, які виникають під час обчислення. Кожен " +"відповідає одному прапорцю контексту та одному активатору перехоплення " +"контексту." + +msgid "" +"The context flag is set whenever the condition is encountered. After the " +"computation, flags may be checked for informational purposes (for instance, " +"to determine whether a computation was exact). After checking the flags, be " +"sure to clear all flags before starting the next computation." +msgstr "" +"Прапор контексту встановлюється щоразу, коли зустрічається умова. Після " +"обчислення прапорці можуть бути перевірені в інформаційних цілях (наприклад, " +"щоб визначити, чи було обчислення точним). Після перевірки прапорів " +"обов’язково видаліть усі прапорці перед початком наступного обчислення." + +msgid "" +"If the context's trap enabler is set for the signal, then the condition " +"causes a Python exception to be raised. For example, if the :class:" +"`DivisionByZero` trap is set, then a :exc:`DivisionByZero` exception is " +"raised upon encountering the condition." +msgstr "" +"Якщо для сигналу встановлено активатор перехоплення контексту, тоді умова " +"викликає виняток Python. Наприклад, якщо встановлено перехоплення :class:" +"`DivisionByZero`, тоді виникає виняткова ситуація :exc:`DivisionByZero`, " +"коли зустрічається умова." + +msgid "Altered an exponent to fit representation constraints." +msgstr "Змінено експоненту, щоб відповідати обмеженням представлення." + +msgid "" +"Typically, clamping occurs when an exponent falls outside the context's :" +"attr:`~Context.Emin` and :attr:`~Context.Emax` limits. If possible, the " +"exponent is reduced to fit by adding zeros to the coefficient." +msgstr "" + +msgid "Base class for other signals and a subclass of :exc:`ArithmeticError`." +msgstr "Базовий клас для інших сигналів і підклас :exc:`ArithmeticError`." + +msgid "Signals the division of a non-infinite number by zero." +msgstr "Сигналізує про ділення нескінченного числа на нуль." + +msgid "" +"Can occur with division, modulo division, or when raising a number to a " +"negative power. If this signal is not trapped, returns ``Infinity`` or ``-" +"Infinity`` with the sign determined by the inputs to the calculation." +msgstr "" + +msgid "Indicates that rounding occurred and the result is not exact." +msgstr "Вказує на те, що відбулося округлення і результат неточний." + +msgid "" +"Signals when non-zero digits were discarded during rounding. The rounded " +"result is returned. The signal flag or trap is used to detect when results " +"are inexact." +msgstr "" +"Сигнали, коли під час округлення були відкинуті ненульові цифри. " +"Повертається округлений результат. Сигнальний прапор або пастка " +"використовується для виявлення неточних результатів." + +msgid "An invalid operation was performed." +msgstr "Виконано недійсну операцію." + +msgid "" +"Indicates that an operation was requested that does not make sense. If not " +"trapped, returns ``NaN``. Possible causes include::" +msgstr "" + +msgid "" +"Infinity - Infinity\n" +"0 * Infinity\n" +"Infinity / Infinity\n" +"x % 0\n" +"Infinity % x\n" +"sqrt(-x) and x > 0\n" +"0 ** 0\n" +"x ** (non-integer)\n" +"x ** Infinity" +msgstr "" + +msgid "Numerical overflow." +msgstr "Числове переповнення." + +msgid "" +"Indicates the exponent is larger than :attr:`Context.Emax` after rounding " +"has occurred. If not trapped, the result depends on the rounding mode, " +"either pulling inward to the largest representable finite number or rounding " +"outward to ``Infinity``. In either case, :class:`Inexact` and :class:" +"`Rounded` are also signaled." +msgstr "" + +msgid "Rounding occurred though possibly no information was lost." +msgstr "" +"Відбулося округлення, хоча, можливо, жодної інформації не було втрачено." + +msgid "" +"Signaled whenever rounding discards digits; even if those digits are zero " +"(such as rounding ``5.00`` to ``5.0``). If not trapped, returns the result " +"unchanged. This signal is used to detect loss of significant digits." +msgstr "" + +msgid "Exponent was lower than :attr:`~Context.Emin` prior to rounding." +msgstr "" + +msgid "" +"Occurs when an operation result is subnormal (the exponent is too small). If " +"not trapped, returns the result unchanged." +msgstr "" +"Виникає, коли результат операції є ненормальним (експонента занадто мала). " +"Якщо не перехоплено, повертає результат без змін." + +msgid "Numerical underflow with result rounded to zero." +msgstr "Числове недоповнення з результатом, округленим до нуля." + +msgid "" +"Occurs when a subnormal result is pushed to zero by rounding. :class:" +"`Inexact` and :class:`Subnormal` are also signaled." +msgstr "" +"Виникає, коли субнормальний результат обнулюється шляхом округлення. :class:" +"`Inexact` і :class:`Subnormal` також сигналізуються." + +msgid "Enable stricter semantics for mixing floats and Decimals." +msgstr "" +"Увімкніть суворішу семантику для змішування чисел із плаваючою точкою та " +"десяткових знаків." + +msgid "" +"If the signal is not trapped (default), mixing floats and Decimals is " +"permitted in the :class:`~decimal.Decimal` constructor, :meth:`~decimal." +"Context.create_decimal` and all comparison operators. Both conversion and " +"comparisons are exact. Any occurrence of a mixed operation is silently " +"recorded by setting :exc:`FloatOperation` in the context flags. Explicit " +"conversions with :meth:`~decimal.Decimal.from_float` or :meth:`~decimal." +"Context.create_decimal_from_float` do not set the flag." +msgstr "" +"Якщо сигнал не перехоплюється (за замовчуванням), змішування чисел із " +"плаваючою точкою та десяткових знаків дозволено в конструкторі :class:" +"`~decimal.Decimal`, :meth:`~decimal.Context.create_decimal` та в усіх " +"операторах порівняння. І перетворення, і порівняння точні. Будь-який випадок " +"змішаної операції автоматично записується шляхом встановлення :exc:" +"`FloatOperation` у прапорцях контексту. Явні перетворення за допомогою :meth:" +"`~decimal.Decimal.from_float` або :meth:`~decimal.Context." +"create_decimal_from_float` не встановлюють прапор." + +msgid "" +"Otherwise (the signal is trapped), only equality comparisons and explicit " +"conversions are silent. All other mixed operations raise :exc:" +"`FloatOperation`." +msgstr "" +"В іншому випадку (сигнал перехоплюється), лише порівняння рівності та явні " +"перетворення мовчать. Усі інші змішані операції викликають :exc:" +"`FloatOperation`." + +msgid "The following table summarizes the hierarchy of signals::" +msgstr "У наступній таблиці підсумовано ієрархію сигналів:" + +msgid "" +"exceptions.ArithmeticError(exceptions.Exception)\n" +" DecimalException\n" +" Clamped\n" +" DivisionByZero(DecimalException, exceptions.ZeroDivisionError)\n" +" Inexact\n" +" Overflow(Inexact, Rounded)\n" +" Underflow(Inexact, Rounded, Subnormal)\n" +" InvalidOperation\n" +" Rounded\n" +" Subnormal\n" +" FloatOperation(DecimalException, exceptions.TypeError)" +msgstr "" + +msgid "Floating-Point Notes" +msgstr "" + +msgid "Mitigating round-off error with increased precision" +msgstr "Зменшення помилки округлення з підвищеною точністю" + +msgid "" +"The use of decimal floating point eliminates decimal representation error " +"(making it possible to represent ``0.1`` exactly); however, some operations " +"can still incur round-off error when non-zero digits exceed the fixed " +"precision." +msgstr "" + +msgid "" +"The effects of round-off error can be amplified by the addition or " +"subtraction of nearly offsetting quantities resulting in loss of " +"significance. Knuth provides two instructive examples where rounded " +"floating-point arithmetic with insufficient precision causes the breakdown " +"of the associative and distributive properties of addition:" +msgstr "" + +msgid "" +"# Examples from Seminumerical Algorithms, Section 4.2.2.\n" +">>> from decimal import Decimal, getcontext\n" +">>> getcontext().prec = 8\n" +"\n" +">>> u, v, w = Decimal(11111113), Decimal(-11111111), Decimal('7.51111111')\n" +">>> (u + v) + w\n" +"Decimal('9.5111111')\n" +">>> u + (v + w)\n" +"Decimal('10')\n" +"\n" +">>> u, v, w = Decimal(20000), Decimal(-6), Decimal('6.0000003')\n" +">>> (u*v) + (u*w)\n" +"Decimal('0.01')\n" +">>> u * (v+w)\n" +"Decimal('0.0060000')" +msgstr "" + +msgid "" +"The :mod:`decimal` module makes it possible to restore the identities by " +"expanding the precision sufficiently to avoid loss of significance:" +msgstr "" +"Модуль :mod:`decimal` дає змогу відновити ідентифікаційні дані, збільшивши " +"точність настільки, щоб уникнути втрати значущості:" + +msgid "" +">>> getcontext().prec = 20\n" +">>> u, v, w = Decimal(11111113), Decimal(-11111111), Decimal('7.51111111')\n" +">>> (u + v) + w\n" +"Decimal('9.51111111')\n" +">>> u + (v + w)\n" +"Decimal('9.51111111')\n" +">>>\n" +">>> u, v, w = Decimal(20000), Decimal(-6), Decimal('6.0000003')\n" +">>> (u*v) + (u*w)\n" +"Decimal('0.0060000')\n" +">>> u * (v+w)\n" +"Decimal('0.0060000')" +msgstr "" + +msgid "Special values" +msgstr "Особливі цінності" + +msgid "" +"The number system for the :mod:`decimal` module provides special values " +"including ``NaN``, ``sNaN``, ``-Infinity``, ``Infinity``, and two zeros, " +"``+0`` and ``-0``." +msgstr "" + +msgid "" +"Infinities can be constructed directly with: ``Decimal('Infinity')``. Also, " +"they can arise from dividing by zero when the :exc:`DivisionByZero` signal " +"is not trapped. Likewise, when the :exc:`Overflow` signal is not trapped, " +"infinity can result from rounding beyond the limits of the largest " +"representable number." +msgstr "" +"Нескінченності можна побудувати безпосередньо за допомогою: " +"``Decimal('Infinity')``. Крім того, вони можуть виникнути через ділення на " +"нуль, коли сигнал :exc:`DivisionByZero` не перехоплюється. Подібним чином, " +"коли сигнал :exc:`Overflow` не перехоплюється, нескінченність може бути " +"результатом округлення за межі найбільшого представленого числа." + +msgid "" +"The infinities are signed (affine) and can be used in arithmetic operations " +"where they get treated as very large, indeterminate numbers. For instance, " +"adding a constant to infinity gives another infinite result." +msgstr "" +"Нескінченності мають знак (афінні) і можуть використовуватися в арифметичних " +"операціях, де вони розглядаються як дуже великі невизначені числа. " +"Наприклад, додавання константи до нескінченності дає інший нескінченний " +"результат." + +msgid "" +"Some operations are indeterminate and return ``NaN``, or if the :exc:" +"`InvalidOperation` signal is trapped, raise an exception. For example, " +"``0/0`` returns ``NaN`` which means \"not a number\". This variety of " +"``NaN`` is quiet and, once created, will flow through other computations " +"always resulting in another ``NaN``. This behavior can be useful for a " +"series of computations that occasionally have missing inputs --- it allows " +"the calculation to proceed while flagging specific results as invalid." +msgstr "" + +msgid "" +"A variant is ``sNaN`` which signals rather than remaining quiet after every " +"operation. This is a useful return value when an invalid result needs to " +"interrupt a calculation for special handling." +msgstr "" + +msgid "" +"The behavior of Python's comparison operators can be a little surprising " +"where a ``NaN`` is involved. A test for equality where one of the operands " +"is a quiet or signaling ``NaN`` always returns :const:`False` (even when " +"doing ``Decimal('NaN')==Decimal('NaN')``), while a test for inequality " +"always returns :const:`True`. An attempt to compare two Decimals using any " +"of the ``<``, ``<=``, ``>`` or ``>=`` operators will raise the :exc:" +"`InvalidOperation` signal if either operand is a ``NaN``, and return :const:" +"`False` if this signal is not trapped. Note that the General Decimal " +"Arithmetic specification does not specify the behavior of direct " +"comparisons; these rules for comparisons involving a ``NaN`` were taken from " +"the IEEE 854 standard (see Table 3 in section 5.7). To ensure strict " +"standards-compliance, use the :meth:`~Decimal.compare` and :meth:`~Decimal." +"compare_signal` methods instead." +msgstr "" + +msgid "" +"The signed zeros can result from calculations that underflow. They keep the " +"sign that would have resulted if the calculation had been carried out to " +"greater precision. Since their magnitude is zero, both positive and " +"negative zeros are treated as equal and their sign is informational." +msgstr "" +"Нулі зі знаком можуть виникати в результаті обчислень, які занижуються. Вони " +"зберігають знак, який був би отриманий, якби розрахунок проводився з більшою " +"точністю. Оскільки їх величина дорівнює нулю, додатні та від’ємні нулі " +"вважаються рівними, а їх знак є інформаційним." + +msgid "" +"In addition to the two signed zeros which are distinct yet equal, there are " +"various representations of zero with differing precisions yet equivalent in " +"value. This takes a bit of getting used to. For an eye accustomed to " +"normalized floating-point representations, it is not immediately obvious " +"that the following calculation returns a value equal to zero:" +msgstr "" + +msgid "Working with threads" +msgstr "Робота з нитками" + +msgid "" +"The :func:`getcontext` function accesses a different :class:`Context` object " +"for each thread. Having separate thread contexts means that threads may " +"make changes (such as ``getcontext().prec=10``) without interfering with " +"other threads." +msgstr "" +"Функція :func:`getcontext` отримує доступ до іншого об’єкта :class:`Context` " +"для кожного потоку. Наявність окремих контекстів потоків означає, що потоки " +"можуть вносити зміни (наприклад, ``getcontext().prec=10``), не заважаючи " +"іншим потокам." + +msgid "" +"Likewise, the :func:`setcontext` function automatically assigns its target " +"to the current thread." +msgstr "" +"Подібним чином функція :func:`setcontext` автоматично призначає свою ціль " +"поточному потоку." + +msgid "" +"If :func:`setcontext` has not been called before :func:`getcontext`, then :" +"func:`getcontext` will automatically create a new context for use in the " +"current thread." +msgstr "" +"Якщо :func:`setcontext` не викликався раніше :func:`getcontext`, тоді :func:" +"`getcontext` автоматично створить новий контекст для використання в " +"поточному потоці." + +msgid "" +"The new context is copied from a prototype context called *DefaultContext*. " +"To control the defaults so that each thread will use the same values " +"throughout the application, directly modify the *DefaultContext* object. " +"This should be done *before* any threads are started so that there won't be " +"a race condition between threads calling :func:`getcontext`. For example::" +msgstr "" +"Новий контекст скопійовано з контексту прототипу під назвою " +"*DefaultContext*. Щоб керувати параметрами за замовчуванням, щоб кожен потік " +"використовував однакові значення в усій програмі, безпосередньо змініть " +"об’єкт *DefaultContext*. Це слід зробити *перед* запуском будь-яких потоків, " +"щоб не виникало змагання між потоками, що викликають :func:`getcontext`. " +"Наприклад::" + +msgid "" +"# Set applicationwide defaults for all threads about to be launched\n" +"DefaultContext.prec = 12\n" +"DefaultContext.rounding = ROUND_DOWN\n" +"DefaultContext.traps = ExtendedContext.traps.copy()\n" +"DefaultContext.traps[InvalidOperation] = 1\n" +"setcontext(DefaultContext)\n" +"\n" +"# Afterwards, the threads can be started\n" +"t1.start()\n" +"t2.start()\n" +"t3.start()\n" +" . . ." +msgstr "" + +msgid "Recipes" +msgstr "рецепти" + +msgid "" +"Here are a few recipes that serve as utility functions and that demonstrate " +"ways to work with the :class:`Decimal` class::" +msgstr "" +"Ось кілька рецептів, які служать допоміжними функціями та демонструють " +"способи роботи з класом :class:`Decimal`::" + +msgid "" +"def moneyfmt(value, places=2, curr='', sep=',', dp='.',\n" +" pos='', neg='-', trailneg=''):\n" +" \"\"\"Convert Decimal to a money formatted string.\n" +"\n" +" places: required number of places after the decimal point\n" +" curr: optional currency symbol before the sign (may be blank)\n" +" sep: optional grouping separator (comma, period, space, or blank)\n" +" dp: decimal point indicator (comma or period)\n" +" only specify as blank when places is zero\n" +" pos: optional sign for positive numbers: '+', space or blank\n" +" neg: optional sign for negative numbers: '-', '(', space or blank\n" +" trailneg:optional trailing minus indicator: '-', ')', space or blank\n" +"\n" +" >>> d = Decimal('-1234567.8901')\n" +" >>> moneyfmt(d, curr='$')\n" +" '-$1,234,567.89'\n" +" >>> moneyfmt(d, places=0, sep='.', dp='', neg='', trailneg='-')\n" +" '1.234.568-'\n" +" >>> moneyfmt(d, curr='$', neg='(', trailneg=')')\n" +" '($1,234,567.89)'\n" +" >>> moneyfmt(Decimal(123456789), sep=' ')\n" +" '123 456 789.00'\n" +" >>> moneyfmt(Decimal('-0.02'), neg='<', trailneg='>')\n" +" '<0.02>'\n" +"\n" +" \"\"\"\n" +" q = Decimal(10) ** -places # 2 places --> '0.01'\n" +" sign, digits, exp = value.quantize(q).as_tuple()\n" +" result = []\n" +" digits = list(map(str, digits))\n" +" build, next = result.append, digits.pop\n" +" if sign:\n" +" build(trailneg)\n" +" for i in range(places):\n" +" build(next() if digits else '0')\n" +" if places:\n" +" build(dp)\n" +" if not digits:\n" +" build('0')\n" +" i = 0\n" +" while digits:\n" +" build(next())\n" +" i += 1\n" +" if i == 3 and digits:\n" +" i = 0\n" +" build(sep)\n" +" build(curr)\n" +" build(neg if sign else pos)\n" +" return ''.join(reversed(result))\n" +"\n" +"def pi():\n" +" \"\"\"Compute Pi to the current precision.\n" +"\n" +" >>> print(pi())\n" +" 3.141592653589793238462643383\n" +"\n" +" \"\"\"\n" +" getcontext().prec += 2 # extra digits for intermediate steps\n" +" three = Decimal(3) # substitute \"three=3.0\" for regular floats\n" +" lasts, t, s, n, na, d, da = 0, three, 3, 1, 0, 0, 24\n" +" while s != lasts:\n" +" lasts = s\n" +" n, na = n+na, na+8\n" +" d, da = d+da, da+32\n" +" t = (t * n) / d\n" +" s += t\n" +" getcontext().prec -= 2\n" +" return +s # unary plus applies the new precision\n" +"\n" +"def exp(x):\n" +" \"\"\"Return e raised to the power of x. Result type matches input " +"type.\n" +"\n" +" >>> print(exp(Decimal(1)))\n" +" 2.718281828459045235360287471\n" +" >>> print(exp(Decimal(2)))\n" +" 7.389056098930650227230427461\n" +" >>> print(exp(2.0))\n" +" 7.38905609893\n" +" >>> print(exp(2+0j))\n" +" (7.38905609893+0j)\n" +"\n" +" \"\"\"\n" +" getcontext().prec += 2\n" +" i, lasts, s, fact, num = 0, 0, 1, 1, 1\n" +" while s != lasts:\n" +" lasts = s\n" +" i += 1\n" +" fact *= i\n" +" num *= x\n" +" s += num / fact\n" +" getcontext().prec -= 2\n" +" return +s\n" +"\n" +"def cos(x):\n" +" \"\"\"Return the cosine of x as measured in radians.\n" +"\n" +" The Taylor series approximation works best for a small value of x.\n" +" For larger values, first compute x = x % (2 * pi).\n" +"\n" +" >>> print(cos(Decimal('0.5')))\n" +" 0.8775825618903727161162815826\n" +" >>> print(cos(0.5))\n" +" 0.87758256189\n" +" >>> print(cos(0.5+0j))\n" +" (0.87758256189+0j)\n" +"\n" +" \"\"\"\n" +" getcontext().prec += 2\n" +" i, lasts, s, fact, num, sign = 0, 0, 1, 1, 1, 1\n" +" while s != lasts:\n" +" lasts = s\n" +" i += 2\n" +" fact *= i * (i-1)\n" +" num *= x * x\n" +" sign *= -1\n" +" s += num / fact * sign\n" +" getcontext().prec -= 2\n" +" return +s\n" +"\n" +"def sin(x):\n" +" \"\"\"Return the sine of x as measured in radians.\n" +"\n" +" The Taylor series approximation works best for a small value of x.\n" +" For larger values, first compute x = x % (2 * pi).\n" +"\n" +" >>> print(sin(Decimal('0.5')))\n" +" 0.4794255386042030002732879352\n" +" >>> print(sin(0.5))\n" +" 0.479425538604\n" +" >>> print(sin(0.5+0j))\n" +" (0.479425538604+0j)\n" +"\n" +" \"\"\"\n" +" getcontext().prec += 2\n" +" i, lasts, s, fact, num, sign = 1, 0, x, 1, x, 1\n" +" while s != lasts:\n" +" lasts = s\n" +" i += 2\n" +" fact *= i * (i-1)\n" +" num *= x * x\n" +" sign *= -1\n" +" s += num / fact * sign\n" +" getcontext().prec -= 2\n" +" return +s" +msgstr "" + +msgid "Decimal FAQ" +msgstr "Десятковий FAQ" + +msgid "" +"Q. It is cumbersome to type ``decimal.Decimal('1234.5')``. Is there a way " +"to minimize typing when using the interactive interpreter?" +msgstr "" +"З. Громіздко вводити ``decimal.Decimal('1234.5')``. Чи є спосіб мінімізувати " +"введення під час використання інтерактивного перекладача?" + +msgid "A. Some users abbreviate the constructor to just a single letter:" +msgstr "A. Деякі користувачі скорочують конструктор лише до однієї літери:" + +msgid "" +"Q. In a fixed-point application with two decimal places, some inputs have " +"many places and need to be rounded. Others are not supposed to have excess " +"digits and need to be validated. What methods should be used?" +msgstr "" +"Q. У програмі з фіксованою комою з двома знаками після коми деякі вхідні " +"дані мають багато знаків і їх потрібно округлити. Інші не повинні мати " +"зайвих цифр і потребують перевірки. Які методи слід використовувати?" + +msgid "" +"A. The :meth:`~Decimal.quantize` method rounds to a fixed number of decimal " +"places. If the :const:`Inexact` trap is set, it is also useful for " +"validation:" +msgstr "" + +msgid "" +"Q. Once I have valid two place inputs, how do I maintain that invariant " +"throughout an application?" +msgstr "" +"З. Якщо я маю дійсні двомісні введення, як мені підтримувати цей інваріант у " +"всій програмі?" + +msgid "" +"A. Some operations like addition, subtraction, and multiplication by an " +"integer will automatically preserve fixed point. Others operations, like " +"division and non-integer multiplication, will change the number of decimal " +"places and need to be followed-up with a :meth:`~Decimal.quantize` step:" +msgstr "" + +msgid "" +"In developing fixed-point applications, it is convenient to define functions " +"to handle the :meth:`~Decimal.quantize` step:" +msgstr "" + +msgid "" +"Q. There are many ways to express the same value. The numbers ``200``, " +"``200.000``, ``2E2``, and ``.02E+4`` all have the same value at various " +"precisions. Is there a way to transform them to a single recognizable " +"canonical value?" +msgstr "" + +msgid "" +"A. The :meth:`~Decimal.normalize` method maps all equivalent values to a " +"single representative:" +msgstr "" + +msgid "Q. When does rounding occur in a computation?" +msgstr "" + +msgid "" +"A. It occurs *after* the computation. The philosophy of the decimal " +"specification is that numbers are considered exact and are created " +"independent of the current context. They can even have greater precision " +"than current context. Computations process with those exact inputs and then " +"rounding (or other context operations) is applied to the *result* of the " +"computation::" +msgstr "" + +msgid "" +">>> getcontext().prec = 5\n" +">>> pi = Decimal('3.1415926535') # More than 5 digits\n" +">>> pi # All digits are retained\n" +"Decimal('3.1415926535')\n" +">>> pi + 0 # Rounded after an addition\n" +"Decimal('3.1416')\n" +">>> pi - Decimal('0.00005') # Subtract unrounded numbers, then round\n" +"Decimal('3.1415')\n" +">>> pi + 0 - Decimal('0.00005'). # Intermediate values are rounded\n" +"Decimal('3.1416')" +msgstr "" + +msgid "" +"Q. Some decimal values always print with exponential notation. Is there a " +"way to get a non-exponential representation?" +msgstr "" +"З. Деякі десяткові значення завжди друкуються в експоненціальному вигляді. " +"Чи є спосіб отримати неекспоненціальне представлення?" + +msgid "" +"A. For some values, exponential notation is the only way to express the " +"number of significant places in the coefficient. For example, expressing " +"``5.0E+3`` as ``5000`` keeps the value constant but cannot show the " +"original's two-place significance." +msgstr "" + +msgid "" +"If an application does not care about tracking significance, it is easy to " +"remove the exponent and trailing zeroes, losing significance, but keeping " +"the value unchanged:" +msgstr "" +"Якщо програма не піклується про відстеження значущості, можна легко видалити " +"експоненту та кінцеві нулі, втрачаючи значущість, але зберігаючи значення " +"незмінним:" + +msgid "Q. Is there a way to convert a regular float to a :class:`Decimal`?" +msgstr "Q. Чи є спосіб перетворити звичайний float на :class:`Decimal`?" + +msgid "" +"A. Yes, any binary floating-point number can be exactly expressed as a " +"Decimal though an exact conversion may take more precision than intuition " +"would suggest:" +msgstr "" + +msgid "" +">>> Decimal(math.pi)\n" +"Decimal('3.141592653589793115997963468544185161590576171875')" +msgstr "" + +msgid "" +"Q. Within a complex calculation, how can I make sure that I haven't gotten a " +"spurious result because of insufficient precision or rounding anomalies." +msgstr "" +"Q. Як я можу переконатися, що в рамках складного обчислення я не отримав " +"фальшивий результат через недостатню точність або аномалії округлення." + +msgid "" +"A. The decimal module makes it easy to test results. A best practice is to " +"re-run calculations using greater precision and with various rounding modes. " +"Widely differing results indicate insufficient precision, rounding mode " +"issues, ill-conditioned inputs, or a numerically unstable algorithm." +msgstr "" +"A. Десятковий модуль дозволяє легко перевірити результати. Найкраща практика " +"— повторити обчислення з більшою точністю та різними режимами округлення. " +"Різні результати вказують на недостатню точність, проблеми з режимом " +"округлення, погано обумовлені вхідні дані або чисельно нестабільний алгоритм." + +msgid "" +"Q. I noticed that context precision is applied to the results of operations " +"but not to the inputs. Is there anything to watch out for when mixing " +"values of different precisions?" +msgstr "" +"З. Я помітив, що точність контексту застосовується до результатів операцій, " +"але не до вхідних даних. Чи є на що слід звернути увагу під час змішування " +"значень різної точності?" + +msgid "" +"A. Yes. The principle is that all values are considered to be exact and so " +"is the arithmetic on those values. Only the results are rounded. The " +"advantage for inputs is that \"what you type is what you get\". A " +"disadvantage is that the results can look odd if you forget that the inputs " +"haven't been rounded:" +msgstr "" +"А. Так. Принцип полягає в тому, що всі значення вважаються точними, як і " +"арифметика цих значень. Округлюються лише результати. Перевага введення " +"даних полягає в тому, що \"те, що ви вводите, те й отримуєте\". Недоліком є " +"те, що результати можуть виглядати дивно, якщо ви забудете, що вхідні дані " +"не були округлені:" + +msgid "" +">>> getcontext().prec = 3\n" +">>> Decimal('3.104') + Decimal('2.104')\n" +"Decimal('5.21')\n" +">>> Decimal('3.104') + Decimal('0.000') + Decimal('2.104')\n" +"Decimal('5.20')" +msgstr "" + +msgid "" +"The solution is either to increase precision or to force rounding of inputs " +"using the unary plus operation:" +msgstr "" +"Рішення полягає в тому, щоб підвищити точність або примусово округлити " +"вхідні дані за допомогою унарної операції плюс:" + +msgid "" +">>> getcontext().prec = 3\n" +">>> +Decimal('1.23456789') # unary plus triggers rounding\n" +"Decimal('1.23')" +msgstr "" + +msgid "" +"Alternatively, inputs can be rounded upon creation using the :meth:`Context." +"create_decimal` method:" +msgstr "" +"Крім того, вхідні дані можна округлити під час створення за допомогою " +"методу :meth:`Context.create_decimal`:" + +msgid "Q. Is the CPython implementation fast for large numbers?" +msgstr "Q. Чи швидка реалізація CPython для великих чисел?" + +msgid "" +"A. Yes. In the CPython and PyPy3 implementations, the C/CFFI versions of " +"the decimal module integrate the high speed `libmpdec `_ library for arbitrary precision " +"correctly rounded decimal floating-point arithmetic [#]_. ``libmpdec`` uses " +"`Karatsuba multiplication `_ for medium-sized numbers and the `Number Theoretic " +"Transform `_ for very " +"large numbers." +msgstr "" + +msgid "" +"The context must be adapted for exact arbitrary precision arithmetic. :attr:" +"`~Context.Emin` and :attr:`~Context.Emax` should always be set to the " +"maximum values, :attr:`~Context.clamp` should always be 0 (the default). " +"Setting :attr:`~Context.prec` requires some care." +msgstr "" + +msgid "" +"The easiest approach for trying out bignum arithmetic is to use the maximum " +"value for :attr:`~Context.prec` as well [#]_::" +msgstr "" + +msgid "" +">>> setcontext(Context(prec=MAX_PREC, Emax=MAX_EMAX, Emin=MIN_EMIN))\n" +">>> x = Decimal(2) ** 256\n" +">>> x / 128\n" +"Decimal('904625697166532776746648320380374280103671755200316906558262375061821325312')" +msgstr "" + +msgid "" +"For inexact results, :const:`MAX_PREC` is far too large on 64-bit platforms " +"and the available memory will be insufficient::" +msgstr "" + +msgid "" +">>> Decimal(1) / 3\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"MemoryError" +msgstr "" + +msgid "" +"On systems with overallocation (e.g. Linux), a more sophisticated approach " +"is to adjust :attr:`~Context.prec` to the amount of available RAM. Suppose " +"that you have 8GB of RAM and expect 10 simultaneous operands using a maximum " +"of 500MB each::" +msgstr "" + +msgid "" +">>> import sys\n" +">>>\n" +">>> # Maximum number of digits for a single operand using 500MB in 8-byte " +"words\n" +">>> # with 19 digits per word (4-byte and 9 digits for the 32-bit build):\n" +">>> maxdigits = 19 * ((500 * 1024**2) // 8)\n" +">>>\n" +">>> # Check that this works:\n" +">>> c = Context(prec=maxdigits, Emax=MAX_EMAX, Emin=MIN_EMIN)\n" +">>> c.traps[Inexact] = True\n" +">>> setcontext(c)\n" +">>>\n" +">>> # Fill the available precision with nines:\n" +">>> x = Decimal(0).logical_invert() * 9\n" +">>> sys.getsizeof(x)\n" +"524288112\n" +">>> x + 2\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +" decimal.Inexact: []" +msgstr "" + +msgid "" +"In general (and especially on systems without overallocation), it is " +"recommended to estimate even tighter bounds and set the :attr:`Inexact` trap " +"if all calculations are expected to be exact." +msgstr "" +"Загалом (і особливо в системах без загального розподілу) рекомендується " +"оцінювати ще більш жорсткі межі та встановлювати пастку :attr:`Inexact`, " +"якщо очікується, що всі обчислення будуть точними." + +msgid "" +"This approach now works for all exact results except for non-integer powers." +msgstr "" +"Цей підхід тепер працює для всіх точних результатів, за винятком нецілих " +"степенів." diff --git a/library/development.po b/library/development.po new file mode 100644 index 000000000..90c791d08 --- /dev/null +++ b/library/development.po @@ -0,0 +1,46 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# Yuliia Shevchenko, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 01:04+0000\n" +"Last-Translator: Yuliia Shevchenko, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Development Tools" +msgstr "Засоби розробки" + +msgid "" +"The modules described in this chapter help you write software. For example, " +"the :mod:`pydoc` module takes a module and generates documentation based on " +"the module's contents. The :mod:`doctest` and :mod:`unittest` modules " +"contains frameworks for writing unit tests that automatically exercise code " +"and verify that the expected output is produced." +msgstr "" +"Модулі, описані в цьому розділі, допоможуть вам писати програмне " +"забезпечення. Наприклад, модуль :mod:`pydoc` бере модуль і генерує " +"документацію на основі вмісту модуля. Модулі :mod:`doctest` та :mod:" +"`unittest` містять фреймворки для написання модульних тестів, які " +"автоматично виконують код і перевіряють, чи отримано очікуваний результат." + +msgid "The list of modules described in this chapter is:" +msgstr "Перелік модулів, описаних у цьому розділі:" diff --git a/library/devmode.po b/library/devmode.po new file mode 100644 index 000000000..d393ee98a --- /dev/null +++ b/library/devmode.po @@ -0,0 +1,409 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 01:04+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Python Development Mode" +msgstr "Режим розробки Python" + +msgid "" +"The Python Development Mode introduces additional runtime checks that are " +"too expensive to be enabled by default. It should not be more verbose than " +"the default if the code is correct; new warnings are only emitted when an " +"issue is detected." +msgstr "" +"Режим розробки Python вводить додаткові перевірки під час виконання, які " +"занадто дорогі, щоб їх можна було ввімкнути за замовчуванням. Якщо код " +"правильний, він не повинен бути більш детальним, ніж стандартний; нові " +"попередження видаються лише тоді, коли виявляється проблема." + +msgid "" +"It can be enabled using the :option:`-X dev <-X>` command line option or by " +"setting the :envvar:`PYTHONDEVMODE` environment variable to ``1``." +msgstr "" +"Його можна ввімкнути за допомогою параметра командного рядка :option:`-X dev " +"<-X>` або встановивши для змінної середовища :envvar:`PYTHONDEVMODE` " +"значення ``1``." + +msgid "See also :ref:`Python debug build `." +msgstr "Дивіться також :ref:`Python debug build `." + +msgid "Effects of the Python Development Mode" +msgstr "Ефекти режиму розробки Python" + +msgid "" +"Enabling the Python Development Mode is similar to the following command, " +"but with additional effects described below::" +msgstr "" +"Увімкнення режиму розробки Python подібне до наступної команди, але з " +"додатковими ефектами, описаними нижче:" + +msgid "" +"PYTHONMALLOC=debug PYTHONASYNCIODEBUG=1 python -W default -X faulthandler" +msgstr "" + +msgid "Effects of the Python Development Mode:" +msgstr "Наслідки режиму розробки Python:" + +msgid "" +"Add ``default`` :ref:`warning filter `. The " +"following warnings are shown:" +msgstr "" +"Додайте ``за замовчуванням`` :ref:`фільтр попереджень `. Відображаються такі попередження:" + +msgid ":exc:`DeprecationWarning`" +msgstr ":exc:`DeprecationWarning`" + +msgid ":exc:`ImportWarning`" +msgstr ":exc:`ImportWarning`" + +msgid ":exc:`PendingDeprecationWarning`" +msgstr ":exc:`PendingDeprecationWarning`" + +msgid ":exc:`ResourceWarning`" +msgstr ":exc:`ResourceWarning`" + +msgid "" +"Normally, the above warnings are filtered by the default :ref:`warning " +"filters `." +msgstr "" +"Зазвичай наведені вище попередження фільтруються стандартними :ref:" +"`фільтрами попереджень `." + +msgid "" +"It behaves as if the :option:`-W default <-W>` command line option is used." +msgstr "" +"Він поводиться так, ніби використовується параметр командного рядка :option:" +"`-W за замовчуванням <-W>`." + +msgid "" +"Use the :option:`-W error <-W>` command line option or set the :envvar:" +"`PYTHONWARNINGS` environment variable to ``error`` to treat warnings as " +"errors." +msgstr "" +"Використовуйте параметр командного рядка :option:`-W error <-W>` або " +"встановіть для змінної середовища :envvar:`PYTHONWARNINGS` значення " +"``error``, щоб розглядати попередження як помилки." + +msgid "Install debug hooks on memory allocators to check for:" +msgstr "" +"Встановіть перехоплювачі налагодження на розподілювачі пам’яті, щоб " +"перевірити:" + +msgid "Buffer underflow" +msgstr "Недоповнення буфера" + +msgid "Buffer overflow" +msgstr "Переповнення буфера" + +msgid "Memory allocator API violation" +msgstr "Порушення API розподілювача пам'яті" + +msgid "Unsafe usage of the GIL" +msgstr "Небезпечне використання GIL" + +msgid "See the :c:func:`PyMem_SetupDebugHooks` C function." +msgstr "Перегляньте функцію C :c:func:`PyMem_SetupDebugHooks`." + +msgid "" +"It behaves as if the :envvar:`PYTHONMALLOC` environment variable is set to " +"``debug``." +msgstr "" +"Він поводиться так, ніби для змінної середовища :envvar:`PYTHONMALLOC` " +"встановлено значення ``debug``." + +msgid "" +"To enable the Python Development Mode without installing debug hooks on " +"memory allocators, set the :envvar:`PYTHONMALLOC` environment variable to " +"``default``." +msgstr "" +"Щоб увімкнути режим розробки Python, не встановлюючи налагоджувальні засоби " +"розподілення пам’яті, встановіть для змінної середовища :envvar:" +"`PYTHONMALLOC` значення ``default``." + +msgid "" +"Call :func:`faulthandler.enable` at Python startup to install handlers for " +"the :const:`~signal.SIGSEGV`, :const:`~signal.SIGFPE`, :const:`~signal." +"SIGABRT`, :const:`~signal.SIGBUS` and :const:`~signal.SIGILL` signals to " +"dump the Python traceback on a crash." +msgstr "" + +msgid "" +"It behaves as if the :option:`-X faulthandler <-X>` command line option is " +"used or if the :envvar:`PYTHONFAULTHANDLER` environment variable is set to " +"``1``." +msgstr "" +"Він поводиться так, ніби використовується параметр командного рядка :option:" +"`-X faulthandler <-X>` або якщо змінна середовища :envvar:" +"`PYTHONFAULTHANDLER` має значення ``1``." + +msgid "" +"Enable :ref:`asyncio debug mode `. For example, :mod:" +"`asyncio` checks for coroutines that were not awaited and logs them." +msgstr "" +"Увімкнути :ref:`асинхронний режим налагодження `. " +"Наприклад, :mod:`asyncio` перевіряє співпрограми, які не були очікувані, і " +"реєструє їх." + +msgid "" +"It behaves as if the :envvar:`PYTHONASYNCIODEBUG` environment variable is " +"set to ``1``." +msgstr "" +"Він поводиться так, ніби для змінної середовища :envvar:`PYTHONASYNCIODEBUG` " +"встановлено значення ``1``." + +msgid "" +"Check the *encoding* and *errors* arguments for string encoding and decoding " +"operations. Examples: :func:`open`, :meth:`str.encode` and :meth:`bytes." +"decode`." +msgstr "" +"Перевірте аргументи *encoding* і *errors* для операцій кодування та " +"декодування рядків. Приклади: :func:`open`, :meth:`str.encode` і :meth:" +"`bytes.decode`." + +msgid "" +"By default, for best performance, the *errors* argument is only checked at " +"the first encoding/decoding error and the *encoding* argument is sometimes " +"ignored for empty strings." +msgstr "" +"За замовчуванням для найкращої продуктивності аргумент *errors* " +"перевіряється лише при першій помилці кодування/декодування, а аргумент " +"*encoding* іноді ігнорується для порожніх рядків." + +msgid "The :class:`io.IOBase` destructor logs ``close()`` exceptions." +msgstr "Деструктор :class:`io.IOBase` реєструє винятки ``close()``." + +msgid "" +"Set the :attr:`~sys.flags.dev_mode` attribute of :data:`sys.flags` to " +"``True``." +msgstr "" + +msgid "" +"The Python Development Mode does not enable the :mod:`tracemalloc` module by " +"default, because the overhead cost (to performance and memory) would be too " +"large. Enabling the :mod:`tracemalloc` module provides additional " +"information on the origin of some errors. For example, :exc:" +"`ResourceWarning` logs the traceback where the resource was allocated, and a " +"buffer overflow error logs the traceback where the memory block was " +"allocated." +msgstr "" +"Режим розробки Python не вмикає модуль :mod:`tracemalloc` за замовчуванням, " +"оскільки накладні витрати (для продуктивності та пам’яті) будуть занадто " +"великими. Увімкнення модуля :mod:`tracemalloc` надає додаткову інформацію " +"про походження деяких помилок. Наприклад, :exc:`ResourceWarning` реєструє " +"відстеження, де було виділено ресурс, а помилка переповнення буфера реєструє " +"відстеження, де було виділено блок пам’яті." + +msgid "" +"The Python Development Mode does not prevent the :option:`-O` command line " +"option from removing :keyword:`assert` statements nor from setting :const:" +"`__debug__` to ``False``." +msgstr "" +"Режим розробки Python не заважає параметру командного рядка :option:`-O` " +"видаляти оператори :keyword:`assert` або встановлювати :const:`__debug__` " +"значення ``False``." + +msgid "" +"The Python Development Mode can only be enabled at the Python startup. Its " +"value can be read from :data:`sys.flags.dev_mode `." +msgstr "" +"Режим розробки Python можна ввімкнути лише під час запуску Python. Його " +"значення можна прочитати з :data:`sys.flags.dev_mode `." + +msgid "The :class:`io.IOBase` destructor now logs ``close()`` exceptions." +msgstr "Деструктор :class:`io.IOBase` тепер реєструє винятки ``close()``." + +msgid "" +"The *encoding* and *errors* arguments are now checked for string encoding " +"and decoding operations." +msgstr "" +"Аргументи *encoding* і *errors* тепер перевіряються на наявність операцій " +"кодування та декодування рядків." + +msgid "ResourceWarning Example" +msgstr "Приклад ResourceWarning" + +msgid "" +"Example of a script counting the number of lines of the text file specified " +"in the command line::" +msgstr "" +"Приклад сценарію підрахунку кількості рядків текстового файлу, вказаного в " +"командному рядку:" + +msgid "" +"import sys\n" +"\n" +"def main():\n" +" fp = open(sys.argv[1])\n" +" nlines = len(fp.readlines())\n" +" print(nlines)\n" +" # The file is closed implicitly\n" +"\n" +"if __name__ == \"__main__\":\n" +" main()" +msgstr "" + +msgid "" +"The script does not close the file explicitly. By default, Python does not " +"emit any warning. Example using README.txt, which has 269 lines:" +msgstr "" +"Сценарій не закриває файл явно. За замовчуванням Python не видає жодних " +"попереджень. Приклад використання README.txt, який містить 269 рядків:" + +msgid "" +"$ python script.py README.txt\n" +"269" +msgstr "" + +msgid "" +"Enabling the Python Development Mode displays a :exc:`ResourceWarning` " +"warning:" +msgstr "" +"Увімкнення режиму розробки Python відображає попередження :exc:" +"`ResourceWarning`:" + +msgid "" +"$ python -X dev script.py README.txt\n" +"269\n" +"script.py:10: ResourceWarning: unclosed file <_io.TextIOWrapper name='README." +"rst' mode='r' encoding='UTF-8'>\n" +" main()\n" +"ResourceWarning: Enable tracemalloc to get the object allocation traceback" +msgstr "" + +msgid "" +"In addition, enabling :mod:`tracemalloc` shows the line where the file was " +"opened:" +msgstr "" +"Крім того, увімкнення :mod:`tracemalloc` показує рядок, де було відкрито " +"файл:" + +msgid "" +"$ python -X dev -X tracemalloc=5 script.py README.rst\n" +"269\n" +"script.py:10: ResourceWarning: unclosed file <_io.TextIOWrapper name='README." +"rst' mode='r' encoding='UTF-8'>\n" +" main()\n" +"Object allocated at (most recent call last):\n" +" File \"script.py\", lineno 10\n" +" main()\n" +" File \"script.py\", lineno 4\n" +" fp = open(sys.argv[1])" +msgstr "" + +msgid "" +"The fix is to close explicitly the file. Example using a context manager::" +msgstr "" +"Виправлення полягає в тому, щоб явно закрити файл. Приклад використання " +"контекстного менеджера::" + +msgid "" +"def main():\n" +" # Close the file explicitly when exiting the with block\n" +" with open(sys.argv[1]) as fp:\n" +" nlines = len(fp.readlines())\n" +" print(nlines)" +msgstr "" + +msgid "" +"Not closing a resource explicitly can leave a resource open for way longer " +"than expected; it can cause severe issues upon exiting Python. It is bad in " +"CPython, but it is even worse in PyPy. Closing resources explicitly makes an " +"application more deterministic and more reliable." +msgstr "" +"Якщо ресурс не закрити явно, він може залишитися відкритим набагато довше, " +"ніж очікувалося; це може спричинити серйозні проблеми після виходу з Python. " +"Це погано в CPython, але ще гірше в PyPy. Закриття ресурсів явно робить " +"додаток більш детермінованим і надійнішим." + +msgid "Bad file descriptor error example" +msgstr "Приклад помилки неправильного дескриптора файлу" + +msgid "Script displaying the first line of itself::" +msgstr "Сценарій, що відображає перший рядок самого себе::" + +msgid "" +"import os\n" +"\n" +"def main():\n" +" fp = open(__file__)\n" +" firstline = fp.readline()\n" +" print(firstline.rstrip())\n" +" os.close(fp.fileno())\n" +" # The file is closed implicitly\n" +"\n" +"main()" +msgstr "" + +msgid "By default, Python does not emit any warning:" +msgstr "За замовчуванням Python не видає жодного попередження:" + +msgid "" +"$ python script.py\n" +"import os" +msgstr "" + +msgid "" +"The Python Development Mode shows a :exc:`ResourceWarning` and logs a \"Bad " +"file descriptor\" error when finalizing the file object:" +msgstr "" +"Режим розробки Python показує :exc:`ResourceWarning` і реєструє помилку " +"\"Поганий дескриптор файлу\" під час завершення об’єкта файлу:" + +msgid "" +"$ python -X dev script.py\n" +"import os\n" +"script.py:10: ResourceWarning: unclosed file <_io.TextIOWrapper name='script." +"py' mode='r' encoding='UTF-8'>\n" +" main()\n" +"ResourceWarning: Enable tracemalloc to get the object allocation traceback\n" +"Exception ignored in: <_io.TextIOWrapper name='script.py' mode='r' " +"encoding='UTF-8'>\n" +"Traceback (most recent call last):\n" +" File \"script.py\", line 10, in \n" +" main()\n" +"OSError: [Errno 9] Bad file descriptor" +msgstr "" + +msgid "" +"``os.close(fp.fileno())`` closes the file descriptor. When the file object " +"finalizer tries to close the file descriptor again, it fails with the ``Bad " +"file descriptor`` error. A file descriptor must be closed only once. In the " +"worst case scenario, closing it twice can lead to a crash (see :issue:" +"`18748` for an example)." +msgstr "" +"``os.close(fp.fileno())`` закриває дескриптор файлу. Коли фіналізатор " +"файлового об’єкта знову намагається закрити файловий дескриптор, це не " +"вдається з помилкою ``Поганий файловий дескриптор``. Файловий дескриптор має " +"бути закрито лише один раз. У гіршому випадку подвійне закриття може " +"призвести до збою (див. :issue:`18748` для прикладу)." + +msgid "" +"The fix is to remove the ``os.close(fp.fileno())`` line, or open the file " +"with ``closefd=False``." +msgstr "" +"Виправлення полягає у видаленні рядка ``os.close(fp.fileno())`` або " +"відкритті файлу ``closefd=False``." diff --git a/library/dialog.po b/library/dialog.po new file mode 100644 index 000000000..2747f50ec --- /dev/null +++ b/library/dialog.po @@ -0,0 +1,277 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 01:04+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Tkinter Dialogs" +msgstr "Діалоги Tkinter" + +msgid ":mod:`tkinter.simpledialog` --- Standard Tkinter input dialogs" +msgstr ":mod:`tkinter.simpledialog` --- Стандартні діалоги введення Tkinter" + +msgid "**Source code:** :source:`Lib/tkinter/simpledialog.py`" +msgstr "**Вихідний код:** :source:`Lib/tkinter/simpledialog.py`" + +msgid "" +"The :mod:`tkinter.simpledialog` module contains convenience classes and " +"functions for creating simple modal dialogs to get a value from the user." +msgstr "" +"Модуль :mod:`tkinter.simpledialog` містить зручні класи та функції для " +"створення простих модальних діалогів для отримання значення від користувача." + +msgid "" +"The above three functions provide dialogs that prompt the user to enter a " +"value of the desired type." +msgstr "" +"Наведені вище три функції пропонують діалогові вікна, які пропонують " +"користувачеві ввести значення потрібного типу." + +msgid "The base class for custom dialogs." +msgstr "Базовий клас для настроюваних діалогів." + +msgid "" +"Override to construct the dialog's interface and return the widget that " +"should have initial focus." +msgstr "" +"Перевизначити, щоб створити інтерфейс діалогового вікна та повернути віджет, " +"який має мати початковий фокус." + +msgid "" +"Default behaviour adds OK and Cancel buttons. Override for custom button " +"layouts." +msgstr "" +"Поведінка за умовчанням додає кнопки OK і Cancel. Перевизначення для власних " +"макетів кнопок." + +msgid ":mod:`tkinter.filedialog` --- File selection dialogs" +msgstr ":mod:`tkinter.filedialog` --- Діалогове вікно вибору файлів" + +msgid "**Source code:** :source:`Lib/tkinter/filedialog.py`" +msgstr "**Вихідний код:** :source:`Lib/tkinter/filedialog.py`" + +msgid "" +"The :mod:`tkinter.filedialog` module provides classes and factory functions " +"for creating file/directory selection windows." +msgstr "" +"Модуль :mod:`tkinter.filedialog` надає класи та фабричні функції для " +"створення вікон вибору файлів/каталогів." + +msgid "Native Load/Save Dialogs" +msgstr "Власні діалоги завантаження/збереження" + +msgid "" +"The following classes and functions provide file dialog windows that combine " +"a native look-and-feel with configuration options to customize behaviour. " +"The following keyword arguments are applicable to the classes and functions " +"listed below:" +msgstr "" +"Наступні класи та функції забезпечують діалогові вікна файлів, які поєднують " +"зовнішній вигляд і параметри конфігурації для налаштування поведінки. " +"Наступні ключові аргументи застосовні до класів і функцій, перелічених нижче:" + +msgid "*parent* - the window to place the dialog on top of" +msgstr "*parent* - вікно, поверх якого буде розміщено діалогове вікно" + +msgid "*title* - the title of the window" +msgstr "*title* - заголовок вікна" + +msgid "*initialdir* - the directory that the dialog starts in" +msgstr "*initialdir* - каталог, у якому починається діалог" + +msgid "*initialfile* - the file selected upon opening of the dialog" +msgstr "*initialfile* - файл, вибраний під час відкриття діалогу" + +msgid "" +"*filetypes* - a sequence of (label, pattern) tuples, '*' wildcard is allowed" +msgstr "" +"*filetypes* – послідовність (мітка, шаблон) кортежів, дозволений символ " +"підстановки \"*\"." + +msgid "*defaultextension* - default extension to append to file (save dialogs)" +msgstr "" +"*defaultextension* - типове розширення для додавання до файлу (діалогове " +"вікно збереження)" + +msgid "*multiple* - when true, selection of multiple items is allowed" +msgstr "*multiple* - якщо значення true, дозволено вибір кількох елементів" + +msgid "**Static factory functions**" +msgstr "**Статичні заводські функції**" + +msgid "" +"The below functions when called create a modal, native look-and-feel dialog, " +"wait for the user's selection, then return the selected value(s) or ``None`` " +"to the caller." +msgstr "" +"Наведені нижче функції під час виклику створюють модальне діалогове вікно, " +"що нагадує зовнішній вигляд, очікують вибору користувача, а потім повертають " +"вибрані значення або ``None`` абоненту." + +msgid "" +"The above two functions create an :class:`Open` dialog and return the opened " +"file object(s) in read-only mode." +msgstr "" +"Наведені вище дві функції створюють діалогове вікно :class:`Open` і " +"повертають відкритий файловий об’єкт(и) у режимі лише для читання." + +msgid "" +"Create a :class:`SaveAs` dialog and return a file object opened in write-" +"only mode." +msgstr "" +"Створіть діалогове вікно :class:`SaveAs` і поверніть об’єкт файлу, відкритий " +"у режимі лише для запису." + +msgid "" +"The above two functions create an :class:`Open` dialog and return the " +"selected filename(s) that correspond to existing file(s)." +msgstr "" +"Наведені вище дві функції створюють діалогове вікно :class:`Open` та " +"повертають вибрані назви файлів, які відповідають існуючим файлам." + +msgid "Create a :class:`SaveAs` dialog and return the selected filename." +msgstr "" +"Створіть діалогове вікно :class:`SaveAs` і поверніть вибране ім’я файлу." + +msgid "Prompt user to select a directory." +msgstr "Запропонувати користувачеві вибрати каталог." + +msgid "Additional keyword option:" +msgstr "Додатковий параметр ключового слова:" + +msgid "*mustexist* - determines if selection must be an existing directory." +msgstr "*mustexist* - визначає, чи має бути виділений існуючий каталог." + +msgid "" +"The above two classes provide native dialog windows for saving and loading " +"files." +msgstr "" +"Наведені вище два класи надають власні діалогові вікна для збереження та " +"завантаження файлів." + +msgid "**Convenience classes**" +msgstr "**Зручні класи**" + +msgid "" +"The below classes are used for creating file/directory windows from scratch. " +"These do not emulate the native look-and-feel of the platform." +msgstr "" +"Наведені нижче класи використовуються для створення вікон файлів/каталогів з " +"нуля. Вони не імітують зовнішній вигляд і відчуття платформи." + +msgid "Create a dialog prompting the user to select a directory." +msgstr "Створіть діалогове вікно з пропозицією користувача вибрати каталог." + +msgid "" +"The *FileDialog* class should be subclassed for custom event handling and " +"behaviour." +msgstr "" +"Клас *FileDialog* повинен бути підкласом для нестандартної обробки подій і " +"поведінки." + +msgid "Create a basic file selection dialog." +msgstr "Створіть базове діалогове вікно вибору файлів." + +msgid "Trigger the termination of the dialog window." +msgstr "Запустити завершення діалогового вікна." + +msgid "Event handler for double-click event on directory." +msgstr "Обробник подій подвійного клацання в каталозі." + +msgid "Event handler for click event on directory." +msgstr "Обробник події клацання в каталозі." + +msgid "Event handler for double-click event on file." +msgstr "Обробник подій подвійного клацання у файлі." + +msgid "Event handler for single-click event on file." +msgstr "Обробник подій для файлу одним клацанням." + +msgid "Filter the files by directory." +msgstr "Фільтруйте файли за каталогом." + +msgid "Retrieve the file filter currently in use." +msgstr "Отримати фільтр файлів, який зараз використовується." + +msgid "Retrieve the currently selected item." +msgstr "Отримати поточний вибраний елемент." + +msgid "Render dialog and start event loop." +msgstr "Відобразити діалогове вікно та запустити цикл подій." + +msgid "Exit dialog returning current selection." +msgstr "Вийти з діалогового вікна, повертаючи поточний вибір." + +msgid "Exit dialog returning filename, if any." +msgstr "Вийти з діалогового вікна, повертаючи назву файлу, якщо є." + +msgid "Set the file filter." +msgstr "Встановіть фільтр файлів." + +msgid "Update the current file selection to *file*." +msgstr "Оновіть поточний вибір файлу на *file*." + +msgid "" +"A subclass of FileDialog that creates a dialog window for selecting an " +"existing file." +msgstr "" +"Підклас FileDialog, який створює діалогове вікно для вибору існуючого файлу." + +msgid "" +"Test that a file is provided and that the selection indicates an already " +"existing file." +msgstr "Перевірте, чи надано файл і чи виділення вказує на вже існуючий файл." + +msgid "" +"A subclass of FileDialog that creates a dialog window for selecting a " +"destination file." +msgstr "" +"Підклас FileDialog, який створює діалогове вікно для вибору файлу " +"призначення." + +msgid "" +"Test whether or not the selection points to a valid file that is not a " +"directory. Confirmation is required if an already existing file is selected." +msgstr "" +"Перевірте, чи вказує вибір на дійсний файл, який не є каталогом. Якщо " +"вибрано вже існуючий файл, потрібне підтвердження." + +msgid ":mod:`tkinter.commondialog` --- Dialog window templates" +msgstr ":mod:`tkinter.commondialog` --- Шаблони діалогових вікон" + +msgid "**Source code:** :source:`Lib/tkinter/commondialog.py`" +msgstr "**Вихідний код:** :source:`Lib/tkinter/commondialog.py`" + +msgid "" +"The :mod:`tkinter.commondialog` module provides the :class:`Dialog` class " +"that is the base class for dialogs defined in other supporting modules." +msgstr "" +"Модуль :mod:`tkinter.commondialog` надає клас :class:`Dialog`, який є " +"базовим класом для діалогів, визначених в інших допоміжних модулях." + +msgid "Render the Dialog window." +msgstr "Відобразити діалогове вікно." + +msgid "Modules :mod:`tkinter.messagebox`, :ref:`tut-files`" +msgstr "Модулі :mod:`tkinter.messagebox`, :ref:`tut-files`" diff --git a/library/difflib.po b/library/difflib.po new file mode 100644 index 000000000..65a04dac6 --- /dev/null +++ b/library/difflib.po @@ -0,0 +1,1178 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 01:04+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!difflib` --- Helpers for computing deltas" +msgstr "" + +msgid "**Source code:** :source:`Lib/difflib.py`" +msgstr "**Вихідний код:** :source:`Lib/difflib.py`" + +msgid "" +"This module provides classes and functions for comparing sequences. It can " +"be used for example, for comparing files, and can produce information about " +"file differences in various formats, including HTML and context and unified " +"diffs. For comparing directories and files, see also, the :mod:`filecmp` " +"module." +msgstr "" +"Цей модуль містить класи та функції для порівняння послідовностей. Він може " +"бути використаний, наприклад, для порівняння файлів і може видавати " +"інформацію про відмінності файлів у різних форматах, включаючи HTML, " +"контекст і уніфіковані відмінності. Для порівняння каталогів і файлів див. " +"також модуль :mod:`filecmp`." + +msgid "" +"This is a flexible class for comparing pairs of sequences of any type, so " +"long as the sequence elements are :term:`hashable`. The basic algorithm " +"predates, and is a little fancier than, an algorithm published in the late " +"1980's by Ratcliff and Obershelp under the hyperbolic name \"gestalt pattern " +"matching.\" The idea is to find the longest contiguous matching subsequence " +"that contains no \"junk\" elements; these \"junk\" elements are ones that " +"are uninteresting in some sense, such as blank lines or whitespace. " +"(Handling junk is an extension to the Ratcliff and Obershelp algorithm.) The " +"same idea is then applied recursively to the pieces of the sequences to the " +"left and to the right of the matching subsequence. This does not yield " +"minimal edit sequences, but does tend to yield matches that \"look right\" " +"to people." +msgstr "" +"Це гнучкий клас для порівняння пар послідовностей будь-якого типу, за умови, " +"що елементи послідовності :term:`hashable`. Базовий алгоритм передує " +"алгоритму, опублікованому наприкінці 1980-х років Реткліфом і Обершелпом під " +"гіперболічною назвою \"відповідність гештальт-шаблону\", і є трохи моднішим " +"за нього. Ідея полягає в тому, щоб знайти найдовшу безперервну відповідну " +"підпослідовність, яка не містить \"сміттєвих\" елементів; ці \"сміттєві\" " +"елементи є такими, що в певному сенсі нецікаві, наприклад порожні рядки чи " +"пробіли. (Обробка сміття є розширенням алгоритму Раткліффа та Обершелпа.) Ця " +"сама ідея потім рекурсивно застосовується до фрагментів послідовностей " +"ліворуч і праворуч від відповідної підпослідовності. Це не дає мінімальних " +"послідовностей редагування, але, як правило, дає збіги, які \"виглядають " +"правильно\" для людей." + +msgid "" +"**Timing:** The basic Ratcliff-Obershelp algorithm is cubic time in the " +"worst case and quadratic time in the expected case. :class:`SequenceMatcher` " +"is quadratic time for the worst case and has expected-case behavior " +"dependent in a complicated way on how many elements the sequences have in " +"common; best case time is linear." +msgstr "" +"**Час:** основний алгоритм Реткліффа-Обершелпа – це кубічний час у " +"найгіршому випадку та квадратичний час у очікуваному випадку. :class:" +"`SequenceMatcher` — це квадратичний час для найгіршого випадку та має " +"очікувану поведінку, складно залежну від кількості спільних елементів " +"послідовностей; найкращий час – лінійний." + +msgid "" +"**Automatic junk heuristic:** :class:`SequenceMatcher` supports a heuristic " +"that automatically treats certain sequence items as junk. The heuristic " +"counts how many times each individual item appears in the sequence. If an " +"item's duplicates (after the first one) account for more than 1% of the " +"sequence and the sequence is at least 200 items long, this item is marked as " +"\"popular\" and is treated as junk for the purpose of sequence matching. " +"This heuristic can be turned off by setting the ``autojunk`` argument to " +"``False`` when creating the :class:`SequenceMatcher`." +msgstr "" +"**Автоматична евристика сміття:** :class:`SequenceMatcher` підтримує " +"евристику, яка автоматично розглядає певні елементи послідовності як сміття. " +"Евристика підраховує, скільки разів кожен окремий елемент з’являється в " +"послідовності. Якщо дублікати елемента (після першого) становлять більше 1% " +"послідовності, а послідовність складається щонайменше з 200 елементів, цей " +"елемент позначається як \"популярний\" і розглядається як небажаний для " +"цілей відповідності послідовності. Цю евристику можна вимкнути, встановивши " +"для аргументу ``autojunk`` значення ``False`` під час створення :class:" +"`SequenceMatcher`." + +msgid "Added the *autojunk* parameter." +msgstr "" + +msgid "" +"This is a class for comparing sequences of lines of text, and producing " +"human-readable differences or deltas. Differ uses :class:`SequenceMatcher` " +"both to compare sequences of lines, and to compare sequences of characters " +"within similar (near-matching) lines." +msgstr "" +"Це клас для порівняння послідовностей рядків тексту та створення зрозумілих " +"людині відмінностей або дельт. Differ використовує :class:`SequenceMatcher` " +"як для порівняння послідовностей рядків, так і для порівняння послідовностей " +"символів у подібних (майже відповідних) рядках." + +msgid "Each line of a :class:`Differ` delta begins with a two-letter code:" +msgstr "Кожен рядок дельти :class:`Differ` починається двобуквеним кодом:" + +msgid "Code" +msgstr "Код" + +msgid "Meaning" +msgstr "Значення" + +msgid "``'- '``" +msgstr "``'- ''``" + +msgid "line unique to sequence 1" +msgstr "рядок, унікальний для послідовності 1" + +msgid "``'+ '``" +msgstr "``'+ '``" + +msgid "line unique to sequence 2" +msgstr "рядок, унікальний для послідовності 2" + +msgid "``' '``" +msgstr "``' '``" + +msgid "line common to both sequences" +msgstr "лінія, спільна для обох послідовностей" + +msgid "``'? '``" +msgstr "``'? ''``" + +msgid "line not present in either input sequence" +msgstr "рядок відсутній у жодній послідовності введення" + +msgid "" +"Lines beginning with '``?``' attempt to guide the eye to intraline " +"differences, and were not present in either input sequence. These lines can " +"be confusing if the sequences contain whitespace characters, such as spaces, " +"tabs or line breaks." +msgstr "" + +msgid "" +"This class can be used to create an HTML table (or a complete HTML file " +"containing the table) showing a side by side, line by line comparison of " +"text with inter-line and intra-line change highlights. The table can be " +"generated in either full or contextual difference mode." +msgstr "" +"Цей клас можна використовувати для створення HTML-таблиці (або повного HTML-" +"файлу, що містить таблицю), що показує пліч-о-пліч, рядок за рядком, " +"порівняння тексту з підсвічуванням міжрядкових і внутрішньорядкових змін. " +"Таблицю можна створити в режимі повної різниці або в режимі контекстної " +"різниці." + +msgid "The constructor for this class is:" +msgstr "Конструктор для цього класу:" + +msgid "Initializes instance of :class:`HtmlDiff`." +msgstr "Ініціалізує екземпляр :class:`HtmlDiff`." + +msgid "" +"*tabsize* is an optional keyword argument to specify tab stop spacing and " +"defaults to ``8``." +msgstr "" +"*tabsize* є необов’язковим аргументом ключового слова для визначення " +"інтервалу табуляції та за замовчуванням ``8``." + +msgid "" +"*wrapcolumn* is an optional keyword to specify column number where lines are " +"broken and wrapped, defaults to ``None`` where lines are not wrapped." +msgstr "" +"*wrapcolumn* є необов’язковим ключовим словом для вказівки номера стовпця, " +"де рядки розбиті та перенесені, за замовчуванням ``None``, якщо рядки не " +"перенесені." + +msgid "" +"*linejunk* and *charjunk* are optional keyword arguments passed into :func:" +"`ndiff` (used by :class:`HtmlDiff` to generate the side by side HTML " +"differences). See :func:`ndiff` documentation for argument default values " +"and descriptions." +msgstr "" +"*linejunk* і *charjunk* є необов’язковими аргументами ключових слів, які " +"передаються в :func:`ndiff` (використовуються :class:`HtmlDiff` для " +"генерування відмінностей у HTML). Перегляньте документацію :func:`ndiff`, " +"щоб дізнатися про значення аргументів за замовчуванням та описи." + +msgid "The following methods are public:" +msgstr "Публічними є такі методи:" + +msgid "" +"Compares *fromlines* and *tolines* (lists of strings) and returns a string " +"which is a complete HTML file containing a table showing line by line " +"differences with inter-line and intra-line changes highlighted." +msgstr "" +"Порівнює *fromlines* і *tolines* (списки рядків) і повертає рядок, який є " +"повним HTML-файлом, що містить таблицю, у якій показано рядкові відмінності " +"з виділеними міжрядковими та внутрішньорядковими змінами." + +msgid "" +"*fromdesc* and *todesc* are optional keyword arguments to specify from/to " +"file column header strings (both default to an empty string)." +msgstr "" +"*fromdesc* і *todesc* є необов’язковими аргументами ключових слів для " +"вказівки рядків заголовків стовпців файлу from/to (обидва за замовчуванням є " +"порожнім рядком)." + +msgid "" +"*context* and *numlines* are both optional keyword arguments. Set *context* " +"to ``True`` when contextual differences are to be shown, else the default is " +"``False`` to show the full files. *numlines* defaults to ``5``. When " +"*context* is ``True`` *numlines* controls the number of context lines which " +"surround the difference highlights. When *context* is ``False`` *numlines* " +"controls the number of lines which are shown before a difference highlight " +"when using the \"next\" hyperlinks (setting to zero would cause the \"next\" " +"hyperlinks to place the next difference highlight at the top of the browser " +"without any leading context)." +msgstr "" +"*context* і *numlines* є необов’язковими аргументами ключового слова. " +"Встановіть для *context* значення ``True``, якщо мають відображатися " +"контекстуальні відмінності, інакше значенням за замовчуванням є ``False`` " +"для відображення повних файлів. *numlines* за умовчанням має значення ``5``. " +"Якщо *context* має значення ``True``, *numlines* контролює кількість рядків " +"контексту, які оточують виділення різниці. Коли *context* має значення " +"``False``, *numlines* контролює кількість рядків, які відображаються перед " +"підсвічуванням різниці під час використання \"наступних\" гіперпосилань " +"(встановлення нуля призведе до того, що \"наступні\" гіперпосилання " +"розмістять наступне підсвічування різниці в у верхній частині браузера без " +"будь-якого початкового контексту)." + +msgid "" +"*fromdesc* and *todesc* are interpreted as unescaped HTML and should be " +"properly escaped while receiving input from untrusted sources." +msgstr "" +"*fromdesc* і *todesc* інтерпретуються як неекранований HTML і мають бути " +"належним чином екрановані під час отримання вхідних даних із ненадійних " +"джерел." + +msgid "" +"*charset* keyword-only argument was added. The default charset of HTML " +"document changed from ``'ISO-8859-1'`` to ``'utf-8'``." +msgstr "" +"Додано *charset* лише ключовий аргумент. Стандартний набір кодів HTML-" +"документа змінено з ``'ISO-8859-1'`` на ``'utf-8'``." + +msgid "" +"Compares *fromlines* and *tolines* (lists of strings) and returns a string " +"which is a complete HTML table showing line by line differences with inter-" +"line and intra-line changes highlighted." +msgstr "" +"Порівнює *fromlines* і *tolines* (списки рядків) і повертає рядок, який є " +"повною HTML-таблицею, що показує рядкові відмінності з виділеними " +"міжрядковими та внутрішньорядковими змінами." + +msgid "" +"The arguments for this method are the same as those for the :meth:" +"`make_file` method." +msgstr "" +"Аргументи для цього методу такі самі, як і для методу :meth:`make_file`." + +msgid "" +"Compare *a* and *b* (lists of strings); return a delta (a :term:`generator` " +"generating the delta lines) in context diff format." +msgstr "" +"Порівняти *a* і *b* (списки рядків); повертає дельту (:term:`generator`, що " +"генерує дельта-рядки) у форматі контекстної різниці." + +msgid "" +"Context diffs are a compact way of showing just the lines that have changed " +"plus a few lines of context. The changes are shown in a before/after " +"style. The number of context lines is set by *n* which defaults to three." +msgstr "" +"Контекстні відмінності — це компактний спосіб показати лише рядки, які " +"змінилися, плюс кілька рядків контексту. Зміни відображаються у стилі до/" +"після. Кількість рядків контексту встановлюється *n*, яке за замовчуванням " +"дорівнює трьом." + +msgid "" +"By default, the diff control lines (those with ``***`` or ``---``) are " +"created with a trailing newline. This is helpful so that inputs created " +"from :func:`io.IOBase.readlines` result in diffs that are suitable for use " +"with :func:`io.IOBase.writelines` since both the inputs and outputs have " +"trailing newlines." +msgstr "" +"За замовчуванням рядки керування відмінностями (ті, що мають ``***`` або " +"``---``) створюються з кінцевим символом нового рядка. Це корисно, щоб " +"вхідні дані, створені з :func:`io.IOBase.readlines`, призводили до " +"відмінностей, які придатні для використання з :func:`io.IOBase.writelines`, " +"оскільки і вхідні, і вихідні дані мають кінцеві символи нового рядка." + +msgid "" +"For inputs that do not have trailing newlines, set the *lineterm* argument " +"to ``\"\"`` so that the output will be uniformly newline free." +msgstr "" +"Для вхідних даних, які не мають кінцевих символів нового рядка, встановіть " +"для аргументу *lineterm* значення ``\"\"``, щоб вихідні дані не містили " +"символів нового рядка." + +msgid "" +"The context diff format normally has a header for filenames and modification " +"times. Any or all of these may be specified using strings for *fromfile*, " +"*tofile*, *fromfiledate*, and *tofiledate*. The modification times are " +"normally expressed in the ISO 8601 format. If not specified, the strings " +"default to blanks." +msgstr "" +"Формат контекстної різниці зазвичай має заголовок для імен файлів і часу " +"модифікації. Будь-який або всі з них можна вказати за допомогою рядків для " +"*fromfile*, *tofile*, *fromfiledate* і *tofiledate*. Час модифікації " +"зазвичай виражається у форматі ISO 8601. Якщо не вказано, рядки за " +"умовчанням пусті." + +msgid "See :ref:`difflib-interface` for a more detailed example." +msgstr "Дивіться :ref:`difflib-interface` для більш детального прикладу." + +msgid "" +"Return a list of the best \"good enough\" matches. *word* is a sequence for " +"which close matches are desired (typically a string), and *possibilities* is " +"a list of sequences against which to match *word* (typically a list of " +"strings)." +msgstr "" +"Поверніть список найкращих \"досить хороших\" збігів. *слово* — це " +"послідовність, для якої потрібні близькі збіги (зазвичай це рядок), а " +"*можливості* — це список послідовностей, з якими потрібно зіставити *слово* " +"(зазвичай список рядків)." + +msgid "" +"Optional argument *n* (default ``3``) is the maximum number of close matches " +"to return; *n* must be greater than ``0``." +msgstr "" +"Необов'язковий аргумент *n* (за замовчуванням ``3``) — це максимальна " +"кількість близьких збігів для повернення; *n* має бути більше, ніж ``0``." + +msgid "" +"Optional argument *cutoff* (default ``0.6``) is a float in the range [0, 1]. " +"Possibilities that don't score at least that similar to *word* are ignored." +msgstr "" +"Необов’язковий аргумент *cutoff* (за замовчуванням ``0,6``) є числом з " +"плаваючою точкою в діапазоні [0, 1]. Можливості, які не схожі на *слово*, " +"ігноруються." + +msgid "" +"The best (no more than *n*) matches among the possibilities are returned in " +"a list, sorted by similarity score, most similar first." +msgstr "" +"Найкращі (не більше ніж *n*) збіги серед можливих повертаються у списку, " +"відсортованому за показником подібності, найбільш схожі першими." + +msgid "" +"Compare *a* and *b* (lists of strings); return a :class:`Differ`\\ -style " +"delta (a :term:`generator` generating the delta lines)." +msgstr "" +"Порівняти *a* і *b* (списки рядків); повертає :class:`Differ`\\ -стиль " +"дельти (:term:`generator`, який генерує дельта-лінії)." + +msgid "" +"Optional keyword parameters *linejunk* and *charjunk* are filtering " +"functions (or ``None``):" +msgstr "" +"Додаткові параметри ключових слів *linejunk* і *charjunk* є функціями " +"фільтрації (або ``None``):" + +msgid "" +"*linejunk*: A function that accepts a single string argument, and returns " +"true if the string is junk, or false if not. The default is ``None``. There " +"is also a module-level function :func:`IS_LINE_JUNK`, which filters out " +"lines without visible characters, except for at most one pound character " +"(``'#'``) -- however the underlying :class:`SequenceMatcher` class does a " +"dynamic analysis of which lines are so frequent as to constitute noise, and " +"this usually works better than using this function." +msgstr "" +"*linejunk*: функція, яка приймає один рядковий аргумент і повертає true, " +"якщо рядок є небажаним, або false, якщо ні. Типовим значенням є ``None``. " +"Існує також функція на рівні модуля :func:`IS_LINE_JUNK`, яка відфільтровує " +"рядки без видимих символів, за винятком щонайбільше одного символу фунта " +"(``'#'``), однак базовий :class:`SequenceMatcher` клас виконує динамічний " +"аналіз того, які рядки є настільки частими, що створюють шум, і це зазвичай " +"працює краще, ніж використання цієї функції." + +msgid "" +"*charjunk*: A function that accepts a character (a string of length 1), and " +"returns if the character is junk, or false if not. The default is module-" +"level function :func:`IS_CHARACTER_JUNK`, which filters out whitespace " +"characters (a blank or tab; it's a bad idea to include newline in this!)." +msgstr "" +"*charjunk*: функція, яка приймає символ (рядок довжиною 1) і повертає, якщо " +"символ непотрібний, або false, якщо ні. За замовчуванням використовується " +"функція рівня модуля :func:`IS_CHARACTER_JUNK`, яка відфільтровує пробіли " +"(пробіл або символ табуляції; це погана ідея включати новий рядок у це!)." + +msgid "Return one of the two sequences that generated a delta." +msgstr "Повертає одну з двох послідовностей, які створили дельту." + +msgid "" +"Given a *sequence* produced by :meth:`Differ.compare` or :func:`ndiff`, " +"extract lines originating from file 1 or 2 (parameter *which*), stripping " +"off line prefixes." +msgstr "" +"За наявності *послідовності*, створеної :meth:`Differ.compare` або :func:" +"`ndiff`, витягти рядки, що походять із файлу 1 або 2 (параметр *which*), " +"видаливши префікси рядків." + +msgid "Example:" +msgstr "приклад:" + +msgid "" +"Compare *a* and *b* (lists of strings); return a delta (a :term:`generator` " +"generating the delta lines) in unified diff format." +msgstr "" +"Порівняти *a* і *b* (списки рядків); повертає дельту (:term:`generator`, що " +"генерує дельта-лінії) в уніфікованому форматі різниці." + +msgid "" +"Unified diffs are a compact way of showing just the lines that have changed " +"plus a few lines of context. The changes are shown in an inline style " +"(instead of separate before/after blocks). The number of context lines is " +"set by *n* which defaults to three." +msgstr "" +"Уніфіковані відмінності — це компактний спосіб показати лише рядки, які " +"змінилися, плюс кілька рядків контексту. Зміни відображаються у вбудованому " +"стилі (замість окремих блоків до/після). Кількість рядків контексту " +"встановлюється *n*, яке за замовчуванням дорівнює трьом." + +msgid "" +"By default, the diff control lines (those with ``---``, ``+++``, or ``@@``) " +"are created with a trailing newline. This is helpful so that inputs created " +"from :func:`io.IOBase.readlines` result in diffs that are suitable for use " +"with :func:`io.IOBase.writelines` since both the inputs and outputs have " +"trailing newlines." +msgstr "" +"За замовчуванням рядки керування відмінностями (з ``---``, ``+++`` або " +"``@@``) створюються з кінцевим символом нового рядка. Це корисно, щоб вхідні " +"дані, створені з :func:`io.IOBase.readlines`, призводили до відмінностей, " +"які придатні для використання з :func:`io.IOBase.writelines`, оскільки і " +"вхідні, і вихідні дані мають кінцеві символи нового рядка." + +msgid "" +"The unified diff format normally has a header for filenames and modification " +"times. Any or all of these may be specified using strings for *fromfile*, " +"*tofile*, *fromfiledate*, and *tofiledate*. The modification times are " +"normally expressed in the ISO 8601 format. If not specified, the strings " +"default to blanks." +msgstr "" + +msgid "" +"Compare *a* and *b* (lists of bytes objects) using *dfunc*; yield a sequence " +"of delta lines (also bytes) in the format returned by *dfunc*. *dfunc* must " +"be a callable, typically either :func:`unified_diff` or :func:`context_diff`." +msgstr "" +"Порівняти *a* і *b* (списки об’єктів bytes) за допомогою *dfunc*; дає " +"послідовність дельта-рядків (також байтів) у форматі, який повертає *dfunc*. " +"*dfunc* має бути викликом, як правило, :func:`unified_diff` або :func:" +"`context_diff`." + +msgid "" +"Allows you to compare data with unknown or inconsistent encoding. All inputs " +"except *n* must be bytes objects, not str. Works by losslessly converting " +"all inputs (except *n*) to str, and calling ``dfunc(a, b, fromfile, tofile, " +"fromfiledate, tofiledate, n, lineterm)``. The output of *dfunc* is then " +"converted back to bytes, so the delta lines that you receive have the same " +"unknown/inconsistent encodings as *a* and *b*." +msgstr "" +"Дозволяє порівнювати дані з невідомим або суперечливим кодуванням. Усі " +"вхідні дані, крім *n*, мають бути об’єктами bytes, а не str. Працює без " +"втрат, перетворюючи всі вхідні дані (крім *n*) на str і викликаючи " +"``dfunc(a, b, fromfile, tofile, fromfiledate, tofiledate, n, lineterm)``. " +"Вихідні дані *dfunc* потім перетворюються назад у байти, тому дельта-рядки, " +"які ви отримуєте, мають таке ж невідоме/непослідовне кодування, що й *a* і " +"*b*." + +msgid "" +"Return ``True`` for ignorable lines. The line *line* is ignorable if *line* " +"is blank or contains a single ``'#'``, otherwise it is not ignorable. Used " +"as a default for parameter *linejunk* in :func:`ndiff` in older versions." +msgstr "" +"Повертає ``True`` для ігнорованих рядків. Рядок *рядок* ігнорується, якщо " +"*рядок* порожній або містить один ``'#'``, інакше він не ігнорується. " +"Використовується за замовчуванням для параметра *linejunk* у :func:`ndiff` у " +"старих версіях." + +msgid "" +"Return ``True`` for ignorable characters. The character *ch* is ignorable " +"if *ch* is a space or tab, otherwise it is not ignorable. Used as a default " +"for parameter *charjunk* in :func:`ndiff`." +msgstr "" +"Повертає ``True`` для ігнорованих символів. Символ *ch* ігнорується, якщо " +"*ch* є пробілом або табуляцією, інакше він не ігнорується. Використовується " +"за замовчуванням для параметра *charjunk* у :func:`ndiff`." + +msgid "" +"`Pattern Matching: The Gestalt Approach `_" +msgstr "" + +msgid "" +"Discussion of a similar algorithm by John W. Ratcliff and D. E. Metzener. " +"This was published in `Dr. Dobb's Journal `_ in " +"July, 1988." +msgstr "" + +msgid "SequenceMatcher Objects" +msgstr "Об’єкти SequenceMatcher" + +msgid "The :class:`SequenceMatcher` class has this constructor:" +msgstr "Клас :class:`SequenceMatcher` має такий конструктор:" + +msgid "" +"Optional argument *isjunk* must be ``None`` (the default) or a one-argument " +"function that takes a sequence element and returns true if and only if the " +"element is \"junk\" and should be ignored. Passing ``None`` for *isjunk* is " +"equivalent to passing ``lambda x: False``; in other words, no elements are " +"ignored. For example, pass::" +msgstr "" +"Необов’язковий аргумент *isjunk* має бути ``None`` (за замовчуванням) або " +"функція з одним аргументом, яка приймає елемент послідовності та повертає " +"true тоді і тільки тоді, коли елемент є \"сміттєвим\" і його слід " +"ігнорувати. Передача ``None`` для *isjunk* еквівалентна передачі ``lambda x: " +"False``; іншими словами, жоден елемент не ігнорується. Наприклад, pass::" + +msgid "lambda x: x in \" \\t\"" +msgstr "" + +msgid "" +"if you're comparing lines as sequences of characters, and don't want to " +"synch up on blanks or hard tabs." +msgstr "" +"якщо ви порівнюєте рядки як послідовності символів і не хочете " +"синхронізувати пробіли чи жорсткі табуляції." + +msgid "" +"The optional arguments *a* and *b* are sequences to be compared; both " +"default to empty strings. The elements of both sequences must be :term:" +"`hashable`." +msgstr "" +"Необов'язкові аргументи *a* і *b* є послідовностями для порівняння; обидва " +"за замовчуванням порожні рядки. Елементи обох послідовностей мають бути :" +"term:`hashable`." + +msgid "" +"The optional argument *autojunk* can be used to disable the automatic junk " +"heuristic." +msgstr "" +"Необов’язковий аргумент *autojunk* можна використовувати для вимкнення " +"автоматичної евристики сміття." + +msgid "" +"SequenceMatcher objects get three data attributes: *bjunk* is the set of " +"elements of *b* for which *isjunk* is ``True``; *bpopular* is the set of non-" +"junk elements considered popular by the heuristic (if it is not disabled); " +"*b2j* is a dict mapping the remaining elements of *b* to a list of positions " +"where they occur. All three are reset whenever *b* is reset with :meth:" +"`set_seqs` or :meth:`set_seq2`." +msgstr "" +"Об’єкти SequenceMatcher отримують три атрибути даних: *bjunk* — це набір " +"елементів *b*, для яких *isjunk* має значення ``True``; *bpopular* — це " +"набір непотрібних елементів, які вважаються популярними за евристикою (якщо " +"її не вимкнено); *b2j* — це dict, що відображає решту елементів *b* на " +"список позицій, де вони зустрічаються. Усі три скидаються щоразу, коли *b* " +"скидається за допомогою :meth:`set_seqs` або :meth:`set_seq2`." + +msgid "The *bjunk* and *bpopular* attributes." +msgstr "Атрибути *bjunk* і *bpopular*." + +msgid ":class:`SequenceMatcher` objects have the following methods:" +msgstr "Об’єкти :class:`SequenceMatcher` мають такі методи:" + +msgid "Set the two sequences to be compared." +msgstr "Встановіть дві послідовності для порівняння." + +msgid "" +":class:`SequenceMatcher` computes and caches detailed information about the " +"second sequence, so if you want to compare one sequence against many " +"sequences, use :meth:`set_seq2` to set the commonly used sequence once and " +"call :meth:`set_seq1` repeatedly, once for each of the other sequences." +msgstr "" +":class:`SequenceMatcher` обчислює та кешує детальну інформацію про другу " +"послідовність, тому, якщо ви хочете порівняти одну послідовність із багатьма " +"послідовностями, використовуйте :meth:`set_seq2`, щоб один раз установити " +"типову послідовність і викликати :meth:`set_seq1` повторно, один раз для " +"кожної з інших послідовностей." + +msgid "" +"Set the first sequence to be compared. The second sequence to be compared " +"is not changed." +msgstr "" +"Встановіть першу послідовність для порівняння. Друга послідовність для " +"порівняння не змінюється." + +msgid "" +"Set the second sequence to be compared. The first sequence to be compared " +"is not changed." +msgstr "" +"Встановіть другу послідовність для порівняння. Перша послідовність для " +"порівняння не змінюється." + +msgid "Find longest matching block in ``a[alo:ahi]`` and ``b[blo:bhi]``." +msgstr "Знайти найдовший відповідний блок у ``a[alo:ahi]`` і ``b[blo:bhi]``." + +msgid "" +"If *isjunk* was omitted or ``None``, :meth:`find_longest_match` returns " +"``(i, j, k)`` such that ``a[i:i+k]`` is equal to ``b[j:j+k]``, where ``alo " +"<= i <= i+k <= ahi`` and ``blo <= j <= j+k <= bhi``. For all ``(i', j', " +"k')`` meeting those conditions, the additional conditions ``k >= k'``, ``i " +"<= i'``, and if ``i == i'``, ``j <= j'`` are also met. In other words, of " +"all maximal matching blocks, return one that starts earliest in *a*, and of " +"all those maximal matching blocks that start earliest in *a*, return the one " +"that starts earliest in *b*." +msgstr "" +"Якщо *isjunk* пропущено або ``None``, :meth:`find_longest_match` повертає " +"``(i, j, k)`` так, що ``a[i:i+k]`` дорівнює ``b[j:j+k]``, де ``alo <= i <= " +"i+k <= ahi`` and ``blo <= j <= j+k <= bhi``. For all ``(i', j', k')`` " +"meeting those conditions, the additional conditions ``k > = k''``, ``i <= " +"i''``, а якщо ``i == i'``, ``j <= j \"`` також зустрічаються. Іншими " +"словами, з усіх максимальних відповідних блоків поверніть той, який " +"починається найраніше в *a*, а з усіх тих максимальних відповідних блоків, " +"які починаються раніше в *a*, поверніть той, який починається найраніше в " +"*b*." + +msgid "" +"If *isjunk* was provided, first the longest matching block is determined as " +"above, but with the additional restriction that no junk element appears in " +"the block. Then that block is extended as far as possible by matching " +"(only) junk elements on both sides. So the resulting block never matches on " +"junk except as identical junk happens to be adjacent to an interesting match." +msgstr "" +"Якщо було надано *isjunk*, спочатку визначається найдовший відповідний блок, " +"як описано вище, але з додатковим обмеженням, що в блоці не з’являється " +"сміттєвий елемент. Потім цей блок розширюється настільки, наскільки це " +"можливо, за допомогою зіставлення (лише) сміттєвих елементів з обох сторін. " +"Таким чином, отриманий блок ніколи не збігається зі сміттям, за винятком " +"випадків, коли ідентичне сміття буває поруч із цікавим збігом." + +msgid "" +"Here's the same example as before, but considering blanks to be junk. That " +"prevents ``' abcd'`` from matching the ``' abcd'`` at the tail end of the " +"second sequence directly. Instead only the ``'abcd'`` can match, and " +"matches the leftmost ``'abcd'`` in the second sequence:" +msgstr "" +"Ось той самий приклад, що й раніше, але вважаючи заготовки сміттям. Це " +"запобігає прямому збігу ``' abcd'`` з ``' abcd'`` у кінці другої " +"послідовності. Замість цього може збігатися лише ``'abcd'`` і збігається з " +"крайнім лівим ``'abcd'`` у другій послідовності:" + +msgid "If no blocks match, this returns ``(alo, blo, 0)``." +msgstr "Якщо жоден блок не збігається, повертається ``(alo, blo, 0)``." + +msgid "This method returns a :term:`named tuple` ``Match(a, b, size)``." +msgstr "Цей метод повертає :term:`named tuple` ``Match(a, b, size)``." + +msgid "Added default arguments." +msgstr "Додано типові аргументи." + +msgid "" +"Return list of triples describing non-overlapping matching subsequences. " +"Each triple is of the form ``(i, j, n)``, and means that ``a[i:i+n] == b[j:" +"j+n]``. The triples are monotonically increasing in *i* and *j*." +msgstr "" +"Повернути список трійок, що описують відповідні підпослідовності, що не " +"перекриваються. Кожна трійка має форму ``(i, j, n)`` і означає, що ``a[i:" +"i+n] == b[j:j+n]``. Трійки монотонно зростають у *i* та *j*." + +msgid "" +"The last triple is a dummy, and has the value ``(len(a), len(b), 0)``. It " +"is the only triple with ``n == 0``. If ``(i, j, n)`` and ``(i', j', n')`` " +"are adjacent triples in the list, and the second is not the last triple in " +"the list, then ``i+n < i'`` or ``j+n < j'``; in other words, adjacent " +"triples always describe non-adjacent equal blocks." +msgstr "" +"Остання трійка є фіктивною і має значення ``(len(a), len(b), 0)``. Це єдина " +"трійка з ``n == 0``. Якщо ``(i, j, n)`` і ``(i', j', n')`` є суміжними " +"трійками в списку, а друга не є останньою трійкою в списку, тоді ``i +n < " +"i'`` або ``j+n < j'``; іншими словами, сусідні трійки завжди описують " +"несуміжні рівні блоки." + +msgid "" +">>> s = SequenceMatcher(None, \"abxcd\", \"abcd\")\n" +">>> s.get_matching_blocks()\n" +"[Match(a=0, b=0, size=2), Match(a=3, b=2, size=2), Match(a=5, b=4, size=0)]" +msgstr "" + +msgid "" +"Return list of 5-tuples describing how to turn *a* into *b*. Each tuple is " +"of the form ``(tag, i1, i2, j1, j2)``. The first tuple has ``i1 == j1 == " +"0``, and remaining tuples have *i1* equal to the *i2* from the preceding " +"tuple, and, likewise, *j1* equal to the previous *j2*." +msgstr "" +"Повернути список із 5-ти кортежів, які описують, як перетворити *a* на *b*. " +"Кожен кортеж має форму ``(tag, i1, i2, j1, j2)``. Перший кортеж має ``i1 == " +"j1 == 0``, а решта кортежів мають *i1*, що дорівнює *i2* з попереднього " +"кортежу, і, так само, *j1* дорівнює попередньому *j2*." + +msgid "The *tag* values are strings, with these meanings:" +msgstr "Значення *тегу* є рядками з такими значеннями:" + +msgid "Value" +msgstr "Значення" + +msgid "``'replace'``" +msgstr "``'замінити'``" + +msgid "``a[i1:i2]`` should be replaced by ``b[j1:j2]``." +msgstr "``a[i1:i2]`` слід замінити на ``b[j1:j2]``." + +msgid "``'delete'``" +msgstr "``'видалити'``" + +msgid "``a[i1:i2]`` should be deleted. Note that ``j1 == j2`` in this case." +msgstr "" +"``a[i1:i2]`` слід видалити. Зверніть увагу, що в цьому випадку ``j1 == j2``." + +msgid "``'insert'``" +msgstr "``'вставити'``" + +msgid "" +"``b[j1:j2]`` should be inserted at ``a[i1:i1]``. Note that ``i1 == i2`` in " +"this case." +msgstr "" +"``b[j1:j2]`` слід вставити в ``a[i1:i1]``. Зверніть увагу, що в цьому " +"випадку ``i1 == i2``." + +msgid "``'equal'``" +msgstr "``'рівний''``" + +msgid "``a[i1:i2] == b[j1:j2]`` (the sub-sequences are equal)." +msgstr "``a[i1:i2] == b[j1:j2]`` (підпослідовності рівні)." + +msgid "For example::" +msgstr "Наприклад::" + +msgid "" +">>> a = \"qabxcd\"\n" +">>> b = \"abycdf\"\n" +">>> s = SequenceMatcher(None, a, b)\n" +">>> for tag, i1, i2, j1, j2 in s.get_opcodes():\n" +"... print('{:7} a[{}:{}] --> b[{}:{}] {!r:>8} --> {!r}'.format(\n" +"... tag, i1, i2, j1, j2, a[i1:i2], b[j1:j2]))\n" +"delete a[0:1] --> b[0:0] 'q' --> ''\n" +"equal a[1:3] --> b[0:2] 'ab' --> 'ab'\n" +"replace a[3:4] --> b[2:3] 'x' --> 'y'\n" +"equal a[4:6] --> b[3:5] 'cd' --> 'cd'\n" +"insert a[6:6] --> b[5:6] '' --> 'f'" +msgstr "" + +msgid "Return a :term:`generator` of groups with up to *n* lines of context." +msgstr "Повертає :term:`generator` груп із до *n* рядків контексту." + +msgid "" +"Starting with the groups returned by :meth:`get_opcodes`, this method splits " +"out smaller change clusters and eliminates intervening ranges which have no " +"changes." +msgstr "" +"Починаючи з груп, повернутих :meth:`get_opcodes`, цей метод розділяє менші " +"кластери змін і усуває проміжні діапазони, які не мають змін." + +msgid "The groups are returned in the same format as :meth:`get_opcodes`." +msgstr "Групи повертаються у тому самому форматі, що й :meth:`get_opcodes`." + +msgid "" +"Return a measure of the sequences' similarity as a float in the range [0, 1]." +msgstr "" +"Повертає міру подібності послідовностей як число з плаваючою точкою в " +"діапазоні [0, 1]." + +msgid "" +"Where T is the total number of elements in both sequences, and M is the " +"number of matches, this is 2.0\\*M / T. Note that this is ``1.0`` if the " +"sequences are identical, and ``0.0`` if they have nothing in common." +msgstr "" +"Де T — загальна кількість елементів в обох послідовностях, а M — кількість " +"збігів, це 2,0\\*M / T. Зауважте, що це \"1,0\", якщо послідовності " +"ідентичні, і \"0,0\" якщо вони не мають нічого спільного." + +msgid "" +"This is expensive to compute if :meth:`get_matching_blocks` or :meth:" +"`get_opcodes` hasn't already been called, in which case you may want to try :" +"meth:`quick_ratio` or :meth:`real_quick_ratio` first to get an upper bound." +msgstr "" +"Це дорого обчислювати, якщо :meth:`get_matching_blocks` або :meth:" +"`get_opcodes` ще не було викликано, у такому випадку ви можете спочатку " +"спробувати :meth:`quick_ratio` або :meth:`real_quick_ratio`, щоб отримати " +"верхня межа." + +msgid "" +"Caution: The result of a :meth:`ratio` call may depend on the order of the " +"arguments. For instance::" +msgstr "" +"Застереження: результат виклику :meth:`ratio` може залежати від порядку " +"аргументів. Наприклад::" + +msgid "" +">>> SequenceMatcher(None, 'tide', 'diet').ratio()\n" +"0.25\n" +">>> SequenceMatcher(None, 'diet', 'tide').ratio()\n" +"0.5" +msgstr "" + +msgid "Return an upper bound on :meth:`ratio` relatively quickly." +msgstr "Відносно швидко повертає верхню межу :meth:`ratio`." + +msgid "Return an upper bound on :meth:`ratio` very quickly." +msgstr "Дуже швидко повертає верхню межу :meth:`ratio`." + +msgid "" +"The three methods that return the ratio of matching to total characters can " +"give different results due to differing levels of approximation, although :" +"meth:`~SequenceMatcher.quick_ratio` and :meth:`~SequenceMatcher." +"real_quick_ratio` are always at least as large as :meth:`~SequenceMatcher." +"ratio`:" +msgstr "" + +msgid "SequenceMatcher Examples" +msgstr "Приклади SequenceMatcher" + +msgid "This example compares two strings, considering blanks to be \"junk\":" +msgstr "" +"У цьому прикладі порівнюються два рядки, вважаючи пробіли \"сміттєвими\":" + +msgid "" +":meth:`~SequenceMatcher.ratio` returns a float in [0, 1], measuring the " +"similarity of the sequences. As a rule of thumb, a :meth:`~SequenceMatcher." +"ratio` value over 0.6 means the sequences are close matches:" +msgstr "" + +msgid "" +"If you're only interested in where the sequences match, :meth:" +"`~SequenceMatcher.get_matching_blocks` is handy:" +msgstr "" + +msgid "" +"Note that the last tuple returned by :meth:`~SequenceMatcher." +"get_matching_blocks` is always a dummy, ``(len(a), len(b), 0)``, and this is " +"the only case in which the last tuple element (number of elements matched) " +"is ``0``." +msgstr "" + +msgid "" +"If you want to know how to change the first sequence into the second, use :" +"meth:`~SequenceMatcher.get_opcodes`:" +msgstr "" + +msgid "" +"The :func:`get_close_matches` function in this module which shows how simple " +"code building on :class:`SequenceMatcher` can be used to do useful work." +msgstr "" +"Функція :func:`get_close_matches` у цьому модулі, яка показує, як простий " +"код, створений на :class:`SequenceMatcher`, можна використовувати для " +"виконання корисної роботи." + +msgid "" +"`Simple version control recipe `_ for a small application built with :class:" +"`SequenceMatcher`." +msgstr "" + +msgid "Differ Objects" +msgstr "Різні об'єкти" + +msgid "" +"Note that :class:`Differ`\\ -generated deltas make no claim to be " +"**minimal** diffs. To the contrary, minimal diffs are often counter-" +"intuitive, because they synch up anywhere possible, sometimes accidental " +"matches 100 pages apart. Restricting synch points to contiguous matches " +"preserves some notion of locality, at the occasional cost of producing a " +"longer diff." +msgstr "" +"Зауважте, що :class:`Differ`\\ -генеровані дельти не претендують на " +"**мінімальні** відмінності. Навпаки, мінімальні відмінності часто суперечать " +"інтуїції, оскільки вони синхронізуються будь-де, де можливо, іноді випадково " +"збігаються на 100 сторінках одна від одної. Обмеження точок синхронізації " +"суміжними збігами зберігає деяке уявлення про локальність за рахунок " +"випадкових витрат на створення довшої різниці." + +msgid "The :class:`Differ` class has this constructor:" +msgstr "Клас :class:`Differ` має такий конструктор:" + +msgid "" +"Optional keyword parameters *linejunk* and *charjunk* are for filter " +"functions (or ``None``):" +msgstr "" +"Додаткові параметри ключових слів *linejunk* і *charjunk* призначені для " +"функцій фільтра (або ``None``):" + +msgid "" +"*linejunk*: A function that accepts a single string argument, and returns " +"true if the string is junk. The default is ``None``, meaning that no line " +"is considered junk." +msgstr "" +"*linejunk*: функція, яка приймає один рядковий аргумент і повертає істину, " +"якщо рядок є небажаним. Типовим значенням є ``None``, що означає, що жоден " +"рядок не вважається небажаним." + +msgid "" +"*charjunk*: A function that accepts a single character argument (a string of " +"length 1), and returns true if the character is junk. The default is " +"``None``, meaning that no character is considered junk." +msgstr "" +"*charjunk*: функція, яка приймає односимвольний аргумент (рядок довжиною 1) " +"і повертає істину, якщо символ непотрібний. Типовим значенням є ``None``, що " +"означає, що жоден символ не вважається небажаним." + +msgid "" +"These junk-filtering functions speed up matching to find differences and do " +"not cause any differing lines or characters to be ignored. Read the " +"description of the :meth:`~SequenceMatcher.find_longest_match` method's " +"*isjunk* parameter for an explanation." +msgstr "" +"Ці функції фільтрації сміття пришвидшують зіставлення для пошуку " +"відмінностей і не призводять до ігнорування будь-яких відмінних рядків чи " +"символів. Щоб отримати пояснення, прочитайте опис параметра *isjunk* методу :" +"meth:`~SequenceMatcher.find_longest_match`." + +msgid "" +":class:`Differ` objects are used (deltas generated) via a single method:" +msgstr "" +"Об’єкти :class:`Differ` використовуються (генеруються дельти) за допомогою " +"одного методу:" + +msgid "" +"Compare two sequences of lines, and generate the delta (a sequence of lines)." +msgstr "" +"Порівняйте дві послідовності рядків і згенеруйте дельту (послідовність " +"рядків)." + +msgid "" +"Each sequence must contain individual single-line strings ending with " +"newlines. Such sequences can be obtained from the :meth:`~io.IOBase." +"readlines` method of file-like objects. The delta generated also consists " +"of newline-terminated strings, ready to be printed as-is via the :meth:`~io." +"IOBase.writelines` method of a file-like object." +msgstr "" +"Кожна послідовність повинна містити окремі однорядкові рядки, що " +"закінчуються символом нового рядка. Такі послідовності можна отримати з " +"методу файлоподібних об’єктів :meth:`~io.IOBase.readlines`. Згенерована " +"дельта також складається з рядків із закінченням нового рядка, готових до " +"друку як є за допомогою методу :meth:`~io.IOBase.writelines` файлоподібного " +"об’єкта." + +msgid "Differ Example" +msgstr "Різний приклад" + +msgid "" +"This example compares two texts. First we set up the texts, sequences of " +"individual single-line strings ending with newlines (such sequences can also " +"be obtained from the :meth:`~io.IOBase.readlines` method of file-like " +"objects):" +msgstr "" + +msgid "Next we instantiate a Differ object:" +msgstr "Далі ми створюємо екземпляр об’єкта Differ:" + +msgid "" +"Note that when instantiating a :class:`Differ` object we may pass functions " +"to filter out line and character \"junk.\" See the :meth:`Differ` " +"constructor for details." +msgstr "" +"Зауважте, що під час створення екземпляра об’єкта :class:`Differ` ми можемо " +"передати функції для фільтрації \"сміття\" рядків і символів. Подробиці див. " +"у конструкторі :meth:`Differ`." + +msgid "Finally, we compare the two:" +msgstr "Нарешті, ми порівнюємо два:" + +msgid "``result`` is a list of strings, so let's pretty-print it:" +msgstr "``результат`` - це список рядків, тож давайте красиво надрукуємо його:" + +msgid "As a single multi-line string it looks like this:" +msgstr "Як один багаторядковий рядок це виглядає так:" + +msgid "A command-line interface to difflib" +msgstr "Інтерфейс командного рядка для difflib" + +msgid "" +"This example shows how to use difflib to create a ``diff``-like utility." +msgstr "" + +msgid "" +"\"\"\" Command line interface to difflib.py providing diffs in four " +"formats:\n" +"\n" +"* ndiff: lists every line and highlights interline changes.\n" +"* context: highlights clusters of changes in a before/after format.\n" +"* unified: highlights clusters of changes in an inline format.\n" +"* html: generates side by side comparison with change highlights.\n" +"\n" +"\"\"\"\n" +"\n" +"import sys, os, difflib, argparse\n" +"from datetime import datetime, timezone\n" +"\n" +"def file_mtime(path):\n" +" t = datetime.fromtimestamp(os.stat(path).st_mtime,\n" +" timezone.utc)\n" +" return t.astimezone().isoformat()\n" +"\n" +"def main():\n" +"\n" +" parser = argparse.ArgumentParser()\n" +" parser.add_argument('-c', action='store_true', default=False,\n" +" help='Produce a context format diff (default)')\n" +" parser.add_argument('-u', action='store_true', default=False,\n" +" help='Produce a unified format diff')\n" +" parser.add_argument('-m', action='store_true', default=False,\n" +" help='Produce HTML side by side diff '\n" +" '(can use -c and -l in conjunction)')\n" +" parser.add_argument('-n', action='store_true', default=False,\n" +" help='Produce a ndiff format diff')\n" +" parser.add_argument('-l', '--lines', type=int, default=3,\n" +" help='Set number of context lines (default 3)')\n" +" parser.add_argument('fromfile')\n" +" parser.add_argument('tofile')\n" +" options = parser.parse_args()\n" +"\n" +" n = options.lines\n" +" fromfile = options.fromfile\n" +" tofile = options.tofile\n" +"\n" +" fromdate = file_mtime(fromfile)\n" +" todate = file_mtime(tofile)\n" +" with open(fromfile) as ff:\n" +" fromlines = ff.readlines()\n" +" with open(tofile) as tf:\n" +" tolines = tf.readlines()\n" +"\n" +" if options.u:\n" +" diff = difflib.unified_diff(fromlines, tolines, fromfile, tofile, " +"fromdate, todate, n=n)\n" +" elif options.n:\n" +" diff = difflib.ndiff(fromlines, tolines)\n" +" elif options.m:\n" +" diff = difflib.HtmlDiff().make_file(fromlines,tolines,fromfile," +"tofile,context=options.c,numlines=n)\n" +" else:\n" +" diff = difflib.context_diff(fromlines, tolines, fromfile, tofile, " +"fromdate, todate, n=n)\n" +"\n" +" sys.stdout.writelines(diff)\n" +"\n" +"if __name__ == '__main__':\n" +" main()\n" +msgstr "" + +msgid "ndiff example" +msgstr "" + +msgid "This example shows how to use :func:`difflib.ndiff`." +msgstr "" + +msgid "" +"\"\"\"ndiff [-q] file1 file2\n" +" or\n" +"ndiff (-r1 | -r2) < ndiff_output > file1_or_file2\n" +"\n" +"Print a human-friendly file difference report to stdout. Both inter-\n" +"and intra-line differences are noted. In the second form, recreate file1\n" +"(-r1) or file2 (-r2) on stdout, from an ndiff report on stdin.\n" +"\n" +"In the first form, if -q (\"quiet\") is not specified, the first two lines\n" +"of output are\n" +"\n" +"-: file1\n" +"+: file2\n" +"\n" +"Each remaining line begins with a two-letter code:\n" +"\n" +" \"- \" line unique to file1\n" +" \"+ \" line unique to file2\n" +" \" \" line common to both files\n" +" \"? \" line not present in either input file\n" +"\n" +"Lines beginning with \"? \" attempt to guide the eye to intraline\n" +"differences, and were not present in either input file. These lines can be\n" +"confusing if the source files contain tab characters.\n" +"\n" +"The first file can be recovered by retaining only lines that begin with\n" +"\" \" or \"- \", and deleting those 2-character prefixes; use ndiff with -" +"r1.\n" +"\n" +"The second file can be recovered similarly, but by retaining only \" \" " +"and\n" +"\"+ \" lines; use ndiff with -r2; or, on Unix, the second file can be\n" +"recovered by piping the output through\n" +"\n" +" sed -n '/^[+ ] /s/^..//p'\n" +"\"\"\"\n" +"\n" +"__version__ = 1, 7, 0\n" +"\n" +"import difflib, sys\n" +"\n" +"def fail(msg):\n" +" out = sys.stderr.write\n" +" out(msg + \"\\n\\n\")\n" +" out(__doc__)\n" +" return 0\n" +"\n" +"# open a file & return the file object; gripe and return 0 if it\n" +"# couldn't be opened\n" +"def fopen(fname):\n" +" try:\n" +" return open(fname)\n" +" except IOError as detail:\n" +" return fail(\"couldn't open \" + fname + \": \" + str(detail))\n" +"\n" +"# open two files & spray the diff to stdout; return false iff a problem\n" +"def fcompare(f1name, f2name):\n" +" f1 = fopen(f1name)\n" +" f2 = fopen(f2name)\n" +" if not f1 or not f2:\n" +" return 0\n" +"\n" +" a = f1.readlines(); f1.close()\n" +" b = f2.readlines(); f2.close()\n" +" for line in difflib.ndiff(a, b):\n" +" print(line, end=' ')\n" +"\n" +" return 1\n" +"\n" +"# crack args (sys.argv[1:] is normal) & compare;\n" +"# return false iff a problem\n" +"\n" +"def main(args):\n" +" import getopt\n" +" try:\n" +" opts, args = getopt.getopt(args, \"qr:\")\n" +" except getopt.error as detail:\n" +" return fail(str(detail))\n" +" noisy = 1\n" +" qseen = rseen = 0\n" +" for opt, val in opts:\n" +" if opt == \"-q\":\n" +" qseen = 1\n" +" noisy = 0\n" +" elif opt == \"-r\":\n" +" rseen = 1\n" +" whichfile = val\n" +" if qseen and rseen:\n" +" return fail(\"can't specify both -q and -r\")\n" +" if rseen:\n" +" if args:\n" +" return fail(\"no args allowed with -r option\")\n" +" if whichfile in (\"1\", \"2\"):\n" +" restore(whichfile)\n" +" return 1\n" +" return fail(\"-r value must be 1 or 2\")\n" +" if len(args) != 2:\n" +" return fail(\"need 2 filename args\")\n" +" f1name, f2name = args\n" +" if noisy:\n" +" print('-:', f1name)\n" +" print('+:', f2name)\n" +" return fcompare(f1name, f2name)\n" +"\n" +"# read ndiff output from stdin, and print file1 (which=='1') or\n" +"# file2 (which=='2') to stdout\n" +"\n" +"def restore(which):\n" +" restored = difflib.restore(sys.stdin.readlines(), which)\n" +" sys.stdout.writelines(restored)\n" +"\n" +"if __name__ == '__main__':\n" +" main(sys.argv[1:])\n" +msgstr "" diff --git a/library/dis.po b/library/dis.po new file mode 100644 index 000000000..beb4d76ef --- /dev/null +++ b/library/dis.po @@ -0,0 +1,1932 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2023 +# Yuliia Shevchenko, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 01:04+0000\n" +"Last-Translator: Yuliia Shevchenko, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!dis` --- Disassembler for Python bytecode" +msgstr "" + +msgid "**Source code:** :source:`Lib/dis.py`" +msgstr "**Вихідний код:** :source:`Lib/dis.py`" + +msgid "" +"The :mod:`dis` module supports the analysis of CPython :term:`bytecode` by " +"disassembling it. The CPython bytecode which this module takes as an input " +"is defined in the file :file:`Include/opcode.h` and used by the compiler and " +"the interpreter." +msgstr "" +"Модуль :mod:`dis` підтримує аналіз :term:`bytecode` CPython шляхом його " +"розбирання. Байт-код CPython, який цей модуль приймає як вхідні дані, " +"визначається у файлі :file:`Include/opcode.h` і використовується " +"компілятором та інтерпретатором." + +msgid "" +"Bytecode is an implementation detail of the CPython interpreter. No " +"guarantees are made that bytecode will not be added, removed, or changed " +"between versions of Python. Use of this module should not be considered to " +"work across Python VMs or Python releases." +msgstr "" +"Байт-код — це деталь реалізації інтерпретатора CPython. Немає гарантій, що " +"байт-код не буде додано, видалено або змінено між версіями Python. " +"Використання цього модуля не слід вважати таким, що працює на віртуальних " +"машинах Python або випусках Python." + +msgid "" +"Use 2 bytes for each instruction. Previously the number of bytes varied by " +"instruction." +msgstr "" +"Використовуйте 2 байти для кожної інструкції. Раніше кількість байтів " +"змінювалася залежно від інструкції." + +msgid "" +"The argument of jump, exception handling and loop instructions is now the " +"instruction offset rather than the byte offset." +msgstr "" + +msgid "" +"Some instructions are accompanied by one or more inline cache entries, which " +"take the form of :opcode:`CACHE` instructions. These instructions are hidden " +"by default, but can be shown by passing ``show_caches=True`` to any :mod:" +"`dis` utility. Furthermore, the interpreter now adapts the bytecode to " +"specialize it for different runtime conditions. The adaptive bytecode can be " +"shown by passing ``adaptive=True``." +msgstr "" + +msgid "" +"The argument of a jump is the offset of the target instruction relative to " +"the instruction that appears immediately after the jump instruction's :" +"opcode:`CACHE` entries." +msgstr "" + +msgid "" +"As a consequence, the presence of the :opcode:`CACHE` instructions is " +"transparent for forward jumps but needs to be taken into account when " +"reasoning about backward jumps." +msgstr "" + +msgid "" +"The output shows logical labels rather than instruction offsets for jump " +"targets and exception handlers. The ``-O`` command line option and the " +"``show_offsets`` argument were added." +msgstr "" + +msgid "Example: Given the function :func:`!myfunc`::" +msgstr "" + +msgid "" +"def myfunc(alist):\n" +" return len(alist)" +msgstr "" + +msgid "" +"the following command can be used to display the disassembly of :func:`!" +"myfunc`:" +msgstr "" + +msgid "" +">>> dis.dis(myfunc)\n" +" 2 RESUME 0\n" +"\n" +" 3 LOAD_GLOBAL 1 (len + NULL)\n" +" LOAD_FAST 0 (alist)\n" +" CALL 1\n" +" RETURN_VALUE" +msgstr "" + +msgid "(The \"2\" is a line number)." +msgstr "(\"2\" — це номер рядка)." + +msgid "Command-line interface" +msgstr "" + +msgid "The :mod:`dis` module can be invoked as a script from the command line:" +msgstr "" + +msgid "python -m dis [-h] [-C] [-O] [infile]" +msgstr "" + +msgid "The following options are accepted:" +msgstr "Приймаються такі варіанти:" + +msgid "Display usage and exit." +msgstr "Показ використання та вихід." + +msgid "Show inline caches." +msgstr "" + +msgid "Show offsets of instructions." +msgstr "" + +msgid "" +"If :file:`infile` is specified, its disassembled code will be written to " +"stdout. Otherwise, disassembly is performed on compiled source code received " +"from stdin." +msgstr "" + +msgid "Bytecode analysis" +msgstr "Аналіз байт-коду" + +msgid "" +"The bytecode analysis API allows pieces of Python code to be wrapped in a :" +"class:`Bytecode` object that provides easy access to details of the compiled " +"code." +msgstr "" +"API аналізу байт-коду дозволяє обернути фрагменти коду Python в об’єкт :" +"class:`Bytecode`, який забезпечує легкий доступ до деталей скомпільованого " +"коду." + +msgid "" +"Analyse the bytecode corresponding to a function, generator, asynchronous " +"generator, coroutine, method, string of source code, or a code object (as " +"returned by :func:`compile`)." +msgstr "" +"Проаналізуйте байт-код, що відповідає функції, генератору, асинхронному " +"генератору, співпрограмі, методу, рядку вихідного коду або об’єкту коду (як " +"повертає :func:`compile`)." + +msgid "" +"This is a convenience wrapper around many of the functions listed below, " +"most notably :func:`get_instructions`, as iterating over a :class:`Bytecode` " +"instance yields the bytecode operations as :class:`Instruction` instances." +msgstr "" +"Це зручна обгортка для багатьох функцій, перелічених нижче, особливо :func:" +"`get_instructions`, оскільки ітерація над екземпляром :class:`Bytecode` дає " +"операції з байт-кодом як екземпляри :class:`Instruction`." + +msgid "" +"If *first_line* is not ``None``, it indicates the line number that should be " +"reported for the first source line in the disassembled code. Otherwise, the " +"source line information (if any) is taken directly from the disassembled " +"code object." +msgstr "" +"Якщо *first_line* не є ``None``, це вказує номер рядка, який має бути " +"повідомлено для першого вихідного рядка в дизассембленому коді. В іншому " +"випадку інформація про вихідний рядок (якщо така є) береться безпосередньо з " +"розібраного об’єкта коду." + +msgid "" +"If *current_offset* is not ``None``, it refers to an instruction offset in " +"the disassembled code. Setting this means :meth:`.dis` will display a " +"\"current instruction\" marker against the specified opcode." +msgstr "" +"Якщо *current_offset* не є ``None``, це стосується зсуву інструкції в " +"дизассембленому коді. Якщо встановити це значення, :meth:`.dis` " +"відображатиме маркер \"поточна інструкція\" проти вказаного коду операції." + +msgid "" +"If *show_caches* is ``True``, :meth:`.dis` will display inline cache entries " +"used by the interpreter to specialize the bytecode." +msgstr "" + +msgid "" +"If *adaptive* is ``True``, :meth:`.dis` will display specialized bytecode " +"that may be different from the original bytecode." +msgstr "" + +msgid "" +"If *show_offsets* is ``True``, :meth:`.dis` will include instruction offsets " +"in the output." +msgstr "" + +msgid "" +"Construct a :class:`Bytecode` instance from the given traceback, setting " +"*current_offset* to the instruction responsible for the exception." +msgstr "" +"Створіть екземпляр :class:`Bytecode` із заданого трасування, встановивши " +"*current_offset* для інструкції, відповідальної за виняток." + +msgid "The compiled code object." +msgstr "Об’єкт скомпільованого коду." + +msgid "The first source line of the code object (if available)" +msgstr "Перший вихідний рядок об'єкта коду (якщо доступний)" + +msgid "" +"Return a formatted view of the bytecode operations (the same as printed by :" +"func:`dis.dis`, but returned as a multi-line string)." +msgstr "" +"Повертає відформатований вигляд операцій байт-коду (те саме, що надруковано :" +"func:`dis.dis`, але повертається як багаторядковий рядок)." + +msgid "" +"Return a formatted multi-line string with detailed information about the " +"code object, like :func:`code_info`." +msgstr "" +"Повертає відформатований багаторядковий рядок із детальною інформацією про " +"об’єкт коду, наприклад :func:`code_info`." + +msgid "This can now handle coroutine and asynchronous generator objects." +msgstr "" +"Тепер це може обробляти об’єкти співпрограми та асинхронного генератора." + +msgid "Added the *show_caches* and *adaptive* parameters." +msgstr "" + +msgid "Example:" +msgstr "приклад:" + +msgid "" +">>> bytecode = dis.Bytecode(myfunc)\n" +">>> for instr in bytecode:\n" +"... print(instr.opname)\n" +"...\n" +"RESUME\n" +"LOAD_GLOBAL\n" +"LOAD_FAST\n" +"CALL\n" +"RETURN_VALUE" +msgstr "" + +msgid "Analysis functions" +msgstr "Функції аналізу" + +msgid "" +"The :mod:`dis` module also defines the following analysis functions that " +"convert the input directly to the desired output. They can be useful if only " +"a single operation is being performed, so the intermediate analysis object " +"isn't useful:" +msgstr "" +"Модуль :mod:`dis` також визначає наступні функції аналізу, які перетворюють " +"вхідні дані безпосередньо в бажані вивідні дані. Вони можуть бути корисними, " +"якщо виконується лише одна операція, тому проміжний об’єкт аналізу не " +"корисний:" + +msgid "" +"Return a formatted multi-line string with detailed code object information " +"for the supplied function, generator, asynchronous generator, coroutine, " +"method, source code string or code object." +msgstr "" +"Повертає відформатований багаторядковий рядок із детальною інформацією про " +"об’єкт коду для наданої функції, генератора, асинхронного генератора, " +"співпрограми, методу, рядка вихідного коду чи об’єкта коду." + +msgid "" +"Note that the exact contents of code info strings are highly implementation " +"dependent and they may change arbitrarily across Python VMs or Python " +"releases." +msgstr "" +"Зауважте, що точний вміст інформаційних рядків коду сильно залежить від " +"реалізації та може довільно змінюватися на різних віртуальних машинах Python " +"або випусках Python." + +msgid "" +"Print detailed code object information for the supplied function, method, " +"source code string or code object to *file* (or ``sys.stdout`` if *file* is " +"not specified)." +msgstr "" +"Вивести детальну інформацію про об’єкт коду для наданої функції, методу, " +"рядка вихідного коду або об’єкта коду у *файл* (або ``sys.stdout``, якщо " +"*файл* не вказано)." + +msgid "" +"This is a convenient shorthand for ``print(code_info(x), file=file)``, " +"intended for interactive exploration at the interpreter prompt." +msgstr "" +"Це зручне скорочення для ``print(code_info(x), file=file)``, призначене для " +"інтерактивного дослідження під час підказки інтерпретатора." + +msgid "Added *file* parameter." +msgstr "Додано параметр *file*." + +msgid "" +"Disassemble the *x* object. *x* can denote either a module, a class, a " +"method, a function, a generator, an asynchronous generator, a coroutine, a " +"code object, a string of source code or a byte sequence of raw bytecode. For " +"a module, it disassembles all functions. For a class, it disassembles all " +"methods (including class and static methods). For a code object or sequence " +"of raw bytecode, it prints one line per bytecode instruction. It also " +"recursively disassembles nested code objects. These can include generator " +"expressions, nested functions, the bodies of nested classes, and the code " +"objects used for :ref:`annotation scopes `. Strings are " +"first compiled to code objects with the :func:`compile` built-in function " +"before being disassembled. If no object is provided, this function " +"disassembles the last traceback." +msgstr "" + +msgid "" +"The disassembly is written as text to the supplied *file* argument if " +"provided and to ``sys.stdout`` otherwise." +msgstr "" +"Розбирання записується як текст до наданого аргументу *file*, якщо він " +"надається, та до ``sys.stdout`` інакше." + +msgid "" +"The maximal depth of recursion is limited by *depth* unless it is ``None``. " +"``depth=0`` means no recursion." +msgstr "" +"Максимальна глибина рекурсії обмежена параметром *depth*, якщо не " +"встановлено ``None``. ``depth=0`` означає відсутність рекурсії." + +msgid "" +"If *show_caches* is ``True``, this function will display inline cache " +"entries used by the interpreter to specialize the bytecode." +msgstr "" + +msgid "" +"If *adaptive* is ``True``, this function will display specialized bytecode " +"that may be different from the original bytecode." +msgstr "" + +msgid "Implemented recursive disassembling and added *depth* parameter." +msgstr "Реалізовано рекурсивне розбирання та додано параметр *depth*." + +msgid "" +"Disassemble the top-of-stack function of a traceback, using the last " +"traceback if none was passed. The instruction causing the exception is " +"indicated." +msgstr "" +"Розберіть функцію top-of-stack зворотного трасування, використовуючи останню " +"трасування, якщо жодного не було передано. Вказується інструкція, що " +"спричиняє виняток." + +msgid "Added the *show_offsets* parameter." +msgstr "" + +msgid "" +"Disassemble a code object, indicating the last instruction if *lasti* was " +"provided. The output is divided in the following columns:" +msgstr "" +"Розберіть об’єкт коду, вказавши останню інструкцію, якщо було надано " +"*lasti*. Результат поділено на такі стовпці:" + +msgid "the line number, for the first instruction of each line" +msgstr "номер рядка для першої інструкції кожного рядка" + +msgid "the current instruction, indicated as ``-->``," +msgstr "поточна інструкція, позначена як ``-->``," + +msgid "a labelled instruction, indicated with ``>>``," +msgstr "маркована інструкція, позначена ``>>``," + +msgid "the address of the instruction," +msgstr "адреса інструкції," + +msgid "the operation code name," +msgstr "кодова назва операції," + +msgid "operation parameters, and" +msgstr "параметри роботи, і" + +msgid "interpretation of the parameters in parentheses." +msgstr "інтерпретація параметрів у дужках." + +msgid "" +"The parameter interpretation recognizes local and global variable names, " +"constant values, branch targets, and compare operators." +msgstr "" +"Інтерпретація параметрів розпізнає імена локальних і глобальних змінних, " +"постійні значення, цілі розгалужень і оператори порівняння." + +msgid "" +"Return an iterator over the instructions in the supplied function, method, " +"source code string or code object." +msgstr "" +"Повертає ітератор над інструкціями в наданій функції, методі, рядку " +"вихідного коду або об’єкті коду." + +msgid "" +"The iterator generates a series of :class:`Instruction` named tuples giving " +"the details of each operation in the supplied code." +msgstr "" +"Ітератор генерує ряд іменованих кортежів :class:`Instruction`, що надає " +"деталі кожної операції в наданому коді." + +msgid "The *adaptive* parameter works as it does in :func:`dis`." +msgstr "" + +msgid "" +"The *show_caches* parameter is deprecated and has no effect. The iterator " +"generates the :class:`Instruction` instances with the *cache_info* field " +"populated (regardless of the value of *show_caches*) and it no longer " +"generates separate items for the cache entries." +msgstr "" + +msgid "" +"This generator function uses the :meth:`~codeobject.co_lines` method of the :" +"ref:`code object ` *code* to find the offsets which are starts " +"of lines in the source code. They are generated as ``(offset, lineno)`` " +"pairs." +msgstr "" + +msgid "Line numbers can be decreasing. Before, they were always increasing." +msgstr "Номери рядків можуть зменшуватися. Раніше вони постійно зростали." + +msgid "" +"The :pep:`626` :meth:`~codeobject.co_lines` method is used instead of the :" +"attr:`~codeobject.co_firstlineno` and :attr:`~codeobject.co_lnotab` " +"attributes of the :ref:`code object `." +msgstr "" + +msgid "" +"Line numbers can be ``None`` for bytecode that does not map to source lines." +msgstr "" + +msgid "" +"Detect all offsets in the raw compiled bytecode string *code* which are jump " +"targets, and return a list of these offsets." +msgstr "" +"Виявлення всіх зсувів у необробленому скомпільованому рядку *code* байт-" +"коду, які є цілями переходу, і повернення списку цих зсувів." + +msgid "Compute the stack effect of *opcode* with argument *oparg*." +msgstr "Обчисліть ефект стека *opcode* з аргументом *oparg*." + +msgid "" +"If the code has a jump target and *jump* is ``True``, :func:`~stack_effect` " +"will return the stack effect of jumping. If *jump* is ``False``, it will " +"return the stack effect of not jumping. And if *jump* is ``None`` (default), " +"it will return the maximal stack effect of both cases." +msgstr "" +"Якщо код має ціль переходу і *jump* має значення ``True``, :func:" +"`~stack_effect` поверне ефект стека стрибка. Якщо *jump* має значення " +"``False``, він поверне ефект стека без стрибка. І якщо *jump* має значення " +"``None`` (за замовчуванням), він поверне максимальний ефект стека в обох " +"випадках." + +msgid "Added *jump* parameter." +msgstr "Додано параметр *jump*." + +msgid "" +"If ``oparg`` is omitted (or ``None``), the stack effect is now returned for " +"``oparg=0``. Previously this was an error for opcodes that use their arg. It " +"is also no longer an error to pass an integer ``oparg`` when the ``opcode`` " +"does not use it; the ``oparg`` in this case is ignored." +msgstr "" + +msgid "Python Bytecode Instructions" +msgstr "Інструкції щодо байт-коду Python" + +msgid "" +"The :func:`get_instructions` function and :class:`Bytecode` class provide " +"details of bytecode instructions as :class:`Instruction` instances:" +msgstr "" +"Функція :func:`get_instructions` і клас :class:`Bytecode` надають деталі " +"інструкцій байт-коду як екземпляри :class:`Instruction`:" + +msgid "Details for a bytecode operation" +msgstr "Подробиці для операції байт-коду" + +msgid "" +"numeric code for operation, corresponding to the opcode values listed below " +"and the bytecode values in the :ref:`opcode_collections`." +msgstr "" +"числовий код для операції, що відповідає значенням коду операції, наведеним " +"нижче, і значенням байт-коду в :ref:`opcode_collections`." + +msgid "human readable name for operation" +msgstr "зрозуміла для людини назва операції" + +msgid "" +"numeric code for the base operation if operation is specialized; otherwise " +"equal to :data:`opcode`" +msgstr "" + +msgid "" +"human readable name for the base operation if operation is specialized; " +"otherwise equal to :data:`opname`" +msgstr "" + +msgid "numeric argument to operation (if any), otherwise ``None``" +msgstr "числовий аргумент операції (якщо є), інакше ``None``" + +msgid "alias for :data:`arg`" +msgstr "" + +msgid "resolved arg value (if any), otherwise ``None``" +msgstr "" + +msgid "" +"human readable description of operation argument (if any), otherwise an " +"empty string." +msgstr "" + +msgid "start index of operation within bytecode sequence" +msgstr "початковий індекс операції в послідовності байт-коду" + +msgid "" +"start index of operation within bytecode sequence, including prefixed " +"``EXTENDED_ARG`` operations if present; otherwise equal to :data:`offset`" +msgstr "" + +msgid "start index of the cache entries following the operation" +msgstr "" + +msgid "end index of the cache entries following the operation" +msgstr "" + +msgid "``True`` if this opcode starts a source line, otherwise ``False``" +msgstr "" + +msgid "" +"source line number associated with this opcode (if any), otherwise ``None``" +msgstr "" + +msgid "``True`` if other code jumps to here, otherwise ``False``" +msgstr "``True``, якщо інший код переходить сюди, інакше ``False``" + +msgid "" +"bytecode index of the jump target if this is a jump operation, otherwise " +"``None``" +msgstr "" + +msgid "" +":class:`dis.Positions` object holding the start and end locations that are " +"covered by this instruction." +msgstr "" + +msgid "" +"Information about the cache entries of this instruction, as triplets of the " +"form ``(name, size, data)``, where the ``name`` and ``size`` describe the " +"cache format and data is the contents of the cache. ``cache_info`` is " +"``None`` if the instruction does not have caches." +msgstr "" + +msgid "Field ``positions`` is added." +msgstr "" + +msgid "Changed field ``starts_line``." +msgstr "" + +msgid "" +"Added fields ``start_offset``, ``cache_offset``, ``end_offset``, " +"``baseopname``, ``baseopcode``, ``jump_target``, ``oparg``, ``line_number`` " +"and ``cache_info``." +msgstr "" + +msgid "" +"In case the information is not available, some fields might be ``None``." +msgstr "" + +msgid "" +"The Python compiler currently generates the following bytecode instructions." +msgstr "Наразі компілятор Python генерує наступні інструкції байт-коду." + +msgid "**General instructions**" +msgstr "**Загальні інструкції**" + +msgid "" +"In the following, We will refer to the interpreter stack as ``STACK`` and " +"describe operations on it as if it was a Python list. The top of the stack " +"corresponds to ``STACK[-1]`` in this language." +msgstr "" + +msgid "" +"Do nothing code. Used as a placeholder by the bytecode optimizer, and to " +"generate line tracing events." +msgstr "" + +msgid "Removes the top-of-stack item::" +msgstr "" + +msgid "STACK.pop()" +msgstr "" + +msgid "" +"Removes the top-of-stack item. Equivalent to ``POP_TOP``. Used to clean up " +"at the end of loops, hence the name." +msgstr "" + +msgid "Implements ``del STACK[-2]``. Used to clean up when a generator exits." +msgstr "" + +msgid "" +"Push the i-th item to the top of the stack without removing it from its " +"original location::" +msgstr "" + +msgid "" +"assert i > 0\n" +"STACK.append(STACK[-i])" +msgstr "" + +msgid "Swap the top of the stack with the i-th element::" +msgstr "" + +msgid "STACK[-i], STACK[-1] = STACK[-1], STACK[-i]" +msgstr "" + +msgid "" +"Rather than being an actual instruction, this opcode is used to mark extra " +"space for the interpreter to cache useful data directly in the bytecode " +"itself. It is automatically hidden by all ``dis`` utilities, but can be " +"viewed with ``show_caches=True``." +msgstr "" + +msgid "" +"Logically, this space is part of the preceding instruction. Many opcodes " +"expect to be followed by an exact number of caches, and will instruct the " +"interpreter to skip over them at runtime." +msgstr "" + +msgid "" +"Populated caches can look like arbitrary instructions, so great care should " +"be taken when reading or modifying raw, adaptive bytecode containing " +"quickened data." +msgstr "" + +msgid "**Unary operations**" +msgstr "**Унарні операції**" + +msgid "" +"Unary operations take the top of the stack, apply the operation, and push " +"the result back on the stack." +msgstr "" +"Унарні операції займають вершину стека, застосовують операцію та повертають " +"результат назад у стек." + +msgid "Implements ``STACK[-1] = -STACK[-1]``." +msgstr "" + +msgid "Implements ``STACK[-1] = not STACK[-1]``." +msgstr "" + +msgid "This instruction now requires an exact :class:`bool` operand." +msgstr "" + +msgid "Implements ``STACK[-1] = ~STACK[-1]``." +msgstr "" + +msgid "Implements ``STACK[-1] = iter(STACK[-1])``." +msgstr "" + +msgid "" +"If ``STACK[-1]`` is a :term:`generator iterator` or :term:`coroutine` object " +"it is left as is. Otherwise, implements ``STACK[-1] = iter(STACK[-1])``." +msgstr "" + +msgid "Implements ``STACK[-1] = bool(STACK[-1])``." +msgstr "" + +msgid "**Binary and in-place operations**" +msgstr "" + +msgid "" +"Binary operations remove the top two items from the stack (``STACK[-1]`` and " +"``STACK[-2]``). They perform the operation, then put the result back on the " +"stack." +msgstr "" + +msgid "" +"In-place operations are like binary operations, but the operation is done in-" +"place when ``STACK[-2]`` supports it, and the resulting ``STACK[-1]`` may be " +"(but does not have to be) the original ``STACK[-2]``." +msgstr "" + +msgid "" +"Implements the binary and in-place operators (depending on the value of " +"*op*)::" +msgstr "" + +msgid "" +"rhs = STACK.pop()\n" +"lhs = STACK.pop()\n" +"STACK.append(lhs op rhs)" +msgstr "" + +msgid "Implements::" +msgstr "" + +msgid "" +"key = STACK.pop()\n" +"container = STACK.pop()\n" +"STACK.append(container[key])" +msgstr "" + +msgid "" +"key = STACK.pop()\n" +"container = STACK.pop()\n" +"value = STACK.pop()\n" +"container[key] = value" +msgstr "" + +msgid "" +"key = STACK.pop()\n" +"container = STACK.pop()\n" +"del container[key]" +msgstr "" + +msgid "" +"end = STACK.pop()\n" +"start = STACK.pop()\n" +"container = STACK.pop()\n" +"STACK.append(container[start:end])" +msgstr "" + +msgid "" +"end = STACK.pop()\n" +"start = STACK.pop()\n" +"container = STACK.pop()\n" +"values = STACK.pop()\n" +"container[start:end] = value" +msgstr "" + +msgid "**Coroutine opcodes**" +msgstr "**Коди операцій співпрограми**" + +msgid "" +"Implements ``STACK[-1] = get_awaitable(STACK[-1])``, where " +"``get_awaitable(o)`` returns ``o`` if ``o`` is a coroutine object or a " +"generator object with the :data:`~inspect.CO_ITERABLE_COROUTINE` flag, or " +"resolves ``o.__await__``." +msgstr "" + +msgid "" +"If the ``where`` operand is nonzero, it indicates where the instruction " +"occurs:" +msgstr "" + +msgid "``1``: After a call to ``__aenter__``" +msgstr "" + +msgid "``2``: After a call to ``__aexit__``" +msgstr "" + +msgid "Previously, this instruction did not have an oparg." +msgstr "" + +msgid "Implements ``STACK[-1] = STACK[-1].__aiter__()``." +msgstr "" + +msgid "Returning awaitable objects from ``__aiter__`` is no longer supported." +msgstr "" +"Повернення очікуваних об’єктів із ``__aiter__`` більше не підтримується." + +msgid "" +"Implement ``STACK.append(get_awaitable(STACK[-1].__anext__()))`` to the " +"stack. See ``GET_AWAITABLE`` for details about ``get_awaitable``." +msgstr "" + +msgid "" +"Terminates an :keyword:`async for` loop. Handles an exception raised when " +"awaiting a next item. The stack contains the async iterable in ``STACK[-2]`` " +"and the raised exception in ``STACK[-1]``. Both are popped. If the exception " +"is not :exc:`StopAsyncIteration`, it is re-raised." +msgstr "" + +msgid "" +"Exception representation on the stack now consist of one, not three, items." +msgstr "" + +msgid "" +"Handles an exception raised during a :meth:`~generator.throw` or :meth:" +"`~generator.close` call through the current frame. If ``STACK[-1]`` is an " +"instance of :exc:`StopIteration`, pop three values from the stack and push " +"its ``value`` member. Otherwise, re-raise ``STACK[-1]``." +msgstr "" + +msgid "" +"Resolves ``__aenter__`` and ``__aexit__`` from ``STACK[-1]``. Pushes " +"``__aexit__`` and result of ``__aenter__()`` to the stack::" +msgstr "" + +msgid "STACK.extend((__aexit__, __aenter__())" +msgstr "" + +msgid "**Miscellaneous opcodes**" +msgstr "**Різні коди операцій**" + +msgid "" +"item = STACK.pop()\n" +"set.add(STACK[-i], item)" +msgstr "" + +msgid "Used to implement set comprehensions." +msgstr "" + +msgid "" +"item = STACK.pop()\n" +"list.append(STACK[-i], item)" +msgstr "" + +msgid "Used to implement list comprehensions." +msgstr "" + +msgid "" +"value = STACK.pop()\n" +"key = STACK.pop()\n" +"dict.__setitem__(STACK[-i], key, value)" +msgstr "" + +msgid "Used to implement dict comprehensions." +msgstr "" + +msgid "" +"Map value is ``STACK[-1]`` and map key is ``STACK[-2]``. Before, those were " +"reversed." +msgstr "" + +msgid "" +"For all of the :opcode:`SET_ADD`, :opcode:`LIST_APPEND` and :opcode:" +"`MAP_ADD` instructions, while the added value or key/value pair is popped " +"off, the container object remains on the stack so that it is available for " +"further iterations of the loop." +msgstr "" +"Для всіх інструкцій :opcode:`SET_ADD`, :opcode:`LIST_APPEND` і :opcode:" +"`MAP_ADD`, поки додане значення або пара ключ/значення видаляється, об’єкт-" +"контейнер залишається в стеку, тому він доступний для подальших ітерацій " +"циклу." + +msgid "Returns with ``STACK[-1]`` to the caller of the function." +msgstr "" + +msgid "Returns with ``co_consts[consti]`` to the caller of the function." +msgstr "" + +msgid "Yields ``STACK.pop()`` from a :term:`generator`." +msgstr "" + +msgid "oparg set to be the stack depth." +msgstr "" + +msgid "" +"oparg set to be the exception block depth, for efficient closing of " +"generators." +msgstr "" + +msgid "" +"oparg is ``1`` if this instruction is part of a yield-from or await, and " +"``0`` otherwise." +msgstr "" + +msgid "" +"Checks whether ``__annotations__`` is defined in ``locals()``, if not it is " +"set up to an empty ``dict``. This opcode is only emitted if a class or " +"module body contains :term:`variable annotations ` " +"statically." +msgstr "" +"Перевіряє, чи визначено ``__annotations__`` в ``locals()``, якщо ні, воно " +"встановлюється на порожній ``dict``. Цей код операції видається, лише якщо " +"тіло класу або модуля містить :term:`анотації змінних ` " +"статично." + +msgid "" +"Pops a value from the stack, which is used to restore the exception state." +msgstr "" + +msgid "" +"Re-raises the exception currently on top of the stack. If oparg is non-zero, " +"pops an additional value from the stack which is used to set :attr:`~frame." +"f_lasti` of the current frame." +msgstr "" + +msgid "" +"Pops a value from the stack. Pushes the current exception to the top of the " +"stack. Pushes the value originally popped back to the stack. Used in " +"exception handlers." +msgstr "" + +msgid "" +"Performs exception matching for ``except``. Tests whether the ``STACK[-2]`` " +"is an exception matching ``STACK[-1]``. Pops ``STACK[-1]`` and pushes the " +"boolean result of the test." +msgstr "" + +msgid "" +"Performs exception matching for ``except*``. Applies ``split(STACK[-1])`` on " +"the exception group representing ``STACK[-2]``." +msgstr "" + +msgid "" +"In case of a match, pops two items from the stack and pushes the non-" +"matching subgroup (``None`` in case of full match) followed by the matching " +"subgroup. When there is no match, pops one item (the match type) and pushes " +"``None``." +msgstr "" + +msgid "" +"Calls the function in position 4 on the stack with arguments (type, val, tb) " +"representing the exception at the top of the stack. Used to implement the " +"call ``context_manager.__exit__(*exc_info())`` when an exception has " +"occurred in a :keyword:`with` statement." +msgstr "" + +msgid "" +"The ``__exit__`` function is in position 4 of the stack rather than 7. " +"Exception representation on the stack now consist of one, not three, items." +msgstr "" + +msgid "" +"Pushes :exc:`AssertionError` onto the stack. Used by the :keyword:`assert` " +"statement." +msgstr "" +"Поміщає :exc:`AssertionError` у стек. Використовується оператором :keyword:" +"`assert`." + +msgid "" +"Pushes :func:`!builtins.__build_class__` onto the stack. It is later called " +"to construct a class." +msgstr "" + +msgid "" +"This opcode performs several operations before a with block starts. First, " +"it loads :meth:`~object.__exit__` from the context manager and pushes it " +"onto the stack for later use by :opcode:`WITH_EXCEPT_START`. Then, :meth:" +"`~object.__enter__` is called. Finally, the result of calling the " +"``__enter__()`` method is pushed onto the stack." +msgstr "" + +msgid "" +"Perform ``STACK.append(len(STACK[-1]))``. Used in :keyword:`match` " +"statements where comparison with structure of pattern is needed." +msgstr "" + +msgid "" +"If ``STACK[-1]`` is an instance of :class:`collections.abc.Mapping` (or, " +"more technically: if it has the :c:macro:`Py_TPFLAGS_MAPPING` flag set in " +"its :c:member:`~PyTypeObject.tp_flags`), push ``True`` onto the stack. " +"Otherwise, push ``False``." +msgstr "" + +msgid "" +"If ``STACK[-1]`` is an instance of :class:`collections.abc.Sequence` and is " +"*not* an instance of :class:`str`/:class:`bytes`/:class:`bytearray` (or, " +"more technically: if it has the :c:macro:`Py_TPFLAGS_SEQUENCE` flag set in " +"its :c:member:`~PyTypeObject.tp_flags`), push ``True`` onto the stack. " +"Otherwise, push ``False``." +msgstr "" + +msgid "" +"``STACK[-1]`` is a tuple of mapping keys, and ``STACK[-2]`` is the match " +"subject. If ``STACK[-2]`` contains all of the keys in ``STACK[-1]``, push a :" +"class:`tuple` containing the corresponding values. Otherwise, push ``None``." +msgstr "" + +msgid "" +"Previously, this instruction also pushed a boolean value indicating success " +"(``True``) or failure (``False``)." +msgstr "" + +msgid "" +"Implements ``name = STACK.pop()``. *namei* is the index of *name* in the " +"attribute :attr:`~codeobject.co_names` of the :ref:`code object `. The compiler tries to use :opcode:`STORE_FAST` or :opcode:" +"`STORE_GLOBAL` if possible." +msgstr "" + +msgid "" +"Implements ``del name``, where *namei* is the index into :attr:`~codeobject." +"co_names` attribute of the :ref:`code object `." +msgstr "" + +msgid "" +"Unpacks ``STACK[-1]`` into *count* individual values, which are put onto the " +"stack right-to-left. Require there to be exactly *count* values.::" +msgstr "" + +msgid "" +"assert(len(STACK[-1]) == count)\n" +"STACK.extend(STACK.pop()[:-count-1:-1])" +msgstr "" + +msgid "" +"Implements assignment with a starred target: Unpacks an iterable in " +"``STACK[-1]`` into individual values, where the total number of values can " +"be smaller than the number of items in the iterable: one of the new values " +"will be a list of all leftover items." +msgstr "" + +msgid "The number of values before and after the list value is limited to 255." +msgstr "" + +msgid "" +"The number of values before the list value is encoded in the argument of the " +"opcode. The number of values after the list if any is encoded using an " +"``EXTENDED_ARG``. As a consequence, the argument can be seen as a two bytes " +"values where the low byte of *counts* is the number of values before the " +"list value, the high byte of *counts* the number of values after it." +msgstr "" + +msgid "" +"The extracted values are put onto the stack right-to-left, i.e. ``a, *b, c = " +"d`` will be stored after execution as ``STACK.extend((a, b, c))``." +msgstr "" + +msgid "" +"obj = STACK.pop()\n" +"value = STACK.pop()\n" +"obj.name = value" +msgstr "" + +msgid "" +"where *namei* is the index of name in :attr:`~codeobject.co_names` of the :" +"ref:`code object `." +msgstr "" + +msgid "" +"obj = STACK.pop()\n" +"del obj.name" +msgstr "" + +msgid "" +"where *namei* is the index of name into :attr:`~codeobject.co_names` of the :" +"ref:`code object `." +msgstr "" + +msgid "Works as :opcode:`STORE_NAME`, but stores the name as a global." +msgstr "Працює як :opcode:`STORE_NAME`, але зберігає назву як глобальну." + +msgid "Works as :opcode:`DELETE_NAME`, but deletes a global name." +msgstr "Працює як :opcode:`DELETE_NAME`, але видаляє глобальне ім’я." + +msgid "Pushes ``co_consts[consti]`` onto the stack." +msgstr "Поміщає ``co_consts[consti]`` в стек." + +msgid "" +"Pushes the value associated with ``co_names[namei]`` onto the stack. The " +"name is looked up within the locals, then the globals, then the builtins." +msgstr "" + +msgid "" +"Pushes a reference to the locals dictionary onto the stack. This is used to " +"prepare namespace dictionaries for :opcode:`LOAD_FROM_DICT_OR_DEREF` and :" +"opcode:`LOAD_FROM_DICT_OR_GLOBALS`." +msgstr "" + +msgid "" +"Pops a mapping off the stack and looks up the value for ``co_names[namei]``. " +"If the name is not found there, looks it up in the globals and then the " +"builtins, similar to :opcode:`LOAD_GLOBAL`. This is used for loading global " +"variables in :ref:`annotation scopes ` within class " +"bodies." +msgstr "" + +msgid "" +"Creates a tuple consuming *count* items from the stack, and pushes the " +"resulting tuple onto the stack::" +msgstr "" + +msgid "" +"if count == 0:\n" +" value = ()\n" +"else:\n" +" value = tuple(STACK[-count:])\n" +" STACK = STACK[:-count]\n" +"\n" +"STACK.append(value)" +msgstr "" + +msgid "Works as :opcode:`BUILD_TUPLE`, but creates a list." +msgstr "Працює як :opcode:`BUILD_TUPLE`, але створює список." + +msgid "Works as :opcode:`BUILD_TUPLE`, but creates a set." +msgstr "Працює як :opcode:`BUILD_TUPLE`, але створює набір." + +msgid "" +"Pushes a new dictionary object onto the stack. Pops ``2 * count`` items so " +"that the dictionary holds *count* entries: ``{..., STACK[-4]: STACK[-3], " +"STACK[-2]: STACK[-1]}``." +msgstr "" + +msgid "" +"The dictionary is created from stack items instead of creating an empty " +"dictionary pre-sized to hold *count* items." +msgstr "" +"Словник створюється з елементів стека замість створення порожнього словника " +"попереднього розміру для *кількості* елементів." + +msgid "" +"The version of :opcode:`BUILD_MAP` specialized for constant keys. Pops the " +"top element on the stack which contains a tuple of keys, then starting from " +"``STACK[-2]``, pops *count* values to form values in the built dictionary." +msgstr "" + +msgid "" +"Concatenates *count* strings from the stack and pushes the resulting string " +"onto the stack." +msgstr "З’єднує *count* рядки зі стеку та надихає отриманий рядок у стек." + +msgid "" +"seq = STACK.pop()\n" +"list.extend(STACK[-i], seq)" +msgstr "" + +msgid "Used to build lists." +msgstr "" + +msgid "" +"seq = STACK.pop()\n" +"set.update(STACK[-i], seq)" +msgstr "" + +msgid "Used to build sets." +msgstr "" + +msgid "" +"map = STACK.pop()\n" +"dict.update(STACK[-i], map)" +msgstr "" + +msgid "Used to build dicts." +msgstr "" + +msgid "Like :opcode:`DICT_UPDATE` but raises an exception for duplicate keys." +msgstr "" +"Подібно до :opcode:`DICT_UPDATE`, але створює виняток для дублікатів ключів." + +msgid "" +"If the low bit of ``namei`` is not set, this replaces ``STACK[-1]`` with " +"``getattr(STACK[-1], co_names[namei>>1])``." +msgstr "" + +msgid "" +"If the low bit of ``namei`` is set, this will attempt to load a method named " +"``co_names[namei>>1]`` from the ``STACK[-1]`` object. ``STACK[-1]`` is " +"popped. This bytecode distinguishes two cases: if ``STACK[-1]`` has a method " +"with the correct name, the bytecode pushes the unbound method and " +"``STACK[-1]``. ``STACK[-1]`` will be used as the first argument (``self``) " +"by :opcode:`CALL` or :opcode:`CALL_KW` when calling the unbound method. " +"Otherwise, ``NULL`` and the object returned by the attribute lookup are " +"pushed." +msgstr "" + +msgid "" +"If the low bit of ``namei`` is set, then a ``NULL`` or ``self`` is pushed to " +"the stack before the attribute or unbound method respectively." +msgstr "" + +msgid "" +"This opcode implements :func:`super`, both in its zero-argument and two-" +"argument forms (e.g. ``super().method()``, ``super().attr`` and ``super(cls, " +"self).method()``, ``super(cls, self).attr``)." +msgstr "" + +msgid "It pops three values from the stack (from top of stack down):" +msgstr "" + +msgid "``self``: the first argument to the current method" +msgstr "" + +msgid "``cls``: the class within which the current method was defined" +msgstr "" + +msgid "the global ``super``" +msgstr "" + +msgid "" +"With respect to its argument, it works similarly to :opcode:`LOAD_ATTR`, " +"except that ``namei`` is shifted left by 2 bits instead of 1." +msgstr "" + +msgid "" +"The low bit of ``namei`` signals to attempt a method load, as with :opcode:" +"`LOAD_ATTR`, which results in pushing ``NULL`` and the loaded method. When " +"it is unset a single value is pushed to the stack." +msgstr "" + +msgid "" +"The second-low bit of ``namei``, if set, means that this was a two-argument " +"call to :func:`super` (unset means zero-argument)." +msgstr "" + +msgid "" +"Performs a Boolean operation. The operation name can be found in " +"``cmp_op[opname >> 5]``. If the fifth-lowest bit of ``opname`` is set " +"(``opname & 16``), the result should be coerced to ``bool``." +msgstr "" + +msgid "" +"The fifth-lowest bit of the oparg now indicates a forced conversion to :" +"class:`bool`." +msgstr "" + +msgid "Performs ``is`` comparison, or ``is not`` if ``invert`` is 1." +msgstr "Виконує порівняння ``is`` або ``is not``, якщо ``invert`` дорівнює 1." + +msgid "Performs ``in`` comparison, or ``not in`` if ``invert`` is 1." +msgstr "Виконує порівняння ``in`` або ``not in``, якщо ``invert`` дорівнює 1." + +msgid "" +"Imports the module ``co_names[namei]``. ``STACK[-1]`` and ``STACK[-2]`` are " +"popped and provide the *fromlist* and *level* arguments of :func:" +"`__import__`. The module object is pushed onto the stack. The current " +"namespace is not affected: for a proper import statement, a subsequent :" +"opcode:`STORE_FAST` instruction modifies the namespace." +msgstr "" + +msgid "" +"Loads the attribute ``co_names[namei]`` from the module found in " +"``STACK[-1]``. The resulting object is pushed onto the stack, to be " +"subsequently stored by a :opcode:`STORE_FAST` instruction." +msgstr "" + +msgid "Increments bytecode counter by *delta*." +msgstr "Збільшує лічильник байт-коду на *delta*." + +msgid "Decrements bytecode counter by *delta*. Checks for interrupts." +msgstr "" + +msgid "Decrements bytecode counter by *delta*. Does not check for interrupts." +msgstr "" + +msgid "" +"If ``STACK[-1]`` is true, increments the bytecode counter by *delta*. " +"``STACK[-1]`` is popped." +msgstr "" + +msgid "" +"The oparg is now a relative delta rather than an absolute target. This " +"opcode is a pseudo-instruction, replaced in final bytecode by the directed " +"versions (forward/backward)." +msgstr "" + +msgid "This is no longer a pseudo-instruction." +msgstr "" + +msgid "" +"If ``STACK[-1]`` is false, increments the bytecode counter by *delta*. " +"``STACK[-1]`` is popped." +msgstr "" + +msgid "" +"If ``STACK[-1]`` is not ``None``, increments the bytecode counter by " +"*delta*. ``STACK[-1]`` is popped." +msgstr "" + +msgid "" +"If ``STACK[-1]`` is ``None``, increments the bytecode counter by *delta*. " +"``STACK[-1]`` is popped." +msgstr "" + +msgid "" +"``STACK[-1]`` is an :term:`iterator`. Call its :meth:`~iterator.__next__` " +"method. If this yields a new value, push it on the stack (leaving the " +"iterator below it). If the iterator indicates it is exhausted then the byte " +"code counter is incremented by *delta*." +msgstr "" + +msgid "Up until 3.11 the iterator was popped when it was exhausted." +msgstr "" + +msgid "Loads the global named ``co_names[namei>>1]`` onto the stack." +msgstr "" + +msgid "" +"If the low bit of ``namei`` is set, then a ``NULL`` is pushed to the stack " +"before the global variable." +msgstr "" + +msgid "" +"Pushes a reference to the local ``co_varnames[var_num]`` onto the stack." +msgstr "Надсилає посилання на локальні ``co_var_names[var_num]`` у стек." + +msgid "" +"This opcode is now only used in situations where the local variable is " +"guaranteed to be initialized. It cannot raise :exc:`UnboundLocalError`." +msgstr "" + +msgid "" +"Pushes references to ``co_varnames[var_nums >> 4]`` and " +"``co_varnames[var_nums & 15]`` onto the stack." +msgstr "" + +msgid "" +"Pushes a reference to the local ``co_varnames[var_num]`` onto the stack, " +"raising an :exc:`UnboundLocalError` if the local variable has not been " +"initialized." +msgstr "" + +msgid "" +"Pushes a reference to the local ``co_varnames[var_num]`` onto the stack (or " +"pushes ``NULL`` onto the stack if the local variable has not been " +"initialized) and sets ``co_varnames[var_num]`` to ``NULL``." +msgstr "" + +msgid "Stores ``STACK.pop()`` into the local ``co_varnames[var_num]``." +msgstr "" + +msgid "" +"Stores ``STACK[-1]`` into ``co_varnames[var_nums >> 4]`` and ``STACK[-2]`` " +"into ``co_varnames[var_nums & 15]``." +msgstr "" + +msgid "" +"Stores ``STACK.pop()`` into the local ``co_varnames[var_nums >> 4]`` and " +"pushes a reference to the local ``co_varnames[var_nums & 15]`` onto the " +"stack." +msgstr "" + +msgid "Deletes local ``co_varnames[var_num]``." +msgstr "Видаляє локальні ``co_var_names[var_num]``." + +msgid "" +"Creates a new cell in slot ``i``. If that slot is nonempty then that value " +"is stored into the new cell." +msgstr "" + +msgid "" +"Loads the cell contained in slot ``i`` of the \"fast locals\" storage. " +"Pushes a reference to the object the cell contains on the stack." +msgstr "" + +msgid "" +"``i`` is no longer offset by the length of :attr:`~codeobject.co_varnames`." +msgstr "" + +msgid "" +"Pops a mapping off the stack and looks up the name associated with slot " +"``i`` of the \"fast locals\" storage in this mapping. If the name is not " +"found there, loads it from the cell contained in slot ``i``, similar to :" +"opcode:`LOAD_DEREF`. This is used for loading :term:`closure variables " +"` in class bodies (which previously used :opcode:`!" +"LOAD_CLASSDEREF`) and in :ref:`annotation scopes ` within " +"class bodies." +msgstr "" + +msgid "" +"Stores ``STACK.pop()`` into the cell contained in slot ``i`` of the \"fast " +"locals\" storage." +msgstr "" + +msgid "" +"Empties the cell contained in slot ``i`` of the \"fast locals\" storage. " +"Used by the :keyword:`del` statement." +msgstr "" + +msgid "" +"Copies the ``n`` :term:`free (closure) variables ` from " +"the closure into the frame. Removes the need for special code on the " +"caller's side when calling closures." +msgstr "" + +msgid "" +"Raises an exception using one of the 3 forms of the ``raise`` statement, " +"depending on the value of *argc*:" +msgstr "" +"Створює виняток, використовуючи одну з 3 форм оператора ``raise``, залежно " +"від значення *argc*:" + +msgid "0: ``raise`` (re-raise previous exception)" +msgstr "0: ``raise`` (повторно підняти попередній виняток)" + +msgid "" +"1: ``raise STACK[-1]`` (raise exception instance or type at ``STACK[-1]``)" +msgstr "" + +msgid "" +"2: ``raise STACK[-2] from STACK[-1]`` (raise exception instance or type at " +"``STACK[-2]`` with ``__cause__`` set to ``STACK[-1]``)" +msgstr "" + +msgid "" +"Calls a callable object with the number of arguments specified by ``argc``. " +"On the stack are (in ascending order):" +msgstr "" + +msgid "The callable" +msgstr "" + +msgid "``self`` or ``NULL``" +msgstr "" + +msgid "The remaining positional arguments" +msgstr "" + +msgid "``argc`` is the total of the positional arguments, excluding ``self``." +msgstr "" + +msgid "" +"``CALL`` pops all arguments and the callable object off the stack, calls the " +"callable object with those arguments, and pushes the return value returned " +"by the callable object." +msgstr "" + +msgid "The callable now always appears at the same position on the stack." +msgstr "" + +msgid "Calls with keyword arguments are now handled by :opcode:`CALL_KW`." +msgstr "" + +msgid "" +"Calls a callable object with the number of arguments specified by ``argc``, " +"including one or more named arguments. On the stack are (in ascending order):" +msgstr "" + +msgid "The named arguments" +msgstr "" + +msgid "A :class:`tuple` of keyword argument names" +msgstr "" + +msgid "" +"``argc`` is the total of the positional and named arguments, excluding " +"``self``. The length of the tuple of keyword argument names is the number of " +"named arguments." +msgstr "" + +msgid "" +"``CALL_KW`` pops all arguments, the keyword names, and the callable object " +"off the stack, calls the callable object with those arguments, and pushes " +"the return value returned by the callable object." +msgstr "" + +msgid "" +"Calls a callable object with variable set of positional and keyword " +"arguments. If the lowest bit of *flags* is set, the top of the stack " +"contains a mapping object containing additional keyword arguments. Before " +"the callable is called, the mapping object and iterable object are each " +"\"unpacked\" and their contents passed in as keyword and positional " +"arguments respectively. ``CALL_FUNCTION_EX`` pops all arguments and the " +"callable object off the stack, calls the callable object with those " +"arguments, and pushes the return value returned by the callable object." +msgstr "" +"Викликає викликаний об’єкт зі змінним набором позиційних і ключових " +"аргументів. Якщо встановлено найнижчий біт *flags*, верхня частина стека " +"містить об’єкт відображення, що містить додаткові аргументи ключового слова. " +"Перед викликом викликаного об’єкта відображення та ітерованого об’єкта кожен " +"\"розпаковується\", а їхній вміст передається як ключове слово та позиційний " +"аргумент відповідно. ``CALL_FUNCTION_EX`` видаляє зі стеку всі аргументи та " +"об’єкт, який викликається, викликає об’єкт, який викликається, з цими " +"аргументами та надсилає значення, яке повертає об’єкт, який викликається." + +msgid "" +"Pushes a ``NULL`` to the stack. Used in the call sequence to match the " +"``NULL`` pushed by :opcode:`LOAD_METHOD` for non-method calls." +msgstr "" + +msgid "" +"Pushes a new function object on the stack built from the code object at " +"``STACK[-1]``." +msgstr "" + +msgid "Flag value ``0x04`` is a tuple of strings instead of dictionary" +msgstr "Значення прапора ``0x04`` є кортежем рядків замість словника" + +msgid "Qualified name at ``STACK[-1]`` was removed." +msgstr "" + +msgid "" +"Extra function attributes on the stack, signaled by oparg flags, were " +"removed. They now use :opcode:`SET_FUNCTION_ATTRIBUTE`." +msgstr "" + +msgid "" +"Sets an attribute on a function object. Expects the function at " +"``STACK[-1]`` and the attribute value to set at ``STACK[-2]``; consumes both " +"and leaves the function at ``STACK[-1]``. The flag determines which " +"attribute to set:" +msgstr "" + +msgid "" +"``0x01`` a tuple of default values for positional-only and positional-or-" +"keyword parameters in positional order" +msgstr "" +"``0x01`` кортеж значень за замовчуванням для позиційних параметрів і " +"параметрів позиційного або ключового слова в позиційному порядку" + +msgid "``0x02`` a dictionary of keyword-only parameters' default values" +msgstr "" +"``0x02`` словник значень за замовчуванням параметрів лише ключових слів" + +msgid "``0x04`` a tuple of strings containing parameters' annotations" +msgstr "``0x04`` кортеж рядків, що містять анотації параметрів" + +msgid "``0x08`` a tuple containing cells for free variables, making a closure" +msgstr "" +"``0x08`` кортеж, що містить комірки для вільних змінних, створюючи закриття" + +msgid "" +"Pushes a slice object on the stack. *argc* must be 2 or 3. If it is 2, " +"implements::" +msgstr "" + +msgid "" +"end = STACK.pop()\n" +"start = STACK.pop()\n" +"STACK.append(slice(start, end))" +msgstr "" + +msgid "if it is 3, implements::" +msgstr "" + +msgid "" +"step = STACK.pop()\n" +"end = STACK.pop()\n" +"start = STACK.pop()\n" +"STACK.append(slice(start, end, step))" +msgstr "" + +msgid "See the :func:`slice` built-in function for more information." +msgstr "" + +msgid "" +"Prefixes any opcode which has an argument too big to fit into the default " +"one byte. *ext* holds an additional byte which act as higher bits in the " +"argument. For each opcode, at most three prefixal ``EXTENDED_ARG`` are " +"allowed, forming an argument from two-byte to four-byte." +msgstr "" +"Додає префікс до будь-якого коду операції, який має занадто великий " +"аргумент, щоб поміститися в стандартний один байт. *ext* містить додатковий " +"байт, який діє як старші біти в аргументі. Для кожного коду операції " +"дозволено не більше трьох префіксів ``EXTENDED_ARG``, які утворюють аргумент " +"розміром від двох до чотирьох байтів." + +msgid "Convert value to a string, depending on ``oparg``::" +msgstr "" + +msgid "" +"value = STACK.pop()\n" +"result = func(value)\n" +"STACK.append(result)" +msgstr "" + +msgid "``oparg == 1``: call :func:`str` on *value*" +msgstr "" + +msgid "``oparg == 2``: call :func:`repr` on *value*" +msgstr "" + +msgid "``oparg == 3``: call :func:`ascii` on *value*" +msgstr "" + +msgid "Used for implementing formatted string literals (f-strings)." +msgstr "" + +msgid "Formats the value on top of stack::" +msgstr "" + +msgid "" +"value = STACK.pop()\n" +"result = value.__format__(\"\")\n" +"STACK.append(result)" +msgstr "" + +msgid "Formats the given value with the given format spec::" +msgstr "" + +msgid "" +"spec = STACK.pop()\n" +"value = STACK.pop()\n" +"result = value.__format__(spec)\n" +"STACK.append(result)" +msgstr "" + +msgid "" +"``STACK[-1]`` is a tuple of keyword attribute names, ``STACK[-2]`` is the " +"class being matched against, and ``STACK[-3]`` is the match subject. " +"*count* is the number of positional sub-patterns." +msgstr "" + +msgid "" +"Pop ``STACK[-1]``, ``STACK[-2]``, and ``STACK[-3]``. If ``STACK[-3]`` is an " +"instance of ``STACK[-2]`` and has the positional and keyword attributes " +"required by *count* and ``STACK[-1]``, push a tuple of extracted attributes. " +"Otherwise, push ``None``." +msgstr "" + +msgid "A no-op. Performs internal tracing, debugging and optimization checks." +msgstr "" + +msgid "" +"The ``context`` oparand consists of two parts. The lowest two bits indicate " +"where the ``RESUME`` occurs:" +msgstr "" + +msgid "" +"``0`` The start of a function, which is neither a generator, coroutine nor " +"an async generator" +msgstr "" + +msgid "``1`` After a ``yield`` expression" +msgstr "" + +msgid "``2`` After a ``yield from`` expression" +msgstr "" + +msgid "``3`` After an ``await`` expression" +msgstr "" + +msgid "" +"The next bit is ``1`` if the RESUME is at except-depth ``1``, and ``0`` " +"otherwise." +msgstr "" + +msgid "The oparg value changed to include information about except-depth" +msgstr "" + +msgid "" +"Create a generator, coroutine, or async generator from the current frame. " +"Used as first opcode of in code object for the above mentioned callables. " +"Clear the current frame and return the newly created generator." +msgstr "" + +msgid "" +"Equivalent to ``STACK[-1] = STACK[-2].send(STACK[-1])``. Used in ``yield " +"from`` and ``await`` statements." +msgstr "" + +msgid "" +"If the call raises :exc:`StopIteration`, pop the top value from the stack, " +"push the exception's ``value`` attribute, and increment the bytecode counter " +"by *delta*." +msgstr "" + +msgid "" +"This is not really an opcode. It identifies the dividing line between " +"opcodes in the range [0,255] which don't use their argument and those that " +"do (``< HAVE_ARGUMENT`` and ``>= HAVE_ARGUMENT``, respectively)." +msgstr "" + +msgid "" +"If your application uses pseudo instructions or specialized instructions, " +"use the :data:`hasarg` collection instead." +msgstr "" + +msgid "" +"Now every instruction has an argument, but opcodes ``< HAVE_ARGUMENT`` " +"ignore it. Before, only opcodes ``>= HAVE_ARGUMENT`` had an argument." +msgstr "" +"Тепер кожна інструкція має аргумент, але коди операцій ``< HAVE_ARGUMENT`` " +"ignore it. Before, only opcodes ``> = HAVE_ARGUMENT`` мали аргумент." + +msgid "" +"Pseudo instructions were added to the :mod:`dis` module, and for them it is " +"not true that comparison with ``HAVE_ARGUMENT`` indicates whether they use " +"their arg." +msgstr "" + +msgid "Use :data:`hasarg` instead." +msgstr "" + +msgid "" +"Calls an intrinsic function with one argument. Passes ``STACK[-1]`` as the " +"argument and sets ``STACK[-1]`` to the result. Used to implement " +"functionality that is not performance critical." +msgstr "" + +msgid "The operand determines which intrinsic function is called:" +msgstr "" + +msgid "Operand" +msgstr "" + +msgid "Description" +msgstr "Опис" + +msgid "``INTRINSIC_1_INVALID``" +msgstr "" + +msgid "Not valid" +msgstr "" + +msgid "``INTRINSIC_PRINT``" +msgstr "" + +msgid "Prints the argument to standard out. Used in the REPL." +msgstr "" + +msgid "``INTRINSIC_IMPORT_STAR``" +msgstr "" + +msgid "Performs ``import *`` for the named module." +msgstr "" + +msgid "``INTRINSIC_STOPITERATION_ERROR``" +msgstr "" + +msgid "Extracts the return value from a ``StopIteration`` exception." +msgstr "" + +msgid "``INTRINSIC_ASYNC_GEN_WRAP``" +msgstr "" + +msgid "Wraps an async generator value" +msgstr "" + +msgid "``INTRINSIC_UNARY_POSITIVE``" +msgstr "" + +msgid "Performs the unary ``+`` operation" +msgstr "" + +msgid "``INTRINSIC_LIST_TO_TUPLE``" +msgstr "" + +msgid "Converts a list to a tuple" +msgstr "" + +msgid "``INTRINSIC_TYPEVAR``" +msgstr "" + +msgid "Creates a :class:`typing.TypeVar`" +msgstr "" + +msgid "``INTRINSIC_PARAMSPEC``" +msgstr "" + +msgid "Creates a :class:`typing.ParamSpec`" +msgstr "" + +msgid "``INTRINSIC_TYPEVARTUPLE``" +msgstr "" + +msgid "Creates a :class:`typing.TypeVarTuple`" +msgstr "" + +msgid "``INTRINSIC_SUBSCRIPT_GENERIC``" +msgstr "" + +msgid "Returns :class:`typing.Generic` subscripted with the argument" +msgstr "" + +msgid "``INTRINSIC_TYPEALIAS``" +msgstr "" + +msgid "" +"Creates a :class:`typing.TypeAliasType`; used in the :keyword:`type` " +"statement. The argument is a tuple of the type alias's name, type " +"parameters, and value." +msgstr "" + +msgid "" +"Calls an intrinsic function with two arguments. Used to implement " +"functionality that is not performance critical::" +msgstr "" + +msgid "" +"arg2 = STACK.pop()\n" +"arg1 = STACK.pop()\n" +"result = intrinsic2(arg1, arg2)\n" +"STACK.append(result)" +msgstr "" + +msgid "``INTRINSIC_2_INVALID``" +msgstr "" + +msgid "``INTRINSIC_PREP_RERAISE_STAR``" +msgstr "" + +msgid "Calculates the :exc:`ExceptionGroup` to raise from a ``try-except*``." +msgstr "" + +msgid "``INTRINSIC_TYPEVAR_WITH_BOUND``" +msgstr "" + +msgid "Creates a :class:`typing.TypeVar` with a bound." +msgstr "" + +msgid "``INTRINSIC_TYPEVAR_WITH_CONSTRAINTS``" +msgstr "" + +msgid "Creates a :class:`typing.TypeVar` with constraints." +msgstr "" + +msgid "``INTRINSIC_SET_FUNCTION_TYPE_PARAMS``" +msgstr "" + +msgid "Sets the ``__type_params__`` attribute of a function." +msgstr "" + +msgid "**Pseudo-instructions**" +msgstr "" + +msgid "" +"These opcodes do not appear in Python bytecode. They are used by the " +"compiler but are replaced by real opcodes or removed before bytecode is " +"generated." +msgstr "" + +msgid "" +"Set up an exception handler for the following code block. If an exception " +"occurs, the value stack level is restored to its current state and control " +"is transferred to the exception handler at ``target``." +msgstr "" + +msgid "" +"Like ``SETUP_FINALLY``, but in case of an exception also pushes the last " +"instruction (``lasti``) to the stack so that ``RERAISE`` can restore it. If " +"an exception occurs, the value stack level and the last instruction on the " +"frame are restored to their current state, and control is transferred to the " +"exception handler at ``target``." +msgstr "" + +msgid "" +"Like ``SETUP_CLEANUP``, but in case of an exception one more item is popped " +"from the stack before control is transferred to the exception handler at " +"``target``." +msgstr "" + +msgid "" +"This variant is used in :keyword:`with` and :keyword:`async with` " +"constructs, which push the return value of the context manager's :meth:" +"`~object.__enter__` or :meth:`~object.__aenter__` to the stack." +msgstr "" + +msgid "" +"Marks the end of the code block associated with the last ``SETUP_FINALLY``, " +"``SETUP_CLEANUP`` or ``SETUP_WITH``." +msgstr "" + +msgid "" +"Undirected relative jump instructions which are replaced by their directed " +"(forward/backward) counterparts by the assembler." +msgstr "" + +msgid "" +"Pushes a reference to the cell contained in slot ``i`` of the \"fast " +"locals\" storage." +msgstr "" + +msgid "" +"Note that ``LOAD_CLOSURE`` is replaced with ``LOAD_FAST`` in the assembler." +msgstr "" + +msgid "This opcode is now a pseudo-instruction." +msgstr "" + +msgid "" +"Optimized unbound method lookup. Emitted as a ``LOAD_ATTR`` opcode with a " +"flag set in the arg." +msgstr "" + +msgid "Opcode collections" +msgstr "Колекції кодів операцій" + +msgid "" +"These collections are provided for automatic introspection of bytecode " +"instructions:" +msgstr "Ці колекції надаються для автоматичного аналізу інструкцій байт-коду:" + +msgid "" +"The collections now contain pseudo instructions and instrumented " +"instructions as well. These are opcodes with values ``>= MIN_PSEUDO_OPCODE`` " +"and ``>= MIN_INSTRUMENTED_OPCODE``." +msgstr "" + +msgid "Sequence of operation names, indexable using the bytecode." +msgstr "Послідовність імен операцій, індексованих за допомогою байт-коду." + +msgid "Dictionary mapping operation names to bytecodes." +msgstr "Словник зіставляє назви операцій із байт-кодами." + +msgid "Sequence of all compare operation names." +msgstr "Послідовність імен усіх операцій порівняння." + +msgid "Sequence of bytecodes that use their argument." +msgstr "" + +msgid "Sequence of bytecodes that access a constant." +msgstr "Послідовність байт-кодів, які звертаються до константи." + +msgid "" +"Sequence of bytecodes that access a :term:`free (closure) variable `. 'free' in this context refers to names in the current scope that " +"are referenced by inner scopes or names in outer scopes that are referenced " +"from this scope. It does *not* include references to global or builtin " +"scopes." +msgstr "" + +msgid "Sequence of bytecodes that access an attribute by name." +msgstr "Послідовність байт-кодів, які звертаються до атрибута за назвою." + +msgid "Sequence of bytecodes that have a jump target. All jumps are relative." +msgstr "" + +msgid "Sequence of bytecodes that access a local variable." +msgstr "Послідовність байт-кодів, які звертаються до локальної змінної." + +msgid "Sequence of bytecodes of Boolean operations." +msgstr "Послідовність байт-кодів булевих операцій." + +msgid "Sequence of bytecodes that set an exception handler." +msgstr "" + +msgid "Sequence of bytecodes that have a relative jump target." +msgstr "Послідовність байт-кодів, які мають відносну ціль переходу." + +msgid "All jumps are now relative. Use :data:`hasjump`." +msgstr "" + +msgid "Sequence of bytecodes that have an absolute jump target." +msgstr "Послідовність байт-кодів, які мають абсолютну ціль переходу." + +msgid "All jumps are now relative. This list is empty." +msgstr "" + +msgid "built-in function" +msgstr "вбудована функція" + +msgid "slice" +msgstr "шматочок" diff --git a/library/distribution.po b/library/distribution.po new file mode 100644 index 000000000..1e9922f80 --- /dev/null +++ b/library/distribution.po @@ -0,0 +1,41 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 01:04+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Software Packaging and Distribution" +msgstr "Упаковка та розповсюдження програмного забезпечення" + +msgid "" +"These libraries help you with publishing and installing Python software. " +"While these modules are designed to work in conjunction with the `Python " +"Package Index `__, they can also be used with a local " +"index server, or without any index server at all." +msgstr "" +"Ці бібліотеки допомагають вам публікувати та інсталювати програмне " +"забезпечення Python. Незважаючи на те, що ці модулі розроблені для роботи в " +"поєднанні з `Python Package Index `__, їх також можна " +"використовувати з локальним сервером індексування або взагалі без будь-якого " +"сервера індексування." diff --git a/library/distutils.po b/library/distutils.po new file mode 100644 index 000000000..359e29712 --- /dev/null +++ b/library/distutils.po @@ -0,0 +1,37 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2024-11-19 01:02+0000\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!distutils` --- Building and installing Python modules" +msgstr "" + +msgid "" +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.12 ` after being " +"deprecated in Python 3.10. The removal was decided in :pep:`632`, which has " +"`migration advice `_." +msgstr "" + +msgid "" +"The last version of Python that provided the :mod:`!distutils` module was " +"`Python 3.11 `_." +msgstr "" diff --git a/library/doctest.po b/library/doctest.po new file mode 100644 index 000000000..718c8b592 --- /dev/null +++ b/library/doctest.po @@ -0,0 +1,3015 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Yuliia Shevchenko, 2024 +# Dmytro Kazanzhy, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-04 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 01:04+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!doctest` --- Test interactive Python examples" +msgstr "" + +msgid "**Source code:** :source:`Lib/doctest.py`" +msgstr "**Вихідний код:** :source:`Lib/doctest.py`" + +msgid "" +"The :mod:`doctest` module searches for pieces of text that look like " +"interactive Python sessions, and then executes those sessions to verify that " +"they work exactly as shown. There are several common ways to use doctest:" +msgstr "" +"Модуль :mod:`doctest` шукає фрагменти тексту, які виглядають як інтерактивні " +"сеанси Python, а потім виконує ці сеанси, щоб перевірити, чи вони працюють " +"саме так, як показано. Існує кілька поширених способів використання doctest:" + +msgid "" +"To check that a module's docstrings are up-to-date by verifying that all " +"interactive examples still work as documented." +msgstr "" +"Щоб перевірити актуальність рядків документів модуля, переконавшись, що всі " +"інтерактивні приклади все ще працюють, як задокументовано." + +msgid "" +"To perform regression testing by verifying that interactive examples from a " +"test file or a test object work as expected." +msgstr "" +"Щоб виконати регресійне тестування, перевіривши, що інтерактивні приклади з " +"тестового файлу або тестового об’єкта працюють належним чином." + +msgid "" +"To write tutorial documentation for a package, liberally illustrated with " +"input-output examples. Depending on whether the examples or the expository " +"text are emphasized, this has the flavor of \"literate testing\" or " +"\"executable documentation\"." +msgstr "" +"Написати навчальну документацію для пакета, щедро проілюстровану прикладами " +"введення-виведення. Залежно від того, чи наголошується на прикладах чи " +"пояснювальному тексті, це має відтінок \"грамотного тестування\" або " +"\"виконуваної документації\"." + +msgid "Here's a complete but small example module::" +msgstr "Ось повний, але невеликий приклад модуля::" + +msgid "" +"\"\"\"\n" +"This is the \"example\" module.\n" +"\n" +"The example module supplies one function, factorial(). For example,\n" +"\n" +">>> factorial(5)\n" +"120\n" +"\"\"\"\n" +"\n" +"def factorial(n):\n" +" \"\"\"Return the factorial of n, an exact integer >= 0.\n" +"\n" +" >>> [factorial(n) for n in range(6)]\n" +" [1, 1, 2, 6, 24, 120]\n" +" >>> factorial(30)\n" +" 265252859812191058636308480000000\n" +" >>> factorial(-1)\n" +" Traceback (most recent call last):\n" +" ...\n" +" ValueError: n must be >= 0\n" +"\n" +" Factorials of floats are OK, but the float must be an exact integer:\n" +" >>> factorial(30.1)\n" +" Traceback (most recent call last):\n" +" ...\n" +" ValueError: n must be exact integer\n" +" >>> factorial(30.0)\n" +" 265252859812191058636308480000000\n" +"\n" +" It must also not be ridiculously large:\n" +" >>> factorial(1e100)\n" +" Traceback (most recent call last):\n" +" ...\n" +" OverflowError: n too large\n" +" \"\"\"\n" +"\n" +" import math\n" +" if not n >= 0:\n" +" raise ValueError(\"n must be >= 0\")\n" +" if math.floor(n) != n:\n" +" raise ValueError(\"n must be exact integer\")\n" +" if n+1 == n: # catch a value like 1e300\n" +" raise OverflowError(\"n too large\")\n" +" result = 1\n" +" factor = 2\n" +" while factor <= n:\n" +" result *= factor\n" +" factor += 1\n" +" return result\n" +"\n" +"\n" +"if __name__ == \"__main__\":\n" +" import doctest\n" +" doctest.testmod()" +msgstr "" + +msgid "" +"If you run :file:`example.py` directly from the command line, :mod:`doctest` " +"works its magic:" +msgstr "" +"Якщо ви запустите :file:`example.py` безпосередньо з командного рядка, :mod:" +"`doctest` спрацює так:" + +msgid "" +"$ python example.py\n" +"$" +msgstr "" + +msgid "" +"There's no output! That's normal, and it means all the examples worked. " +"Pass ``-v`` to the script, and :mod:`doctest` prints a detailed log of what " +"it's trying, and prints a summary at the end:" +msgstr "" +"Немає виходу! Це нормально, і це означає, що всі приклади спрацювали. " +"Передайте сценарію ``-v``, і :mod:`doctest` надрукує докладний журнал того, " +"що він намагається, і наприкінці виведе підсумок:" + +msgid "" +"$ python example.py -v\n" +"Trying:\n" +" factorial(5)\n" +"Expecting:\n" +" 120\n" +"ok\n" +"Trying:\n" +" [factorial(n) for n in range(6)]\n" +"Expecting:\n" +" [1, 1, 2, 6, 24, 120]\n" +"ok" +msgstr "" + +msgid "And so on, eventually ending with:" +msgstr "І так далі, зрештою закінчуючи:" + +msgid "" +"Trying:\n" +" factorial(1e100)\n" +"Expecting:\n" +" Traceback (most recent call last):\n" +" ...\n" +" OverflowError: n too large\n" +"ok\n" +"2 items passed all tests:\n" +" 1 test in __main__\n" +" 6 tests in __main__.factorial\n" +"7 tests in 2 items.\n" +"7 passed.\n" +"Test passed.\n" +"$" +msgstr "" + +msgid "" +"That's all you need to know to start making productive use of :mod:" +"`doctest`! Jump in. The following sections provide full details. Note that " +"there are many examples of doctests in the standard Python test suite and " +"libraries. Especially useful examples can be found in the standard test " +"file :file:`Lib/test/test_doctest/test_doctest.py`." +msgstr "" + +msgid "Simple Usage: Checking Examples in Docstrings" +msgstr "Просте використання: перевірка прикладів у Docstrings" + +msgid "" +"The simplest way to start using doctest (but not necessarily the way you'll " +"continue to do it) is to end each module :mod:`!M` with::" +msgstr "" + +msgid "" +"if __name__ == \"__main__\":\n" +" import doctest\n" +" doctest.testmod()" +msgstr "" + +msgid ":mod:`!doctest` then examines docstrings in module :mod:`!M`." +msgstr "" + +msgid "" +"Running the module as a script causes the examples in the docstrings to get " +"executed and verified::" +msgstr "" +"Запуск модуля як сценарію призводить до виконання та перевірки прикладів у " +"рядках документів:" + +msgid "python M.py" +msgstr "" + +msgid "" +"This won't display anything unless an example fails, in which case the " +"failing example(s) and the cause(s) of the failure(s) are printed to stdout, " +"and the final line of output is ``***Test Failed*** N failures.``, where *N* " +"is the number of examples that failed." +msgstr "" +"Це не відображатиме нічого, якщо приклад не буде невдалим, у цьому випадку " +"невдалий(і) приклад(и) і причину(и) помилки(и) друкуються в stdout, а " +"останній рядок виводу буде ``***Test Помилка*** N невдач.``, де *N* — це " +"кількість прикладів, що не вдалося виконати." + +msgid "Run it with the ``-v`` switch instead::" +msgstr "Натомість запустіть його з перемикачем ``-v``::" + +msgid "python M.py -v" +msgstr "" + +msgid "" +"and a detailed report of all examples tried is printed to standard output, " +"along with assorted summaries at the end." +msgstr "" +"і детальний звіт про всі спробовані приклади друкується на стандартному " +"виводі разом із різноманітними підсумками в кінці." + +msgid "" +"You can force verbose mode by passing ``verbose=True`` to :func:`testmod`, " +"or prohibit it by passing ``verbose=False``. In either of those cases, " +"``sys.argv`` is not examined by :func:`testmod` (so passing ``-v`` or not " +"has no effect)." +msgstr "" +"Ви можете змусити докладний режим, передавши ``verbose=True`` до :func:" +"`testmod`, або заборонити його, передавши ``verbose=False``. У жодному з цих " +"випадків ``sys.argv`` не перевіряється :func:`testmod` (тому передача ``-v`` " +"чи ні не має ефекту)." + +msgid "" +"There is also a command line shortcut for running :func:`testmod`, see " +"section :ref:`doctest-cli`." +msgstr "" + +msgid "" +"For more information on :func:`testmod`, see section :ref:`doctest-basic-" +"api`." +msgstr "" +"Додаткову інформацію про :func:`testmod` див. у розділі :ref:`doctest-basic-" +"api`." + +msgid "Simple Usage: Checking Examples in a Text File" +msgstr "Просте використання: перевірка прикладів у текстовому файлі" + +msgid "" +"Another simple application of doctest is testing interactive examples in a " +"text file. This can be done with the :func:`testfile` function::" +msgstr "" +"Іншим простим застосуванням doctest є тестування інтерактивних прикладів у " +"текстовому файлі. Це можна зробити за допомогою функції :func:`testfile`::" + +msgid "" +"import doctest\n" +"doctest.testfile(\"example.txt\")" +msgstr "" + +msgid "" +"That short script executes and verifies any interactive Python examples " +"contained in the file :file:`example.txt`. The file content is treated as " +"if it were a single giant docstring; the file doesn't need to contain a " +"Python program! For example, perhaps :file:`example.txt` contains this:" +msgstr "" +"Цей короткий сценарій виконує та перевіряє будь-які інтерактивні приклади " +"Python, що містяться у файлі :file:`example.txt`. Вміст файлу обробляється " +"так, ніби це один гігантський рядок документа; файл не повинен містити " +"програму Python! Наприклад, можливо, :file:`example.txt` містить таке:" + +msgid "" +"The ``example`` module\n" +"======================\n" +"\n" +"Using ``factorial``\n" +"-------------------\n" +"\n" +"This is an example text file in reStructuredText format. First import\n" +"``factorial`` from the ``example`` module:\n" +"\n" +" >>> from example import factorial\n" +"\n" +"Now use it:\n" +"\n" +" >>> factorial(6)\n" +" 120" +msgstr "" + +msgid "" +"Running ``doctest.testfile(\"example.txt\")`` then finds the error in this " +"documentation::" +msgstr "" +"Запуск ``doctest.testfile(\"example.txt\")`` потім знаходить помилку в цій " +"документації::" + +msgid "" +"File \"./example.txt\", line 14, in example.txt\n" +"Failed example:\n" +" factorial(6)\n" +"Expected:\n" +" 120\n" +"Got:\n" +" 720" +msgstr "" + +msgid "" +"As with :func:`testmod`, :func:`testfile` won't display anything unless an " +"example fails. If an example does fail, then the failing example(s) and the " +"cause(s) of the failure(s) are printed to stdout, using the same format as :" +"func:`testmod`." +msgstr "" +"Як і у випадку з :func:`testmod`, :func:`testfile` нічого не відображатиме, " +"якщо приклад не вдасться. Якщо приклад не вдається, то невдалий(і) " +"приклад(и) і причина(и) невдачі(ів) друкуються у stdout, використовуючи той " +"самий формат, що й :func:`testmod`." + +msgid "" +"By default, :func:`testfile` looks for files in the calling module's " +"directory. See section :ref:`doctest-basic-api` for a description of the " +"optional arguments that can be used to tell it to look for files in other " +"locations." +msgstr "" +"За замовчуванням :func:`testfile` шукає файли в каталозі викликаючого " +"модуля. Перегляньте розділ :ref:`doctest-basic-api` для опису необов’язкових " +"аргументів, які можна використовувати, щоб наказати йому шукати файли в " +"інших місцях." + +msgid "" +"Like :func:`testmod`, :func:`testfile`'s verbosity can be set with the ``-" +"v`` command-line switch or with the optional keyword argument *verbose*." +msgstr "" +"Подібно до :func:`testmod`, докладність :func:`testfile` можна встановити за " +"допомогою перемикача командного рядка ``-v`` або за допомогою додаткового " +"аргументу ключового слова *verbose*." + +msgid "" +"There is also a command line shortcut for running :func:`testfile`, see " +"section :ref:`doctest-cli`." +msgstr "" + +msgid "" +"For more information on :func:`testfile`, see section :ref:`doctest-basic-" +"api`." +msgstr "" +"Для отримання додаткової інформації про :func:`testfile` див. розділ :ref:" +"`doctest-basic-api`." + +msgid "Command-line Usage" +msgstr "" + +msgid "" +"The :mod:`doctest` module can be invoked as a script from the command line:" +msgstr "" + +msgid "python -m doctest [-v] [-o OPTION] [-f] file [file ...]" +msgstr "" + +msgid "" +"Detailed report of all examples tried is printed to standard output, along " +"with assorted summaries at the end::" +msgstr "" + +msgid "python -m doctest -v example.py" +msgstr "" + +msgid "" +"This will import :file:`example.py` as a standalone module and run :func:" +"`testmod` on it. Note that this may not work correctly if the file is part " +"of a package and imports other submodules from that package." +msgstr "" + +msgid "" +"If the file name does not end with :file:`.py`, :mod:`!doctest` infers that " +"it must be run with :func:`testfile` instead::" +msgstr "" + +msgid "python -m doctest -v example.txt" +msgstr "" + +msgid "" +"Option flags control various aspects of doctest's behavior, see section :ref:" +"`doctest-options`." +msgstr "" + +msgid "This is shorthand for ``-o FAIL_FAST``." +msgstr "" + +msgid "How It Works" +msgstr "Як це працює" + +msgid "" +"This section examines in detail how doctest works: which docstrings it looks " +"at, how it finds interactive examples, what execution context it uses, how " +"it handles exceptions, and how option flags can be used to control its " +"behavior. This is the information that you need to know to write doctest " +"examples; for information about actually running doctest on these examples, " +"see the following sections." +msgstr "" +"У цьому розділі детально розглядається, як працює doctest: які рядки " +"документації він переглядає, як він знаходить інтерактивні приклади, який " +"контекст виконання він використовує, як він обробляє винятки та як прапорці " +"параметрів можна використовувати для керування його поведінкою. Це " +"інформація, яку вам потрібно знати, щоб написати приклади doctest; для " +"отримання інформації про фактичний запуск doctest на цих прикладах дивіться " +"наступні розділи." + +msgid "Which Docstrings Are Examined?" +msgstr "Які рядки документів перевіряються?" + +msgid "" +"The module docstring, and all function, class and method docstrings are " +"searched. Objects imported into the module are not searched." +msgstr "" +"Здійснюється пошук у рядку документів модуля та всіх рядках документів " +"функцій, класів і методів. Об’єкти, імпортовані в модуль, не шукаються." + +msgid "" +"In addition, there are cases when you want tests to be part of a module but " +"not part of the help text, which requires that the tests not be included in " +"the docstring. Doctest looks for a module-level variable called ``__test__`` " +"and uses it to locate other tests. If ``M.__test__`` exists, it must be a " +"dict, and each entry maps a (string) name to a function object, class " +"object, or string. Function and class object docstrings found from ``M." +"__test__`` are searched, and strings are treated as if they were " +"docstrings. In output, a key ``K`` in ``M.__test__`` appears with name ``M." +"__test__.K``." +msgstr "" + +msgid "For example, place this block of code at the top of :file:`example.py`:" +msgstr "" + +msgid "" +"__test__ = {\n" +" 'numbers': \"\"\"\n" +">>> factorial(6)\n" +"720\n" +"\n" +">>> [factorial(n) for n in range(6)]\n" +"[1, 1, 2, 6, 24, 120]\n" +"\"\"\"\n" +"}" +msgstr "" + +msgid "" +"The value of ``example.__test__[\"numbers\"]`` will be treated as a " +"docstring and all the tests inside it will be run. It is important to note " +"that the value can be mapped to a function, class object, or module; if so, :" +"mod:`!doctest` searches them recursively for docstrings, which are then " +"scanned for tests." +msgstr "" + +msgid "" +"Any classes found are recursively searched similarly, to test docstrings in " +"their contained methods and nested classes." +msgstr "" +"Будь-які знайдені класи рекурсивно шукаються подібним чином, щоб перевірити " +"рядки документів у їх методах і вкладених класах." + +msgid "How are Docstring Examples Recognized?" +msgstr "Як розпізнаються приклади Docstring?" + +msgid "" +"In most cases a copy-and-paste of an interactive console session works fine, " +"but doctest isn't trying to do an exact emulation of any specific Python " +"shell." +msgstr "" +"У більшості випадків копіювання та вставлення сеансу інтерактивної консолі " +"працює добре, але doctest не намагається зробити точну емуляцію будь-якої " +"конкретної оболонки Python." + +msgid "" +">>> # comments are ignored\n" +">>> x = 12\n" +">>> x\n" +"12\n" +">>> if x == 13:\n" +"... print(\"yes\")\n" +"... else:\n" +"... print(\"no\")\n" +"... print(\"NO\")\n" +"... print(\"NO!!!\")\n" +"...\n" +"no\n" +"NO\n" +"NO!!!\n" +">>>" +msgstr "" + +msgid "" +"Any expected output must immediately follow the final ``'>>> '`` or ``'... " +"'`` line containing the code, and the expected output (if any) extends to " +"the next ``'>>> '`` or all-whitespace line." +msgstr "" +"Будь-який очікуваний вихід має слідувати одразу за останнім ``'>>> '`` або " +"``'... '`` рядком, що містить код, і очікуваний вихід (якщо такий є) " +"поширюється на наступний ``'>>> \"`` або рядок із пробілами." + +msgid "The fine print:" +msgstr "Дрібний шрифт:" + +msgid "" +"Expected output cannot contain an all-whitespace line, since such a line is " +"taken to signal the end of expected output. If expected output does contain " +"a blank line, put ```` in your doctest example each place a blank " +"line is expected." +msgstr "" +"Очікуваний вихід не може містити рядок із пробілами, оскільки такий рядок " +"використовується для сигналізації про кінець очікуваного виведення. Якщо " +"очікуваний результат містить порожній рядок, додайте ```` у " +"прикладі doctest у кожному місці, де очікується порожній рядок." + +msgid "" +"All hard tab characters are expanded to spaces, using 8-column tab stops. " +"Tabs in output generated by the tested code are not modified. Because any " +"hard tabs in the sample output *are* expanded, this means that if the code " +"output includes hard tabs, the only way the doctest can pass is if the :" +"const:`NORMALIZE_WHITESPACE` option or :ref:`directive ` " +"is in effect. Alternatively, the test can be rewritten to capture the output " +"and compare it to an expected value as part of the test. This handling of " +"tabs in the source was arrived at through trial and error, and has proven to " +"be the least error prone way of handling them. It is possible to use a " +"different algorithm for handling tabs by writing a custom :class:" +"`DocTestParser` class." +msgstr "" +"Усі жорсткі символи табуляції розгорнуті на пробіли за допомогою позицій " +"табуляції з 8 стовпців. Вкладки у вихідних даних, згенерованих тестованим " +"кодом, не змінюються. Оскільки будь-які жорсткі вкладки у вихідних даних " +"зразка *розгорнуті*, це означає, що якщо вивід коду містить жорсткі вкладки, " +"єдиний спосіб проходження doctest — це параметр :const:" +"`NORMALIZE_WHITESPACE` або :ref:`директива ` в ефекті. " +"Крім того, тест можна переписати, щоб зафіксувати результат і порівняти його " +"з очікуваним значенням як частину тесту. Таку обробку вкладок у вихідному " +"коді було досягнуто шляхом проб і помилок, і це виявилося найменш схильним " +"до помилок способом обробки. Можна використати інший алгоритм для обробки " +"вкладок, написавши спеціальний клас :class:`DocTestParser`." + +msgid "" +"Output to stdout is captured, but not output to stderr (exception tracebacks " +"are captured via a different means)." +msgstr "" +"Вихідні дані в stdout фіксуються, але не виводяться в stderr (зворотні дані " +"за винятками фіксуються іншим способом)." + +msgid "" +"If you continue a line via backslashing in an interactive session, or for " +"any other reason use a backslash, you should use a raw docstring, which will " +"preserve your backslashes exactly as you type them::" +msgstr "" +"Якщо ви продовжуєте рядок через зворотну косу риску в інтерактивному сеансі " +"або з будь-якої іншої причини використовуєте зворотну косу риску, вам слід " +"використовувати необроблений рядок документації, який збереже ваші зворотні " +"косі риски точно так, як ви їх вводите::" + +msgid "" +">>> def f(x):\n" +"... r'''Backslashes in a raw docstring: m\\n'''\n" +"...\n" +">>> print(f.__doc__)\n" +"Backslashes in a raw docstring: m\\n" +msgstr "" + +msgid "" +"Otherwise, the backslash will be interpreted as part of the string. For " +"example, the ``\\n`` above would be interpreted as a newline character. " +"Alternatively, you can double each backslash in the doctest version (and not " +"use a raw string)::" +msgstr "" +"В іншому випадку зворотна коса риска буде інтерпретуватися як частина рядка. " +"Наприклад, ``\\n`` вище буде інтерпретовано як символ нового рядка. Крім " +"того, ви можете подвоїти кожну зворотну косу риску у версії doctest (і не " +"використовувати необроблений рядок)::" + +msgid "" +">>> def f(x):\n" +"... '''Backslashes in a raw docstring: m\\\\n'''\n" +"...\n" +">>> print(f.__doc__)\n" +"Backslashes in a raw docstring: m\\n" +msgstr "" + +msgid "The starting column doesn't matter::" +msgstr "Початковий стовпець не має значення::" + +msgid "" +">>> assert \"Easy!\"\n" +" >>> import math\n" +" >>> math.floor(1.9)\n" +" 1" +msgstr "" + +msgid "" +"and as many leading whitespace characters are stripped from the expected " +"output as appeared in the initial ``'>>> '`` line that started the example." +msgstr "" +"і стільки початкових пробільних символів видаляються з очікуваного " +"результату, скільки було показано в початковому рядку ``'>>> '``, який " +"розпочав приклад." + +msgid "What's the Execution Context?" +msgstr "Що таке контекст виконання?" + +msgid "" +"By default, each time :mod:`doctest` finds a docstring to test, it uses a " +"*shallow copy* of :mod:`!M`'s globals, so that running tests doesn't change " +"the module's real globals, and so that one test in :mod:`!M` can't leave " +"behind crumbs that accidentally allow another test to work. This means " +"examples can freely use any names defined at top-level in :mod:`!M`, and " +"names defined earlier in the docstring being run. Examples cannot see names " +"defined in other docstrings." +msgstr "" + +msgid "" +"You can force use of your own dict as the execution context by passing " +"``globs=your_dict`` to :func:`testmod` or :func:`testfile` instead." +msgstr "" +"Ви можете примусово використовувати свій власний dict як контекст виконання, " +"передавши натомість ``globs=your_dict`` у :func:`testmod` або :func:" +"`testfile`." + +msgid "What About Exceptions?" +msgstr "А як щодо винятків?" + +msgid "" +"No problem, provided that the traceback is the only output produced by the " +"example: just paste in the traceback. [#]_ Since tracebacks contain details " +"that are likely to change rapidly (for example, exact file paths and line " +"numbers), this is one case where doctest works hard to be flexible in what " +"it accepts." +msgstr "" +"Немає проблем, за умови, що відстеження є єдиним результатом, створеним " +"прикладом: просто вставте відстеження. [#]_ Оскільки відстеження містять " +"деталі, які можуть швидко змінюватися (наприклад, точні шляхи до файлів і " +"номери рядків), це один випадок, коли doctest докладає всіх зусиль, щоб бути " +"гнучким у тому, що він приймає." + +msgid "Simple example::" +msgstr "Простий приклад::" + +msgid "" +">>> [1, 2, 3].remove(42)\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"ValueError: list.remove(x): x not in list" +msgstr "" + +msgid "" +"That doctest succeeds if :exc:`ValueError` is raised, with the ``list." +"remove(x): x not in list`` detail as shown." +msgstr "" +"Цей doctest завершується успішно, якщо виникає :exc:`ValueError`, а ``list." +"remove(x): x немає в деталях списку``, як показано." + +msgid "" +"The expected output for an exception must start with a traceback header, " +"which may be either of the following two lines, indented the same as the " +"first line of the example::" +msgstr "" +"Очікуваний вихід для винятку повинен починатися із заголовка трасування, " +"який може бути будь-яким із наступних двох рядків із таким самим відступом, " +"як і перший рядок прикладу:" + +msgid "" +"Traceback (most recent call last):\n" +"Traceback (innermost last):" +msgstr "" + +msgid "" +"The traceback header is followed by an optional traceback stack, whose " +"contents are ignored by doctest. The traceback stack is typically omitted, " +"or copied verbatim from an interactive session." +msgstr "" +"Після заголовка трасування слід додатковий стек зворотного трасування, вміст " +"якого ігнорується doctest. Стек зворотного відстеження зазвичай " +"пропускається або дослівно копіюється з інтерактивного сеансу." + +msgid "" +"The traceback stack is followed by the most interesting part: the line(s) " +"containing the exception type and detail. This is usually the last line of " +"a traceback, but can extend across multiple lines if the exception has a " +"multi-line detail::" +msgstr "" +"За стеком відстеження слідує найцікавіша частина: рядки, що містять тип " +"винятку та деталі. Зазвичай це останній рядок трасування, але він може " +"охоплювати кілька рядків, якщо виняток містить багаторядкові деталі::" + +msgid "" +">>> raise ValueError('multi\\n line\\ndetail')\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"ValueError: multi\n" +" line\n" +"detail" +msgstr "" + +msgid "" +"The last three lines (starting with :exc:`ValueError`) are compared against " +"the exception's type and detail, and the rest are ignored." +msgstr "" +"Останні три рядки (починаючи з :exc:`ValueError`) порівнюються з типом і " +"деталями винятку, а решта ігноруються." + +msgid "" +"Best practice is to omit the traceback stack, unless it adds significant " +"documentation value to the example. So the last example is probably better " +"as::" +msgstr "" +"Найкраща практика — опустити стек трасування, якщо це не додає прикладу " +"значну цінність документації. Отже, останній приклад, ймовірно, кращий як::" + +msgid "" +">>> raise ValueError('multi\\n line\\ndetail')\n" +"Traceback (most recent call last):\n" +" ...\n" +"ValueError: multi\n" +" line\n" +"detail" +msgstr "" + +msgid "" +"Note that tracebacks are treated very specially. In particular, in the " +"rewritten example, the use of ``...`` is independent of doctest's :const:" +"`ELLIPSIS` option. The ellipsis in that example could be left out, or could " +"just as well be three (or three hundred) commas or digits, or an indented " +"transcript of a Monty Python skit." +msgstr "" +"Зауважте, що трейсбеки обробляються дуже спеціально. Зокрема, у переписаному " +"прикладі використання ``...`` не залежить від параметра :const:`ELLIPSIS` " +"doctest. Багатокрапка в цьому прикладі може бути пропущена, або з таким же " +"успіхом може бути трьома (чи трьома сотнями) комами чи цифрами, або " +"транскриптом сценки Монті Пайтона з відступом." + +msgid "Some details you should read once, but won't need to remember:" +msgstr "" +"Деякі деталі, які ви повинні прочитати один раз, але не повинні " +"запам'ятовувати:" + +msgid "" +"Doctest can't guess whether your expected output came from an exception " +"traceback or from ordinary printing. So, e.g., an example that expects " +"``ValueError: 42 is prime`` will pass whether :exc:`ValueError` is actually " +"raised or if the example merely prints that traceback text. In practice, " +"ordinary output rarely begins with a traceback header line, so this doesn't " +"create real problems." +msgstr "" +"Doctest не може здогадатися, чи ваш очікуваний результат отримано від " +"відстеження виняткової ситуації чи від звичайного друку. Так, наприклад, " +"приклад, який очікує ``ValueError: 42 є простим``, буде передано незалежно " +"від того, чи :exc:`ValueError` справді викликано, чи приклад просто друкує " +"цей текст трасування. На практиці звичайний вихід рідко починається з рядка " +"заголовка трасування, тому це не створює реальних проблем." + +msgid "" +"Each line of the traceback stack (if present) must be indented further than " +"the first line of the example, *or* start with a non-alphanumeric character. " +"The first line following the traceback header indented the same and starting " +"with an alphanumeric is taken to be the start of the exception detail. Of " +"course this does the right thing for genuine tracebacks." +msgstr "" +"Кожен рядок стека зворотного відстеження (якщо він є) повинен мати відступ " +"далі, ніж перший рядок прикладу, *або* починатися з небуквено-цифрового " +"символу. Перший рядок після заголовка зворотного відстеження з однаковим " +"відступом і починається з буквено-цифрового символу вважається початком " +"деталей винятку. Звичайно, це правильно для справжнього відстеження." + +msgid "" +"When the :const:`IGNORE_EXCEPTION_DETAIL` doctest option is specified, " +"everything following the leftmost colon and any module information in the " +"exception name is ignored." +msgstr "" +"Коли вказано параметр doctest :const:`IGNORE_EXCEPTION_DETAIL`, все, що йде " +"після крайньої лівої двокрапки, і будь-яка інформація модуля в назві винятку " +"ігнорується." + +msgid "" +"The interactive shell omits the traceback header line for some :exc:" +"`SyntaxError`\\ s. But doctest uses the traceback header line to " +"distinguish exceptions from non-exceptions. So in the rare case where you " +"need to test a :exc:`SyntaxError` that omits the traceback header, you will " +"need to manually add the traceback header line to your test example." +msgstr "" +"Інтерактивна оболонка пропускає рядок заголовка трасування для деяких :exc:" +"`SyntaxError`\\ s. Але doctest використовує рядок заголовка трасування, щоб " +"відрізнити винятки від невинятків. Тож у тих рідкісних випадках, коли вам " +"потрібно перевірити :exc:`SyntaxError`, який пропускає заголовок трасування, " +"вам потрібно буде вручну додати рядок заголовка трасування до вашого " +"тестового прикладу." + +msgid "" +"For some exceptions, Python displays the position of the error using ``^`` " +"markers and tildes::" +msgstr "" + +msgid "" +">>> 1 + None\n" +" File \"\", line 1\n" +" 1 + None\n" +" ~~^~~~~~\n" +"TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'" +msgstr "" + +msgid "" +"Since the lines showing the position of the error come before the exception " +"type and detail, they are not checked by doctest. For example, the " +"following test would pass, even though it puts the ``^`` marker in the wrong " +"location::" +msgstr "" +"Оскільки рядки, що показують положення помилки, стоять перед типом винятку " +"та деталями, вони не перевіряються doctest. Наприклад, наступний тест буде " +"пройдено, навіть якщо він розмістить маркер ``^`` у неправильному місці:" + +msgid "" +">>> 1 + None\n" +" File \"\", line 1\n" +" 1 + None\n" +" ^~~~~~~~\n" +"TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'" +msgstr "" + +msgid "Option Flags" +msgstr "Прапори параметрів" + +msgid "" +"A number of option flags control various aspects of doctest's behavior. " +"Symbolic names for the flags are supplied as module constants, which can be :" +"ref:`bitwise ORed ` together and passed to various functions. The " +"names can also be used in :ref:`doctest directives `, " +"and may be passed to the doctest command line interface via the ``-o`` " +"option." +msgstr "" +"Кілька прапорців параметрів контролюють різні аспекти поведінки doctest. " +"Символічні імена для прапорів надаються як константи модуля, які можна :ref:" +"`порозрядно об’єднати АБО ` разом і передати до різних функцій. " +"Імена також можна використовувати в :ref:`директивах doctest `, і можуть бути передані в інтерфейс командного рядка doctest " +"через опцію ``-o``." + +msgid "" +"The first group of options define test semantics, controlling aspects of how " +"doctest decides whether actual output matches an example's expected output:" +msgstr "" +"Перша група параметрів визначає семантику тесту, контролюючи аспекти того, " +"як doctest вирішує, чи фактичний результат відповідає очікуваному результату " +"прикладу:" + +msgid "" +"By default, if an expected output block contains just ``1``, an actual " +"output block containing just ``1`` or just ``True`` is considered to be a " +"match, and similarly for ``0`` versus ``False``. When :const:" +"`DONT_ACCEPT_TRUE_FOR_1` is specified, neither substitution is allowed. The " +"default behavior caters to that Python changed the return type of many " +"functions from integer to boolean; doctests expecting \"little integer\" " +"output still work in these cases. This option will probably go away, but " +"not for several years." +msgstr "" +"За замовчуванням, якщо очікуваний вихідний блок містить лише ``1``, " +"фактичний вихідний блок, що містить лише ``1`` або лише ``True``, вважається " +"збігом, і аналогічно для ``0`` проти ``False``. Якщо вказано :const:" +"`DONT_ACCEPT_TRUE_FOR_1`, жодна заміна не дозволяється. Поведінка за " +"замовчуванням відповідає тому, що Python змінив тип повернення багатьох " +"функцій з цілого на логічний; doctests, які очікують виводу \"маленького " +"цілого\", все ще працюють у цих випадках. Цей варіант, ймовірно, зникне, але " +"не через кілька років." + +msgid "" +"By default, if an expected output block contains a line containing only the " +"string ````, then that line will match a blank line in the actual " +"output. Because a genuinely blank line delimits the expected output, this " +"is the only way to communicate that a blank line is expected. When :const:" +"`DONT_ACCEPT_BLANKLINE` is specified, this substitution is not allowed." +msgstr "" +"За замовчуванням, якщо очікуваний блок виводу містить рядок, що містить лише " +"рядок ````, тоді цей рядок відповідатиме порожньому рядку у " +"фактичному виведенні. Оскільки справді порожній рядок розмежовує очікуваний " +"вихід, це єдиний спосіб повідомити, що очікується порожній рядок. Якщо " +"вказано :const:`DONT_ACCEPT_BLANKLINE`, ця заміна не дозволяється." + +msgid "" +"When specified, all sequences of whitespace (blanks and newlines) are " +"treated as equal. Any sequence of whitespace within the expected output " +"will match any sequence of whitespace within the actual output. By default, " +"whitespace must match exactly. :const:`NORMALIZE_WHITESPACE` is especially " +"useful when a line of expected output is very long, and you want to wrap it " +"across multiple lines in your source." +msgstr "" +"Якщо вказано, усі послідовності пробілів (пробілі та нові рядки) " +"розглядаються як однакові. Будь-яка послідовність пробілів у очікуваному " +"виводі відповідатиме будь-якій послідовності пробілів у фактичному " +"виведенні. За замовчуванням пробіли мають точно збігатися. :const:" +"`NORMALIZE_WHITESPACE` особливо корисний, коли рядок очікуваного результату " +"дуже довгий, і ви хочете обернути його між кількома рядками у своєму джерелі." + +msgid "" +"When specified, an ellipsis marker (``...``) in the expected output can " +"match any substring in the actual output. This includes substrings that " +"span line boundaries, and empty substrings, so it's best to keep usage of " +"this simple. Complicated uses can lead to the same kinds of \"oops, it " +"matched too much!\" surprises that ``.*`` is prone to in regular expressions." +msgstr "" +"Якщо вказано, маркер еліпса (``...``) в очікуваному виведенні може збігатися " +"з будь-яким підрядком у фактичному виведенні. Це включає в себе підрядки, " +"які охоплюють межі рядка, і порожні підрядки, тому найкраще використовувати " +"це просто. Складне використання може призвести до тих самих типів \"ой, це " +"збігається занадто багато!\" сюрпризів, до яких схильний ``.*`` у регулярних " +"виразах." + +msgid "" +"When specified, doctests expecting exceptions pass so long as an exception " +"of the expected type is raised, even if the details (message and fully " +"qualified exception name) don't match." +msgstr "" + +msgid "" +"For example, an example expecting ``ValueError: 42`` will pass if the actual " +"exception raised is ``ValueError: 3*14``, but will fail if, say, a :exc:" +"`TypeError` is raised instead. It will also ignore any fully qualified name " +"included before the exception class, which can vary between implementations " +"and versions of Python and the code/libraries in use. Hence, all three of " +"these variations will work with the flag specified:" +msgstr "" + +msgid "" +">>> raise Exception('message')\n" +"Traceback (most recent call last):\n" +"Exception: message\n" +"\n" +">>> raise Exception('message')\n" +"Traceback (most recent call last):\n" +"builtins.Exception: message\n" +"\n" +">>> raise Exception('message')\n" +"Traceback (most recent call last):\n" +"__main__.Exception: message" +msgstr "" + +msgid "" +"Note that :const:`ELLIPSIS` can also be used to ignore the details of the " +"exception message, but such a test may still fail based on whether the " +"module name is present or matches exactly." +msgstr "" +"Зауважте, що :const:`ELLIPSIS` також можна використовувати для ігнорування " +"деталей повідомлення про винятки, але такий тест все одно може завершитися " +"невдачею залежно від того, чи присутнє ім’я модуля чи воно точно збігається." + +msgid "" +":const:`IGNORE_EXCEPTION_DETAIL` now also ignores any information relating " +"to the module containing the exception under test." +msgstr "" +":const:`IGNORE_EXCEPTION_DETAIL` тепер також ігнорує будь-яку інформацію, " +"пов’язану з модулем, що містить виняток, що тестується." + +msgid "" +"When specified, do not run the example at all. This can be useful in " +"contexts where doctest examples serve as both documentation and test cases, " +"and an example should be included for documentation purposes, but should not " +"be checked. E.g., the example's output might be random; or the example " +"might depend on resources which would be unavailable to the test driver." +msgstr "" +"Якщо вказано, не запускати приклад взагалі. Це може бути корисним у " +"контекстах, де приклади doctest служать як документацією, так і тестовими " +"випадками, і приклад слід включити з метою документації, але не слід " +"перевіряти. Наприклад, результат прикладу може бути випадковим; або приклад " +"може залежати від ресурсів, які були б недоступні для тестового драйвера." + +msgid "" +"The SKIP flag can also be used for temporarily \"commenting out\" examples." +msgstr "" +"Прапор SKIP також можна використовувати для тимчасового \"закоментування\" " +"прикладів." + +msgid "A bitmask or'ing together all the comparison flags above." +msgstr "Бітова маска або об’єднання всіх прапорів порівняння вище." + +msgid "The second group of options controls how test failures are reported:" +msgstr "Друга група параметрів контролює, як повідомляється про помилки тесту:" + +msgid "" +"When specified, failures that involve multi-line expected and actual outputs " +"are displayed using a unified diff." +msgstr "" +"Якщо вказано, помилки, які включають багаторядкові очікувані та фактичні " +"виходи, відображаються за допомогою уніфікованої різниці." + +msgid "" +"When specified, failures that involve multi-line expected and actual outputs " +"will be displayed using a context diff." +msgstr "" +"Якщо вказано, помилки, які включають багаторядкові очікувані та фактичні " +"результати, відображатимуться за допомогою контекстної різниці." + +msgid "" +"When specified, differences are computed by ``difflib.Differ``, using the " +"same algorithm as the popular :file:`ndiff.py` utility. This is the only " +"method that marks differences within lines as well as across lines. For " +"example, if a line of expected output contains digit ``1`` where actual " +"output contains letter ``l``, a line is inserted with a caret marking the " +"mismatching column positions." +msgstr "" +"Якщо вказано, відмінності обчислюються за допомогою ``difflib.Differ``, " +"використовуючи той самий алгоритм, що й популярна утиліта :file:`ndiff.py`. " +"Це єдиний метод, який позначає відмінності всередині ліній, а також між " +"лініями. Наприклад, якщо рядок очікуваного виводу містить цифру ``1``, а " +"фактичний вивід містить літеру ``l``, рядок вставляється з кареткою, що " +"позначає невідповідні позиції стовпців." + +msgid "" +"When specified, display the first failing example in each doctest, but " +"suppress output for all remaining examples. This will prevent doctest from " +"reporting correct examples that break because of earlier failures; but it " +"might also hide incorrect examples that fail independently of the first " +"failure. When :const:`REPORT_ONLY_FIRST_FAILURE` is specified, the " +"remaining examples are still run, and still count towards the total number " +"of failures reported; only the output is suppressed." +msgstr "" +"Якщо вказано, відобразити перший невдалий приклад у кожному документотесті, " +"але придушити вихід для всіх решти прикладів. Це завадить doctest " +"повідомляти про правильні приклади, які вийшли з ладу через попередні " +"помилки; але це також може приховати некоректні приклади, які завершуються " +"невдачею незалежно від першої невдачі. Якщо вказано :const:" +"`REPORT_ONLY_FIRST_FAILURE`, інші приклади все ще виконуються та " +"враховуються до загальної кількості повідомлених про помилки; пригнічується " +"тільки вихід." + +msgid "" +"When specified, exit after the first failing example and don't attempt to " +"run the remaining examples. Thus, the number of failures reported will be at " +"most 1. This flag may be useful during debugging, since examples after the " +"first failure won't even produce debugging output." +msgstr "" +"Якщо вказано, вийти після першого невдалого прикладу та не намагатися " +"запустити решту прикладів. Таким чином, кількість повідомлених помилок " +"становитиме щонайбільше 1. Цей прапорець може бути корисним під час " +"налагодження, оскільки приклади після першої помилки навіть не " +"створюватимуть вихід налагодження." + +msgid "A bitmask or'ing together all the reporting flags above." +msgstr "Бітова маска або об’єднання всіх наведених вище позначок звітування." + +msgid "" +"There is also a way to register new option flag names, though this isn't " +"useful unless you intend to extend :mod:`doctest` internals via subclassing:" +msgstr "" +"Існує також спосіб зареєструвати нові назви прапорців параметрів, хоча це не " +"корисно, якщо ви не маєте намір розширити внутрішні :mod:`doctest` через " +"підкласи:" + +msgid "" +"Create a new option flag with a given name, and return the new flag's " +"integer value. :func:`register_optionflag` can be used when subclassing :" +"class:`OutputChecker` or :class:`DocTestRunner` to create new options that " +"are supported by your subclasses. :func:`register_optionflag` should always " +"be called using the following idiom::" +msgstr "" +"Створіть новий прапор параметра з заданою назвою та поверніть ціле значення " +"нового прапора. :func:`register_optionflag` можна використовувати під час " +"створення підкласів :class:`OutputChecker` або :class:`DocTestRunner` для " +"створення нових параметрів, які підтримуються вашими підкласами. :func:" +"`register_optionflag` завжди слід викликати за допомогою такої ідіоми:" + +msgid "MY_FLAG = register_optionflag('MY_FLAG')" +msgstr "" + +msgid "Directives" +msgstr "Директиви" + +msgid "" +"Doctest directives may be used to modify the :ref:`option flags ` for an individual example. Doctest directives are special Python " +"comments following an example's source code:" +msgstr "" +"Директиви Doctest можна використовувати для зміни :ref:`прапорців параметрів " +"` для окремого прикладу. Директиви Doctest — це спеціальні " +"коментарі Python, які слідують за вихідним кодом прикладу:" + +msgid "" +"Whitespace is not allowed between the ``+`` or ``-`` and the directive " +"option name. The directive option name can be any of the option flag names " +"explained above." +msgstr "" +"Пробіли не допускаються між \"+\" або \"-\" та назвою параметра директиви. " +"Назва опції директиви може бути будь-якою з імен прапорців опції, пояснених " +"вище." + +msgid "" +"An example's doctest directives modify doctest's behavior for that single " +"example. Use ``+`` to enable the named behavior, or ``-`` to disable it." +msgstr "" +"Директиви doctest прикладу змінюють поведінку doctest для цього окремого " +"прикладу. Використовуйте ``+``, щоб увімкнути вказану поведінку, або ``-``, " +"щоб вимкнути її." + +msgid "For example, this test passes:" +msgstr "Наприклад, цей тест проходить:" + +msgid "" +">>> print(list(range(20))) # doctest: +NORMALIZE_WHITESPACE\n" +"[0, 1, 2, 3, 4, 5, 6, 7, 8, 9,\n" +"10, 11, 12, 13, 14, 15, 16, 17, 18, 19]" +msgstr "" + +msgid "" +"Without the directive it would fail, both because the actual output doesn't " +"have two blanks before the single-digit list elements, and because the " +"actual output is on a single line. This test also passes, and also requires " +"a directive to do so:" +msgstr "" +"Без директиви це було б невдалим, тому що фактичний вивід не має двох " +"пробілів перед однозначними елементами списку, а також тому, що фактичний " +"вивід містить один рядок. Цей тест також проходить, і для цього також " +"потрібна директива:" + +msgid "" +">>> print(list(range(20))) # doctest: +ELLIPSIS\n" +"[0, 1, ..., 18, 19]" +msgstr "" + +msgid "" +"Multiple directives can be used on a single physical line, separated by " +"commas:" +msgstr "" +"В одному фізичному рядку можна використовувати кілька директив, розділених " +"комами:" + +msgid "" +">>> print(list(range(20))) # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE\n" +"[0, 1, ..., 18, 19]" +msgstr "" + +msgid "" +"If multiple directive comments are used for a single example, then they are " +"combined:" +msgstr "" +"Якщо для одного прикладу використовується кілька коментарів директиви, вони " +"об’єднуються:" + +msgid "" +">>> print(list(range(20))) # doctest: +ELLIPSIS\n" +"... # doctest: +NORMALIZE_WHITESPACE\n" +"[0, 1, ..., 18, 19]" +msgstr "" + +msgid "" +"As the previous example shows, you can add ``...`` lines to your example " +"containing only directives. This can be useful when an example is too long " +"for a directive to comfortably fit on the same line:" +msgstr "" +"Як показано в попередньому прикладі, ви можете додати до свого прикладу " +"рядки ``...``, які містять лише директиви. Це може бути корисно, коли " +"приклад надто довгий, щоб директива могла зручно розміститися в одному рядку:" + +msgid "" +">>> print(list(range(5)) + list(range(10, 20)) + list(range(30, 40)))\n" +"... # doctest: +ELLIPSIS\n" +"[0, ..., 4, 10, ..., 19, 30, ..., 39]" +msgstr "" + +msgid "" +"Note that since all options are disabled by default, and directives apply " +"only to the example they appear in, enabling options (via ``+`` in a " +"directive) is usually the only meaningful choice. However, option flags can " +"also be passed to functions that run doctests, establishing different " +"defaults. In such cases, disabling an option via ``-`` in a directive can " +"be useful." +msgstr "" +"Зауважте, що оскільки всі параметри вимкнено за замовчуванням, а директиви " +"застосовуються лише до прикладу, у якому вони з’являються, увімкнення " +"параметрів (через ``+`` у директиві) зазвичай є єдиним значущим вибором. " +"Однак позначки параметрів також можна передати функціям, які запускають " +"doctests, встановлюючи різні значення за замовчуванням. У таких випадках " +"може бути корисним вимкнення опції за допомогою ``-`` у директиві." + +msgid "Warnings" +msgstr "Попередження" + +msgid "" +":mod:`doctest` is serious about requiring exact matches in expected output. " +"If even a single character doesn't match, the test fails. This will " +"probably surprise you a few times, as you learn exactly what Python does and " +"doesn't guarantee about output. For example, when printing a set, Python " +"doesn't guarantee that the element is printed in any particular order, so a " +"test like ::" +msgstr "" +":mod:`doctest` серйозно ставиться до вимог точних збігів в очікуваних " +"результатах. Якщо хоча б один символ не збігається, тест проходить невдало. " +"Можливо, це кілька разів вас здивує, оскільки ви дізнаєтесь, що саме робить " +"Python і що не гарантує вихід. Наприклад, під час друку набору Python не " +"гарантує, що елемент буде надруковано в будь-якому певному порядку, тому " +"такий тест::" + +msgid "" +">>> foo()\n" +"{\"spam\", \"eggs\"}" +msgstr "" + +msgid "is vulnerable! One workaround is to do ::" +msgstr "вразливий! Одним з обхідних шляхів є:" + +msgid "" +">>> foo() == {\"spam\", \"eggs\"}\n" +"True" +msgstr "" + +msgid "instead. Another is to do ::" +msgstr "замість цього. Інше - зробити ::" + +msgid "" +">>> d = sorted(foo())\n" +">>> d\n" +"['eggs', 'spam']" +msgstr "" + +msgid "There are others, but you get the idea." +msgstr "Є й інші, але ви зрозуміли." + +msgid "Another bad idea is to print things that embed an object address, like" +msgstr "" +"Ще одна погана ідея — друкувати речі, які містять адресу об’єкта, наприклад" + +msgid "" +">>> id(1.0) # certain to fail some of the time\n" +"7948648\n" +">>> class C: pass\n" +">>> C() # the default repr() for instances embeds an address\n" +"" +msgstr "" + +msgid "" +"The :const:`ELLIPSIS` directive gives a nice approach for the last example:" +msgstr "Директива :const:`ELLIPSIS` дає гарний підхід для останнього прикладу:" + +msgid "" +">>> C() # doctest: +ELLIPSIS\n" +"" +msgstr "" + +msgid "" +"Floating-point numbers are also subject to small output variations across " +"platforms, because Python defers to the platform C library for float " +"formatting, and C libraries vary widely in quality here. ::" +msgstr "" +"Числа з плаваючою комою також підлягають невеликим варіаціям виводу на " +"різних платформах, оскільки Python віддає перевагу бібліотеці платформи C " +"для форматування з плаваючою комою, і бібліотеки C тут сильно відрізняються " +"за якістю. ::" + +msgid "" +">>> 1./7 # risky\n" +"0.14285714285714285\n" +">>> print(1./7) # safer\n" +"0.142857142857\n" +">>> print(round(1./7, 6)) # much safer\n" +"0.142857" +msgstr "" + +msgid "" +"Numbers of the form ``I/2.**J`` are safe across all platforms, and I often " +"contrive doctest examples to produce numbers of that form::" +msgstr "" +"Числа у формі ``I/2.**J`` безпечні на всіх платформах, і я часто створюю " +"приклади doctest для отримання чисел такої форми::" + +msgid "" +">>> 3./4 # utterly safe\n" +"0.75" +msgstr "" + +msgid "" +"Simple fractions are also easier for people to understand, and that makes " +"for better documentation." +msgstr "Прості дроби також легше зрозуміти людям, і це покращує документацію." + +msgid "Basic API" +msgstr "Базовий API" + +msgid "" +"The functions :func:`testmod` and :func:`testfile` provide a simple " +"interface to doctest that should be sufficient for most basic uses. For a " +"less formal introduction to these two functions, see sections :ref:`doctest-" +"simple-testmod` and :ref:`doctest-simple-testfile`." +msgstr "" +"Функції :func:`testmod` і :func:`testfile` забезпечують простий інтерфейс " +"для doctest, якого має бути достатньо для більшості базових застосувань. Для " +"менш формального вступу до цих двох функцій див. розділи :ref:`doctest-" +"simple-testmod` і :ref:`doctest-simple-testfile`." + +msgid "" +"All arguments except *filename* are optional, and should be specified in " +"keyword form." +msgstr "" +"Усі аргументи, окрім *ім’я файлу*, є необов’язковими та мають бути вказані у " +"формі ключового слова." + +msgid "" +"Test examples in the file named *filename*. Return ``(failure_count, " +"test_count)``." +msgstr "" +"Тестові приклади у файлі з назвою *ім'я_файлу*. Повернення ``(failure_count, " +"test_count)``." + +msgid "" +"Optional argument *module_relative* specifies how the filename should be " +"interpreted:" +msgstr "" +"Необов’язковий аргумент *module_relative* визначає, як слід інтерпретувати " +"назву файлу:" + +msgid "" +"If *module_relative* is ``True`` (the default), then *filename* specifies an " +"OS-independent module-relative path. By default, this path is relative to " +"the calling module's directory; but if the *package* argument is specified, " +"then it is relative to that package. To ensure OS-independence, *filename* " +"should use ``/`` characters to separate path segments, and may not be an " +"absolute path (i.e., it may not begin with ``/``)." +msgstr "" +"Якщо *module_relative* має значення ``True`` (за замовчуванням), тоді " +"*filename* вказує незалежний від ОС шлях до модуля. За замовчуванням цей " +"шлях є відносно каталогу викликаючого модуля; але якщо вказано аргумент " +"*package*, то він відноситься до цього пакета. Щоб забезпечити незалежність " +"від ОС, *ім’я файлу* має використовувати символи ``/`` для розділення " +"сегментів шляху та не може бути абсолютним шляхом (тобто воно не може " +"починатися з ``/``)." + +msgid "" +"If *module_relative* is ``False``, then *filename* specifies an OS-specific " +"path. The path may be absolute or relative; relative paths are resolved " +"with respect to the current working directory." +msgstr "" +"Якщо *module_relative* має значення ``False``, тоді *filename* вказує шлях " +"до ОС. Шлях може бути абсолютним або відносним; відносні шляхи вирішуються " +"відносно поточного робочого каталогу." + +msgid "" +"Optional argument *name* gives the name of the test; by default, or if " +"``None``, ``os.path.basename(filename)`` is used." +msgstr "" +"Необов'язковий аргумент *name* дає назву тесту; за замовчуванням або, якщо " +"``None``, ``os.path.basename(filename)`` використовується." + +msgid "" +"Optional argument *package* is a Python package or the name of a Python " +"package whose directory should be used as the base directory for a module-" +"relative filename. If no package is specified, then the calling module's " +"directory is used as the base directory for module-relative filenames. It " +"is an error to specify *package* if *module_relative* is ``False``." +msgstr "" +"Необов’язковий аргумент *package* — це пакет Python або ім’я пакета Python, " +"чий каталог слід використовувати як базовий каталог для назви файла, що " +"стосується модуля. Якщо пакет не вказано, то каталог модуля, що викликає, " +"використовується як базовий каталог для імен файлів, що відносяться до " +"модуля. Це помилка вказувати *package*, якщо *module_relative* має значення " +"``False``." + +msgid "" +"Optional argument *globs* gives a dict to be used as the globals when " +"executing examples. A new shallow copy of this dict is created for the " +"doctest, so its examples start with a clean slate. By default, or if " +"``None``, a new empty dict is used." +msgstr "" +"Необов’язковий аргумент *globs* дає dict, який буде використовуватися як " +"глобальні під час виконання прикладів. Для doctest створюється нова " +"поверхнева копія цього dict, тому її приклади починаються з чистого аркуша. " +"За замовчуванням або якщо ``None``, використовується новий порожній dict." + +msgid "" +"Optional argument *extraglobs* gives a dict merged into the globals used to " +"execute examples. This works like :meth:`dict.update`: if *globs* and " +"*extraglobs* have a common key, the associated value in *extraglobs* appears " +"in the combined dict. By default, or if ``None``, no extra globals are " +"used. This is an advanced feature that allows parameterization of " +"doctests. For example, a doctest can be written for a base class, using a " +"generic name for the class, then reused to test any number of subclasses by " +"passing an *extraglobs* dict mapping the generic name to the subclass to be " +"tested." +msgstr "" +"Необов’язковий аргумент *extraglobs* дає dict, об’єднаний із глобальними " +"значеннями, які використовуються для виконання прикладів. Це працює як :meth:" +"`dict.update`: якщо *globs* і *extraglobs* мають спільний ключ, пов’язане " +"значення в *extraglobs* з’являється в комбінованому dict. За замовчуванням " +"або якщо ``None``, додаткові глобальні значення не використовуються. Це " +"розширена функція, яка дозволяє параметризувати doctests. Наприклад, doctest " +"можна написати для базового класу, використовуючи загальну назву для класу, " +"а потім повторно використовувати для тестування будь-якої кількості " +"підкласів, передавши *extraglobs* dict, що відображає загальну назву на " +"підклас, який потрібно перевірити." + +msgid "" +"Optional argument *verbose* prints lots of stuff if true, and prints only " +"failures if false; by default, or if ``None``, it's true if and only if ``'-" +"v'`` is in ``sys.argv``." +msgstr "" +"Додатковий аргумент *verbose* друкує багато речей, якщо true, і друкує лише " +"помилки, якщо false; за замовчуванням або якщо ``None``, це істина тоді і " +"тільки якщо ``'-v''`` є в ``sys.argv``." + +msgid "" +"Optional argument *report* prints a summary at the end when true, else " +"prints nothing at the end. In verbose mode, the summary is detailed, else " +"the summary is very brief (in fact, empty if all tests passed)." +msgstr "" +"Необов’язковий аргумент *report* друкує підсумок у кінці, якщо значення " +"true, інакше нічого не друкує в кінці. У багатослівному режимі резюме є " +"детальним, інакше резюме є дуже коротким (насправді порожнім, якщо всі тести " +"пройдено)." + +msgid "" +"Optional argument *optionflags* (default value 0) takes the :ref:`bitwise OR " +"` of option flags. See section :ref:`doctest-options`." +msgstr "" +"Необов’язковий аргумент *optionflags* (значення за замовчуванням 0) приймає :" +"ref:`побітове АБО ` прапорів параметрів. Дивіться розділ :ref:" +"`doctest-options`." + +msgid "" +"Optional argument *raise_on_error* defaults to false. If true, an exception " +"is raised upon the first failure or unexpected exception in an example. " +"This allows failures to be post-mortem debugged. Default behavior is to " +"continue running examples." +msgstr "" +"Додатковий аргумент *raise_on_error* за умовчанням має значення false. Якщо " +"істина, виняток виникає після першої помилки або несподіваного винятку в " +"прикладі. Це дозволяє посмертно виправляти помилки. Типовою поведінкою є " +"продовження виконання прикладів." + +msgid "" +"Optional argument *parser* specifies a :class:`DocTestParser` (or subclass) " +"that should be used to extract tests from the files. It defaults to a " +"normal parser (i.e., ``DocTestParser()``)." +msgstr "" +"Необов’язковий аргумент *parser* визначає :class:`DocTestParser` (або " +"підклас), який слід використовувати для отримання тестів із файлів. За " +"замовчуванням використовується звичайний аналізатор (тобто " +"``DocTestParser()``)." + +msgid "" +"Optional argument *encoding* specifies an encoding that should be used to " +"convert the file to unicode." +msgstr "" +"Необов’язковий аргумент *encoding* визначає кодування, яке слід " +"використовувати для перетворення файлу в Юнікод." + +msgid "" +"All arguments are optional, and all except for *m* should be specified in " +"keyword form." +msgstr "" +"Усі аргументи є необов’язковими, і всі, крім *m*, мають бути вказані у формі " +"ключового слова." + +msgid "" +"Test examples in docstrings in functions and classes reachable from module " +"*m* (or module :mod:`__main__` if *m* is not supplied or is ``None``), " +"starting with ``m.__doc__``." +msgstr "" +"Тестові приклади в рядках документів у функціях і класах, доступних із " +"модуля *m* (або модуля :mod:`__main__`, якщо *m* не вказано або має значення " +"``None``), починаючи з ``m.__doc__``." + +msgid "" +"Also test examples reachable from dict ``m.__test__``, if it exists. ``m." +"__test__`` maps names (strings) to functions, classes and strings; function " +"and class docstrings are searched for examples; strings are searched " +"directly, as if they were docstrings." +msgstr "" + +msgid "" +"Only docstrings attached to objects belonging to module *m* are searched." +msgstr "" +"Пошук здійснюється лише в рядках документів, приєднаних до об’єктів, що " +"належать модулю *m*." + +msgid "Return ``(failure_count, test_count)``." +msgstr "Повернення ``(failure_count, test_count)``." + +msgid "" +"Optional argument *name* gives the name of the module; by default, or if " +"``None``, ``m.__name__`` is used." +msgstr "" +"Необов'язковий аргумент *name* дає назву модуля; за замовчуванням або, якщо " +"``None``, ``m.__name__`` використовується." + +msgid "" +"Optional argument *exclude_empty* defaults to false. If true, objects for " +"which no doctests are found are excluded from consideration. The default is " +"a backward compatibility hack, so that code still using :meth:`doctest." +"master.summarize ` in conjunction with :func:" +"`testmod` continues to get output for objects with no tests. The " +"*exclude_empty* argument to the newer :class:`DocTestFinder` constructor " +"defaults to true." +msgstr "" + +msgid "" +"Optional arguments *extraglobs*, *verbose*, *report*, *optionflags*, " +"*raise_on_error*, and *globs* are the same as for function :func:`testfile` " +"above, except that *globs* defaults to ``m.__dict__``." +msgstr "" +"Необов’язкові аргументи *extraglobs*, *verbose*, *report*, *optionflags*, " +"*raise_on_error* і *globs* такі самі, як і для функції :func:`testfile` " +"вище, за винятком того, що *globs* за умовчанням має значення ``m ." +"__dict__``." + +msgid "" +"Test examples associated with object *f*; for example, *f* may be a string, " +"a module, a function, or a class object." +msgstr "" +"Тестові приклади, пов'язані з об'єктом *f*; наприклад, *f* може бути рядком, " +"модулем, функцією або об’єктом класу." + +msgid "" +"A shallow copy of dictionary argument *globs* is used for the execution " +"context." +msgstr "" +"Неглибока копія аргументу словника *globs* використовується для контексту " +"виконання." + +msgid "" +"Optional argument *name* is used in failure messages, and defaults to " +"``\"NoName\"``." +msgstr "" +"Необов’язковий аргумент *ім’я* використовується в повідомленнях про помилку " +"та за умовчанням має значення ``\"NoName\"``." + +msgid "" +"If optional argument *verbose* is true, output is generated even if there " +"are no failures. By default, output is generated only in case of an example " +"failure." +msgstr "" +"Якщо додатковий аргумент *verbose* має значення true, вихідні дані " +"генеруються, навіть якщо немає помилок. За замовчуванням вихідні дані " +"генеруються лише у випадку помилки прикладу." + +msgid "" +"Optional argument *compileflags* gives the set of flags that should be used " +"by the Python compiler when running the examples. By default, or if " +"``None``, flags are deduced corresponding to the set of future features " +"found in *globs*." +msgstr "" +"Необов’язковий аргумент *compileflags* надає набір прапорів, які має " +"використовувати компілятор Python під час виконання прикладів. За " +"замовчуванням або якщо ``None``, прапори виводяться відповідно до набору " +"майбутніх функцій, знайдених у *globs*." + +msgid "" +"Optional argument *optionflags* works as for function :func:`testfile` above." +msgstr "" +"Необов’язковий аргумент *optionflags* працює як для функції :func:`testfile` " +"вище." + +msgid "Unittest API" +msgstr "Unittest API" + +msgid "" +"As your collection of doctest'ed modules grows, you'll want a way to run all " +"their doctests systematically. :mod:`doctest` provides two functions that " +"can be used to create :mod:`unittest` test suites from modules and text " +"files containing doctests. To integrate with :mod:`unittest` test " +"discovery, include a :ref:`load_tests ` function in " +"your test module::" +msgstr "" + +msgid "" +"import unittest\n" +"import doctest\n" +"import my_module_with_doctests\n" +"\n" +"def load_tests(loader, tests, ignore):\n" +" tests.addTests(doctest.DocTestSuite(my_module_with_doctests))\n" +" return tests" +msgstr "" + +msgid "" +"There are two main functions for creating :class:`unittest.TestSuite` " +"instances from text files and modules with doctests:" +msgstr "" +"Є дві основні функції для створення екземплярів :class:`unittest.TestSuite` " +"з текстових файлів і модулів з doctests:" + +msgid "" +"Convert doctest tests from one or more text files to a :class:`unittest." +"TestSuite`." +msgstr "" +"Перетворіть тести doctest з одного чи кількох текстових файлів у :class:" +"`unittest.TestSuite`." + +msgid "" +"The returned :class:`unittest.TestSuite` is to be run by the unittest " +"framework and runs the interactive examples in each file. If an example in " +"any file fails, then the synthesized unit test fails, and a :exc:" +"`failureException` exception is raised showing the name of the file " +"containing the test and a (sometimes approximate) line number. If all the " +"examples in a file are skipped, then the synthesized unit test is also " +"marked as skipped." +msgstr "" + +msgid "Pass one or more paths (as strings) to text files to be examined." +msgstr "" +"Передайте один або кілька шляхів (у вигляді рядків) до текстових файлів, які " +"потрібно перевірити." + +msgid "Options may be provided as keyword arguments:" +msgstr "Параметри можуть бути надані як аргументи ключових слів:" + +msgid "" +"Optional argument *module_relative* specifies how the filenames in *paths* " +"should be interpreted:" +msgstr "" +"Необов’язковий аргумент *module_relative* визначає, як слід інтерпретувати " +"назви файлів у *paths*:" + +msgid "" +"If *module_relative* is ``True`` (the default), then each filename in " +"*paths* specifies an OS-independent module-relative path. By default, this " +"path is relative to the calling module's directory; but if the *package* " +"argument is specified, then it is relative to that package. To ensure OS-" +"independence, each filename should use ``/`` characters to separate path " +"segments, and may not be an absolute path (i.e., it may not begin with ``/" +"``)." +msgstr "" +"Якщо *module_relative* має значення ``True`` (за замовчуванням), тоді кожне " +"ім’я файлу в *paths* визначає незалежний від ОС шлях щодо модуля. За " +"замовчуванням цей шлях є відносно каталогу викликаючого модуля; але якщо " +"вказано аргумент *package*, то він відноситься до цього пакета. Щоб " +"забезпечити незалежність від ОС, кожне ім’я файлу має використовувати " +"символи ``/`` для розділення сегментів шляху та не може бути абсолютним " +"шляхом (тобто воно не може починатися з ``/``)." + +msgid "" +"If *module_relative* is ``False``, then each filename in *paths* specifies " +"an OS-specific path. The path may be absolute or relative; relative paths " +"are resolved with respect to the current working directory." +msgstr "" +"Якщо *module_relative* має значення ``False``, тоді кожне ім’я файлу в " +"*paths* вказує шлях до ОС. Шлях може бути абсолютним або відносним; відносні " +"шляхи вирішуються відносно поточного робочого каталогу." + +msgid "" +"Optional argument *package* is a Python package or the name of a Python " +"package whose directory should be used as the base directory for module-" +"relative filenames in *paths*. If no package is specified, then the calling " +"module's directory is used as the base directory for module-relative " +"filenames. It is an error to specify *package* if *module_relative* is " +"``False``." +msgstr "" +"Необов’язковий аргумент *package* — це пакет Python або ім’я пакета Python, " +"чий каталог слід використовувати як базовий каталог для імен файлів, " +"пов’язаних із модулями, у *paths*. Якщо пакет не вказано, то каталог модуля, " +"що викликає, використовується як базовий каталог для імен файлів, що " +"відносяться до модуля. Це помилка вказувати *package*, якщо " +"*module_relative* має значення ``False``." + +msgid "" +"Optional argument *setUp* specifies a set-up function for the test suite. " +"This is called before running the tests in each file. The *setUp* function " +"will be passed a :class:`DocTest` object. The setUp function can access the " +"test globals as the *globs* attribute of the test passed." +msgstr "" +"Додатковий аргумент *setUp* визначає функцію налаштування для набору тестів. " +"Це викликається перед виконанням тестів у кожному файлі. Функції *setUp* " +"буде передано об’єкт :class:`DocTest`. Функція setUp може отримати доступ до " +"глобальних параметрів тесту як атрибута *globs* пройденого тесту." + +msgid "" +"Optional argument *tearDown* specifies a tear-down function for the test " +"suite. This is called after running the tests in each file. The *tearDown* " +"function will be passed a :class:`DocTest` object. The setUp function can " +"access the test globals as the *globs* attribute of the test passed." +msgstr "" +"Необов’язковий аргумент *tearDown* визначає функцію розриву для набору " +"тестів. Це викликається після виконання тестів у кожному файлі. Функції " +"*tearDown* буде передано об’єкт :class:`DocTest`. Функція setUp може " +"отримати доступ до глобальних параметрів тесту як атрибута *globs* " +"пройденого тесту." + +msgid "" +"Optional argument *globs* is a dictionary containing the initial global " +"variables for the tests. A new copy of this dictionary is created for each " +"test. By default, *globs* is a new empty dictionary." +msgstr "" +"Додатковий аргумент *globs* — це словник, що містить початкові глобальні " +"змінні для тестів. Для кожного тесту створюється нова копія цього словника. " +"За замовчуванням *globs* — це новий порожній словник." + +msgid "" +"Optional argument *optionflags* specifies the default doctest options for " +"the tests, created by or-ing together individual option flags. See section :" +"ref:`doctest-options`. See function :func:`set_unittest_reportflags` below " +"for a better way to set reporting options." +msgstr "" +"Необов’язковий аргумент *optionflags* вказує параметри тесту за " +"замовчуванням для тестів, створені шляхом об’єднання окремих прапорців " +"параметрів. Дивіться розділ :ref:`doctest-options`. Перегляньте функцію :" +"func:`set_unittest_reportflags` нижче, щоб дізнатися про кращий спосіб " +"налаштування параметрів звітування." + +msgid "" +"The global ``__file__`` is added to the globals provided to doctests loaded " +"from a text file using :func:`DocFileSuite`." +msgstr "" +"Глобальний ``__file__`` додається до глобалів, наданих до doctests, " +"завантажених із текстового файлу за допомогою :func:`DocFileSuite`." + +msgid "Convert doctest tests for a module to a :class:`unittest.TestSuite`." +msgstr "Перетворіть тести doctest для модуля на :class:`unittest.TestSuite`." + +msgid "" +"The returned :class:`unittest.TestSuite` is to be run by the unittest " +"framework and runs each doctest in the module. If any of the doctests fail, " +"then the synthesized unit test fails, and a :exc:`failureException` " +"exception is raised showing the name of the file containing the test and a " +"(sometimes approximate) line number. If all the examples in a docstring are " +"skipped, then the synthesized unit test is also marked as skipped." +msgstr "" + +msgid "" +"Optional argument *module* provides the module to be tested. It can be a " +"module object or a (possibly dotted) module name. If not specified, the " +"module calling this function is used." +msgstr "" +"Необов’язковий аргумент *module* надає модуль для тестування. Це може бути " +"об’єкт модуля або ім’я модуля (можливо з крапками). Якщо не вказано, " +"використовується модуль, який викликає цю функцію." + +msgid "" +"Optional argument *extraglobs* specifies an extra set of global variables, " +"which is merged into *globs*. By default, no extra globals are used." +msgstr "" +"Необов’язковий аргумент *extraglobs* визначає додатковий набір глобальних " +"змінних, який об’єднується в *globs*. За замовчуванням додаткові глобальні " +"значення не використовуються." + +msgid "" +"Optional argument *test_finder* is the :class:`DocTestFinder` object (or a " +"drop-in replacement) that is used to extract doctests from the module." +msgstr "" +"Необов’язковий аргумент *test_finder* — це об’єкт :class:`DocTestFinder` " +"(або замінник), який використовується для вилучення тестів документів із " +"модуля." + +msgid "" +"Optional arguments *setUp*, *tearDown*, and *optionflags* are the same as " +"for function :func:`DocFileSuite` above." +msgstr "" +"Необов’язкові аргументи *setUp*, *tearDown* і *optionflags* такі самі, як і " +"для функції :func:`DocFileSuite` вище." + +msgid "This function uses the same search technique as :func:`testmod`." +msgstr "Ця функція використовує ту саму техніку пошуку, що й :func:`testmod`." + +msgid "" +":func:`DocTestSuite` returns an empty :class:`unittest.TestSuite` if " +"*module* contains no docstrings instead of raising :exc:`ValueError`." +msgstr "" +":func:`DocTestSuite` повертає порожній :class:`unittest.TestSuite`, якщо " +"*module* не містить рядків документів, замість того, щоб викликати :exc:" +"`ValueError`." + +msgid "" +"When doctests which have been converted to unit tests by :func:" +"`DocFileSuite` or :func:`DocTestSuite` fail, this exception is raised " +"showing the name of the file containing the test and a (sometimes " +"approximate) line number." +msgstr "" + +msgid "" +"Under the covers, :func:`DocTestSuite` creates a :class:`unittest.TestSuite` " +"out of :class:`!doctest.DocTestCase` instances, and :class:`!DocTestCase` is " +"a subclass of :class:`unittest.TestCase`. :class:`!DocTestCase` isn't " +"documented here (it's an internal detail), but studying its code can answer " +"questions about the exact details of :mod:`unittest` integration." +msgstr "" + +msgid "" +"Similarly, :func:`DocFileSuite` creates a :class:`unittest.TestSuite` out " +"of :class:`!doctest.DocFileCase` instances, and :class:`!DocFileCase` is a " +"subclass of :class:`!DocTestCase`." +msgstr "" + +msgid "" +"So both ways of creating a :class:`unittest.TestSuite` run instances of :" +"class:`!DocTestCase`. This is important for a subtle reason: when you run :" +"mod:`doctest` functions yourself, you can control the :mod:`doctest` options " +"in use directly, by passing option flags to :mod:`doctest` functions. " +"However, if you're writing a :mod:`unittest` framework, :mod:`unittest` " +"ultimately controls when and how tests get run. The framework author " +"typically wants to control :mod:`doctest` reporting options (perhaps, e.g., " +"specified by command line options), but there's no way to pass options " +"through :mod:`unittest` to :mod:`doctest` test runners." +msgstr "" + +msgid "" +"For this reason, :mod:`doctest` also supports a notion of :mod:`doctest` " +"reporting flags specific to :mod:`unittest` support, via this function:" +msgstr "" +"З цієї причини :mod:`doctest` також підтримує поняття прапорів звітності :" +"mod:`doctest`, специфічних для підтримки :mod:`unittest`, через цю функцію:" + +msgid "Set the :mod:`doctest` reporting flags to use." +msgstr "Встановіть прапорці звітів :mod:`doctest` для використання." + +msgid "" +"Argument *flags* takes the :ref:`bitwise OR ` of option flags. See " +"section :ref:`doctest-options`. Only \"reporting flags\" can be used." +msgstr "" +"Аргумент *flags* приймає :ref:`побітове АБО ` прапорів параметрів. " +"Дивіться розділ :ref:`doctest-options`. Можна використовувати лише \"прапори " +"звітності\"." + +msgid "" +"This is a module-global setting, and affects all future doctests run by " +"module :mod:`unittest`: the :meth:`!runTest` method of :class:`!" +"DocTestCase` looks at the option flags specified for the test case when the :" +"class:`!DocTestCase` instance was constructed. If no reporting flags were " +"specified (which is the typical and expected case), :mod:`!doctest`'s :mod:" +"`unittest` reporting flags are :ref:`bitwise ORed ` into the option " +"flags, and the option flags so augmented are passed to the :class:" +"`DocTestRunner` instance created to run the doctest. If any reporting flags " +"were specified when the :class:`!DocTestCase` instance was constructed, :mod:" +"`!doctest`'s :mod:`unittest` reporting flags are ignored." +msgstr "" + +msgid "" +"The value of the :mod:`unittest` reporting flags in effect before the " +"function was called is returned by the function." +msgstr "" +"Функція повертає значення прапорів звітів :mod:`unittest`, які діяли до " +"виклику функції." + +msgid "Advanced API" +msgstr "Розширений API" + +msgid "" +"The basic API is a simple wrapper that's intended to make doctest easy to " +"use. It is fairly flexible, and should meet most users' needs; however, if " +"you require more fine-grained control over testing, or wish to extend " +"doctest's capabilities, then you should use the advanced API." +msgstr "" +"Основний API — це проста оболонка, призначена для полегшення використання " +"doctest. Він досить гнучкий і повинен відповідати потребам більшості " +"користувачів; однак, якщо вам потрібен більш детальний контроль над " +"тестуванням або ви бажаєте розширити можливості doctest, тоді вам слід " +"скористатися розширеним API." + +msgid "" +"The advanced API revolves around two container classes, which are used to " +"store the interactive examples extracted from doctest cases:" +msgstr "" +"Розширений API обертається навколо двох класів контейнерів, які " +"використовуються для зберігання інтерактивних прикладів, отриманих із " +"випадків doctest:" + +msgid "" +":class:`Example`: A single Python :term:`statement`, paired with its " +"expected output." +msgstr "" +":class:`Example`: один :term:`statement` Python у поєднанні з очікуваним " +"результатом." + +msgid "" +":class:`DocTest`: A collection of :class:`Example`\\ s, typically extracted " +"from a single docstring or text file." +msgstr "" +":class:`DocTest`: колекція :class:`Example`\\, зазвичай витягнутих з одного " +"рядка документа або текстового файлу." + +msgid "" +"Additional processing classes are defined to find, parse, and run, and check " +"doctest examples:" +msgstr "" +"Додаткові класи обробки визначені для пошуку, аналізу та запуску та " +"перевірки прикладів doctest:" + +msgid "" +":class:`DocTestFinder`: Finds all docstrings in a given module, and uses a :" +"class:`DocTestParser` to create a :class:`DocTest` from every docstring that " +"contains interactive examples." +msgstr "" +":class:`DocTestFinder`: знаходить усі рядки документів у певному модулі та " +"використовує :class:`DocTestParser` для створення :class:`DocTest` з кожного " +"рядка документів, який містить інтерактивні приклади." + +msgid "" +":class:`DocTestParser`: Creates a :class:`DocTest` object from a string " +"(such as an object's docstring)." +msgstr "" +":class:`DocTestParser`: створює об’єкт :class:`DocTest` із рядка (наприклад, " +"рядка документації об’єкта)." + +msgid "" +":class:`DocTestRunner`: Executes the examples in a :class:`DocTest`, and " +"uses an :class:`OutputChecker` to verify their output." +msgstr "" +":class:`DocTestRunner`: Виконує приклади в :class:`DocTest` і використовує :" +"class:`OutputChecker` для перевірки їх результату." + +msgid "" +":class:`OutputChecker`: Compares the actual output from a doctest example " +"with the expected output, and decides whether they match." +msgstr "" +":class:`OutputChecker`: порівнює фактичні результати прикладу doctest з " +"очікуваними результатами та вирішує, чи вони збігаються." + +msgid "" +"The relationships among these processing classes are summarized in the " +"following diagram::" +msgstr "Відносини між цими класами обробки підсумовано на наступній діаграмі:" + +msgid "" +" list of:\n" +"+------+ +---------+\n" +"|module| --DocTestFinder-> | DocTest | --DocTestRunner-> results\n" +"+------+ | ^ +---------+ | ^ (printed)\n" +" | | | Example | | |\n" +" v | | ... | v |\n" +" DocTestParser | Example | OutputChecker\n" +" +---------+" +msgstr "" + +msgid "DocTest Objects" +msgstr "Об’єкти DocTest" + +msgid "" +"A collection of doctest examples that should be run in a single namespace. " +"The constructor arguments are used to initialize the attributes of the same " +"names." +msgstr "" +"Набір прикладів doctest, які слід запускати в одному просторі імен. " +"Аргументи конструктора використовуються для ініціалізації однойменних " +"атрибутів." + +msgid "" +":class:`DocTest` defines the following attributes. They are initialized by " +"the constructor, and should not be modified directly." +msgstr "" +":class:`DocTest` визначає такі атрибути. Вони ініціалізуються конструктором " +"і не повинні змінюватися безпосередньо." + +msgid "" +"A list of :class:`Example` objects encoding the individual interactive " +"Python examples that should be run by this test." +msgstr "" +"Список об’єктів :class:`Example`, що кодують окремі інтерактивні приклади " +"Python, які мають виконуватися цим тестом." + +msgid "" +"The namespace (aka globals) that the examples should be run in. This is a " +"dictionary mapping names to values. Any changes to the namespace made by " +"the examples (such as binding new variables) will be reflected in :attr:" +"`globs` after the test is run." +msgstr "" +"Простір імен (він же глобальні), у якому слід запускати приклади. Це " +"словник, що зіставляє імена зі значеннями. Будь-які зміни в просторі імен, " +"внесені прикладами (такі як зв’язування нових змінних), будуть відображені " +"в :attr:`globs` після виконання тесту." + +msgid "" +"A string name identifying the :class:`DocTest`. Typically, this is the name " +"of the object or file that the test was extracted from." +msgstr "" +"Ім’я рядка, що ідентифікує :class:`DocTest`. Як правило, це ім'я об'єкта або " +"файлу, з якого було отримано тест." + +msgid "" +"The name of the file that this :class:`DocTest` was extracted from; or " +"``None`` if the filename is unknown, or if the :class:`DocTest` was not " +"extracted from a file." +msgstr "" +"Ім'я файлу, з якого було видобуто цей :class:`DocTest`; або ``None``, якщо " +"назва файлу невідома, або якщо :class:`DocTest` не було видобуто з файлу." + +msgid "" +"The line number within :attr:`filename` where this :class:`DocTest` begins, " +"or ``None`` if the line number is unavailable. This line number is zero-" +"based with respect to the beginning of the file." +msgstr "" +"Номер рядка в :attr:`filename`, де починається цей :class:`DocTest`, або " +"``None``, якщо номер рядка недоступний. Цей номер рядка відраховується від " +"нуля відносно початку файлу." + +msgid "" +"The string that the test was extracted from, or ``None`` if the string is " +"unavailable, or if the test was not extracted from a string." +msgstr "" +"Рядок, з якого було отримано тест, або ``None``, якщо рядок недоступний, або " +"якщо тест не було вилучено з рядка." + +msgid "Example Objects" +msgstr "Приклад об'єктів" + +msgid "" +"A single interactive example, consisting of a Python statement and its " +"expected output. The constructor arguments are used to initialize the " +"attributes of the same names." +msgstr "" +"Єдиний інтерактивний приклад, що складається з оператора Python і його " +"очікуваного результату. Аргументи конструктора використовуються для " +"ініціалізації однойменних атрибутів." + +msgid "" +":class:`Example` defines the following attributes. They are initialized by " +"the constructor, and should not be modified directly." +msgstr "" +":class:`Example` визначає такі атрибути. Вони ініціалізуються конструктором " +"і не повинні змінюватися безпосередньо." + +msgid "" +"A string containing the example's source code. This source code consists of " +"a single Python statement, and always ends with a newline; the constructor " +"adds a newline when necessary." +msgstr "" +"Рядок, що містить вихідний код прикладу. Цей вихідний код складається з " +"одного оператора Python і завжди закінчується символом нового рядка; " +"конструктор додає новий рядок, коли це необхідно." + +msgid "" +"The expected output from running the example's source code (either from " +"stdout, or a traceback in case of exception). :attr:`want` ends with a " +"newline unless no output is expected, in which case it's an empty string. " +"The constructor adds a newline when necessary." +msgstr "" +"Очікуваний результат запуску вихідного коду прикладу (або зі стандартного " +"виводу, або з відстеження у випадку винятку). :attr:`want` закінчується " +"символом нового рядка, якщо тільки вихід не очікується, у такому випадку це " +"порожній рядок. За потреби конструктор додає новий рядок." + +msgid "" +"The exception message generated by the example, if the example is expected " +"to generate an exception; or ``None`` if it is not expected to generate an " +"exception. This exception message is compared against the return value of :" +"func:`traceback.format_exception_only`. :attr:`exc_msg` ends with a newline " +"unless it's ``None``. The constructor adds a newline if needed." +msgstr "" +"Повідомлення про виняток, створене прикладом, якщо очікується, що приклад " +"створить виняток; або ``None``, якщо не очікується створення виняткової " +"ситуації. Це повідомлення про виняток порівнюється зі значенням, що " +"повертається :func:`traceback.format_exception_only`. :attr:`exc_msg` " +"закінчується символом нового рядка, якщо він не ``None``. За потреби " +"конструктор додає новий рядок." + +msgid "" +"The line number within the string containing this example where the example " +"begins. This line number is zero-based with respect to the beginning of the " +"containing string." +msgstr "" +"Номер рядка в рядку, що містить цей приклад, де починається приклад. Цей " +"номер рядка відраховується від нуля відносно початку рядка, що містить." + +msgid "" +"The example's indentation in the containing string, i.e., the number of " +"space characters that precede the example's first prompt." +msgstr "" +"Відступ прикладу в рядку, що містить, тобто кількість пробілів, які " +"передують першому запиту прикладу." + +msgid "" +"A dictionary mapping from option flags to ``True`` or ``False``, which is " +"used to override default options for this example. Any option flags not " +"contained in this dictionary are left at their default value (as specified " +"by the :class:`DocTestRunner`'s :ref:`optionflags `). By " +"default, no options are set." +msgstr "" + +msgid "DocTestFinder objects" +msgstr "Об’єкти DocTestFinder" + +msgid "" +"A processing class used to extract the :class:`DocTest`\\ s that are " +"relevant to a given object, from its docstring and the docstrings of its " +"contained objects. :class:`DocTest`\\ s can be extracted from modules, " +"classes, functions, methods, staticmethods, classmethods, and properties." +msgstr "" +"Клас обробки, який використовується для вилучення :class:`DocTest`\\ s, які " +"мають відношення до даного об’єкта, з його рядка документації та рядків " +"документації об’єктів, які містяться в ньому. :class:`DocTest`\\ s можна " +"отримати з модулів, класів, функцій, методів, статичних методів, методів " +"класів і властивостей." + +msgid "" +"The optional argument *verbose* can be used to display the objects searched " +"by the finder. It defaults to ``False`` (no output)." +msgstr "" +"Необов'язковий аргумент *verbose* можна використовувати для відображення " +"об'єктів, які шукав шукач. За замовчуванням значення False (без виведення)." + +msgid "" +"The optional argument *parser* specifies the :class:`DocTestParser` object " +"(or a drop-in replacement) that is used to extract doctests from docstrings." +msgstr "" +"Необов’язковий аргумент *parser* визначає об’єкт :class:`DocTestParser` (або " +"замінник), який використовується для вилучення тестів документів із рядків " +"документів." + +msgid "" +"If the optional argument *recurse* is false, then :meth:`DocTestFinder.find` " +"will only examine the given object, and not any contained objects." +msgstr "" +"Якщо необов’язковий аргумент *recurse* має значення false, тоді :meth:" +"`DocTestFinder.find` перевірятиме лише даний об’єкт, а не будь-які об’єкти, " +"що містяться." + +msgid "" +"If the optional argument *exclude_empty* is false, then :meth:`DocTestFinder." +"find` will include tests for objects with empty docstrings." +msgstr "" +"Якщо необов’язковий аргумент *exclude_empty* має значення false, тоді :meth:" +"`DocTestFinder.find` включатиме тести для об’єктів із порожніми рядками " +"документів." + +msgid ":class:`DocTestFinder` defines the following method:" +msgstr ":class:`DocTestFinder` визначає такий метод:" + +msgid "" +"Return a list of the :class:`DocTest`\\ s that are defined by *obj*'s " +"docstring, or by any of its contained objects' docstrings." +msgstr "" +"Повертає список :class:`DocTest`\\, які визначені рядком документації *obj* " +"або будь-якими рядками документів, що містяться в ньому." + +msgid "" +"The optional argument *name* specifies the object's name; this name will be " +"used to construct names for the returned :class:`DocTest`\\ s. If *name* is " +"not specified, then ``obj.__name__`` is used." +msgstr "" +"Необов'язковий аргумент *name* визначає ім'я об'єкта; це ім’я буде " +"використано для створення імен для повернутих :class:`DocTest`\\ s. Якщо " +"*name* не вказано, тоді використовується ``obj.__name__``." + +msgid "" +"The optional parameter *module* is the module that contains the given " +"object. If the module is not specified or is ``None``, then the test finder " +"will attempt to automatically determine the correct module. The object's " +"module is used:" +msgstr "" +"Необов’язковий параметр *module* — це модуль, який містить заданий об’єкт. " +"Якщо модуль не вказано або має значення ``None``, то засіб пошуку тестів " +"спробує автоматично визначити правильний модуль. Використовується модуль " +"об'єкта:" + +msgid "As a default namespace, if *globs* is not specified." +msgstr "Як простір імен за замовчуванням, якщо *globs* не вказано." + +msgid "" +"To prevent the DocTestFinder from extracting DocTests from objects that are " +"imported from other modules. (Contained objects with modules other than " +"*module* are ignored.)" +msgstr "" +"Щоб DocTestFinder не видобував DocTests з об’єктів, імпортованих з інших " +"модулів. (Об’єкти, що містяться з модулями, відмінними від *module*, " +"ігноруються.)" + +msgid "To find the name of the file containing the object." +msgstr "Щоб знайти ім'я файлу, що містить об'єкт." + +msgid "To help find the line number of the object within its file." +msgstr "Щоб допомогти знайти номер рядка об’єкта в його файлі." + +msgid "" +"If *module* is ``False``, no attempt to find the module will be made. This " +"is obscure, of use mostly in testing doctest itself: if *module* is " +"``False``, or is ``None`` but cannot be found automatically, then all " +"objects are considered to belong to the (non-existent) module, so all " +"contained objects will (recursively) be searched for doctests." +msgstr "" +"Якщо *module* має значення ``False``, спроба знайти модуль не буде зроблена. " +"Це незрозуміло, використовується переважно під час тестування самого " +"doctest: якщо *module* має значення ``False`` або ``None``, але не може бути " +"знайдено автоматично, тоді всі об’єкти вважаються такими, що належать до " +"(неіснуючого) модуль, тому всі об’єкти, що містяться, будуть (рекурсивно) " +"шукатися для тестів документів." + +msgid "" +"The globals for each :class:`DocTest` is formed by combining *globs* and " +"*extraglobs* (bindings in *extraglobs* override bindings in *globs*). A new " +"shallow copy of the globals dictionary is created for each :class:`DocTest`. " +"If *globs* is not specified, then it defaults to the module's *__dict__*, if " +"specified, or ``{}`` otherwise. If *extraglobs* is not specified, then it " +"defaults to ``{}``." +msgstr "" +"Глобальні значення для кожного :class:`DocTest` утворюються шляхом " +"об’єднання *globs* і *extraglobs* (прив’язки в *extraglobs* замінюють " +"прив’язки в *globs*). Для кожного :class:`DocTest` створюється нова копія " +"глобального словника. Якщо *globs* не вказано, тоді за замовчуванням " +"використовується *__dict__* модуля, якщо вказано, або ``{}`` інакше. Якщо " +"*extraglobs* не вказано, то за замовчуванням буде ``{}``." + +msgid "DocTestParser objects" +msgstr "Об’єкти DocTestParser" + +msgid "" +"A processing class used to extract interactive examples from a string, and " +"use them to create a :class:`DocTest` object." +msgstr "" +"Клас обробки, який використовується для отримання інтерактивних прикладів із " +"рядка та використання їх для створення об’єкта :class:`DocTest`." + +msgid ":class:`DocTestParser` defines the following methods:" +msgstr ":class:`DocTestParser` визначає такі методи:" + +msgid "" +"Extract all doctest examples from the given string, and collect them into a :" +"class:`DocTest` object." +msgstr "" +"Витягніть усі приклади doctest із заданого рядка та зберіть їх у об’єкт :" +"class:`DocTest`." + +msgid "" +"*globs*, *name*, *filename*, and *lineno* are attributes for the new :class:" +"`DocTest` object. See the documentation for :class:`DocTest` for more " +"information." +msgstr "" +"*globs*, *name*, *filename* і *lineno* є атрибутами для нового об’єкта :" +"class:`DocTest`. Перегляньте документацію для :class:`DocTest` для отримання " +"додаткової інформації." + +msgid "" +"Extract all doctest examples from the given string, and return them as a " +"list of :class:`Example` objects. Line numbers are 0-based. The optional " +"argument *name* is a name identifying this string, and is only used for " +"error messages." +msgstr "" +"Витягніть усі приклади doctest із заданого рядка та поверніть їх як список " +"об’єктів :class:`Example`. Номери рядків базуються на 0. Необов’язковий " +"аргумент *ім’я* – це ім’я, що ідентифікує цей рядок і використовується лише " +"для повідомлень про помилки." + +msgid "" +"Divide the given string into examples and intervening text, and return them " +"as a list of alternating :class:`Example`\\ s and strings. Line numbers for " +"the :class:`Example`\\ s are 0-based. The optional argument *name* is a " +"name identifying this string, and is only used for error messages." +msgstr "" +"Розділіть заданий рядок на приклади та проміжний текст і поверніть їх як " +"список чергування :class:`Example`\\ і рядків. Номери рядків для :class:" +"`Example`\\ s засновані на 0. Необов’язковий аргумент *ім’я* – це ім’я, що " +"ідентифікує цей рядок і використовується лише для повідомлень про помилки." + +msgid "TestResults objects" +msgstr "" + +msgid "Number of failed tests." +msgstr "" + +msgid "Number of attempted tests." +msgstr "" + +msgid "Number of skipped tests." +msgstr "" + +msgid "DocTestRunner objects" +msgstr "Об’єкти DocTestRunner" + +msgid "" +"A processing class used to execute and verify the interactive examples in a :" +"class:`DocTest`." +msgstr "" +"Клас обробки, який використовується для виконання та перевірки інтерактивних " +"прикладів у :class:`DocTest`." + +msgid "" +"The comparison between expected outputs and actual outputs is done by an :" +"class:`OutputChecker`. This comparison may be customized with a number of " +"option flags; see section :ref:`doctest-options` for more information. If " +"the option flags are insufficient, then the comparison may also be " +"customized by passing a subclass of :class:`OutputChecker` to the " +"constructor." +msgstr "" +"Порівняння очікуваних і фактичних результатів виконується за допомогою :" +"class:`OutputChecker`. Це порівняння можна налаштувати за допомогою кількох " +"позначок параметрів; дивіться розділ :ref:`doctest-options` для отримання " +"додаткової інформації. Якщо прапорців параметрів недостатньо, порівняння " +"також можна налаштувати, передавши підклас :class:`OutputChecker` до " +"конструктора." + +msgid "" +"The test runner's display output can be controlled in two ways. First, an " +"output function can be passed to :meth:`run`; this function will be called " +"with strings that should be displayed. It defaults to ``sys.stdout." +"write``. If capturing the output is not sufficient, then the display output " +"can be also customized by subclassing DocTestRunner, and overriding the " +"methods :meth:`report_start`, :meth:`report_success`, :meth:" +"`report_unexpected_exception`, and :meth:`report_failure`." +msgstr "" + +msgid "" +"The optional keyword argument *checker* specifies the :class:`OutputChecker` " +"object (or drop-in replacement) that should be used to compare the expected " +"outputs to the actual outputs of doctest examples." +msgstr "" +"Необов’язковий аргумент ключового слова *checker* визначає об’єкт :class:" +"`OutputChecker` (або додаткову заміну), який слід використовувати для " +"порівняння очікуваних результатів із фактичними результатами прикладів " +"doctest." + +msgid "" +"The optional keyword argument *verbose* controls the :class:" +"`DocTestRunner`'s verbosity. If *verbose* is ``True``, then information is " +"printed about each example, as it is run. If *verbose* is ``False``, then " +"only failures are printed. If *verbose* is unspecified, or ``None``, then " +"verbose output is used iff the command-line switch ``-v`` is used." +msgstr "" +"Додатковий аргумент ключового слова *verbose* контролює докладність :class:" +"`DocTestRunner`. Якщо *verbose* має значення ``True``, тоді друкується " +"інформація про кожен приклад під час його виконання. Якщо *verbose* має " +"значення ``False``, друкуються лише помилки. Якщо *verbose* не вказано або " +"``None``, тоді використовується докладний вивід, якщо використовується " +"параметр командного рядка ``-v``." + +msgid "" +"The optional keyword argument *optionflags* can be used to control how the " +"test runner compares expected output to actual output, and how it displays " +"failures. For more information, see section :ref:`doctest-options`." +msgstr "" +"Необов’язковий аргумент ключового слова *optionflags* можна використовувати " +"для керування тим, як програма виконання тестів порівнює очікуваний " +"результат із фактичним результатом і як він відображає помилки. Для " +"отримання додаткової інформації див. розділ :ref:`doctest-options`." + +msgid "" +"The test runner accumulates statistics. The aggregated number of attempted, " +"failed and skipped examples is also available via the :attr:`tries`, :attr:" +"`failures` and :attr:`skips` attributes. The :meth:`run` and :meth:" +"`summarize` methods return a :class:`TestResults` instance." +msgstr "" + +msgid ":class:`DocTestRunner` defines the following methods:" +msgstr "" + +msgid "" +"Report that the test runner is about to process the given example. This " +"method is provided to allow subclasses of :class:`DocTestRunner` to " +"customize their output; it should not be called directly." +msgstr "" +"Повідомте, що тестувальник збирається обробити наведений приклад. Цей метод " +"надається, щоб дозволити підкласам :class:`DocTestRunner` налаштовувати свій " +"вихід; його не слід називати безпосередньо." + +msgid "" +"*example* is the example about to be processed. *test* is the test " +"*containing example*. *out* is the output function that was passed to :meth:" +"`DocTestRunner.run`." +msgstr "" +"*приклад* — це приклад, який буде оброблено. *тест* — це тест, який *містить " +"приклад*. *out* — це функція виводу, яка була передана в :meth:" +"`DocTestRunner.run`." + +msgid "" +"Report that the given example ran successfully. This method is provided to " +"allow subclasses of :class:`DocTestRunner` to customize their output; it " +"should not be called directly." +msgstr "" +"Повідомте, що наведений приклад виконано успішно. Цей метод надається, щоб " +"дозволити підкласам :class:`DocTestRunner` налаштовувати свій вихід; його не " +"слід називати безпосередньо." + +msgid "" +"*example* is the example about to be processed. *got* is the actual output " +"from the example. *test* is the test containing *example*. *out* is the " +"output function that was passed to :meth:`DocTestRunner.run`." +msgstr "" +"*приклад* — це приклад, який буде оброблено. *got* — фактичний вихід із " +"прикладу. *тест* — це тест, що містить *приклад*. *out* — це функція виводу, " +"яка була передана в :meth:`DocTestRunner.run`." + +msgid "" +"Report that the given example failed. This method is provided to allow " +"subclasses of :class:`DocTestRunner` to customize their output; it should " +"not be called directly." +msgstr "" +"Повідомте, що наведений приклад не вдався. Цей метод надається, щоб " +"дозволити підкласам :class:`DocTestRunner` налаштовувати свій вихід; його не " +"слід називати безпосередньо." + +msgid "" +"Report that the given example raised an unexpected exception. This method is " +"provided to allow subclasses of :class:`DocTestRunner` to customize their " +"output; it should not be called directly." +msgstr "" +"Повідомте, що наведений приклад викликав несподіваний виняток. Цей метод " +"надається, щоб дозволити підкласам :class:`DocTestRunner` налаштовувати свій " +"вихід; його не слід називати безпосередньо." + +msgid "" +"*example* is the example about to be processed. *exc_info* is a tuple " +"containing information about the unexpected exception (as returned by :func:" +"`sys.exc_info`). *test* is the test containing *example*. *out* is the " +"output function that was passed to :meth:`DocTestRunner.run`." +msgstr "" +"*приклад* — це приклад, який буде оброблено. *exc_info* — це кортеж, що " +"містить інформацію про неочікуваний виняток (як повертає :func:`sys." +"exc_info`). *тест* — це тест, що містить *приклад*. *out* — це функція " +"виводу, яка була передана в :meth:`DocTestRunner.run`." + +msgid "" +"Run the examples in *test* (a :class:`DocTest` object), and display the " +"results using the writer function *out*. Return a :class:`TestResults` " +"instance." +msgstr "" + +msgid "" +"The examples are run in the namespace ``test.globs``. If *clear_globs* is " +"true (the default), then this namespace will be cleared after the test runs, " +"to help with garbage collection. If you would like to examine the namespace " +"after the test completes, then use *clear_globs=False*." +msgstr "" +"Приклади запускаються в просторі імен ``test.globs``. Якщо *clear_globs* має " +"значення true (за замовчуванням), цей простір імен буде очищено після " +"виконання тесту, щоб допомогти зі збиранням сміття. Якщо ви хочете " +"перевірити простір імен після завершення тесту, використовуйте " +"*clear_globs=False*." + +msgid "" +"*compileflags* gives the set of flags that should be used by the Python " +"compiler when running the examples. If not specified, then it will default " +"to the set of future-import flags that apply to *globs*." +msgstr "" +"*compileflags* надає набір прапорів, які має використовувати компілятор " +"Python під час виконання прикладів. Якщо не вказано, за замовчуванням " +"використовуватиметься набір прапорів майбутнього імпорту, які застосовуються " +"до *globs*." + +msgid "" +"The output of each example is checked using the :class:`DocTestRunner`'s " +"output checker, and the results are formatted by the :meth:`!DocTestRunner." +"report_\\*` methods." +msgstr "" + +msgid "" +"Print a summary of all the test cases that have been run by this " +"DocTestRunner, and return a :class:`TestResults` instance." +msgstr "" + +msgid "" +"The optional *verbose* argument controls how detailed the summary is. If " +"the verbosity is not specified, then the :class:`DocTestRunner`'s verbosity " +"is used." +msgstr "" +"Необов’язковий аргумент *verbose* контролює, наскільки детальним є резюме. " +"Якщо детальність не вказана, тоді використовується детальність :class:" +"`DocTestRunner`." + +msgid ":class:`DocTestParser` has the following attributes:" +msgstr "" + +msgid "Number of attempted examples." +msgstr "" + +msgid "Number of failed examples." +msgstr "" + +msgid "Number of skipped examples." +msgstr "" + +msgid "OutputChecker objects" +msgstr "Об'єкти OutputChecker" + +msgid "" +"A class used to check the whether the actual output from a doctest example " +"matches the expected output. :class:`OutputChecker` defines two methods: :" +"meth:`check_output`, which compares a given pair of outputs, and returns " +"``True`` if they match; and :meth:`output_difference`, which returns a " +"string describing the differences between two outputs." +msgstr "" +"Клас, який використовується для перевірки того, чи фактичний результат із " +"прикладу doctest відповідає очікуваному результату. :class:`OutputChecker` " +"визначає два методи: :meth:`check_output`, який порівнює задану пару виходів " +"і повертає ``True``, якщо вони збігаються; і :meth:`output_difference`, який " +"повертає рядок, що описує різницю між двома результатами." + +msgid ":class:`OutputChecker` defines the following methods:" +msgstr ":class:`OutputChecker` визначає такі методи:" + +msgid "" +"Return ``True`` iff the actual output from an example (*got*) matches the " +"expected output (*want*). These strings are always considered to match if " +"they are identical; but depending on what option flags the test runner is " +"using, several non-exact match types are also possible. See section :ref:" +"`doctest-options` for more information about option flags." +msgstr "" +"Повертає ``True``, якщо фактичний результат із прикладу (*got*) відповідає " +"очікуваному результату (*want*). Ці рядки завжди вважаються такими, що " +"збігаються, якщо вони ідентичні; але залежно від того, які прапорці " +"параметрів використовує програма виконання тестів, також можливі кілька " +"типів неточної відповідності. Перегляньте розділ :ref:`doctest-options` для " +"отримання додаткової інформації про прапорці параметрів." + +msgid "" +"Return a string describing the differences between the expected output for a " +"given example (*example*) and the actual output (*got*). *optionflags* is " +"the set of option flags used to compare *want* and *got*." +msgstr "" +"Повертає рядок, що описує відмінності між очікуваним виходом для даного " +"прикладу (*example*) і фактичним виходом (*got*). *optionflags* — це набір " +"позначок параметрів, які використовуються для порівняння *want* і *got*." + +msgid "Debugging" +msgstr "Налагодження" + +msgid "Doctest provides several mechanisms for debugging doctest examples:" +msgstr "Doctest надає кілька механізмів для налагодження прикладів doctest:" + +msgid "" +"Several functions convert doctests to executable Python programs, which can " +"be run under the Python debugger, :mod:`pdb`." +msgstr "" +"Декілька функцій перетворюють doctests на виконувані програми Python, які " +"можна запускати в налагоджувачі Python, :mod:`pdb`." + +msgid "" +"The :class:`DebugRunner` class is a subclass of :class:`DocTestRunner` that " +"raises an exception for the first failing example, containing information " +"about that example. This information can be used to perform post-mortem " +"debugging on the example." +msgstr "" +"Клас :class:`DebugRunner` є підкласом :class:`DocTestRunner`, який створює " +"виняток для першого невдалого прикладу, що містить інформацію про цей " +"приклад. Ця інформація може бути використана для виконання посмертного " +"налагодження на прикладі." + +msgid "" +"The :mod:`unittest` cases generated by :func:`DocTestSuite` support the :" +"meth:`debug` method defined by :class:`unittest.TestCase`." +msgstr "" +"Випадки :mod:`unittest`, згенеровані :func:`DocTestSuite`, підтримують " +"метод :meth:`debug`, визначений :class:`unittest.TestCase`." + +msgid "" +"You can add a call to :func:`pdb.set_trace` in a doctest example, and you'll " +"drop into the Python debugger when that line is executed. Then you can " +"inspect current values of variables, and so on. For example, suppose :file:" +"`a.py` contains just this module docstring::" +msgstr "" +"Ви можете додати виклик до :func:`pdb.set_trace` у прикладі doctest, і ви " +"перейдете до налагоджувача Python, коли цей рядок буде виконано. Потім ви " +"можете перевірити поточні значення змінних і так далі. Наприклад, " +"припустимо, що :file:`a.py` містить лише цей модуль docstring::" + +msgid "" +"\"\"\"\n" +">>> def f(x):\n" +"... g(x*2)\n" +">>> def g(x):\n" +"... print(x+3)\n" +"... import pdb; pdb.set_trace()\n" +">>> f(3)\n" +"9\n" +"\"\"\"" +msgstr "" + +msgid "Then an interactive Python session may look like this::" +msgstr "Тоді інтерактивний сеанс Python може виглядати так:" + +msgid "" +">>> import a, doctest\n" +">>> doctest.testmod(a)\n" +"--Return--\n" +"> (3)g()->None\n" +"-> import pdb; pdb.set_trace()\n" +"(Pdb) list\n" +" 1 def g(x):\n" +" 2 print(x+3)\n" +" 3 -> import pdb; pdb.set_trace()\n" +"[EOF]\n" +"(Pdb) p x\n" +"6\n" +"(Pdb) step\n" +"--Return--\n" +"> (2)f()->None\n" +"-> g(x*2)\n" +"(Pdb) list\n" +" 1 def f(x):\n" +" 2 -> g(x*2)\n" +"[EOF]\n" +"(Pdb) p x\n" +"3\n" +"(Pdb) step\n" +"--Return--\n" +"> (1)?()->None\n" +"-> f(3)\n" +"(Pdb) cont\n" +"(0, 3)\n" +">>>" +msgstr "" + +msgid "" +"Functions that convert doctests to Python code, and possibly run the " +"synthesized code under the debugger:" +msgstr "" +"Функції, які перетворюють doctests на код Python і, можливо, запускають " +"синтезований код під налагоджувачем:" + +msgid "Convert text with examples to a script." +msgstr "Перетворення тексту з прикладами на сценарій." + +msgid "" +"Argument *s* is a string containing doctest examples. The string is " +"converted to a Python script, where doctest examples in *s* are converted to " +"regular code, and everything else is converted to Python comments. The " +"generated script is returned as a string. For example, ::" +msgstr "" +"Аргумент *s* — це рядок, що містить приклади doctest. Рядок перетворюється " +"на сценарій Python, де приклади doctest у *s* перетворюються на звичайний " +"код, а все інше перетворюється на коментарі Python. Згенерований сценарій " +"повертається як рядок. Наприклад, ::" + +msgid "" +"import doctest\n" +"print(doctest.script_from_examples(r\"\"\"\n" +" Set x and y to 1 and 2.\n" +" >>> x, y = 1, 2\n" +"\n" +" Print their sum:\n" +" >>> print(x+y)\n" +" 3\n" +"\"\"\"))" +msgstr "" + +msgid "displays::" +msgstr "дисплеї::" + +msgid "" +"# Set x and y to 1 and 2.\n" +"x, y = 1, 2\n" +"#\n" +"# Print their sum:\n" +"print(x+y)\n" +"# Expected:\n" +"## 3" +msgstr "" + +msgid "" +"This function is used internally by other functions (see below), but can " +"also be useful when you want to transform an interactive Python session into " +"a Python script." +msgstr "" +"Ця функція використовується внутрішньо іншими функціями (див. нижче), але " +"також може бути корисною, коли ви хочете перетворити інтерактивний сеанс " +"Python на сценарій Python." + +msgid "Convert the doctest for an object to a script." +msgstr "Перетворення doctest для об’єкта на сценарій." + +msgid "" +"Argument *module* is a module object, or dotted name of a module, containing " +"the object whose doctests are of interest. Argument *name* is the name " +"(within the module) of the object with the doctests of interest. The result " +"is a string, containing the object's docstring converted to a Python script, " +"as described for :func:`script_from_examples` above. For example, if " +"module :file:`a.py` contains a top-level function :func:`!f`, then ::" +msgstr "" + +msgid "" +"import a, doctest\n" +"print(doctest.testsource(a, \"a.f\"))" +msgstr "" + +msgid "" +"prints a script version of function :func:`!f`'s docstring, with doctests " +"converted to code, and the rest placed in comments." +msgstr "" + +msgid "Debug the doctests for an object." +msgstr "Налагодження документів для об’єкта." + +msgid "" +"The *module* and *name* arguments are the same as for function :func:" +"`testsource` above. The synthesized Python script for the named object's " +"docstring is written to a temporary file, and then that file is run under " +"the control of the Python debugger, :mod:`pdb`." +msgstr "" +"Аргументи *module* і *name* такі самі, як і для функції :func:`testsource` " +"вище. Синтезований сценарій Python для рядка документації названого об’єкта " +"записується у тимчасовий файл, а потім цей файл запускається під керуванням " +"налагоджувача Python, :mod:`pdb`." + +msgid "" +"A shallow copy of ``module.__dict__`` is used for both local and global " +"execution context." +msgstr "" +"Поверхнева копія ``module.__dict__`` використовується як для локального, так " +"і для глобального контексту виконання." + +msgid "" +"Optional argument *pm* controls whether post-mortem debugging is used. If " +"*pm* has a true value, the script file is run directly, and the debugger " +"gets involved only if the script terminates via raising an unhandled " +"exception. If it does, then post-mortem debugging is invoked, via :func:" +"`pdb.post_mortem`, passing the traceback object from the unhandled " +"exception. If *pm* is not specified, or is false, the script is run under " +"the debugger from the start, via passing an appropriate :func:`exec` call " +"to :func:`pdb.run`." +msgstr "" +"Додатковий аргумент *pm* визначає, чи використовується посмертне " +"налагодження. Якщо *pm* має значення true, файл сценарію запускається " +"безпосередньо, і налагоджувач бере участь лише в тому випадку, якщо сценарій " +"завершується через виклик необробленого винятку. Якщо це так, то через :func:" +"`pdb.post_mortem` викликається посмертне налагодження, передаючи об’єкт " +"трасування з необробленого винятку. Якщо *pm* не вказано або має значення " +"false, сценарій запускається під налагоджувачем із самого початку, шляхом " +"передачі відповідного виклику :func:`exec` до :func:`pdb.run`." + +msgid "Debug the doctests in a string." +msgstr "Налагодити doctests у рядку." + +msgid "" +"This is like function :func:`debug` above, except that a string containing " +"doctest examples is specified directly, via the *src* argument." +msgstr "" +"Це схоже на функцію :func:`debug` вище, за винятком того, що рядок, що " +"містить приклади doctest, вказується безпосередньо через аргумент *src*." + +msgid "" +"Optional argument *pm* has the same meaning as in function :func:`debug` " +"above." +msgstr "" +"Необов’язковий аргумент *pm* має те саме значення, що й у функції :func:" +"`debug` вище." + +msgid "" +"Optional argument *globs* gives a dictionary to use as both local and global " +"execution context. If not specified, or ``None``, an empty dictionary is " +"used. If specified, a shallow copy of the dictionary is used." +msgstr "" +"Необов’язковий аргумент *globs* надає словник для використання як " +"локального, так і глобального контексту виконання. Якщо не вказано або " +"``None``, використовується порожній словник. Якщо вказано, використовується " +"неглибока копія словника." + +msgid "" +"The :class:`DebugRunner` class, and the special exceptions it may raise, are " +"of most interest to testing framework authors, and will only be sketched " +"here. See the source code, and especially :class:`DebugRunner`'s docstring " +"(which is a doctest!) for more details:" +msgstr "" +"Клас :class:`DebugRunner` і спеціальні винятки, які він може спричинити, " +"представляють найбільший інтерес для авторів фреймворку тестування, і тут " +"буде лише схематично описано. Перегляньте вихідний код, а особливо рядок " +"документації :class:`DebugRunner` (який є тестом документів!) для отримання " +"додаткової інформації:" + +msgid "" +"A subclass of :class:`DocTestRunner` that raises an exception as soon as a " +"failure is encountered. If an unexpected exception occurs, an :exc:" +"`UnexpectedException` exception is raised, containing the test, the example, " +"and the original exception. If the output doesn't match, then a :exc:" +"`DocTestFailure` exception is raised, containing the test, the example, and " +"the actual output." +msgstr "" +"Підклас :class:`DocTestRunner`, який викликає виняток, щойно виникає " +"помилка. Якщо виникає неочікуваний виняток, виникає виняток :exc:" +"`UnexpectedException`, який містить тест, приклад і оригінальний виняток. " +"Якщо вихідні дані не збігаються, то виникає виняток :exc:`DocTestFailure`, " +"який містить тест, приклад і фактичний результат." + +msgid "" +"For information about the constructor parameters and methods, see the " +"documentation for :class:`DocTestRunner` in section :ref:`doctest-advanced-" +"api`." +msgstr "" +"Щоб отримати інформацію про параметри та методи конструктора, перегляньте " +"документацію для :class:`DocTestRunner` у розділі :ref:`doctest-advanced-" +"api`." + +msgid "" +"There are two exceptions that may be raised by :class:`DebugRunner` " +"instances:" +msgstr "" +"Є два винятки, які можуть бути викликані екземплярами :class:`DebugRunner`:" + +msgid "" +"An exception raised by :class:`DocTestRunner` to signal that a doctest " +"example's actual output did not match its expected output. The constructor " +"arguments are used to initialize the attributes of the same names." +msgstr "" +"Виняток, викликаний :class:`DocTestRunner`, щоб повідомити, що фактичний " +"вихід прикладу doctest не збігається з його очікуваним результатом. " +"Аргументи конструктора використовуються для ініціалізації однойменних " +"атрибутів." + +msgid ":exc:`DocTestFailure` defines the following attributes:" +msgstr ":exc:`DocTestFailure` визначає такі атрибути:" + +msgid "The :class:`DocTest` object that was being run when the example failed." +msgstr "Об’єкт :class:`DocTest`, який запускався під час помилки прикладу." + +msgid "The :class:`Example` that failed." +msgstr "Невдалий :class:`Example`." + +msgid "The example's actual output." +msgstr "Фактичний результат прикладу." + +msgid "" +"An exception raised by :class:`DocTestRunner` to signal that a doctest " +"example raised an unexpected exception. The constructor arguments are used " +"to initialize the attributes of the same names." +msgstr "" +"Виняток, викликаний :class:`DocTestRunner`, щоб сигналізувати про те, що " +"приклад doctest викликав неочікуваний виняток. Аргументи конструктора " +"використовуються для ініціалізації однойменних атрибутів." + +msgid ":exc:`UnexpectedException` defines the following attributes:" +msgstr ":exc:`UnexpectedException` визначає такі атрибути:" + +msgid "" +"A tuple containing information about the unexpected exception, as returned " +"by :func:`sys.exc_info`." +msgstr "" +"Кортеж, що містить інформацію про неочікуваний виняток, яку повертає :func:" +"`sys.exc_info`." + +msgid "Soapbox" +msgstr "Мильниця" + +msgid "" +"As mentioned in the introduction, :mod:`doctest` has grown to have three " +"primary uses:" +msgstr "" +"Як згадувалося у вступі, :mod:`doctest` зріс до трьох основних застосувань:" + +msgid "Checking examples in docstrings." +msgstr "Перевірка прикладів у рядках документів." + +msgid "Regression testing." +msgstr "Регресійне тестування." + +msgid "Executable documentation / literate testing." +msgstr "Виконувана документація / грамотне тестування." + +msgid "" +"These uses have different requirements, and it is important to distinguish " +"them. In particular, filling your docstrings with obscure test cases makes " +"for bad documentation." +msgstr "" +"Ці види використання мають різні вимоги, і їх важливо розрізняти. Зокрема, " +"заповнення ваших рядків документації незрозумілими тестовими прикладами " +"створює погану документацію." + +msgid "" +"When writing a docstring, choose docstring examples with care. There's an " +"art to this that needs to be learned---it may not be natural at first. " +"Examples should add genuine value to the documentation. A good example can " +"often be worth many words. If done with care, the examples will be " +"invaluable for your users, and will pay back the time it takes to collect " +"them many times over as the years go by and things change. I'm still amazed " +"at how often one of my :mod:`doctest` examples stops working after a " +"\"harmless\" change." +msgstr "" +"Під час написання документаційного рядка обережно вибирайте приклади " +"документаційного рядка. У цьому є певне мистецтво, якому потрібно навчитися " +"--- спочатку це може бути неприродним. Приклади повинні додати справжню " +"цінність документації. Хороший приклад часто вартий багатьох слів. Якщо їх " +"робити обережно, приклади будуть безцінні для ваших користувачів і " +"багаторазово окуплять час, потрачений на їх збирання, оскільки роки йдуть і " +"все змінюється. Мене все ще дивує, як часто один із моїх прикладів :mod:" +"`doctest` перестає працювати після \"нешкідливої\" зміни." + +msgid "" +"Doctest also makes an excellent tool for regression testing, especially if " +"you don't skimp on explanatory text. By interleaving prose and examples, it " +"becomes much easier to keep track of what's actually being tested, and why. " +"When a test fails, good prose can make it much easier to figure out what the " +"problem is, and how it should be fixed. It's true that you could write " +"extensive comments in code-based testing, but few programmers do. Many have " +"found that using doctest approaches instead leads to much clearer tests. " +"Perhaps this is simply because doctest makes writing prose a little easier " +"than writing code, while writing comments in code is a little harder. I " +"think it goes deeper than just that: the natural attitude when writing a " +"doctest-based test is that you want to explain the fine points of your " +"software, and illustrate them with examples. This in turn naturally leads to " +"test files that start with the simplest features, and logically progress to " +"complications and edge cases. A coherent narrative is the result, instead " +"of a collection of isolated functions that test isolated bits of " +"functionality seemingly at random. It's a different attitude, and produces " +"different results, blurring the distinction between testing and explaining." +msgstr "" +"Doctest також є чудовим інструментом для регресійного тестування, особливо " +"якщо ви не економите на пояснювальному тексті. Перемежовуючи прозу та " +"приклади, стає набагато легше відслідковувати, що насправді перевіряється та " +"чому. Якщо тест провалився, хороша проза може значно полегшити з’ясування " +"проблеми та способи її вирішення. Це правда, що ви можете писати розгорнуті " +"коментарі під час тестування на основі коду, але мало хто з програмістів це " +"робить. Багато хто виявив, що використання підходів doctest натомість " +"призводить до набагато чіткіших тестів. Можливо, це просто тому, що doctest " +"робить написання прози трохи легшим, ніж написання коду, тоді як писати " +"коментарі в коді трохи складніше. Я думаю, що це глибше, ніж просто це: " +"природне ставлення до написання тесту на основі doctest полягає в тому, що " +"ви хочете пояснити тонкощі свого програмного забезпечення та проілюструвати " +"їх прикладами. Це, у свою чергу, природним чином призводить до тестових " +"файлів, які починаються з найпростіших функцій і логічно прогресують до " +"ускладнень і крайніх випадків. Результатом є послідовна розповідь, а не " +"набір ізольованих функцій, які перевіряють окремі фрагменти " +"функціональності, здавалося б, випадковим чином. Це інше ставлення, яке дає " +"інші результати, стираючи різницю між тестуванням і поясненням." + +msgid "" +"Regression testing is best confined to dedicated objects or files. There " +"are several options for organizing tests:" +msgstr "" +"Регресійне тестування найкраще обмежити виділеними об’єктами або файлами. Є " +"кілька варіантів організації тестів:" + +msgid "" +"Write text files containing test cases as interactive examples, and test the " +"files using :func:`testfile` or :func:`DocFileSuite`. This is recommended, " +"although is easiest to do for new projects, designed from the start to use " +"doctest." +msgstr "" +"Напишіть текстові файли, що містять тестові приклади як інтерактивні " +"приклади, і протестуйте файли за допомогою :func:`testfile` або :func:" +"`DocFileSuite`. Це рекомендовано, хоча це найлегше зробити для нових " +"проектів, розроблених із самого початку для використання doctest." + +msgid "" +"Define functions named ``_regrtest_topic`` that consist of single " +"docstrings, containing test cases for the named topics. These functions can " +"be included in the same file as the module, or separated out into a separate " +"test file." +msgstr "" +"Визначте функції під назвою ``_regrtest_topic``, які складаються з окремих " +"рядків документів, що містять тестові випадки для названих тем. Ці функції " +"можна включити в той самий файл, що й модуль, або відокремити в окремий " +"тестовий файл." + +msgid "" +"Define a ``__test__`` dictionary mapping from regression test topics to " +"docstrings containing test cases." +msgstr "" +"Визначте зіставлення словника ``__test__`` із тем регресійних тестів на " +"рядки документів, що містять тестові приклади." + +msgid "" +"When you have placed your tests in a module, the module can itself be the " +"test runner. When a test fails, you can arrange for your test runner to re-" +"run only the failing doctest while you debug the problem. Here is a minimal " +"example of such a test runner::" +msgstr "" +"Якщо ви розмістили свої тести в модулі, модуль сам може бути виконавцем " +"тестів. Коли тест виходить невдалим, ви можете організувати повторний запуск " +"лише невдалого документу, поки ви вирішуєте проблему. Ось мінімальний " +"приклад такого тесту:" + +msgid "" +"if __name__ == '__main__':\n" +" import doctest\n" +" flags = doctest.REPORT_NDIFF|doctest.FAIL_FAST\n" +" if len(sys.argv) > 1:\n" +" name = sys.argv[1]\n" +" if name in globals():\n" +" obj = globals()[name]\n" +" else:\n" +" obj = __test__[name]\n" +" doctest.run_docstring_examples(obj, globals(), name=name,\n" +" optionflags=flags)\n" +" else:\n" +" fail, total = doctest.testmod(optionflags=flags)\n" +" print(f\"{fail} failures out of {total} tests\")" +msgstr "" + +msgid "Footnotes" +msgstr "Виноски" + +msgid "" +"Examples containing both expected output and an exception are not supported. " +"Trying to guess where one ends and the other begins is too error-prone, and " +"that also makes for a confusing test." +msgstr "" +"Приклади, що містять як очікуваний результат, так і виняток, не " +"підтримуються. Спроба вгадати, де закінчується один і починається інший, " +"занадто схильна до помилок, і це також створює заплутаний тест." + +msgid ">>>" +msgstr "" + +msgid "interpreter prompt" +msgstr "" + +msgid "..." +msgstr "" + +msgid "^ (caret)" +msgstr "" + +msgid "marker" +msgstr "" + +msgid "" +msgstr "" + +msgid "in doctests" +msgstr "" + +msgid "# (hash)" +msgstr "# (хеш)" + +msgid "+ (plus)" +msgstr "" + +msgid "- (minus)" +msgstr "- (мінус)" diff --git a/library/email.po b/library/email.po new file mode 100644 index 000000000..f884ea70e --- /dev/null +++ b/library/email.po @@ -0,0 +1,249 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 01:05+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!email` --- An email and MIME handling package" +msgstr "" + +msgid "**Source code:** :source:`Lib/email/__init__.py`" +msgstr "**Вихідний код:** :source:`Lib/email/__init__.py`" + +msgid "" +"The :mod:`email` package is a library for managing email messages. It is " +"specifically *not* designed to do any sending of email messages to SMTP (:" +"rfc:`2821`), NNTP, or other servers; those are functions of modules such as :" +"mod:`smtplib`. The :mod:`email` package attempts to be as RFC-compliant as " +"possible, supporting :rfc:`5322` and :rfc:`6532`, as well as such MIME-" +"related RFCs as :rfc:`2045`, :rfc:`2046`, :rfc:`2047`, :rfc:`2183`, and :rfc:" +"`2231`." +msgstr "" + +msgid "" +"The overall structure of the email package can be divided into three major " +"components, plus a fourth component that controls the behavior of the other " +"components." +msgstr "" +"Загальну структуру пакета електронної пошти можна розділити на три основні " +"компоненти, плюс четвертий компонент, який контролює поведінку інших " +"компонентів." + +msgid "" +"The central component of the package is an \"object model\" that represents " +"email messages. An application interacts with the package primarily through " +"the object model interface defined in the :mod:`~email.message` sub-module. " +"The application can use this API to ask questions about an existing email, " +"to construct a new email, or to add or remove email subcomponents that " +"themselves use the same object model interface. That is, following the " +"nature of email messages and their MIME subcomponents, the email object " +"model is a tree structure of objects that all provide the :class:`~email." +"message.EmailMessage` API." +msgstr "" +"Центральним компонентом пакету є \"об’єктна модель\", яка представляє " +"повідомлення електронної пошти. Програма взаємодіє з пакетом переважно через " +"інтерфейс об’єктної моделі, визначений у підмодулі :mod:`~email.message`. " +"Програма може використовувати цей API, щоб ставити запитання щодо наявного " +"електронного листа, створювати новий електронний лист або додавати чи " +"видаляти підкомпоненти електронної пошти, які самі використовують той самий " +"інтерфейс об’єктної моделі. Тобто, відповідно до природи повідомлень " +"електронної пошти та їхніх підкомпонентів MIME, об’єктна модель електронної " +"пошти є деревовидною структурою об’єктів, усі з яких забезпечують API :class:" +"`~email.message.EmailMessage`." + +msgid "" +"The other two major components of the package are the :mod:`~email.parser` " +"and the :mod:`~email.generator`. The parser takes the serialized version of " +"an email message (a stream of bytes) and converts it into a tree of :class:" +"`~email.message.EmailMessage` objects. The generator takes an :class:" +"`~email.message.EmailMessage` and turns it back into a serialized byte " +"stream. (The parser and generator also handle streams of text characters, " +"but this usage is discouraged as it is too easy to end up with messages that " +"are not valid in one way or another.)" +msgstr "" +"Двома іншими основними компонентами пакета є :mod:`~email.parser` і :mod:" +"`~email.generator`. Синтаксичний аналізатор бере серіалізовану версію " +"повідомлення електронної пошти (потік байтів) і перетворює його на дерево " +"об’єктів :class:`~email.message.EmailMessage`. Генератор приймає :class:" +"`~email.message.EmailMessage` і перетворює його назад на серіалізований " +"потік байтів. (Антаксичний аналізатор і генератор також обробляють потоки " +"текстових символів, але таке використання не рекомендується, оскільки надто " +"легко отримати повідомлення, які тим чи іншим чином є недійсними.)" + +msgid "" +"The control component is the :mod:`~email.policy` module. Every :class:" +"`~email.message.EmailMessage`, every :mod:`~email.generator`, and every :mod:" +"`~email.parser` has an associated :mod:`~email.policy` object that controls " +"its behavior. Usually an application only needs to specify the policy when " +"an :class:`~email.message.EmailMessage` is created, either by directly " +"instantiating an :class:`~email.message.EmailMessage` to create a new " +"email, or by parsing an input stream using a :mod:`~email.parser`. But the " +"policy can be changed when the message is serialized using a :mod:`~email." +"generator`. This allows, for example, a generic email message to be parsed " +"from disk, but to serialize it using standard SMTP settings when sending it " +"to an email server." +msgstr "" +"Керуючим компонентом є модуль :mod:`~email.policy`. Кожен :class:`~email." +"message.EmailMessage`, кожен :mod:`~email.generator` і кожен :mod:`~email." +"parser` має пов’язаний об’єкт :mod:`~email.policy`, який контролює його " +"поведінку. Зазвичай програмі потрібно лише вказати політику, коли " +"створюється :class:`~email.message.EmailMessage`, шляхом безпосереднього " +"створення екземпляра :class:`~email.message.EmailMessage` для створення " +"нового електронного листа або аналізу вхідний потік за допомогою :mod:" +"`~email.parser`. Але політику можна змінити, якщо повідомлення серіалізовано " +"за допомогою :mod:`~email.generator`. Це дозволяє, наприклад, аналізувати " +"загальне повідомлення електронної пошти з диска, але серіалізувати його за " +"допомогою стандартних параметрів SMTP під час надсилання на сервер " +"електронної пошти." + +msgid "" +"The email package does its best to hide the details of the various governing " +"RFCs from the application. Conceptually the application should be able to " +"treat the email message as a structured tree of unicode text and binary " +"attachments, without having to worry about how these are represented when " +"serialized. In practice, however, it is often necessary to be aware of at " +"least some of the rules governing MIME messages and their structure, " +"specifically the names and nature of the MIME \"content types\" and how they " +"identify multipart documents. For the most part this knowledge should only " +"be required for more complex applications, and even then it should only be " +"the high level structure in question, and not the details of how those " +"structures are represented. Since MIME content types are used widely in " +"modern internet software (not just email), this will be a familiar concept " +"to many programmers." +msgstr "" +"Пакет електронної пошти робить усе можливе, щоб приховати деталі різних " +"керівних RFC від програми. Концептуально програма повинна мати можливість " +"розглядати повідомлення електронної пошти як структуроване дерево тексту " +"Юнікод і двійкових вкладень, не турбуючись про те, як вони представлені під " +"час серіалізації. На практиці, однак, часто необхідно знати принаймні деякі " +"правила, що регулюють повідомлення MIME та їхню структуру, зокрема назви та " +"природу \"типів вмісту\" MIME та те, як вони ідентифікують багатокомпонентні " +"документи. Здебільшого ці знання потрібні лише для більш складних " +"застосувань, і навіть тоді це має бути лише структура високого рівня, а не " +"деталі того, як ці структури представлені. Оскільки типи вмісту MIME широко " +"використовуються в сучасному Інтернет-програмному забезпеченні (не лише в " +"електронній пошті), це буде знайомим поняттям для багатьох програмістів." + +msgid "" +"The following sections describe the functionality of the :mod:`email` " +"package. We start with the :mod:`~email.message` object model, which is the " +"primary interface an application will use, and follow that with the :mod:" +"`~email.parser` and :mod:`~email.generator` components. Then we cover the :" +"mod:`~email.policy` controls, which completes the treatment of the main " +"components of the library." +msgstr "" +"У наступних розділах описується функціональність пакета :mod:`email`. Ми " +"починаємо з об’єктної моделі :mod:`~email.message`, яка є основним " +"інтерфейсом, який використовуватиме додаток, і продовжуємо це з :mod:`~email." +"parser` і :mod:`~email.generator` компоненти. Потім ми розглядаємо елементи " +"керування :mod:`~email.policy`, що завершує обробку основних компонентів " +"бібліотеки." + +msgid "" +"The next three sections cover the exceptions the package may raise and the " +"defects (non-compliance with the RFCs) that the :mod:`~email.parser` may " +"detect. Then we cover the :mod:`~email.headerregistry` and the :mod:`~email." +"contentmanager` sub-components, which provide tools for doing more detailed " +"manipulation of headers and payloads, respectively. Both of these " +"components contain features relevant to consuming and producing non-trivial " +"messages, but also document their extensibility APIs, which will be of " +"interest to advanced applications." +msgstr "" +"У наступних трьох розділах розглядаються винятки, які може викликати " +"пакунок, і дефекти (невідповідність RFC), які може виявити :mod:`~email." +"parser`. Далі ми розглядаємо підкомпоненти :mod:`~email.headerregistry` і :" +"mod:`~email.contentmanager`, які надають інструменти для більш детального " +"маніпулювання заголовками та корисними навантаженнями відповідно. Обидва ці " +"компоненти містять функції, пов’язані зі споживанням і створенням " +"нетривіальних повідомлень, але також документують їхні API розширюваності, " +"які будуть цікаві для розширених програм." + +msgid "" +"Following those is a set of examples of using the fundamental parts of the " +"APIs covered in the preceding sections." +msgstr "" +"Після них наведено набір прикладів використання основних частин API, " +"розглянутих у попередніх розділах." + +msgid "" +"The foregoing represent the modern (unicode friendly) API of the email " +"package. The remaining sections, starting with the :class:`~email.message." +"Message` class, cover the legacy :data:`~email.policy.compat32` API that " +"deals much more directly with the details of how email messages are " +"represented. The :data:`~email.policy.compat32` API does *not* hide the " +"details of the RFCs from the application, but for applications that need to " +"operate at that level, they can be useful tools. This documentation is also " +"relevant for applications that are still using the :mod:`~email.policy." +"compat32` API for backward compatibility reasons." +msgstr "" +"Вищезазначене представляє сучасний (дружній до Unicode) API пакета " +"електронної пошти. Решта розділів, починаючи з класу :class:`~email.message." +"Message`, охоплюють застарілий API :data:`~email.policy.compat32`, який має " +"набагато більш пряме справу з деталями представлення повідомлень електронної " +"пошти. :data:`~email.policy.compat32` API *не* приховує деталі RFC від " +"програми, але для програм, яким потрібно працювати на цьому рівні, вони " +"можуть бути корисними інструментами. Ця документація також актуальна для " +"програм, які все ще використовують :mod:`~email.policy.compat32` API з " +"причин зворотної сумісності." + +msgid "" +"Docs reorganized and rewritten to promote the new :class:`~email.message." +"EmailMessage`/:class:`~email.policy.EmailPolicy` API." +msgstr "" +"Документи реорганізовано та переписано для просування нового :class:`~email." +"message.EmailMessage`/:class:`~email.policy.EmailPolicy` API." + +msgid "Contents of the :mod:`email` package documentation:" +msgstr "Вміст документації пакета :mod:`email`:" + +msgid "Legacy API:" +msgstr "Застарілий API:" + +msgid "Module :mod:`smtplib`" +msgstr "Модуль :mod:`smtplib`" + +msgid "SMTP (Simple Mail Transport Protocol) client" +msgstr "Клієнт SMTP (Simple Mail Transport Protocol)." + +msgid "Module :mod:`poplib`" +msgstr "Модуль :mod:`poplib`" + +msgid "POP (Post Office Protocol) client" +msgstr "Клієнт POP (Post Office Protocol)." + +msgid "Module :mod:`imaplib`" +msgstr "Модуль :mod:`imaplib`" + +msgid "IMAP (Internet Message Access Protocol) client" +msgstr "Клієнт IMAP (Internet Message Access Protocol)." + +msgid "Module :mod:`mailbox`" +msgstr "Модуль :mod:`mailbox`" + +msgid "" +"Tools for creating, reading, and managing collections of messages on disk " +"using a variety standard formats." +msgstr "" +"Інструменти для створення, читання та керування колекціями повідомлень на " +"диску з використанням різноманітних стандартних форматів." diff --git a/library/email_charset.po b/library/email_charset.po new file mode 100644 index 000000000..dafedadb7 --- /dev/null +++ b/library/email_charset.po @@ -0,0 +1,341 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 01:04+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!email.charset`: Representing character sets" +msgstr "" + +msgid "**Source code:** :source:`Lib/email/charset.py`" +msgstr "**Вихідний код:** :source:`Lib/email/charset.py`" + +msgid "" +"This module is part of the legacy (``Compat32``) email API. In the new API " +"only the aliases table is used." +msgstr "" +"Цей модуль є частиною застарілого (``Compat32``) API електронної пошти. У " +"новому API використовується лише таблиця псевдонімів." + +msgid "" +"The remaining text in this section is the original documentation of the " +"module." +msgstr "Решта тексту в цьому розділі є оригінальною документацією модуля." + +msgid "" +"This module provides a class :class:`Charset` for representing character " +"sets and character set conversions in email messages, as well as a character " +"set registry and several convenience methods for manipulating this registry. " +"Instances of :class:`Charset` are used in several other modules within the :" +"mod:`email` package." +msgstr "" +"Цей модуль надає клас :class:`Charset` для представлення наборів символів і " +"перетворення наборів символів у повідомленнях електронної пошти, а також " +"реєстр наборів символів і декілька зручних методів для маніпулювання цим " +"реєстром. Екземпляри :class:`Charset` використовуються в кількох інших " +"модулях у пакеті :mod:`email`." + +msgid "Import this class from the :mod:`email.charset` module." +msgstr "Імпортуйте цей клас із модуля :mod:`email.charset`." + +msgid "Map character sets to their email properties." +msgstr "Зіставте набори символів із властивостями електронної пошти." + +msgid "" +"This class provides information about the requirements imposed on email for " +"a specific character set. It also provides convenience routines for " +"converting between character sets, given the availability of the applicable " +"codecs. Given a character set, it will do its best to provide information " +"on how to use that character set in an email message in an RFC-compliant way." +msgstr "" +"Цей клас надає інформацію про вимоги до електронної пошти для певного набору " +"символів. Він також надає зручні процедури для перетворення між наборами " +"символів, враховуючи наявність застосовних кодеків. Маючи набір символів, " +"він докладе всіх зусиль, щоб надати інформацію про те, як використовувати " +"цей набір символів у повідомленні електронної пошти відповідно до RFC." + +msgid "" +"Certain character sets must be encoded with quoted-printable or base64 when " +"used in email headers or bodies. Certain character sets must be converted " +"outright, and are not allowed in email." +msgstr "" +"Певні набори символів мають бути закодовані за допомогою citaty-printable " +"або base64, якщо вони використовуються в заголовках або тілах електронних " +"листів. Певні набори символів потрібно відразу конвертувати, і їх заборонено " +"використовувати в електронній пошті." + +msgid "" +"Optional *input_charset* is as described below; it is always coerced to " +"lower case. After being alias normalized it is also used as a lookup into " +"the registry of character sets to find out the header encoding, body " +"encoding, and output conversion codec to be used for the character set. For " +"example, if *input_charset* is ``iso-8859-1``, then headers and bodies will " +"be encoded using quoted-printable and no output conversion codec is " +"necessary. If *input_charset* is ``euc-jp``, then headers will be encoded " +"with base64, bodies will not be encoded, but output text will be converted " +"from the ``euc-jp`` character set to the ``iso-2022-jp`` character set." +msgstr "" +"Додатковий *input_charset*, як описано нижче; це завжди примусово до малого " +"регістру. Після нормалізації псевдоніма він також використовується як пошук " +"у реєстрі наборів символів, щоб дізнатися кодування заголовка, кодування " +"основного тексту та кодек перетворення виводу, який буде використано для " +"набору символів. Наприклад, якщо *input_charset* дорівнює ``iso-8859-1``, " +"тоді заголовки та тіла кодуватимуться з використанням параметра \"quote-" +"printable\", і кодек для перетворення виводу не потрібен. Якщо " +"*input_charset* має значення ``euc-jp``, тоді заголовки будуть закодовані за " +"допомогою base64, тіла не будуть закодовані, але вихідний текст буде " +"перетворено з набору символів ``euc-jp`` на ``iso- 2022-jp`` набір символів." + +msgid ":class:`Charset` instances have the following data attributes:" +msgstr "Екземпляри :class:`Charset` мають такі атрибути даних:" + +msgid "" +"The initial character set specified. Common aliases are converted to their " +"*official* email names (e.g. ``latin_1`` is converted to ``iso-8859-1``). " +"Defaults to 7-bit ``us-ascii``." +msgstr "" +"Зазначений початковий набір символів. Загальні псевдоніми перетворюються на " +"*офіційні* імена електронної пошти (наприклад, ``latin_1`` перетворюється на " +"``iso-8859-1``). За замовчуванням 7-бітний ``us-ascii``." + +msgid "" +"If the character set must be encoded before it can be used in an email " +"header, this attribute will be set to ``charset.QP`` (for quoted-printable), " +"``charset.BASE64`` (for base64 encoding), or ``charset.SHORTEST`` for the " +"shortest of QP or BASE64 encoding. Otherwise, it will be ``None``." +msgstr "" + +msgid "" +"Same as *header_encoding*, but describes the encoding for the mail message's " +"body, which indeed may be different than the header encoding. ``charset." +"SHORTEST`` is not allowed for *body_encoding*." +msgstr "" + +msgid "" +"Some character sets must be converted before they can be used in email " +"headers or bodies. If the *input_charset* is one of them, this attribute " +"will contain the name of the character set output will be converted to. " +"Otherwise, it will be ``None``." +msgstr "" +"Деякі набори символів потрібно перетворити, перш ніж їх можна буде " +"використовувати в заголовках або тексті електронних листів. Якщо " +"*input_charset* є одним із них, цей атрибут міститиме ім’я набору символів, " +"у який буде перетворено вихід. В іншому випадку буде ``None``." + +msgid "" +"The name of the Python codec used to convert the *input_charset* to " +"Unicode. If no conversion codec is necessary, this attribute will be " +"``None``." +msgstr "" +"Назва кодека Python, який використовується для перетворення *input_charset* " +"в Unicode. Якщо кодек перетворення не потрібен, цей атрибут матиме значення " +"``None``." + +msgid "" +"The name of the Python codec used to convert Unicode to the " +"*output_charset*. If no conversion codec is necessary, this attribute will " +"have the same value as the *input_codec*." +msgstr "" +"Назва кодека Python, який використовується для перетворення Unicode у " +"*output_charset*. Якщо кодек перетворення не потрібен, цей атрибут матиме те " +"саме значення, що й *input_codec*." + +msgid ":class:`Charset` instances also have the following methods:" +msgstr "Екземпляри :class:`Charset` також мають такі методи:" + +msgid "Return the content transfer encoding used for body encoding." +msgstr "" +"Повертає кодування передачі вмісту, яке використовується для кодування тіла." + +msgid "" +"This is either the string ``quoted-printable`` or ``base64`` depending on " +"the encoding used, or it is a function, in which case you should call the " +"function with a single argument, the Message object being encoded. The " +"function should then set the :mailheader:`Content-Transfer-Encoding` header " +"itself to whatever is appropriate." +msgstr "" +"Це або рядок ``quoted-printable`` або ``base64`` залежно від кодування, що " +"використовується, або це функція, у цьому випадку ви повинні викликати " +"функцію з одним аргументом, об’єкт Message, який кодується. Потім функція " +"має встановити відповідний заголовок :mailheader:`Content-Transfer-Encoding`." + +msgid "" +"Returns the string ``quoted-printable`` if *body_encoding* is ``QP``, " +"returns the string ``base64`` if *body_encoding* is ``BASE64``, and returns " +"the string ``7bit`` otherwise." +msgstr "" +"Повертає рядок ``quoted-printable``, якщо *body_encoding* має значення " +"``QP``, повертає рядок ``base64``, якщо *body_encoding* має ``BASE64``, і " +"повертає рядок ``7bit`` в іншому випадку ." + +msgid "Return the output character set." +msgstr "Повернути вихідний набір символів." + +msgid "" +"This is the *output_charset* attribute if that is not ``None``, otherwise it " +"is *input_charset*." +msgstr "" +"Це атрибут *output_charset*, якщо це не ``None``, інакше це *input_charset*." + +msgid "Header-encode the string *string*." +msgstr "Заголовок кодує рядок *string*." + +msgid "" +"The type of encoding (base64 or quoted-printable) will be based on the " +"*header_encoding* attribute." +msgstr "" +"Тип кодування (base64 або друковані цитати) базуватиметься на атрибуті " +"*header_encoding*." + +msgid "Header-encode a *string* by converting it first to bytes." +msgstr "Заголовок кодує *рядок*, спочатку перетворюючи його на байти." + +msgid "" +"This is similar to :meth:`header_encode` except that the string is fit into " +"maximum line lengths as given by the argument *maxlengths*, which must be an " +"iterator: each element returned from this iterator will provide the next " +"maximum line length." +msgstr "" +"Це схоже на :meth:`header_encode`, за винятком того, що рядок вписується в " +"максимальну довжину рядка, задану аргументом *maxlengths*, який має бути " +"ітератором: кожен елемент, повернутий цим ітератором, забезпечить наступну " +"максимальну довжину рядка." + +msgid "Body-encode the string *string*." +msgstr "Основне кодування рядка *string*." + +msgid "" +"The type of encoding (base64 or quoted-printable) will be based on the " +"*body_encoding* attribute." +msgstr "" +"Тип кодування (base64 або з можливістю друку в цитатах) базуватиметься на " +"атрибуті *body_encoding*." + +msgid "" +"The :class:`Charset` class also provides a number of methods to support " +"standard operations and built-in functions." +msgstr "" +"Клас :class:`Charset` також надає ряд методів для підтримки стандартних " +"операцій і вбудованих функцій." + +msgid "" +"Returns *input_charset* as a string coerced to lower case. :meth:`!__repr__` " +"is an alias for :meth:`!__str__`." +msgstr "" + +msgid "" +"This method allows you to compare two :class:`Charset` instances for " +"equality." +msgstr "" +"Цей метод дозволяє порівнювати два екземпляри :class:`Charset` на рівність." + +msgid "" +"This method allows you to compare two :class:`Charset` instances for " +"inequality." +msgstr "" +"Цей метод дозволяє порівнювати два екземпляри :class:`Charset` на нерівність." + +msgid "" +"The :mod:`email.charset` module also provides the following functions for " +"adding new entries to the global character set, alias, and codec registries:" +msgstr "" +"Модуль :mod:`email.charset` також надає такі функції для додавання нових " +"записів до глобального набору символів, псевдонімів і реєстрів кодеків:" + +msgid "Add character properties to the global registry." +msgstr "Додайте властивості символів до глобального реєстру." + +msgid "" +"*charset* is the input character set, and must be the canonical name of a " +"character set." +msgstr "" +"*charset* — це вхідний набір символів і має бути канонічною назвою набору " +"символів." + +msgid "" +"Optional *header_enc* and *body_enc* is either ``charset.QP`` for quoted-" +"printable, ``charset.BASE64`` for base64 encoding, ``charset.SHORTEST`` for " +"the shortest of quoted-printable or base64 encoding, or ``None`` for no " +"encoding. ``SHORTEST`` is only valid for *header_enc*. The default is " +"``None`` for no encoding." +msgstr "" + +msgid "" +"Optional *output_charset* is the character set that the output should be in. " +"Conversions will proceed from input charset, to Unicode, to the output " +"charset when the method :meth:`Charset.convert` is called. The default is " +"to output in the same character set as the input." +msgstr "" +"Необов’язковий *output_charset* — це набір символів, у якому мають бути " +"виведені дані. Під час виклику методу :meth:`Charset.convert` перетворення " +"відбуватиметься з вхідного набору символів у Unicode у вихідний набір " +"символів. За замовчуванням виводиться той самий набір символів, що й вхід." + +msgid "" +"Both *input_charset* and *output_charset* must have Unicode codec entries in " +"the module's character set-to-codec mapping; use :func:`add_codec` to add " +"codecs the module does not know about. See the :mod:`codecs` module's " +"documentation for more information." +msgstr "" +"Як *input_charset*, так і *output_charset* повинні мати записи кодека Юнікод " +"у відображенні набору символів у кодек модуля; використовуйте :func:" +"`add_codec`, щоб додати кодеки, про які модуль не знає. Для отримання " +"додаткової інформації дивіться документацію модуля :mod:`codecs`." + +msgid "" +"The global character set registry is kept in the module global dictionary " +"``CHARSETS``." +msgstr "" +"Глобальний реєстр набору символів зберігається в глобальному словнику модуля " +"``CHARSETS``." + +msgid "" +"Add a character set alias. *alias* is the alias name, e.g. ``latin-1``. " +"*canonical* is the character set's canonical name, e.g. ``iso-8859-1``." +msgstr "" +"Додайте псевдонім набору символів. *alias* — псевдонім, напр. ``латин-1``. " +"*canonical* — це канонічне ім’я набору символів, напр. ``iso-8859-1``." + +msgid "" +"The global charset alias registry is kept in the module global dictionary " +"``ALIASES``." +msgstr "" +"Глобальний реєстр псевдонімів кодування зберігається в глобальному словнику " +"модуля ``ALIASES``." + +msgid "" +"Add a codec that map characters in the given character set to and from " +"Unicode." +msgstr "" +"Додайте кодек, який відображає символи в заданому наборі символів у та з " +"Unicode." + +msgid "" +"*charset* is the canonical name of a character set. *codecname* is the name " +"of a Python codec, as appropriate for the second argument to the :class:" +"`str`'s :meth:`~str.encode` method." +msgstr "" +"*charset* — це канонічна назва набору символів. *codecname* — це назва " +"кодека Python, відповідно до другого аргументу методу :class:`str` :meth:" +"`~str.encode`." diff --git a/library/email_compat32-message.po b/library/email_compat32-message.po new file mode 100644 index 000000000..c6163d448 --- /dev/null +++ b/library/email_compat32-message.po @@ -0,0 +1,1189 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 01:04+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "" +":mod:`email.message.Message`: Representing an email message using the :data:" +"`~email.policy.compat32` API" +msgstr "" +":mod:`email.message.Message`: Представлення повідомлення електронної пошти " +"за допомогою API :data:`~email.policy.compat32`" + +msgid "" +"The :class:`Message` class is very similar to the :class:`~email.message." +"EmailMessage` class, without the methods added by that class, and with the " +"default behavior of certain other methods being slightly different. We also " +"document here some methods that, while supported by the :class:`~email." +"message.EmailMessage` class, are not recommended unless you are dealing with " +"legacy code." +msgstr "" +"Клас :class:`Message` дуже схожий на клас :class:`~email.message." +"EmailMessage`, але без методів, доданих цим класом, і з поведінкою за " +"замовчуванням деяких інших методів дещо іншою. Ми також документуємо тут " +"деякі методи, які, хоча й підтримуються класом :class:`~email.message." +"EmailMessage`, не рекомендуються, якщо ви не маєте справу зі застарілим " +"кодом." + +msgid "The philosophy and structure of the two classes is otherwise the same." +msgstr "Філософія та структура двох класів є однаковими." + +msgid "" +"This document describes the behavior under the default (for :class:" +"`Message`) policy :attr:`~email.policy.Compat32`. If you are going to use " +"another policy, you should be using the :class:`~email.message.EmailMessage` " +"class instead." +msgstr "" +"Цей документ описує поведінку за умовчанням (для :class:`Message`) політики :" +"attr:`~email.policy.Compat32`. Якщо ви збираєтеся використовувати іншу " +"політику, замість неї слід використовувати клас :class:`~email.message." +"EmailMessage`." + +msgid "" +"An email message consists of *headers* and a *payload*. Headers must be :" +"rfc:`5322` style names and values, where the field name and value are " +"separated by a colon. The colon is not part of either the field name or the " +"field value. The payload may be a simple text message, or a binary object, " +"or a structured sequence of sub-messages each with their own set of headers " +"and their own payload. The latter type of payload is indicated by the " +"message having a MIME type such as :mimetype:`multipart/\\*` or :mimetype:" +"`message/rfc822`." +msgstr "" +"Повідомлення електронної пошти складається з *заголовків* і *корисного " +"навантаження*. Заголовки мають бути в стилі :rfc:`5322` імен і значень, де " +"назва поля та значення розділені двокрапкою. Двокрапка не є частиною ані " +"імені поля, ані значення поля. Корисне навантаження може бути простим " +"текстовим повідомленням, або двійковим об’єктом, або структурованою " +"послідовністю підповідомлень, кожне з яких має власний набір заголовків і " +"власне корисне навантаження. Останній тип корисного навантаження вказується " +"повідомленням, що має тип MIME, наприклад :mimetype:`multipart/\\*` або :" +"mimetype:`message/rfc822`." + +msgid "" +"The conceptual model provided by a :class:`Message` object is that of an " +"ordered dictionary of headers with additional methods for accessing both " +"specialized information from the headers, for accessing the payload, for " +"generating a serialized version of the message, and for recursively walking " +"over the object tree. Note that duplicate headers are supported but special " +"methods must be used to access them." +msgstr "" +"Концептуальна модель, яку забезпечує об’єкт :class:`Message`, — це " +"впорядкований словник заголовків із додатковими методами для доступу до " +"спеціалізованої інформації із заголовків, для доступу до корисного " +"навантаження, для генерації серіалізованої версії повідомлення та для " +"рекурсивного проходячи по дереву предметів. Зауважте, що дублікати " +"заголовків підтримуються, але для доступу до них потрібно використовувати " +"спеціальні методи." + +msgid "" +"The :class:`Message` pseudo-dictionary is indexed by the header names, which " +"must be ASCII values. The values of the dictionary are strings that are " +"supposed to contain only ASCII characters; there is some special handling " +"for non-ASCII input, but it doesn't always produce the correct results. " +"Headers are stored and returned in case-preserving form, but field names are " +"matched case-insensitively. There may also be a single envelope header, " +"also known as the *Unix-From* header or the ``From_`` header. The *payload* " +"is either a string or bytes, in the case of simple message objects, or a " +"list of :class:`Message` objects, for MIME container documents (e.g. :" +"mimetype:`multipart/\\*` and :mimetype:`message/rfc822`)." +msgstr "" +"Псевдословник :class:`Message` індексується іменами заголовків, які мають " +"бути значеннями ASCII. Значення словника - це рядки, які мають містити лише " +"символи ASCII; існує певна особлива обробка для вводу не-ASCII, але вона не " +"завжди дає правильні результати. Заголовки зберігаються та повертаються у " +"формі зі збереженням регістру, але імена полів зіставляються без урахування " +"регістру. Також може бути єдиний заголовок конверта, також відомий як " +"заголовок *Unix-From* або заголовок ``From_``. *Корисне навантаження* — це " +"або рядок, або байти, у випадку простих об’єктів повідомлення, або список " +"об’єктів :class:`Message` для документів-контейнерів MIME (наприклад, :" +"mimetype:`multipart/\\*` і :mimetype:`повідомлення/rfc822`)." + +msgid "Here are the methods of the :class:`Message` class:" +msgstr "Ось методи класу :class:`Message`:" + +msgid "" +"If *policy* is specified (it must be an instance of a :mod:`~email.policy` " +"class) use the rules it specifies to update and serialize the representation " +"of the message. If *policy* is not set, use the :class:`compat32 ` policy, which maintains backward compatibility with the " +"Python 3.2 version of the email package. For more information see the :mod:" +"`~email.policy` documentation." +msgstr "" +"Якщо вказано *policy* (вона має бути екземпляром класу :mod:`~email." +"policy`), використовуйте вказані в ньому правила для оновлення та " +"серіалізації представлення повідомлення. Якщо *policy* не встановлено, " +"використовуйте політику :class:`compat32 `, яка " +"підтримує зворотну сумісність із версією пакета електронної пошти Python " +"3.2. Для отримання додаткової інформації дивіться документацію :mod:`~email." +"policy`." + +msgid "The *policy* keyword argument was added." +msgstr "Додано аргумент ключового слова *policy*." + +msgid "" +"Return the entire message flattened as a string. When optional *unixfrom* " +"is true, the envelope header is included in the returned string. *unixfrom* " +"defaults to ``False``. For backward compatibility reasons, *maxheaderlen* " +"defaults to ``0``, so if you want a different value you must override it " +"explicitly (the value specified for *max_line_length* in the policy will be " +"ignored by this method). The *policy* argument may be used to override the " +"default policy obtained from the message instance. This can be used to " +"control some of the formatting produced by the method, since the specified " +"*policy* will be passed to the ``Generator``." +msgstr "" +"Повернути все повідомлення зведеним у вигляді рядка. Якщо необов’язковий " +"параметр *unixfrom* має значення true, заголовок конверта включається до " +"поверненого рядка. *unixfrom* за умовчанням має значення ``False``. З " +"міркувань зворотної сумісності *maxheaderlen* за замовчуванням має значення " +"``0``, тому, якщо ви бажаєте інше значення, ви повинні його явно змінити " +"(значення, указане для *max_line_length* у політиці, ігноруватиметься цим " +"методом). Аргумент *policy* можна використовувати для заміни політики за " +"замовчуванням, отриманої з екземпляра повідомлення. Це можна використовувати " +"для керування частиною форматування, створеного методом, оскільки вказану " +"*політику* буде передано ``генератору``." + +msgid "" +"Flattening the message may trigger changes to the :class:`Message` if " +"defaults need to be filled in to complete the transformation to a string " +"(for example, MIME boundaries may be generated or modified)." +msgstr "" +"Зведення повідомлення може викликати зміни в :class:`Message`, якщо для " +"завершення перетворення в рядок необхідно вказати значення за замовчуванням " +"(наприклад, можуть бути створені або змінені межі MIME)." + +msgid "" +"Note that this method is provided as a convenience and may not always format " +"the message the way you want. For example, by default it does not do the " +"mangling of lines that begin with ``From`` that is required by the Unix mbox " +"format. For more flexibility, instantiate a :class:`~email.generator." +"Generator` instance and use its :meth:`~email.generator.Generator.flatten` " +"method directly. For example::" +msgstr "" + +msgid "" +"from io import StringIO\n" +"from email.generator import Generator\n" +"fp = StringIO()\n" +"g = Generator(fp, mangle_from_=True, maxheaderlen=60)\n" +"g.flatten(msg)\n" +"text = fp.getvalue()" +msgstr "" + +msgid "" +"If the message object contains binary data that is not encoded according to " +"RFC standards, the non-compliant data will be replaced by unicode \"unknown " +"character\" code points. (See also :meth:`.as_bytes` and :class:`~email." +"generator.BytesGenerator`.)" +msgstr "" +"Якщо об’єкт повідомлення містить двійкові дані, які не закодовані відповідно " +"до стандартів RFC, невідповідні дані буде замінено кодовими точками Unicode " +"\"невідомий символ\". (Див. також :meth:`.as_bytes` і :class:`~email." +"generator.BytesGenerator`.)" + +msgid "the *policy* keyword argument was added." +msgstr "було додано аргумент ключового слова *policy*." + +msgid "" +"Equivalent to :meth:`.as_string`. Allows ``str(msg)`` to produce a string " +"containing the formatted message." +msgstr "" + +msgid "" +"Return the entire message flattened as a bytes object. When optional " +"*unixfrom* is true, the envelope header is included in the returned string. " +"*unixfrom* defaults to ``False``. The *policy* argument may be used to " +"override the default policy obtained from the message instance. This can be " +"used to control some of the formatting produced by the method, since the " +"specified *policy* will be passed to the ``BytesGenerator``." +msgstr "" +"Повертає все повідомлення зведене як об’єкт bytes. Якщо необов’язковий " +"параметр *unixfrom* має значення true, заголовок конверта включається до " +"поверненого рядка. *unixfrom* за умовчанням має значення ``False``. Аргумент " +"*policy* можна використовувати для заміни політики за замовчуванням, " +"отриманої з екземпляра повідомлення. Це можна використовувати для керування " +"частиною форматування, створеного методом, оскільки вказану *політику* буде " +"передано до ``BytesGenerator``." + +msgid "" +"Note that this method is provided as a convenience and may not always format " +"the message the way you want. For example, by default it does not do the " +"mangling of lines that begin with ``From`` that is required by the Unix mbox " +"format. For more flexibility, instantiate a :class:`~email.generator." +"BytesGenerator` instance and use its :meth:`~email.generator.BytesGenerator." +"flatten` method directly. For example::" +msgstr "" + +msgid "" +"from io import BytesIO\n" +"from email.generator import BytesGenerator\n" +"fp = BytesIO()\n" +"g = BytesGenerator(fp, mangle_from_=True, maxheaderlen=60)\n" +"g.flatten(msg)\n" +"text = fp.getvalue()" +msgstr "" + +msgid "" +"Equivalent to :meth:`.as_bytes`. Allows ``bytes(msg)`` to produce a bytes " +"object containing the formatted message." +msgstr "" + +msgid "" +"Return ``True`` if the message's payload is a list of sub-\\ :class:" +"`Message` objects, otherwise return ``False``. When :meth:`is_multipart` " +"returns ``False``, the payload should be a string object (which might be a " +"CTE encoded binary payload). (Note that :meth:`is_multipart` returning " +"``True`` does not necessarily mean that \"msg.get_content_maintype() == " +"'multipart'\" will return the ``True``. For example, ``is_multipart`` will " +"return ``True`` when the :class:`Message` is of type ``message/rfc822``.)" +msgstr "" +"Повертає ``True``, якщо корисним навантаженням повідомлення є список sub-\\ :" +"class:`Message` об’єктів, інакше повертає ``False``. Коли :meth:" +"`is_multipart` повертає ``False``, корисним навантаженням має бути рядковий " +"об’єкт (який може бути двійковим навантаженням у кодуванні CTE). (Зауважте, " +"що :meth:`is_multipart`, що повертає ``True``, не обов’язково означає, що " +"\"msg.get_content_maintype() == 'multipart'\" поверне ``True``. Наприклад, " +"``is_multipart`` буде повертає ``True``, якщо :class:`Message` має тип " +"``message/rfc822``.)" + +msgid "" +"Set the message's envelope header to *unixfrom*, which should be a string." +msgstr "" +"Встановіть заголовок конверта повідомлення на *unixfrom*, який має бути " +"рядком." + +msgid "" +"Return the message's envelope header. Defaults to ``None`` if the envelope " +"header was never set." +msgstr "" +"Повернути заголовок конверта повідомлення. За замовчуванням ``None``, якщо " +"заголовок конверта ніколи не встановлювався." + +msgid "" +"Add the given *payload* to the current payload, which must be ``None`` or a " +"list of :class:`Message` objects before the call. After the call, the " +"payload will always be a list of :class:`Message` objects. If you want to " +"set the payload to a scalar object (e.g. a string), use :meth:`set_payload` " +"instead." +msgstr "" +"Додайте вказане *корисне навантаження* до поточного корисного навантаження, " +"яке має бути ``None`` або список об’єктів :class:`Message` перед викликом. " +"Після виклику корисним навантаженням завжди буде список об’єктів :class:" +"`Message`. Якщо ви хочете встановити корисне навантаження на скалярний " +"об’єкт (наприклад, рядок), замість цього використовуйте :meth:`set_payload`." + +msgid "" +"This is a legacy method. On the :class:`~email.emailmessage.EmailMessage` " +"class its functionality is replaced by :meth:`~email.message.EmailMessage." +"set_content` and the related ``make`` and ``add`` methods." +msgstr "" +"Це застарілий метод. У класі :class:`~email.emailmessage.EmailMessage` його " +"функціональні можливості замінені на :meth:`~email.message.EmailMessage." +"set_content` і відповідні методи ``make`` і ``add``." + +msgid "" +"Return the current payload, which will be a list of :class:`Message` objects " +"when :meth:`is_multipart` is ``True``, or a string when :meth:`is_multipart` " +"is ``False``. If the payload is a list and you mutate the list object, you " +"modify the message's payload in place." +msgstr "" +"Повертає поточне корисне навантаження, яке буде списком об’єктів :class:" +"`Message`, якщо :meth:`is_multipart` має значення ``True``, або рядок, коли :" +"meth:`is_multipart` має значення ``False``. Якщо корисним навантаженням є " +"список, і ви змінюєте об’єкт списку, ви змінюєте корисне навантаження " +"повідомлення на місці." + +msgid "" +"With optional argument *i*, :meth:`get_payload` will return the *i*-th " +"element of the payload, counting from zero, if :meth:`is_multipart` is " +"``True``. An :exc:`IndexError` will be raised if *i* is less than 0 or " +"greater than or equal to the number of items in the payload. If the payload " +"is a string (i.e. :meth:`is_multipart` is ``False``) and *i* is given, a :" +"exc:`TypeError` is raised." +msgstr "" +"З необов’язковим аргументом *i* :meth:`get_payload` поверне *i*-й елемент " +"корисного навантаження, починаючи з нуля, якщо :meth:`is_multipart` має " +"значення ``True``. Помилка :exc:`IndexError` буде викликана, якщо *i* менше " +"за 0 або більше або дорівнює кількості елементів у корисному навантаженні. " +"Якщо корисне навантаження є рядком (тобто :meth:`is_multipart` має значення " +"``False``) і задано *i*, виникає :exc:`TypeError`." + +msgid "" +"Optional *decode* is a flag indicating whether the payload should be decoded " +"or not, according to the :mailheader:`Content-Transfer-Encoding` header. " +"When ``True`` and the message is not a multipart, the payload will be " +"decoded if this header's value is ``quoted-printable`` or ``base64``. If " +"some other encoding is used, or :mailheader:`Content-Transfer-Encoding` " +"header is missing, the payload is returned as-is (undecoded). In all cases " +"the returned value is binary data. If the message is a multipart and the " +"*decode* flag is ``True``, then ``None`` is returned. If the payload is " +"base64 and it was not perfectly formed (missing padding, characters outside " +"the base64 alphabet), then an appropriate defect will be added to the " +"message's defect property (:class:`~email.errors.InvalidBase64PaddingDefect` " +"or :class:`~email.errors.InvalidBase64CharactersDefect`, respectively)." +msgstr "" +"Необов’язковий *decode* — це прапорець, який вказує, чи слід декодувати " +"корисне навантаження чи ні, відповідно до заголовка :mailheader:`Content-" +"Transfer-Encoding`. Якщо значення ``True`` і повідомлення не складається з " +"кількох частин, корисне навантаження буде декодовано, якщо значенням цього " +"заголовка є ``quoted-printable`` або ``base64``. Якщо використовується інше " +"кодування або відсутній заголовок :mailheader:`Content-Transfer-Encoding`, " +"корисне навантаження повертається як є (недекодоване). У всіх випадках " +"повертається двійкове значення. Якщо повідомлення складається з кількох " +"частин і прапорець *decode* має значення ``True``, тоді повертається " +"``None``. Якщо корисне навантаження є base64 і воно не було ідеально " +"сформоване (відсутнє заповнення, символи поза алфавітом base64), тоді до " +"властивості дефекту повідомлення буде додано відповідний дефект (:class:" +"`~email.errors.InvalidBase64PaddingDefect` або :class:`~email.errors." +"InvalidBase64CharactersDefect` відповідно)." + +msgid "" +"When *decode* is ``False`` (the default) the body is returned as a string " +"without decoding the :mailheader:`Content-Transfer-Encoding`. However, for " +"a :mailheader:`Content-Transfer-Encoding` of 8bit, an attempt is made to " +"decode the original bytes using the ``charset`` specified by the :mailheader:" +"`Content-Type` header, using the ``replace`` error handler. If no " +"``charset`` is specified, or if the ``charset`` given is not recognized by " +"the email package, the body is decoded using the default ASCII charset." +msgstr "" +"Якщо *decode* має значення ``False`` (за замовчуванням), тіло повертається " +"як рядок без декодування :mailheader:`Content-Transfer-Encoding`. Однак для :" +"mailheader:`Content-Transfer-Encoding` 8 біт робиться спроба декодувати " +"оригінальні байти за допомогою ``charset``, визначеного заголовком :" +"mailheader:`Content-Type`, використовуючи обробник помилок ``replace``. Якщо " +"``charset`` не вказано, або якщо наданий ``набір символів`` не розпізнається " +"пакетом електронної пошти, тіло декодується за допомогою набору символів " +"ASCII за замовчуванням." + +msgid "" +"This is a legacy method. On the :class:`~email.emailmessage.EmailMessage` " +"class its functionality is replaced by :meth:`~email.message.EmailMessage." +"get_content` and :meth:`~email.message.EmailMessage.iter_parts`." +msgstr "" +"Це застарілий метод. У класі :class:`~email.emailmessage.EmailMessage` його " +"функції замінені на :meth:`~email.message.EmailMessage.get_content` і :meth:" +"`~email.message.EmailMessage.iter_parts`." + +msgid "" +"Set the entire message object's payload to *payload*. It is the client's " +"responsibility to ensure the payload invariants. Optional *charset* sets " +"the message's default character set; see :meth:`set_charset` for details." +msgstr "" +"Встановіть корисне навантаження всього об’єкта повідомлення на *корисне " +"навантаження*. Клієнт відповідає за забезпечення інваріантів корисного " +"навантаження. Додатковий *charset* встановлює стандартний набір символів " +"повідомлення; подробиці див. :meth:`set_charset`." + +msgid "" +"This is a legacy method. On the :class:`~email.emailmessage.EmailMessage` " +"class its functionality is replaced by :meth:`~email.message.EmailMessage." +"set_content`." +msgstr "" +"Це застарілий метод. У класі :class:`~email.emailmessage.EmailMessage` його " +"функціональність замінено на :meth:`~email.message.EmailMessage.set_content`." + +msgid "" +"Set the character set of the payload to *charset*, which can either be a :" +"class:`~email.charset.Charset` instance (see :mod:`email.charset`), a string " +"naming a character set, or ``None``. If it is a string, it will be " +"converted to a :class:`~email.charset.Charset` instance. If *charset* is " +"``None``, the ``charset`` parameter will be removed from the :mailheader:" +"`Content-Type` header (the message will not be otherwise modified). " +"Anything else will generate a :exc:`TypeError`." +msgstr "" +"Встановіть набір символів корисного навантаження на *charset*, який може " +"бути екземпляром :class:`~email.charset.Charset` (див. :mod:`email." +"charset`), рядком із назвою набору символів або ``Жодного``. Якщо це рядок, " +"його буде перетворено на екземпляр :class:`~email.charset.Charset`. Якщо " +"*charset* має значення ``None``, параметр ``charset`` буде видалено із " +"заголовка :mailheader:`Content-Type` (повідомлення не буде іншим чином " +"змінено). Усе інше створить :exc:`TypeError`." + +msgid "" +"If there is no existing :mailheader:`MIME-Version` header one will be " +"added. If there is no existing :mailheader:`Content-Type` header, one will " +"be added with a value of :mimetype:`text/plain`. Whether the :mailheader:" +"`Content-Type` header already exists or not, its ``charset`` parameter will " +"be set to *charset.output_charset*. If *charset.input_charset* and " +"*charset.output_charset* differ, the payload will be re-encoded to the " +"*output_charset*. If there is no existing :mailheader:`Content-Transfer-" +"Encoding` header, then the payload will be transfer-encoded, if needed, " +"using the specified :class:`~email.charset.Charset`, and a header with the " +"appropriate value will be added. If a :mailheader:`Content-Transfer-" +"Encoding` header already exists, the payload is assumed to already be " +"correctly encoded using that :mailheader:`Content-Transfer-Encoding` and is " +"not modified." +msgstr "" +"Якщо немає існуючого заголовка :mailheader:`MIME-Version`, буде додано один. " +"Якщо немає заголовка :mailheader:`Content-Type`, його буде додано зі " +"значенням :mimetype:`text/plain`. Незалежно від того, чи існує заголовок :" +"mailheader:`Content-Type`, його параметр ``charset`` буде встановлено на " +"*charset.output_charset*. Якщо *charset.input_charset* і *charset." +"output_charset* відрізняються, корисне навантаження буде перекодовано в " +"*output_charset*. Якщо немає існуючого заголовка :mailheader:`Content-" +"Transfer-Encoding`, то корисне навантаження буде закодовано за потреби за " +"допомогою вказаного :class:`~email.charset.Charset` і заголовка з " +"відповідним буде додано значення. Якщо заголовок :mailheader:`Content-" +"Transfer-Encoding` вже існує, вважається, що корисне навантаження вже " +"правильно закодовано за допомогою цього :mailheader:`Content-Transfer-" +"Encoding` і не змінюється." + +msgid "" +"This is a legacy method. On the :class:`~email.emailmessage.EmailMessage` " +"class its functionality is replaced by the *charset* parameter of the :meth:" +"`email.emailmessage.EmailMessage.set_content` method." +msgstr "" +"Це застарілий метод. У класі :class:`~email.emailmessage.EmailMessage` його " +"функціональність замінено параметром *charset* методу :meth:`email." +"emailmessage.EmailMessage.set_content`." + +msgid "" +"Return the :class:`~email.charset.Charset` instance associated with the " +"message's payload." +msgstr "" +"Повертає екземпляр :class:`~email.charset.Charset`, пов’язаний із корисним " +"навантаженням повідомлення." + +msgid "" +"This is a legacy method. On the :class:`~email.emailmessage.EmailMessage` " +"class it always returns ``None``." +msgstr "" +"Це застарілий метод. У класі :class:`~email.emailmessage.EmailMessage` " +"завжди повертається ``None``." + +msgid "" +"The following methods implement a mapping-like interface for accessing the " +"message's :rfc:`2822` headers. Note that there are some semantic " +"differences between these methods and a normal mapping (i.e. dictionary) " +"interface. For example, in a dictionary there are no duplicate keys, but " +"here there may be duplicate message headers. Also, in dictionaries there is " +"no guaranteed order to the keys returned by :meth:`keys`, but in a :class:" +"`Message` object, headers are always returned in the order they appeared in " +"the original message, or were added to the message later. Any header " +"deleted and then re-added are always appended to the end of the header list." +msgstr "" +"Наступні методи реалізують схожий на відображення інтерфейс для доступу до " +"заголовків повідомлення :rfc:`2822`. Зверніть увагу, що існують деякі " +"семантичні відмінності між цими методами та інтерфейсом звичайного " +"відображення (тобто словника). Наприклад, у словнику немає дублікатів " +"ключів, але тут можуть бути дублікати заголовків повідомлень. Крім того, у " +"словниках немає гарантованого порядку ключів, які повертає :meth:`keys`, але " +"в об’єкті :class:`Message` заголовки завжди повертаються в тому порядку, в " +"якому вони з’являлися у вихідному повідомленні або були додані до " +"повідомлення пізніше. Будь-який видалений і потім знову доданий заголовок " +"завжди додається в кінець списку заголовків." + +msgid "" +"These semantic differences are intentional and are biased toward maximal " +"convenience." +msgstr "" +"Ці семантичні відмінності є навмисними та спрямовані на максимальну " +"зручність." + +msgid "" +"Note that in all cases, any envelope header present in the message is not " +"included in the mapping interface." +msgstr "" +"Зауважте, що в усіх випадках будь-який заголовок конверта, присутній у " +"повідомленні, не включається в інтерфейс зіставлення." + +msgid "" +"In a model generated from bytes, any header values that (in contravention of " +"the RFCs) contain non-ASCII bytes will, when retrieved through this " +"interface, be represented as :class:`~email.header.Header` objects with a " +"charset of ``unknown-8bit``." +msgstr "" + +msgid "Return the total number of headers, including duplicates." +msgstr "Повертає загальну кількість заголовків, включаючи дублікати." + +msgid "" +"Return ``True`` if the message object has a field named *name*. Matching is " +"done case-insensitively and *name* should not include the trailing colon. " +"Used for the ``in`` operator, e.g.::" +msgstr "" +"Повертає ``True``, якщо об’єкт повідомлення має поле з назвою *name*. " +"Зіставлення виконується без урахування регістру, і *ім’я* не повинно містити " +"двокрапку в кінці. Використовується для оператора ``in``, наприклад::" + +msgid "" +"if 'message-id' in myMessage:\n" +" print('Message-ID:', myMessage['message-id'])" +msgstr "" + +msgid "" +"Return the value of the named header field. *name* should not include the " +"colon field separator. If the header is missing, ``None`` is returned; a :" +"exc:`KeyError` is never raised." +msgstr "" +"Повертає значення названого поля заголовка. *ім’я* не повинно включати " +"двокрапку-роздільник полів. Якщо заголовок відсутній, повертається ``None``; " +"a :exc:`KeyError` ніколи не виникає." + +msgid "" +"Note that if the named field appears more than once in the message's " +"headers, exactly which of those field values will be returned is undefined. " +"Use the :meth:`get_all` method to get the values of all the extant named " +"headers." +msgstr "" +"Зауважте, що якщо назване поле з’являється більше одного разу в заголовках " +"повідомлення, яке саме значення полів буде повернуто, не визначено. " +"Використовуйте метод :meth:`get_all`, щоб отримати значення всіх наявних " +"іменованих заголовків." + +msgid "" +"Add a header to the message with field name *name* and value *val*. The " +"field is appended to the end of the message's existing fields." +msgstr "" +"Додайте до повідомлення заголовок із назвою поля *name* і значенням *val*. " +"Поле додається в кінці існуючих полів повідомлення." + +msgid "" +"Note that this does *not* overwrite or delete any existing header with the " +"same name. If you want to ensure that the new header is the only one " +"present in the message with field name *name*, delete the field first, e.g.::" +msgstr "" +"Зауважте, що це *не* перезаписує та не видаляє будь-який існуючий заголовок " +"із такою самою назвою. Якщо ви хочете переконатися, що новий заголовок є " +"єдиним у повідомленні з назвою поля *name*, спочатку видаліть це поле, " +"наприклад::" + +msgid "" +"del msg['subject']\n" +"msg['subject'] = 'Python roolz!'" +msgstr "" + +msgid "" +"Delete all occurrences of the field with name *name* from the message's " +"headers. No exception is raised if the named field isn't present in the " +"headers." +msgstr "" +"Видалити всі входження поля з назвою *name* із заголовків повідомлення. " +"Жодного винятку не створюється, якщо назване поле відсутнє в заголовках." + +msgid "Return a list of all the message's header field names." +msgstr "Повертає список імен усіх полів заголовка повідомлення." + +msgid "Return a list of all the message's field values." +msgstr "Повертає список усіх значень полів повідомлення." + +msgid "" +"Return a list of 2-tuples containing all the message's field headers and " +"values." +msgstr "" +"Повертає список із двох кортежів, що містить усі заголовки та значення полів " +"повідомлення." + +msgid "" +"Return the value of the named header field. This is identical to :meth:" +"`~object.__getitem__` except that optional *failobj* is returned if the " +"named header is missing (defaults to ``None``)." +msgstr "" + +msgid "Here are some additional useful methods:" +msgstr "Ось кілька додаткових корисних методів:" + +msgid "" +"Return a list of all the values for the field named *name*. If there are no " +"such named headers in the message, *failobj* is returned (defaults to " +"``None``)." +msgstr "" +"Повертає список усіх значень для поля з назвою *name*. Якщо в повідомленні " +"немає таких іменованих заголовків, повертається *failobj* (за замовчуванням " +"``None``)." + +msgid "" +"Extended header setting. This method is similar to :meth:`__setitem__` " +"except that additional header parameters can be provided as keyword " +"arguments. *_name* is the header field to add and *_value* is the *primary* " +"value for the header." +msgstr "" +"Розширене налаштування заголовка. Цей метод подібний до :meth:`__setitem__` " +"за винятком того, що додаткові параметри заголовка можуть бути надані як " +"аргументи ключового слова. *_name* — це поле заголовка, яке потрібно додати, " +"а *_value* — це *основне* значення для заголовка." + +msgid "" +"For each item in the keyword argument dictionary *_params*, the key is taken " +"as the parameter name, with underscores converted to dashes (since dashes " +"are illegal in Python identifiers). Normally, the parameter will be added " +"as ``key=\"value\"`` unless the value is ``None``, in which case only the " +"key will be added. If the value contains non-ASCII characters, it can be " +"specified as a three tuple in the format ``(CHARSET, LANGUAGE, VALUE)``, " +"where ``CHARSET`` is a string naming the charset to be used to encode the " +"value, ``LANGUAGE`` can usually be set to ``None`` or the empty string (see :" +"rfc:`2231` for other possibilities), and ``VALUE`` is the string value " +"containing non-ASCII code points. If a three tuple is not passed and the " +"value contains non-ASCII characters, it is automatically encoded in :rfc:" +"`2231` format using a ``CHARSET`` of ``utf-8`` and a ``LANGUAGE`` of " +"``None``." +msgstr "" +"Для кожного елемента в словнику аргументів ключових слів *_params* ключ " +"береться як ім’я параметра, а символи підкреслення перетворюються на тире " +"(оскільки тире заборонені в ідентифікаторах Python). Зазвичай параметр буде " +"додано як ``key=\"value\"``, якщо значення не буде ``None``, у цьому випадку " +"буде додано лише ключ. Якщо значення містить символи, відмінні від ASCII, " +"його можна вказати як трикортеж у форматі ``(НАБІР СИМВОЛІВ, МОВА, " +"ЗНАЧЕННЯ)``, де ``НАБІР СИГНАЛОВ`` – це рядок із назвою набору символів, " +"який буде використано для кодування значення ``LANGUAGE`` зазвичай можна " +"встановити на ``None`` або порожній рядок (перегляньте :rfc:`2231` для інших " +"можливостей), а ``VALUE`` є значенням рядка, що містить кодові точки не-" +"ASCII . Якщо три кортежу не передано і значення містить символи, відмінні " +"від ASCII, воно автоматично кодується у форматі :rfc:`2231` з використанням " +"``CHARSET`` ``utf-8`` і ``LANGUAGE`` з ``Жодного``." + +msgid "Here's an example::" +msgstr "Ось приклад::" + +msgid "msg.add_header('Content-Disposition', 'attachment', filename='bud.gif')" +msgstr "" + +msgid "This will add a header that looks like ::" +msgstr "Це додасть заголовок, який виглядає так::" + +msgid "Content-Disposition: attachment; filename=\"bud.gif\"" +msgstr "" + +msgid "An example with non-ASCII characters::" +msgstr "Приклад із символами, відмінними від ASCII:" + +msgid "" +"msg.add_header('Content-Disposition', 'attachment',\n" +" filename=('iso-8859-1', '', 'Fußballer.ppt'))" +msgstr "" + +msgid "Which produces ::" +msgstr "Що виробляє ::" + +msgid "" +"Content-Disposition: attachment; filename*=\"iso-8859-1''Fu%DFballer.ppt\"" +msgstr "" + +msgid "" +"Replace a header. Replace the first header found in the message that " +"matches *_name*, retaining header order and field name case. If no matching " +"header was found, a :exc:`KeyError` is raised." +msgstr "" +"Замінити заголовок. Замініть перший знайдений у повідомленні заголовок, який " +"відповідає *_name*, зберігаючи порядок заголовків і регістр імені поля. Якщо " +"відповідного заголовка не знайдено, виникає :exc:`KeyError`." + +msgid "" +"Return the message's content type. The returned string is coerced to lower " +"case of the form :mimetype:`maintype/subtype`. If there was no :mailheader:" +"`Content-Type` header in the message the default type as given by :meth:" +"`get_default_type` will be returned. Since according to :rfc:`2045`, " +"messages always have a default type, :meth:`get_content_type` will always " +"return a value." +msgstr "" +"Повернути тип вмісту повідомлення. Повернений рядок приводиться до нижнього " +"регістру у формі :mimetype:`maintype/subtype`. Якщо в повідомленні не було " +"заголовка :mailheader:`Content-Type`, буде повернено тип за замовчуванням, " +"заданий :meth:`get_default_type`. Оскільки відповідно до :rfc:`2045` " +"повідомлення завжди мають тип за замовчуванням, :meth:`get_content_type` " +"завжди повертатиме значення." + +msgid "" +":rfc:`2045` defines a message's default type to be :mimetype:`text/plain` " +"unless it appears inside a :mimetype:`multipart/digest` container, in which " +"case it would be :mimetype:`message/rfc822`. If the :mailheader:`Content-" +"Type` header has an invalid type specification, :rfc:`2045` mandates that " +"the default type be :mimetype:`text/plain`." +msgstr "" +":rfc:`2045` визначає тип повідомлення за замовчуванням як :mimetype:`text/" +"plain`, якщо воно не з’являється всередині контейнера :mimetype:`multipart/" +"digest`, у такому випадку це буде :mimetype:`message/rfc822` . Якщо " +"заголовок :mailheader:`Content-Type` має недійсну специфікацію типу, :rfc:" +"`2045` вимагає, щоб типовим типом був :mimetype:`text/plain`." + +msgid "" +"Return the message's main content type. This is the :mimetype:`maintype` " +"part of the string returned by :meth:`get_content_type`." +msgstr "" +"Повернути основний тип вмісту повідомлення. Це :mimetype:`maintype` частина " +"рядка, яку повертає :meth:`get_content_type`." + +msgid "" +"Return the message's sub-content type. This is the :mimetype:`subtype` part " +"of the string returned by :meth:`get_content_type`." +msgstr "" +"Повернути тип підвмісту повідомлення. Це :mimetype:`subtype` частина рядка, " +"яку повертає :meth:`get_content_type`." + +msgid "" +"Return the default content type. Most messages have a default content type " +"of :mimetype:`text/plain`, except for messages that are subparts of :" +"mimetype:`multipart/digest` containers. Such subparts have a default " +"content type of :mimetype:`message/rfc822`." +msgstr "" +"Повернути типовий тип вмісту. Більшість повідомлень мають стандартний тип " +"вмісту :mimetype:`text/plain`, за винятком повідомлень, які є підчастинами " +"контейнерів :mimetype:`multipart/digest`. Такі підчастини мають типовий тип " +"вмісту :mimetype:`message/rfc822`." + +msgid "" +"Set the default content type. *ctype* should either be :mimetype:`text/" +"plain` or :mimetype:`message/rfc822`, although this is not enforced. The " +"default content type is not stored in the :mailheader:`Content-Type` header." +msgstr "" +"Встановіть тип вмісту за замовчуванням. *ctype* має бути :mimetype:`text/" +"plain` або :mimetype:`message/rfc822`, хоча це не обов’язково. Стандартний " +"тип вмісту не зберігається в заголовку :mailheader:`Content-Type`." + +msgid "" +"Return the message's :mailheader:`Content-Type` parameters, as a list. The " +"elements of the returned list are 2-tuples of key/value pairs, as split on " +"the ``'='`` sign. The left hand side of the ``'='`` is the key, while the " +"right hand side is the value. If there is no ``'='`` sign in the parameter " +"the value is the empty string, otherwise the value is as described in :meth:" +"`get_param` and is unquoted if optional *unquote* is ``True`` (the default)." +msgstr "" +"Повернути параметри :mailheader:`Content-Type` повідомлення у вигляді " +"списку. Елементи повернутого списку — це 2-кортежі пар ключ/значення, " +"розділені знаком ``'='``. Ліва сторона ``'='`` є ключем, а права частина - " +"значенням. Якщо в параметрі немає знака ``'='``, значенням є порожній рядок, " +"інакше значення відповідає опису в :meth:`get_param` і не береться в лапки, " +"якщо необов’язковий *unquote* має значення ``True`` ( за замовчуванням)." + +msgid "" +"Optional *failobj* is the object to return if there is no :mailheader:" +"`Content-Type` header. Optional *header* is the header to search instead " +"of :mailheader:`Content-Type`." +msgstr "" +"Необов’язковий *failobj* — це об’єкт, який повертається, якщо немає " +"заголовка :mailheader:`Content-Type`. Додатковий *header* – це заголовок для " +"пошуку замість :mailheader:`Content-Type`." + +msgid "" +"This is a legacy method. On the :class:`~email.emailmessage.EmailMessage` " +"class its functionality is replaced by the *params* property of the " +"individual header objects returned by the header access methods." +msgstr "" +"Це застарілий метод. У класі :class:`~email.emailmessage.EmailMessage` його " +"функціональність замінена властивістю *params* окремих об’єктів заголовка, " +"які повертаються методами доступу до заголовка." + +msgid "" +"Return the value of the :mailheader:`Content-Type` header's parameter " +"*param* as a string. If the message has no :mailheader:`Content-Type` " +"header or if there is no such parameter, then *failobj* is returned " +"(defaults to ``None``)." +msgstr "" +"Повертає значення параметра *param* заголовка :mailheader:`Content-Type` у " +"вигляді рядка. Якщо повідомлення не має заголовка :mailheader:`Content-Type` " +"або немає такого параметра, повертається *failobj* (за замовчуванням " +"``None``)." + +msgid "" +"Optional *header* if given, specifies the message header to use instead of :" +"mailheader:`Content-Type`." +msgstr "" +"Необов’язковий *заголовок*, якщо задано, визначає заголовок повідомлення, " +"який слід використовувати замість :mailheader:`Content-Type`." + +msgid "" +"Parameter keys are always compared case insensitively. The return value can " +"either be a string, or a 3-tuple if the parameter was :rfc:`2231` encoded. " +"When it's a 3-tuple, the elements of the value are of the form ``(CHARSET, " +"LANGUAGE, VALUE)``. Note that both ``CHARSET`` and ``LANGUAGE`` can be " +"``None``, in which case you should consider ``VALUE`` to be encoded in the " +"``us-ascii`` charset. You can usually ignore ``LANGUAGE``." +msgstr "" +"Ключі параметрів завжди порівнюються без урахування регістру. Значення, що " +"повертається, може бути рядком або кортежем із трьох, якщо параметр було " +"закодовано :rfc:`2231`. Якщо це 3-кортеж, елементи значення мають форму " +"``(НАБІР СИМВОЛІВ, МОВА, ЗНАЧЕННЯ)``. Зауважте, що як для ``CHARSET``, так і " +"для ``LANGUAGE`` може бути ``None``, у цьому випадку вам слід вважати, що " +"``VALUE`` закодовано в ``us-ascii``. Зазвичай ви можете ігнорувати " +"``LANGUAGE``." + +msgid "" +"If your application doesn't care whether the parameter was encoded as in :" +"rfc:`2231`, you can collapse the parameter value by calling :func:`email." +"utils.collapse_rfc2231_value`, passing in the return value from :meth:" +"`get_param`. This will return a suitably decoded Unicode string when the " +"value is a tuple, or the original string unquoted if it isn't. For example::" +msgstr "" +"Якщо вашій програмі байдуже, чи був параметр закодований як у :rfc:`2231`, " +"ви можете згорнути значення параметра, викликавши :func:`email.utils." +"collapse_rfc2231_value`, передавши значення, що повертається з :meth:" +"`get_param`. Це поверне відповідним чином декодований рядок Unicode, якщо " +"значення є кортежем, або оригінальний рядок без лапок, якщо це не так. " +"Наприклад::" + +msgid "" +"rawparam = msg.get_param('foo')\n" +"param = email.utils.collapse_rfc2231_value(rawparam)" +msgstr "" + +msgid "" +"In any case, the parameter value (either the returned string, or the " +"``VALUE`` item in the 3-tuple) is always unquoted, unless *unquote* is set " +"to ``False``." +msgstr "" +"У будь-якому випадку значення параметра (або повернений рядок, або елемент " +"``VALUE`` у 3-кортежі) завжди не береться в лапки, якщо для *unquote* не " +"встановлено значення ``False``." + +msgid "" +"Set a parameter in the :mailheader:`Content-Type` header. If the parameter " +"already exists in the header, its value will be replaced with *value*. If " +"the :mailheader:`Content-Type` header as not yet been defined for this " +"message, it will be set to :mimetype:`text/plain` and the new parameter " +"value will be appended as per :rfc:`2045`." +msgstr "" +"Установіть параметр у заголовку :mailheader:`Content-Type`. Якщо параметр " +"уже існує в заголовку, його значення буде замінено на *value*. Якщо " +"заголовок :mailheader:`Content-Type` ще не визначено для цього повідомлення, " +"для нього буде встановлено значення :mimetype:`text/plain`, а нове значення " +"параметра буде додано відповідно до :rfc:`2045`." + +msgid "" +"Optional *header* specifies an alternative header to :mailheader:`Content-" +"Type`, and all parameters will be quoted as necessary unless optional " +"*requote* is ``False`` (the default is ``True``)." +msgstr "" +"Необов’язковий *header* визначає альтернативний заголовок :mailheader:" +"`Content-Type`, і всі параметри будуть взяті в лапки, якщо необов’язковий " +"*requote* не має значення ``False`` (за замовчуванням це ``True``)." + +msgid "" +"If optional *charset* is specified, the parameter will be encoded according " +"to :rfc:`2231`. Optional *language* specifies the RFC 2231 language, " +"defaulting to the empty string. Both *charset* and *language* should be " +"strings." +msgstr "" +"Якщо вказано необов’язковий *charset*, параметр буде закодовано відповідно " +"до :rfc:`2231`. Необов’язкова *мова* вказує мову RFC 2231, за умовчанням " +"порожній рядок. І *charset*, і *language* мають бути рядками." + +msgid "" +"If *replace* is ``False`` (the default) the header is moved to the end of " +"the list of headers. If *replace* is ``True``, the header will be updated " +"in place." +msgstr "" +"Якщо *replace* має значення ``False`` (за замовчуванням), заголовок " +"переміщується в кінець списку заголовків. Якщо *replace* має значення " +"``True``, заголовок буде оновлено на місці." + +msgid "``replace`` keyword was added." +msgstr "Додано ключове слово ``replace``." + +msgid "" +"Remove the given parameter completely from the :mailheader:`Content-Type` " +"header. The header will be re-written in place without the parameter or its " +"value. All values will be quoted as necessary unless *requote* is ``False`` " +"(the default is ``True``). Optional *header* specifies an alternative to :" +"mailheader:`Content-Type`." +msgstr "" +"Повністю вилучіть вказаний параметр із заголовка :mailheader:`Content-Type`. " +"Заголовок буде перезаписано на місці без параметра чи його значення. Усі " +"значення будуть взяті в лапки за необхідності, якщо *requote* не має " +"значення ``False`` (за замовчуванням ``True``). Необов’язковий *заголовок* " +"визначає альтернативу :mailheader:`Content-Type`." + +msgid "" +"Set the main type and subtype for the :mailheader:`Content-Type` header. " +"*type* must be a string in the form :mimetype:`maintype/subtype`, otherwise " +"a :exc:`ValueError` is raised." +msgstr "" +"Встановіть основний тип і підтип для заголовка :mailheader:`Content-Type`. " +"*type* має бути рядком у формі :mimetype:`maintype/subtype`, інакше виникає :" +"exc:`ValueError`." + +msgid "" +"This method replaces the :mailheader:`Content-Type` header, keeping all the " +"parameters in place. If *requote* is ``False``, this leaves the existing " +"header's quoting as is, otherwise the parameters will be quoted (the " +"default)." +msgstr "" +"Цей метод замінює заголовок :mailheader:`Content-Type`, зберігаючи всі " +"параметри на місці. Якщо *requote* має значення ``False``, це залишає " +"існуючі лапки заголовка як є, інакше параметри будуть взяті в лапки (за " +"замовчуванням)." + +msgid "" +"An alternative header can be specified in the *header* argument. When the :" +"mailheader:`Content-Type` header is set a :mailheader:`MIME-Version` header " +"is also added." +msgstr "" +"Альтернативний заголовок можна вказати в аргументі *header*. Коли " +"встановлено заголовок :mailheader:`Content-Type`, також додається заголовок :" +"mailheader:`MIME-Version`." + +msgid "" +"This is a legacy method. On the :class:`~email.emailmessage.EmailMessage` " +"class its functionality is replaced by the ``make_`` and ``add_`` methods." +msgstr "" +"Це застарілий метод. У класі :class:`~email.emailmessage.EmailMessage` його " +"функціональність замінена методами ``make_`` і ``add_``." + +msgid "" +"Return the value of the ``filename`` parameter of the :mailheader:`Content-" +"Disposition` header of the message. If the header does not have a " +"``filename`` parameter, this method falls back to looking for the ``name`` " +"parameter on the :mailheader:`Content-Type` header. If neither is found, or " +"the header is missing, then *failobj* is returned. The returned string will " +"always be unquoted as per :func:`email.utils.unquote`." +msgstr "" +"Повертає значення параметра ``filename`` заголовка :mailheader:`Content-" +"Disposition` повідомлення. Якщо заголовок не має параметра ``filename``, цей " +"метод повертається до пошуку параметра ``name`` у заголовку :mailheader:" +"`Content-Type`. Якщо нічого не знайдено або відсутній заголовок, " +"повертається *failobj*. Повернений рядок завжди буде без лапок відповідно " +"до :func:`email.utils.unquote`." + +msgid "" +"Return the value of the ``boundary`` parameter of the :mailheader:`Content-" +"Type` header of the message, or *failobj* if either the header is missing, " +"or has no ``boundary`` parameter. The returned string will always be " +"unquoted as per :func:`email.utils.unquote`." +msgstr "" +"Повертає значення параметра ``boundary`` заголовка :mailheader:`Content-" +"Type` повідомлення або *failobj*, якщо заголовок відсутній або не має " +"параметра ``boundary``. Повернений рядок завжди буде без лапок відповідно " +"до :func:`email.utils.unquote`." + +msgid "" +"Set the ``boundary`` parameter of the :mailheader:`Content-Type` header to " +"*boundary*. :meth:`set_boundary` will always quote *boundary* if " +"necessary. A :exc:`~email.errors.HeaderParseError` is raised if the message " +"object has no :mailheader:`Content-Type` header." +msgstr "" +"Установіть для параметра ``boundary`` заголовка :mailheader:`Content-Type` " +"значення *boundary*. :meth:`set_boundary` завжди братиме *boundary* у лапки, " +"якщо необхідно. Помилка :exc:`~email.errors.HeaderParseError` виникає, якщо " +"об’єкт повідомлення не має заголовка :mailheader:`Content-Type`." + +msgid "" +"Note that using this method is subtly different than deleting the old :" +"mailheader:`Content-Type` header and adding a new one with the new boundary " +"via :meth:`add_header`, because :meth:`set_boundary` preserves the order of " +"the :mailheader:`Content-Type` header in the list of headers. However, it " +"does *not* preserve any continuation lines which may have been present in " +"the original :mailheader:`Content-Type` header." +msgstr "" +"Зауважте, що використання цього методу дещо відрізняється від видалення " +"старого заголовка :mailheader:`Content-Type` і додавання нового з новою " +"межею за допомогою :meth:`add_header`, оскільки :meth:`set_boundary` " +"зберігає порядок заголовок :mailheader:`Content-Type` у списку заголовків. " +"Однак він *не* зберігає будь-які рядки продовження, які могли бути " +"присутніми в оригінальному заголовку :mailheader:`Content-Type`." + +msgid "" +"Return the ``charset`` parameter of the :mailheader:`Content-Type` header, " +"coerced to lower case. If there is no :mailheader:`Content-Type` header, or " +"if that header has no ``charset`` parameter, *failobj* is returned." +msgstr "" +"Повертає параметр ``charset`` заголовка :mailheader:`Content-Type` у " +"нижньому регістрі. Якщо немає заголовка :mailheader:`Content-Type` або цей " +"заголовок не має параметра ``charset``, повертається *failobj*." + +msgid "" +"Note that this method differs from :meth:`get_charset` which returns the :" +"class:`~email.charset.Charset` instance for the default encoding of the " +"message body." +msgstr "" +"Зауважте, що цей метод відрізняється від :meth:`get_charset`, який повертає " +"екземпляр :class:`~email.charset.Charset` для стандартного кодування тіла " +"повідомлення." + +msgid "" +"Return a list containing the character set names in the message. If the " +"message is a :mimetype:`multipart`, then the list will contain one element " +"for each subpart in the payload, otherwise, it will be a list of length 1." +msgstr "" +"Повернути список із назвами наборів символів у повідомленні. Якщо " +"повідомлення є :mimetype:`multipart`, тоді список міститиме один елемент для " +"кожної підчастини в корисному навантаженні, інакше це буде список довжиною 1." + +msgid "" +"Each item in the list will be a string which is the value of the ``charset`` " +"parameter in the :mailheader:`Content-Type` header for the represented " +"subpart. However, if the subpart has no :mailheader:`Content-Type` header, " +"no ``charset`` parameter, or is not of the :mimetype:`text` main MIME type, " +"then that item in the returned list will be *failobj*." +msgstr "" +"Кожен елемент у списку буде рядком, який є значенням параметра ``charset`` у " +"заголовку :mailheader:`Content-Type` для представленої підчастини. Однак, " +"якщо підчастина не має заголовка :mailheader:`Content-Type`, параметра " +"``charset`` або не належить до основного типу MIME :mimetype:`text`, тоді " +"цей елемент у списку, що повертається, буде *failobj*." + +msgid "" +"Return the lowercased value (without parameters) of the message's :" +"mailheader:`Content-Disposition` header if it has one, or ``None``. The " +"possible values for this method are *inline*, *attachment* or ``None`` if " +"the message follows :rfc:`2183`." +msgstr "" +"Повертає значення в нижньому регістрі (без параметрів) заголовка " +"повідомлення :mailheader:`Content-Disposition`, якщо воно є, або ``None``. " +"Можливі значення для цього методу: *inline*, *attachment* або ``None``, якщо " +"повідомлення слідує за :rfc:`2183`." + +msgid "" +"The :meth:`walk` method is an all-purpose generator which can be used to " +"iterate over all the parts and subparts of a message object tree, in depth-" +"first traversal order. You will typically use :meth:`walk` as the iterator " +"in a ``for`` loop; each iteration returns the next subpart." +msgstr "" +"Метод :meth:`walk` — це універсальний генератор, який можна використовувати " +"для перебору всіх частин і підчастин дерева об’єктів повідомлення в порядку " +"проходження спочатку в глибину. Ви зазвичай використовуєте :meth:`walk` як " +"ітератор у циклі ``for``; кожна ітерація повертає наступну підчастину." + +msgid "" +"Here's an example that prints the MIME type of every part of a multipart " +"message structure:" +msgstr "" +"Ось приклад, який друкує тип MIME кожної частини структури повідомлення, що " +"складається з кількох частин:" + +msgid "" +">>> for part in msg.walk():\n" +"... print(part.get_content_type())\n" +"multipart/report\n" +"text/plain\n" +"message/delivery-status\n" +"text/plain\n" +"text/plain\n" +"message/rfc822\n" +"text/plain" +msgstr "" + +msgid "" +"``walk`` iterates over the subparts of any part where :meth:`is_multipart` " +"returns ``True``, even though ``msg.get_content_maintype() == 'multipart'`` " +"may return ``False``. We can see this in our example by making use of the " +"``_structure`` debug helper function:" +msgstr "" +"``walk`` повторює підчастини будь-якої частини, де :meth:`is_multipart` " +"повертає ``True``, навіть якщо ``msg.get_content_maintype() == 'multipart'`` " +"може повернути ``False``. Ми можемо побачити це в нашому прикладі, " +"використовуючи допоміжну функцію налагодження ``_structure``:" + +msgid "" +">>> for part in msg.walk():\n" +"... print(part.get_content_maintype() == 'multipart',\n" +"... part.is_multipart())\n" +"True True\n" +"False False\n" +"False True\n" +"False False\n" +"False False\n" +"False True\n" +"False False\n" +">>> _structure(msg)\n" +"multipart/report\n" +" text/plain\n" +" message/delivery-status\n" +" text/plain\n" +" text/plain\n" +" message/rfc822\n" +" text/plain" +msgstr "" + +msgid "" +"Here the ``message`` parts are not ``multiparts``, but they do contain " +"subparts. ``is_multipart()`` returns ``True`` and ``walk`` descends into the " +"subparts." +msgstr "" +"Тут частини ``message`` не є ``multiparts``, але вони містять підчастини. " +"``is_multipart()`` повертає ``True`` і ``walk`` спускається до підчастин." + +msgid "" +":class:`Message` objects can also optionally contain two instance " +"attributes, which can be used when generating the plain text of a MIME " +"message." +msgstr "" +"Об’єкти :class:`Message` також можуть додатково містити два атрибути " +"екземпляра, які можна використовувати під час генерації простого тексту " +"повідомлення MIME." + +msgid "" +"The format of a MIME document allows for some text between the blank line " +"following the headers, and the first multipart boundary string. Normally, " +"this text is never visible in a MIME-aware mail reader because it falls " +"outside the standard MIME armor. However, when viewing the raw text of the " +"message, or when viewing the message in a non-MIME aware reader, this text " +"can become visible." +msgstr "" +"Формат документа MIME допускає деякий текст між порожнім рядком після " +"заголовків і першим обмежувальним рядком із складених частин. Зазвичай цей " +"текст ніколи не відображається в програмі читання пошти з підтримкою MIME, " +"оскільки він виходить за рамки стандартної броні MIME. Однак під час " +"перегляду необробленого тексту повідомлення або під час перегляду " +"повідомлення в програмі читання, яка не підтримує MIME, цей текст може стати " +"видимим." + +msgid "" +"The *preamble* attribute contains this leading extra-armor text for MIME " +"documents. When the :class:`~email.parser.Parser` discovers some text after " +"the headers but before the first boundary string, it assigns this text to " +"the message's *preamble* attribute. When the :class:`~email.generator." +"Generator` is writing out the plain text representation of a MIME message, " +"and it finds the message has a *preamble* attribute, it will write this text " +"in the area between the headers and the first boundary. See :mod:`email." +"parser` and :mod:`email.generator` for details." +msgstr "" +"Атрибут *преамбула* містить цей провідний додатковий текст для документів " +"MIME. Коли :class:`~email.parser.Parser` виявляє текст після заголовків, але " +"перед першим обмежувальним рядком, він призначає цей текст атрибуту " +"*преамбула* повідомлення. Коли :class:`~email.generator.Generator` записує " +"звичайне текстове представлення повідомлення MIME і виявляє, що повідомлення " +"має атрибут *преамбула*, він записує цей текст у область між заголовками та " +"перша межа. Перегляньте :mod:`email.parser` і :mod:`email.generator` для " +"деталей." + +msgid "" +"Note that if the message object has no preamble, the *preamble* attribute " +"will be ``None``." +msgstr "" +"Зауважте, що якщо об’єкт повідомлення не має преамбули, атрибут *preamble* " +"матиме значення ``None``." + +msgid "" +"The *epilogue* attribute acts the same way as the *preamble* attribute, " +"except that it contains text that appears between the last boundary and the " +"end of the message." +msgstr "" +"Атрибут *epilogue* діє так само, як і атрибут *preamble*, за винятком того, " +"що він містить текст, який з’являється між останньою межею та кінцем " +"повідомлення." + +msgid "" +"You do not need to set the epilogue to the empty string in order for the :" +"class:`~email.generator.Generator` to print a newline at the end of the file." +msgstr "" +"Вам не потрібно встановлювати епілог порожнім рядком, щоб :class:`~email." +"generator.Generator` друкував новий рядок у кінці файлу." + +msgid "" +"The *defects* attribute contains a list of all the problems found when " +"parsing this message. See :mod:`email.errors` for a detailed description of " +"the possible parsing defects." +msgstr "" +"Атрибут *defects* містить список усіх проблем, виявлених під час аналізу " +"цього повідомлення. Перегляньте :mod:`email.errors` для детального опису " +"можливих дефектів аналізу." diff --git a/library/email_contentmanager.po b/library/email_contentmanager.po new file mode 100644 index 000000000..0240be8bf --- /dev/null +++ b/library/email_contentmanager.po @@ -0,0 +1,351 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 01:04+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!email.contentmanager`: Managing MIME Content" +msgstr "" + +msgid "**Source code:** :source:`Lib/email/contentmanager.py`" +msgstr "**Вихідний код:** :source:`Lib/email/contentmanager.py`" + +msgid "[1]_" +msgstr "[1]_" + +msgid "" +"Base class for content managers. Provides the standard registry mechanisms " +"to register converters between MIME content and other representations, as " +"well as the ``get_content`` and ``set_content`` dispatch methods." +msgstr "" +"Базовий клас для менеджерів вмісту. Надає стандартні механізми реєстру для " +"реєстрації конвертерів між вмістом MIME та іншими представленнями, а також " +"методи відправлення ``get_content`` і ``set_content``." + +msgid "" +"Look up a handler function based on the ``mimetype`` of *msg* (see next " +"paragraph), call it, passing through all arguments, and return the result of " +"the call. The expectation is that the handler will extract the payload from " +"*msg* and return an object that encodes information about the extracted data." +msgstr "" +"Знайдіть функцію обробки на основі ``mimetype`` *msg* (див. наступний " +"параграф), викличте її, передаючи всі аргументи, і поверніть результат " +"виклику. Очікується, що обробник витягне корисне навантаження з *msg* і " +"поверне об’єкт, який кодує інформацію про витягнуті дані." + +msgid "" +"To find the handler, look for the following keys in the registry, stopping " +"with the first one found:" +msgstr "" +"Щоб знайти обробник, знайдіть такі розділи в реєстрі, зупинившись на першому " +"знайденому:" + +msgid "the string representing the full MIME type (``maintype/subtype``)" +msgstr "рядок, що представляє повний тип MIME (``maintype/subtype``)" + +msgid "the string representing the ``maintype``" +msgstr "рядок, що представляє ``maintype``" + +msgid "the empty string" +msgstr "порожній рядок" + +msgid "" +"If none of these keys produce a handler, raise a :exc:`KeyError` for the " +"full MIME type." +msgstr "" +"Якщо жоден із цих ключів не створює обробник, викличте :exc:`KeyError` для " +"повного типу MIME." + +msgid "" +"If the ``maintype`` is ``multipart``, raise a :exc:`TypeError`; otherwise " +"look up a handler function based on the type of *obj* (see next paragraph), " +"call :meth:`~email.message.EmailMessage.clear_content` on the *msg*, and " +"call the handler function, passing through all arguments. The expectation " +"is that the handler will transform and store *obj* into *msg*, possibly " +"making other changes to *msg* as well, such as adding various MIME headers " +"to encode information needed to interpret the stored data." +msgstr "" +"Якщо ``maintype`` є ``multipart``, викликати :exc:`TypeError`; інакше " +"знайдіть функцію обробки на основі типу *obj* (див. наступний абзац), " +"викличте :meth:`~email.message.EmailMessage.clear_content` у *msg* та " +"викликайте функцію обробки, передаючи всі аргументи . Очікується, що " +"обробник перетворить і збереже *obj* в *msg*, можливо також вносячи інші " +"зміни в *msg*, наприклад додаючи різні заголовки MIME для кодування " +"інформації, необхідної для інтерпретації збережених даних." + +msgid "" +"To find the handler, obtain the type of *obj* (``typ = type(obj)``), and " +"look for the following keys in the registry, stopping with the first one " +"found:" +msgstr "" +"Щоб знайти обробник, отримайте тип *obj* (``typ = type(obj)``) і знайдіть " +"наступні ключі в реєстрі, зупиняючись на першому знайденому:" + +msgid "the type itself (``typ``)" +msgstr "сам тип (``typ``)" + +msgid "" +"the type's fully qualified name (``typ.__module__ + '.' + typ." +"__qualname__``)." +msgstr "повне ім’я типу (``typ.__module__ + '.' + typ.__qualname__``)." + +msgid "the type's :attr:`qualname ` (``typ.__qualname__``)" +msgstr "" + +msgid "the type's :attr:`name ` (``typ.__name__``)." +msgstr "" + +msgid "" +"If none of the above match, repeat all of the checks above for each of the " +"types in the :term:`MRO` (:attr:`typ.__mro__ `). Finally, if " +"no other key yields a handler, check for a handler for the key ``None``. If " +"there is no handler for ``None``, raise a :exc:`KeyError` for the fully " +"qualified name of the type." +msgstr "" + +msgid "" +"Also add a :mailheader:`MIME-Version` header if one is not present (see " +"also :class:`.MIMEPart`)." +msgstr "" +"Також додайте заголовок :mailheader:`MIME-Version`, якщо його немає (див. " +"також :class:`.MIMEPart`)." + +msgid "" +"Record the function *handler* as the handler for *key*. For the possible " +"values of *key*, see :meth:`get_content`." +msgstr "" +"Запишіть функцію *обробник* як обробник для *ключа*. Можливі значення *key* " +"див. у :meth:`get_content`." + +msgid "" +"Record *handler* as the function to call when an object of a type matching " +"*typekey* is passed to :meth:`set_content`. For the possible values of " +"*typekey*, see :meth:`set_content`." +msgstr "" +"Запишіть *обробник* як функцію для виклику, коли об’єкт типу, який " +"відповідає *typekey*, передається до :meth:`set_content`. Можливі значення " +"*typekey* див. у :meth:`set_content`." + +msgid "Content Manager Instances" +msgstr "Примірники Content Manager" + +msgid "" +"Currently the email package provides only one concrete content manager, :" +"data:`raw_data_manager`, although more may be added in the future. :data:" +"`raw_data_manager` is the :attr:`~email.policy.EmailPolicy.content_manager` " +"provided by :attr:`~email.policy.EmailPolicy` and its derivatives." +msgstr "" +"Наразі пакет електронної пошти містить лише один конкретний менеджер " +"вмісту, :data:`raw_data_manager`, хоча в майбутньому може бути додано " +"більше. :data:`raw_data_manager` — це :attr:`~email.policy.EmailPolicy." +"content_manager`, наданий :attr:`~email.policy.EmailPolicy` та його " +"похідними." + +msgid "" +"This content manager provides only a minimum interface beyond that provided " +"by :class:`~email.message.Message` itself: it deals only with text, raw " +"byte strings, and :class:`~email.message.Message` objects. Nevertheless, it " +"provides significant advantages compared to the base API: ``get_content`` on " +"a text part will return a unicode string without the application needing to " +"manually decode it, ``set_content`` provides a rich set of options for " +"controlling the headers added to a part and controlling the content transfer " +"encoding, and it enables the use of the various ``add_`` methods, thereby " +"simplifying the creation of multipart messages." +msgstr "" +"Цей менеджер вмісту надає лише мінімальний інтерфейс, окрім того, який надає " +"сам :class:`~email.message.Message`: він має справу лише з текстом, " +"необробленими рядками байтів та об’єктами :class:`~email.message.Message`. " +"Тим не менш, він надає значні переваги порівняно з базовим API: " +"``get_content`` у текстовій частині поверне рядок Unicode без необхідності " +"програми вручну декодувати його, ``set_content`` надає багатий набір " +"параметрів для керування заголовками додається до частини та контролює " +"кодування передачі вмісту, а також дозволяє використовувати різні методи " +"``add_``, тим самим спрощуючи створення багатокомпонентних повідомлень." + +msgid "" +"Return the payload of the part as either a string (for ``text`` parts), an :" +"class:`~email.message.EmailMessage` object (for ``message/rfc822`` parts), " +"or a ``bytes`` object (for all other non-multipart types). Raise a :exc:" +"`KeyError` if called on a ``multipart``. If the part is a ``text`` part and " +"*errors* is specified, use it as the error handler when decoding the payload " +"to unicode. The default error handler is ``replace``." +msgstr "" +"Повертає корисне навантаження частини як рядок (для частин ``text``), " +"об’єкт :class:`~email.message.EmailMessage` (для частин ``message/rfc822``) " +"або ``bytes`` об'єкт (для всіх інших нескладних типів). Викликає :exc:" +"`KeyError`, якщо викликається на ``multipart``. Якщо частина є частиною " +"``text`` і вказано *errors*, використовуйте її як обробник помилок під час " +"декодування корисного навантаження в Юнікод. Обробником помилок за " +"замовчуванням є ``replace``." + +msgid "Add headers and payload to *msg*:" +msgstr "Додайте заголовки та корисне навантаження до *повідомлення*:" + +msgid "" +"Add a :mailheader:`Content-Type` header with a ``maintype/subtype`` value." +msgstr "" +"Додайте заголовок :mailheader:`Content-Type` зі значенням ``maintype/" +"subtype``." + +msgid "" +"For ``str``, set the MIME ``maintype`` to ``text``, and set the subtype to " +"*subtype* if it is specified, or ``plain`` if it is not." +msgstr "" +"Для ``str`` встановіть ``maintype`` MIME на ``text`` і встановіть підтип на " +"*subtype*, якщо він указаний, або ``plain``, якщо він не вказано." + +msgid "" +"For ``bytes``, use the specified *maintype* and *subtype*, or raise a :exc:" +"`TypeError` if they are not specified." +msgstr "" +"Для ``bytes`` використовуйте вказані *maintype* і *subtype* або викликайте :" +"exc:`TypeError`, якщо вони не вказані." + +msgid "" +"For :class:`~email.message.EmailMessage` objects, set the maintype to " +"``message``, and set the subtype to *subtype* if it is specified or " +"``rfc822`` if it is not. If *subtype* is ``partial``, raise an error " +"(``bytes`` objects must be used to construct ``message/partial`` parts)." +msgstr "" +"Для об’єктів :class:`~email.message.EmailMessage` встановіть основний тип як " +"``message``, а для підтипу встановіть *subtype*, якщо він указаний, або " +"``rfc822``, якщо його немає. Якщо *subtype* має значення ``partial``, " +"виникає помилка (об’єкти ``bytes`` повинні використовуватися для створення " +"частин ``message/partial``)." + +msgid "" +"If *charset* is provided (which is valid only for ``str``), encode the " +"string to bytes using the specified character set. The default is " +"``utf-8``. If the specified *charset* is a known alias for a standard MIME " +"charset name, use the standard charset instead." +msgstr "" +"Якщо надано *charset* (який дійсний лише для ``str``), закодуйте рядок у " +"байти за допомогою вказаного набору символів. Типовим є ``utf-8``. Якщо " +"вказаний *набір символів* є відомим псевдонімом для назви стандартного " +"набору кодів MIME, замість цього використовуйте стандартний набір символів." + +msgid "" +"If *cte* is set, encode the payload using the specified content transfer " +"encoding, and set the :mailheader:`Content-Transfer-Encoding` header to that " +"value. Possible values for *cte* are ``quoted-printable``, ``base64``, " +"``7bit``, ``8bit``, and ``binary``. If the input cannot be encoded in the " +"specified encoding (for example, specifying a *cte* of ``7bit`` for an input " +"that contains non-ASCII values), raise a :exc:`ValueError`." +msgstr "" +"Якщо встановлено *cte*, закодуйте корисне навантаження, використовуючи " +"вказане кодування передачі вмісту, і встановіть це значення для заголовка :" +"mailheader:`Content-Transfer-Encoding`. Можливі значення для *cte*: ``quoted-" +"printable``, ``base64``, ``7bit``, ``8bit`` і ``binary``. Якщо вхідні дані " +"не можна закодувати у вказаному кодуванні (наприклад, вказавши *cte* " +"``7bit`` для вхідних даних, які містять значення, відмінні від ASCII), " +"викликайте :exc:`ValueError`." + +msgid "" +"For ``str`` objects, if *cte* is not set use heuristics to determine the " +"most compact encoding. Prior to encoding, :meth:`str.splitlines` is used to " +"normalize all line boundaries, ensuring that each line of the payload is " +"terminated by the current policy's :data:`~email.policy.Policy.linesep` " +"property (even if the original string did not end with one)." +msgstr "" + +msgid "" +"For ``bytes`` objects, *cte* is taken to be base64 if not set, and the " +"aforementioned newline translation is not performed." +msgstr "" + +msgid "" +"For :class:`~email.message.EmailMessage`, per :rfc:`2046`, raise an error if " +"a *cte* of ``quoted-printable`` or ``base64`` is requested for *subtype* " +"``rfc822``, and for any *cte* other than ``7bit`` for *subtype* ``external-" +"body``. For ``message/rfc822``, use ``8bit`` if *cte* is not specified. " +"For all other values of *subtype*, use ``7bit``." +msgstr "" +"Для :class:`~email.message.EmailMessage`, відповідно до :rfc:`2046`, " +"викликати помилку, якщо *cte* ``quoted-printable`` або ``base64`` " +"запитується для *підтипу* ``rfc822`` і для будь-якого *cte*, крім ``7bit`` " +"для *підтипу* ``external-body``. Для ``message/rfc822`` використовуйте " +"``8bit``, якщо *cte* не вказано. Для всіх інших значень *subtype* " +"використовуйте ``7bit``." + +msgid "" +"A *cte* of ``binary`` does not actually work correctly yet. The " +"``EmailMessage`` object as modified by ``set_content`` is correct, but :" +"class:`~email.generator.BytesGenerator` does not serialize it correctly." +msgstr "" +"*cte* ``binary`` насправді ще не працює належним чином. Об’єкт " +"``EmailMessage``, змінений ``set_content`` є правильним, але :class:`~email." +"generator.BytesGenerator` не серіалізує його правильно." + +msgid "" +"If *disposition* is set, use it as the value of the :mailheader:`Content-" +"Disposition` header. If not specified, and *filename* is specified, add the " +"header with the value ``attachment``. If *disposition* is not specified and " +"*filename* is also not specified, do not add the header. The only valid " +"values for *disposition* are ``attachment`` and ``inline``." +msgstr "" +"Якщо встановлено *disposition*, використовуйте його як значення заголовка :" +"mailheader:`Content-Disposition`. Якщо не вказано, але вказано *filename*, " +"додайте заголовок зі значенням ``attachment``. Якщо *disposition* не вказано " +"і *filename* також не вказано, не додавайте заголовок. Єдиними дійсними " +"значеннями для *disposition* є ``attachment`` і ``inline``." + +msgid "" +"If *filename* is specified, use it as the value of the ``filename`` " +"parameter of the :mailheader:`Content-Disposition` header." +msgstr "" +"Якщо вказано *filename*, використовуйте його як значення параметра " +"``filename`` заголовка :mailheader:`Content-Disposition`." + +msgid "" +"If *cid* is specified, add a :mailheader:`Content-ID` header with *cid* as " +"its value." +msgstr "" +"Якщо вказано *cid*, додайте заголовок :mailheader:`Content-ID` зі значенням " +"*cid*." + +msgid "" +"If *params* is specified, iterate its ``items`` method and use the resulting " +"``(key, value)`` pairs to set additional parameters on the :mailheader:" +"`Content-Type` header." +msgstr "" +"Якщо вказано *params*, повторіть його метод ``items`` і використовуйте " +"отримані пари ``(key, value)``, щоб установити додаткові параметри в " +"заголовку :mailheader:`Content-Type`." + +msgid "" +"If *headers* is specified and is a list of strings of the form ``headername: " +"headervalue`` or a list of ``header`` objects (distinguished from strings by " +"having a ``name`` attribute), add the headers to *msg*." +msgstr "" +"Якщо вказано *headers* і це список рядків у формі ``назва заголовка: " +"значення заголовка`` або список об’єктів ``заголовка`` (відрізняються від " +"рядків наявністю атрибута ``назва``), додайте заголовки на *повідомлення*." + +msgid "Footnotes" +msgstr "Виноски" + +msgid "" +"Originally added in 3.4 as a :term:`provisional module `" +msgstr "" +"Спочатку додано в 3.4 як :term:`проміжний модуль `" diff --git a/library/email_encoders.po b/library/email_encoders.po new file mode 100644 index 000000000..8551ceebc --- /dev/null +++ b/library/email_encoders.po @@ -0,0 +1,144 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 01:04+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!email.encoders`: Encoders" +msgstr "" + +msgid "**Source code:** :source:`Lib/email/encoders.py`" +msgstr "**Вихідний код:** :source:`Lib/email/encoders.py`" + +msgid "" +"This module is part of the legacy (``Compat32``) email API. In the new API " +"the functionality is provided by the *cte* parameter of the :meth:`~email." +"message.EmailMessage.set_content` method." +msgstr "" +"Цей модуль є частиною застарілого (``Compat32``) API електронної пошти. У " +"новому API функціональні можливості забезпечуються параметром *cte* методу :" +"meth:`~email.message.EmailMessage.set_content`." + +msgid "" +"This module is deprecated in Python 3. The functions provided here should " +"not be called explicitly since the :class:`~email.mime.text.MIMEText` class " +"sets the content type and CTE header using the *_subtype* and *_charset* " +"values passed during the instantiation of that class." +msgstr "" +"Цей модуль є застарілим у Python 3. Надані тут функції не слід викликати " +"явно, оскільки клас :class:`~email.mime.text.MIMEText` встановлює тип вмісту " +"та заголовок CTE за допомогою значень *_subtype* і *_charset* передана під " +"час створення екземпляра цього класу." + +msgid "" +"The remaining text in this section is the original documentation of the " +"module." +msgstr "Решта тексту в цьому розділі є оригінальною документацією модуля." + +msgid "" +"When creating :class:`~email.message.Message` objects from scratch, you " +"often need to encode the payloads for transport through compliant mail " +"servers. This is especially true for :mimetype:`image/\\*` and :mimetype:" +"`text/\\*` type messages containing binary data." +msgstr "" +"Під час створення об’єктів :class:`~email.message.Message` з нуля вам часто " +"потрібно закодувати корисні дані для транспортування через сумісні поштові " +"сервери. Особливо це стосується повідомлень типу :mimetype:`image/\\*` і :" +"mimetype:`text/\\*`, що містять двійкові дані." + +msgid "" +"The :mod:`email` package provides some convenient encoders in its :mod:" +"`~email.encoders` module. These encoders are actually used by the :class:" +"`~email.mime.audio.MIMEAudio` and :class:`~email.mime.image.MIMEImage` class " +"constructors to provide default encodings. All encoder functions take " +"exactly one argument, the message object to encode. They usually extract " +"the payload, encode it, and reset the payload to this newly encoded value. " +"They should also set the :mailheader:`Content-Transfer-Encoding` header as " +"appropriate." +msgstr "" + +msgid "" +"Note that these functions are not meaningful for a multipart message. They " +"must be applied to individual subparts instead, and will raise a :exc:" +"`TypeError` if passed a message whose type is multipart." +msgstr "" +"Зауважте, що ці функції не мають значення для багатокомпонентного " +"повідомлення. Натомість вони повинні застосовуватися до окремих підчастин і " +"викличуть :exc:`TypeError`, якщо передано повідомлення, тип якого є " +"багатокомпонентним." + +msgid "Here are the encoding functions provided:" +msgstr "Ось доступні функції кодування:" + +msgid "" +"Encodes the payload into quoted-printable form and sets the :mailheader:" +"`Content-Transfer-Encoding` header to ``quoted-printable`` [#]_. This is a " +"good encoding to use when most of your payload is normal printable data, but " +"contains a few unprintable characters." +msgstr "" +"Кодує корисне навантаження у форму для друку в цитатах і встановлює для " +"заголовка :mailheader:`Content-Transfer-Encoding` значення ``quoted-" +"printable`` [#]_. Це хороше кодування для використання, коли більша частина " +"вашого корисного навантаження є звичайними даними для друку, але містить " +"кілька недрукованих символів." + +msgid "" +"Encodes the payload into base64 form and sets the :mailheader:`Content-" +"Transfer-Encoding` header to ``base64``. This is a good encoding to use " +"when most of your payload is unprintable data since it is a more compact " +"form than quoted-printable. The drawback of base64 encoding is that it " +"renders the text non-human readable." +msgstr "" +"Кодує корисне навантаження у форму base64 і встановлює для заголовка :" +"mailheader:`Content-Transfer-Encoding` значення ``base64``. Це хороше " +"кодування для використання, коли більша частина вашого корисного " +"навантаження є недрукованими даними, оскільки це більш компактна форма, ніж " +"придатна для друку в цитатах. Недоліком кодування base64 є те, що воно " +"робить текст недоступним для читання людиною." + +msgid "" +"This doesn't actually modify the message's payload, but it does set the :" +"mailheader:`Content-Transfer-Encoding` header to either ``7bit`` or ``8bit`` " +"as appropriate, based on the payload data." +msgstr "" +"Це фактично не змінює корисне навантаження повідомлення, але встановлює для " +"заголовка :mailheader:`Content-Transfer-Encoding` значення ``7bit`` або " +"``8bit`` відповідно, на основі даних корисного навантаження." + +msgid "" +"This does nothing; it doesn't even set the :mailheader:`Content-Transfer-" +"Encoding` header." +msgstr "" +"Це нічого не робить; він навіть не встановлює заголовок :mailheader:`Content-" +"Transfer-Encoding`." + +msgid "Footnotes" +msgstr "Виноски" + +msgid "" +"Note that encoding with :meth:`encode_quopri` also encodes all tabs and " +"space characters in the data." +msgstr "" +"Зауважте, що кодування за допомогою :meth:`encode_quopri` також кодує всі " +"символи табуляції та пробілів у даних." diff --git a/library/email_errors.po b/library/email_errors.po new file mode 100644 index 000000000..d83b6a0d7 --- /dev/null +++ b/library/email_errors.po @@ -0,0 +1,182 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 01:05+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!email.errors`: Exception and Defect classes" +msgstr "" + +msgid "**Source code:** :source:`Lib/email/errors.py`" +msgstr "**Вихідний код:** :source:`Lib/email/errors.py`" + +msgid "" +"The following exception classes are defined in the :mod:`email.errors` " +"module:" +msgstr "Наступні класи винятків визначено в модулі :mod:`email.errors`:" + +msgid "" +"This is the base class for all exceptions that the :mod:`email` package can " +"raise. It is derived from the standard :exc:`Exception` class and defines " +"no additional methods." +msgstr "" +"Це базовий клас для всіх винятків, які може створити пакет :mod:`email`. Він " +"походить від стандартного класу :exc:`Exception` і не визначає додаткових " +"методів." + +msgid "" +"This is the base class for exceptions raised by the :class:`~email.parser." +"Parser` class. It is derived from :exc:`MessageError`. This class is also " +"used internally by the parser used by :mod:`~email.headerregistry`." +msgstr "" +"Це базовий клас для винятків, викликаних класом :class:`~email.parser." +"Parser`. Він походить від :exc:`MessageError`. Цей клас також " +"використовується внутрішньо аналізатором, який використовує :mod:`~email." +"headerregistry`." + +msgid "" +"Raised under some error conditions when parsing the :rfc:`5322` headers of a " +"message, this class is derived from :exc:`MessageParseError`. The :meth:" +"`~email.message.EmailMessage.set_boundary` method will raise this error if " +"the content type is unknown when the method is called. :class:`~email.header." +"Header` may raise this error for certain base64 decoding errors, and when an " +"attempt is made to create a header that appears to contain an embedded " +"header (that is, there is what is supposed to be a continuation line that " +"has no leading whitespace and looks like a header)." +msgstr "" +"Виникає за деяких умов помилки під час аналізу заголовків :rfc:`5322` " +"повідомлення, цей клас походить від :exc:`MessageParseError`. Метод :meth:" +"`~email.message.EmailMessage.set_boundary` викличе цю помилку, якщо під час " +"виклику методу тип вмісту невідомий. :class:`~email.header.Header` може " +"викликати цю помилку для певних помилок декодування base64, а також коли " +"робиться спроба створити заголовок, який, здається, містить вбудований " +"заголовок (тобто, є те, що має бути рядок продовження, який не має " +"початкових пробілів і виглядає як заголовок)." + +msgid "Deprecated and no longer used." +msgstr "Застарілий і більше не використовується." + +msgid "" +"Raised if the :meth:`~email.message.Message.attach` method is called on an " +"instance of a class derived from :class:`~email.mime.nonmultipart." +"MIMENonMultipart` (e.g. :class:`~email.mime.image.MIMEImage`). :exc:" +"`MultipartConversionError` multiply inherits from :exc:`MessageError` and " +"the built-in :exc:`TypeError`." +msgstr "" + +msgid "" +"Raised when an error occurs when the :mod:`~email.generator` outputs headers." +msgstr "" + +msgid "" +"This is the base class for all defects found when parsing email messages. It " +"is derived from :exc:`ValueError`." +msgstr "" + +msgid "" +"This is the base class for all defects found when parsing email headers. It " +"is derived from :exc:`MessageDefect`." +msgstr "" + +msgid "" +"Here is the list of the defects that the :class:`~email.parser.FeedParser` " +"can find while parsing messages. Note that the defects are added to the " +"message where the problem was found, so for example, if a message nested " +"inside a :mimetype:`multipart/alternative` had a malformed header, that " +"nested message object would have a defect, but the containing messages would " +"not." +msgstr "" +"Ось список дефектів, які :class:`~email.parser.FeedParser` може знайти під " +"час аналізу повідомлень. Зауважте, що дефекти додаються до повідомлення, у " +"якому виявлено проблему, тому, наприклад, якщо повідомлення, вкладене в :" +"mimetype:`multipart/alternative`, мало неправильний заголовок, цей вкладений " +"об’єкт повідомлення мав би дефект, але містив би повідомлення не будуть." + +msgid "" +"All defect classes are subclassed from :class:`email.errors.MessageDefect`." +msgstr "Усі класи дефектів є підкласами :class:`email.errors.MessageDefect`." + +msgid "" +"A message claimed to be a multipart, but had no :mimetype:`boundary` " +"parameter." +msgstr "" + +msgid "" +"The start boundary claimed in the :mailheader:`Content-Type` header was " +"never found." +msgstr "" + +msgid "" +"A start boundary was found, but no corresponding close boundary was ever " +"found." +msgstr "" + +msgid "The message had a continuation line as its first header line." +msgstr "" + +msgid "A \"Unix From\" header was found in the middle of a header block." +msgstr "" + +msgid "" +"A line was found while parsing headers that had no leading white space but " +"contained no ':'. Parsing continues assuming that the line represents the " +"first line of the body." +msgstr "" + +msgid "" +"A header was found that was missing a colon, or was otherwise malformed." +msgstr "" + +msgid "This defect has not been used for several Python versions." +msgstr "Цей дефект не використовувався для кількох версій Python." + +msgid "" +"A message claimed to be a :mimetype:`multipart`, but no subparts were found. " +"Note that when a message has this defect, its :meth:`~email.message.Message." +"is_multipart` method may return ``False`` even though its content type " +"claims to be :mimetype:`multipart`." +msgstr "" + +msgid "" +"When decoding a block of base64 encoded bytes, the padding was not correct. " +"Enough padding is added to perform the decode, but the resulting decoded " +"bytes may be invalid." +msgstr "" + +msgid "" +"When decoding a block of base64 encoded bytes, characters outside the base64 " +"alphabet were encountered. The characters are ignored, but the resulting " +"decoded bytes may be invalid." +msgstr "" + +msgid "" +"When decoding a block of base64 encoded bytes, the number of non-padding " +"base64 characters was invalid (1 more than a multiple of 4). The encoded " +"block was kept as-is." +msgstr "" + +msgid "" +"When decoding an invalid or unparsable date field. The original value is " +"kept as-is." +msgstr "" diff --git a/library/email_examples.po b/library/email_examples.po new file mode 100644 index 000000000..ebde6f4f9 --- /dev/null +++ b/library/email_examples.po @@ -0,0 +1,489 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 01:05+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`email`: Examples" +msgstr ":mod:`email`: Приклади" + +msgid "" +"Here are a few examples of how to use the :mod:`email` package to read, " +"write, and send simple email messages, as well as more complex MIME messages." +msgstr "" +"Ось кілька прикладів того, як використовувати пакет :mod:`email` для " +"читання, написання та надсилання простих повідомлень електронної пошти, а " +"також більш складних повідомлень MIME." + +msgid "" +"First, let's see how to create and send a simple text message (both the text " +"content and the addresses may contain unicode characters):" +msgstr "" +"Спочатку розглянемо, як створити та надіслати просте текстове повідомлення " +"(як текстовий вміст, так і адреси можуть містити символи Юнікоду):" + +msgid "" +"# Import smtplib for the actual sending function\n" +"import smtplib\n" +"\n" +"# Import the email modules we'll need\n" +"from email.message import EmailMessage\n" +"\n" +"# Open the plain text file whose name is in textfile for reading.\n" +"with open(textfile) as fp:\n" +" # Create a text/plain message\n" +" msg = EmailMessage()\n" +" msg.set_content(fp.read())\n" +"\n" +"# me == the sender's email address\n" +"# you == the recipient's email address\n" +"msg['Subject'] = f'The contents of {textfile}'\n" +"msg['From'] = me\n" +"msg['To'] = you\n" +"\n" +"# Send the message via our own SMTP server.\n" +"s = smtplib.SMTP('localhost')\n" +"s.send_message(msg)\n" +"s.quit()\n" +msgstr "" + +msgid "" +"Parsing :rfc:`822` headers can easily be done by the using the classes from " +"the :mod:`~email.parser` module:" +msgstr "" +"Розбір заголовків :rfc:`822` можна легко виконати за допомогою класів із " +"модуля :mod:`~email.parser`:" + +msgid "" +"# Import the email modules we'll need\n" +"#from email.parser import BytesParser\n" +"from email.parser import Parser\n" +"from email.policy import default\n" +"\n" +"# If the e-mail headers are in a file, uncomment these two lines:\n" +"# with open(messagefile, 'rb') as fp:\n" +"# headers = BytesParser(policy=default).parse(fp)\n" +"\n" +"# Or for parsing headers in a string (this is an uncommon operation), use:\n" +"headers = Parser(policy=default).parsestr(\n" +" 'From: Foo Bar \\n'\n" +" 'To: \\n'\n" +" 'Subject: Test message\\n'\n" +" '\\n'\n" +" 'Body would go here\\n')\n" +"\n" +"# Now the header items can be accessed as a dictionary:\n" +"print('To: {}'.format(headers['to']))\n" +"print('From: {}'.format(headers['from']))\n" +"print('Subject: {}'.format(headers['subject']))\n" +"\n" +"# You can also access the parts of the addresses:\n" +"print('Recipient username: {}'.format(headers['to'].addresses[0].username))\n" +"print('Sender name: {}'.format(headers['from'].addresses[0].display_name))\n" +msgstr "" + +msgid "" +"Here's an example of how to send a MIME message containing a bunch of family " +"pictures that may be residing in a directory:" +msgstr "" +"Ось приклад того, як надіслати повідомлення MIME, що містить групу сімейних " +"фотографій, які можуть зберігатися в каталозі:" + +msgid "" +"# Import smtplib for the actual sending function.\n" +"import smtplib\n" +"\n" +"# Here are the email package modules we'll need.\n" +"from email.message import EmailMessage\n" +"\n" +"# Create the container email message.\n" +"msg = EmailMessage()\n" +"msg['Subject'] = 'Our family reunion'\n" +"# me == the sender's email address\n" +"# family = the list of all recipients' email addresses\n" +"msg['From'] = me\n" +"msg['To'] = ', '.join(family)\n" +"msg.preamble = 'You will not see this in a MIME-aware mail reader.\\n'\n" +"\n" +"# Open the files in binary mode. You can also omit the subtype\n" +"# if you want MIMEImage to guess it.\n" +"for file in pngfiles:\n" +" with open(file, 'rb') as fp:\n" +" img_data = fp.read()\n" +" msg.add_attachment(img_data, maintype='image',\n" +" subtype='png')\n" +"\n" +"# Send the email via our own SMTP server.\n" +"with smtplib.SMTP('localhost') as s:\n" +" s.send_message(msg)\n" +msgstr "" + +msgid "" +"Here's an example of how to send the entire contents of a directory as an " +"email message: [1]_" +msgstr "" +"Ось приклад того, як надіслати весь вміст каталогу як повідомлення " +"електронної пошти: [1]_" + +msgid "" +"#!/usr/bin/env python3\n" +"\n" +"\"\"\"Send the contents of a directory as a MIME message.\"\"\"\n" +"\n" +"import os\n" +"import smtplib\n" +"# For guessing MIME type based on file name extension\n" +"import mimetypes\n" +"\n" +"from argparse import ArgumentParser\n" +"\n" +"from email.message import EmailMessage\n" +"from email.policy import SMTP\n" +"\n" +"\n" +"def main():\n" +" parser = ArgumentParser(description=\"\"\"\\\n" +"Send the contents of a directory as a MIME message.\n" +"Unless the -o option is given, the email is sent by forwarding to your " +"local\n" +"SMTP server, which then does the normal delivery process. Your local " +"machine\n" +"must be running an SMTP server.\n" +"\"\"\")\n" +" parser.add_argument('-d', '--directory',\n" +" help=\"\"\"Mail the contents of the specified " +"directory,\n" +" otherwise use the current directory. Only the " +"regular\n" +" files in the directory are sent, and we don't " +"recurse to\n" +" subdirectories.\"\"\")\n" +" parser.add_argument('-o', '--output',\n" +" metavar='FILE',\n" +" help=\"\"\"Print the composed message to FILE " +"instead of\n" +" sending the message to the SMTP server.\"\"\")\n" +" parser.add_argument('-s', '--sender', required=True,\n" +" help='The value of the From: header (required)')\n" +" parser.add_argument('-r', '--recipient', required=True,\n" +" action='append', metavar='RECIPIENT',\n" +" default=[], dest='recipients',\n" +" help='A To: header value (at least one required)')\n" +" args = parser.parse_args()\n" +" directory = args.directory\n" +" if not directory:\n" +" directory = '.'\n" +" # Create the message\n" +" msg = EmailMessage()\n" +" msg['Subject'] = f'Contents of directory {os.path.abspath(directory)}'\n" +" msg['To'] = ', '.join(args.recipients)\n" +" msg['From'] = args.sender\n" +" msg.preamble = 'You will not see this in a MIME-aware mail reader.\\n'\n" +"\n" +" for filename in os.listdir(directory):\n" +" path = os.path.join(directory, filename)\n" +" if not os.path.isfile(path):\n" +" continue\n" +" # Guess the content type based on the file's extension. Encoding\n" +" # will be ignored, although we should check for simple things like\n" +" # gzip'd or compressed files.\n" +" ctype, encoding = mimetypes.guess_file_type(path)\n" +" if ctype is None or encoding is not None:\n" +" # No guess could be made, or the file is encoded (compressed), " +"so\n" +" # use a generic bag-of-bits type.\n" +" ctype = 'application/octet-stream'\n" +" maintype, subtype = ctype.split('/', 1)\n" +" with open(path, 'rb') as fp:\n" +" msg.add_attachment(fp.read(),\n" +" maintype=maintype,\n" +" subtype=subtype,\n" +" filename=filename)\n" +" # Now send or store the message\n" +" if args.output:\n" +" with open(args.output, 'wb') as fp:\n" +" fp.write(msg.as_bytes(policy=SMTP))\n" +" else:\n" +" with smtplib.SMTP('localhost') as s:\n" +" s.send_message(msg)\n" +"\n" +"\n" +"if __name__ == '__main__':\n" +" main()\n" +msgstr "" + +msgid "" +"Here's an example of how to unpack a MIME message like the one above, into a " +"directory of files:" +msgstr "" +"Ось приклад того, як розпакувати повідомлення MIME, як наведене вище, у " +"каталог файлів:" + +msgid "" +"#!/usr/bin/env python3\n" +"\n" +"\"\"\"Unpack a MIME message into a directory of files.\"\"\"\n" +"\n" +"import os\n" +"import email\n" +"import mimetypes\n" +"\n" +"from email.policy import default\n" +"\n" +"from argparse import ArgumentParser\n" +"\n" +"\n" +"def main():\n" +" parser = ArgumentParser(description=\"\"\"\\\n" +"Unpack a MIME message into a directory of files.\n" +"\"\"\")\n" +" parser.add_argument('-d', '--directory', required=True,\n" +" help=\"\"\"Unpack the MIME message into the named\n" +" directory, which will be created if it doesn't " +"already\n" +" exist.\"\"\")\n" +" parser.add_argument('msgfile')\n" +" args = parser.parse_args()\n" +"\n" +" with open(args.msgfile, 'rb') as fp:\n" +" msg = email.message_from_binary_file(fp, policy=default)\n" +"\n" +" try:\n" +" os.mkdir(args.directory)\n" +" except FileExistsError:\n" +" pass\n" +"\n" +" counter = 1\n" +" for part in msg.walk():\n" +" # multipart/* are just containers\n" +" if part.get_content_maintype() == 'multipart':\n" +" continue\n" +" # Applications should really sanitize the given filename so that an\n" +" # email message can't be used to overwrite important files\n" +" filename = part.get_filename()\n" +" if not filename:\n" +" ext = mimetypes.guess_extension(part.get_content_type())\n" +" if not ext:\n" +" # Use a generic bag-of-bits extension\n" +" ext = '.bin'\n" +" filename = f'part-{counter:03d}{ext}'\n" +" counter += 1\n" +" with open(os.path.join(args.directory, filename), 'wb') as fp:\n" +" fp.write(part.get_payload(decode=True))\n" +"\n" +"\n" +"if __name__ == '__main__':\n" +" main()\n" +msgstr "" + +msgid "" +"Here's an example of how to create an HTML message with an alternative plain " +"text version. To make things a bit more interesting, we include a related " +"image in the html part, and we save a copy of what we are going to send to " +"disk, as well as sending it." +msgstr "" +"Ось приклад того, як створити HTML-повідомлення з альтернативною версією " +"звичайного тексту. Щоб зробити все трохи цікавішим, ми включаємо пов’язане " +"зображення в частину html і зберігаємо копію того, що збираємося надіслати, " +"на диск, а також надсилаємо його." + +msgid "" +"#!/usr/bin/env python3\n" +"\n" +"import smtplib\n" +"\n" +"from email.message import EmailMessage\n" +"from email.headerregistry import Address\n" +"from email.utils import make_msgid\n" +"\n" +"# Create the base text message.\n" +"msg = EmailMessage()\n" +"msg['Subject'] = \"Pourquoi pas des asperges pour ce midi ?\"\n" +"msg['From'] = Address(\"Pepé Le Pew\", \"pepe\", \"example.com\")\n" +"msg['To'] = (Address(\"Penelope Pussycat\", \"penelope\", \"example.com\"),\n" +" Address(\"Fabrette Pussycat\", \"fabrette\", \"example.com\"))\n" +"msg.set_content(\"\"\"\\\n" +"Salut!\n" +"\n" +"Cette recette [1] sera sûrement un très bon repas.\n" +"\n" +"[1] http://www.yummly.com/recipe/Roasted-Asparagus-Epicurious-203718\n" +"\n" +"--Pepé\n" +"\"\"\")\n" +"\n" +"# Add the html version. This converts the message into a multipart/" +"alternative\n" +"# container, with the original text message as the first part and the new " +"html\n" +"# message as the second part.\n" +"asparagus_cid = make_msgid()\n" +"msg.add_alternative(\"\"\"\\\n" +"\n" +" \n" +" \n" +"

Salut!

\n" +"

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

\n" +" \n" +" \n" +"\n" +"\"\"\".format(asparagus_cid=asparagus_cid[1:-1]), subtype='html')\n" +"# note that we needed to peel the <> off the msgid for use in the html.\n" +"\n" +"# Now add the related image to the html part.\n" +"with open(\"roasted-asparagus.jpg\", 'rb') as img:\n" +" msg.get_payload()[1].add_related(img.read(), 'image', 'jpeg',\n" +" cid=asparagus_cid)\n" +"\n" +"# Make a local copy of what we are going to send.\n" +"with open('outgoing.msg', 'wb') as f:\n" +" f.write(bytes(msg))\n" +"\n" +"# Send the message via local SMTP server.\n" +"with smtplib.SMTP('localhost') as s:\n" +" s.send_message(msg)\n" +msgstr "" + +msgid "" +"If we were sent the message from the last example, here is one way we could " +"process it:" +msgstr "" +"Якби нам надіслали повідомлення з останнього прикладу, ось один із способів " +"його обробки:" + +msgid "" +"import os\n" +"import sys\n" +"import tempfile\n" +"import mimetypes\n" +"import webbrowser\n" +"\n" +"# Import the email modules we'll need\n" +"from email import policy\n" +"from email.parser import BytesParser\n" +"\n" +"\n" +"def magic_html_parser(html_text, partfiles):\n" +" \"\"\"Return safety-sanitized html linked to partfiles.\n" +"\n" +" Rewrite the href=\"cid:....\" attributes to point to the filenames in " +"partfiles.\n" +" Though not trivial, this should be possible using html.parser.\n" +" \"\"\"\n" +" raise NotImplementedError(\"Add the magic needed\")\n" +"\n" +"\n" +"# In a real program you'd get the filename from the arguments.\n" +"with open('outgoing.msg', 'rb') as fp:\n" +" msg = BytesParser(policy=policy.default).parse(fp)\n" +"\n" +"# Now the header items can be accessed as a dictionary, and any non-ASCII " +"will\n" +"# be converted to unicode:\n" +"print('To:', msg['to'])\n" +"print('From:', msg['from'])\n" +"print('Subject:', msg['subject'])\n" +"\n" +"# If we want to print a preview of the message content, we can extract " +"whatever\n" +"# the least formatted payload is and print the first three lines. Of " +"course,\n" +"# if the message has no plain text part printing the first three lines of " +"html\n" +"# is probably useless, but this is just a conceptual example.\n" +"simplest = msg.get_body(preferencelist=('plain', 'html'))\n" +"print()\n" +"print(''.join(simplest.get_content().splitlines(keepends=True)[:3]))\n" +"\n" +"ans = input(\"View full message?\")\n" +"if ans.lower()[0] == 'n':\n" +" sys.exit()\n" +"\n" +"# We can extract the richest alternative in order to display it:\n" +"richest = msg.get_body()\n" +"partfiles = {}\n" +"if richest['content-type'].maintype == 'text':\n" +" if richest['content-type'].subtype == 'plain':\n" +" for line in richest.get_content().splitlines():\n" +" print(line)\n" +" sys.exit()\n" +" elif richest['content-type'].subtype == 'html':\n" +" body = richest\n" +" else:\n" +" print(\"Don't know how to display {}\".format(richest." +"get_content_type()))\n" +" sys.exit()\n" +"elif richest['content-type'].content_type == 'multipart/related':\n" +" body = richest.get_body(preferencelist=('html'))\n" +" for part in richest.iter_attachments():\n" +" fn = part.get_filename()\n" +" if fn:\n" +" extension = os.path.splitext(part.get_filename())[1]\n" +" else:\n" +" extension = mimetypes.guess_extension(part.get_content_type())\n" +" with tempfile.NamedTemporaryFile(suffix=extension, delete=False) as " +"f:\n" +" f.write(part.get_content())\n" +" # again strip the <> to go from email form of cid to html form.\n" +" partfiles[part['content-id'][1:-1]] = f.name\n" +"else:\n" +" print(\"Don't know how to display {}\".format(richest." +"get_content_type()))\n" +" sys.exit()\n" +"with tempfile.NamedTemporaryFile(mode='w', delete=False) as f:\n" +" f.write(magic_html_parser(body.get_content(), partfiles))\n" +"webbrowser.open(f.name)\n" +"os.remove(f.name)\n" +"for fn in partfiles.values():\n" +" os.remove(fn)\n" +"\n" +"# Of course, there are lots of email messages that could break this simple\n" +"# minded program, but it will handle the most common ones.\n" +msgstr "" + +msgid "Up to the prompt, the output from the above is:" +msgstr "До підказки вихідні дані вище:" + +msgid "" +"To: Penelope Pussycat , Fabrette Pussycat " +"\n" +"From: Pepé Le Pew \n" +"Subject: Pourquoi pas des asperges pour ce midi ?\n" +"\n" +"Salut!\n" +"\n" +"Cette recette [1] sera sûrement un très bon repas." +msgstr "" + +msgid "Footnotes" +msgstr "Виноски" + +msgid "" +"Thanks to Matthew Dixon Cowles for the original inspiration and examples." +msgstr "Дякуємо Метью Діксону Коулзу за оригінальне натхнення та приклади." diff --git a/library/email_generator.po b/library/email_generator.po new file mode 100644 index 000000000..36c85cce7 --- /dev/null +++ b/library/email_generator.po @@ -0,0 +1,430 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 01:05+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!email.generator`: Generating MIME documents" +msgstr "" + +msgid "**Source code:** :source:`Lib/email/generator.py`" +msgstr "**Вихідний код:** :source:`Lib/email/generator.py`" + +msgid "" +"One of the most common tasks is to generate the flat (serialized) version of " +"the email message represented by a message object structure. You will need " +"to do this if you want to send your message via :meth:`smtplib.SMTP." +"sendmail`, or print the message on the console. Taking a message object " +"structure and producing a serialized representation is the job of the " +"generator classes." +msgstr "" + +msgid "" +"As with the :mod:`email.parser` module, you aren't limited to the " +"functionality of the bundled generator; you could write one from scratch " +"yourself. However the bundled generator knows how to generate most email in " +"a standards-compliant way, should handle MIME and non-MIME email messages " +"just fine, and is designed so that the bytes-oriented parsing and generation " +"operations are inverses, assuming the same non-transforming :mod:`~email." +"policy` is used for both. That is, parsing the serialized byte stream via " +"the :class:`~email.parser.BytesParser` class and then regenerating the " +"serialized byte stream using :class:`BytesGenerator` should produce output " +"identical to the input [#]_. (On the other hand, using the generator on an :" +"class:`~email.message.EmailMessage` constructed by program may result in " +"changes to the :class:`~email.message.EmailMessage` object as defaults are " +"filled in.)" +msgstr "" +"Як і у випадку з модулем :mod:`email.parser`, ви не обмежені " +"функціональністю вбудованого генератора; ви можете написати його з нуля " +"самостійно. Однак укомплектований генератор знає, як генерувати більшість " +"електронних листів відповідно до стандартів, має добре обробляти " +"повідомлення електронної пошти MIME та не MIME та розроблено таким чином, " +"щоб операції синтаксичного аналізу та генерування, орієнтовані на байти, " +"були зворотними, припускаючи однакові не-MIME transforming :mod:`~email." +"policy` використовується для обох. Тобто розбір серіалізованого потоку " +"байтів за допомогою класу :class:`~email.parser.BytesParser`, а потім " +"регенерація серіалізованого потоку байтів за допомогою :class:" +"`BytesGenerator` має давати вихідні дані, ідентичні вхідним [#]_. (З іншого " +"боку, використання генератора для :class:`~email.message.EmailMessage`, " +"створеного програмою, може призвести до змін в об’єкті :class:`~email." +"message.EmailMessage`, оскільки стандартні значення заповнені.)" + +msgid "" +"The :class:`Generator` class can be used to flatten a message into a text " +"(as opposed to binary) serialized representation, but since Unicode cannot " +"represent binary data directly, the message is of necessity transformed into " +"something that contains only ASCII characters, using the standard email RFC " +"Content Transfer Encoding techniques for encoding email messages for " +"transport over channels that are not \"8 bit clean\"." +msgstr "" +"Клас :class:`Generator` можна використовувати для зведення повідомлення в " +"текстове (на відміну від двійкового) серіалізоване представлення, але " +"оскільки Юнікод не може представляти двійкові дані напряму, повідомлення " +"обов’язково перетворюється на щось, що містить лише символи ASCII, " +"використання стандартних методів кодування електронної пошти RFC Content " +"Transfer для кодування повідомлень електронної пошти для передачі через " +"канали, які не є \"8-бітними чистими\"." + +msgid "" +"To accommodate reproducible processing of SMIME-signed messages :class:" +"`Generator` disables header folding for message parts of type ``multipart/" +"signed`` and all subparts." +msgstr "" +"Для забезпечення відтворюваної обробки повідомлень, підписаних SMIME, :class:" +"`Generator` вимикає згортання заголовків для частин повідомлення типу " +"``multipart/signed`` та всіх підчастин." + +msgid "" +"Return a :class:`BytesGenerator` object that will write any message provided " +"to the :meth:`flatten` method, or any surrogateescape encoded text provided " +"to the :meth:`write` method, to the :term:`file-like object` *outfp*. " +"*outfp* must support a ``write`` method that accepts binary data." +msgstr "" +"Повертає об’єкт :class:`BytesGenerator`, який записуватиме будь-яке " +"повідомлення, надане методу :meth:`flatten`, або будь-який текст у кодуванні " +"surrogateescape, наданий методу :meth:`write`, у :term:`file-like object` " +"*outfp*. *outfp* повинен підтримувати метод ``write``, який приймає двійкові " +"дані." + +msgid "" +"If optional *mangle_from_* is ``True``, put a ``>`` character in front of " +"any line in the body that starts with the exact string ``\"From \"``, that " +"is ``From`` followed by a space at the beginning of a line. *mangle_from_* " +"defaults to the value of the :attr:`~email.policy.Policy.mangle_from_` " +"setting of the *policy* (which is ``True`` for the :data:`~email.policy." +"compat32` policy and ``False`` for all others). *mangle_from_* is intended " +"for use when messages are stored in Unix mbox format (see :mod:`mailbox` and " +"`WHY THE CONTENT-LENGTH FORMAT IS BAD `_)." +msgstr "" + +msgid "" +"If *maxheaderlen* is not ``None``, refold any header lines that are longer " +"than *maxheaderlen*, or if ``0``, do not rewrap any headers. If " +"*manheaderlen* is ``None`` (the default), wrap headers and other message " +"lines according to the *policy* settings." +msgstr "" +"Якщо *maxheaderlen* не є ``None``, перепакуйте будь-які рядки заголовків, " +"які довші за *maxheaderlen*, або якщо ``0``, не перегортайте жодних " +"заголовків. Якщо *manheaderlen* має значення ``None`` (за замовчуванням), " +"оберніть заголовки та інші рядки повідомлень відповідно до налаштувань " +"*policy*." + +msgid "" +"If *policy* is specified, use that policy to control message generation. If " +"*policy* is ``None`` (the default), use the policy associated with the :" +"class:`~email.message.Message` or :class:`~email.message.EmailMessage` " +"object passed to ``flatten`` to control the message generation. See :mod:" +"`email.policy` for details on what *policy* controls." +msgstr "" +"Якщо вказано *політику*, використовуйте цю політику для керування створенням " +"повідомлень. Якщо *policy* має значення ``None`` (за замовчуванням), " +"використовуйте політику, пов’язану з об’єктом :class:`~email.message." +"Message` або :class:`~email.message.EmailMessage`, переданим у ``flatten`` " +"для керування генерацією повідомлень. Перегляньте :mod:`email.policy`, щоб " +"дізнатися більше про те, що контролює *policy*." + +msgid "Added the *policy* keyword." +msgstr "Додано ключове слово *політика*." + +msgid "" +"The default behavior of the *mangle_from_* and *maxheaderlen* parameters is " +"to follow the policy." +msgstr "" +"Поведінка за замовчуванням параметрів *mangle_from_* і *maxheaderlen* " +"полягає в дотриманні політики." + +msgid "" +"Print the textual representation of the message object structure rooted at " +"*msg* to the output file specified when the :class:`BytesGenerator` instance " +"was created." +msgstr "" +"Надрукуйте текстове представлення структури об’єкта повідомлення з коренем " +"*msg* у вихідний файл, указаний під час створення екземпляра :class:" +"`BytesGenerator`." + +msgid "" +"If the :mod:`~email.policy` option :attr:`~email.policy.Policy.cte_type` is " +"``8bit`` (the default), copy any headers in the original parsed message that " +"have not been modified to the output with any bytes with the high bit set " +"reproduced as in the original, and preserve the non-ASCII :mailheader:" +"`Content-Transfer-Encoding` of any body parts that have them. If " +"``cte_type`` is ``7bit``, convert the bytes with the high bit set as needed " +"using an ASCII-compatible :mailheader:`Content-Transfer-Encoding`. That is, " +"transform parts with non-ASCII :mailheader:`Content-Transfer-Encoding` (:" +"mailheader:`Content-Transfer-Encoding: 8bit`) to an ASCII compatible :" +"mailheader:`Content-Transfer-Encoding`, and encode RFC-invalid non-ASCII " +"bytes in headers using the MIME ``unknown-8bit`` character set, thus " +"rendering them RFC-compliant." +msgstr "" +"Якщо параметр :mod:`~email.policy` :attr:`~email.policy.Policy.cte_type` має " +"значення ``8bit`` (за замовчуванням), скопіюйте будь-які заголовки в " +"оригінальному проаналізованому повідомленні, які не були змінені на вихідні " +"дані з будь-якими байтами зі встановленим старшим бітом, відтвореним як в " +"оригіналі, і зберігають не-ASCII :mailheader:`Content-Transfer-Encoding` " +"будь-яких частин тіла, які їх мають. Якщо ``cte_type`` дорівнює ``7bit``, " +"конвертуйте байти з установленим старшим бітом за потреби за допомогою ASCII-" +"сумісного :mailheader:`Content-Transfer-Encoding`. Тобто перетворіть частини " +"з не-ASCII :mailheader:`Content-Transfer-Encoding` (:mailheader:`Content-" +"Transfer-Encoding: 8bit`) на ASCII-сумісне :mailheader:`Content-Transfer-" +"Encoding` і закодуйте RFC-недійсні байти не-ASCII у заголовках із " +"використанням набору символів MIME ``unknown-8bit``, що робить їх сумісними " +"з RFC." + +msgid "" +"If *unixfrom* is ``True``, print the envelope header delimiter used by the " +"Unix mailbox format (see :mod:`mailbox`) before the first of the :rfc:`5322` " +"headers of the root message object. If the root object has no envelope " +"header, craft a standard one. The default is ``False``. Note that for " +"subparts, no envelope header is ever printed." +msgstr "" +"Якщо *unixfrom* має значення ``True``, надрукуйте роздільник заголовка " +"конверта, який використовується форматом поштової скриньки Unix (див. :mod:" +"`mailbox`) перед першим із заголовків :rfc:`5322` кореневого об’єкта " +"повідомлення. Якщо кореневий об’єкт не має заголовка конверта, створіть " +"стандартний. Типовим значенням є ``False``. Зауважте, що для підчастин " +"заголовок конверта ніколи не друкується." + +msgid "" +"If *linesep* is not ``None``, use it as the separator character between all " +"the lines of the flattened message. If *linesep* is ``None`` (the default), " +"use the value specified in the *policy*." +msgstr "" +"Якщо *linesep* не є ``None``, використовуйте його як символ роздільника між " +"усіма рядками зведеного повідомлення. Якщо *linesep* має значення ``None`` " +"(за замовчуванням), використовуйте значення, указане в *policy*." + +msgid "" +"Return an independent clone of this :class:`BytesGenerator` instance with " +"the exact same option settings, and *fp* as the new *outfp*." +msgstr "" +"Повернути незалежний клон цього екземпляра :class:`BytesGenerator` з такими " +"самими налаштуваннями параметрів і *fp* як новий *outfp*." + +msgid "" +"Encode *s* using the ``ASCII`` codec and the ``surrogateescape`` error " +"handler, and pass it to the *write* method of the *outfp* passed to the :" +"class:`BytesGenerator`'s constructor." +msgstr "" +"Закодуйте *s* за допомогою кодека ``ASCII`` і обробника помилок " +"``surrogateescape`` і передайте його в метод *write* *outfp*, переданого " +"конструктору :class:`BytesGenerator`." + +msgid "" +"As a convenience, :class:`~email.message.EmailMessage` provides the methods :" +"meth:`~email.message.EmailMessage.as_bytes` and ``bytes(aMessage)`` (a.k.a. :" +"meth:`~email.message.EmailMessage.__bytes__`), which simplify the generation " +"of a serialized binary representation of a message object. For more detail, " +"see :mod:`email.message`." +msgstr "" +"Для зручності :class:`~email.message.EmailMessage` надає методи :meth:" +"`~email.message.EmailMessage.as_bytes` і ``bytes(aMessage)`` (він же :meth:" +"`~email.message .EmailMessage.__bytes__`), які спрощують створення " +"серіалізованого двійкового представлення об’єкта повідомлення. Щоб отримати " +"докладнішу інформацію, перегляньте :mod:`email.message`." + +msgid "" +"Because strings cannot represent binary data, the :class:`Generator` class " +"must convert any binary data in any message it flattens to an ASCII " +"compatible format, by converting them to an ASCII compatible :mailheader:" +"`Content-Transfer_Encoding`. Using the terminology of the email RFCs, you " +"can think of this as :class:`Generator` serializing to an I/O stream that is " +"not \"8 bit clean\". In other words, most applications will want to be " +"using :class:`BytesGenerator`, and not :class:`Generator`." +msgstr "" +"Оскільки рядки не можуть представляти двійкові дані, клас :class:`Generator` " +"повинен перетворювати будь-які двійкові дані в будь-якому повідомленні, яке " +"він об’єднує, у ASCII-сумісний формат, перетворюючи їх у ASCII-сумісний :" +"mailheader:`Content-Transfer_Encoding`. Використовуючи термінологію RFC " +"електронної пошти, ви можете думати про це як про :class:`Generator`, що " +"серіалізується на потік вводу/виводу, який не є \"8-бітним чистим\". Іншими " +"словами, більшість програм захочуть використовувати :class:`BytesGenerator`, " +"а не :class:`Generator`." + +msgid "" +"Return a :class:`Generator` object that will write any message provided to " +"the :meth:`flatten` method, or any text provided to the :meth:`write` " +"method, to the :term:`file-like object` *outfp*. *outfp* must support a " +"``write`` method that accepts string data." +msgstr "" +"Повертає об’єкт :class:`Generator`, який записуватиме будь-яке повідомлення, " +"надане методу :meth:`flatten`, або будь-який текст, наданий методу :meth:" +"`write`, у :term:`file-like object` *outfp*. *outfp* повинен підтримувати " +"метод ``write``, який приймає рядкові дані." + +msgid "" +"Print the textual representation of the message object structure rooted at " +"*msg* to the output file specified when the :class:`Generator` instance was " +"created." +msgstr "" +"Надрукуйте текстове представлення структури об’єкта повідомлення з коренем " +"*msg* у вихідний файл, указаний під час створення екземпляра :class:" +"`Generator`." + +msgid "" +"If the :mod:`~email.policy` option :attr:`~email.policy.Policy.cte_type` is " +"``8bit``, generate the message as if the option were set to ``7bit``. (This " +"is required because strings cannot represent non-ASCII bytes.) Convert any " +"bytes with the high bit set as needed using an ASCII-compatible :mailheader:" +"`Content-Transfer-Encoding`. That is, transform parts with non-ASCII :" +"mailheader:`Content-Transfer-Encoding` (:mailheader:`Content-Transfer-" +"Encoding: 8bit`) to an ASCII compatible :mailheader:`Content-Transfer-" +"Encoding`, and encode RFC-invalid non-ASCII bytes in headers using the MIME " +"``unknown-8bit`` character set, thus rendering them RFC-compliant." +msgstr "" +"Якщо параметр :mod:`~email.policy` :attr:`~email.policy.Policy.cte_type` має " +"значення ``8bit``, згенеруйте повідомлення так, ніби для параметра " +"встановлено значення ``7bit``. (Це потрібно, оскільки рядки не можуть " +"представляти байти, відмінні від ASCII.) Перетворюйте будь-які байти зі " +"старшим бітом, якщо потрібно, за допомогою ASCII-сумісного :mailheader:" +"`Content-Transfer-Encoding`. Тобто перетворіть частини з не-ASCII :" +"mailheader:`Content-Transfer-Encoding` (:mailheader:`Content-Transfer-" +"Encoding: 8bit`) на ASCII-сумісне :mailheader:`Content-Transfer-Encoding` і " +"закодуйте RFC-недійсні байти не-ASCII у заголовках із використанням набору " +"символів MIME ``unknown-8bit``, що робить їх сумісними з RFC." + +msgid "" +"Added support for re-encoding ``8bit`` message bodies, and the *linesep* " +"argument." +msgstr "" +"Додано підтримку перекодування тіл повідомлень ``8bit`` і аргументу " +"*linesep*." + +msgid "" +"Return an independent clone of this :class:`Generator` instance with the " +"exact same options, and *fp* as the new *outfp*." +msgstr "" +"Повернути незалежний клон цього екземпляра :class:`Generator` з такими " +"самими параметрами та *fp*, що й новий *outfp*." + +msgid "" +"Write *s* to the *write* method of the *outfp* passed to the :class:" +"`Generator`'s constructor. This provides just enough file-like API for :" +"class:`Generator` instances to be used in the :func:`print` function." +msgstr "" +"Запишіть *s* у метод *write* *outfp*, переданого конструктору :class:" +"`Generator`. Це забезпечує достатньо файлоподібного API для екземплярів :" +"class:`Generator` для використання у функції :func:`print`." + +msgid "" +"As a convenience, :class:`~email.message.EmailMessage` provides the methods :" +"meth:`~email.message.EmailMessage.as_string` and ``str(aMessage)`` (a.k.a. :" +"meth:`~email.message.EmailMessage.__str__`), which simplify the generation " +"of a formatted string representation of a message object. For more detail, " +"see :mod:`email.message`." +msgstr "" +"Для зручності :class:`~email.message.EmailMessage` надає методи :meth:" +"`~email.message.EmailMessage.as_string` і ``str(aMessage)`` (він же :meth:" +"`~email.message .EmailMessage.__str__`), які спрощують створення " +"відформатованого рядкового представлення об’єкта повідомлення. Щоб отримати " +"докладнішу інформацію, перегляньте :mod:`email.message`." + +msgid "" +"The :mod:`email.generator` module also provides a derived class, :class:" +"`DecodedGenerator`, which is like the :class:`Generator` base class, except " +"that non-\\ :mimetype:`text` parts are not serialized, but are instead " +"represented in the output stream by a string derived from a template filled " +"in with information about the part." +msgstr "" +"Модуль :mod:`email.generator` також надає похідний клас, :class:" +"`DecodedGenerator`, який схожий на базовий клас :class:`Generator`, за " +"винятком того, що не\\ :mimetype:`text` частини не є серіалізовані, але " +"натомість представлені у вихідному потоці рядком, отриманим із шаблону, " +"заповненого інформацією про частину." + +msgid "" +"Act like :class:`Generator`, except that for any subpart of the message " +"passed to :meth:`Generator.flatten`, if the subpart is of main type :" +"mimetype:`text`, print the decoded payload of the subpart, and if the main " +"type is not :mimetype:`text`, instead of printing it fill in the string " +"*fmt* using information from the part and print the resulting filled-in " +"string." +msgstr "" +"Дійте як :class:`Generator`, за винятком того, що для будь-якої підчастини " +"повідомлення, переданої до :meth:`Generator.flatten`, якщо підчастина має " +"основний тип :mimetype:`text`, друкується декодована корисна інформація " +"підчастини, і якщо основний тип не є :mimetype:`text`, замість друку " +"заповніть рядок *fmt*, використовуючи інформацію з частини, і надрукуйте " +"отриманий заповнений рядок." + +msgid "" +"To fill in *fmt*, execute ``fmt % part_info``, where ``part_info`` is a " +"dictionary composed of the following keys and values:" +msgstr "" +"Щоб заповнити *fmt*, виконайте ``fmt % part_info``, де ``part_info`` є " +"словником, що складається з таких ключів і значень:" + +msgid "``type`` -- Full MIME type of the non-\\ :mimetype:`text` part" +msgstr "``type`` -- повний тип MIME не\\ :mimetype:`text` частини" + +msgid "``maintype`` -- Main MIME type of the non-\\ :mimetype:`text` part" +msgstr "``maintype`` -- основний тип MIME не\\ :mimetype:`text` частини" + +msgid "``subtype`` -- Sub-MIME type of the non-\\ :mimetype:`text` part" +msgstr "``subtype`` -- Sub-MIME-тип не\\ :mimetype:`text` частини" + +msgid "``filename`` -- Filename of the non-\\ :mimetype:`text` part" +msgstr "``filename`` -- ім'я файлу не\\ :mimetype:`text` частини" + +msgid "" +"``description`` -- Description associated with the non-\\ :mimetype:`text` " +"part" +msgstr "``description`` -- Опис, пов’язаний з не\\ :mimetype:`text` частиною" + +msgid "" +"``encoding`` -- Content transfer encoding of the non-\\ :mimetype:`text` part" +msgstr "" +"``encoding`` -- кодування передачі вмісту не\\ :mimetype:`text` частини" + +msgid "If *fmt* is ``None``, use the following default *fmt*:" +msgstr "" +"Якщо *fmt* має значення ``None``, використовуйте такий *fmt* за " +"замовчуванням:" + +msgid "" +"\"[Non-text (%(type)s) part of message omitted, filename %(filename)s]\"" +msgstr "" +"\"[Нетекстова (%(type)s) частина повідомлення пропущена, ім'я файлу " +"%(filename)s]\"" + +msgid "" +"Optional *_mangle_from_* and *maxheaderlen* are as with the :class:" +"`Generator` base class." +msgstr "" +"Необов’язкові *_mangle_from_* і *maxheaderlen* такі ж, як у базового класу :" +"class:`Generator`." + +msgid "Footnotes" +msgstr "Виноски" + +msgid "" +"This statement assumes that you use the appropriate setting for " +"``unixfrom``, and that there are no :mod:`email.policy` settings calling for " +"automatic adjustments (for example, :attr:`~email.policy.EmailPolicy." +"refold_source` must be ``none``, which is *not* the default). It is also " +"not 100% true, since if the message does not conform to the RFC standards " +"occasionally information about the exact original text is lost during " +"parsing error recovery. It is a goal to fix these latter edge cases when " +"possible." +msgstr "" diff --git a/library/email_header.po b/library/email_header.po new file mode 100644 index 000000000..c7c05bda6 --- /dev/null +++ b/library/email_header.po @@ -0,0 +1,384 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 01:05+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!email.header`: Internationalized headers" +msgstr "" + +msgid "**Source code:** :source:`Lib/email/header.py`" +msgstr "**Вихідний код:** :source:`Lib/email/header.py`" + +msgid "" +"This module is part of the legacy (``Compat32``) email API. In the current " +"API encoding and decoding of headers is handled transparently by the " +"dictionary-like API of the :class:`~email.message.EmailMessage` class. In " +"addition to uses in legacy code, this module can be useful in applications " +"that need to completely control the character sets used when encoding " +"headers." +msgstr "" +"Цей модуль є частиною застарілого (``Compat32``) API електронної пошти. У " +"поточному API кодування та декодування заголовків обробляється прозоро за " +"допомогою словникового API класу :class:`~email.message.EmailMessage`. На " +"додаток до використання у застарілому коді, цей модуль може бути корисним у " +"програмах, яким потрібно повністю контролювати набори символів, що " +"використовуються під час кодування заголовків." + +msgid "" +"The remaining text in this section is the original documentation of the " +"module." +msgstr "Решта тексту в цьому розділі є оригінальною документацією модуля." + +msgid "" +":rfc:`2822` is the base standard that describes the format of email " +"messages. It derives from the older :rfc:`822` standard which came into " +"widespread use at a time when most email was composed of ASCII characters " +"only. :rfc:`2822` is a specification written assuming email contains only 7-" +"bit ASCII characters." +msgstr "" +":rfc:`2822` — це базовий стандарт, який описує формат електронних " +"повідомлень. Він походить від старішого стандарту :rfc:`822`, який набув " +"широкого використання в той час, коли більшість електронних листів " +"складалися лише з символів ASCII. :rfc:`2822` — це специфікація, написана за " +"умови, що електронна пошта містить лише 7-бітні символи ASCII." + +msgid "" +"Of course, as email has been deployed worldwide, it has become " +"internationalized, such that language specific character sets can now be " +"used in email messages. The base standard still requires email messages to " +"be transferred using only 7-bit ASCII characters, so a slew of RFCs have " +"been written describing how to encode email containing non-ASCII characters " +"into :rfc:`2822`\\ -compliant format. These RFCs include :rfc:`2045`, :rfc:" +"`2046`, :rfc:`2047`, and :rfc:`2231`. The :mod:`email` package supports " +"these standards in its :mod:`email.header` and :mod:`email.charset` modules." +msgstr "" +"Звичайно, оскільки електронна пошта була розгорнута в усьому світі, вона " +"стала інтернаціоналізованою, так що набори символів для певної мови тепер " +"можна використовувати в електронних повідомленнях. Базовий стандарт все ще " +"вимагає, щоб повідомлення електронної пошти передавалися лише з " +"використанням 7-бітових символів ASCII, тому було написано безліч RFC, які " +"описують, як кодувати електронну пошту, що містить символи, відмінні від " +"ASCII, у :rfc:`2822`\\ -сумісний формат. Ці RFC включають :rfc:`2045`, :rfc:" +"`2046`, :rfc:`2047` і :rfc:`2231`. Пакет :mod:`email` підтримує ці стандарти " +"у своїх модулях :mod:`email.header` і :mod:`email.charset`." + +msgid "" +"If you want to include non-ASCII characters in your email headers, say in " +"the :mailheader:`Subject` or :mailheader:`To` fields, you should use the :" +"class:`Header` class and assign the field in the :class:`~email.message." +"Message` object to an instance of :class:`Header` instead of using a string " +"for the header value. Import the :class:`Header` class from the :mod:`email." +"header` module. For example::" +msgstr "" +"Якщо ви хочете включити символи, відмінні від ASCII, у заголовки електронної " +"пошти, скажімо, у поля :mailheader:`Subject` або :mailheader:`To`, вам слід " +"використовувати клас :class:`Header` і призначити поле в :class:`~email." +"message.Message` до екземпляра :class:`Header` замість використання рядка " +"для значення заголовка. Імпортуйте клас :class:`Header` з модуля :mod:`email." +"header`. Наприклад::" + +msgid "" +">>> from email.message import Message\n" +">>> from email.header import Header\n" +">>> msg = Message()\n" +">>> h = Header('p\\xf6stal', 'iso-8859-1')\n" +">>> msg['Subject'] = h\n" +">>> msg.as_string()\n" +"'Subject: =?iso-8859-1?q?p=F6stal?=\\n\\n'" +msgstr "" + +msgid "" +"Notice here how we wanted the :mailheader:`Subject` field to contain a non-" +"ASCII character? We did this by creating a :class:`Header` instance and " +"passing in the character set that the byte string was encoded in. When the " +"subsequent :class:`~email.message.Message` instance was flattened, the :" +"mailheader:`Subject` field was properly :rfc:`2047` encoded. MIME-aware " +"mail readers would show this header using the embedded ISO-8859-1 character." +msgstr "" +"Зверніть увагу, як ми хотіли, щоб поле :mailheader:`Subject` містило символ " +"не ASCII? Ми зробили це, створивши екземпляр :class:`Header` і передавши " +"набір символів, у якому було закодовано рядок байтів. Коли наступний " +"екземпляр :class:`~email.message.Message` було зведено, :mailheader:" +"`Subject` було правильно закодовано :rfc:`2047`. Програми читання пошти з " +"підтримкою MIME відображатимуть цей заголовок за допомогою вбудованого " +"символу ISO-8859-1." + +msgid "Here is the :class:`Header` class description:" +msgstr "Ось опис класу :class:`Header`:" + +msgid "" +"Create a MIME-compliant header that can contain strings in different " +"character sets." +msgstr "" +"Створіть MIME-сумісний заголовок, який може містити рядки з різними наборами " +"символів." + +msgid "" +"Optional *s* is the initial header value. If ``None`` (the default), the " +"initial header value is not set. You can later append to the header with :" +"meth:`append` method calls. *s* may be an instance of :class:`bytes` or :" +"class:`str`, but see the :meth:`append` documentation for semantics." +msgstr "" +"Необов’язковий параметр *s* — початкове значення заголовка. Якщо ``None`` " +"(за замовчуванням), початкове значення заголовка не встановлено. Ви можете " +"пізніше додати до заголовка за допомогою викликів методу :meth:`append`. *s* " +"може бути екземпляром :class:`bytes` або :class:`str`, але див. " +"документацію :meth:`append` щодо семантики." + +msgid "" +"Optional *charset* serves two purposes: it has the same meaning as the " +"*charset* argument to the :meth:`append` method. It also sets the default " +"character set for all subsequent :meth:`append` calls that omit the " +"*charset* argument. If *charset* is not provided in the constructor (the " +"default), the ``us-ascii`` character set is used both as *s*'s initial " +"charset and as the default for subsequent :meth:`append` calls." +msgstr "" +"Додатковий *charset* служить двом цілям: він має те саме значення, що й " +"аргумент *charset* для методу :meth:`append`. Він також встановлює " +"стандартний набір символів для всіх наступних викликів :meth:`append`, які " +"пропускають аргумент *charset*. Якщо *charset* не надано в конструкторі (за " +"замовчуванням), набір символів ``us-ascii`` використовується і як початковий " +"набір символів *s*, і як типовий для наступних викликів :meth:`append`." + +msgid "" +"The maximum line length can be specified explicitly via *maxlinelen*. For " +"splitting the first line to a shorter value (to account for the field header " +"which isn't included in *s*, e.g. :mailheader:`Subject`) pass in the name of " +"the field in *header_name*. The default *maxlinelen* is 78, and the default " +"value for *header_name* is ``None``, meaning it is not taken into account " +"for the first line of a long, split header." +msgstr "" + +msgid "" +"Optional *continuation_ws* must be :rfc:`2822`\\ -compliant folding " +"whitespace, and is usually either a space or a hard tab character. This " +"character will be prepended to continuation lines. *continuation_ws* " +"defaults to a single space character." +msgstr "" +"Необов’язковий *continuation_ws* має бути :rfc:`2822`\\ -сумісним згортаним " +"пробілом і зазвичай є пробілом або символом жорсткої табуляції. Цей символ " +"буде додано до рядків продовження. *continuation_ws* за замовчуванням " +"використовує один пробіл." + +msgid "" +"Optional *errors* is passed straight through to the :meth:`append` method." +msgstr "" +"Необов’язкові *помилки* передаються безпосередньо до методу :meth:`append`." + +msgid "Append the string *s* to the MIME header." +msgstr "Додайте рядок *s* до заголовка MIME." + +msgid "" +"Optional *charset*, if given, should be a :class:`~email.charset.Charset` " +"instance (see :mod:`email.charset`) or the name of a character set, which " +"will be converted to a :class:`~email.charset.Charset` instance. A value of " +"``None`` (the default) means that the *charset* given in the constructor is " +"used." +msgstr "" +"Додатковий *charset*, якщо він наданий, має бути екземпляром :class:`~email." +"charset.Charset` (див. :mod:`email.charset`) або назвою набору символів, " +"який буде перетворено на :class:`~email.charset.Charset` екземпляр. Значення " +"``None`` (за замовчуванням) означає, що використовується *набір символів*, " +"наданий у конструкторі." + +msgid "" +"*s* may be an instance of :class:`bytes` or :class:`str`. If it is an " +"instance of :class:`bytes`, then *charset* is the encoding of that byte " +"string, and a :exc:`UnicodeError` will be raised if the string cannot be " +"decoded with that character set." +msgstr "" +"*s* може бути екземпляром :class:`bytes` або :class:`str`. Якщо це " +"екземпляр :class:`bytes`, тоді *charset* є кодуванням цього рядка байтів, і :" +"exc:`UnicodeError` буде викликано, якщо рядок не можна декодувати за " +"допомогою цього набору символів." + +msgid "" +"If *s* is an instance of :class:`str`, then *charset* is a hint specifying " +"the character set of the characters in the string." +msgstr "" +"Якщо *s* є екземпляром :class:`str`, тоді *charset* є підказкою, що визначає " +"набір символів у рядку." + +msgid "" +"In either case, when producing an :rfc:`2822`\\ -compliant header using :rfc:" +"`2047` rules, the string will be encoded using the output codec of the " +"charset. If the string cannot be encoded using the output codec, a " +"UnicodeError will be raised." +msgstr "" +"У будь-якому випадку, під час створення :rfc:`2822`\\ -сумісного заголовка з " +"використанням правил :rfc:`2047` рядок кодуватиметься за допомогою вихідного " +"кодека набору символів. Якщо рядок неможливо закодувати за допомогою " +"вихідного кодека, виникне UnicodeError." + +msgid "" +"Optional *errors* is passed as the errors argument to the decode call if *s* " +"is a byte string." +msgstr "" +"Необов’язковий *errors* передається як аргумент errors виклику декодування, " +"якщо *s* є рядком байтів." + +msgid "" +"Encode a message header into an RFC-compliant format, possibly wrapping long " +"lines and encapsulating non-ASCII parts in base64 or quoted-printable " +"encodings." +msgstr "" +"Закодуйте заголовок повідомлення у RFC-сумісний формат, можливо, обгортаючи " +"довгі рядки та інкапсулюючи частини, що не належать до ASCII, у кодування " +"base64 або кодування в лапках." + +msgid "" +"Optional *splitchars* is a string containing characters which should be " +"given extra weight by the splitting algorithm during normal header " +"wrapping. This is in very rough support of :RFC:`2822`\\'s 'higher level " +"syntactic breaks': split points preceded by a splitchar are preferred " +"during line splitting, with the characters preferred in the order in which " +"they appear in the string. Space and tab may be included in the string to " +"indicate whether preference should be given to one over the other as a split " +"point when other split chars do not appear in the line being split. " +"Splitchars does not affect :RFC:`2047` encoded lines." +msgstr "" +"Необов’язковий *splitchars* — це рядок, що містить символи, яким слід надати " +"додаткову вагу за допомогою алгоритму розбиття під час звичайного обгортання " +"заголовка. Це є дуже грубою підтримкою \"синтаксичних розривів вищого " +"рівня\" :RFC:`2822`: крапки розділення, яким передує символ розділення, є " +"кращими під час поділу рядка, а символи мають перевагу в тому порядку, в " +"якому вони з’являються в рядку. Пробіл і табуляція можуть бути включені в " +"рядок, щоб вказати, чи слід надавати перевагу одному над іншим як точці " +"розділення, коли інші символи розділення не з’являються в рядку, що " +"розділяється. Splitchars не впливає на рядки, закодовані :RFC:`2047`." + +msgid "" +"*maxlinelen*, if given, overrides the instance's value for the maximum line " +"length." +msgstr "" +"*maxlinelen*, якщо задано, замінює значення екземпляра для максимальної " +"довжини рядка." + +msgid "" +"*linesep* specifies the characters used to separate the lines of the folded " +"header. It defaults to the most useful value for Python application code " +"(``\\n``), but ``\\r\\n`` can be specified in order to produce headers with " +"RFC-compliant line separators." +msgstr "" +"*linesep* визначає символи, які використовуються для розділення рядків " +"згорнутого заголовка. За замовчуванням це найбільш корисне значення для коду " +"програми Python (``\\n``), але ``\\r\\n`` можна вказати, щоб створити " +"заголовки з RFC-сумісними роздільниками рядків." + +msgid "Added the *linesep* argument." +msgstr "Додано аргумент *linesep*." + +msgid "" +"The :class:`Header` class also provides a number of methods to support " +"standard operators and built-in functions." +msgstr "" +"Клас :class:`Header` також надає ряд методів для підтримки стандартних " +"операторів і вбудованих функцій." + +msgid "" +"Returns an approximation of the :class:`Header` as a string, using an " +"unlimited line length. All pieces are converted to unicode using the " +"specified encoding and joined together appropriately. Any pieces with a " +"charset of ``'unknown-8bit'`` are decoded as ASCII using the ``'replace'`` " +"error handler." +msgstr "" +"Повертає наближення :class:`Header` у вигляді рядка, використовуючи " +"необмежену довжину рядка. Усі фрагменти перетворюються на юнікод із " +"використанням зазначеного кодування та об’єднуються належним чином. Будь-які " +"фрагменти з кодуванням ``'unknown-8bit'`` декодуються як ASCII за допомогою " +"обробника помилок ``'replace'``." + +msgid "Added handling for the ``'unknown-8bit'`` charset." +msgstr "Додано обробку набору символів ``'unknown-8bit''``." + +msgid "" +"This method allows you to compare two :class:`Header` instances for equality." +msgstr "" +"Цей метод дозволяє порівнювати два екземпляри :class:`Header` на предмет " +"рівності." + +msgid "" +"This method allows you to compare two :class:`Header` instances for " +"inequality." +msgstr "" +"Цей метод дозволяє порівнювати два екземпляри :class:`Header` на предмет " +"нерівності." + +msgid "" +"The :mod:`email.header` module also provides the following convenient " +"functions." +msgstr "Модуль :mod:`email.header` також надає такі зручні функції." + +msgid "" +"Decode a message header value without converting the character set. The " +"header value is in *header*." +msgstr "" +"Декодуйте значення заголовка повідомлення без перетворення набору символів. " +"Значення заголовка знаходиться в *заголовку*." + +msgid "" +"This function returns a list of ``(decoded_string, charset)`` pairs " +"containing each of the decoded parts of the header. *charset* is ``None`` " +"for non-encoded parts of the header, otherwise a lower case string " +"containing the name of the character set specified in the encoded string." +msgstr "" +"Ця функція повертає список пар ``(decoded_string, charset)``, що містить " +"кожну з декодованих частин заголовка. *charset* має значення ``None`` для " +"незакодованих частин заголовка, інакше рядок у нижньому регістрі, що містить " +"назву набору символів, указаного в закодованому рядку." + +msgid "Here's an example::" +msgstr "Ось приклад::" + +msgid "" +">>> from email.header import decode_header\n" +">>> decode_header('=?iso-8859-1?q?p=F6stal?=')\n" +"[(b'p\\xf6stal', 'iso-8859-1')]" +msgstr "" + +msgid "" +"Create a :class:`Header` instance from a sequence of pairs as returned by :" +"func:`decode_header`." +msgstr "" +"Створіть екземпляр :class:`Header` із послідовності пар, які повертає :func:" +"`decode_header`." + +msgid "" +":func:`decode_header` takes a header value string and returns a sequence of " +"pairs of the format ``(decoded_string, charset)`` where *charset* is the " +"name of the character set." +msgstr "" +":func:`decode_header` приймає рядок значення заголовка та повертає " +"послідовність пар у форматі ``(decoded_string, charset)``, де *charset* — " +"назва набору символів." + +msgid "" +"This function takes one of those sequence of pairs and returns a :class:" +"`Header` instance. Optional *maxlinelen*, *header_name*, and " +"*continuation_ws* are as in the :class:`Header` constructor." +msgstr "" +"Ця функція бере одну з цих пар і повертає екземпляр :class:`Header`. " +"Необов’язкові *maxlinelen*, *header_name* і *continuation_ws* такі, як у " +"конструкторі :class:`Header`." diff --git a/library/email_headerregistry.po b/library/email_headerregistry.po new file mode 100644 index 000000000..7aa6bd966 --- /dev/null +++ b/library/email_headerregistry.po @@ -0,0 +1,757 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 01:05+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!email.headerregistry`: Custom Header Objects" +msgstr "" + +msgid "**Source code:** :source:`Lib/email/headerregistry.py`" +msgstr "**Вихідний код:** :source:`Lib/email/headerregistry.py`" + +msgid "[1]_" +msgstr "[1]_" + +msgid "" +"Headers are represented by customized subclasses of :class:`str`. The " +"particular class used to represent a given header is determined by the :attr:" +"`~email.policy.EmailPolicy.header_factory` of the :mod:`~email.policy` in " +"effect when the headers are created. This section documents the particular " +"``header_factory`` implemented by the email package for handling :RFC:`5322` " +"compliant email messages, which not only provides customized header objects " +"for various header types, but also provides an extension mechanism for " +"applications to add their own custom header types." +msgstr "" +"Заголовки представлені налаштованими підкласами :class:`str`. Конкретний " +"клас, який використовується для представлення даного заголовка, " +"визначається :attr:`~email.policy.EmailPolicy.header_factory` :mod:`~email." +"policy`, що діє під час створення заголовків. У цьому розділі описано " +"конкретну ``header_factory``, реалізовану пакетом електронної пошти для " +"обробки :RFC:`5322` сумісних повідомлень електронної пошти, яка не тільки " +"надає налаштовані об’єкти заголовків для різних типів заголовків, але також " +"забезпечує механізм розширення для додатків для додавання своїх власні типи " +"заголовків." + +msgid "" +"When using any of the policy objects derived from :data:`~email.policy." +"EmailPolicy`, all headers are produced by :class:`.HeaderRegistry` and have :" +"class:`.BaseHeader` as their last base class. Each header class has an " +"additional base class that is determined by the type of the header. For " +"example, many headers have the class :class:`.UnstructuredHeader` as their " +"other base class. The specialized second class for a header is determined " +"by the name of the header, using a lookup table stored in the :class:`." +"HeaderRegistry`. All of this is managed transparently for the typical " +"application program, but interfaces are provided for modifying the default " +"behavior for use by more complex applications." +msgstr "" +"При використанні будь-якого з об’єктів політики, отриманих від :data:`~email." +"policy.EmailPolicy`, усі заголовки створюються :class:`.HeaderRegistry` і " +"мають :class:`.BaseHeader` як останній базовий клас. Кожен клас заголовка " +"має додатковий базовий клас, який визначається типом заголовка. Наприклад, " +"багато заголовків мають клас :class:`.UnstructuredHeader` як інший базовий " +"клас. Спеціалізований другий клас для заголовка визначається назвою " +"заголовка за допомогою таблиці пошуку, що зберігається в :class:`." +"HeaderRegistry`. Усім цим керується прозоро для типової прикладної програми, " +"але надаються інтерфейси для зміни типової поведінки для використання більш " +"складними програмами." + +msgid "" +"The sections below first document the header base classes and their " +"attributes, followed by the API for modifying the behavior of :class:`." +"HeaderRegistry`, and finally the support classes used to represent the data " +"parsed from structured headers." +msgstr "" +"У розділах нижче спочатку описані базові класи заголовків та їх атрибути, " +"потім API для зміни поведінки :class:`.HeaderRegistry` і, нарешті, класи " +"підтримки, які використовуються для представлення даних, проаналізованих із " +"структурованих заголовків." + +msgid "" +"*name* and *value* are passed to ``BaseHeader`` from the :attr:`~email." +"policy.EmailPolicy.header_factory` call. The string value of any header " +"object is the *value* fully decoded to unicode." +msgstr "" +"*name* і *value* передаються в ``BaseHeader`` з виклику :attr:`~email.policy." +"EmailPolicy.header_factory`. Рядкове значення будь-якого об’єкта заголовка є " +"*значенням*, повністю декодованим у Юнікод." + +msgid "This base class defines the following read-only properties:" +msgstr "Цей базовий клас визначає наступні властивості лише для читання:" + +msgid "" +"The name of the header (the portion of the field before the ':'). This is " +"exactly the value passed in the :attr:`~email.policy.EmailPolicy." +"header_factory` call for *name*; that is, case is preserved." +msgstr "" +"Назва заголовка (частина поля перед \":\"). Це саме значення, передане у " +"виклику :attr:`~email.policy.EmailPolicy.header_factory` для *name*; тобто " +"регістр зберігається." + +msgid "" +"A tuple of :exc:`~email.errors.HeaderDefect` instances reporting any RFC " +"compliance problems found during parsing. The email package tries to be " +"complete about detecting compliance issues. See the :mod:`~email.errors` " +"module for a discussion of the types of defects that may be reported." +msgstr "" +"Кортеж екземплярів :exc:`~email.errors.HeaderDefect`, які повідомляють про " +"будь-які проблеми відповідності RFC, виявлені під час аналізу. Пакет " +"електронної пошти намагається бути повним щодо виявлення проблем " +"відповідності. Перегляньте модуль :mod:`~email.errors` для обговорення типів " +"дефектів, про які можна повідомити." + +msgid "" +"The maximum number of headers of this type that can have the same ``name``. " +"A value of ``None`` means unlimited. The ``BaseHeader`` value for this " +"attribute is ``None``; it is expected that specialized header classes will " +"override this value as needed." +msgstr "" +"Максимальна кількість заголовків цього типу, які можуть мати однакову назву. " +"Значення ``None`` означає необмежений. Значення ``BaseHeader`` для цього " +"атрибута є ``None``; очікується, що спеціалізовані класи заголовків замінять " +"це значення за потреби." + +msgid "" +"``BaseHeader`` also provides the following method, which is called by the " +"email library code and should not in general be called by application " +"programs:" +msgstr "" +"``BaseHeader`` також надає наступний метод, який викликається кодом " +"бібліотеки електронної пошти і, як правило, не повинен викликатися " +"прикладними програмами:" + +msgid "" +"Return a string containing :attr:`~email.policy.Policy.linesep` characters " +"as required to correctly fold the header according to *policy*. A :attr:" +"`~email.policy.Policy.cte_type` of ``8bit`` will be treated as if it were " +"``7bit``, since headers may not contain arbitrary binary data. If :attr:" +"`~email.policy.EmailPolicy.utf8` is ``False``, non-ASCII data will be :rfc:" +"`2047` encoded." +msgstr "" +"Повертає рядок, що містить символи :attr:`~email.policy.Policy.linesep`, " +"необхідні для правильного згортання заголовка відповідно до *policy*. :attr:" +"`~email.policy.Policy.cte_type` ``8bit`` буде розглядатися як ``7bit``, " +"оскільки заголовки не можуть містити довільних двійкових даних. Якщо :attr:" +"`~email.policy.EmailPolicy.utf8` має значення ``False``, дані, відмінні від " +"ASCII, будуть закодовані :rfc:`2047`." + +msgid "" +"``BaseHeader`` by itself cannot be used to create a header object. It " +"defines a protocol that each specialized header cooperates with in order to " +"produce the header object. Specifically, ``BaseHeader`` requires that the " +"specialized class provide a :func:`classmethod` named ``parse``. This " +"method is called as follows::" +msgstr "" +"``BaseHeader`` сам по собі не може використовуватися для створення об’єкта " +"заголовка. Він визначає протокол, з яким співпрацює кожен спеціалізований " +"заголовок, щоб створити об’єкт заголовка. Зокрема, ``BaseHeader`` вимагає, " +"щоб спеціалізований клас надавав :func:`classmethod` під назвою ``parse``. " +"Цей метод називається наступним чином:" + +msgid "parse(string, kwds)" +msgstr "" + +msgid "" +"``kwds`` is a dictionary containing one pre-initialized key, ``defects``. " +"``defects`` is an empty list. The parse method should append any detected " +"defects to this list. On return, the ``kwds`` dictionary *must* contain " +"values for at least the keys ``decoded`` and ``defects``. ``decoded`` " +"should be the string value for the header (that is, the header value fully " +"decoded to unicode). The parse method should assume that *string* may " +"contain content-transfer-encoded parts, but should correctly handle all " +"valid unicode characters as well so that it can parse un-encoded header " +"values." +msgstr "" +"``kwds`` — це словник, що містить один попередньо ініціалізований ключ, " +"``defects``. ``дефекти`` – порожній список. Метод аналізу має додати всі " +"виявлені дефекти до цього списку. Після повернення словник ``kwds`` *має* " +"містити значення принаймні для ключів ``decoded`` і ``defects``. ``decoded`` " +"має бути значенням рядка для заголовка (тобто, значення заголовка, повністю " +"декодоване в Юнікод). Метод синтаксичного аналізу має припускати, що *рядок* " +"може містити частини, закодовані перенесенням вмісту, але також має " +"правильно обробляти всі дійсні символи Unicode, щоб він міг аналізувати " +"незакодовані значення заголовка." + +msgid "" +"``BaseHeader``'s ``__new__`` then creates the header instance, and calls its " +"``init`` method. The specialized class only needs to provide an ``init`` " +"method if it wishes to set additional attributes beyond those provided by " +"``BaseHeader`` itself. Such an ``init`` method should look like this::" +msgstr "" +"Потім ``__new__`` ``BaseHeader`` створює екземпляр заголовка та викликає " +"його метод ``init``. Спеціалізованому класу потрібно лише надати метод " +"``init``, якщо він бажає встановити додаткові атрибути крім тих, що " +"надаються самим ``BaseHeader``. Такий метод ``init`` має виглядати так:" + +msgid "" +"def init(self, /, *args, **kw):\n" +" self._myattr = kw.pop('myattr')\n" +" super().init(*args, **kw)" +msgstr "" + +msgid "" +"That is, anything extra that the specialized class puts in to the ``kwds`` " +"dictionary should be removed and handled, and the remaining contents of " +"``kw`` (and ``args``) passed to the ``BaseHeader`` ``init`` method." +msgstr "" +"Тобто все зайве, що спеціалізований клас поміщає до словника ``kwds``, має " +"бути видалено та оброблено, а решта вмісту ``kw`` (та ``args``) передано до " +"``BaseHeader`` Метод ``init``." + +msgid "" +"An \"unstructured\" header is the default type of header in :rfc:`5322`. Any " +"header that does not have a specified syntax is treated as unstructured. " +"The classic example of an unstructured header is the :mailheader:`Subject` " +"header." +msgstr "" +"\"Неструктурований\" заголовок є типовим типом заголовка в :rfc:`5322`. Будь-" +"який заголовок, який не має визначеного синтаксису, вважається " +"неструктурованим. Класичним прикладом неструктурованого заголовка є " +"заголовок :mailheader:`Subject`." + +msgid "" +"In :rfc:`5322`, an unstructured header is a run of arbitrary text in the " +"ASCII character set. :rfc:`2047`, however, has an :rfc:`5322` compatible " +"mechanism for encoding non-ASCII text as ASCII characters within a header " +"value. When a *value* containing encoded words is passed to the " +"constructor, the ``UnstructuredHeader`` parser converts such encoded words " +"into unicode, following the :rfc:`2047` rules for unstructured text. The " +"parser uses heuristics to attempt to decode certain non-compliant encoded " +"words. Defects are registered in such cases, as well as defects for issues " +"such as invalid characters within the encoded words or the non-encoded text." +msgstr "" +"У :rfc:`5322` неструктурований заголовок — це довільний текст у наборі " +"символів ASCII. :rfc:`2047`, однак, має :rfc:`5322` сумісний механізм для " +"кодування не-ASCII тексту як символів ASCII у значенні заголовка. Коли " +"*значення*, що містить закодовані слова, передається конструктору, " +"аналізатор ``UnstructuredHeader`` перетворює такі закодовані слова в юнікод, " +"дотримуючись правил :rfc:`2047` для неструктурованого тексту. Синтаксичний " +"аналізатор використовує евристику, щоб спробувати декодувати певні " +"невідповідні закодовані слова. У таких випадках реєструються дефекти, а " +"також такі дефекти, як недійсні символи в закодованих словах або " +"незакодований текст." + +msgid "This header type provides no additional attributes." +msgstr "Цей тип заголовка не містить додаткових атрибутів." + +msgid "" +":rfc:`5322` specifies a very specific format for dates within email headers. " +"The ``DateHeader`` parser recognizes that date format, as well as " +"recognizing a number of variant forms that are sometimes found \"in the " +"wild\"." +msgstr "" +":rfc:`5322` визначає дуже специфічний формат для дат у заголовках " +"електронних листів. Синтаксичний аналізатор ``DateHeader`` розпізнає цей " +"формат дати, а також розпізнає низку варіантних форм, які іноді " +"зустрічаються \"в дикій природі\"." + +msgid "This header type provides the following additional attributes:" +msgstr "Цей тип заголовка надає такі додаткові атрибути:" + +msgid "" +"If the header value can be recognized as a valid date of one form or " +"another, this attribute will contain a :class:`~datetime.datetime` instance " +"representing that date. If the timezone of the input date is specified as " +"``-0000`` (indicating it is in UTC but contains no information about the " +"source timezone), then :attr:`.datetime` will be a naive :class:`~datetime." +"datetime`. If a specific timezone offset is found (including ``+0000``), " +"then :attr:`.datetime` will contain an aware ``datetime`` that uses :class:" +"`datetime.timezone` to record the timezone offset." +msgstr "" + +msgid "" +"The ``decoded`` value of the header is determined by formatting the " +"``datetime`` according to the :rfc:`5322` rules; that is, it is set to::" +msgstr "" +"Значення ``decoded`` заголовка визначається форматуванням ``datetime`` " +"відповідно до правил :rfc:`5322`; тобто встановлено::" + +msgid "email.utils.format_datetime(self.datetime)" +msgstr "" + +msgid "" +"When creating a ``DateHeader``, *value* may be :class:`~datetime.datetime` " +"instance. This means, for example, that the following code is valid and " +"does what one would expect::" +msgstr "" +"Під час створення ``DateHeader`` *значення* може бути екземпляром :class:" +"`~datetime.datetime`. Це означає, наприклад, що наступний код дійсний і " +"виконує те, що можна очікувати:" + +msgid "msg['Date'] = datetime(2011, 7, 15, 21)" +msgstr "" + +msgid "" +"Because this is a naive ``datetime`` it will be interpreted as a UTC " +"timestamp, and the resulting value will have a timezone of ``-0000``. Much " +"more useful is to use the :func:`~email.utils.localtime` function from the :" +"mod:`~email.utils` module::" +msgstr "" +"Оскільки це проста ``datetime``, вона буде інтерпретована як мітка часу UTC, " +"а результуюче значення матиме часовий пояс ``-0000``. Набагато кориснішим є " +"використання функції :func:`~email.utils.localtime` з модуля :mod:`~email." +"utils`::" + +msgid "msg['Date'] = utils.localtime()" +msgstr "" + +msgid "" +"This example sets the date header to the current time and date using the " +"current timezone offset." +msgstr "" +"У цьому прикладі в заголовку дати встановлюється поточний час і дата з " +"використанням поточного зміщення часового поясу." + +msgid "" +"Address headers are one of the most complex structured header types. The " +"``AddressHeader`` class provides a generic interface to any address header." +msgstr "" +"Заголовки адрес є одним із найскладніших структурованих типів заголовків. " +"Клас ``AddressHeader`` забезпечує загальний інтерфейс для будь-якого " +"заголовка адреси." + +msgid "" +"A tuple of :class:`.Group` objects encoding the addresses and groups found " +"in the header value. Addresses that are not part of a group are represented " +"in this list as single-address ``Groups`` whose :attr:`~.Group.display_name` " +"is ``None``." +msgstr "" +"Кортеж об’єктів :class:`.Group`, що кодує адреси та групи, знайдені у " +"значенні заголовка. Адреси, які не є частиною групи, представлені в цьому " +"списку як одноадресні ``Групи``, у яких :attr:`~.Group.display_name` має " +"значення ``None``." + +msgid "" +"A tuple of :class:`.Address` objects encoding all of the individual " +"addresses from the header value. If the header value contains any groups, " +"the individual addresses from the group are included in the list at the " +"point where the group occurs in the value (that is, the list of addresses is " +"\"flattened\" into a one dimensional list)." +msgstr "" +"Кортеж об’єктів :class:`.Address`, що кодує всі окремі адреси зі значення " +"заголовка. Якщо значення заголовка містить будь-які групи, окремі адреси з " +"групи включаються до списку в тому місці, де група зустрічається у значенні " +"(тобто список адрес \"зрівнюється\" в одновимірний список)." + +msgid "" +"The ``decoded`` value of the header will have all encoded words decoded to " +"unicode. :class:`~encodings.idna` encoded domain names are also decoded to " +"unicode. The ``decoded`` value is set by :ref:`joining ` " +"the :class:`str` value of the elements of the ``groups`` attribute with ``', " +"'``." +msgstr "" + +msgid "" +"A list of :class:`.Address` and :class:`.Group` objects in any combination " +"may be used to set the value of an address header. ``Group`` objects whose " +"``display_name`` is ``None`` will be interpreted as single addresses, which " +"allows an address list to be copied with groups intact by using the list " +"obtained from the ``groups`` attribute of the source header." +msgstr "" +"Для встановлення значення заголовка адреси можна використовувати список " +"об’єктів :class:`.Address` і :class:`.Group` у будь-якій комбінації. Об’єкти " +"``Групи``, у яких ``display_name`` є ``None``, інтерпретуватимуться як " +"окремі адреси, що дозволяє скопіювати список адрес із недоторканими групами " +"за допомогою списку, отриманого з атрибута ``groups`` вихідний заголовок." + +msgid "" +"A subclass of :class:`.AddressHeader` that adds one additional attribute:" +msgstr "Підклас :class:`.AddressHeader`, який додає один додатковий атрибут:" + +msgid "" +"The single address encoded by the header value. If the header value " +"actually contains more than one address (which would be a violation of the " +"RFC under the default :mod:`~email.policy`), accessing this attribute will " +"result in a :exc:`ValueError`." +msgstr "" +"Єдина адреса, закодована значенням заголовка. Якщо значення заголовка " +"насправді містить більше однієї адреси (що було б порушенням RFC за " +"умовчанням :mod:`~email.policy`), доступ до цього атрибута призведе до :exc:" +"`ValueError`." + +msgid "" +"Many of the above classes also have a ``Unique`` variant (for example, " +"``UniqueUnstructuredHeader``). The only difference is that in the " +"``Unique`` variant, :attr:`~.BaseHeader.max_count` is set to 1." +msgstr "" +"Багато з наведених вище класів також мають варіант ``Unique`` (наприклад, " +"``UniqueUnstructuredHeader``). Єдина відмінність полягає в тому, що у " +"варіанті ``Unique`` :attr:`~.BaseHeader.max_count` має значення 1." + +msgid "" +"There is really only one valid value for the :mailheader:`MIME-Version` " +"header, and that is ``1.0``. For future proofing, this header class " +"supports other valid version numbers. If a version number has a valid value " +"per :rfc:`2045`, then the header object will have non-``None`` values for " +"the following attributes:" +msgstr "" +"Насправді існує лише одне дійсне значення для заголовка :mailheader:`MIME-" +"Version`, і це ``1.0``. Для майбутньої перевірки цей клас заголовка " +"підтримує інші дійсні номери версій. Якщо номер версії має дійсне значення " +"для :rfc:`2045`, тоді об’єкт заголовка матиме значення, відмінні від " +"``None`` для таких атрибутів:" + +msgid "" +"The version number as a string, with any whitespace and/or comments removed." +msgstr "" +"Номер версії у вигляді рядка з видаленими пробілами та/або коментарями." + +msgid "The major version number as an integer" +msgstr "Основний номер версії як ціле число" + +msgid "The minor version number as an integer" +msgstr "Номер другорядної версії як ціле число" + +msgid "" +"MIME headers all start with the prefix 'Content-'. Each specific header has " +"a certain value, described under the class for that header. Some can also " +"take a list of supplemental parameters, which have a common format. This " +"class serves as a base for all the MIME headers that take parameters." +msgstr "" +"Усі заголовки MIME починаються з префікса \"Content-\". Кожен конкретний " +"заголовок має певне значення, описане в класі для цього заголовка. Деякі " +"також можуть приймати список додаткових параметрів, які мають загальний " +"формат. Цей клас служить основою для всіх заголовків MIME, які приймають " +"параметри." + +msgid "A dictionary mapping parameter names to parameter values." +msgstr "Словник, що зіставляє назви параметрів зі значеннями параметрів." + +msgid "" +"A :class:`ParameterizedMIMEHeader` class that handles the :mailheader:" +"`Content-Type` header." +msgstr "" +"Клас :class:`ParameterizedMIMEHeader`, який обробляє заголовок :mailheader:" +"`Content-Type`." + +msgid "The content type string, in the form ``maintype/subtype``." +msgstr "Рядок типу вмісту у формі ``maintype/subtype``." + +msgid "" +"A :class:`ParameterizedMIMEHeader` class that handles the :mailheader:" +"`Content-Disposition` header." +msgstr "" +"Клас :class:`ParameterizedMIMEHeader`, який обробляє заголовок :mailheader:" +"`Content-Disposition`." + +msgid "``inline`` and ``attachment`` are the only valid values in common use." +msgstr "" +"``inline`` і ``attachment`` є єдиними допустимими значеннями, які широко " +"використовуються." + +msgid "Handles the :mailheader:`Content-Transfer-Encoding` header." +msgstr "Обробляє заголовок :mailheader:`Content-Transfer-Encoding`." + +msgid "" +"Valid values are ``7bit``, ``8bit``, ``base64``, and ``quoted-printable``. " +"See :rfc:`2045` for more information." +msgstr "" +"Дійсні значення: ``7bit``, ``8bit``, ``base64`` і ``quoted-printable``. " +"Перегляньте :rfc:`2045` для отримання додаткової інформації." + +msgid "" +"This is the factory used by :class:`~email.policy.EmailPolicy` by default. " +"``HeaderRegistry`` builds the class used to create a header instance " +"dynamically, using *base_class* and a specialized class retrieved from a " +"registry that it holds. When a given header name does not appear in the " +"registry, the class specified by *default_class* is used as the specialized " +"class. When *use_default_map* is ``True`` (the default), the standard " +"mapping of header names to classes is copied in to the registry during " +"initialization. *base_class* is always the last class in the generated " +"class's :class:`~type.__bases__` list." +msgstr "" + +msgid "The default mappings are:" +msgstr "Відображення за замовчуванням:" + +msgid "subject" +msgstr "тема" + +msgid "UniqueUnstructuredHeader" +msgstr "UniqueUnstructuredHeader" + +msgid "date" +msgstr "дата" + +msgid "UniqueDateHeader" +msgstr "UniqueDateHeader" + +msgid "resent-date" +msgstr "дата повторного відправлення" + +msgid "DateHeader" +msgstr "DateHeader" + +msgid "orig-date" +msgstr "дата виходу" + +msgid "sender" +msgstr "відправник" + +msgid "UniqueSingleAddressHeader" +msgstr "UniqueSingleAddressHeader" + +msgid "resent-sender" +msgstr "resent-sender" + +msgid "SingleAddressHeader" +msgstr "SingleAddressHeader" + +msgid "to" +msgstr "до" + +msgid "UniqueAddressHeader" +msgstr "UniqueAddressHeader" + +msgid "resent-to" +msgstr "обурюватися" + +msgid "AddressHeader" +msgstr "AddressHeader" + +msgid "cc" +msgstr "cc" + +msgid "resent-cc" +msgstr "resent-cc" + +msgid "bcc" +msgstr "прихована копія" + +msgid "resent-bcc" +msgstr "resent-bcc" + +msgid "from" +msgstr "від" + +msgid "resent-from" +msgstr "обурюватися-від" + +msgid "reply-to" +msgstr "відповідати на" + +msgid "mime-version" +msgstr "мім-версія" + +msgid "MIMEVersionHeader" +msgstr "MIMEVersionHeader" + +msgid "content-type" +msgstr "тип вмісту" + +msgid "ContentTypeHeader" +msgstr "ContentTypeHeader" + +msgid "content-disposition" +msgstr "зміст-диспозиція" + +msgid "ContentDispositionHeader" +msgstr "ContentDispositionHeader" + +msgid "content-transfer-encoding" +msgstr "кодування передачі вмісту" + +msgid "ContentTransferEncodingHeader" +msgstr "ContentTransferEncodingHeader" + +msgid "message-id" +msgstr "ідентифікатор повідомлення" + +msgid "MessageIDHeader" +msgstr "MessageIDHeader" + +msgid "``HeaderRegistry`` has the following methods:" +msgstr "``HeaderRegistry`` має такі методи:" + +msgid "" +"*name* is the name of the header to be mapped. It will be converted to " +"lower case in the registry. *cls* is the specialized class to be used, " +"along with *base_class*, to create the class used to instantiate headers " +"that match *name*." +msgstr "" +"*ім’я* — це ім’я заголовка, який буде зіставлено. У реєстрі його буде " +"перетворено на нижній регістр. *cls* — це спеціалізований клас, який " +"використовується разом із *base_class* для створення класу, що " +"використовується для створення екземплярів заголовків, які відповідають " +"*name*." + +msgid "Construct and return a class to handle creating a *name* header." +msgstr "Створіть і поверніть клас для створення заголовка *name*." + +msgid "" +"Retrieves the specialized header associated with *name* from the registry " +"(using *default_class* if *name* does not appear in the registry) and " +"composes it with *base_class* to produce a class, calls the constructed " +"class's constructor, passing it the same argument list, and finally returns " +"the class instance created thereby." +msgstr "" +"Отримує спеціальний заголовок, пов’язаний з *name*, із реєстру " +"(використовуючи *default_class*, якщо *name* не відображається в реєстрі) і " +"створює його з *base_class* для створення класу, викликає конструктор " +"створеного класу, передаючи йому те саме список аргументів і, нарешті, " +"повертає екземпляр класу, створений таким чином." + +msgid "" +"The following classes are the classes used to represent data parsed from " +"structured headers and can, in general, be used by an application program to " +"construct structured values to assign to specific headers." +msgstr "" +"Наступні класи є класами, які використовуються для представлення даних, " +"розібраних із структурованих заголовків, і можуть, загалом, " +"використовуватися прикладною програмою для створення структурованих значень " +"для призначення певним заголовкам." + +msgid "" +"The class used to represent an email address. The general form of an " +"address is::" +msgstr "" +"Клас, який використовується для представлення електронної адреси. Загальна " +"форма адреси:" + +msgid "[display_name] " +msgstr "" + +msgid "or::" +msgstr "або::" + +msgid "username@domain" +msgstr "" + +msgid "" +"where each part must conform to specific syntax rules spelled out in :rfc:" +"`5322`." +msgstr "" +"де кожна частина має відповідати певним правилам синтаксису, викладеним у :" +"rfc:`5322`." + +msgid "" +"As a convenience *addr_spec* can be specified instead of *username* and " +"*domain*, in which case *username* and *domain* will be parsed from the " +"*addr_spec*. An *addr_spec* must be a properly RFC quoted string; if it is " +"not ``Address`` will raise an error. Unicode characters are allowed and " +"will be property encoded when serialized. However, per the RFCs, unicode is " +"*not* allowed in the username portion of the address." +msgstr "" +"Для зручності можна вказати *addr_spec* замість *username* і *domain*, у " +"цьому випадку *username* і *domain* будуть аналізуватися з *addr_spec*. " +"*addr_spec* має бути належним чином цитованим рядком RFC; якщо це не " +"``Address``, викличе помилку. Дозволяються символи Юнікоду, які будуть " +"закодовані властивостями під час серіалізації. Однак, згідно з RFC, Юнікод " +"*не* дозволений у частині імені користувача адреси." + +msgid "" +"The display name portion of the address, if any, with all quoting removed. " +"If the address does not have a display name, this attribute will be an empty " +"string." +msgstr "" +"Частина відображуваної назви адреси, якщо така є, без лапок. Якщо адреса не " +"має відображуваного імені, цей атрибут буде порожнім рядком." + +msgid "The ``username`` portion of the address, with all quoting removed." +msgstr "Частина ``ім’я користувача`` адреси з видаленням лапок." + +msgid "The ``domain`` portion of the address." +msgstr "Частина ``domain`` адреси." + +msgid "" +"The ``username@domain`` portion of the address, correctly quoted for use as " +"a bare address (the second form shown above). This attribute is not mutable." +msgstr "" +"Частина адреси ``username@domain``, правильно взята в лапки для використання " +"як чистої адреси (друга форма, показана вище). Цей атрибут не змінний." + +msgid "" +"The ``str`` value of the object is the address quoted according to :rfc:" +"`5322` rules, but with no Content Transfer Encoding of any non-ASCII " +"characters." +msgstr "" +"Значення ``str`` об'єкта є адресою в цитатах відповідно до правил :rfc:" +"`5322`, але без кодування передачі вмісту будь-яких символів, відмінних від " +"ASCII." + +msgid "" +"To support SMTP (:rfc:`5321`), ``Address`` handles one special case: if " +"``username`` and ``domain`` are both the empty string (or ``None``), then " +"the string value of the ``Address`` is ``<>``." +msgstr "" +"Щоб підтримувати SMTP (:rfc:`5321`), ``Address`` обробляє один особливий " +"випадок: якщо ``username`` і ``domain`` є порожнім рядком (або ``None``), " +"тоді рядкове значення ``Address`` - ``<>``." + +msgid "" +"The class used to represent an address group. The general form of an " +"address group is::" +msgstr "" +"Клас, який використовується для представлення групи адрес. Загальна форма " +"групи адрес:" + +msgid "display_name: [address-list];" +msgstr "" + +msgid "" +"As a convenience for processing lists of addresses that consist of a mixture " +"of groups and single addresses, a ``Group`` may also be used to represent " +"single addresses that are not part of a group by setting *display_name* to " +"``None`` and providing a list of the single address as *addresses*." +msgstr "" +"Для зручності обробки списків адрес, які складаються з суміші груп і окремих " +"адрес, ``Група`` також може використовуватися для представлення окремих " +"адрес, які не є частиною групи, встановивши *display_name* на ``None`` і " +"надання списку однієї адреси як *адрес*." + +msgid "" +"The ``display_name`` of the group. If it is ``None`` and there is exactly " +"one ``Address`` in ``addresses``, then the ``Group`` represents a single " +"address that is not in a group." +msgstr "" +"``display_name`` групи. Якщо значення ``None`` і в ``адресах`` є точно одна " +"``Адреса``, тоді ``Група`` представляє одну адресу, яка не входить до групи." + +msgid "" +"A possibly empty tuple of :class:`.Address` objects representing the " +"addresses in the group." +msgstr "" +"Можливо, порожній кортеж об’єктів :class:`.Address`, що представляє адреси в " +"групі." + +msgid "" +"The ``str`` value of a ``Group`` is formatted according to :rfc:`5322`, but " +"with no Content Transfer Encoding of any non-ASCII characters. If " +"``display_name`` is none and there is a single ``Address`` in the " +"``addresses`` list, the ``str`` value will be the same as the ``str`` of " +"that single ``Address``." +msgstr "" +"Значення ``str`` ``Group`` відформатовано відповідно до :rfc:`5322`, але без " +"кодування передачі вмісту будь-яких символів, відмінних від ASCII. Якщо " +"``display_name`` не має значення, а в списку ``addresses`` є одна " +"``Address``, значення ``str`` буде таким самим, як ``str`` цього одного " +"``Address``." + +msgid "Footnotes" +msgstr "Виноски" + +msgid "" +"Originally added in 3.3 as a :term:`provisional module `" +msgstr "" +"Спочатку додано в 3.3 як :term:`проміжний модуль `" diff --git a/library/email_iterators.po b/library/email_iterators.po new file mode 100644 index 000000000..1b81595a1 --- /dev/null +++ b/library/email_iterators.po @@ -0,0 +1,133 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 01:05+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!email.iterators`: Iterators" +msgstr "" + +msgid "**Source code:** :source:`Lib/email/iterators.py`" +msgstr "**Вихідний код:** :source:`Lib/email/iterators.py`" + +msgid "" +"Iterating over a message object tree is fairly easy with the :meth:`Message." +"walk ` method. The :mod:`email.iterators` " +"module provides some useful higher level iterations over message object " +"trees." +msgstr "" +"Ітерація дерева об’єктів повідомлення досить проста за допомогою методу :" +"meth:`Message.walk `. Модуль :mod:`email." +"iterators` забезпечує деякі корисні ітерації вищого рівня над деревами " +"об’єктів повідомлень." + +msgid "" +"This iterates over all the payloads in all the subparts of *msg*, returning " +"the string payloads line-by-line. It skips over all the subpart headers, " +"and it skips over any subpart with a payload that isn't a Python string. " +"This is somewhat equivalent to reading the flat text representation of the " +"message from a file using :meth:`~io.TextIOBase.readline`, skipping over all " +"the intervening headers." +msgstr "" +"Це повторює всі корисні навантаження в усіх підчастинах *msg*, повертаючи " +"рядкові корисні навантаження рядок за рядком. Він пропускає всі заголовки " +"підчастини, а також пропускає будь-яку підчастину з корисним навантаженням, " +"яке не є рядком Python. Це дещо еквівалентно читанню простого текстового " +"представлення повідомлення з файлу за допомогою :meth:`~io.TextIOBase." +"readline`, пропускаючи всі проміжні заголовки." + +msgid "" +"Optional *decode* is passed through to :meth:`Message.get_payload `." +msgstr "" +"Додаткове *decode* передається до :meth:`Message.get_payload `." + +msgid "" +"This iterates over all the subparts of *msg*, returning only those subparts " +"that match the MIME type specified by *maintype* and *subtype*." +msgstr "" +"Це повторює всі підчастини *msg*, повертаючи лише ті підчастини, які " +"відповідають типу MIME, визначеному *maintype* і *subtype*." + +msgid "" +"Note that *subtype* is optional; if omitted, then subpart MIME type matching " +"is done only with the main type. *maintype* is optional too; it defaults " +"to :mimetype:`text`." +msgstr "" +"Зауважте, що *підтип* необов’язковий; якщо опущено, то зіставлення типу MIME " +"підрозділу виконується лише з основним типом. *maintype* також " +"необов'язковий; за замовчуванням :mimetype:`text`." + +msgid "" +"Thus, by default :func:`typed_subpart_iterator` returns each subpart that " +"has a MIME type of :mimetype:`text/\\*`." +msgstr "" +"Таким чином, за замовчуванням :func:`typed_subpart_iterator` повертає кожну " +"підчастину, яка має тип MIME :mimetype:`text/\\*`." + +msgid "" +"The following function has been added as a useful debugging tool. It should " +"*not* be considered part of the supported public interface for the package." +msgstr "" +"Наведену нижче функцію було додано як корисний інструмент налагодження. Його " +"*не* слід вважати частиною підтримуваного загальнодоступного інтерфейсу " +"пакета." + +msgid "" +"Prints an indented representation of the content types of the message object " +"structure. For example:" +msgstr "" +"Друкує представлення типів вмісту структури об’єкта повідомлення з " +"відступом. Наприклад:" + +msgid "" +">>> msg = email.message_from_file(somefile)\n" +">>> _structure(msg)\n" +"multipart/mixed\n" +" text/plain\n" +" text/plain\n" +" multipart/digest\n" +" message/rfc822\n" +" text/plain\n" +" message/rfc822\n" +" text/plain\n" +" message/rfc822\n" +" text/plain\n" +" message/rfc822\n" +" text/plain\n" +" message/rfc822\n" +" text/plain\n" +" text/plain" +msgstr "" + +msgid "" +"Optional *fp* is a file-like object to print the output to. It must be " +"suitable for Python's :func:`print` function. *level* is used internally. " +"*include_default*, if true, prints the default type as well." +msgstr "" +"Необов’язковий *fp* — це файлоподібний об’єкт, у який потрібно надрукувати " +"вихідні дані. Він має відповідати функції :func:`print` Python. *level* " +"використовується внутрішньо. *include_default*, якщо true, також друкує тип " +"за замовчуванням." diff --git a/library/email_message.po b/library/email_message.po new file mode 100644 index 000000000..c8e984951 --- /dev/null +++ b/library/email_message.po @@ -0,0 +1,1138 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2025 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 01:05+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2025\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!email.message`: Representing an email message" +msgstr "" + +msgid "**Source code:** :source:`Lib/email/message.py`" +msgstr "**Вихідний код:** :source:`Lib/email/message.py`" + +msgid "[1]_" +msgstr "[1]_" + +msgid "" +"The central class in the :mod:`email` package is the :class:`EmailMessage` " +"class, imported from the :mod:`email.message` module. It is the base class " +"for the :mod:`email` object model. :class:`EmailMessage` provides the core " +"functionality for setting and querying header fields, for accessing message " +"bodies, and for creating or modifying structured messages." +msgstr "" +"Центральним класом у пакеті :mod:`email` є клас :class:`EmailMessage`, " +"імпортований із модуля :mod:`email.message`. Це базовий клас для об’єктної " +"моделі :mod:`email`. :class:`EmailMessage` забезпечує основну " +"функціональність для налаштування та запиту полів заголовків, для доступу до " +"тіла повідомлень, а також для створення або зміни структурованих повідомлень." + +msgid "" +"An email message consists of *headers* and a *payload* (which is also " +"referred to as the *content*). Headers are :rfc:`5322` or :rfc:`6532` style " +"field names and values, where the field name and value are separated by a " +"colon. The colon is not part of either the field name or the field value. " +"The payload may be a simple text message, or a binary object, or a " +"structured sequence of sub-messages each with their own set of headers and " +"their own payload. The latter type of payload is indicated by the message " +"having a MIME type such as :mimetype:`multipart/\\*` or :mimetype:`message/" +"rfc822`." +msgstr "" +"Повідомлення електронної пошти складається з *заголовків* і *корисного " +"навантаження* (яке також називають *контентом*). Заголовки — це імена та " +"значення полів у стилі :rfc:`5322` або :rfc:`6532`, де назва поля та " +"значення розділені двокрапкою. Двокрапка не є частиною ані імені поля, ані " +"значення поля. Корисне навантаження може бути простим текстовим " +"повідомленням, або двійковим об’єктом, або структурованою послідовністю " +"підповідомлень, кожне з яких має власний набір заголовків і власне корисне " +"навантаження. Останній тип корисного навантаження вказується повідомленням, " +"що має тип MIME, наприклад :mimetype:`multipart/\\*` або :mimetype:`message/" +"rfc822`." + +msgid "" +"The conceptual model provided by an :class:`EmailMessage` object is that of " +"an ordered dictionary of headers coupled with a *payload* that represents " +"the :rfc:`5322` body of the message, which might be a list of sub-" +"``EmailMessage`` objects. In addition to the normal dictionary methods for " +"accessing the header names and values, there are methods for accessing " +"specialized information from the headers (for example the MIME content " +"type), for operating on the payload, for generating a serialized version of " +"the message, and for recursively walking over the object tree." +msgstr "" +"Концептуальна модель, надана об’єктом :class:`EmailMessage`, — це " +"впорядкований словник заголовків у поєднанні з *корисним навантаженням*, " +"який представляє тіло :rfc:`5322` повідомлення, яке може бути списком під-` " +"Об’єкти ``EmailMessage``. На додаток до звичайних методів словника для " +"доступу до імен і значень заголовків, існують методи для доступу до " +"спеціальної інформації із заголовків (наприклад, типу вмісту MIME), для " +"роботи з корисним навантаженням, для генерації серіалізованої версії " +"повідомлення та для рекурсивного переходу по дереву об'єктів." + +msgid "" +"The :class:`EmailMessage` dictionary-like interface is indexed by the header " +"names, which must be ASCII values. The values of the dictionary are strings " +"with some extra methods. Headers are stored and returned in case-preserving " +"form, but field names are matched case-insensitively. The keys are ordered, " +"but unlike a real dict, there can be duplicates. Additional methods are " +"provided for working with headers that have duplicate keys." +msgstr "" + +msgid "" +"The *payload* is either a string or bytes object, in the case of simple " +"message objects, or a list of :class:`EmailMessage` objects, for MIME " +"container documents such as :mimetype:`multipart/\\*` and :mimetype:`message/" +"rfc822` message objects." +msgstr "" +"*Корисне навантаження* — це об’єкт рядка чи байтів у випадку простих " +"об’єктів повідомлення, або список об’єктів :class:`EmailMessage` для " +"документів-контейнерів MIME, таких як :mimetype:`multipart/\\*` і :mimetype:" +"`message/rfc822` об’єкти повідомлення." + +msgid "" +"If *policy* is specified use the rules it specifies to update and serialize " +"the representation of the message. If *policy* is not set, use the :class:" +"`~email.policy.default` policy, which follows the rules of the email RFCs " +"except for line endings (instead of the RFC mandated ``\\r\\n``, it uses the " +"Python standard ``\\n`` line endings). For more information see the :mod:" +"`~email.policy` documentation." +msgstr "" +"Якщо вказано *політику*, використовуйте правила, які вона визначає, щоб " +"оновити та серіалізувати представлення повідомлення. Якщо *policy* не " +"встановлено, використовуйте політику :class:`~email.policy.default`, яка " +"відповідає правилам RFC електронної пошти, за винятком закінчення рядків " +"(замість RFC, передбаченого ``\\r\\n``, він використовує стандартні " +"закінчення рядків Python ``\\n``). Для отримання додаткової інформації " +"дивіться документацію :mod:`~email.policy`." + +msgid "" +"Return the entire message flattened as a string. When optional *unixfrom* " +"is true, the envelope header is included in the returned string. *unixfrom* " +"defaults to ``False``. For backward compatibility with the base :class:" +"`~email.message.Message` class *maxheaderlen* is accepted, but defaults to " +"``None``, which means that by default the line length is controlled by the :" +"attr:`~email.policy.Policy.max_line_length` of the policy. The *policy* " +"argument may be used to override the default policy obtained from the " +"message instance. This can be used to control some of the formatting " +"produced by the method, since the specified *policy* will be passed to the :" +"class:`~email.generator.Generator`." +msgstr "" + +msgid "" +"Flattening the message may trigger changes to the :class:`EmailMessage` if " +"defaults need to be filled in to complete the transformation to a string " +"(for example, MIME boundaries may be generated or modified)." +msgstr "" +"Зведення повідомлення може викликати зміни в :class:`EmailMessage`, якщо для " +"завершення перетворення в рядок необхідно вказати значення за умовчанням " +"(наприклад, можуть бути згенеровані або змінені межі MIME)." + +msgid "" +"Note that this method is provided as a convenience and may not be the most " +"useful way to serialize messages in your application, especially if you are " +"dealing with multiple messages. See :class:`email.generator.Generator` for " +"a more flexible API for serializing messages. Note also that this method is " +"restricted to producing messages serialized as \"7 bit clean\" when :attr:" +"`~email.policy.EmailPolicy.utf8` is ``False``, which is the default." +msgstr "" +"Зауважте, що цей метод надається для зручності та може бути не найкориснішим " +"способом серіалізації повідомлень у вашій програмі, особливо якщо ви маєте " +"справу з кількома повідомленнями. Перегляньте :class:`email.generator." +"Generator` для більш гнучкого API для серіалізації повідомлень. Зауважте " +"також, що цей метод обмежений створенням повідомлень, серіалізованих як \"7 " +"bit clean\", якщо :attr:`~email.policy.EmailPolicy.utf8` має значення " +"``False``, що є типовим." + +msgid "" +"the default behavior when *maxheaderlen* is not specified was changed from " +"defaulting to 0 to defaulting to the value of *max_line_length* from the " +"policy." +msgstr "" +"поведінку за замовчуванням, коли *maxheaderlen* не вказано, було змінено з 0 " +"на значення *max_line_length* із політики." + +msgid "" +"Equivalent to ``as_string(policy=self.policy.clone(utf8=True))``. Allows " +"``str(msg)`` to produce a string containing the serialized message in a " +"readable format." +msgstr "" +"Еквівалент ``as_string(policy=self.policy.clone(utf8=True))``. Дозволяє " +"``str(msg)`` створювати рядок, що містить серіалізоване повідомлення в " +"читабельному форматі." + +msgid "" +"the method was changed to use ``utf8=True``, thus producing an :rfc:`6531`-" +"like message representation, instead of being a direct alias for :meth:" +"`as_string`." +msgstr "" +"метод було змінено на використання ``utf8=True``, таким чином створюючи " +"представлення повідомлення, схоже на :rfc:`6531`, замість прямого псевдоніма " +"для :meth:`as_string`." + +msgid "" +"Return the entire message flattened as a bytes object. When optional " +"*unixfrom* is true, the envelope header is included in the returned string. " +"*unixfrom* defaults to ``False``. The *policy* argument may be used to " +"override the default policy obtained from the message instance. This can be " +"used to control some of the formatting produced by the method, since the " +"specified *policy* will be passed to the :class:`~email.generator." +"BytesGenerator`." +msgstr "" +"Повертає все повідомлення зведене як об’єкт bytes. Якщо необов’язковий " +"параметр *unixfrom* має значення true, заголовок конверта включається до " +"поверненого рядка. *unixfrom* за умовчанням має значення ``False``. Аргумент " +"*policy* можна використовувати для заміни політики за замовчуванням, " +"отриманої з екземпляра повідомлення. Це можна використовувати для керування " +"частиною форматування, створеного методом, оскільки вказану *політику* буде " +"передано до :class:`~email.generator.BytesGenerator`." + +msgid "" +"Note that this method is provided as a convenience and may not be the most " +"useful way to serialize messages in your application, especially if you are " +"dealing with multiple messages. See :class:`email.generator.BytesGenerator` " +"for a more flexible API for serializing messages." +msgstr "" +"Зауважте, що цей метод надається для зручності та може бути не найкориснішим " +"способом серіалізації повідомлень у вашій програмі, особливо якщо ви маєте " +"справу з кількома повідомленнями. Перегляньте :class:`email.generator." +"BytesGenerator` для більш гнучкого API для серіалізації повідомлень." + +msgid "" +"Equivalent to :meth:`.as_bytes`. Allows ``bytes(msg)`` to produce a bytes " +"object containing the serialized message." +msgstr "" + +msgid "" +"Return ``True`` if the message's payload is a list of sub-\\ :class:" +"`EmailMessage` objects, otherwise return ``False``. When :meth:" +"`is_multipart` returns ``False``, the payload should be a string object " +"(which might be a CTE encoded binary payload). Note that :meth:" +"`is_multipart` returning ``True`` does not necessarily mean that \"msg." +"get_content_maintype() == 'multipart'\" will return the ``True``. For " +"example, ``is_multipart`` will return ``True`` when the :class:" +"`EmailMessage` is of type ``message/rfc822``." +msgstr "" +"Повертає ``True``, якщо корисним навантаженням повідомлення є список sub-\\ :" +"class:`EmailMessage` об’єктів, інакше повертає ``False``. Коли :meth:" +"`is_multipart` повертає ``False``, корисним навантаженням має бути рядковий " +"об’єкт (який може бути двійковим навантаженням у кодуванні CTE). Зауважте, " +"що :meth:`is_multipart`, що повертає ``True``, не обов’язково означає, що " +"\"msg.get_content_maintype() == 'multipart'\" поверне ``True``. Наприклад, " +"``is_multipart`` поверне ``True``, якщо :class:`EmailMessage` має тип " +"``message/rfc822``." + +msgid "" +"Set the message's envelope header to *unixfrom*, which should be a string. " +"(See :class:`~mailbox.mboxMessage` for a brief description of this header.)" +msgstr "" +"Встановіть заголовок конверта повідомлення на *unixfrom*, який має бути " +"рядком. (Див. :class:`~mailbox.mboxMessage` для короткого опису цього " +"заголовка.)" + +msgid "" +"Return the message's envelope header. Defaults to ``None`` if the envelope " +"header was never set." +msgstr "" +"Повернути заголовок конверта повідомлення. За замовчуванням ``None``, якщо " +"заголовок конверта ніколи не встановлювався." + +msgid "" +"The following methods implement the mapping-like interface for accessing the " +"message's headers. Note that there are some semantic differences between " +"these methods and a normal mapping (i.e. dictionary) interface. For " +"example, in a dictionary there are no duplicate keys, but here there may be " +"duplicate message headers. Also, in dictionaries there is no guaranteed " +"order to the keys returned by :meth:`keys`, but in an :class:`EmailMessage` " +"object, headers are always returned in the order they appeared in the " +"original message, or in which they were added to the message later. Any " +"header deleted and then re-added is always appended to the end of the header " +"list." +msgstr "" +"Наступні методи реалізують схожий на відображення інтерфейс для доступу до " +"заголовків повідомлення. Зверніть увагу, що існують деякі семантичні " +"відмінності між цими методами та інтерфейсом звичайного відображення (тобто " +"словника). Наприклад, у словнику немає дублікатів ключів, але тут можуть " +"бути дублікати заголовків повідомлень. Крім того, у словниках немає " +"гарантованого порядку ключів, які повертає :meth:`keys`, але в об’єкті :" +"class:`EmailMessage` заголовки завжди повертаються в тому порядку, в якому " +"вони з’явилися в оригінальному повідомленні або в якому вони були додані до " +"повідомлення пізніше. Будь-який заголовок, видалений і потім знову доданий, " +"завжди додається в кінець списку заголовків." + +msgid "" +"These semantic differences are intentional and are biased toward convenience " +"in the most common use cases." +msgstr "" +"Ці семантичні відмінності є навмисними та спрямовані на зручність у " +"найпоширеніших випадках використання." + +msgid "" +"Note that in all cases, any envelope header present in the message is not " +"included in the mapping interface." +msgstr "" +"Зауважте, що в усіх випадках будь-який заголовок конверта, присутній у " +"повідомленні, не включається в інтерфейс зіставлення." + +msgid "Return the total number of headers, including duplicates." +msgstr "Повертає загальну кількість заголовків, включаючи дублікати." + +msgid "" +"Return ``True`` if the message object has a field named *name*. Matching is " +"done without regard to case and *name* does not include the trailing colon. " +"Used for the ``in`` operator. For example::" +msgstr "" +"Повертає ``True``, якщо об’єкт повідомлення має поле з назвою *name*. " +"Зіставлення виконується без урахування регістру, а *ім’я* не містить " +"двокрапки в кінці. Використовується для оператора ``in``. Наприклад::" + +msgid "" +"if 'message-id' in myMessage:\n" +" print('Message-ID:', myMessage['message-id'])" +msgstr "" + +msgid "" +"Return the value of the named header field. *name* does not include the " +"colon field separator. If the header is missing, ``None`` is returned; a :" +"exc:`KeyError` is never raised." +msgstr "" +"Повертає значення названого поля заголовка. *ім’я* не містить двокрапку-" +"роздільник полів. Якщо заголовок відсутній, повертається ``None``; a :exc:" +"`KeyError` ніколи не виникає." + +msgid "" +"Note that if the named field appears more than once in the message's " +"headers, exactly which of those field values will be returned is undefined. " +"Use the :meth:`get_all` method to get the values of all the extant headers " +"named *name*." +msgstr "" +"Зауважте, що якщо назване поле з’являється більше одного разу в заголовках " +"повідомлення, яке саме значення полів буде повернуто, не визначено. " +"Використовуйте метод :meth:`get_all`, щоб отримати значення всіх існуючих " +"заголовків з назвою *name*." + +msgid "" +"Using the standard (non-``compat32``) policies, the returned value is an " +"instance of a subclass of :class:`email.headerregistry.BaseHeader`." +msgstr "" +"Використовуючи стандартні політики (не ``compat32``), повернуте значення є " +"екземпляром підкласу :class:`email.headerregistry.BaseHeader`." + +msgid "" +"Add a header to the message with field name *name* and value *val*. The " +"field is appended to the end of the message's existing headers." +msgstr "" +"Додайте до повідомлення заголовок із назвою поля *name* і значенням *val*. " +"Поле додається в кінці існуючих заголовків повідомлення." + +msgid "" +"Note that this does *not* overwrite or delete any existing header with the " +"same name. If you want to ensure that the new header is the only one " +"present in the message with field name *name*, delete the field first, e.g.::" +msgstr "" +"Зауважте, що це *не* перезаписує та не видаляє будь-який існуючий заголовок " +"із такою ж назвою. Якщо ви хочете переконатися, що новий заголовок є єдиним " +"у повідомленні з назвою поля *name*, спочатку видаліть це поле, наприклад::" + +msgid "" +"del msg['subject']\n" +"msg['subject'] = 'Python roolz!'" +msgstr "" + +msgid "" +"If the :mod:`policy ` defines certain headers to be unique (as " +"the standard policies do), this method may raise a :exc:`ValueError` when an " +"attempt is made to assign a value to such a header when one already exists. " +"This behavior is intentional for consistency's sake, but do not depend on it " +"as we may choose to make such assignments do an automatic deletion of the " +"existing header in the future." +msgstr "" + +msgid "" +"Delete all occurrences of the field with name *name* from the message's " +"headers. No exception is raised if the named field isn't present in the " +"headers." +msgstr "" +"Видалити всі входження поля з назвою *ім’я* із заголовків повідомлення. " +"Жодного винятку не створюється, якщо назване поле відсутнє в заголовках." + +msgid "Return a list of all the message's header field names." +msgstr "Повертає список імен усіх полів заголовка повідомлення." + +msgid "Return a list of all the message's field values." +msgstr "Повертає список усіх значень полів повідомлення." + +msgid "" +"Return a list of 2-tuples containing all the message's field headers and " +"values." +msgstr "" +"Повертає список із двох кортежів, що містить усі заголовки та значення полів " +"повідомлення." + +msgid "" +"Return the value of the named header field. This is identical to :meth:" +"`~object.__getitem__` except that optional *failobj* is returned if the " +"named header is missing (*failobj* defaults to ``None``)." +msgstr "" + +msgid "Here are some additional useful header related methods:" +msgstr "Ось кілька додаткових корисних методів, пов’язаних із заголовками:" + +msgid "" +"Return a list of all the values for the field named *name*. If there are no " +"such named headers in the message, *failobj* is returned (defaults to " +"``None``)." +msgstr "" +"Повертає список усіх значень для поля з назвою *name*. Якщо в повідомленні " +"немає таких іменованих заголовків, повертається *failobj* (за замовчуванням " +"``None``)." + +msgid "" +"Extended header setting. This method is similar to :meth:`__setitem__` " +"except that additional header parameters can be provided as keyword " +"arguments. *_name* is the header field to add and *_value* is the *primary* " +"value for the header." +msgstr "" +"Розширене налаштування заголовка. Цей метод подібний до :meth:`__setitem__` " +"за винятком того, що додаткові параметри заголовка можуть бути надані як " +"аргументи ключового слова. *_name* — це поле заголовка, яке потрібно додати, " +"а *_value* — це *основне* значення для заголовка." + +msgid "" +"For each item in the keyword argument dictionary *_params*, the key is taken " +"as the parameter name, with underscores converted to dashes (since dashes " +"are illegal in Python identifiers). Normally, the parameter will be added " +"as ``key=\"value\"`` unless the value is ``None``, in which case only the " +"key will be added." +msgstr "" +"Для кожного елемента в словнику аргументів ключових слів *_params* ключ " +"береться як ім’я параметра, а символи підкреслення перетворюються на тире " +"(оскільки тире заборонені в ідентифікаторах Python). Зазвичай параметр буде " +"додано як ``key=\"value\"``, якщо значення не буде ``None``, у цьому випадку " +"буде додано лише ключ." + +msgid "" +"If the value contains non-ASCII characters, the charset and language may be " +"explicitly controlled by specifying the value as a three tuple in the format " +"``(CHARSET, LANGUAGE, VALUE)``, where ``CHARSET`` is a string naming the " +"charset to be used to encode the value, ``LANGUAGE`` can usually be set to " +"``None`` or the empty string (see :rfc:`2231` for other possibilities), and " +"``VALUE`` is the string value containing non-ASCII code points. If a three " +"tuple is not passed and the value contains non-ASCII characters, it is " +"automatically encoded in :rfc:`2231` format using a ``CHARSET`` of ``utf-8`` " +"and a ``LANGUAGE`` of ``None``." +msgstr "" +"Якщо значення містить символи, відмінні від ASCII, кодуванням і мовою можна " +"явно керувати, вказавши значення у вигляді трьох кортежів у форматі ``(НАБОР " +"СИГНАЛІВ, МОВА, ЗНАЧЕННЯ)``, де ``НАБІР СИГНАЛІВ`` — це назва рядка набір " +"символів, який буде використано для кодування значення, ``LANGUAGE`` " +"зазвичай може бути встановлено на ``None`` або порожній рядок (перегляньте :" +"rfc:`2231` для інших можливостей), а ``VALUE`` є значення рядка, що містить " +"кодові точки, відмінні від ASCII. Якщо три кортежу не передано і значення " +"містить символи, відмінні від ASCII, воно автоматично кодується у форматі :" +"rfc:`2231` з використанням ``CHARSET`` ``utf-8`` і ``LANGUAGE`` з " +"``Жодного``." + +msgid "Here is an example::" +msgstr "Ось приклад::" + +msgid "msg.add_header('Content-Disposition', 'attachment', filename='bud.gif')" +msgstr "" + +msgid "This will add a header that looks like ::" +msgstr "Це додасть заголовок, який виглядає так::" + +msgid "Content-Disposition: attachment; filename=\"bud.gif\"" +msgstr "" + +msgid "An example of the extended interface with non-ASCII characters::" +msgstr "Приклад розширеного інтерфейсу з не-ASCII символами::" + +msgid "" +"msg.add_header('Content-Disposition', 'attachment',\n" +" filename=('iso-8859-1', '', 'Fußballer.ppt'))" +msgstr "" + +msgid "" +"Replace a header. Replace the first header found in the message that " +"matches *_name*, retaining header order and field name case of the original " +"header. If no matching header is found, raise a :exc:`KeyError`." +msgstr "" +"Замінити заголовок. Замініть перший знайдений у повідомленні заголовок, який " +"відповідає *_name*, зберігаючи порядок заголовків і регістр імені поля " +"вихідного заголовка. Якщо відповідного заголовка не знайдено, викликайте :" +"exc:`KeyError`." + +msgid "" +"Return the message's content type, coerced to lower case of the form :" +"mimetype:`maintype/subtype`. If there is no :mailheader:`Content-Type` " +"header in the message return the value returned by :meth:" +"`get_default_type`. If the :mailheader:`Content-Type` header is invalid, " +"return ``text/plain``." +msgstr "" +"Повертає тип вмісту повідомлення, переведений у нижній регістр у формі :" +"mimetype:`maintype/subtype`. Якщо в повідомленні немає заголовка :mailheader:" +"`Content-Type`, повертається значення, яке повертає :meth:" +"`get_default_type`. Якщо заголовок :mailheader:`Content-Type` недійсний, " +"поверніть ``text/plain``." + +msgid "" +"(According to :rfc:`2045`, messages always have a default type, :meth:" +"`get_content_type` will always return a value. :rfc:`2045` defines a " +"message's default type to be :mimetype:`text/plain` unless it appears inside " +"a :mimetype:`multipart/digest` container, in which case it would be :" +"mimetype:`message/rfc822`. If the :mailheader:`Content-Type` header has an " +"invalid type specification, :rfc:`2045` mandates that the default type be :" +"mimetype:`text/plain`.)" +msgstr "" +"(Відповідно до :rfc:`2045`, повідомлення завжди мають тип за замовчуванням, :" +"meth:`get_content_type` завжди повертатиме значення. :rfc:`2045` визначає " +"тип повідомлення за замовчуванням як :mimetype:`text/plain` якщо він не " +"з’являється всередині контейнера :mimetype:`multipart/digest`, у такому " +"випадку це буде :mimetype:`message/rfc822`. Якщо заголовок :mailheader:" +"`Content-Type` має недійсну специфікацію типу, :rfc:`2045` вимагає, щоб тип " +"за замовчуванням був :mimetype:`text/plain`.)" + +msgid "" +"Return the message's main content type. This is the :mimetype:`maintype` " +"part of the string returned by :meth:`get_content_type`." +msgstr "" +"Повернути основний тип вмісту повідомлення. Це :mimetype:`maintype` частина " +"рядка, яку повертає :meth:`get_content_type`." + +msgid "" +"Return the message's sub-content type. This is the :mimetype:`subtype` part " +"of the string returned by :meth:`get_content_type`." +msgstr "" +"Повернути тип підвмісту повідомлення. Це :mimetype:`subtype` частина рядка, " +"яку повертає :meth:`get_content_type`." + +msgid "" +"Return the default content type. Most messages have a default content type " +"of :mimetype:`text/plain`, except for messages that are subparts of :" +"mimetype:`multipart/digest` containers. Such subparts have a default " +"content type of :mimetype:`message/rfc822`." +msgstr "" +"Повернути типовий тип вмісту. Більшість повідомлень мають стандартний тип " +"вмісту :mimetype:`text/plain`, за винятком повідомлень, які є підчастинами " +"контейнерів :mimetype:`multipart/digest`. Такі підчастини мають типовий тип " +"вмісту :mimetype:`message/rfc822`." + +msgid "" +"Set the default content type. *ctype* should either be :mimetype:`text/" +"plain` or :mimetype:`message/rfc822`, although this is not enforced. The " +"default content type is not stored in the :mailheader:`Content-Type` header, " +"so it only affects the return value of the ``get_content_type`` methods when " +"no :mailheader:`Content-Type` header is present in the message." +msgstr "" +"Встановіть тип вмісту за замовчуванням. *ctype* має бути :mimetype:`text/" +"plain` або :mimetype:`message/rfc822`, хоча це не обов’язково. Тип вмісту за " +"замовчуванням не зберігається в заголовку :mailheader:`Content-Type`, тому " +"він впливає лише на значення, що повертається методами ``get_content_type``, " +"якщо в повідомленні немає заголовка :mailheader:`Content-Type` ." + +msgid "" +"Set a parameter in the :mailheader:`Content-Type` header. If the parameter " +"already exists in the header, replace its value with *value*. When *header* " +"is ``Content-Type`` (the default) and the header does not yet exist in the " +"message, add it, set its value to :mimetype:`text/plain`, and append the new " +"parameter value. Optional *header* specifies an alternative header to :" +"mailheader:`Content-Type`." +msgstr "" +"Установіть параметр у заголовку :mailheader:`Content-Type`. Якщо параметр " +"уже існує в заголовку, замініть його значення на *value*. Якщо *header* має " +"значення ``Content-Type`` (за замовчуванням), а заголовок ще не існує в " +"повідомленні, додайте його, установіть для нього значення :mimetype:`text/" +"plain` і додайте нове значення параметра. Необов’язковий *header* визначає " +"альтернативний заголовок :mailheader:`Content-Type`." + +msgid "" +"If the value contains non-ASCII characters, the charset and language may be " +"explicitly specified using the optional *charset* and *language* " +"parameters. Optional *language* specifies the :rfc:`2231` language, " +"defaulting to the empty string. Both *charset* and *language* should be " +"strings. The default is to use the ``utf8`` *charset* and ``None`` for the " +"*language*." +msgstr "" +"Якщо значення містить символи, відмінні від ASCII, кодування та мову можна " +"вказати явно за допомогою додаткових параметрів *charset* і *language*. " +"Необов’язковий *мова* вказує мову :rfc:`2231`, за умовчанням порожній рядок. " +"І *charset*, і *language* мають бути рядками. За замовчуванням для *мови* " +"використовується ``utf8`` *charset* і ``None``." + +msgid "" +"If *replace* is ``False`` (the default) the header is moved to the end of " +"the list of headers. If *replace* is ``True``, the header will be updated " +"in place." +msgstr "" +"Якщо *replace* має значення ``False`` (за замовчуванням), заголовок " +"переміщується в кінець списку заголовків. Якщо *replace* має значення " +"``True``, заголовок буде оновлено на місці." + +msgid "" +"Use of the *requote* parameter with :class:`EmailMessage` objects is " +"deprecated." +msgstr "" +"Використання параметра *requote* з об’єктами :class:`EmailMessage` застаріло." + +msgid "" +"Note that existing parameter values of headers may be accessed through the :" +"attr:`~email.headerregistry.ParameterizedMIMEHeader.params` attribute of the " +"header value (for example, ``msg['Content-Type'].params['charset']``)." +msgstr "" + +msgid "``replace`` keyword was added." +msgstr "Додано ключове слово ``replace``." + +msgid "" +"Remove the given parameter completely from the :mailheader:`Content-Type` " +"header. The header will be re-written in place without the parameter or its " +"value. Optional *header* specifies an alternative to :mailheader:`Content-" +"Type`." +msgstr "" +"Повністю вилучіть вказаний параметр із заголовка :mailheader:`Content-Type`. " +"Заголовок буде перезаписано на місці без параметра чи його значення. " +"Необов’язковий *заголовок* визначає альтернативу :mailheader:`Content-Type`." + +msgid "" +"Return the value of the ``filename`` parameter of the :mailheader:`Content-" +"Disposition` header of the message. If the header does not have a " +"``filename`` parameter, this method falls back to looking for the ``name`` " +"parameter on the :mailheader:`Content-Type` header. If neither is found, or " +"the header is missing, then *failobj* is returned. The returned string will " +"always be unquoted as per :func:`email.utils.unquote`." +msgstr "" +"Повертає значення параметра ``filename`` заголовка :mailheader:`Content-" +"Disposition` повідомлення. Якщо заголовок не має параметра ``filename``, цей " +"метод повертається до пошуку параметра ``name`` у заголовку :mailheader:" +"`Content-Type`. Якщо нічого не знайдено або відсутній заголовок, " +"повертається *failobj*. Повернений рядок завжди буде без лапок відповідно " +"до :func:`email.utils.unquote`." + +msgid "" +"Return the value of the ``boundary`` parameter of the :mailheader:`Content-" +"Type` header of the message, or *failobj* if either the header is missing, " +"or has no ``boundary`` parameter. The returned string will always be " +"unquoted as per :func:`email.utils.unquote`." +msgstr "" +"Повертає значення параметра ``boundary`` заголовка :mailheader:`Content-" +"Type` повідомлення або *failobj*, якщо заголовок відсутній або не має " +"параметра ``boundary``. Повернений рядок завжди буде без лапок відповідно " +"до :func:`email.utils.unquote`." + +msgid "" +"Set the ``boundary`` parameter of the :mailheader:`Content-Type` header to " +"*boundary*. :meth:`set_boundary` will always quote *boundary* if " +"necessary. A :exc:`~email.errors.HeaderParseError` is raised if the message " +"object has no :mailheader:`Content-Type` header." +msgstr "" +"Установіть для параметра ``boundary`` заголовка :mailheader:`Content-Type` " +"значення *boundary*. :meth:`set_boundary` завжди братиме *boundary* у лапки, " +"якщо необхідно. Помилка :exc:`~email.errors.HeaderParseError` виникає, якщо " +"об’єкт повідомлення не має заголовка :mailheader:`Content-Type`." + +msgid "" +"Note that using this method is subtly different from deleting the old :" +"mailheader:`Content-Type` header and adding a new one with the new boundary " +"via :meth:`add_header`, because :meth:`set_boundary` preserves the order of " +"the :mailheader:`Content-Type` header in the list of headers." +msgstr "" +"Зауважте, що використання цього методу дещо відрізняється від видалення " +"старого заголовка :mailheader:`Content-Type` і додавання нового з новою " +"межею за допомогою :meth:`add_header`, оскільки :meth:`set_boundary` " +"зберігає порядок заголовок :mailheader:`Content-Type` у списку заголовків." + +msgid "" +"Return the ``charset`` parameter of the :mailheader:`Content-Type` header, " +"coerced to lower case. If there is no :mailheader:`Content-Type` header, or " +"if that header has no ``charset`` parameter, *failobj* is returned." +msgstr "" +"Повертає параметр ``charset`` заголовка :mailheader:`Content-Type` у " +"нижньому регістрі. Якщо немає заголовка :mailheader:`Content-Type` або цей " +"заголовок не має параметра ``charset``, повертається *failobj*." + +msgid "" +"Return a list containing the character set names in the message. If the " +"message is a :mimetype:`multipart`, then the list will contain one element " +"for each subpart in the payload, otherwise, it will be a list of length 1." +msgstr "" +"Повернути список із назвами наборів символів у повідомленні. Якщо " +"повідомлення є :mimetype:`multipart`, тоді список міститиме один елемент для " +"кожної підчастини в корисному навантаженні, інакше це буде список довжиною 1." + +msgid "" +"Each item in the list will be a string which is the value of the ``charset`` " +"parameter in the :mailheader:`Content-Type` header for the represented " +"subpart. If the subpart has no :mailheader:`Content-Type` header, no " +"``charset`` parameter, or is not of the :mimetype:`text` main MIME type, " +"then that item in the returned list will be *failobj*." +msgstr "" +"Кожен елемент у списку буде рядком, який є значенням параметра ``charset`` у " +"заголовку :mailheader:`Content-Type` для представленої підчастини. Якщо " +"підчастина не має заголовка :mailheader:`Content-Type`, параметра " +"``charset`` або не належить до основного типу MIME :mimetype:`text`, тоді " +"цей елемент у списку буде *failobj* ." + +msgid "" +"Return ``True`` if there is a :mailheader:`Content-Disposition` header and " +"its (case insensitive) value is ``attachment``, ``False`` otherwise." +msgstr "" +"Повертає ``True``, якщо є заголовок :mailheader:`Content-Disposition` і його " +"(незалежне від регістру) значення є ``attachment``, ``False`` інакше." + +msgid "" +"is_attachment is now a method instead of a property, for consistency with :" +"meth:`~email.message.Message.is_multipart`." +msgstr "" +"is_attachment тепер є методом замість властивості, для узгодженості з :meth:" +"`~email.message.Message.is_multipart`." + +msgid "" +"Return the lowercased value (without parameters) of the message's :" +"mailheader:`Content-Disposition` header if it has one, or ``None``. The " +"possible values for this method are *inline*, *attachment* or ``None`` if " +"the message follows :rfc:`2183`." +msgstr "" +"Повертає значення в нижньому регістрі (без параметрів) заголовка " +"повідомлення :mailheader:`Content-Disposition`, якщо воно є, або ``None``. " +"Можливі значення для цього методу: *inline*, *attachment* або ``None``, якщо " +"повідомлення слідує за :rfc:`2183`." + +msgid "" +"The following methods relate to interrogating and manipulating the content " +"(payload) of the message." +msgstr "" +"Наступні методи стосуються опитування та маніпулювання вмістом (корисним " +"навантаженням) повідомлення." + +msgid "" +"The :meth:`walk` method is an all-purpose generator which can be used to " +"iterate over all the parts and subparts of a message object tree, in depth-" +"first traversal order. You will typically use :meth:`walk` as the iterator " +"in a ``for`` loop; each iteration returns the next subpart." +msgstr "" +"Метод :meth:`walk` — це універсальний генератор, який можна використовувати " +"для перебору всіх частин і підчастин дерева об’єктів повідомлення в порядку " +"проходження спочатку в глибину. Ви зазвичай використовуєте :meth:`walk` як " +"ітератор у циклі ``for``; кожна ітерація повертає наступну підчастину." + +msgid "" +"Here's an example that prints the MIME type of every part of a multipart " +"message structure:" +msgstr "" +"Ось приклад, який друкує тип MIME кожної частини структури повідомлення, що " +"складається з кількох частин:" + +msgid "" +">>> for part in msg.walk():\n" +"... print(part.get_content_type())\n" +"multipart/report\n" +"text/plain\n" +"message/delivery-status\n" +"text/plain\n" +"text/plain\n" +"message/rfc822\n" +"text/plain" +msgstr "" + +msgid "" +"``walk`` iterates over the subparts of any part where :meth:`is_multipart` " +"returns ``True``, even though ``msg.get_content_maintype() == 'multipart'`` " +"may return ``False``. We can see this in our example by making use of the " +"``_structure`` debug helper function:" +msgstr "" +"``walk`` повторює підчастини будь-якої частини, де :meth:`is_multipart` " +"повертає ``True``, навіть якщо ``msg.get_content_maintype() == 'multipart'`` " +"може повернути ``False``. Ми можемо побачити це в нашому прикладі, " +"використовуючи допоміжну функцію налагодження ``_structure``:" + +msgid "" +">>> from email.iterators import _structure\n" +">>> for part in msg.walk():\n" +"... print(part.get_content_maintype() == 'multipart',\n" +"... part.is_multipart())\n" +"True True\n" +"False False\n" +"False True\n" +"False False\n" +"False False\n" +"False True\n" +"False False\n" +">>> _structure(msg)\n" +"multipart/report\n" +" text/plain\n" +" message/delivery-status\n" +" text/plain\n" +" text/plain\n" +" message/rfc822\n" +" text/plain" +msgstr "" + +msgid "" +"Here the ``message`` parts are not ``multiparts``, but they do contain " +"subparts. ``is_multipart()`` returns ``True`` and ``walk`` descends into the " +"subparts." +msgstr "" +"Тут частини ``message`` не є ``multiparts``, але вони містять підчастини. " +"``is_multipart()`` повертає ``True`` і ``walk`` спускається до підчастин." + +msgid "" +"Return the MIME part that is the best candidate to be the \"body\" of the " +"message." +msgstr "" +"Повертає частину MIME, яка є найкращим кандидатом на роль \"тіла\" " +"повідомлення." + +msgid "" +"*preferencelist* must be a sequence of strings from the set ``related``, " +"``html``, and ``plain``, and indicates the order of preference for the " +"content type of the part returned." +msgstr "" +"*preferencelist* має бути послідовністю рядків із набору ``related``, " +"``html`` і ``plain`` і вказує на порядок пріоритету для типу вмісту " +"повернутої частини." + +msgid "" +"Start looking for candidate matches with the object on which the " +"``get_body`` method is called." +msgstr "" +"Почніть шукати збіги кандидатів з об’єктом, для якого викликається метод " +"get_body." + +msgid "" +"If ``related`` is not included in *preferencelist*, consider the root part " +"(or subpart of the root part) of any related encountered as a candidate if " +"the (sub-)part matches a preference." +msgstr "" +"Якщо ``related`` не включено до *preferencelist*, розгляньте кореневу " +"частину (або підчастину кореневої частини) будь-якої пов’язаної частини як " +"кандидата, якщо (під)частина відповідає налаштуванню." + +msgid "" +"When encountering a ``multipart/related``, check the ``start`` parameter and " +"if a part with a matching :mailheader:`Content-ID` is found, consider only " +"it when looking for candidate matches. Otherwise consider only the first " +"(default root) part of the ``multipart/related``." +msgstr "" +"Коли ви зустрічаєте ``multipart/related``, перевірте параметр ``start``, і " +"якщо знайдено частину з відповідним :mailheader:`Content-ID`, враховуйте " +"лише його під час пошуку збігів кандидатів. В іншому випадку враховуйте лише " +"першу (за замовчуванням кореневу) частину ``multipart/related``." + +msgid "" +"If a part has a :mailheader:`Content-Disposition` header, only consider the " +"part a candidate match if the value of the header is ``inline``." +msgstr "" +"Якщо частина має заголовок :mailheader:`Content-Disposition`, розглядайте цю " +"частину як кандидат-збіг, лише якщо значення заголовка є ``inline``." + +msgid "" +"If none of the candidates matches any of the preferences in " +"*preferencelist*, return ``None``." +msgstr "" +"Якщо жоден із кандидатів не відповідає жодному з параметрів у " +"*preferencelist*, поверніть ``None``." + +msgid "" +"Notes: (1) For most applications the only *preferencelist* combinations that " +"really make sense are ``('plain',)``, ``('html', 'plain')``, and the default " +"``('related', 'html', 'plain')``. (2) Because matching starts with the " +"object on which ``get_body`` is called, calling ``get_body`` on a " +"``multipart/related`` will return the object itself unless *preferencelist* " +"has a non-default value. (3) Messages (or message parts) that do not specify " +"a :mailheader:`Content-Type` or whose :mailheader:`Content-Type` header is " +"invalid will be treated as if they are of type ``text/plain``, which may " +"occasionally cause ``get_body`` to return unexpected results." +msgstr "" +"Примітки: (1) Для більшості програм єдиними комбінаціями *preferencelist*, " +"які справді мають сенс, є ``('plain',)``, ``('html', 'plain')`` і типове " +"``( 'related', 'html', 'plain')``. (2) Оскільки зіставлення починається з " +"об’єкта, для якого викликається ``get_body``, виклик ``get_body`` для " +"``multipart/related`` поверне сам об’єкт, якщо *preferencelist* не має " +"значення за замовчуванням. (3) Повідомлення (або частини повідомлення), у " +"яких не вказано :mailheader:`Content-Type` або чий :mailheader:`Content-" +"Type` заголовок недійсний, розглядатимуться так, ніби вони мають тип ``text/" +"plain``, через що іноді get_body може повертати несподівані результати." + +msgid "" +"Return an iterator over all of the immediate sub-parts of the message that " +"are not candidate \"body\" parts. That is, skip the first occurrence of " +"each of ``text/plain``, ``text/html``, ``multipart/related``, or ``multipart/" +"alternative`` (unless they are explicitly marked as attachments via :" +"mailheader:`Content-Disposition: attachment`), and return all remaining " +"parts. When applied directly to a ``multipart/related``, return an iterator " +"over the all the related parts except the root part (ie: the part pointed to " +"by the ``start`` parameter, or the first part if there is no ``start`` " +"parameter or the ``start`` parameter doesn't match the :mailheader:`Content-" +"ID` of any of the parts). When applied directly to a ``multipart/" +"alternative`` or a non-``multipart``, return an empty iterator." +msgstr "" +"Повертає ітератор над усіма безпосередніми підчастинами повідомлення, які не " +"є кандидатами на \"тіло\". Тобто пропустіть перше входження кожного з ``text/" +"plain``, ``text/html``, ``multipart/related`` або ``multipart/alternative`` " +"(якщо вони явно не позначені як вкладення через :mailheader:`Content-" +"Disposition: attachment`), і повернути всі інші частини. При безпосередньому " +"застосуванні до ``multipart/related`` повертає ітератор для всіх пов’язаних " +"частин, крім кореневої частини (тобто: частини, на яку вказує параметр " +"``start``, або першої частини, якщо її немає Параметр ``start`` або параметр " +"``start`` не відповідає :mailheader:`Content-ID` жодної з частин). При " +"застосуванні безпосередньо до ``multipart/alternative`` або не-``multipart`` " +"повертає порожній ітератор." + +msgid "" +"Return an iterator over all of the immediate sub-parts of the message, which " +"will be empty for a non-``multipart``. (See also :meth:`~email.message." +"EmailMessage.walk`.)" +msgstr "" +"Повертає ітератор для всіх безпосередніх підчастин повідомлення, який буде " +"порожнім для не-``multipart``. (Див. також :meth:`~email.message." +"EmailMessage.walk`.)" + +msgid "" +"Call the :meth:`~email.contentmanager.ContentManager.get_content` method of " +"the *content_manager*, passing self as the message object, and passing along " +"any other arguments or keywords as additional arguments. If " +"*content_manager* is not specified, use the ``content_manager`` specified by " +"the current :mod:`~email.policy`." +msgstr "" +"Викличте метод :meth:`~email.contentmanager.ContentManager.get_content` " +"*content_manager*, передаючи self як об’єкт повідомлення та передаючи будь-" +"які інші аргументи чи ключові слова як додаткові аргументи. Якщо " +"*content_manager* не вказано, використовуйте ``content_manager``, визначений " +"поточною :mod:`~email.policy`." + +msgid "" +"Call the :meth:`~email.contentmanager.ContentManager.set_content` method of " +"the *content_manager*, passing self as the message object, and passing along " +"any other arguments or keywords as additional arguments. If " +"*content_manager* is not specified, use the ``content_manager`` specified by " +"the current :mod:`~email.policy`." +msgstr "" +"Викличте метод :meth:`~email.contentmanager.ContentManager.set_content` " +"*content_manager*, передаючи self як об’єкт повідомлення та передаючи будь-" +"які інші аргументи чи ключові слова як додаткові аргументи. Якщо " +"*content_manager* не вказано, використовуйте ``content_manager``, визначений " +"поточною :mod:`~email.policy`." + +msgid "" +"Convert a non-``multipart`` message into a ``multipart/related`` message, " +"moving any existing :mailheader:`Content-` headers and payload into a (new) " +"first part of the ``multipart``. If *boundary* is specified, use it as the " +"boundary string in the multipart, otherwise leave the boundary to be " +"automatically created when it is needed (for example, when the message is " +"serialized)." +msgstr "" +"Перетворіть повідомлення, яке не є ``складним``, на ``багаточастинне/" +"пов’язане`` повідомлення, перемістивши будь-які існуючі заголовки :" +"mailheader:`Content-` і корисне навантаження в (нову) першу частину " +"``багаточастинного``. Якщо вказано *межу*, використовуйте її як " +"обмежувальний рядок у складеній частині, інакше залиште межу автоматично " +"створеною, коли це необхідно (наприклад, коли повідомлення серіалізовано)." + +msgid "" +"Convert a non-``multipart`` or a ``multipart/related`` into a ``multipart/" +"alternative``, moving any existing :mailheader:`Content-` headers and " +"payload into a (new) first part of the ``multipart``. If *boundary* is " +"specified, use it as the boundary string in the multipart, otherwise leave " +"the boundary to be automatically created when it is needed (for example, " +"when the message is serialized)." +msgstr "" +"Перетворіть не ``multipart`` або ``multipart/related`` на ``multipart/" +"alternative``, перемістивши всі наявні заголовки :mailheader:`Content-` і " +"корисне навантаження в (нову) першу частину ``багаточастинний``. Якщо " +"вказано *межу*, використовуйте її як обмежувальний рядок у складеній " +"частині, інакше залиште межу автоматично створеною, коли це необхідно " +"(наприклад, коли повідомлення серіалізовано)." + +msgid "" +"Convert a non-``multipart``, a ``multipart/related``, or a ``multipart-" +"alternative`` into a ``multipart/mixed``, moving any existing :mailheader:" +"`Content-` headers and payload into a (new) first part of the " +"``multipart``. If *boundary* is specified, use it as the boundary string in " +"the multipart, otherwise leave the boundary to be automatically created when " +"it is needed (for example, when the message is serialized)." +msgstr "" +"Перетворіть не ``multipart``, ``multipart/related`` або ``multipart-" +"alternative`` на ``multipart/mixed``, перемістивши будь-які існуючі " +"заголовки :mailheader:`Content-` та корисне навантаження в (нову) першу " +"частину ``multipart``. Якщо вказано *межу*, використовуйте її як " +"обмежувальний рядок у складеній частині, інакше залиште межу автоматично " +"створеною, коли це необхідно (наприклад, коли повідомлення серіалізовано)." + +msgid "" +"If the message is a ``multipart/related``, create a new message object, pass " +"all of the arguments to its :meth:`set_content` method, and :meth:`~email." +"message.Message.attach` it to the ``multipart``. If the message is a non-" +"``multipart``, call :meth:`make_related` and then proceed as above. If the " +"message is any other type of ``multipart``, raise a :exc:`TypeError`. If " +"*content_manager* is not specified, use the ``content_manager`` specified by " +"the current :mod:`~email.policy`. If the added part has no :mailheader:" +"`Content-Disposition` header, add one with the value ``inline``." +msgstr "" +"Якщо повідомлення є ``multipart/related``, створіть новий об’єкт " +"повідомлення, передайте всі аргументи його методу :meth:`set_content` і :" +"meth:`~email.message.Message.attach` його до ``багаточастинний``. Якщо " +"повідомлення не є ``складним``, викличте :meth:`make_related`, а потім " +"виконайте описані вище дії. Якщо повідомлення має будь-який інший тип " +"``multipart``, викликайте :exc:`TypeError`. Якщо *content_manager* не " +"вказано, використовуйте ``content_manager``, визначений поточною :mod:" +"`~email.policy`. Якщо додана частина не має заголовка :mailheader:`Content-" +"Disposition`, додайте його зі значенням ``inline``." + +msgid "" +"If the message is a ``multipart/alternative``, create a new message object, " +"pass all of the arguments to its :meth:`set_content` method, and :meth:" +"`~email.message.Message.attach` it to the ``multipart``. If the message is " +"a non-``multipart`` or ``multipart/related``, call :meth:`make_alternative` " +"and then proceed as above. If the message is any other type of " +"``multipart``, raise a :exc:`TypeError`. If *content_manager* is not " +"specified, use the ``content_manager`` specified by the current :mod:`~email." +"policy`." +msgstr "" +"Якщо повідомлення є ``multipart/alternative``, створіть новий об’єкт " +"повідомлення, передайте всі аргументи його методу :meth:`set_content` і :" +"meth:`~email.message.Message.attach` його до ``багаточастинний``. Якщо " +"повідомлення не є ``multipart`` або ``multipart/related``, викличте :meth:" +"`make_alternative`, а потім виконайте описані вище дії. Якщо повідомлення " +"має будь-який інший тип ``multipart``, викликайте :exc:`TypeError`. Якщо " +"*content_manager* не вказано, використовуйте ``content_manager``, визначений " +"поточною :mod:`~email.policy`." + +msgid "" +"If the message is a ``multipart/mixed``, create a new message object, pass " +"all of the arguments to its :meth:`set_content` method, and :meth:`~email." +"message.Message.attach` it to the ``multipart``. If the message is a non-" +"``multipart``, ``multipart/related``, or ``multipart/alternative``, call :" +"meth:`make_mixed` and then proceed as above. If *content_manager* is not " +"specified, use the ``content_manager`` specified by the current :mod:`~email." +"policy`. If the added part has no :mailheader:`Content-Disposition` header, " +"add one with the value ``attachment``. This method can be used both for " +"explicit attachments (:mailheader:`Content-Disposition: attachment`) and " +"``inline`` attachments (:mailheader:`Content-Disposition: inline`), by " +"passing appropriate options to the ``content_manager``." +msgstr "" +"Якщо повідомлення є ``multipart/mixed``, створіть новий об’єкт повідомлення, " +"передайте всі аргументи його методу :meth:`set_content` і :meth:`~email." +"message.Message.attach` його до ``багаточастинний``. Якщо повідомлення не є " +"``multipart``, ``multipart/related`` або ``multipart/alternative``, " +"викличте :meth:`make_mixed`, а потім виконайте описані вище дії. Якщо " +"*content_manager* не вказано, використовуйте ``content_manager``, визначений " +"поточною :mod:`~email.policy`. Якщо додана частина не має заголовка :" +"mailheader:`Content-Disposition`, додайте його зі значенням ``attachment``. " +"Цей метод можна використовувати як для явних вкладень (:mailheader:`Content-" +"Disposition: attachment`), так і для вкладень ``inline`` (:mailheader:" +"`Content-Disposition: inline`), передавши відповідні параметри " +"``content_manager``." + +msgid "Remove the payload and all of the headers." +msgstr "Видаліть корисне навантаження та всі заголовки." + +msgid "" +"Remove the payload and all of the :mailheader:`!Content-` headers, leaving " +"all other headers intact and in their original order." +msgstr "" + +msgid ":class:`EmailMessage` objects have the following instance attributes:" +msgstr "Об’єкти :class:`EmailMessage` мають такі атрибути екземпляра:" + +msgid "" +"The format of a MIME document allows for some text between the blank line " +"following the headers, and the first multipart boundary string. Normally, " +"this text is never visible in a MIME-aware mail reader because it falls " +"outside the standard MIME armor. However, when viewing the raw text of the " +"message, or when viewing the message in a non-MIME aware reader, this text " +"can become visible." +msgstr "" +"Формат документа MIME допускає деякий текст між порожнім рядком після " +"заголовків і першим обмежувальним рядком із складених частин. Зазвичай цей " +"текст ніколи не відображається в програмі читання пошти з підтримкою MIME, " +"оскільки він виходить за межі стандартної броні MIME. Однак під час " +"перегляду необробленого тексту повідомлення або під час перегляду " +"повідомлення в програмі читання, яка не підтримує MIME, цей текст може стати " +"видимим." + +msgid "" +"The *preamble* attribute contains this leading extra-armor text for MIME " +"documents. When the :class:`~email.parser.Parser` discovers some text after " +"the headers but before the first boundary string, it assigns this text to " +"the message's *preamble* attribute. When the :class:`~email.generator." +"Generator` is writing out the plain text representation of a MIME message, " +"and it finds the message has a *preamble* attribute, it will write this text " +"in the area between the headers and the first boundary. See :mod:`email." +"parser` and :mod:`email.generator` for details." +msgstr "" +"Атрибут *преамбула* містить цей провідний додатковий текст для документів " +"MIME. Коли :class:`~email.parser.Parser` виявляє текст після заголовків, але " +"перед першим обмежувальним рядком, він призначає цей текст атрибуту " +"*преамбула* повідомлення. Коли :class:`~email.generator.Generator` записує " +"звичайне текстове представлення повідомлення MIME і виявляє, що повідомлення " +"має атрибут *преамбула*, він записує цей текст у область між заголовками та " +"перша межа. Перегляньте :mod:`email.parser` і :mod:`email.generator` для " +"деталей." + +msgid "" +"Note that if the message object has no preamble, the *preamble* attribute " +"will be ``None``." +msgstr "" +"Зауважте, що якщо об’єкт повідомлення не має преамбули, атрибут *preamble* " +"матиме значення ``None``." + +msgid "" +"The *epilogue* attribute acts the same way as the *preamble* attribute, " +"except that it contains text that appears between the last boundary and the " +"end of the message. As with the :attr:`~EmailMessage.preamble`, if there is " +"no epilog text this attribute will be ``None``." +msgstr "" +"Атрибут *epilogue* діє так само, як і атрибут *preamble*, за винятком того, " +"що він містить текст, який з’являється між останньою межею та кінцем " +"повідомлення. Як і у випадку з :attr:`~EmailMessage.preamble`, якщо немає " +"тексту епілога, цей атрибут буде ``None``." + +msgid "" +"The *defects* attribute contains a list of all the problems found when " +"parsing this message. See :mod:`email.errors` for a detailed description of " +"the possible parsing defects." +msgstr "" +"Атрибут *defects* містить список усіх проблем, виявлених під час аналізу " +"цього повідомлення. Перегляньте :mod:`email.errors` для детального опису " +"можливих дефектів аналізу." + +msgid "" +"This class represents a subpart of a MIME message. It is identical to :" +"class:`EmailMessage`, except that no :mailheader:`MIME-Version` headers are " +"added when :meth:`~EmailMessage.set_content` is called, since sub-parts do " +"not need their own :mailheader:`MIME-Version` headers." +msgstr "" +"Цей клас представляє підчастину повідомлення MIME. Він ідентичний :class:" +"`EmailMessage`, за винятком того, що під час виклику :meth:`~EmailMessage." +"set_content` не додаються заголовки :mailheader:`MIME-Version`, оскільки " +"підчастини не потребують власного Заголовки :mailheader:`MIME-Version`." + +msgid "Footnotes" +msgstr "Виноски" + +msgid "" +"Originally added in 3.4 as a :term:`provisional module `. Docs for legacy message class moved to :ref:`compat32_message`." +msgstr "" +"Спочатку додано в 3.4 як :term:`проміжний модуль `. " +"Документи для застарілого класу повідомлень переміщено до :ref:" +"`compat32_message`." diff --git a/library/email_mime.po b/library/email_mime.po new file mode 100644 index 000000000..dac4e20ea --- /dev/null +++ b/library/email_mime.po @@ -0,0 +1,374 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 01:05+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!email.mime`: Creating email and MIME objects from scratch" +msgstr "" + +msgid "**Source code:** :source:`Lib/email/mime/`" +msgstr "**Вихідний код:** :source:`Lib/email/mime/`" + +msgid "" +"This module is part of the legacy (``Compat32``) email API. Its " +"functionality is partially replaced by the :mod:`~email.contentmanager` in " +"the new API, but in certain applications these classes may still be useful, " +"even in non-legacy code." +msgstr "" +"Цей модуль є частиною застарілого (``Compat32``) API електронної пошти. Його " +"функціональні можливості частково замінено на :mod:`~email.contentmanager` у " +"новому API, але в деяких програмах ці класи все ще можуть бути корисними, " +"навіть у коді, що не є застарілим." + +msgid "" +"Ordinarily, you get a message object structure by passing a file or some " +"text to a parser, which parses the text and returns the root message " +"object. However you can also build a complete message structure from " +"scratch, or even individual :class:`~email.message.Message` objects by " +"hand. In fact, you can also take an existing structure and add new :class:" +"`~email.message.Message` objects, move them around, etc. This makes a very " +"convenient interface for slicing-and-dicing MIME messages." +msgstr "" +"Зазвичай ви отримуєте структуру об’єкта повідомлення, передаючи файл або " +"деякий текст синтаксичному аналізатору, який аналізує текст і повертає " +"кореневий об’єкт повідомлення. Однак ви також можете створити повну " +"структуру повідомлення з нуля або навіть окремі об’єкти :class:`~email." +"message.Message` вручну. Фактично, ви також можете взяти існуючу структуру " +"та додати нові об’єкти :class:`~email.message.Message`, перемістити їх тощо. " +"Це робить дуже зручний інтерфейс для нарізання та нарізання повідомлень MIME." + +msgid "" +"You can create a new object structure by creating :class:`~email.message." +"Message` instances, adding attachments and all the appropriate headers " +"manually. For MIME messages though, the :mod:`email` package provides some " +"convenient subclasses to make things easier." +msgstr "" +"Ви можете створити нову структуру об’єктів, створивши екземпляри :class:" +"`~email.message.Message`, додавши вкладення та всі відповідні заголовки " +"вручну. Однак для повідомлень MIME пакет :mod:`email` надає кілька зручних " +"підкласів, щоб полегшити роботу." + +msgid "Here are the classes:" +msgstr "Ось класи:" + +msgid "Module: :mod:`email.mime.base`" +msgstr "Модуль: :mod:`email.mime.base`" + +msgid "" +"This is the base class for all the MIME-specific subclasses of :class:" +"`~email.message.Message`. Ordinarily you won't create instances " +"specifically of :class:`MIMEBase`, although you could. :class:`MIMEBase` is " +"provided primarily as a convenient base class for more specific MIME-aware " +"subclasses." +msgstr "" +"Це базовий клас для всіх специфічних для MIME підкласів :class:`~email." +"message.Message`. Зазвичай ви не будете створювати екземпляри конкретно :" +"class:`MIMEBase`, хоча можете. :class:`MIMEBase` надається в основному як " +"зручний базовий клас для більш конкретних підкласів, що підтримують MIME." + +msgid "" +"*_maintype* is the :mailheader:`Content-Type` major type (e.g. :mimetype:" +"`text` or :mimetype:`image`), and *_subtype* is the :mailheader:`Content-" +"Type` minor type (e.g. :mimetype:`plain` or :mimetype:`gif`). *_params* is " +"a parameter key/value dictionary and is passed directly to :meth:`Message." +"add_header `." +msgstr "" +"*_maintype* — це основний тип :mailheader:`Content-Type` (наприклад, :" +"mimetype:`text` або :mimetype:`image`), а *_subtype* — другорядний тип :" +"mailheader:`Content-Type` (напр. :mimetype:`plain` або :mimetype:`gif`). " +"*_params* — це словник ключ/значення параметра, який передається " +"безпосередньо до :meth:`Message.add_header `." + +msgid "" +"If *policy* is specified, (defaults to the :class:`compat32 ` policy) it will be passed to :class:`~email.message.Message`." +msgstr "" +"Якщо вказано *політику* (за замовчуванням політика :class:`compat32 `), вона буде передана в :class:`~email.message.Message`." + +msgid "" +"The :class:`MIMEBase` class always adds a :mailheader:`Content-Type` header " +"(based on *_maintype*, *_subtype*, and *_params*), and a :mailheader:`MIME-" +"Version` header (always set to ``1.0``)." +msgstr "" +"Клас :class:`MIMEBase` завжди додає заголовок :mailheader:`Content-Type` (на " +"основі *_maintype*, *_subtype* і *_params*) і заголовок :mailheader:`MIME-" +"Version` (завжди встановити значення ``1.0``)." + +msgid "Added *policy* keyword-only parameter." +msgstr "Додано параметр *policy* лише для ключового слова." + +msgid "Module: :mod:`email.mime.nonmultipart`" +msgstr "Модуль: :mod:`email.mime.nonmultipart`" + +msgid "" +"A subclass of :class:`~email.mime.base.MIMEBase`, this is an intermediate " +"base class for MIME messages that are not :mimetype:`multipart`. The " +"primary purpose of this class is to prevent the use of the :meth:`~email." +"message.Message.attach` method, which only makes sense for :mimetype:" +"`multipart` messages. If :meth:`~email.message.Message.attach` is called, " +"a :exc:`~email.errors.MultipartConversionError` exception is raised." +msgstr "" +"Підклас :class:`~email.mime.base.MIMEBase`, це проміжний базовий клас для " +"повідомлень MIME, які не є :mimetype:`multipart`. Основною метою цього класу " +"є запобігання використанню методу :meth:`~email.message.Message.attach`, " +"який має сенс лише для повідомлень :mimetype:`multipart`. Якщо викликається :" +"meth:`~email.message.Message.attach`, виникає виняток :exc:`~email.errors." +"MultipartConversionError`." + +msgid "Module: :mod:`email.mime.multipart`" +msgstr "Модуль: :mod:`email.mime.multipart`" + +msgid "" +"A subclass of :class:`~email.mime.base.MIMEBase`, this is an intermediate " +"base class for MIME messages that are :mimetype:`multipart`. Optional " +"*_subtype* defaults to :mimetype:`mixed`, but can be used to specify the " +"subtype of the message. A :mailheader:`Content-Type` header of :mimetype:" +"`multipart/_subtype` will be added to the message object. A :mailheader:" +"`MIME-Version` header will also be added." +msgstr "" +"Підклас :class:`~email.mime.base.MIMEBase`, це проміжний базовий клас для " +"повідомлень MIME, які є :mimetype:`multipart`. Необов’язковий *_subtype* за " +"умовчанням має значення :mimetype:`mixed`, але його можна використовувати " +"для визначення підтипу повідомлення. Заголовок :mailheader:`Content-Type` :" +"mimetype:`multipart/_subtype` буде додано до об’єкта повідомлення. Також " +"буде додано заголовок :mailheader:`MIME-Version`." + +msgid "" +"Optional *boundary* is the multipart boundary string. When ``None`` (the " +"default), the boundary is calculated when needed (for example, when the " +"message is serialized)." +msgstr "" +"Необов’язковий *межа* — це обмежувальний рядок із кількох частин. Якщо " +"``None`` (за замовчуванням), межа обчислюється за потреби (наприклад, коли " +"повідомлення серіалізовано)." + +msgid "" +"*_subparts* is a sequence of initial subparts for the payload. It must be " +"possible to convert this sequence to a list. You can always attach new " +"subparts to the message by using the :meth:`Message.attach ` method." +msgstr "" +"*_subparts* — це послідовність початкових підчастин для корисного " +"навантаження. Має бути можливість перетворити цю послідовність на список. Ви " +"завжди можете додати нові частини до повідомлення за допомогою методу :meth:" +"`Message.attach `." + +msgid "" +"Optional *policy* argument defaults to :class:`compat32 `." +msgstr "" +"Додатковий аргумент *policy* за умовчанням має значення :class:`compat32 " +"`." + +msgid "" +"Additional parameters for the :mailheader:`Content-Type` header are taken " +"from the keyword arguments, or passed into the *_params* argument, which is " +"a keyword dictionary." +msgstr "" +"Додаткові параметри для заголовка :mailheader:`Content-Type` беруться з " +"аргументів ключових слів або передаються в аргумент *_params*, який є " +"словником ключових слів." + +msgid "Module: :mod:`email.mime.application`" +msgstr "Модуль: :mod:`email.mime.application`" + +msgid "" +"A subclass of :class:`~email.mime.nonmultipart.MIMENonMultipart`, the :class:" +"`MIMEApplication` class is used to represent MIME message objects of major " +"type :mimetype:`application`. *_data* contains the bytes for the raw " +"application data. Optional *_subtype* specifies the MIME subtype and " +"defaults to :mimetype:`octet-stream`." +msgstr "" + +msgid "" +"Optional *_encoder* is a callable (i.e. function) which will perform the " +"actual encoding of the data for transport. This callable takes one " +"argument, which is the :class:`MIMEApplication` instance. It should use :" +"meth:`~email.message.Message.get_payload` and :meth:`~email.message.Message." +"set_payload` to change the payload to encoded form. It should also add any :" +"mailheader:`Content-Transfer-Encoding` or other headers to the message " +"object as necessary. The default encoding is base64. See the :mod:`email." +"encoders` module for a list of the built-in encoders." +msgstr "" +"Необов’язковий *_encoder* — це виклик (тобто функція), яка виконуватиме " +"фактичне кодування даних для транспортування. Цей виклик приймає один " +"аргумент, який є екземпляром :class:`MIMEApplication`. Він має " +"використовувати :meth:`~email.message.Message.get_payload` і :meth:`~email." +"message.Message.set_payload`, щоб змінити корисне навантаження на закодовану " +"форму. Він також має додати будь-які :mailheader:`Content-Transfer-Encoding` " +"або інші заголовки до об’єкта повідомлення за потреби. Стандартне кодування " +"— base64. Перегляньте список вбудованих кодувальників у модулі :mod:`email." +"encoders`." + +msgid "*_params* are passed straight through to the base class constructor." +msgstr "*_params* передаються прямо до конструктора базового класу." + +msgid "Module: :mod:`email.mime.audio`" +msgstr "Модуль: :mod:`email.mime.audio`" + +msgid "" +"A subclass of :class:`~email.mime.nonmultipart.MIMENonMultipart`, the :class:" +"`MIMEAudio` class is used to create MIME message objects of major type :" +"mimetype:`audio`. *_audiodata* contains the bytes for the raw audio data. " +"If this data can be decoded as au, wav, aiff, or aifc, then the subtype will " +"be automatically included in the :mailheader:`Content-Type` header. " +"Otherwise you can explicitly specify the audio subtype via the *_subtype* " +"argument. If the minor type could not be guessed and *_subtype* was not " +"given, then :exc:`TypeError` is raised." +msgstr "" + +msgid "" +"Optional *_encoder* is a callable (i.e. function) which will perform the " +"actual encoding of the audio data for transport. This callable takes one " +"argument, which is the :class:`MIMEAudio` instance. It should use :meth:" +"`~email.message.Message.get_payload` and :meth:`~email.message.Message." +"set_payload` to change the payload to encoded form. It should also add any :" +"mailheader:`Content-Transfer-Encoding` or other headers to the message " +"object as necessary. The default encoding is base64. See the :mod:`email." +"encoders` module for a list of the built-in encoders." +msgstr "" +"Необов’язковий *_encoder* — це виклик (тобто функція), яка виконуватиме " +"фактичне кодування аудіоданих для транспортування. Цей виклик приймає один " +"аргумент, який є екземпляром :class:`MIMEAudio`. Він має використовувати :" +"meth:`~email.message.Message.get_payload` і :meth:`~email.message.Message." +"set_payload`, щоб змінити корисне навантаження на закодовану форму. Він " +"також має додати будь-які :mailheader:`Content-Transfer-Encoding` або інші " +"заголовки до об’єкта повідомлення за потреби. Стандартне кодування — base64. " +"Перегляньте список вбудованих кодувальників у модулі :mod:`email.encoders`." + +msgid "Module: :mod:`email.mime.image`" +msgstr "Модуль: :mod:`email.mime.image`" + +msgid "" +"A subclass of :class:`~email.mime.nonmultipart.MIMENonMultipart`, the :class:" +"`MIMEImage` class is used to create MIME message objects of major type :" +"mimetype:`image`. *_imagedata* contains the bytes for the raw image data. " +"If this data type can be detected (jpeg, png, gif, tiff, rgb, pbm, pgm, ppm, " +"rast, xbm, bmp, webp, and exr attempted), then the subtype will be " +"automatically included in the :mailheader:`Content-Type` header. Otherwise " +"you can explicitly specify the image subtype via the *_subtype* argument. If " +"the minor type could not be guessed and *_subtype* was not given, then :exc:" +"`TypeError` is raised." +msgstr "" + +msgid "" +"Optional *_encoder* is a callable (i.e. function) which will perform the " +"actual encoding of the image data for transport. This callable takes one " +"argument, which is the :class:`MIMEImage` instance. It should use :meth:" +"`~email.message.Message.get_payload` and :meth:`~email.message.Message." +"set_payload` to change the payload to encoded form. It should also add any :" +"mailheader:`Content-Transfer-Encoding` or other headers to the message " +"object as necessary. The default encoding is base64. See the :mod:`email." +"encoders` module for a list of the built-in encoders." +msgstr "" +"Необов’язковий *_encoder* — це виклик (тобто функція), яка виконуватиме " +"фактичне кодування даних зображення для транспортування. Цей виклик приймає " +"один аргумент, який є екземпляром :class:`MIMEImage`. Він має " +"використовувати :meth:`~email.message.Message.get_payload` і :meth:`~email." +"message.Message.set_payload`, щоб змінити корисне навантаження на закодовану " +"форму. Він також має додати будь-які :mailheader:`Content-Transfer-Encoding` " +"або інші заголовки до об’єкта повідомлення за потреби. Стандартне кодування " +"— base64. Перегляньте список вбудованих кодувальників у модулі :mod:`email." +"encoders`." + +msgid "" +"*_params* are passed straight through to the :class:`~email.mime.base." +"MIMEBase` constructor." +msgstr "" +"*_параметри* передаються безпосередньо до конструктора :class:`~email.mime." +"base.MIMEBase`." + +msgid "Module: :mod:`email.mime.message`" +msgstr "Модуль: :mod:`email.mime.message`" + +msgid "" +"A subclass of :class:`~email.mime.nonmultipart.MIMENonMultipart`, the :class:" +"`MIMEMessage` class is used to create MIME objects of main type :mimetype:" +"`message`. *_msg* is used as the payload, and must be an instance of class :" +"class:`~email.message.Message` (or a subclass thereof), otherwise a :exc:" +"`TypeError` is raised." +msgstr "" +"Підклас :class:`~email.mime.nonmultipart.MIMENonMultipart`, клас :class:" +"`MIMEMessage` використовується для створення об’єктів MIME основного типу :" +"mimetype:`message`. *_msg* використовується як корисне навантаження та має " +"бути екземпляром класу :class:`~email.message.Message` (або його підкласу), " +"інакше виникає :exc:`TypeError`." + +msgid "" +"Optional *_subtype* sets the subtype of the message; it defaults to :" +"mimetype:`rfc822`." +msgstr "" +"Додатково *_subtype* встановлює підтип повідомлення; за замовчуванням :" +"mimetype:`rfc822`." + +msgid "Module: :mod:`email.mime.text`" +msgstr "Модуль: :mod:`email.mime.text`" + +msgid "" +"A subclass of :class:`~email.mime.nonmultipart.MIMENonMultipart`, the :class:" +"`MIMEText` class is used to create MIME objects of major type :mimetype:" +"`text`. *_text* is the string for the payload. *_subtype* is the minor type " +"and defaults to :mimetype:`plain`. *_charset* is the character set of the " +"text and is passed as an argument to the :class:`~email.mime.nonmultipart." +"MIMENonMultipart` constructor; it defaults to ``us-ascii`` if the string " +"contains only ``ascii`` code points, and ``utf-8`` otherwise. The " +"*_charset* parameter accepts either a string or a :class:`~email.charset." +"Charset` instance." +msgstr "" +"Підклас :class:`~email.mime.nonmultipart.MIMENonMultipart`, клас :class:" +"`MIMEText` використовується для створення об’єктів MIME основного типу :" +"mimetype:`text`. *_text* — це рядок корисного навантаження. *_subtype* є " +"другорядним типом і за замовчуванням :mimetype:`plain`. *_charset* — це " +"набір символів тексту, який передається як аргумент конструктору :class:" +"`~email.mime.nonmultipart.MIMENonMultipart`; за замовчуванням встановлено " +"``us-ascii``, якщо рядок містить лише ``ascii`` кодові точки, і ``utf-8`` " +"інакше. Параметр *_charset* приймає або рядок, або екземпляр :class:`~email." +"charset.Charset`." + +msgid "" +"Unless the *_charset* argument is explicitly set to ``None``, the MIMEText " +"object created will have both a :mailheader:`Content-Type` header with a " +"``charset`` parameter, and a :mailheader:`Content-Transfer-Encoding` " +"header. This means that a subsequent ``set_payload`` call will not result " +"in an encoded payload, even if a charset is passed in the ``set_payload`` " +"command. You can \"reset\" this behavior by deleting the ``Content-Transfer-" +"Encoding`` header, after which a ``set_payload`` call will automatically " +"encode the new payload (and add a new :mailheader:`Content-Transfer-" +"Encoding` header)." +msgstr "" +"Якщо для аргументу *_charset* явно не встановлено значення ``None``, " +"створений об’єкт MIMEText матиме як заголовок :mailheader:`Content-Type` з " +"параметром ``charset``, так і Заголовок :mailheader:`Content-Transfer-" +"Encoding`. Це означає, що наступний виклик ``set_payload`` не призведе до " +"закодованого корисного навантаження, навіть якщо кодування передано в " +"команді ``set_payload``. Ви можете \"скинути\" цю поведінку, видаливши " +"заголовок ``Content-Transfer-Encoding``, після чого виклик ``set_payload`` " +"автоматично закодує нове корисне навантаження (і додасть нове :mailheader:" +"`Content-Transfer-Encoding` заголовок)." + +msgid "*_charset* also accepts :class:`~email.charset.Charset` instances." +msgstr "*_charset* також приймає екземпляри :class:`~email.charset.Charset`." diff --git a/library/email_parser.po b/library/email_parser.po new file mode 100644 index 000000000..49e0467dc --- /dev/null +++ b/library/email_parser.po @@ -0,0 +1,499 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 01:05+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!email.parser`: Parsing email messages" +msgstr "" + +msgid "**Source code:** :source:`Lib/email/parser.py`" +msgstr "**Вихідний код:** :source:`Lib/email/parser.py`" + +msgid "" +"Message object structures can be created in one of two ways: they can be " +"created from whole cloth by creating an :class:`~email.message.EmailMessage` " +"object, adding headers using the dictionary interface, and adding payload(s) " +"using :meth:`~email.message.EmailMessage.set_content` and related methods, " +"or they can be created by parsing a serialized representation of the email " +"message." +msgstr "" +"Структури об’єктів повідомлень можна створити одним із двох способів: їх " +"можна створити з цілої тканини, створивши об’єкт :class:`~email.message." +"EmailMessage`, додавши заголовки за допомогою інтерфейсу словника та додавши " +"корисне(і) навантаження за допомогою :meth:`~email.message.EmailMessage." +"set_content` і пов’язані методи, або їх можна створити шляхом аналізу " +"серіалізованого представлення повідомлення електронної пошти." + +msgid "" +"The :mod:`email` package provides a standard parser that understands most " +"email document structures, including MIME documents. You can pass the " +"parser a bytes, string or file object, and the parser will return to you the " +"root :class:`~email.message.EmailMessage` instance of the object structure. " +"For simple, non-MIME messages the payload of this root object will likely be " +"a string containing the text of the message. For MIME messages, the root " +"object will return ``True`` from its :meth:`~email.message.EmailMessage." +"is_multipart` method, and the subparts can be accessed via the payload " +"manipulation methods, such as :meth:`~email.message.EmailMessage.get_body`, :" +"meth:`~email.message.EmailMessage.iter_parts`, and :meth:`~email.message." +"EmailMessage.walk`." +msgstr "" +"Пакет :mod:`email` надає стандартний аналізатор, який розуміє більшість " +"структур документів електронної пошти, включаючи документи MIME. Ви можете " +"передати аналізатору байти, рядок або файловий об’єкт, і аналізатор поверне " +"вам кореневий екземпляр :class:`~email.message.EmailMessage` структури " +"об’єкта. Для простих повідомлень без MIME корисним навантаженням цього " +"кореневого об’єкта, ймовірно, буде рядок, що містить текст повідомлення. Для " +"повідомлень MIME кореневий об’єкт поверне ``True`` зі свого методу :meth:" +"`~email.message.EmailMessage.is_multipart`, а доступ до підчастин можна " +"отримати за допомогою методів маніпулювання корисним навантаженням, таких " +"як :meth:`~email.message.EmailMessage.get_body`, :meth:`~email.message." +"EmailMessage.iter_parts` і :meth:`~email.message.EmailMessage.walk`." + +msgid "" +"There are actually two parser interfaces available for use, the :class:" +"`Parser` API and the incremental :class:`FeedParser` API. The :class:" +"`Parser` API is most useful if you have the entire text of the message in " +"memory, or if the entire message lives in a file on the file system. :class:" +"`FeedParser` is more appropriate when you are reading the message from a " +"stream which might block waiting for more input (such as reading an email " +"message from a socket). The :class:`FeedParser` can consume and parse the " +"message incrementally, and only returns the root object when you close the " +"parser." +msgstr "" +"Насправді існує два інтерфейси синтаксичного аналізатора, доступні для " +"використання: :class:`Parser` API та інкрементальний :class:`FeedParser` " +"API. API :class:`Parser` найбільш корисний, якщо у вас є весь текст " +"повідомлення в пам’яті або якщо все повідомлення зберігається у файлі у " +"файловій системі. :class:`FeedParser` більше підходить, коли ви читаєте " +"повідомлення з потоку, який може блокувати очікування додаткового введення " +"(наприклад, читання повідомлення електронної пошти з сокета). :class:" +"`FeedParser` може споживати та аналізувати повідомлення поступово, і " +"повертає кореневий об’єкт лише тоді, коли ви закриваєте аналізатор." + +msgid "" +"Note that the parser can be extended in limited ways, and of course you can " +"implement your own parser completely from scratch. All of the logic that " +"connects the :mod:`email` package's bundled parser and the :class:`~email." +"message.EmailMessage` class is embodied in the :class:`~email.policy.Policy` " +"class, so a custom parser can create message object trees any way it finds " +"necessary by implementing custom versions of the appropriate :class:`!" +"Policy` methods." +msgstr "" + +msgid "FeedParser API" +msgstr "API FeedParser" + +msgid "" +"The :class:`BytesFeedParser`, imported from the :mod:`email.feedparser` " +"module, provides an API that is conducive to incremental parsing of email " +"messages, such as would be necessary when reading the text of an email " +"message from a source that can block (such as a socket). The :class:" +"`BytesFeedParser` can of course be used to parse an email message fully " +"contained in a :term:`bytes-like object`, string, or file, but the :class:" +"`BytesParser` API may be more convenient for such use cases. The semantics " +"and results of the two parser APIs are identical." +msgstr "" +":class:`BytesFeedParser`, імпортований з модуля :mod:`email.feedparser`, " +"надає API, який сприяє поступовому розбору повідомлень електронної пошти, як " +"це було б необхідно під час читання тексту повідомлення електронної пошти з " +"джерела які можуть блокувати (наприклад, сокет). Звичайно, :class:" +"`BytesFeedParser` можна використовувати для аналізу повідомлення електронної " +"пошти, яке повністю міститься в :term:`bytes-like object`, рядку або файлі, " +"але API :class:`BytesParser` може бути зручнішим для такі випадки " +"використання. Семантика та результати двох API парсера ідентичні." + +msgid "" +"The :class:`BytesFeedParser`'s API is simple; you create an instance, feed " +"it a bunch of bytes until there's no more to feed it, then close the parser " +"to retrieve the root message object. The :class:`BytesFeedParser` is " +"extremely accurate when parsing standards-compliant messages, and it does a " +"very good job of parsing non-compliant messages, providing information about " +"how a message was deemed broken. It will populate a message object's :attr:" +"`~email.message.EmailMessage.defects` attribute with a list of any problems " +"it found in a message. See the :mod:`email.errors` module for the list of " +"defects that it can find." +msgstr "" +"API :class:`BytesFeedParser` простий; ви створюєте екземпляр, передаєте йому " +"купу байтів, доки більше не залишиться, а потім закриваєте аналізатор, щоб " +"отримати кореневий об’єкт повідомлення. :class:`BytesFeedParser` є " +"надзвичайно точним під час аналізу повідомлень, що відповідають стандартам, " +"і він дуже добре справляється з аналізом невідповідних повідомлень, надаючи " +"інформацію про те, як повідомлення було визнано зламаним. Він заповнить " +"атрибут :attr:`~email.message.EmailMessage.defects` об’єкта повідомлення " +"списком будь-яких проблем, знайдених у повідомленні. Дивіться модуль :mod:" +"`email.errors`, щоб переглянути список дефектів, які він може знайти." + +msgid "Here is the API for the :class:`BytesFeedParser`:" +msgstr "Ось API для :class:`BytesFeedParser`:" + +msgid "" +"Create a :class:`BytesFeedParser` instance. Optional *_factory* is a no-" +"argument callable; if not specified use the :attr:`~email.policy.Policy." +"message_factory` from the *policy*. Call *_factory* whenever a new message " +"object is needed." +msgstr "" +"Створіть екземпляр :class:`BytesFeedParser`. Необов’язковий *_factory* — " +"виклик без аргументів; якщо не вказано, використовуйте :attr:`~email.policy." +"Policy.message_factory` з *політики*. Викликати *_factory* щоразу, коли " +"потрібен новий об’єкт повідомлення." + +msgid "" +"If *policy* is specified use the rules it specifies to update the " +"representation of the message. If *policy* is not set, use the :class:" +"`compat32 ` policy, which maintains backward " +"compatibility with the Python 3.2 version of the email package and provides :" +"class:`~email.message.Message` as the default factory. All other policies " +"provide :class:`~email.message.EmailMessage` as the default *_factory*. For " +"more information on what else *policy* controls, see the :mod:`~email." +"policy` documentation." +msgstr "" +"Якщо вказано *policy*, використовуйте правила, які вона визначає, щоб " +"оновити представлення повідомлення. Якщо *policy* не налаштовано, " +"використовуйте політику :class:`compat32 `, яка " +"підтримує зворотну сумісність із версією пакета електронної пошти Python 3.2 " +"і надає :class:`~email.message.Message` як фабрику за замовчуванням. Усі " +"інші політики передбачають :class:`~email.message.EmailMessage` як " +"*_factory* за умовчанням. Щоб дізнатися більше про те, що ще контролює " +"*policy*, перегляньте документацію :mod:`~email.policy`." + +msgid "" +"Note: **The policy keyword should always be specified**; The default will " +"change to :data:`email.policy.default` in a future version of Python." +msgstr "" +"Примітка: **Ключове слово політики слід завжди вказувати**; У наступній " +"версії Python значення за умовчанням зміниться на :data:`email.policy." +"default`." + +msgid "Added the *policy* keyword." +msgstr "Додано ключове слово *політика*." + +msgid "*_factory* defaults to the policy ``message_factory``." +msgstr "*_factory* за умовчанням використовує політику ``message_factory``." + +msgid "" +"Feed the parser some more data. *data* should be a :term:`bytes-like " +"object` containing one or more lines. The lines can be partial and the " +"parser will stitch such partial lines together properly. The lines can have " +"any of the three common line endings: carriage return, newline, or carriage " +"return and newline (they can even be mixed)." +msgstr "" +"Подайте аналізатору ще трохи даних. *data* має бути :term:`bytes-like " +"object`, що містить один або більше рядків. Рядки можуть бути частковими, і " +"синтаксичний аналізатор правильно з’єднає такі часткові рядки. Рядки можуть " +"мати будь-яке з трьох загальних закінчень рядків: повернення каретки, новий " +"рядок або повернення каретки та новий рядок (вони навіть можуть бути " +"змішаними)." + +msgid "" +"Complete the parsing of all previously fed data and return the root message " +"object. It is undefined what happens if :meth:`~feed` is called after this " +"method has been called." +msgstr "" +"Завершіть розбір усіх попередньо поданих даних і поверніть кореневий об’єкт " +"повідомлення. Не визначено, що відбувається, якщо :meth:`~feed` викликається " +"після виклику цього методу." + +msgid "" +"Works like :class:`BytesFeedParser` except that the input to the :meth:" +"`~BytesFeedParser.feed` method must be a string. This is of limited " +"utility, since the only way for such a message to be valid is for it to " +"contain only ASCII text or, if :attr:`~email.policy.Policy.utf8` is " +"``True``, no binary attachments." +msgstr "" +"Працює як :class:`BytesFeedParser`, за винятком того, що вхід до методу :" +"meth:`~BytesFeedParser.feed` має бути рядком. Це має обмежену корисність, " +"оскільки єдиний спосіб зробити таке повідомлення дійсним — це містити лише " +"текст ASCII або, якщо :attr:`~email.policy.Policy.utf8` має значення " +"``True``, не мати двійкового коду вкладення." + +msgid "Parser API" +msgstr "API парсера" + +msgid "" +"The :class:`BytesParser` class, imported from the :mod:`email.parser` " +"module, provides an API that can be used to parse a message when the " +"complete contents of the message are available in a :term:`bytes-like " +"object` or file. The :mod:`email.parser` module also provides :class:" +"`Parser` for parsing strings, and header-only parsers, :class:" +"`BytesHeaderParser` and :class:`HeaderParser`, which can be used if you're " +"only interested in the headers of the message. :class:`BytesHeaderParser` " +"and :class:`HeaderParser` can be much faster in these situations, since they " +"do not attempt to parse the message body, instead setting the payload to the " +"raw body." +msgstr "" +"Клас :class:`BytesParser`, імпортований з модуля :mod:`email.parser`, надає " +"API, який можна використовувати для аналізу повідомлення, коли повний вміст " +"повідомлення доступний у :term:`bytes-like object` або файл. Модуль :mod:" +"`email.parser` також містить :class:`Parser` для аналізу рядків і " +"аналізатори лише заголовків, :class:`BytesHeaderParser` і :class:" +"`HeaderParser`, які можна використовувати, якщо ви цікавляться лише " +"заголовками повідомлень. :class:`BytesHeaderParser` і :class:`HeaderParser` " +"можуть бути набагато швидшими в цих ситуаціях, оскільки вони не намагаються " +"проаналізувати тіло повідомлення, натомість встановлюючи корисне " +"навантаження на необроблене тіло." + +msgid "" +"Create a :class:`BytesParser` instance. The *_class* and *policy* arguments " +"have the same meaning and semantics as the *_factory* and *policy* arguments " +"of :class:`BytesFeedParser`." +msgstr "" +"Створіть екземпляр :class:`BytesParser`. Аргументи *_class* і *policy* мають " +"те саме значення й семантику, що й аргументи *_factory* і *policy* :class:" +"`BytesFeedParser`." + +msgid "" +"Removed the *strict* argument that was deprecated in 2.4. Added the " +"*policy* keyword." +msgstr "" +"Видалено аргумент *strict*, який був застарілим у версії 2.4. Додано ключове " +"слово *політика*." + +msgid "*_class* defaults to the policy ``message_factory``." +msgstr "*_class* за умовчанням використовує політику ``message_factory``." + +msgid "" +"Read all the data from the binary file-like object *fp*, parse the resulting " +"bytes, and return the message object. *fp* must support both the :meth:`~io." +"IOBase.readline` and the :meth:`~io.IOBase.read` methods." +msgstr "" +"Прочитати всі дані з двійкового файлоподібного об’єкта *fp*, проаналізувати " +"отримані байти та повернути об’єкт повідомлення. *fp* має підтримувати як " +"методи :meth:`~io.IOBase.readline`, так і :meth:`~io.IOBase.read`." + +msgid "" +"The bytes contained in *fp* must be formatted as a block of :rfc:`5322` (or, " +"if :attr:`~email.policy.Policy.utf8` is ``True``, :rfc:`6532`) style headers " +"and header continuation lines, optionally preceded by an envelope header. " +"The header block is terminated either by the end of the data or by a blank " +"line. Following the header block is the body of the message (which may " +"contain MIME-encoded subparts, including subparts with a :mailheader:" +"`Content-Transfer-Encoding` of ``8bit``)." +msgstr "" +"Байти, що містяться у *fp*, мають бути відформатовані як блок :rfc:`5322` " +"(або, якщо :attr:`~email.policy.Policy.utf8` має значення ``True``, :rfc:" +"`6532` ) заголовки стилю та рядки продовження заголовка, необов’язково " +"передуючими заголовком конверта. Блок заголовка завершується або кінцем " +"даних, або порожнім рядком. Після блоку заголовка йде тіло повідомлення (яке " +"може містити частини в кодуванні MIME, включаючи частини з :mailheader:" +"`Content-Transfer-Encoding` ``8bit``)." + +msgid "" +"Optional *headersonly* is a flag specifying whether to stop parsing after " +"reading the headers or not. The default is ``False``, meaning it parses the " +"entire contents of the file." +msgstr "" +"Необов’язковий параметр *headersonly* — це позначка, яка вказує, чи зупиняти " +"аналіз після читання заголовків. Типовим значенням є ``False``, що означає, " +"що аналізується весь вміст файлу." + +msgid "" +"Similar to the :meth:`parse` method, except it takes a :term:`bytes-like " +"object` instead of a file-like object. Calling this method on a :term:" +"`bytes-like object` is equivalent to wrapping *bytes* in a :class:`~io." +"BytesIO` instance first and calling :meth:`parse`." +msgstr "" +"Подібний до методу :meth:`parse`, за винятком того, що він приймає :term:" +"`bytes-like object` замість файлоподібного об’єкта. Виклик цього методу для :" +"term:`bytes-подібного об’єкта` еквівалентний обгортанню *bytes* в " +"екземплярі :class:`~io.BytesIO` і виклику :meth:`parse`." + +msgid "Optional *headersonly* is as with the :meth:`parse` method." +msgstr "" +"Необов’язковий *headersonly* такий же, як у випадку з методом :meth:`parse`." + +msgid "" +"Exactly like :class:`BytesParser`, except that *headersonly* defaults to " +"``True``." +msgstr "" +"Точно так само, як :class:`BytesParser`, за винятком того, що *headersonly* " +"за умовчанням має значення ``True``." + +msgid "" +"This class is parallel to :class:`BytesParser`, but handles string input." +msgstr "" +"Цей клас є паралельним до :class:`BytesParser`, але обробляє введення рядків." + +msgid "Removed the *strict* argument. Added the *policy* keyword." +msgstr "Видалено *суворий* аргумент. Додано ключове слово *політика*." + +msgid "" +"Read all the data from the text-mode file-like object *fp*, parse the " +"resulting text, and return the root message object. *fp* must support both " +"the :meth:`~io.TextIOBase.readline` and the :meth:`~io.TextIOBase.read` " +"methods on file-like objects." +msgstr "" +"Прочитати всі дані з файлоподібного об’єкта текстового режиму *fp*, " +"проаналізувати отриманий текст і повернути кореневий об’єкт повідомлення. " +"*fp* має підтримувати як методи :meth:`~io.TextIOBase.readline`, так і :meth:" +"`~io.TextIOBase.read` для файлоподібних об’єктів." + +msgid "" +"Other than the text mode requirement, this method operates like :meth:" +"`BytesParser.parse`." +msgstr "" +"За винятком вимог текстового режиму, цей метод працює як :meth:`BytesParser." +"parse`." + +msgid "" +"Similar to the :meth:`parse` method, except it takes a string object instead " +"of a file-like object. Calling this method on a string is equivalent to " +"wrapping *text* in a :class:`~io.StringIO` instance first and calling :meth:" +"`parse`." +msgstr "" +"Подібний до методу :meth:`parse`, за винятком того, що він приймає рядковий " +"об’єкт замість файлоподібного об’єкта. Виклик цього методу для рядка " +"еквівалентний обгортанню *тексту* в екземплярі :class:`~io.StringIO` і " +"виклику :meth:`parse`." + +msgid "" +"Exactly like :class:`Parser`, except that *headersonly* defaults to ``True``." +msgstr "" +"Точно так само, як :class:`Parser`, за винятком того, що *headersonly* за " +"замовчуванням має значення ``True``." + +msgid "" +"Since creating a message object structure from a string or a file object is " +"such a common task, four functions are provided as a convenience. They are " +"available in the top-level :mod:`email` package namespace." +msgstr "" +"Оскільки створення структури об’єкта повідомлення з рядка або файлового " +"об’єкта є таким поширеним завданням, для зручності передбачено чотири " +"функції. Вони доступні в просторі імен пакета :mod:`email` верхнього рівня." + +msgid "" +"Return a message object structure from a :term:`bytes-like object`. This is " +"equivalent to ``BytesParser().parsebytes(s)``. Optional *_class* and " +"*policy* are interpreted as with the :class:`~email.parser.BytesParser` " +"class constructor." +msgstr "" +"Повертає структуру об’єкта повідомлення з :term:`bytes-like object`. Це " +"еквівалентно ``BytesParser().parsebytes(s)``. Необов’язкові *_class* і " +"*policy* інтерпретуються як конструктор класу :class:`~email.parser." +"BytesParser`." + +msgid "" +"Return a message object structure tree from an open binary :term:`file " +"object`. This is equivalent to ``BytesParser().parse(fp)``. *_class* and " +"*policy* are interpreted as with the :class:`~email.parser.BytesParser` " +"class constructor." +msgstr "" +"Повертає дерево структури об’єкта повідомлення з відкритого двійкового " +"файлу :term:`file object`. Це еквівалентно ``BytesParser().parse(fp)``. " +"*_class* і *policy* інтерпретуються як конструктор класу :class:`~email." +"parser.BytesParser`." + +msgid "" +"Return a message object structure from a string. This is equivalent to " +"``Parser().parsestr(s)``. *_class* and *policy* are interpreted as with " +"the :class:`~email.parser.Parser` class constructor." +msgstr "" +"Повертає структуру об’єкта повідомлення з рядка. Це еквівалентно ``Parser()." +"parsestr(s)``. *_class* і *policy* інтерпретуються як конструктор класу :" +"class:`~email.parser.Parser`." + +msgid "" +"Return a message object structure tree from an open :term:`file object`. " +"This is equivalent to ``Parser().parse(fp)``. *_class* and *policy* are " +"interpreted as with the :class:`~email.parser.Parser` class constructor." +msgstr "" +"Повертає дерево структури об’єкта повідомлення з відкритого :term:`file " +"object`. Це еквівалентно ``Parser().parse(fp)``. *_class* і *policy* " +"інтерпретуються як конструктор класу :class:`~email.parser.Parser`." + +msgid "" +"Here's an example of how you might use :func:`message_from_bytes` at an " +"interactive Python prompt::" +msgstr "" +"Ось приклад того, як можна використовувати :func:`message_from_bytes` в " +"інтерактивному запиті Python::" + +msgid "" +">>> import email\n" +">>> msg = email.message_from_bytes(myBytes)" +msgstr "" + +msgid "Additional notes" +msgstr "Додаткові нотатки" + +msgid "Here are some notes on the parsing semantics:" +msgstr "Ось деякі зауваження щодо семантики аналізу:" + +msgid "" +"Most non-\\ :mimetype:`multipart` type messages are parsed as a single " +"message object with a string payload. These objects will return ``False`` " +"for :meth:`~email.message.EmailMessage.is_multipart`, and :meth:`~email." +"message.EmailMessage.iter_parts` will yield an empty list." +msgstr "" +"Більшість повідомлень не типу \\ :mimetype:`multipart` аналізуються як один " +"об’єкт повідомлення з корисним навантаженням рядка. Ці об’єкти повернуть " +"``False`` для :meth:`~email.message.EmailMessage.is_multipart`, а :meth:" +"`~email.message.EmailMessage.iter_parts` дасть порожній список." + +msgid "" +"All :mimetype:`multipart` type messages will be parsed as a container " +"message object with a list of sub-message objects for their payload. The " +"outer container message will return ``True`` for :meth:`~email.message." +"EmailMessage.is_multipart`, and :meth:`~email.message.EmailMessage." +"iter_parts` will yield a list of subparts." +msgstr "" +"Усі повідомлення типу :mimetype:`multipart` аналізуватимуться як " +"контейнерний об’єкт повідомлення зі списком об’єктів підповідомлення для їх " +"корисного навантаження. Повідомлення зовнішнього контейнера поверне ``True`` " +"для :meth:`~email.message.EmailMessage.is_multipart`, а :meth:`~email." +"message.EmailMessage.iter_parts` дасть список підчастин." + +msgid "" +"Most messages with a content type of :mimetype:`message/\\*` (such as :" +"mimetype:`message/delivery-status` and :mimetype:`message/rfc822`) will also " +"be parsed as container object containing a list payload of length 1. Their :" +"meth:`~email.message.EmailMessage.is_multipart` method will return ``True``. " +"The single element yielded by :meth:`~email.message.EmailMessage.iter_parts` " +"will be a sub-message object." +msgstr "" +"Більшість повідомлень із типом вмісту :mimetype:`message/\\*` (наприклад, :" +"mimetype:`message/delivery-status` і :mimetype:`message/rfc822`) також " +"аналізуватимуться як об’єкт-контейнер, що містить корисне навантаження " +"списку довжиною 1. Їхній метод :meth:`~email.message.EmailMessage." +"is_multipart` поверне значення ``True``. Єдиний елемент, отриманий :meth:" +"`~email.message.EmailMessage.iter_parts`, буде об’єктом підповідомлення." + +msgid "" +"Some non-standards-compliant messages may not be internally consistent about " +"their :mimetype:`multipart`\\ -edness. Such messages may have a :mailheader:" +"`Content-Type` header of type :mimetype:`multipart`, but their :meth:`~email." +"message.EmailMessage.is_multipart` method may return ``False``. If such " +"messages were parsed with the :class:`~email.parser.FeedParser`, they will " +"have an instance of the :class:`~email.errors." +"MultipartInvariantViolationDefect` class in their *defects* attribute list. " +"See :mod:`email.errors` for details." +msgstr "" +"Деякі повідомлення, що не відповідають стандартам, можуть бути внутрішньо " +"неузгодженими щодо їх :mimetype:`multipart`\\ -edness. Такі повідомлення " +"можуть мати заголовок :mailheader:`Content-Type` типу :mimetype:`multipart`, " +"але їхній метод :meth:`~email.message.EmailMessage.is_multipart` може " +"повертати значення ``False``. Якщо такі повідомлення були проаналізовані за " +"допомогою :class:`~email.parser.FeedParser`, вони матимуть екземпляр класу :" +"class:`~email.errors.MultipartInvariantViolationDefect` у своєму списку " +"атрибутів *defects*. Перегляньте :mod:`email.errors` для деталей." diff --git a/library/email_policy.po b/library/email_policy.po new file mode 100644 index 000000000..852761995 --- /dev/null +++ b/library/email_policy.po @@ -0,0 +1,1022 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 01:05+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!email.policy`: Policy Objects" +msgstr "" + +msgid "**Source code:** :source:`Lib/email/policy.py`" +msgstr "**Вихідний код:** :source:`Lib/email/policy.py`" + +msgid "" +"The :mod:`email` package's prime focus is the handling of email messages as " +"described by the various email and MIME RFCs. However, the general format " +"of email messages (a block of header fields each consisting of a name " +"followed by a colon followed by a value, the whole block followed by a blank " +"line and an arbitrary 'body'), is a format that has found utility outside of " +"the realm of email. Some of these uses conform fairly closely to the main " +"email RFCs, some do not. Even when working with email, there are times when " +"it is desirable to break strict compliance with the RFCs, such as generating " +"emails that interoperate with email servers that do not themselves follow " +"the standards, or that implement extensions you want to use in ways that " +"violate the standards." +msgstr "" +"Пакунок :mod:`email` головним чином зосереджується на обробці повідомлень " +"електронної пошти, як описано в різних RFC електронної пошти та MIME. Однак " +"загальний формат повідомлень електронної пошти (блок полів заголовка, кожне " +"з яких складається з назви, за якою йде двокрапка, за якою йде значення, " +"весь блок, після якого йде порожній рядок і довільний \"тіло\"), — це " +"формат, який знайшов утиліта за межами сфери електронної пошти. Деякі з цих " +"способів використання досить точно відповідають основним RFC електронної " +"пошти, інші – ні. Навіть під час роботи з електронною поштою бувають " +"випадки, коли бажано порушити сувору відповідність RFC, наприклад, " +"створювати електронні листи, які взаємодіють із серверами електронної пошти, " +"які самі по собі не дотримуються стандартів, або які реалізують розширення, " +"які ви хочете використовувати, у спосіб, який порушує стандарти." + +msgid "" +"Policy objects give the email package the flexibility to handle all these " +"disparate use cases." +msgstr "" +"Об’єкти політики надають пакету електронної пошти гнучкість для обробки всіх " +"цих різнорідних випадків використання." + +msgid "" +"A :class:`Policy` object encapsulates a set of attributes and methods that " +"control the behavior of various components of the email package during use. :" +"class:`Policy` instances can be passed to various classes and methods in the " +"email package to alter the default behavior. The settable values and their " +"defaults are described below." +msgstr "" +"Об’єкт :class:`Policy` інкапсулює набір атрибутів і методів, які контролюють " +"поведінку різних компонентів пакета електронної пошти під час використання. " +"Екземпляри :class:`Policy` можна передати різним класам і методам у пакеті " +"електронної пошти, щоб змінити типову поведінку. Нижче описано встановлені " +"значення та їх значення за замовчуванням." + +msgid "" +"There is a default policy used by all classes in the email package. For all " +"of the :mod:`~email.parser` classes and the related convenience functions, " +"and for the :class:`~email.message.Message` class, this is the :class:" +"`Compat32` policy, via its corresponding pre-defined instance :const:" +"`compat32`. This policy provides for complete backward compatibility (in " +"some cases, including bug compatibility) with the pre-Python3.3 version of " +"the email package." +msgstr "" +"Існує політика за замовчуванням, яка використовується всіма класами в пакеті " +"електронної пошти. Для всіх класів :mod:`~email.parser` і відповідних " +"функцій зручності, а також для класу :class:`~email.message.Message`, це " +"політика :class:`Compat32` через відповідну політику попередньо визначений " +"екземпляр :const:`compat32`. Ця політика забезпечує повну зворотну " +"сумісність (у деяких випадках, включаючи сумісність із помилками) із версією " +"пакета електронної пошти до Python3.3." + +msgid "" +"This default value for the *policy* keyword to :class:`~email.message." +"EmailMessage` is the :class:`EmailPolicy` policy, via its pre-defined " +"instance :data:`~default`." +msgstr "" +"Це значення за умовчанням для ключового слова *policy* для :class:`~email." +"message.EmailMessage` є політикою :class:`EmailPolicy` через її попередньо " +"визначений екземпляр :data:`~default`." + +msgid "" +"When a :class:`~email.message.Message` or :class:`~email.message." +"EmailMessage` object is created, it acquires a policy. If the message is " +"created by a :mod:`~email.parser`, a policy passed to the parser will be the " +"policy used by the message it creates. If the message is created by the " +"program, then the policy can be specified when it is created. When a " +"message is passed to a :mod:`~email.generator`, the generator uses the " +"policy from the message by default, but you can also pass a specific policy " +"to the generator that will override the one stored on the message object." +msgstr "" +"Коли створюється об’єкт :class:`~email.message.Message` або :class:`~email." +"message.EmailMessage`, він отримує політику. Якщо повідомлення створено :mod:" +"`~email.parser`, політика, передана аналізатору, буде політикою, яка " +"використовується у створеному ним повідомленні. Якщо повідомлення " +"створюється програмою, то під час його створення можна вказати політику. " +"Коли повідомлення передається до :mod:`~email.generator`, генератор " +"використовує політику з повідомлення за замовчуванням, але ви також можете " +"передати певну політику генератору, яка замінить політику, збережену в " +"об’єкті повідомлення." + +msgid "" +"The default value for the *policy* keyword for the :mod:`email.parser` " +"classes and the parser convenience functions **will be changing** in a " +"future version of Python. Therefore you should **always specify explicitly " +"which policy you want to use** when calling any of the classes and functions " +"described in the :mod:`~email.parser` module." +msgstr "" +"Значення за замовчуванням для ключового слова *policy* для класів :mod:" +"`email.parser` і зручних функцій синтаксичного аналізатора **буде змінено** " +"в наступній версії Python. Тому ви повинні **завжди чітко вказувати, яку " +"політику ви хочете використовувати** під час виклику будь-якого з класів і " +"функцій, описаних у модулі :mod:`~email.parser`." + +msgid "" +"The first part of this documentation covers the features of :class:`Policy`, " +"an :term:`abstract base class` that defines the features that are common to " +"all policy objects, including :const:`compat32`. This includes certain hook " +"methods that are called internally by the email package, which a custom " +"policy could override to obtain different behavior. The second part " +"describes the concrete classes :class:`EmailPolicy` and :class:`Compat32`, " +"which implement the hooks that provide the standard behavior and the " +"backward compatible behavior and features, respectively." +msgstr "" +"Перша частина цієї документації охоплює функції :class:`Policy`, :term:" +"`abstract base class`, який визначає функції, спільні для всіх об’єктів " +"політики, включаючи :const:`compat32`. Це включає в себе певні методи " +"підключення, які викликаються внутрішньо пакетом електронної пошти, які " +"спеціальна політика може замінити, щоб отримати іншу поведінку. Друга " +"частина описує конкретні класи :class:`EmailPolicy` і :class:`Compat32`, які " +"реалізують хуки, які забезпечують стандартну поведінку та зворотну " +"сумісність і функції відповідно." + +msgid "" +":class:`Policy` instances are immutable, but they can be cloned, accepting " +"the same keyword arguments as the class constructor and returning a new :" +"class:`Policy` instance that is a copy of the original but with the " +"specified attributes values changed." +msgstr "" +"Екземпляри :class:`Policy` незмінні, але їх можна клонувати, приймаючи ті " +"самі аргументи ключового слова, що й конструктор класу, і повертаючи новий " +"екземпляр :class:`Policy`, який є копією оригіналу, але зі зміненими " +"значеннями вказаних атрибутів ." + +msgid "" +"As an example, the following code could be used to read an email message " +"from a file on disk and pass it to the system ``sendmail`` program on a Unix " +"system:" +msgstr "" +"Як приклад, наступний код можна використати для читання повідомлення " +"електронної пошти з файлу на диску та передачі його системній програмі " +"``sendmail`` в системі Unix:" + +msgid "" +">>> from email import message_from_binary_file\n" +">>> from email.generator import BytesGenerator\n" +">>> from email import policy\n" +">>> from subprocess import Popen, PIPE\n" +">>> with open('mymsg.txt', 'rb') as f:\n" +"... msg = message_from_binary_file(f, policy=policy.default)\n" +"...\n" +">>> p = Popen(['sendmail', msg['To'].addresses[0]], stdin=PIPE)\n" +">>> g = BytesGenerator(p.stdin, policy=msg.policy.clone(linesep='\\r\\n'))\n" +">>> g.flatten(msg)\n" +">>> p.stdin.close()\n" +">>> rc = p.wait()" +msgstr "" + +msgid "" +"Here we are telling :class:`~email.generator.BytesGenerator` to use the RFC " +"correct line separator characters when creating the binary string to feed " +"into ``sendmail's`` ``stdin``, where the default policy would use ``\\n`` " +"line separators." +msgstr "" +"Тут ми повідомляємо :class:`~email.generator.BytesGenerator` використовувати " +"правильні символи роздільників рядків RFC під час створення двійкового рядка " +"для передачі в ``stdin`` ``sendmail``, де політика за замовчуванням " +"використовуватиме ``\\n`` роздільники рядків." + +msgid "" +"Some email package methods accept a *policy* keyword argument, allowing the " +"policy to be overridden for that method. For example, the following code " +"uses the :meth:`~email.message.Message.as_bytes` method of the *msg* object " +"from the previous example and writes the message to a file using the native " +"line separators for the platform on which it is running::" +msgstr "" +"Деякі методи пакетів електронної пошти приймають аргумент ключового слова " +"*policy*, що дозволяє перевизначати політику для цього методу. Наприклад, у " +"наступному коді використовується метод :meth:`~email.message.Message." +"as_bytes` об’єкта *msg* із попереднього прикладу та записує повідомлення у " +"файл, використовуючи рідні розділювачі рядків для платформи, на якій воно " +"біжить::" + +msgid "" +">>> import os\n" +">>> with open('converted.txt', 'wb') as f:\n" +"... f.write(msg.as_bytes(policy=msg.policy.clone(linesep=os.linesep)))\n" +"17" +msgstr "" + +msgid "" +"Policy objects can also be combined using the addition operator, producing a " +"policy object whose settings are a combination of the non-default values of " +"the summed objects::" +msgstr "" +"Об’єкти політики також можна комбінувати за допомогою оператора додавання, " +"утворюючи об’єкт політики, параметри якого є комбінацією нестандартних " +"значень сумованих об’єктів::" + +msgid "" +">>> compat_SMTP = policy.compat32.clone(linesep='\\r\\n')\n" +">>> compat_strict = policy.compat32.clone(raise_on_defect=True)\n" +">>> compat_strict_SMTP = compat_SMTP + compat_strict" +msgstr "" + +msgid "" +"This operation is not commutative; that is, the order in which the objects " +"are added matters. To illustrate::" +msgstr "" +"Ця операція не є комутативною; тобто порядок, у якому додаються об’єкти, має " +"значення. Проілюструвати::" + +msgid "" +">>> policy100 = policy.compat32.clone(max_line_length=100)\n" +">>> policy80 = policy.compat32.clone(max_line_length=80)\n" +">>> apolicy = policy100 + policy80\n" +">>> apolicy.max_line_length\n" +"80\n" +">>> apolicy = policy80 + policy100\n" +">>> apolicy.max_line_length\n" +"100" +msgstr "" + +msgid "" +"This is the :term:`abstract base class` for all policy classes. It provides " +"default implementations for a couple of trivial methods, as well as the " +"implementation of the immutability property, the :meth:`clone` method, and " +"the constructor semantics." +msgstr "" +"Це :term:`abstract base class` для всіх класів політики. Він забезпечує " +"реалізацію за замовчуванням для кількох тривіальних методів, а також " +"реалізацію властивості незмінності, метод :meth:`clone` і семантику " +"конструктора." + +msgid "" +"The constructor of a policy class can be passed various keyword arguments. " +"The arguments that may be specified are any non-method properties on this " +"class, plus any additional non-method properties on the concrete class. A " +"value specified in the constructor will override the default value for the " +"corresponding attribute." +msgstr "" +"Конструктору класу політики можна передати різні ключові аргументи. " +"Аргументами, які можна вказати, є будь-які неметодні властивості цього " +"класу, а також будь-які додаткові неметодні властивості конкретного класу. " +"Значення, указане в конструкторі, замінить значення за замовчуванням для " +"відповідного атрибута." + +msgid "" +"This class defines the following properties, and thus values for the " +"following may be passed in the constructor of any policy class:" +msgstr "" +"Цей клас визначає наступні властивості, і, отже, значення для наступного " +"можна передати в конструктор будь-якого класу політики:" + +msgid "" +"The maximum length of any line in the serialized output, not counting the " +"end of line character(s). Default is 78, per :rfc:`5322`. A value of ``0`` " +"or :const:`None` indicates that no line wrapping should be done at all." +msgstr "" +"Максимальна довжина будь-якого рядка в серіалізованому виведенні, не " +"враховуючи символ(и) кінця рядка. За замовчуванням 78 відповідно до :rfc:" +"`5322`. Значення ``0`` або :const:`None` вказує на те, що перенесення рядків " +"не потрібно виконувати взагалі." + +msgid "" +"The string to be used to terminate lines in serialized output. The default " +"is ``\\n`` because that's the internal end-of-line discipline used by " +"Python, though ``\\r\\n`` is required by the RFCs." +msgstr "" +"Рядок, який буде використовуватися для завершення рядків у серіалізованому " +"виведенні. Типовим є ``\\n``, оскільки це внутрішня дисципліна кінця рядка, " +"яка використовується Python, хоча ``\\r\\n`` вимагається RFC." + +msgid "" +"Controls the type of Content Transfer Encodings that may be or are required " +"to be used. The possible values are:" +msgstr "" +"Керує типом кодувань передачі вмісту, які можуть або повинні " +"використовуватися. Можливі значення:" + +msgid "``7bit``" +msgstr "``7 біт``" + +msgid "" +"all data must be \"7 bit clean\" (ASCII-only). This means that where " +"necessary data will be encoded using either quoted-printable or base64 " +"encoding." +msgstr "" +"усі дані мають бути \"7-бітними чистими\" (лише ASCII). Це означає, що там, " +"де це необхідно, дані будуть закодовані з використанням кодування для друку " +"в цитатах або кодування base64." + +msgid "``8bit``" +msgstr "``8 біт``" + +msgid "" +"data is not constrained to be 7 bit clean. Data in headers is still " +"required to be ASCII-only and so will be encoded (see :meth:`fold_binary` " +"and :attr:`~EmailPolicy.utf8` below for exceptions), but body parts may use " +"the ``8bit`` CTE." +msgstr "" +"дані не мають обмежень бути чистими 7 біт. Дані в заголовках, як і раніше, " +"повинні бути лише ASCII, тому вони будуть закодовані (див. :meth:" +"`fold_binary` і :attr:`~EmailPolicy.utf8` нижче для винятків), але частини " +"тіла можуть використовувати ``8bit`` CTE." + +msgid "" +"A ``cte_type`` value of ``8bit`` only works with ``BytesGenerator``, not " +"``Generator``, because strings cannot contain binary data. If a " +"``Generator`` is operating under a policy that specifies ``cte_type=8bit``, " +"it will act as if ``cte_type`` is ``7bit``." +msgstr "" +"Значення ``cte_type`` ``8bit`` працює лише з ``BytesGenerator``, а не " +"``Generator``, оскільки рядки не можуть містити двійкові дані. Якщо " +"``генератор`` працює відповідно до політики, яка визначає ``cte_type=8bit``, " +"він діятиме так, ніби ``cte_type`` має значення ``7bit``." + +msgid "" +"If :const:`True`, any defects encountered will be raised as errors. If :" +"const:`False` (the default), defects will be passed to the :meth:" +"`register_defect` method." +msgstr "" +"Якщо :const:`True`, будь-які виявлені дефекти визначатимуться як помилки. " +"Якщо :const:`False` (за замовчуванням), дефекти будуть передані в метод :" +"meth:`register_defect`." + +msgid "" +"If :const:`True`, lines starting with *\"From \"* in the body are escaped by " +"putting a ``>`` in front of them. This parameter is used when the message is " +"being serialized by a generator. Default: :const:`False`." +msgstr "" +"Якщо :const:`True`, рядки, що починаються з *\"From \"* у тілі, екрануються " +"шляхом розміщення ``>`` перед ними. Цей параметр використовується, коли " +"повідомлення серіалізується генератором. Типове значення: :const:`False`." + +msgid "" +"A factory function for constructing a new empty message object. Used by the " +"parser when building messages. Defaults to ``None``, in which case :class:" +"`~email.message.Message` is used." +msgstr "" +"Фабрична функція для створення нового порожнього об’єкта повідомлення. " +"Використовується аналізатором під час створення повідомлень. За " +"замовчуванням ``None``, у цьому випадку використовується :class:`~email." +"message.Message`." + +msgid "" +"If ``True`` (the default), the generator will raise :exc:`~email.errors." +"HeaderWriteError` instead of writing a header that is improperly folded or " +"delimited, such that it would be parsed as multiple headers or joined with " +"adjacent data. Such headers can be generated by custom header classes or " +"bugs in the ``email`` module." +msgstr "" + +msgid "" +"As it's a security feature, this defaults to ``True`` even in the :class:" +"`~email.policy.Compat32` policy. For backwards compatible, but unsafe, " +"behavior, it must be set to ``False`` explicitly." +msgstr "" + +msgid "" +"The following :class:`Policy` method is intended to be called by code using " +"the email library to create policy instances with custom settings:" +msgstr "" +"Наступний метод :class:`Policy` призначений для виклику за допомогою коду за " +"допомогою бібліотеки електронної пошти для створення екземплярів політики з " +"настроюваними налаштуваннями:" + +msgid "" +"Return a new :class:`Policy` instance whose attributes have the same values " +"as the current instance, except where those attributes are given new values " +"by the keyword arguments." +msgstr "" +"Повертає новий екземпляр :class:`Policy`, атрибути якого мають ті самі " +"значення, що й поточний екземпляр, за винятком тих випадків, коли ці " +"атрибути отримують нові значення аргументами ключового слова." + +msgid "" +"The remaining :class:`Policy` methods are called by the email package code, " +"and are not intended to be called by an application using the email package. " +"A custom policy must implement all of these methods." +msgstr "" +"Решта методів :class:`Policy` викликається кодом пакета електронної пошти і " +"не призначена для виклику програмою, яка використовує пакет електронної " +"пошти. Спеціальна політика повинна реалізовувати всі ці методи." + +msgid "" +"Handle a *defect* found on *obj*. When the email package calls this method, " +"*defect* will always be a subclass of :class:`~email.errors.MessageDefect`." +msgstr "" + +msgid "" +"The default implementation checks the :attr:`raise_on_defect` flag. If it " +"is ``True``, *defect* is raised as an exception. If it is ``False`` (the " +"default), *obj* and *defect* are passed to :meth:`register_defect`." +msgstr "" +"Стандартна реалізація перевіряє прапорець :attr:`raise_on_defect`. Якщо " +"значення ``True``, *defect* створюється як виняток. Якщо значення ``False`` " +"(за замовчуванням), *obj* і *defect* передаються в :meth:`register_defect`." + +msgid "" +"Register a *defect* on *obj*. In the email package, *defect* will always be " +"a subclass of :class:`~email.errors.MessageDefect`." +msgstr "" + +msgid "" +"The default implementation calls the ``append`` method of the ``defects`` " +"attribute of *obj*. When the email package calls :attr:`handle_defect`, " +"*obj* will normally have a ``defects`` attribute that has an ``append`` " +"method. Custom object types used with the email package (for example, " +"custom ``Message`` objects) should also provide such an attribute, otherwise " +"defects in parsed messages will raise unexpected errors." +msgstr "" +"Стандартна реалізація викликає метод ``append`` атрибута ``defects`` *obj*. " +"Коли пакет електронної пошти викликає :attr:`handle_defect`, *obj* зазвичай " +"матиме атрибут ``defects``, який має метод ``append``. Спеціальні типи " +"об’єктів, які використовуються з пакетом електронної пошти (наприклад, " +"спеціальні об’єкти ``Message``), також повинні надавати такий атрибут, " +"інакше дефекти в проаналізованих повідомленнях призведуть до неочікуваних " +"помилок." + +msgid "Return the maximum allowed number of headers named *name*." +msgstr "Повертає максимально дозволену кількість заголовків із назвою *ім’я*." + +msgid "" +"Called when a header is added to an :class:`~email.message.EmailMessage` or :" +"class:`~email.message.Message` object. If the returned value is not ``0`` " +"or ``None``, and there are already a number of headers with the name *name* " +"greater than or equal to the value returned, a :exc:`ValueError` is raised." +msgstr "" +"Викликається, коли заголовок додається до об’єкта :class:`~email.message." +"EmailMessage` або :class:`~email.message.Message`. Якщо повернуте значення " +"не є ``0`` або ``None``, і вже існує кількість заголовків з іменем *name*, " +"більшим або рівним поверненому значенню, виникає :exc:`ValueError` ." + +msgid "" +"Because the default behavior of ``Message.__setitem__`` is to append the " +"value to the list of headers, it is easy to create duplicate headers without " +"realizing it. This method allows certain headers to be limited in the " +"number of instances of that header that may be added to a ``Message`` " +"programmatically. (The limit is not observed by the parser, which will " +"faithfully produce as many headers as exist in the message being parsed.)" +msgstr "" +"Оскільки за замовчуванням ``Message.__setitem__`` додає значення до списку " +"заголовків, легко створити дублікати заголовків, не усвідомлюючи цього. Цей " +"метод дозволяє обмежити певні заголовки в кількості екземплярів цього " +"заголовка, які можна додати до ``повідомлення`` програмним шляхом. " +"(Обмеження не дотримується синтаксичним аналізатором, який сумлінно створить " +"стільки заголовків, скільки існує в повідомленні, що аналізується.)" + +msgid "The default implementation returns ``None`` for all header names." +msgstr "" +"Реалізація за замовчуванням повертає ``None`` для всіх імен заголовків." + +msgid "" +"The email package calls this method with a list of strings, each string " +"ending with the line separation characters found in the source being " +"parsed. The first line includes the field header name and separator. All " +"whitespace in the source is preserved. The method should return the " +"``(name, value)`` tuple that is to be stored in the ``Message`` to represent " +"the parsed header." +msgstr "" +"Пакет електронної пошти викликає цей метод зі списком рядків, кожен рядок " +"закінчується символами розділення рядків, знайденими в джерелі, що " +"аналізується. Перший рядок містить назву заголовка поля та роздільник. Усі " +"пробіли в джерелі збережено. Метод має повертати кортеж ``(name, value)``, " +"який має зберігатися в ``Message`` для представлення аналізованого заголовка." + +msgid "" +"If an implementation wishes to retain compatibility with the existing email " +"package policies, *name* should be the case preserved name (all characters " +"up to the '``:``' separator), while *value* should be the unfolded value " +"(all line separator characters removed, but whitespace kept intact), " +"stripped of leading whitespace." +msgstr "" +"Якщо реалізація бажає зберегти сумісність із існуючими політиками пакетів " +"електронної пошти, *ім’я* має бути ім’ям із збереженням регістру (усі " +"символи до роздільника \"``:``), тоді як *значення* має бути розгорнутим " +"значенням (усі символи-роздільники рядків видалено, але пробіли збережено " +"без змін), видалено пробіли на початку." + +msgid "*sourcelines* may contain surrogateescaped binary data." +msgstr "*вихідні лінії* можуть містити сурогатні двійкові дані." + +msgid "There is no default implementation" +msgstr "Реалізації за замовчуванням немає" + +msgid "" +"The email package calls this method with the name and value provided by the " +"application program when the application program is modifying a ``Message`` " +"programmatically (as opposed to a ``Message`` created by a parser). The " +"method should return the ``(name, value)`` tuple that is to be stored in the " +"``Message`` to represent the header." +msgstr "" +"Пакет електронної пошти викликає цей метод із назвою та значенням, наданими " +"прикладною програмою, коли прикладна програма програмно змінює " +"``повідомлення`` (на відміну від ``повідомлення``, створеного аналізатором). " +"Метод має повертати кортеж ``(name, value)``, який має зберігатися в " +"``Message`` для представлення заголовка." + +msgid "" +"If an implementation wishes to retain compatibility with the existing email " +"package policies, the *name* and *value* should be strings or string " +"subclasses that do not change the content of the passed in arguments." +msgstr "" +"Якщо реалізація бажає зберегти сумісність із існуючими політиками пакетів " +"електронної пошти, *ім’я* та *значення* мають бути рядками або підкласами " +"рядків, які не змінюють вміст переданих аргументів." + +msgid "" +"The email package calls this method with the *name* and *value* currently " +"stored in the ``Message`` when that header is requested by the application " +"program, and whatever the method returns is what is passed back to the " +"application as the value of the header being retrieved. Note that there may " +"be more than one header with the same name stored in the ``Message``; the " +"method is passed the specific name and value of the header destined to be " +"returned to the application." +msgstr "" +"Пакет електронної пошти викликає цей метод із *ім’ям* і *значенням*, які " +"наразі зберігаються в ``Message``, коли прикладна програма запитує цей " +"заголовок, і те, що метод повертає, передається назад до програми як " +"значення заголовка, що витягується. Зауважте, що в ``Повідомленні`` може " +"бути більше одного заголовка з однаковою назвою; методу передається " +"конкретне ім'я та значення заголовка, призначеного для повернення до " +"програми." + +msgid "" +"*value* may contain surrogateescaped binary data. There should be no " +"surrogateescaped binary data in the value returned by the method." +msgstr "" +"*значення* може містити сурогатні екрановані двійкові дані. У значенні, яке " +"повертає метод, не повинно бути сурогатних двійкових даних." + +msgid "" +"The email package calls this method with the *name* and *value* currently " +"stored in the ``Message`` for a given header. The method should return a " +"string that represents that header \"folded\" correctly (according to the " +"policy settings) by composing the *name* with the *value* and inserting :" +"attr:`linesep` characters at the appropriate places. See :rfc:`5322` for a " +"discussion of the rules for folding email headers." +msgstr "" +"Пакет електронної пошти викликає цей метод із *ім’ям* і *значенням*, які " +"наразі зберігаються в ``Повідомленні`` для заданого заголовка. Метод має " +"повернути рядок, який представляє цей заголовок, \"згорнутий\" правильно " +"(відповідно до налаштувань політики), складаючи *ім’я* з *значенням* і " +"вставляючи символи :attr:`linesep` у відповідних місцях. Перегляньте :rfc:" +"`5322` для обговорення правил згортання заголовків електронних листів." + +msgid "" +"*value* may contain surrogateescaped binary data. There should be no " +"surrogateescaped binary data in the string returned by the method." +msgstr "" +"*значення* може містити сурогатні екрановані двійкові дані. У рядку, який " +"повертає метод, не повинно бути сурогатних двійкових даних." + +msgid "" +"The same as :meth:`fold`, except that the returned value should be a bytes " +"object rather than a string." +msgstr "" +"Те саме, що :meth:`fold`, за винятком того, що повернуте значення має бути " +"об’єктом bytes, а не рядком." + +msgid "" +"*value* may contain surrogateescaped binary data. These could be converted " +"back into binary data in the returned bytes object." +msgstr "" +"*значення* може містити сурогатні екрановані двійкові дані. Вони можуть бути " +"перетворені назад у двійкові дані у повернутому об’єкті bytes." + +msgid "" +"This concrete :class:`Policy` provides behavior that is intended to be fully " +"compliant with the current email RFCs. These include (but are not limited " +"to) :rfc:`5322`, :rfc:`2047`, and the current MIME RFCs." +msgstr "" +"Ця конкретна :class:`Policy` забезпечує поведінку, яка повністю відповідає " +"поточним RFC електронної пошти. До них належать (але не обмежуються ними) :" +"rfc:`5322`, :rfc:`2047` і поточні RFC MIME." + +msgid "" +"This policy adds new header parsing and folding algorithms. Instead of " +"simple strings, headers are ``str`` subclasses with attributes that depend " +"on the type of the field. The parsing and folding algorithm fully " +"implement :rfc:`2047` and :rfc:`5322`." +msgstr "" +"Ця політика додає нові алгоритми аналізу та згортання заголовків. Замість " +"простих рядків, заголовки є підкласами ``str`` з атрибутами, які залежать " +"від типу поля. Алгоритм аналізу та згортання повністю реалізує :rfc:`2047` " +"і :rfc:`5322`." + +msgid "" +"The default value for the :attr:`~email.policy.Policy.message_factory` " +"attribute is :class:`~email.message.EmailMessage`." +msgstr "" +"Значенням за замовчуванням атрибута :attr:`~email.policy.Policy." +"message_factory` є :class:`~email.message.EmailMessage`." + +msgid "" +"In addition to the settable attributes listed above that apply to all " +"policies, this policy adds the following additional attributes:" +msgstr "" +"На додаток до перерахованих вище настроюваних атрибутів, які застосовуються " +"до всіх політик, ця політика додає такі додаткові атрибути:" + +msgid "[1]_" +msgstr "[1]_" + +msgid "" +"If ``False``, follow :rfc:`5322`, supporting non-ASCII characters in headers " +"by encoding them as \"encoded words\". If ``True``, follow :rfc:`6532` and " +"use ``utf-8`` encoding for headers. Messages formatted in this way may be " +"passed to SMTP servers that support the ``SMTPUTF8`` extension (:rfc:`6531`)." +msgstr "" +"Якщо ``False``, дотримуйтесь :rfc:`5322`, підтримуючи символи, відмінні від " +"ASCII, у заголовках, кодуючи їх як \"закодовані слова\". Якщо ``True``, " +"слідуйте :rfc:`6532` і використовуйте ``utf-8`` кодування для заголовків. " +"Повідомлення, відформатовані таким чином, можуть передаватися на сервери " +"SMTP, які підтримують розширення ``SMTPUTF8`` (:rfc:`6531`)." + +msgid "" +"If the value for a header in the ``Message`` object originated from a :mod:" +"`~email.parser` (as opposed to being set by a program), this attribute " +"indicates whether or not a generator should refold that value when " +"transforming the message back into serialized form. The possible values are:" +msgstr "" +"Якщо значення для заголовка в об’єкті ``Message`` походить від :mod:`~email." +"parser` (на відміну від встановлення програмою), цей атрибут вказує, чи " +"повинен генератор повторно згортати це значення, коли перетворення " +"повідомлення назад у серіалізовану форму. Можливі значення:" + +msgid "``none``" +msgstr "``None``" + +msgid "all source values use original folding" +msgstr "усі вихідні значення використовують оригінальне згортання" + +msgid "``long``" +msgstr "``довгий``" + +msgid "" +"source values that have any line that is longer than ``max_line_length`` " +"will be refolded" +msgstr "" +"вихідні значення, які мають будь-який рядок, довший за ``max_line_length``, " +"будуть повторно згорнуті" + +msgid "``all``" +msgstr "``все``" + +msgid "all values are refolded." +msgstr "усі значення перескладають." + +msgid "The default is ``long``." +msgstr "Типовим є ``long``." + +msgid "" +"A callable that takes two arguments, ``name`` and ``value``, where ``name`` " +"is a header field name and ``value`` is an unfolded header field value, and " +"returns a string subclass that represents that header. A default " +"``header_factory`` (see :mod:`~email.headerregistry`) is provided that " +"supports custom parsing for the various address and date :RFC:`5322` header " +"field types, and the major MIME header field stypes. Support for additional " +"custom parsing will be added in the future." +msgstr "" +"Викликається, що приймає два аргументи, ``name`` і ``value``, де ``name`` — " +"це ім’я поля заголовка, а ``value`` — це значення розгорнутого поля " +"заголовка, і повертає підклас рядка, який представляє той заголовок. За " +"замовчуванням надається ``header_factory`` (див. :mod:`~email." +"headerregistry`), який підтримує спеціальний аналіз для різних типів полів " +"заголовків адреси та дати :RFC:`5322`, а також основних типів полів " +"заголовків MIME. У майбутньому буде додано підтримку додаткового " +"спеціального аналізу." + +msgid "" +"An object with at least two methods: get_content and set_content. When the :" +"meth:`~email.message.EmailMessage.get_content` or :meth:`~email.message." +"EmailMessage.set_content` method of an :class:`~email.message.EmailMessage` " +"object is called, it calls the corresponding method of this object, passing " +"it the message object as its first argument, and any arguments or keywords " +"that were passed to it as additional arguments. By default " +"``content_manager`` is set to :data:`~email.contentmanager.raw_data_manager`." +msgstr "" +"Об’єкт із принаймні двома методами: get_content і set_content. Коли " +"викликається метод :meth:`~email.message.EmailMessage.get_content` або :meth:" +"`~email.message.EmailMessage.set_content` об’єкта :class:`~email.message." +"EmailMessage`, він викликає відповідний метод цього об’єкта, передаючи йому " +"об’єкт повідомлення як його перший аргумент, а також будь-які аргументи або " +"ключові слова, які були передані йому як додаткові аргументи. За умовчанням " +"``content_manager`` встановлено на :data:`~email.contentmanager." +"raw_data_manager`." + +msgid "" +"The class provides the following concrete implementations of the abstract " +"methods of :class:`Policy`:" +msgstr "" +"Клас забезпечує такі конкретні реалізації абстрактних методів :class:" +"`Policy`:" + +msgid "" +"Returns the value of the :attr:`~email.headerregistry.BaseHeader.max_count` " +"attribute of the specialized class used to represent the header with the " +"given name." +msgstr "" +"Повертає значення атрибута :attr:`~email.headerregistry.BaseHeader." +"max_count` спеціалізованого класу, який використовується для представлення " +"заголовка з заданим іменем." + +msgid "" +"The name is parsed as everything up to the '``:``' and returned unmodified. " +"The value is determined by stripping leading whitespace off the remainder of " +"the first line, joining all subsequent lines together, and stripping any " +"trailing carriage return or linefeed characters." +msgstr "" +"Ім'я аналізується як усе, аж до \"``:``\", і повертається без змін. Значення " +"визначається видаленням початкових пробілів із решти першого рядка, " +"з’єднанням усіх наступних рядків разом і видаленням будь-яких завершальних " +"символів повернення каретки або переводу рядка." + +msgid "" +"The name is returned unchanged. If the input value has a ``name`` attribute " +"and it matches *name* ignoring case, the value is returned unchanged. " +"Otherwise the *name* and *value* are passed to ``header_factory``, and the " +"resulting header object is returned as the value. In this case a " +"``ValueError`` is raised if the input value contains CR or LF characters." +msgstr "" +"Ім'я повертається без змін. Якщо вхідне значення має атрибут ``name`` і воно " +"відповідає *name* без урахування регістру, значення повертається без змін. В " +"іншому випадку *ім’я* та *значення* передаються до ``header_factory``, а " +"отриманий об’єкт заголовка повертається як значення. У цьому випадку виникає " +"``ValueError``, якщо вхідне значення містить символи CR або LF." + +msgid "" +"If the value has a ``name`` attribute, it is returned to unmodified. " +"Otherwise the *name*, and the *value* with any CR or LF characters removed, " +"are passed to the ``header_factory``, and the resulting header object is " +"returned. Any surrogateescaped bytes get turned into the unicode unknown-" +"character glyph." +msgstr "" +"Якщо значення має атрибут ``name``, воно повертається до незміненого. В " +"іншому випадку *ім’я* та *значення* з видаленими будь-якими символами CR або " +"LF передаються до ``header_factory``, і повертається отриманий об’єкт " +"заголовка. Будь-які сурогатні екрановані байти перетворюються на гліф " +"невідомих символів Unicode." + +msgid "" +"Header folding is controlled by the :attr:`refold_source` policy setting. A " +"value is considered to be a 'source value' if and only if it does not have a " +"``name`` attribute (having a ``name`` attribute means it is a header object " +"of some sort). If a source value needs to be refolded according to the " +"policy, it is converted into a header object by passing the *name* and the " +"*value* with any CR and LF characters removed to the ``header_factory``. " +"Folding of a header object is done by calling its ``fold`` method with the " +"current policy." +msgstr "" +"Згортання заголовка контролюється параметром політики :attr:`refold_source`. " +"Значення вважається \"вихідним значенням\" тоді і тільки тоді, коли воно не " +"має атрибута ``name`` (наявність атрибута ``name`` означає, що це певний " +"об’єкт заголовка). Якщо вихідне значення потрібно повторно згорнути " +"відповідно до політики, воно перетворюється на об’єкт заголовка шляхом " +"передачі *name* і *value* з будь-якими символами CR і LF, видаленими до " +"``header_factory``. Згортання об’єкта заголовка виконується викликом його " +"методу ``fold`` із поточною політикою." + +msgid "" +"Source values are split into lines using :meth:`~str.splitlines`. If the " +"value is not to be refolded, the lines are rejoined using the ``linesep`` " +"from the policy and returned. The exception is lines containing non-ascii " +"binary data. In that case the value is refolded regardless of the " +"``refold_source`` setting, which causes the binary data to be CTE encoded " +"using the ``unknown-8bit`` charset." +msgstr "" +"Вихідні значення розбиваються на рядки за допомогою :meth:`~str.splitlines`. " +"Якщо значення не потрібно повторно згортати, рядки знову об’єднуються за " +"допомогою ``linesep`` із політики та повертаються. Винятком є рядки, що " +"містять двійкові дані, відмінні від ASCII. У цьому випадку значення повторно " +"згортається незалежно від параметра ``refold_source``, що призводить до " +"того, що двійкові дані кодуються CTE за допомогою набору символів " +"``unknown-8bit``." + +msgid "" +"The same as :meth:`fold` if :attr:`~Policy.cte_type` is ``7bit``, except " +"that the returned value is bytes." +msgstr "" +"Те саме, що :meth:`fold`, якщо :attr:`~Policy.cte_type` має значення " +"``7bit``, за винятком того, що повертається значення байтів." + +msgid "" +"If :attr:`~Policy.cte_type` is ``8bit``, non-ASCII binary data is converted " +"back into bytes. Headers with binary data are not refolded, regardless of " +"the ``refold_header`` setting, since there is no way to know whether the " +"binary data consists of single byte characters or multibyte characters." +msgstr "" +"Якщо :attr:`~Policy.cte_type` має значення ``8bit``, двійкові дані, відмінні " +"від ASCII, перетворюються назад у байти. Заголовки з двійковими даними не " +"згортаються повторно, незалежно від параметра ``refold_header``, оскільки " +"немає способу дізнатися, чи двійкові дані складаються з однобайтових " +"символів чи багатобайтових символів." + +msgid "" +"The following instances of :class:`EmailPolicy` provide defaults suitable " +"for specific application domains. Note that in the future the behavior of " +"these instances (in particular the ``HTTP`` instance) may be adjusted to " +"conform even more closely to the RFCs relevant to their domains." +msgstr "" +"Наступні екземпляри :class:`EmailPolicy` забезпечують значення за " +"замовчуванням, придатні для певних доменів програм. Зауважте, що в " +"майбутньому поведінка цих екземплярів (зокрема екземпляра ``HTTP``) може " +"бути налаштована для ще більшої відповідності RFC, що стосуються їхніх " +"доменів." + +msgid "" +"An instance of ``EmailPolicy`` with all defaults unchanged. This policy " +"uses the standard Python ``\\n`` line endings rather than the RFC-correct " +"``\\r\\n``." +msgstr "" +"Екземпляр ``EmailPolicy`` з незмінними параметрами за замовчуванням. Ця " +"політика використовує стандартні закінчення рядків Python ``\\n`` замість " +"правильного RFC ``\\r\\n``." + +msgid "" +"Suitable for serializing messages in conformance with the email RFCs. Like " +"``default``, but with ``linesep`` set to ``\\r\\n``, which is RFC compliant." +msgstr "" +"Підходить для серіалізації повідомлень відповідно до RFC електронної пошти. " +"Як ``default``, але ``linesep`` має значення ``\\r\\n``, що відповідає RFC." + +msgid "" +"The same as ``SMTP`` except that :attr:`~EmailPolicy.utf8` is ``True``. " +"Useful for serializing messages to a message store without using encoded " +"words in the headers. Should only be used for SMTP transmission if the " +"sender or recipient addresses have non-ASCII characters (the :meth:`smtplib." +"SMTP.send_message` method handles this automatically)." +msgstr "" +"Те саме, що ``SMTP``, за винятком того, що :attr:`~EmailPolicy.utf8` має " +"значення ``True``. Корисно для серіалізації повідомлень до сховища " +"повідомлень без використання закодованих слів у заголовках. Слід " +"використовувати лише для передачі SMTP, якщо адреси відправника чи " +"одержувача містять символи, відмінні від ASCII (метод :meth:`smtplib.SMTP." +"send_message` обробляє це автоматично)." + +msgid "" +"Suitable for serializing headers with for use in HTTP traffic. Like " +"``SMTP`` except that ``max_line_length`` is set to ``None`` (unlimited)." +msgstr "" +"Підходить для серіалізації заголовків для використання в трафіку HTTP. " +"Подібно до ``SMTP``, за винятком того, що ``max_line_length`` встановлено на " +"``None`` (необмежено)." + +msgid "" +"Convenience instance. The same as ``default`` except that " +"``raise_on_defect`` is set to ``True``. This allows any policy to be made " +"strict by writing::" +msgstr "" +"Зручний екземпляр. Те саме, що ``default``, за винятком того, що " +"``raise_on_defect`` має значення ``True``. Це дозволяє зробити будь-яку " +"політику суворою, написавши:" + +msgid "somepolicy + policy.strict" +msgstr "" + +msgid "" +"With all of these :class:`EmailPolicies <.EmailPolicy>`, the effective API " +"of the email package is changed from the Python 3.2 API in the following " +"ways:" +msgstr "" +"З усіма цими :class:`EmailPolicies <.EmailPolicy>` ефективний API пакета " +"електронної пошти змінюється від API Python 3.2 у такий спосіб:" + +msgid "" +"Setting a header on a :class:`~email.message.Message` results in that header " +"being parsed and a header object created." +msgstr "" +"Встановлення заголовка в :class:`~email.message.Message` призводить до " +"аналізу цього заголовка та створення об’єкта заголовка." + +msgid "" +"Fetching a header value from a :class:`~email.message.Message` results in " +"that header being parsed and a header object created and returned." +msgstr "" +"Отримання значення заголовка з :class:`~email.message.Message` призводить до " +"аналізу цього заголовка та створення та повернення об’єкта заголовка." + +msgid "" +"Any header object, or any header that is refolded due to the policy " +"settings, is folded using an algorithm that fully implements the RFC folding " +"algorithms, including knowing where encoded words are required and allowed." +msgstr "" +"Будь-який об’єкт заголовка або будь-який заголовок, який повторно " +"згортається через параметри політики, згортається за допомогою алгоритму, " +"який повністю реалізує алгоритми згортання RFC, включаючи визначення того, " +"де закодовані слова потрібні та дозволені." + +msgid "" +"From the application view, this means that any header obtained through the :" +"class:`~email.message.EmailMessage` is a header object with extra " +"attributes, whose string value is the fully decoded unicode value of the " +"header. Likewise, a header may be assigned a new value, or a new header " +"created, using a unicode string, and the policy will take care of converting " +"the unicode string into the correct RFC encoded form." +msgstr "" +"З точки зору програми це означає, що будь-який заголовок, отриманий через :" +"class:`~email.message.EmailMessage`, є об’єктом заголовка з додатковими " +"атрибутами, рядкове значення якого є повністю розшифрованим значенням " +"заголовка в Unicode. Так само заголовку може бути призначено нове значення " +"або створений новий заголовок за допомогою рядка Юнікод, і політика подбає " +"про перетворення рядка Юнікод у правильну форму, закодовану RFC." + +msgid "" +"The header objects and their attributes are described in :mod:`~email." +"headerregistry`." +msgstr "" +"Об’єкти заголовка та їхні атрибути описані в :mod:`~email.headerregistry`." + +msgid "" +"This concrete :class:`Policy` is the backward compatibility policy. It " +"replicates the behavior of the email package in Python 3.2. The :mod:" +"`~email.policy` module also defines an instance of this class, :const:" +"`compat32`, that is used as the default policy. Thus the default behavior " +"of the email package is to maintain compatibility with Python 3.2." +msgstr "" +"Ця конкретна :class:`Policy` є політикою зворотної сумісності. Він повторює " +"поведінку пакета електронної пошти в Python 3.2. Модуль :mod:`~email.policy` " +"також визначає екземпляр цього класу, :const:`compat32`, який " +"використовується як політика за замовчуванням. Таким чином, за замовчуванням " +"пакет електронної пошти підтримує сумісність із Python 3.2." + +msgid "" +"The following attributes have values that are different from the :class:" +"`Policy` default:" +msgstr "" +"Наступні атрибути мають значення, які відрізняються від стандартних :class:" +"`Policy`:" + +msgid "The default is ``True``." +msgstr "Типовим значенням є ``True``." + +msgid "The name and value are returned unmodified." +msgstr "Ім'я та значення повертаються без змін." + +msgid "" +"If the value contains binary data, it is converted into a :class:`~email." +"header.Header` object using the ``unknown-8bit`` charset. Otherwise it is " +"returned unmodified." +msgstr "" +"Якщо значення містить двійкові дані, воно перетворюється на об’єкт :class:" +"`~email.header.Header` за допомогою кодування ``unknown-8bit``. В іншому " +"випадку він повертається без змін." + +msgid "" +"Headers are folded using the :class:`~email.header.Header` folding " +"algorithm, which preserves existing line breaks in the value, and wraps each " +"resulting line to the ``max_line_length``. Non-ASCII binary data are CTE " +"encoded using the ``unknown-8bit`` charset." +msgstr "" +"Заголовки згортаються за допомогою алгоритму згортання :class:`~email.header." +"Header`, який зберігає наявні розриви рядків у значенні та обертає кожен " +"отриманий рядок до ``max_line_length``. Двійкові дані, відмінні від ASCII, " +"кодуються CTE за допомогою набору символів ``unknown-8bit``." + +msgid "" +"Headers are folded using the :class:`~email.header.Header` folding " +"algorithm, which preserves existing line breaks in the value, and wraps each " +"resulting line to the ``max_line_length``. If ``cte_type`` is ``7bit``, non-" +"ascii binary data is CTE encoded using the ``unknown-8bit`` charset. " +"Otherwise the original source header is used, with its existing line breaks " +"and any (RFC invalid) binary data it may contain." +msgstr "" +"Заголовки згортаються за допомогою алгоритму згортання :class:`~email.header." +"Header`, який зберігає наявні розриви рядків у значенні та обертає кожен " +"отриманий рядок до ``max_line_length``. Якщо ``cte_type`` дорівнює ``7bit``, " +"двійкові дані, що не є ascii, кодуються CTE з використанням набору символів " +"``unknown-8bit``. В іншому випадку використовується вихідний вихідний " +"заголовок із наявними розривами рядків і будь-якими (недійсними RFC) " +"двійковими даними, які він може містити." + +msgid "" +"An instance of :class:`Compat32`, providing backward compatibility with the " +"behavior of the email package in Python 3.2." +msgstr "" +"Екземпляр :class:`Compat32`, що забезпечує зворотну сумісність із поведінкою " +"пакета електронної пошти в Python 3.2." + +msgid "Footnotes" +msgstr "Виноски" + +msgid "" +"Originally added in 3.3 as a :term:`provisional feature `." +msgstr "" +"Спочатку додано в 3.3 як :term:`попередню функцію `." diff --git a/library/email_utils.po b/library/email_utils.po new file mode 100644 index 000000000..2c590856b --- /dev/null +++ b/library/email_utils.po @@ -0,0 +1,344 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 01:05+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!email.utils`: Miscellaneous utilities" +msgstr "" + +msgid "**Source code:** :source:`Lib/email/utils.py`" +msgstr "**Вихідний код:** :source:`Lib/email/utils.py`" + +msgid "" +"There are a couple of useful utilities provided in the :mod:`email.utils` " +"module:" +msgstr "У модулі :mod:`email.utils` є кілька корисних утиліт:" + +msgid "" +"Return local time as an aware datetime object. If called without arguments, " +"return current time. Otherwise *dt* argument should be a :class:`~datetime." +"datetime` instance, and it is converted to the local time zone according to " +"the system time zone database. If *dt* is naive (that is, ``dt.tzinfo`` is " +"``None``), it is assumed to be in local time. The *isdst* parameter is " +"ignored." +msgstr "" + +msgid "The *isdst* parameter." +msgstr "" + +msgid "" +"Returns a string suitable for an :rfc:`2822`\\ -compliant :mailheader:" +"`Message-ID` header. Optional *idstring* if given, is a string used to " +"strengthen the uniqueness of the message id. Optional *domain* if given " +"provides the portion of the msgid after the '@'. The default is the local " +"hostname. It is not normally necessary to override this default, but may be " +"useful certain cases, such as a constructing distributed system that uses a " +"consistent domain name across multiple hosts." +msgstr "" +"Повертає рядок, який підходить для :rfc:`2822`\\ -сумісного заголовка :" +"mailheader:`Message-ID`. Необов’язковий *idstring*, якщо вказано, це рядок, " +"який використовується для посилення унікальності ідентифікатора " +"повідомлення. Необов’язковий *домен*, якщо вказано, надає частину msgid " +"після \"@\". Типовим є локальне ім’я хоста. Зазвичай немає необхідності " +"змінювати це значення за замовчуванням, але це може бути корисним у певних " +"випадках, наприклад, при побудові розподіленої системи, яка використовує " +"узгоджене доменне ім’я на кількох хостах." + +msgid "Added the *domain* keyword." +msgstr "Додано ключове слово *domain*." + +msgid "" +"The remaining functions are part of the legacy (``Compat32``) email API. " +"There is no need to directly use these with the new API, since the parsing " +"and formatting they provide is done automatically by the header parsing " +"machinery of the new API." +msgstr "" +"Решта функцій є частиною застарілого (``Compat32``) API електронної пошти. " +"Немає потреби безпосередньо використовувати їх із новим API, оскільки " +"синтаксичний аналіз і форматування, які вони надають, виконуються " +"автоматично механізмом аналізу заголовків нового API." + +msgid "" +"Return a new string with backslashes in *str* replaced by two backslashes, " +"and double quotes replaced by backslash-double quote." +msgstr "" +"Повертає новий рядок із зворотними похилими рисками в *str*, заміненими " +"двома зворотними похилими рисками, і подвійними лапками, заміненими " +"зворотними похилими рисками-подвійними лапками." + +msgid "" +"Return a new string which is an *unquoted* version of *str*. If *str* ends " +"and begins with double quotes, they are stripped off. Likewise if *str* " +"ends and begins with angle brackets, they are stripped off." +msgstr "" +"Повертає новий рядок, який є версією *str* без лапок. Якщо *str* " +"закінчується і починається подвійними лапками, вони видаляються. Так само, " +"якщо *str* закінчується і починається кутовими дужками, вони видаляються." + +msgid "" +"Parse address -- which should be the value of some address-containing field " +"such as :mailheader:`To` or :mailheader:`Cc` -- into its constituent " +"*realname* and *email address* parts. Returns a tuple of that information, " +"unless the parse fails, in which case a 2-tuple of ``('', '')`` is returned." +msgstr "" +"Проаналізуйте адресу, яка має бути значенням деякого поля, що містить " +"адресу, наприклад :mailheader:`To` або :mailheader:`Cc`, на його складові " +"частини *realname* і *email address*. Повертає кортеж із цією інформацією, " +"якщо синтаксичний аналіз не вдається, у цьому випадку повертається 2-кортеж " +"``('', '')``." + +msgid "" +"If *strict* is true, use a strict parser which rejects malformed inputs." +msgstr "" + +msgid "Add *strict* optional parameter and reject malformed inputs by default." +msgstr "" + +msgid "" +"The inverse of :meth:`parseaddr`, this takes a 2-tuple of the form " +"``(realname, email_address)`` and returns the string value suitable for a :" +"mailheader:`To` or :mailheader:`Cc` header. If the first element of *pair* " +"is false, then the second element is returned unmodified." +msgstr "" +"Інверсія :meth:`parseaddr`, приймає 2-кортеж у формі ``(справжнє ім’я, " +"електронна_адреса)`` і повертає значення рядка, придатне для заголовка :" +"mailheader:`To` або :mailheader:`Cc` . Якщо перший елемент *pair* є false, " +"то другий елемент повертається без змін." + +msgid "" +"Optional *charset* is the character set that will be used in the :rfc:`2047` " +"encoding of the ``realname`` if the ``realname`` contains non-ASCII " +"characters. Can be an instance of :class:`str` or a :class:`~email.charset." +"Charset`. Defaults to ``utf-8``." +msgstr "" +"Необов’язковий *charset* — це набір символів, який використовуватиметься в :" +"rfc:`2047` кодуванні ``realname``, якщо ``realname`` містить символи, " +"відмінні від ASCII. Може бути екземпляром :class:`str` або :class:`~email." +"charset.Charset`. За замовчуванням ``utf-8``." + +msgid "Added the *charset* option." +msgstr "Додано опцію *charset*." + +msgid "" +"This method returns a list of 2-tuples of the form returned by " +"``parseaddr()``. *fieldvalues* is a sequence of header field values as might " +"be returned by :meth:`Message.get_all `." +msgstr "" + +msgid "Here's a simple example that gets all the recipients of a message::" +msgstr "" + +msgid "" +"from email.utils import getaddresses\n" +"\n" +"tos = msg.get_all('to', [])\n" +"ccs = msg.get_all('cc', [])\n" +"resent_tos = msg.get_all('resent-to', [])\n" +"resent_ccs = msg.get_all('resent-cc', [])\n" +"all_recipients = getaddresses(tos + ccs + resent_tos + resent_ccs)" +msgstr "" + +msgid "" +"Attempts to parse a date according to the rules in :rfc:`2822`. however, " +"some mailers don't follow that format as specified, so :func:`parsedate` " +"tries to guess correctly in such cases. *date* is a string containing an :" +"rfc:`2822` date, such as ``\"Mon, 20 Nov 1995 19:12:08 -0500\"``. If it " +"succeeds in parsing the date, :func:`parsedate` returns a 9-tuple that can " +"be passed directly to :func:`time.mktime`; otherwise ``None`` will be " +"returned. Note that indexes 6, 7, and 8 of the result tuple are not usable." +msgstr "" +"Намагається проаналізувати дату відповідно до правил у :rfc:`2822`. однак " +"деякі розсилки не дотримуються зазначеного формату, тому :func:`parsedate` " +"намагається правильно вгадати в таких випадках. *date* — це рядок, що " +"містить дату :rfc:`2822`, наприклад ``\"Mon, 20 Nov 1995 19:12:08 -0500\"``. " +"Якщо вдасться проаналізувати дату, :func:`parsedate` повертає 9-кортеж, який " +"можна передати безпосередньо до :func:`time.mktime`; інакше буде повернено " +"``None``. Зверніть увагу, що індекси 6, 7 і 8 кортежу результатів не можна " +"використовувати." + +msgid "" +"Performs the same function as :func:`parsedate`, but returns either ``None`` " +"or a 10-tuple; the first 9 elements make up a tuple that can be passed " +"directly to :func:`time.mktime`, and the tenth is the offset of the date's " +"timezone from UTC (which is the official term for Greenwich Mean Time) " +"[#]_. If the input string has no timezone, the last element of the tuple " +"returned is ``0``, which represents UTC. Note that indexes 6, 7, and 8 of " +"the result tuple are not usable." +msgstr "" +"Виконує ту саму функцію, що й :func:`parsedate`, але повертає або ``None``, " +"або 10-кортеж; перші 9 елементів утворюють кортеж, який можна передати " +"безпосередньо до :func:`time.mktime`, а десятий — це зсув часового поясу " +"дати відносно UTC (офіційний термін для часу за Гринвічем) [#]_ . Якщо " +"вхідний рядок не має часового поясу, останнім елементом кортежу, що " +"повертається, є ``0``, який представляє UTC. Зверніть увагу, що індекси 6, 7 " +"і 8 кортежу результатів не можна використовувати." + +msgid "" +"The inverse of :func:`format_datetime`. Performs the same function as :func:" +"`parsedate`, but on success returns a :mod:`~datetime.datetime`; otherwise " +"``ValueError`` is raised if *date* contains an invalid value such as an hour " +"greater than 23 or a timezone offset not between -24 and 24 hours. If the " +"input date has a timezone of ``-0000``, the ``datetime`` will be a naive " +"``datetime``, and if the date is conforming to the RFCs it will represent a " +"time in UTC but with no indication of the actual source timezone of the " +"message the date comes from. If the input date has any other valid timezone " +"offset, the ``datetime`` will be an aware ``datetime`` with the " +"corresponding a :class:`~datetime.timezone` :class:`~datetime.tzinfo`." +msgstr "" +"Інверсія :func:`format_datetime`. Виконує ту саму функцію, що й :func:" +"`parsedate`, але в разі успіху повертає :mod:`~datetime.datetime`; інакше " +"``ValueError`` викликається, якщо *date* містить недійсне значення, таке як " +"година більше 23 або зсув часового поясу не між -24 та 24 годинами. Якщо " +"введена дата має часовий пояс ``-0000``, ``datetime`` буде простим " +"``datetime``, і якщо дата відповідає RFC, вона представлятиме час у UTC, але " +"без вказівка фактичного часового поясу джерела повідомлення, з якого " +"походить дата. Якщо введена дата має будь-яке інше дійсне зміщення часового " +"поясу, ``datetime`` буде відомим ``datetime`` з відповідним :class:" +"`~datetime.timezone` :class:`~datetime.tzinfo`." + +msgid "" +"Turn a 10-tuple as returned by :func:`parsedate_tz` into a UTC timestamp " +"(seconds since the Epoch). If the timezone item in the tuple is ``None``, " +"assume local time." +msgstr "" +"Перетворіть 10-кортеж, який повертає :func:`parsedate_tz`, на мітку часу UTC " +"(секунди з епохи). Якщо елемент часового поясу в кортежі ``None``, " +"припустіть місцевий час." + +msgid "Returns a date string as per :rfc:`2822`, e.g.::" +msgstr "Повертає рядок дати згідно з :rfc:`2822`, наприклад::" + +msgid "Fri, 09 Nov 2001 01:08:47 -0000" +msgstr "" + +msgid "" +"Optional *timeval* if given is a floating-point time value as accepted by :" +"func:`time.gmtime` and :func:`time.localtime`, otherwise the current time is " +"used." +msgstr "" + +msgid "" +"Optional *localtime* is a flag that when ``True``, interprets *timeval*, and " +"returns a date relative to the local timezone instead of UTC, properly " +"taking daylight savings time into account. The default is ``False`` meaning " +"UTC is used." +msgstr "" +"Необов’язковий *місцевий час* — це прапорець, який, якщо значення ``True`` " +"інтерпретує *timeval* і повертає дату відносно місцевого часового поясу " +"замість UTC, правильно враховуючи літній час. Типовим значенням є ``False``, " +"тобто використовується UTC." + +msgid "" +"Optional *usegmt* is a flag that when ``True``, outputs a date string with " +"the timezone as an ascii string ``GMT``, rather than a numeric ``-0000``. " +"This is needed for some protocols (such as HTTP). This only applies when " +"*localtime* is ``False``. The default is ``False``." +msgstr "" +"Необов’язковий *usegmt* — це прапорець, який, якщо значення \"Істина\" " +"виводить рядок дати з часовим поясом як рядок ASCII \"GMT\", а не числове " +"\"-0000\". Це потрібно для деяких протоколів (наприклад, HTTP). Це " +"стосується лише випадків, коли *localtime* має значення ``False``. Типовим " +"значенням є ``False``." + +msgid "" +"Like ``formatdate``, but the input is a :mod:`datetime` instance. If it is " +"a naive datetime, it is assumed to be \"UTC with no information about the " +"source timezone\", and the conventional ``-0000`` is used for the timezone. " +"If it is an aware ``datetime``, then the numeric timezone offset is used. If " +"it is an aware timezone with offset zero, then *usegmt* may be set to " +"``True``, in which case the string ``GMT`` is used instead of the numeric " +"timezone offset. This provides a way to generate standards conformant HTTP " +"date headers." +msgstr "" +"Подібно до ``formatdate``, але введенням є екземпляр :mod:`datetime`. Якщо " +"це наивна дата-час, передбачається, що це \"UTC без інформації про вихідний " +"часовий пояс\", а для часового поясу використовується звичайний \"-0000\". " +"Якщо це відомий ``datetime``, тоді використовується числове зміщення " +"часового поясу. Якщо це відомий часовий пояс із нульовим зміщенням, тоді " +"*usegmt* може бути встановлено на ``True``, у цьому випадку рядок ``GMT`` " +"використовується замість числового зсуву часового поясу. Це надає спосіб " +"генерувати заголовки дати HTTP, що відповідають стандартам." + +msgid "Decode the string *s* according to :rfc:`2231`." +msgstr "Розшифруйте рядок *s* відповідно до :rfc:`2231`." + +msgid "" +"Encode the string *s* according to :rfc:`2231`. Optional *charset* and " +"*language*, if given is the character set name and language name to use. If " +"neither is given, *s* is returned as-is. If *charset* is given but " +"*language* is not, the string is encoded using the empty string for " +"*language*." +msgstr "" +"Закодуйте рядок *s* відповідно до :rfc:`2231`. Необов’язкові *charset* і " +"*language*, якщо вказано, це назва набору символів і назва мови для " +"використання. Якщо жодного не вказано, *s* повертається як є. Якщо *charset* " +"задано, але *language* ні, рядок кодується за допомогою порожнього рядка для " +"*language*." + +msgid "" +"When a header parameter is encoded in :rfc:`2231` format, :meth:`Message." +"get_param ` may return a 3-tuple containing " +"the character set, language, and value. :func:`collapse_rfc2231_value` " +"turns this into a unicode string. Optional *errors* is passed to the " +"*errors* argument of :class:`str`'s :func:`~str.encode` method; it defaults " +"to ``'replace'``. Optional *fallback_charset* specifies the character set " +"to use if the one in the :rfc:`2231` header is not known by Python; it " +"defaults to ``'us-ascii'``." +msgstr "" +"Якщо параметр заголовка закодовано у форматі :rfc:`2231`, :meth:`Message." +"get_param ` може повертати 3-кортеж, що " +"містить набір символів, мову та значення. :func:`collapse_rfc2231_value` " +"перетворює це на рядок Юнікод. Необов’язковий *errors* передається в " +"аргумент *errors* методу :class:`str` :func:`~str.encode`; за замовчуванням " +"``'replace'``. Необов’язковий *fallback_charset* визначає набір символів для " +"використання, якщо той, що міститься в заголовку :rfc:`2231`, не відомий " +"Python; за замовчуванням ``'us-ascii'``." + +msgid "" +"For convenience, if the *value* passed to :func:`collapse_rfc2231_value` is " +"not a tuple, it should be a string and it is returned unquoted." +msgstr "" +"Для зручності, якщо *значення*, передане :func:`collapse_rfc2231_value`, не " +"є кортежем, воно має бути рядком і повертається без лапок." + +msgid "" +"Decode parameters list according to :rfc:`2231`. *params* is a sequence of " +"2-tuples containing elements of the form ``(content-type, string-value)``." +msgstr "" +"Розшифруйте список параметрів відповідно до :rfc:`2231`. *параметри* — це " +"послідовність 2-кортежів, що містять елементи форми ``(тип вмісту, значення-" +"рядка)``." + +msgid "Footnotes" +msgstr "Виноски" + +msgid "" +"Note that the sign of the timezone offset is the opposite of the sign of the " +"``time.timezone`` variable for the same timezone; the latter variable " +"follows the POSIX standard while this module follows :rfc:`2822`." +msgstr "" +"Зауважте, що знак зміщення часового поясу протилежний знаку змінної ``time." +"timezone`` для того самого часового поясу; остання змінна відповідає " +"стандарту POSIX, тоді як цей модуль відповідає :rfc:`2822`." diff --git a/library/ensurepip.po b/library/ensurepip.po new file mode 100644 index 000000000..358df6fbb --- /dev/null +++ b/library/ensurepip.po @@ -0,0 +1,258 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 01:05+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!ensurepip` --- Bootstrapping the ``pip`` installer" +msgstr "" + +msgid "**Source code:** :source:`Lib/ensurepip`" +msgstr "" + +msgid "" +"The :mod:`ensurepip` package provides support for bootstrapping the ``pip`` " +"installer into an existing Python installation or virtual environment. This " +"bootstrapping approach reflects the fact that ``pip`` is an independent " +"project with its own release cycle, and the latest available stable version " +"is bundled with maintenance and feature releases of the CPython reference " +"interpreter." +msgstr "" +"Пакет :mod:`ensurepip` забезпечує підтримку початкового завантаження " +"інсталятора ``pip`` в існуючу установку Python або віртуальне середовище. " +"Цей підхід до початкового завантаження відображає той факт, що ``pip`` є " +"незалежним проектом із власним циклом випуску, а остання доступна стабільна " +"версія входить до комплекту технічного обслуговування та функціональних " +"випусків довідкового інтерпретатора CPython." + +msgid "" +"In most cases, end users of Python shouldn't need to invoke this module " +"directly (as ``pip`` should be bootstrapped by default), but it may be " +"needed if installing ``pip`` was skipped when installing Python (or when " +"creating a virtual environment) or after explicitly uninstalling ``pip``." +msgstr "" +"У більшості випадків кінцевим користувачам Python не потрібно викликати цей " +"модуль напряму (оскільки ``pip`` має завантажуватися за замовчуванням), але " +"це може знадобитися, якщо під час встановлення Python було пропущено " +"встановлення ``pip`` (або під час створення віртуального середовища) або " +"після явного видалення ``pip``." + +msgid "" +"This module *does not* access the internet. All of the components needed to " +"bootstrap ``pip`` are included as internal parts of the package." +msgstr "" +"Цей модуль *не* має доступ до Інтернету. Усі компоненти, необхідні для " +"завантаження ``pip``, включені як внутрішні частини пакунка." + +msgid ":ref:`installing-index`" +msgstr ":ref:`інсталяційний індекс `" + +msgid "The end user guide for installing Python packages" +msgstr "Посібник кінцевого користувача для встановлення пакетів Python" + +msgid ":pep:`453`: Explicit bootstrapping of pip in Python installations" +msgstr ":pep:`453`: Явне початкове завантаження pip у встановленнях Python" + +msgid "The original rationale and specification for this module." +msgstr "Оригінальне обґрунтування та специфікація цього модуля." + +msgid "Availability" +msgstr "" + +msgid "" +"This module is not supported on :ref:`mobile platforms ` or :ref:`WebAssembly platforms `." +msgstr "" + +msgid "Command line interface" +msgstr "Інтерфейс командного рядка" + +msgid "" +"The command line interface is invoked using the interpreter's ``-m`` switch." +msgstr "" +"Інтерфейс командного рядка викликається за допомогою перемикача ``-m`` " +"інтерпретатора." + +msgid "The simplest possible invocation is::" +msgstr "Найпростіший можливий виклик:" + +msgid "python -m ensurepip" +msgstr "" + +msgid "" +"This invocation will install ``pip`` if it is not already installed, but " +"otherwise does nothing. To ensure the installed version of ``pip`` is at " +"least as recent as the one available in ``ensurepip``, pass the ``--" +"upgrade`` option::" +msgstr "" +"Цей виклик встановить ``pip``, якщо він ще не встановлено, але в інших " +"випадках нічого не робить. Щоб переконатися, що встановлена версія ``pip`` " +"принаймні така ж остання, як та, доступна в ``ensurepip``, передайте опцію " +"``--upgrade``::" + +msgid "python -m ensurepip --upgrade" +msgstr "" + +msgid "" +"By default, ``pip`` is installed into the current virtual environment (if " +"one is active) or into the system site packages (if there is no active " +"virtual environment). The installation location can be controlled through " +"two additional command line options:" +msgstr "" +"За замовчуванням ``pip`` інсталюється в поточне віртуальне середовище (якщо " +"воно активне) або в системні пакети сайту (якщо активного віртуального " +"середовища немає). Розташуванням встановлення можна керувати за допомогою " +"двох додаткових параметрів командного рядка:" + +msgid "" +"Installs ``pip`` relative to the given root directory rather than the root " +"of the currently active virtual environment (if any) or the default root for " +"the current Python installation." +msgstr "" + +msgid "" +"Installs ``pip`` into the user site packages directory rather than globally " +"for the current Python installation (this option is not permitted inside an " +"active virtual environment)." +msgstr "" + +msgid "" +"By default, the scripts ``pipX`` and ``pipX.Y`` will be installed (where X.Y " +"stands for the version of Python used to invoke ``ensurepip``). The scripts " +"installed can be controlled through two additional command line options:" +msgstr "" +"За замовчуванням буде встановлено сценарії ``pipX`` і ``pipX.Y`` (де X.Y " +"означає версію Python, яка використовується для виклику ``ensurepip``). " +"Установленими сценаріями можна керувати за допомогою двох додаткових " +"параметрів командного рядка:" + +msgid "" +"If an alternate installation is requested, the ``pipX`` script will *not* be " +"installed." +msgstr "" + +msgid "" +"If a \"default pip\" installation is requested, the ``pip`` script will be " +"installed in addition to the two regular scripts." +msgstr "" + +msgid "" +"Providing both of the script selection options will trigger an exception." +msgstr "Надання обох параметрів вибору сценарію призведе до виключення." + +msgid "Module API" +msgstr "Модуль API" + +msgid ":mod:`ensurepip` exposes two functions for programmatic use:" +msgstr ":mod:`ensurepip` надає дві функції для програмного використання:" + +msgid "" +"Returns a string specifying the available version of pip that will be " +"installed when bootstrapping an environment." +msgstr "" +"Повертає рядок із зазначенням доступної версії pip, яка буде встановлена під " +"час завантаження середовища." + +msgid "Bootstraps ``pip`` into the current or designated environment." +msgstr "Bootstraps ``pip`` в поточне або призначене середовище." + +msgid "" +"*root* specifies an alternative root directory to install relative to. If " +"*root* is ``None``, then installation uses the default install location for " +"the current environment." +msgstr "" +"*root* вказує альтернативний кореневий каталог для встановлення. Якщо *root* " +"має значення ``None``, тоді для встановлення використовується місце " +"встановлення за замовчуванням для поточного середовища." + +msgid "" +"*upgrade* indicates whether or not to upgrade an existing installation of an " +"earlier version of ``pip`` to the available version." +msgstr "" +"*upgrade* вказує, чи потрібно оновлювати наявну інсталяцію попередньої " +"версії ``pip`` до доступної версії." + +msgid "" +"*user* indicates whether to use the user scheme rather than installing " +"globally." +msgstr "" +"*user* вказує, чи слід використовувати схему користувача, а не глобальне " +"встановлення." + +msgid "" +"By default, the scripts ``pipX`` and ``pipX.Y`` will be installed (where X.Y " +"stands for the current version of Python)." +msgstr "" +"За замовчуванням буде встановлено сценарії ``pipX`` і ``pipX.Y`` (де X.Y " +"означає поточну версію Python)." + +msgid "If *altinstall* is set, then ``pipX`` will *not* be installed." +msgstr "Якщо встановлено *altinstall*, то ``pipX`` *не* буде встановлено." + +msgid "" +"If *default_pip* is set, then ``pip`` will be installed in addition to the " +"two regular scripts." +msgstr "" +"Якщо встановлено *default_pip*, то ``pip`` буде встановлено на додаток до " +"двох звичайних сценаріїв." + +msgid "" +"Setting both *altinstall* and *default_pip* will trigger :exc:`ValueError`." +msgstr "" +"Налаштування як *altinstall*, так і *default_pip* спричинить :exc:" +"`ValueError`." + +msgid "" +"*verbosity* controls the level of output to :data:`sys.stdout` from the " +"bootstrapping operation." +msgstr "" +"*detality* контролює рівень виведення в :data:`sys.stdout` від операції " +"початкового завантаження." + +msgid "" +"Raises an :ref:`auditing event ` ``ensurepip.bootstrap`` with " +"argument ``root``." +msgstr "" +"Викликає :ref:`подію аудиту ` ``ensurepip.bootstrap`` з аргументом " +"``root``." + +msgid "" +"The bootstrapping process has side effects on both ``sys.path`` and ``os." +"environ``. Invoking the command line interface in a subprocess instead " +"allows these side effects to be avoided." +msgstr "" +"Процес початкового завантаження має побічні ефекти як для ``sys.path``, так " +"і ``os.environ``. Натомість виклик інтерфейсу командного рядка в підпроцесі " +"дозволяє уникнути цих побічних ефектів." + +msgid "" +"The bootstrapping process may install additional modules required by " +"``pip``, but other software should not assume those dependencies will always " +"be present by default (as the dependencies may be removed in a future " +"version of ``pip``)." +msgstr "" +"Процес завантаження може встановити додаткові модулі, необхідні для ``pip``, " +"але інше програмне забезпечення не повинно припускати, що ці залежності " +"завжди будуть присутні за замовчуванням (оскільки залежності можуть бути " +"видалені в майбутній версії ``pip``)." diff --git a/library/enum.po b/library/enum.po new file mode 100644 index 000000000..9bff9516f --- /dev/null +++ b/library/enum.po @@ -0,0 +1,1241 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 01:05+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!enum` --- Support for enumerations" +msgstr "" + +msgid "**Source code:** :source:`Lib/enum.py`" +msgstr "**Вихідний код:** :source:`Lib/enum.py`" + +msgid "" +"This page contains the API reference information. For tutorial information " +"and discussion of more advanced topics, see" +msgstr "" +"Ця сторінка містить довідкову інформацію про API. Інформацію про підручники " +"та обговорення більш складних тем див" + +msgid ":ref:`Basic Tutorial `" +msgstr "" + +msgid ":ref:`Advanced Tutorial `" +msgstr "" + +msgid ":ref:`Enum Cookbook `" +msgstr "" + +msgid "An enumeration:" +msgstr "" + +msgid "is a set of symbolic names (members) bound to unique values" +msgstr "" + +msgid "" +"can be iterated over to return its canonical (i.e. non-alias) members in " +"definition order" +msgstr "" + +msgid "uses *call* syntax to return members by value" +msgstr "" + +msgid "uses *index* syntax to return members by name" +msgstr "" + +msgid "" +"Enumerations are created either by using :keyword:`class` syntax, or by " +"using function-call syntax::" +msgstr "" + +msgid "" +">>> from enum import Enum\n" +"\n" +">>> # class syntax\n" +">>> class Color(Enum):\n" +"... RED = 1\n" +"... GREEN = 2\n" +"... BLUE = 3\n" +"\n" +">>> # functional syntax\n" +">>> Color = Enum('Color', [('RED', 1), ('GREEN', 2), ('BLUE', 3)])" +msgstr "" + +msgid "" +"Even though we can use :keyword:`class` syntax to create Enums, Enums are " +"not normal Python classes. See :ref:`How are Enums different? ` for more details." +msgstr "" + +msgid "Nomenclature" +msgstr "Номенклатура" + +msgid "The class :class:`!Color` is an *enumeration* (or *enum*)" +msgstr "" + +msgid "" +"The attributes :attr:`!Color.RED`, :attr:`!Color.GREEN`, etc., are " +"*enumeration members* (or *members*) and are functionally constants." +msgstr "" + +msgid "" +"The enum members have *names* and *values* (the name of :attr:`!Color.RED` " +"is ``RED``, the value of :attr:`!Color.BLUE` is ``3``, etc.)" +msgstr "" + +msgid "Module Contents" +msgstr "Зміст модуля" + +msgid ":class:`EnumType`" +msgstr "" + +msgid "The ``type`` for Enum and its subclasses." +msgstr "" + +msgid ":class:`Enum`" +msgstr "" + +msgid "Base class for creating enumerated constants." +msgstr "" + +msgid ":class:`IntEnum`" +msgstr "" + +msgid "" +"Base class for creating enumerated constants that are also subclasses of :" +"class:`int`. (`Notes`_)" +msgstr "" + +msgid ":class:`StrEnum`" +msgstr "" + +msgid "" +"Base class for creating enumerated constants that are also subclasses of :" +"class:`str`. (`Notes`_)" +msgstr "" + +msgid ":class:`Flag`" +msgstr "" + +msgid "" +"Base class for creating enumerated constants that can be combined using the " +"bitwise operations without losing their :class:`Flag` membership." +msgstr "" +"Базовий клас для створення перерахованих констант, які можна комбінувати за " +"допомогою порозрядних операцій, не втрачаючи приналежності до :class:`Flag`." + +msgid ":class:`IntFlag`" +msgstr "" + +msgid "" +"Base class for creating enumerated constants that can be combined using the " +"bitwise operators without losing their :class:`IntFlag` membership. :class:" +"`IntFlag` members are also subclasses of :class:`int`. (`Notes`_)" +msgstr "" + +msgid ":class:`ReprEnum`" +msgstr "" + +msgid "" +"Used by :class:`IntEnum`, :class:`StrEnum`, and :class:`IntFlag` to keep " +"the :class:`str() ` of the mixed-in type." +msgstr "" + +msgid ":class:`EnumCheck`" +msgstr "" + +msgid "" +"An enumeration with the values ``CONTINUOUS``, ``NAMED_FLAGS``, and " +"``UNIQUE``, for use with :func:`verify` to ensure various constraints are " +"met by a given enumeration." +msgstr "" + +msgid ":class:`FlagBoundary`" +msgstr "" + +msgid "" +"An enumeration with the values ``STRICT``, ``CONFORM``, ``EJECT``, and " +"``KEEP`` which allows for more fine-grained control over how invalid values " +"are dealt with in an enumeration." +msgstr "" + +msgid ":class:`EnumDict`" +msgstr "" + +msgid "A subclass of :class:`dict` for use when subclassing :class:`EnumType`." +msgstr "" + +msgid ":class:`auto`" +msgstr "" + +msgid "" +"Instances are replaced with an appropriate value for Enum members. :class:" +"`StrEnum` defaults to the lower-cased version of the member name, while " +"other Enums default to 1 and increase from there." +msgstr "" + +msgid ":func:`~enum.property`" +msgstr "" + +msgid "" +"Allows :class:`Enum` members to have attributes without conflicting with " +"member names. The ``value`` and ``name`` attributes are implemented this " +"way." +msgstr "" + +msgid ":func:`unique`" +msgstr "" + +msgid "" +"Enum class decorator that ensures only one name is bound to any one value." +msgstr "" +"Декоратор класу Enum, який забезпечує прив’язку лише одного імені до будь-" +"якого значення." + +msgid ":func:`verify`" +msgstr "" + +msgid "" +"Enum class decorator that checks user-selectable constraints on an " +"enumeration." +msgstr "" + +msgid ":func:`member`" +msgstr "" + +msgid "Make ``obj`` a member. Can be used as a decorator." +msgstr "" + +msgid ":func:`nonmember`" +msgstr "" + +msgid "Do not make ``obj`` a member. Can be used as a decorator." +msgstr "" + +msgid ":func:`global_enum`" +msgstr "" + +msgid "" +"Modify the :class:`str() ` and :func:`repr` of an enum to show its " +"members as belonging to the module instead of its class, and export the enum " +"members to the global namespace." +msgstr "" + +msgid ":func:`show_flag_values`" +msgstr "" + +msgid "Return a list of all power-of-two integers contained in a flag." +msgstr "" + +msgid "``Flag``, ``IntFlag``, ``auto``" +msgstr "``Flag``, ``IntFlag``, ``auto``" + +msgid "" +"``StrEnum``, ``EnumCheck``, ``ReprEnum``, ``FlagBoundary``, ``property``, " +"``member``, ``nonmember``, ``global_enum``, ``show_flag_values``" +msgstr "" + +msgid "``EnumDict``" +msgstr "" + +msgid "Data Types" +msgstr "Типи даних" + +msgid "" +"*EnumType* is the :term:`metaclass` for *enum* enumerations. It is possible " +"to subclass *EnumType* -- see :ref:`Subclassing EnumType ` for details." +msgstr "" + +msgid "" +"``EnumType`` is responsible for setting the correct :meth:`!__repr__`, :meth:" +"`!__str__`, :meth:`!__format__`, and :meth:`!__reduce__` methods on the " +"final *enum*, as well as creating the enum members, properly handling " +"duplicates, providing iteration over the enum class, etc." +msgstr "" + +msgid "This method is called in two different ways:" +msgstr "" + +msgid "to look up an existing member:" +msgstr "" + +msgid "cls" +msgstr "" + +msgid "The enum class being called." +msgstr "" + +msgid "value" +msgstr "значення" + +msgid "The value to lookup." +msgstr "" + +msgid "" +"to use the ``cls`` enum to create a new enum (only if the existing enum does " +"not have any members):" +msgstr "" + +msgid "The name of the new Enum to create." +msgstr "" + +msgid "names" +msgstr "імена" + +msgid "The names/values of the members for the new Enum." +msgstr "" + +msgid "module" +msgstr "модуль" + +msgid "The name of the module the new Enum is created in." +msgstr "" + +msgid "qualname" +msgstr "qualname" + +msgid "The actual location in the module where this Enum can be found." +msgstr "" + +msgid "type" +msgstr "типу" + +msgid "A mix-in type for the new Enum." +msgstr "" + +msgid "start" +msgstr "початок" + +msgid "The first integer value for the Enum (used by :class:`auto`)." +msgstr "" + +msgid "boundary" +msgstr "" + +msgid "" +"How to handle out-of-range values from bit operations (:class:`Flag` only)." +msgstr "" + +msgid "Returns ``True`` if member belongs to the ``cls``::" +msgstr "" + +msgid "" +">>> some_var = Color.RED\n" +">>> some_var in Color\n" +"True\n" +">>> Color.RED.value in Color\n" +"True" +msgstr "" + +msgid "" +"Before Python 3.12, a ``TypeError`` is raised if a non-Enum-member is used " +"in a containment check." +msgstr "" + +msgid "" +"Returns ``['__class__', '__doc__', '__members__', '__module__']`` and the " +"names of the members in *cls*::" +msgstr "" + +msgid "" +">>> dir(Color)\n" +"['BLUE', 'GREEN', 'RED', '__class__', '__contains__', '__doc__', " +"'__getitem__', '__init_subclass__', '__iter__', '__len__', '__members__', " +"'__module__', '__name__', '__qualname__']" +msgstr "" + +msgid "" +"Returns the Enum member in *cls* matching *name*, or raises a :exc:" +"`KeyError`::" +msgstr "" + +msgid "" +">>> Color['BLUE']\n" +"" +msgstr "" + +msgid "Returns each member in *cls* in definition order::" +msgstr "" + +msgid "" +">>> list(Color)\n" +"[, , ]" +msgstr "" + +msgid "Returns the number of member in *cls*::" +msgstr "" + +msgid "" +">>> len(Color)\n" +"3" +msgstr "" + +msgid "Returns a mapping of every enum name to its member, including aliases" +msgstr "" + +msgid "Returns each member in *cls* in reverse definition order::" +msgstr "" + +msgid "" +">>> list(reversed(Color))\n" +"[, , ]" +msgstr "" + +msgid "" +"Adds a new name as an alias to an existing member. Raises a :exc:" +"`NameError` if the name is already assigned to a different member." +msgstr "" + +msgid "" +"Adds a new value as an alias to an existing member. Raises a :exc:" +"`ValueError` if the value is already linked with a different member." +msgstr "" + +msgid "" +"Before 3.11 ``EnumType`` was called ``EnumMeta``, which is still available " +"as an alias." +msgstr "" + +msgid "*Enum* is the base class for all *enum* enumerations." +msgstr "" + +msgid "The name used to define the ``Enum`` member::" +msgstr "" + +msgid "" +">>> Color.BLUE.name\n" +"'BLUE'" +msgstr "" + +msgid "The value given to the ``Enum`` member::" +msgstr "" + +msgid "" +">>> Color.RED.value\n" +"1" +msgstr "" + +msgid "Value of the member, can be set in :meth:`~Enum.__new__`." +msgstr "" + +msgid "Enum member values" +msgstr "Значення члена Enum" + +msgid "" +"Member values can be anything: :class:`int`, :class:`str`, etc. If the " +"exact value is unimportant you may use :class:`auto` instances and an " +"appropriate value will be chosen for you. See :class:`auto` for the details." +msgstr "" + +msgid "" +"While mutable/unhashable values, such as :class:`dict`, :class:`list` or a " +"mutable :class:`~dataclasses.dataclass`, can be used, they will have a " +"quadratic performance impact during creation relative to the total number of " +"mutable/unhashable values in the enum." +msgstr "" + +msgid "Name of the member." +msgstr "" + +msgid "" +"No longer used, kept for backward compatibility. (class attribute, removed " +"during class creation)." +msgstr "" + +msgid "" +"``_ignore_`` is only used during creation and is removed from the " +"enumeration once creation is complete." +msgstr "" + +msgid "" +"``_ignore_`` is a list of names that will not become members, and whose " +"names will also be removed from the completed enumeration. See :ref:" +"`TimePeriod ` for an example." +msgstr "" + +msgid "" +"Returns ``['__class__', '__doc__', '__module__', 'name', 'value']`` and any " +"public methods defined on *self.__class__*::" +msgstr "" + +msgid "" +">>> from datetime import date\n" +">>> class Weekday(Enum):\n" +"... MONDAY = 1\n" +"... TUESDAY = 2\n" +"... WEDNESDAY = 3\n" +"... THURSDAY = 4\n" +"... FRIDAY = 5\n" +"... SATURDAY = 6\n" +"... SUNDAY = 7\n" +"... @classmethod\n" +"... def today(cls):\n" +"... print('today is %s' % cls(date.today().isoweekday()).name)\n" +"...\n" +">>> dir(Weekday.SATURDAY)\n" +"['__class__', '__doc__', '__eq__', '__hash__', '__module__', 'name', " +"'today', 'value']" +msgstr "" + +msgid "name" +msgstr "name" + +msgid "The name of the member being defined (e.g. 'RED')." +msgstr "" + +msgid "The start value for the Enum; the default is 1." +msgstr "" + +msgid "count" +msgstr "" + +msgid "The number of members currently defined, not including this one." +msgstr "" + +msgid "last_values" +msgstr "" + +msgid "A list of the previous values." +msgstr "" + +msgid "" +"A *staticmethod* that is used to determine the next value returned by :class:" +"`auto`::" +msgstr "" + +msgid "" +">>> from enum import auto\n" +">>> class PowersOfThree(Enum):\n" +"... @staticmethod\n" +"... def _generate_next_value_(name, start, count, last_values):\n" +"... return 3 ** (count + 1)\n" +"... FIRST = auto()\n" +"... SECOND = auto()\n" +"...\n" +">>> PowersOfThree.SECOND.value\n" +"9" +msgstr "" + +msgid "" +"By default, does nothing. If multiple values are given in the member " +"assignment, those values become separate arguments to ``__init__``; e.g." +msgstr "" + +msgid "" +"``Weekday.__init__()`` would be called as ``Weekday.__init__(self, 1, " +"'Mon')``" +msgstr "" + +msgid "" +"A *classmethod* that is used to further configure subsequent subclasses. By " +"default, does nothing." +msgstr "" + +msgid "" +"A *classmethod* for looking up values not found in *cls*. By default it " +"does nothing, but can be overridden to implement custom search behavior::" +msgstr "" + +msgid "" +">>> from enum import StrEnum\n" +">>> class Build(StrEnum):\n" +"... DEBUG = auto()\n" +"... OPTIMIZED = auto()\n" +"... @classmethod\n" +"... def _missing_(cls, value):\n" +"... value = value.lower()\n" +"... for member in cls:\n" +"... if member.value == value:\n" +"... return member\n" +"... return None\n" +"...\n" +">>> Build.DEBUG.value\n" +"'debug'\n" +">>> Build('deBUG')\n" +"" +msgstr "" + +msgid "" +"By default, doesn't exist. If specified, either in the enum class " +"definition or in a mixin class (such as ``int``), all values given in the " +"member assignment will be passed; e.g." +msgstr "" + +msgid "" +"results in the call ``int('1a', 16)`` and a value of ``26`` for the member." +msgstr "" + +msgid "" +"When writing a custom ``__new__``, do not use ``super().__new__`` -- call " +"the appropriate ``__new__`` instead." +msgstr "" + +msgid "" +"Returns the string used for *repr()* calls. By default, returns the *Enum* " +"name, member name, and value, but can be overridden::" +msgstr "" + +msgid "" +">>> class OtherStyle(Enum):\n" +"... ALTERNATE = auto()\n" +"... OTHER = auto()\n" +"... SOMETHING_ELSE = auto()\n" +"... def __repr__(self):\n" +"... cls_name = self.__class__.__name__\n" +"... return f'{cls_name}.{self.name}'\n" +"...\n" +">>> OtherStyle.ALTERNATE, str(OtherStyle.ALTERNATE), f\"{OtherStyle." +"ALTERNATE}\"\n" +"(OtherStyle.ALTERNATE, 'OtherStyle.ALTERNATE', 'OtherStyle.ALTERNATE')" +msgstr "" + +msgid "" +"Returns the string used for *str()* calls. By default, returns the *Enum* " +"name and member name, but can be overridden::" +msgstr "" + +msgid "" +">>> class OtherStyle(Enum):\n" +"... ALTERNATE = auto()\n" +"... OTHER = auto()\n" +"... SOMETHING_ELSE = auto()\n" +"... def __str__(self):\n" +"... return f'{self.name}'\n" +"...\n" +">>> OtherStyle.ALTERNATE, str(OtherStyle.ALTERNATE), f\"{OtherStyle." +"ALTERNATE}\"\n" +"(, 'ALTERNATE', 'ALTERNATE')" +msgstr "" + +msgid "" +"Returns the string used for *format()* and *f-string* calls. By default, " +"returns :meth:`__str__` return value, but can be overridden::" +msgstr "" + +msgid "" +">>> class OtherStyle(Enum):\n" +"... ALTERNATE = auto()\n" +"... OTHER = auto()\n" +"... SOMETHING_ELSE = auto()\n" +"... def __format__(self, spec):\n" +"... return f'{self.name}'\n" +"...\n" +">>> OtherStyle.ALTERNATE, str(OtherStyle.ALTERNATE), f\"{OtherStyle." +"ALTERNATE}\"\n" +"(, 'OtherStyle.ALTERNATE', 'ALTERNATE')" +msgstr "" + +msgid "" +"Using :class:`auto` with :class:`Enum` results in integers of increasing " +"value, starting with ``1``." +msgstr "" + +msgid "Added :ref:`enum-dataclass-support`" +msgstr "" + +msgid "" +"*IntEnum* is the same as :class:`Enum`, but its members are also integers " +"and can be used anywhere that an integer can be used. If any integer " +"operation is performed with an *IntEnum* member, the resulting value loses " +"its enumeration status." +msgstr "" + +msgid "" +"Using :class:`auto` with :class:`IntEnum` results in integers of increasing " +"value, starting with ``1``." +msgstr "" + +msgid "" +":meth:`~object.__str__` is now :meth:`!int.__str__` to better support the " +"*replacement of existing constants* use-case. :meth:`~object.__format__` was " +"already :meth:`!int.__format__` for that same reason." +msgstr "" + +msgid "" +"``StrEnum`` is the same as :class:`Enum`, but its members are also strings " +"and can be used in most of the same places that a string can be used. The " +"result of any string operation performed on or with a *StrEnum* member is " +"not part of the enumeration." +msgstr "" + +msgid "" +"There are places in the stdlib that check for an exact :class:`str` instead " +"of a :class:`str` subclass (i.e. ``type(unknown) == str`` instead of " +"``isinstance(unknown, str)``), and in those locations you will need to use " +"``str(StrEnum.member)``." +msgstr "" + +msgid "" +"Using :class:`auto` with :class:`StrEnum` results in the lower-cased member " +"name as the value." +msgstr "" + +msgid "" +":meth:`~object.__str__` is :meth:`!str.__str__` to better support the " +"*replacement of existing constants* use-case. :meth:`~object.__format__` is " +"likewise :meth:`!str.__format__` for that same reason." +msgstr "" + +msgid "" +"``Flag`` is the same as :class:`Enum`, but its members support the bitwise " +"operators ``&`` (*AND*), ``|`` (*OR*), ``^`` (*XOR*), and ``~`` (*INVERT*); " +"the results of those operations are (aliases of) members of the enumeration." +msgstr "" + +msgid "Returns *True* if value is in self::" +msgstr "" + +msgid "" +">>> from enum import Flag, auto\n" +">>> class Color(Flag):\n" +"... RED = auto()\n" +"... GREEN = auto()\n" +"... BLUE = auto()\n" +"...\n" +">>> purple = Color.RED | Color.BLUE\n" +">>> white = Color.RED | Color.GREEN | Color.BLUE\n" +">>> Color.GREEN in purple\n" +"False\n" +">>> Color.GREEN in white\n" +"True\n" +">>> purple in white\n" +"True\n" +">>> white in purple\n" +"False" +msgstr "" + +msgid "Returns all contained non-alias members::" +msgstr "" + +msgid "" +">>> list(Color.RED)\n" +"[]\n" +">>> list(purple)\n" +"[, ]" +msgstr "" + +msgid "Returns number of members in flag::" +msgstr "" + +msgid "" +">>> len(Color.GREEN)\n" +"1\n" +">>> len(white)\n" +"3" +msgstr "" + +msgid "Returns *True* if any members in flag, *False* otherwise::" +msgstr "" + +msgid "" +">>> bool(Color.GREEN)\n" +"True\n" +">>> bool(white)\n" +"True\n" +">>> black = Color(0)\n" +">>> bool(black)\n" +"False" +msgstr "" + +msgid "Returns current flag binary or'ed with other::" +msgstr "" + +msgid "" +">>> Color.RED | Color.GREEN\n" +"" +msgstr "" + +msgid "Returns current flag binary and'ed with other::" +msgstr "" + +msgid "" +">>> purple & white\n" +"\n" +">>> purple & Color.GREEN\n" +"" +msgstr "" + +msgid "Returns current flag binary xor'ed with other::" +msgstr "" + +msgid "" +">>> purple ^ white\n" +"\n" +">>> purple ^ Color.GREEN\n" +"" +msgstr "" + +msgid "Returns all the flags in *type(self)* that are not in *self*::" +msgstr "" + +msgid "" +">>> ~white\n" +"\n" +">>> ~purple\n" +"\n" +">>> ~Color.RED\n" +"" +msgstr "" + +msgid "" +"Function used to format any remaining unnamed numeric values. Default is " +"the value's repr; common choices are :func:`hex` and :func:`oct`." +msgstr "" + +msgid "" +"Using :class:`auto` with :class:`Flag` results in integers that are powers " +"of two, starting with ``1``." +msgstr "" + +msgid "The *repr()* of zero-valued flags has changed. It is now::" +msgstr "" + +msgid "" +"``IntFlag`` is the same as :class:`Flag`, but its members are also integers " +"and can be used anywhere that an integer can be used." +msgstr "" + +msgid "" +"If any integer operation is performed with an *IntFlag* member, the result " +"is not an *IntFlag*::" +msgstr "" + +msgid "" +">>> Color.RED + 2\n" +"3" +msgstr "" + +msgid "If a :class:`Flag` operation is performed with an *IntFlag* member and:" +msgstr "" + +msgid "the result is a valid *IntFlag*: an *IntFlag* is returned" +msgstr "" + +msgid "" +"the result is not a valid *IntFlag*: the result depends on the :class:" +"`FlagBoundary` setting" +msgstr "" + +msgid "The :func:`repr` of unnamed zero-valued flags has changed. It is now:" +msgstr "" + +msgid "" +"Using :class:`auto` with :class:`IntFlag` results in integers that are " +"powers of two, starting with ``1``." +msgstr "" + +msgid "" +":meth:`~object.__str__` is now :meth:`!int.__str__` to better support the " +"*replacement of existing constants* use-case. :meth:`~object.__format__` " +"was already :meth:`!int.__format__` for that same reason." +msgstr "" + +msgid "" +"Inversion of an :class:`!IntFlag` now returns a positive value that is the " +"union of all flags not in the given flag, rather than a negative value. This " +"matches the existing :class:`Flag` behavior." +msgstr "" + +msgid "" +":class:`!ReprEnum` uses the :meth:`repr() ` of :class:`Enum`, " +"but the :class:`str() ` of the mixed-in data type:" +msgstr "" + +msgid ":meth:`!int.__str__` for :class:`IntEnum` and :class:`IntFlag`" +msgstr "" + +msgid ":meth:`!str.__str__` for :class:`StrEnum`" +msgstr "" + +msgid "" +"Inherit from :class:`!ReprEnum` to keep the :class:`str() ` / :func:" +"`format` of the mixed-in data type instead of using the :class:`Enum`-" +"default :meth:`str() `." +msgstr "" + +msgid "" +"*EnumCheck* contains the options used by the :func:`verify` decorator to " +"ensure various constraints; failed constraints result in a :exc:`ValueError`." +msgstr "" + +msgid "Ensure that each value has only one name::" +msgstr "" + +msgid "" +">>> from enum import Enum, verify, UNIQUE\n" +">>> @verify(UNIQUE)\n" +"... class Color(Enum):\n" +"... RED = 1\n" +"... GREEN = 2\n" +"... BLUE = 3\n" +"... CRIMSON = 1\n" +"Traceback (most recent call last):\n" +"...\n" +"ValueError: aliases found in : CRIMSON -> RED" +msgstr "" + +msgid "" +"Ensure that there are no missing values between the lowest-valued member and " +"the highest-valued member::" +msgstr "" + +msgid "" +">>> from enum import Enum, verify, CONTINUOUS\n" +">>> @verify(CONTINUOUS)\n" +"... class Color(Enum):\n" +"... RED = 1\n" +"... GREEN = 2\n" +"... BLUE = 5\n" +"Traceback (most recent call last):\n" +"...\n" +"ValueError: invalid enum 'Color': missing values 3, 4" +msgstr "" + +msgid "" +"Ensure that any flag groups/masks contain only named flags -- useful when " +"values are specified instead of being generated by :func:`auto`::" +msgstr "" + +msgid "" +">>> from enum import Flag, verify, NAMED_FLAGS\n" +">>> @verify(NAMED_FLAGS)\n" +"... class Color(Flag):\n" +"... RED = 1\n" +"... GREEN = 2\n" +"... BLUE = 4\n" +"... WHITE = 15\n" +"... NEON = 31\n" +"Traceback (most recent call last):\n" +"...\n" +"ValueError: invalid Flag 'Color': aliases WHITE and NEON are missing " +"combined values of 0x18 [use enum.show_flag_values(value) for details]" +msgstr "" + +msgid "" +"CONTINUOUS and NAMED_FLAGS are designed to work with integer-valued members." +msgstr "" + +msgid "" +"``FlagBoundary`` controls how out-of-range values are handled in :class:" +"`Flag` and its subclasses." +msgstr "" + +msgid "" +"Out-of-range values cause a :exc:`ValueError` to be raised. This is the " +"default for :class:`Flag`::" +msgstr "" + +msgid "" +">>> from enum import Flag, STRICT, auto\n" +">>> class StrictFlag(Flag, boundary=STRICT):\n" +"... RED = auto()\n" +"... GREEN = auto()\n" +"... BLUE = auto()\n" +"...\n" +">>> StrictFlag(2**2 + 2**4)\n" +"Traceback (most recent call last):\n" +"...\n" +"ValueError: invalid value 20\n" +" given 0b0 10100\n" +" allowed 0b0 00111" +msgstr "" + +msgid "" +"Out-of-range values have invalid values removed, leaving a valid :class:" +"`Flag` value::" +msgstr "" + +msgid "" +">>> from enum import Flag, CONFORM, auto\n" +">>> class ConformFlag(Flag, boundary=CONFORM):\n" +"... RED = auto()\n" +"... GREEN = auto()\n" +"... BLUE = auto()\n" +"...\n" +">>> ConformFlag(2**2 + 2**4)\n" +"" +msgstr "" + +msgid "" +"Out-of-range values lose their :class:`Flag` membership and revert to :class:" +"`int`." +msgstr "" + +msgid "" +"Out-of-range values are kept, and the :class:`Flag` membership is kept. This " +"is the default for :class:`IntFlag`::" +msgstr "" + +msgid "" +">>> from enum import Flag, KEEP, auto\n" +">>> class KeepFlag(Flag, boundary=KEEP):\n" +"... RED = auto()\n" +"... GREEN = auto()\n" +"... BLUE = auto()\n" +"...\n" +">>> KeepFlag(2**2 + 2**4)\n" +"" +msgstr "" + +msgid "" +"*EnumDict* is a subclass of :class:`dict` that is used as the namespace for " +"defining enum classes (see :ref:`prepare`). It is exposed to allow " +"subclasses of :class:`EnumType` with advanced behavior like having multiple " +"values per member. It should be called with the name of the enum class being " +"created, otherwise private names and internal classes will not be handled " +"correctly." +msgstr "" + +msgid "" +"Note that only the :class:`~collections.abc.MutableMapping` interface (:meth:" +"`~object.__setitem__` and :meth:`~dict.update`) is overridden. It may be " +"possible to bypass the checks using other :class:`!dict` operations like :" +"meth:`|= `." +msgstr "" + +msgid "A list of member names." +msgstr "" + +msgid "Supported ``__dunder__`` names" +msgstr "Підтримувані імена ``__dunder__``" + +msgid "" +":attr:`~EnumType.__members__` is a read-only ordered mapping of " +"``member_name``:``member`` items. It is only available on the class." +msgstr "" + +msgid "" +":meth:`~Enum.__new__`, if specified, must create and return the enum " +"members; it is also a very good idea to set the member's :attr:`!_value_` " +"appropriately. Once all the members are created it is no longer used." +msgstr "" + +msgid "Supported ``_sunder_`` names" +msgstr "Підтримувані імена ``_sunder_``" + +msgid "" +":meth:`~EnumType._add_alias_` -- adds a new name as an alias to an existing " +"member." +msgstr "" + +msgid "" +":meth:`~EnumType._add_value_alias_` -- adds a new value as an alias to an " +"existing member." +msgstr "" + +msgid ":attr:`~Enum._name_` -- name of the member" +msgstr "" + +msgid ":attr:`~Enum._value_` -- value of the member; can be set in ``__new__``" +msgstr "" + +msgid "" +":meth:`~Enum._missing_` -- a lookup function used when a value is not found; " +"may be overridden" +msgstr "" + +msgid "" +":attr:`~Enum._ignore_` -- a list of names, either as a :class:`list` or a :" +"class:`str`, that will not be transformed into members, and will be removed " +"from the final class" +msgstr "" + +msgid "" +":attr:`~Enum._order_` -- no longer used, kept for backward compatibility " +"(class attribute, removed during class creation)" +msgstr "" + +msgid "" +":meth:`~Enum._generate_next_value_` -- used to get an appropriate value for " +"an enum member; may be overridden" +msgstr "" + +msgid "" +"For standard :class:`Enum` classes the next value chosen is the highest " +"value seen incremented by one." +msgstr "" + +msgid "" +"For :class:`Flag` classes the next value chosen will be the next highest " +"power-of-two." +msgstr "" + +msgid "" +"While ``_sunder_`` names are generally reserved for the further development " +"of the :class:`Enum` class and can not be used, some are explicitly allowed:" +msgstr "" + +msgid "" +"``_repr_*`` (e.g. ``_repr_html_``), as used in `IPython's rich display`_" +msgstr "" + +msgid "``_missing_``, ``_order_``, ``_generate_next_value_``" +msgstr "``_missing_``, ``_order_``, ``_generate_next_value_``" + +msgid "``_ignore_``" +msgstr "``_ігнорувати_``" + +msgid "``_add_alias_``, ``_add_value_alias_``, ``_repr_*``" +msgstr "" + +msgid "Utilities and Decorators" +msgstr "" + +msgid "" +"*auto* can be used in place of a value. If used, the *Enum* machinery will " +"call an :class:`Enum`'s :meth:`~Enum._generate_next_value_` to get an " +"appropriate value. For :class:`Enum` and :class:`IntEnum` that appropriate " +"value will be the last value plus one; for :class:`Flag` and :class:" +"`IntFlag` it will be the first power-of-two greater than the highest value; " +"for :class:`StrEnum` it will be the lower-cased version of the member's " +"name. Care must be taken if mixing *auto()* with manually specified values." +msgstr "" + +msgid "" +"*auto* instances are only resolved when at the top level of an assignment:" +msgstr "" + +msgid "``FIRST = auto()`` will work (auto() is replaced with ``1``);" +msgstr "" + +msgid "" +"``SECOND = auto(), -2`` will work (auto is replaced with ``2``, so ``2, -2`` " +"is used to create the ``SECOND`` enum member;" +msgstr "" + +msgid "" +"``THREE = [auto(), -3]`` will *not* work (``, -3`` is used to " +"create the ``THREE`` enum member)" +msgstr "" + +msgid "" +"In prior versions, ``auto()`` had to be the only thing on the assignment " +"line to work properly." +msgstr "" + +msgid "" +"``_generate_next_value_`` can be overridden to customize the values used by " +"*auto*." +msgstr "" + +msgid "" +"in 3.13 the default ``_generate_next_value_`` will always return the highest " +"member value incremented by 1, and will fail if any member is an " +"incompatible type." +msgstr "" + +msgid "" +"A decorator similar to the built-in *property*, but specifically for " +"enumerations. It allows member attributes to have the same names as members " +"themselves." +msgstr "" + +msgid "" +"the *property* and the member must be defined in separate classes; for " +"example, the *value* and *name* attributes are defined in the *Enum* class, " +"and *Enum* subclasses can define members with the names ``value`` and " +"``name``." +msgstr "" + +msgid "" +"A :keyword:`class` decorator specifically for enumerations. It searches an " +"enumeration's :attr:`~EnumType.__members__`, gathering any aliases it finds; " +"if any are found :exc:`ValueError` is raised with the details::" +msgstr "" + +msgid "" +">>> from enum import Enum, unique\n" +">>> @unique\n" +"... class Mistake(Enum):\n" +"... ONE = 1\n" +"... TWO = 2\n" +"... THREE = 3\n" +"... FOUR = 3\n" +"...\n" +"Traceback (most recent call last):\n" +"...\n" +"ValueError: duplicate values found in : FOUR -> THREE" +msgstr "" + +msgid "" +"A :keyword:`class` decorator specifically for enumerations. Members from :" +"class:`EnumCheck` are used to specify which constraints should be checked on " +"the decorated enumeration." +msgstr "" + +msgid "A decorator for use in enums: its target will become a member." +msgstr "" + +msgid "A decorator for use in enums: its target will not become a member." +msgstr "" + +msgid "" +"A decorator to change the :class:`str() ` and :func:`repr` of an enum " +"to show its members as belonging to the module instead of its class. Should " +"only be used when the enum members are exported to the module global " +"namespace (see :class:`re.RegexFlag` for an example)." +msgstr "" + +msgid "Return a list of all power-of-two integers contained in a flag *value*." +msgstr "" + +msgid "Notes" +msgstr "Примітки" + +msgid ":class:`IntEnum`, :class:`StrEnum`, and :class:`IntFlag`" +msgstr "" + +msgid "" +"These three enum types are designed to be drop-in replacements for existing " +"integer- and string-based values; as such, they have extra limitations:" +msgstr "" + +msgid "``__str__`` uses the value and not the name of the enum member" +msgstr "" + +msgid "" +"``__format__``, because it uses ``__str__``, will also use the value of the " +"enum member instead of its name" +msgstr "" + +msgid "" +"If you do not need/want those limitations, you can either create your own " +"base class by mixing in the ``int`` or ``str`` type yourself::" +msgstr "" + +msgid "" +">>> from enum import Enum\n" +">>> class MyIntEnum(int, Enum):\n" +"... pass" +msgstr "" + +msgid "or you can reassign the appropriate :meth:`str`, etc., in your enum::" +msgstr "" + +msgid "" +">>> from enum import Enum, IntEnum\n" +">>> class MyIntEnum(IntEnum):\n" +"... __str__ = Enum.__str__" +msgstr "" diff --git a/library/errno.po b/library/errno.po new file mode 100644 index 000000000..f93057182 --- /dev/null +++ b/library/errno.po @@ -0,0 +1,598 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 01:05+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!errno` --- Standard errno system symbols" +msgstr "" + +msgid "" +"This module makes available standard ``errno`` system symbols. The value of " +"each symbol is the corresponding integer value. The names and descriptions " +"are borrowed from :file:`linux/include/errno.h`, which should be all-" +"inclusive." +msgstr "" +"Цей модуль робить доступними стандартні системні символи ``errno``. Значення " +"кожного символу є відповідним цілим значенням. Назви та описи запозичені з :" +"file:`linux/include/errno.h`, який має бути повним." + +msgid "" +"Dictionary providing a mapping from the errno value to the string name in " +"the underlying system. For instance, ``errno.errorcode[errno.EPERM]`` maps " +"to ``'EPERM'``." +msgstr "" +"Словник, що забезпечує зіставлення значення errno з іменем рядка в базовій " +"системі. Наприклад, ``errno.errorcode[errno.EPERM]`` відповідає ``'EPERM''``." + +msgid "" +"To translate a numeric error code to an error message, use :func:`os." +"strerror`." +msgstr "" +"Щоб перетворити числовий код помилки на повідомлення про помилку, " +"використовуйте :func:`os.strerror`." + +msgid "" +"Of the following list, symbols that are not used on the current platform are " +"not defined by the module. The specific list of defined symbols is " +"available as ``errno.errorcode.keys()``. Symbols available can include:" +msgstr "" +"З наведеного нижче списку символи, які не використовуються на поточній " +"платформі, не визначені модулем. Конкретний список визначених символів " +"доступний як ``errno.errorcode.keys()``. Доступні символи можуть включати:" + +msgid "" +"Operation not permitted. This error is mapped to the exception :exc:" +"`PermissionError`." +msgstr "" +"Операція не дозволена. Ця помилка зіставляється з винятком :exc:" +"`PermissionError`." + +msgid "" +"No such file or directory. This error is mapped to the exception :exc:" +"`FileNotFoundError`." +msgstr "" +"Такого файлу чи каталогу немає. Ця помилка зіставляється з винятком :exc:" +"`FileNotFoundError`." + +msgid "" +"No such process. This error is mapped to the exception :exc:" +"`ProcessLookupError`." +msgstr "" +"Такого процесу немає. Ця помилка зіставляється з винятком :exc:" +"`ProcessLookupError`." + +msgid "" +"Interrupted system call. This error is mapped to the exception :exc:" +"`InterruptedError`." +msgstr "" +"Перерваний системний виклик. Ця помилка зіставляється з винятком :exc:" +"`InterruptedError`." + +msgid "I/O error" +msgstr "Помилка введення/виведення" + +msgid "No such device or address" +msgstr "Немає такого пристрою чи адреси" + +msgid "Arg list too long" +msgstr "Список аргументів задовгий" + +msgid "Exec format error" +msgstr "Помилка формату Exec" + +msgid "Bad file number" +msgstr "Неправильний номер файлу" + +msgid "" +"No child processes. This error is mapped to the exception :exc:" +"`ChildProcessError`." +msgstr "" +"Немає дочірніх процесів. Ця помилка зіставляється з винятком :exc:" +"`ChildProcessError`." + +msgid "" +"Try again. This error is mapped to the exception :exc:`BlockingIOError`." +msgstr "" +"Спробуйте знову. Ця помилка зіставляється з винятком :exc:`BlockingIOError`." + +msgid "Out of memory" +msgstr "Недостатньо помяті" + +msgid "" +"Permission denied. This error is mapped to the exception :exc:" +"`PermissionError`." +msgstr "" +"У дозволі відмовлено. Ця помилка зіставляється з винятком :exc:" +"`PermissionError`." + +msgid "Bad address" +msgstr "Погана адреса" + +msgid "Block device required" +msgstr "Потрібен блоковий пристрій" + +msgid "Device or resource busy" +msgstr "Пристрій або ресурс зайняті" + +msgid "" +"File exists. This error is mapped to the exception :exc:`FileExistsError`." +msgstr "" +"Файл існує. Ця помилка зіставляється з винятком :exc:`FileExistsError`." + +msgid "Cross-device link" +msgstr "Зв’язок між пристроями" + +msgid "No such device" +msgstr "Немає такого пристрою" + +msgid "" +"Not a directory. This error is mapped to the exception :exc:" +"`NotADirectoryError`." +msgstr "" +"Не каталог. Ця помилка зіставляється з винятком :exc:`NotADirectoryError`." + +msgid "" +"Is a directory. This error is mapped to the exception :exc:" +"`IsADirectoryError`." +msgstr "" +"Це каталог. Ця помилка зіставляється з винятком :exc:`IsADirectoryError`." + +msgid "Invalid argument" +msgstr "Недійсний аргумент" + +msgid "File table overflow" +msgstr "Переповнення таблиці файлів" + +msgid "Too many open files" +msgstr "Забагато відкритих файлів" + +msgid "Not a typewriter" +msgstr "Не друкарська машинка" + +msgid "Text file busy" +msgstr "Текстовий файл зайнятий" + +msgid "File too large" +msgstr "Файл завеликий" + +msgid "No space left on device" +msgstr "На пристрої не залишилося місця" + +msgid "Illegal seek" +msgstr "Незаконний пошук" + +msgid "Read-only file system" +msgstr "Файлова система лише для читання" + +msgid "Too many links" +msgstr "Забагато посилань" + +msgid "" +"Broken pipe. This error is mapped to the exception :exc:`BrokenPipeError`." +msgstr "" +"Розбита труба. Ця помилка зіставляється з винятком :exc:`BrokenPipeError`." + +msgid "Math argument out of domain of func" +msgstr "Математичний аргумент поза областю функ" + +msgid "Math result not representable" +msgstr "Математичний результат неможливо представити" + +msgid "Resource deadlock would occur" +msgstr "Виникне блокування ресурсів" + +msgid "File name too long" +msgstr "Назва файлу задовга" + +msgid "No record locks available" +msgstr "Немає доступних блокувань записів" + +msgid "Function not implemented" +msgstr "Функція не реалізована" + +msgid "Directory not empty" +msgstr "Каталог не порожній" + +msgid "Too many symbolic links encountered" +msgstr "Знайдено забагато символічних посилань" + +msgid "" +"Operation would block. This error is mapped to the exception :exc:" +"`BlockingIOError`." +msgstr "" +"Операція буде заблокована. Ця помилка зіставляється з винятком :exc:" +"`BlockingIOError`." + +msgid "No message of desired type" +msgstr "Немає повідомлень потрібного типу" + +msgid "Identifier removed" +msgstr "Ідентифікатор видалено" + +msgid "Channel number out of range" +msgstr "Номер каналу поза діапазоном" + +msgid "Level 2 not synchronized" +msgstr "Рівень 2 не синхронізовано" + +msgid "Level 3 halted" +msgstr "Рівень 3 зупинено" + +msgid "Level 3 reset" +msgstr "Скидання рівня 3" + +msgid "Link number out of range" +msgstr "Номер посилання поза діапазоном" + +msgid "Protocol driver not attached" +msgstr "Драйвер протоколу не підключено" + +msgid "No CSI structure available" +msgstr "Немає доступної структури CSI" + +msgid "Level 2 halted" +msgstr "Рівень 2 зупинено" + +msgid "Invalid exchange" +msgstr "Недійсний обмін" + +msgid "Invalid request descriptor" +msgstr "Недійсний дескриптор запиту" + +msgid "Exchange full" +msgstr "Обмін повний" + +msgid "No anode" +msgstr "Без анода" + +msgid "Invalid request code" +msgstr "Недійсний код запиту" + +msgid "Invalid slot" +msgstr "Недійсний слот" + +msgid "File locking deadlock error" +msgstr "Помилка взаємоблокування блокування файлу" + +msgid "Bad font file format" +msgstr "Неправильний формат файлу шрифту" + +msgid "Device not a stream" +msgstr "Пристрій не є потоком" + +msgid "No data available" +msgstr "Немає даних" + +msgid "Timer expired" +msgstr "Таймер закінчився" + +msgid "Out of streams resources" +msgstr "Ресурси поза потоками" + +msgid "Machine is not on the network" +msgstr "Машина не в мережі" + +msgid "Package not installed" +msgstr "Пакет не встановлено" + +msgid "Object is remote" +msgstr "Об'єкт віддалений" + +msgid "Link has been severed" +msgstr "Посилання розірвано" + +msgid "Advertise error" +msgstr "Помилка реклами" + +msgid "Srmount error" +msgstr "Помилка Srmount" + +msgid "Communication error on send" +msgstr "Помилка зв’язку під час надсилання" + +msgid "Protocol error" +msgstr "Помилка протоколу" + +msgid "Multihop attempted" +msgstr "Спроба кількох стрибків" + +msgid "RFS specific error" +msgstr "Специфічна помилка RFS" + +msgid "Not a data message" +msgstr "Не повідомлення даних" + +msgid "Value too large for defined data type" +msgstr "Значення завелике для визначеного типу даних" + +msgid "Name not unique on network" +msgstr "Ім'я не унікальне в мережі" + +msgid "File descriptor in bad state" +msgstr "Дескриптор файлу в поганому стані" + +msgid "Remote address changed" +msgstr "Змінено віддалену адресу" + +msgid "Can not access a needed shared library" +msgstr "Неможливо отримати доступ до необхідної спільної бібліотеки" + +msgid "Accessing a corrupted shared library" +msgstr "Доступ до пошкодженої спільної бібліотеки" + +msgid ".lib section in a.out corrupted" +msgstr "Розділ .lib у файлі a.out пошкоджено" + +msgid "Attempting to link in too many shared libraries" +msgstr "Спроба зв’язатися із занадто великою кількістю спільних бібліотек" + +msgid "Cannot exec a shared library directly" +msgstr "Неможливо виконати спільну бібліотеку безпосередньо" + +msgid "Illegal byte sequence" +msgstr "Недопустима послідовність байтів" + +msgid "Interrupted system call should be restarted" +msgstr "Перерваний системний виклик слід розпочати заново" + +msgid "Streams pipe error" +msgstr "Помилка каналу потоків" + +msgid "Too many users" +msgstr "Забагато користувачів" + +msgid "Socket operation on non-socket" +msgstr "Робота сокета на несокеті" + +msgid "Destination address required" +msgstr "Потрібна адреса призначення" + +msgid "Message too long" +msgstr "Повідомлення задовге" + +msgid "Protocol wrong type for socket" +msgstr "Неправильний тип протоколу для сокета" + +msgid "Protocol not available" +msgstr "Протокол недоступний" + +msgid "Protocol not supported" +msgstr "Протокол не підтримується" + +msgid "Socket type not supported" +msgstr "Тип розетки не підтримується" + +msgid "Operation not supported on transport endpoint" +msgstr "Операція не підтримується на транспортній кінцевій точці" + +msgid "Operation not supported" +msgstr "" + +msgid "Protocol family not supported" +msgstr "Сімейство протоколів не підтримується" + +msgid "Address family not supported by protocol" +msgstr "Сімейство адрес не підтримується протоколом" + +msgid "Address already in use" +msgstr "Адреса вже використовується" + +msgid "Cannot assign requested address" +msgstr "Неможливо призначити запитану адресу" + +msgid "Network is down" +msgstr "Мережа не працює" + +msgid "Network is unreachable" +msgstr "Мережа недоступна" + +msgid "Network dropped connection because of reset" +msgstr "З’єднання з мережею перервано через скидання" + +msgid "" +"Software caused connection abort. This error is mapped to the exception :exc:" +"`ConnectionAbortedError`." +msgstr "" +"Програмне забезпечення спричинило переривання підключення. Ця помилка " +"зіставляється з винятком :exc:`ConnectionAbortedError`." + +msgid "" +"Connection reset by peer. This error is mapped to the exception :exc:" +"`ConnectionResetError`." +msgstr "" +"Підключення скинуто іншим комп'ютером. Ця помилка зіставляється з винятком :" +"exc:`ConnectionResetError`." + +msgid "No buffer space available" +msgstr "Немає буферного простору" + +msgid "Transport endpoint is already connected" +msgstr "Транспортна кінцева точка вже підключена" + +msgid "Transport endpoint is not connected" +msgstr "Кінцева транспортна точка не підключена" + +msgid "" +"Cannot send after transport endpoint shutdown. This error is mapped to the " +"exception :exc:`BrokenPipeError`." +msgstr "" +"Неможливо надіслати після завершення транспортної кінцевої точки. Ця помилка " +"зіставляється з винятком :exc:`BrokenPipeError`." + +msgid "Too many references: cannot splice" +msgstr "Забагато посилань: неможливо з’єднати" + +msgid "" +"Connection timed out. This error is mapped to the exception :exc:" +"`TimeoutError`." +msgstr "" +"Тайм-аут підключення. Ця помилка зіставляється з винятком :exc:" +"`TimeoutError`." + +msgid "" +"Connection refused. This error is mapped to the exception :exc:" +"`ConnectionRefusedError`." +msgstr "" +"З'єднання відхилено. Ця помилка зіставляється з винятком :exc:" +"`ConnectionRefusedError`." + +msgid "Host is down" +msgstr "Хост не працює" + +msgid "No route to host" +msgstr "Немає маршруту до хосту" + +msgid "" +"Operation already in progress. This error is mapped to the exception :exc:" +"`BlockingIOError`." +msgstr "" +"Операція вже триває. Ця помилка зіставляється з винятком :exc:" +"`BlockingIOError`." + +msgid "" +"Operation now in progress. This error is mapped to the exception :exc:" +"`BlockingIOError`." +msgstr "" +"Зараз триває операція. Ця помилка зіставляється з винятком :exc:" +"`BlockingIOError`." + +msgid "Stale NFS file handle" +msgstr "Застарілий дескриптор файлу NFS" + +msgid "Structure needs cleaning" +msgstr "Конструкція потребує очищення" + +msgid "Not a XENIX named type file" +msgstr "Файл не має імені XENIX" + +msgid "No XENIX semaphores available" +msgstr "Немає доступних семафорів XENIX" + +msgid "Is a named type file" +msgstr "Це файл іменованого типу" + +msgid "Remote I/O error" +msgstr "Помилка віддаленого введення-виведення" + +msgid "Quota exceeded" +msgstr "Квоту перевищено" + +msgid "Interface output queue is full" +msgstr "" + +msgid "No medium found" +msgstr "" + +msgid "Wrong medium type" +msgstr "" + +msgid "Required key not available" +msgstr "" + +msgid "Key has expired" +msgstr "" + +msgid "Key has been revoked" +msgstr "" + +msgid "Key was rejected by service" +msgstr "" + +msgid "Operation not possible due to RF-kill" +msgstr "" + +msgid "Locked lock was unmapped" +msgstr "" + +msgid "Facility is not active" +msgstr "" + +msgid "Authentication error" +msgstr "" + +msgid "Bad CPU type in executable" +msgstr "" + +msgid "Bad executable (or shared library)" +msgstr "" + +msgid "Malformed Mach-o file" +msgstr "" + +msgid "Device error" +msgstr "" + +msgid "Inappropriate file type or format" +msgstr "" + +msgid "Need authenticator" +msgstr "" + +msgid "Attribute not found" +msgstr "" + +msgid "Policy not found" +msgstr "" + +msgid "Too many processes" +msgstr "" + +msgid "Bad procedure for program" +msgstr "" + +msgid "Program version wrong" +msgstr "" + +msgid "RPC prog. not avail" +msgstr "" + +msgid "Device power is off" +msgstr "" + +msgid "RPC struct is bad" +msgstr "" + +msgid "RPC version wrong" +msgstr "" + +msgid "Shared library version mismatch" +msgstr "" + +msgid "" +"Capabilities insufficient. This error is mapped to the exception :exc:" +"`PermissionError`." +msgstr "" + +msgid "Availability" +msgstr "" + +msgid "Operation canceled" +msgstr "" + +msgid "Owner died" +msgstr "" + +msgid "State not recoverable" +msgstr "" diff --git a/library/exceptions.po b/library/exceptions.po new file mode 100644 index 000000000..9dbd49dba --- /dev/null +++ b/library/exceptions.po @@ -0,0 +1,1438 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2023 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 01:05+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2023\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Built-in Exceptions" +msgstr "Вбудовані винятки" + +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." +msgstr "" +"У Python усі винятки мають бути екземплярами класу, який походить від :class:" +"`BaseException`. У операторі :keyword:`try` із пунктом :keyword:`except`, " +"який згадує певний клас, цей пункт також обробляє будь-які класи винятків, " +"похідних від цього класу (але не класи винятків, з яких *it* походить). Два " +"класи винятків, які не пов’язані через підкласи, ніколи не є еквівалентними, " +"навіть якщо вони мають однакові назви." + +msgid "" +"The built-in exceptions listed in this chapter can be generated by the " +"interpreter or built-in functions. Except where mentioned, they have an " +"\"associated value\" indicating the detailed cause of the error. This may " +"be a string or a tuple of several items of information (e.g., an error code " +"and a string explaining the code). The associated value is usually passed " +"as arguments to the exception class's constructor." +msgstr "" + +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 " +"situation in which the interpreter raises the same exception; but beware " +"that there is nothing to prevent user code from raising an inappropriate " +"error." +msgstr "" +"Код користувача може викликати вбудовані винятки. Це можна використовувати " +"для перевірки обробника винятків або для повідомлення про стан помилки " +"\"подібно до\" ситуації, в якій інтерпретатор викликає той самий виняток; " +"але майте на увазі, що ніщо не завадить коду користувача викликати недоречну " +"помилку." + +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`." +msgstr "" +"Вбудовані класи винятків можуть бути підкласами для визначення нових " +"винятків; Програмістам рекомендується отримувати нові винятки з класу :exc:" +"`Exception` або одного з його підкласів, а не з :exc:`BaseException`. Більше " +"інформації про визначення винятків доступно в підручнику з Python у розділі :" +"ref:`tut-userexceptions`." + +msgid "Exception context" +msgstr "Контекст винятків" + +msgid "" +"Three attributes on exception objects provide information about the context " +"in which the exception was raised:" +msgstr "" + +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." +msgstr "" + +msgid "" +"This implicit exception context can be supplemented with an explicit cause " +"by using :keyword:`!from` with :keyword:`raise`::" +msgstr "" +"Цей контекст неявної виняткової ситуації можна доповнити явною причиною за " +"допомогою :keyword:`!from` з :keyword:`raise`::" + +msgid "raise new_exc from original_exc" +msgstr "" + +msgid "" +"The expression following :keyword:`from` must be an exception or " +"``None``. It will be set as :attr:`!__cause__` on the raised exception. " +"Setting :attr:`!__cause__` also implicitly sets the :attr:`!" +"__suppress_context__` attribute to ``True``, so that using ``raise new_exc " +"from None`` effectively replaces the old exception with the new one for " +"display purposes (e.g. converting :exc:`KeyError` to :exc:`AttributeError`), " +"while leaving the old exception available in :attr:`!__context__` for " +"introspection when debugging." +msgstr "" + +msgid "" +"The default traceback display code shows these chained exceptions in " +"addition to the traceback for the exception itself. An explicitly chained " +"exception in :attr:`!__cause__` is always shown when present. An implicitly " +"chained exception in :attr:`!__context__` is shown only if :attr:`!" +"__cause__` is :const:`None` and :attr:`!__suppress_context__` is false." +msgstr "" + +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 " +"exception that was raised." +msgstr "" +"У будь-якому випадку сам виняток завжди відображається після будь-яких " +"ланцюжкових винятків, так що останній рядок трасування завжди показує " +"останній виняток, який був викликаний." + +msgid "Inheriting from built-in exceptions" +msgstr "Успадкування від вбудованих винятків" + +msgid "" +"User code can create subclasses that inherit from an exception type. It's " +"recommended to only subclass one exception type at a time to avoid any " +"possible conflicts between how the bases handle the ``args`` attribute, as " +"well as due to possible memory layout incompatibilities." +msgstr "" +"Код користувача може створювати підкласи, які успадковуються від типу " +"винятку. Рекомендується створювати підкласи лише для одного типу винятків за " +"раз, щоб уникнути будь-яких можливих конфліктів між тим, як основи " +"обробляють атрибут ``args``, а також через можливу несумісність розташування " +"пам’яті." + +msgid "" +"Most built-in exceptions are implemented in C for efficiency, see: :source:" +"`Objects/exceptions.c`. Some have custom memory layouts which makes it " +"impossible to create a subclass that inherits from multiple exception types. " +"The memory layout of a type is an implementation detail and might change " +"between Python versions, leading to new conflicts in the future. Therefore, " +"it's recommended to avoid subclassing multiple exception types altogether." +msgstr "" +"Більшість вбудованих винятків реалізовано в C для ефективності, див.: :" +"source:`Objects/exceptions.c`. Деякі мають власне розташування пам’яті, що " +"унеможливлює створення підкласу, який успадковує кілька типів винятків. " +"Розташування пам’яті типу є деталлю реалізації та може змінюватися між " +"версіями Python, що призведе до нових конфліктів у майбутньому. Тому " +"рекомендується взагалі уникати створення підкласів кількох типів винятків." + +msgid "Base classes" +msgstr "Базові класи" + +msgid "" +"The following exceptions are used mostly as base classes for other " +"exceptions." +msgstr "" +"Наступні винятки використовуються переважно як базові класи для інших " +"винятків." + +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 " +"were no arguments." +msgstr "" +"Базовий клас для всіх вбудованих винятків. Він не призначений для " +"безпосереднього успадкування класами, визначеними користувачем (для цього " +"використовуйте :exc:`Exception`). Якщо :func:`str` викликається для " +"екземпляра цього класу, повертається представлення аргументів для екземпляра " +"або порожній рядок, якщо аргументів не було." + +msgid "" +"The tuple of arguments given to the exception constructor. Some built-in " +"exceptions (like :exc:`OSError`) expect a certain number of arguments and " +"assign a special meaning to the elements of this tuple, while others are " +"usually called only with a single string giving an error message." +msgstr "" +"Кортеж аргументів, наданий конструктору винятків. Деякі вбудовані винятки " +"(як-от :exc:`OSError`) очікують певної кількості аргументів і призначають " +"особливе значення елементам цього кортежу, тоді як інші зазвичай " +"викликаються лише з одним рядком, що дає повідомлення про помилку." + +msgid "" +"This method sets *tb* as the new traceback for the exception and returns the " +"exception object. It was more commonly used before the exception chaining " +"features of :pep:`3134` became available. The following example shows how " +"we can convert an instance of ``SomeException`` into an instance of " +"``OtherException`` while preserving the traceback. Once raised, the current " +"frame is pushed onto the traceback of the ``OtherException``, as would have " +"happened to the traceback of the original ``SomeException`` had we allowed " +"it to propagate to the caller. ::" +msgstr "" +"Цей метод встановлює *tb* як нову трасування для винятку та повертає об’єкт " +"винятку. Його частіше використовували до того, як стали доступними функції " +"ланцюжка винятків :pep:`3134`. У наступному прикладі показано, як ми можемо " +"перетворити екземпляр ``SomeException`` на екземпляр ``OtherException``, " +"зберігаючи зворотне трасування. Після підняття поточний фрейм надсилається " +"на трасування ``OtherException``, як це сталося б із трасуванням " +"оригінального ``SomeException``, якби ми дозволили йому поширюватися на " +"виклик. ::" + +msgid "" +"try:\n" +" ...\n" +"except SomeException:\n" +" tb = sys.exception().__traceback__\n" +" raise OtherException(...).with_traceback(tb)" +msgstr "" + +msgid "" +"A writable field that holds the :ref:`traceback object ` " +"associated with this exception. See also: :ref:`raise`." +msgstr "" + +msgid "" +"Add the string ``note`` to the exception's notes which appear in the " +"standard traceback after the exception string. A :exc:`TypeError` is raised " +"if ``note`` is not a string." +msgstr "" + +msgid "" +"A list of the notes of this exception, which were added with :meth:" +"`add_note`. This attribute is created when :meth:`add_note` is called." +msgstr "" + +msgid "" +"All built-in, non-system-exiting exceptions are derived from this class. " +"All user-defined exceptions should also be derived from this class." +msgstr "" +"Усі вбудовані винятки, що не виходять із системи, походять від цього класу. " +"Усі визначені користувачем винятки також мають бути похідними від цього " +"класу." + +msgid "" +"The base class for those built-in exceptions that are raised for various " +"arithmetic errors: :exc:`OverflowError`, :exc:`ZeroDivisionError`, :exc:" +"`FloatingPointError`." +msgstr "" +"Базовий клас для тих вбудованих винятків, які викликаються для різних " +"арифметичних помилок: :exc:`OverflowError`, :exc:`ZeroDivisionError`, :exc:" +"`FloatingPointError`." + +msgid "" +"Raised when a :ref:`buffer ` related operation cannot be " +"performed." +msgstr "" +"Викликається, коли пов’язану операцію :ref:`buffer ` не можна " +"виконати." + +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 "" +"Базовий клас для винятків, які виникають, коли ключ або індекс, використаний " +"у відображенні чи послідовності, недійсний: :exc:`IndexError`, :exc:" +"`KeyError`. Це можна викликати безпосередньо за допомогою :func:`codecs." +"lookup`." + +msgid "Concrete exceptions" +msgstr "Конкретні винятки" + +msgid "The following exceptions are the exceptions that are usually raised." +msgstr "Наступні винятки є винятками, які зазвичай виникають." + +msgid "Raised when an :keyword:`assert` statement fails." +msgstr "Викликається, коли оператор :keyword:`assert` не виконується." + +msgid "" +"Raised when an attribute reference (see :ref:`attribute-references`) or " +"assignment fails. (When an object does not support attribute references or " +"attribute assignments at all, :exc:`TypeError` is raised.)" +msgstr "" +"Викликається, коли посилання на атрибут (див. :ref:`attribute-references`) " +"або призначення не вдається. (Якщо об’єкт взагалі не підтримує посилання на " +"атрибути чи призначення атрибутів, виникає :exc:`TypeError`.)" + +msgid "" +"The :attr:`name` and :attr:`obj` attributes can be set using keyword-only " +"arguments to the constructor. When set they represent the name of the " +"attribute that was attempted to be accessed and the object that was accessed " +"for said attribute, respectively." +msgstr "" +"Атрибути :attr:`name` і :attr:`obj` можна встановити за допомогою аргументів " +"конструктора, які містять лише ключові слова. Якщо встановлено, вони " +"представляють ім’я атрибута, до якого намагалися отримати доступ, і об’єкта, " +"до якого було звернено доступ для зазначеного атрибута, відповідно." + +msgid "Added the :attr:`name` and :attr:`obj` attributes." +msgstr "Додано атрибути :attr:`name` і :attr:`obj`." + +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 "" +"Викликається, коли функція :func:`input` досягає умови кінця файлу (EOF) без " +"читання жодних даних. (Примітка: методи :meth:`io.IOBase.read` і :meth:`io." +"IOBase.readline` повертають порожній рядок, коли вони досягають EOF.)" + +msgid "Not currently used." +msgstr "Зараз не використовується." + +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." +msgstr "" +"Викликається, коли :term:`generator` або :term:`coroutine` закрито; див. :" +"meth:`generator.close` і :meth:`coroutine.close`. Він безпосередньо " +"успадковує :exc:`BaseException` замість :exc:`Exception`, оскільки технічно " +"це не помилка." + +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 " +"name that cannot be found." +msgstr "" +"Викликається, коли оператор :keyword:`import` має проблеми при спробі " +"завантажити модуль. Також виникає, коли \"зі списку\" в ``from ... import`` " +"має назву, яку неможливо знайти." + +msgid "" +"The optional *name* and *path* keyword-only arguments set the corresponding " +"attributes:" +msgstr "" + +msgid "The name of the module that was attempted to be imported." +msgstr "" + +msgid "The path to any file which triggered the exception." +msgstr "" + +msgid "Added the :attr:`name` and :attr:`path` attributes." +msgstr "Додано атрибути :attr:`name` і :attr:`path`." + +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`." +msgstr "" +"Підклас :exc:`ImportError`, який викликається :keyword:`import`, коли не " +"вдалося знайти модуль. Він також виникає, коли ``None`` знайдено в :data:" +"`sys.modules`." + +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 " +"integer, :exc:`TypeError` is raised.)" +msgstr "" +"Викликається, коли індекс послідовності виходить за межі діапазону. (Індекси " +"фрагментів мовчки скорочуються, щоб потрапити в дозволений діапазон; якщо " +"індекс не є цілим числом, виникає :exc:`TypeError`.)" + +msgid "" +"Raised when a mapping (dictionary) key is not found in the set of existing " +"keys." +msgstr "" +"Викликається, коли ключ відображення (словника) не знайдено в наборі " +"існуючих ключів." + +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 " +"accidentally caught by code that catches :exc:`Exception` and thus prevent " +"the interpreter from exiting." +msgstr "" +"Викликається, коли користувач натискає клавішу переривання (зазвичай :kbd:" +"`Control-C` або :kbd:`Delete`). Під час виконання регулярно виконується " +"перевірка на наявність переривань. Виняток успадковується від :exc:" +"`BaseException`, щоб не бути випадково перехопленим кодом, який перехоплює :" +"exc:`Exception` і таким чином запобігти виходу інтерпретатора." + +msgid "" +"Catching a :exc:`KeyboardInterrupt` requires special consideration. Because " +"it can be raised at unpredictable points, it may, in some circumstances, " +"leave the running program in an inconsistent state. It is generally best to " +"allow :exc:`KeyboardInterrupt` to end the program as quickly as possible or " +"avoid raising it entirely. (See :ref:`handlers-and-exceptions`.)" +msgstr "" +"Перехоплення :exc:`KeyboardInterrupt` вимагає особливої уваги. Оскільки він " +"може виникати в непередбачуваних моментах, за деяких обставин він може " +"залишити запущену програму в неузгодженому стані. Загалом найкраще " +"дозволити :exc:`KeyboardInterrupt` завершити програму якомога швидше або " +"повністю уникати її запуску. (Див. :ref:`handlers-and-exceptions`.)" + +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." +msgstr "" +"Викликається, коли для операції вичерпується пам’ять, але ситуацію можна " +"врятувати (видаливши деякі об’єкти). Пов’язане значення — це рядок, що " +"вказує, яка (внутрішня) операція вичерпала пам’ять. Зауважте, що через " +"базову архітектуру керування пам’яттю (функція C :c:func:`malloc`), " +"інтерпретатор не завжди може повністю вийти з цієї ситуації; незважаючи на " +"це, він викликає виняток, щоб можна було надрукувати зворотне трасування " +"стека, якщо причиною стала програма, що втекла." + +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 " +"the name that could not be found." +msgstr "" +"Викликається, коли локальне чи глобальне ім’я не знайдено. Це стосується " +"лише некваліфікованих імен. Пов’язане значення – це повідомлення про " +"помилку, яке містить ім’я, яке не вдалося знайти." + +msgid "" +"The :attr:`name` attribute can be set using a keyword-only argument to the " +"constructor. When set it represent the name of the variable that was " +"attempted to be accessed." +msgstr "" +"Атрибут :attr:`name` можна встановити за допомогою лише ключового аргументу " +"для конструктора. Якщо встановлено, воно представляє назву змінної, до якої " +"намагалися отримати доступ." + +msgid "Added the :attr:`name` attribute." +msgstr "Додано атрибут :attr:`name`." + +msgid "" +"This exception is derived from :exc:`RuntimeError`. In user defined base " +"classes, abstract methods should raise this exception when they require " +"derived classes to override the method, or while the class is being " +"developed to indicate that the real implementation still needs to be added." +msgstr "" +"Цей виняток походить від :exc:`RuntimeError`. У визначених користувачем " +"базових класах абстрактні методи повинні викликати цей виняток, коли вони " +"вимагають, щоб похідні класи замінили метод, або під час розробки класу, щоб " +"вказати, що справжню реалізацію все ще потрібно додати." + +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 " +"undefined or, if a subclass, set it to :data:`None`." +msgstr "" +"Його не слід використовувати для вказівки на те, що оператор або метод " +"взагалі не призначений для підтримки — у такому випадку або залиште оператор/" +"метод невизначеними, або, якщо це підклас, установіть для нього значення :" +"data:`None`." + +msgid "" +":exc:`!NotImplementedError` and :data:`!NotImplemented` are not " +"interchangeable. This exception should only be used as described above; see :" +"data:`NotImplemented` for details on correct usage of the built-in constant." +msgstr "" + +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)." +msgstr "" +"Цей виняток виникає, коли системна функція повертає системну помилку, " +"включаючи помилки вводу-виводу, такі як \"файл не знайдено\" або \"диск " +"заповнений\" (не для недопустимих типів аргументів або інших випадкових " +"помилок)." + +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." +msgstr "" +"Друга форма конструктора встановлює відповідні атрибути, описані нижче. " +"Атрибути за замовчуванням :const:`None`, якщо не вказано. Для зворотної " +"сумісності, якщо передано три аргументи, атрибут :attr:`~BaseException.args` " +"містить лише 2 кортежу з перших двох аргументів конструктора." + +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." +msgstr "" +"Конструктор часто повертає підклас :exc:`OSError`, як описано в розділі `OS " +"exceptions`_ нижче. Конкретний підклас залежить від кінцевого значення :attr:" +"`.errno`. Така поведінка виникає лише під час створення :exc:`OSError` " +"безпосередньо або через псевдонім і не успадковується під час створення " +"підкласу." + +msgid "A numeric error code from the C variable :c:data:`errno`." +msgstr "Числовий код помилки зі змінної C :c:data:`errno`." + +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." +msgstr "" +"У Windows це дає вам рідний код помилки Windows. Тоді атрибут :attr:`.errno` " +"є приблизним перекладом, у термінах POSIX, цього рідного коду помилки." + +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." +msgstr "" +"У Windows, якщо аргумент конструктора *winerror* є цілим числом, атрибут :" +"attr:`.errno` визначається з коду помилки Windows, а аргумент *errno* " +"ігнорується. На інших платформах аргумент *winerror* ігнорується, а атрибут :" +"attr:`winerror` не існує." + +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." +msgstr "" +"Відповідне повідомлення про помилку, яке надає операційна система. Він " +"відформатований функціями C :c:func:`perror` під POSIX і :c:func:" +"`FormatMessage` під Windows." + +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." +msgstr "" +"Для винятків, які містять шлях до файлової системи (наприклад, :func:`open` " +"або :func:`os.unlink`), :attr:`filename` — це ім’я файлу, яке передається " +"функції. Для функцій, які включають два шляхи до файлової системи " +"(наприклад, :func:`os.rename`), :attr:`filename2` відповідає другому імені " +"файлу, переданому функції." + +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." +msgstr "" +":exc:`EnvironmentError`, :exc:`IOError`, :exc:`WindowsError`, :exc:`socket." +"error`, :exc:`select.error` і :exc:`mmap.error` об’єднано у :exc:`OSError`, " +"і конструктор може повернути підклас." + +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." +msgstr "" +"Атрибут :attr:`filename` тепер є оригінальним ім’ям файлу, переданим у " +"функцію, замість імені, закодованого або декодованого з :term:`filesystem " +"encoding and error handler`. Також було додано аргумент і атрибут " +"конструктора *filename2*." + +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." +msgstr "" + +msgid "" +"This exception is derived from :exc:`RuntimeError`. It is raised when an " +"operation is blocked during interpreter shutdown also known as :term:`Python " +"finalization `." +msgstr "" + +msgid "" +"Examples of operations which can be blocked with a :exc:" +"`PythonFinalizationError` during the Python finalization:" +msgstr "" + +msgid "Creating a new Python thread." +msgstr "" + +msgid ":func:`os.fork`." +msgstr "" + +msgid "See also the :func:`sys.is_finalizing` function." +msgstr "" + +msgid "Previously, a plain :exc:`RuntimeError` was raised." +msgstr "Раніше було викликано звичайне повідомлення :exc:`RuntimeError`." + +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." +msgstr "" +"Цей виняток походить від :exc:`RuntimeError`. Він виникає, коли " +"інтерпретатор виявляє, що максимальна глибина рекурсії (див. :func:`sys." +"getrecursionlimit`) перевищена." + +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 " +"references, see the :mod:`weakref` module." +msgstr "" +"Цей виняток виникає, коли слабкий посилальний проксі-сервер, створений " +"функцією :func:`weakref.proxy`, використовується для доступу до атрибута " +"референта після його збирання сміття. Щоб дізнатися більше про слабкі " +"посилання, перегляньте модуль :mod:`weakref`." + +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 " +"wrong." +msgstr "" +"Викликається, коли виявлено помилку, яка не підпадає під жодну з інших " +"категорій. Пов’язане значення — це рядок, який вказує, що саме пішло не так." + +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." +msgstr "" +"Викликається вбудованою функцією :func:`next` і методом :term:" +"`iterator`\\'s :meth:`~iterator.__next__`, щоб повідомити про те, що " +"ітератор не створює жодних елементів." + +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`." +msgstr "" + +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." +msgstr "" +"Коли функція :term:`generator` або :term:`coroutine` повертається, " +"створюється новий екземпляр :exc:`StopIteration`, і значення, повернуте " +"функцією, використовується як параметр :attr:`value` для конструктор винятку." + +msgid "" +"If a generator code directly or indirectly raises :exc:`StopIteration`, it " +"is converted into a :exc:`RuntimeError` (retaining the :exc:`StopIteration` " +"as the new exception's cause)." +msgstr "" +"Якщо код генератора прямо чи опосередковано викликає :exc:`StopIteration`, " +"він перетворюється на :exc:`RuntimeError` (зберігаючи :exc:`StopIteration` " +"як нову причину винятку)." + +msgid "" +"Added ``value`` attribute and the ability for generator functions to use it " +"to return a value." +msgstr "" +"Додано атрибут ``value`` і можливість для функцій генератора використовувати " +"його для повернення значення." + +msgid "" +"Introduced the RuntimeError transformation via ``from __future__ import " +"generator_stop``, see :pep:`479`." +msgstr "" +"Представлено перетворення RuntimeError через ``from __future__ import " +"generator_stop``, див. :pep:`479`." + +msgid "" +"Enable :pep:`479` for all code by default: a :exc:`StopIteration` error " +"raised in a generator is transformed into a :exc:`RuntimeError`." +msgstr "" +"Увімкнути :pep:`479` для всього коду за замовчуванням: помилка :exc:" +"`StopIteration`, викликана генератором, перетворюється на :exc:" +"`RuntimeError`." + +msgid "" +"Must be raised by :meth:`~object.__anext__` method of an :term:`asynchronous " +"iterator` object to stop the iteration." +msgstr "" + +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)." +msgstr "" +"Викликається, коли аналізатор виявляє синтаксичну помилку. Це може статися в " +"операторі :keyword:`import`, під час виклику вбудованих функцій :func:" +"`compile`, :func:`exec` або :func:`eval`, або під час читання початкового " +"сценарію або стандартний ввід (також інтерактивно)." + +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." +msgstr "" +":func:`str` екземпляра винятку повертає лише повідомлення про помилку. " +"Деталі — це кортеж, члени якого також доступні як окремі атрибути." + +msgid "The name of the file the syntax error occurred in." +msgstr "Назва файлу, у якому сталася синтаксична помилка." + +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." +msgstr "" +"У якому номері рядка у файлі сталася помилка. Це індексовано 1: перший рядок " +"у файлі має ``lineno`` 1." + +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." +msgstr "" +"Стовпець у рядку, де сталася помилка. Це індексується 1: перший символ у " +"рядку має ``зміщення`` 1." + +msgid "The source code text involved in the error." +msgstr "Текст вихідного коду, пов’язаний з помилкою." + +msgid "" +"Which line number in the file the error occurred ends in. This is 1-indexed: " +"the first line in the file has a ``lineno`` of 1." +msgstr "" +"На якому номері рядка у файлі закінчується помилка. Це індексовано 1: перший " +"рядок у файлі має ``lineno`` 1." + +msgid "" +"The column in the end line where the error occurred finishes. This is 1-" +"indexed: the first character in the line has an ``offset`` of 1." +msgstr "" +"Стовпець у кінцевому рядку, де сталася помилка, завершується. Це " +"індексується 1: перший символ у рядку має ``зміщення`` 1." + +msgid "" +"For errors in f-string fields, the message is prefixed by \"f-string: \" and " +"the offsets are offsets in a text constructed from the replacement " +"expression. For example, compiling f'Bad {a b} field' results in this args " +"attribute: ('f-string: ...', ('', 1, 2, '(a b)\\n', 1, 5))." +msgstr "" +"Для помилок у полях f-рядка повідомлення має префікс \"f-рядок: \", а зсуви " +"є зсувами в тексті, створеному з виразу заміни. Наприклад, компіляція f'Bad " +"{a b} field' призводить до такого атрибута args: ('f-string: ...', ('', 1, " +"2, '(a b)\\n', 1, 5)) ." + +msgid "Added the :attr:`end_lineno` and :attr:`end_offset` attributes." +msgstr "Додано атрибути :attr:`end_lineno` і :attr:`end_offset`." + +msgid "" +"Base class for syntax errors related to incorrect indentation. This is a " +"subclass of :exc:`SyntaxError`." +msgstr "" +"Базовий клас для синтаксичних помилок, пов’язаних із неправильним відступом. " +"Це підклас :exc:`SyntaxError`." + +msgid "" +"Raised when indentation contains an inconsistent use of tabs and spaces. " +"This is a subclass of :exc:`IndentationError`." +msgstr "" +"Піднімається, коли відступ містить непослідовне використання табуляції та " +"пробілів. Це підклас :exc:`IndentationError`." + +msgid "" +"Raised when the interpreter finds an internal error, but the situation does " +"not look so serious to cause it to abandon all hope. The associated value is " +"a string indicating what went wrong (in low-level terms). In :term:" +"`CPython`, this could be raised by incorrectly using Python's C API, such as " +"returning a ``NULL`` value without an exception set." +msgstr "" + +msgid "" +"If you're confident that this exception wasn't your fault, or the fault of a " +"package you're using, you should report this to the author or maintainer of " +"your Python interpreter. Be sure to report the version of the Python " +"interpreter (``sys.version``; it is also printed at the start of an " +"interactive Python session), the exact error message (the exception's " +"associated value) and if possible the source of the program that triggered " +"the error." +msgstr "" + +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 "" +"Цей виняток викликає функція :func:`sys.exit`. Він успадковує :exc:" +"`BaseException` замість :exc:`Exception`, щоб його випадково не перехопив " +"код, який перехоплює :exc:`Exception`. Це дозволяє винятку належним чином " +"поширюватися вгору та спричиняти вихід інтерпретатора. Якщо він не " +"оброблений, інтерпретатор Python завершує роботу; трасування стека не " +"друкується. Конструктор приймає той самий необов’язковий аргумент, що " +"передається в :func:`sys.exit`. Якщо значення є цілим числом, воно вказує " +"статус виходу з системи (передається функції C :c:func:`exit`); якщо " +"значення ``None``, статус виходу дорівнює нулю; якщо він має інший тип " +"(наприклад, рядок), значення об’єкта друкується, а статус виходу один." + +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 " +"executed, and so that a debugger can execute a script without running the " +"risk of losing control. The :func:`os._exit` function can be used if it is " +"absolutely positively necessary to exit immediately (for example, in the " +"child process after a call to :func:`os.fork`)." +msgstr "" +"Виклик :func:`sys.exit` перетворюється на виняток, щоб можна було виконати " +"обробники очищення (пункти :keyword:`finally` інструкцій :keyword:`try`), а " +"також щоб налагоджувач міг виконати сценарій без ризику втратити контроль. " +"Функцію :func:`os._exit` можна використовувати, якщо є абсолютна " +"необхідність негайного виходу (наприклад, у дочірньому процесі після " +"виклику :func:`os.fork`)." + +msgid "" +"The exit status or error message that is passed to the constructor. " +"(Defaults to ``None``.)" +msgstr "" +"Статус виходу або повідомлення про помилку, яке передається конструктору. " +"(За замовчуванням ``None``.)" + +msgid "" +"Raised when an operation or function is applied to an object of " +"inappropriate type. The associated value is a string giving details about " +"the type mismatch." +msgstr "" +"Викликається, коли операція або функція застосована до об’єкта " +"невідповідного типу. Пов’язане значення — це рядок, що містить відомості про " +"невідповідність типу." + +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 " +"object is meant to support a given operation but has not yet provided an " +"implementation, :exc:`NotImplementedError` is the proper exception to raise." +msgstr "" +"Цей виняток може бути викликаний кодом користувача, щоб вказати, що спроба " +"операції з об’єктом не підтримується та не передбачається. Якщо об’єкт " +"призначений для підтримки даної операції, але ще не надав реалізацію, :exc:" +"`NotImplementedError` є правильним винятком для виклику." + +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`." +msgstr "" +"Передача аргументів неправильного типу (наприклад, передача :class:`list`, " +"коли очікується :class:`int`) має призвести до :exc:`TypeError`, але " +"передача аргументів із неправильним значенням (наприклад, число за межами " +"очікувані межі) має призвести до :exc:`ValueError`." + +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`." +msgstr "" +"Викликається, коли робиться посилання на локальну змінну у функції чи " +"методі, але жодне значення не прив’язано до цієї змінної. Це підклас :exc:" +"`NameError`." + +msgid "" +"Raised when a Unicode-related encoding or decoding error occurs. It is a " +"subclass of :exc:`ValueError`." +msgstr "" +"Викликається, коли виникає помилка кодування чи декодування, пов’язана з " +"Unicode. Це підклас :exc:`ValueError`." + +msgid "" +":exc:`UnicodeError` has attributes that describe the encoding or decoding " +"error. For example, ``err.object[err.start:err.end]`` gives the particular " +"invalid input that the codec failed on." +msgstr "" +":exc:`UnicodeError` має атрибути, які описують помилку кодування або " +"декодування. Наприклад, ``err.object[err.start:err.end]`` вказує на певний " +"недійсний вхід, який не вдалося виконати кодеку." + +msgid "The name of the encoding that raised the error." +msgstr "Назва кодування, яке викликало помилку." + +msgid "A string describing the specific codec error." +msgstr "Рядок, що описує певну помилку кодека." + +msgid "The object the codec was attempting to encode or decode." +msgstr "Об’єкт, який кодек намагався закодувати або декодувати." + +msgid "The first index of invalid data in :attr:`object`." +msgstr "Перший індекс недійсних даних в :attr:`object`." + +msgid "The index after the last invalid data in :attr:`object`." +msgstr "Індекс після останніх недійсних даних у :attr:`object`." + +msgid "" +"Raised when a Unicode-related error occurs during encoding. It is a " +"subclass of :exc:`UnicodeError`." +msgstr "" +"Викликається, коли під час кодування виникає помилка, пов’язана з Unicode. " +"Це підклас :exc:`UnicodeError`." + +msgid "" +"Raised when a Unicode-related error occurs during decoding. It is a " +"subclass of :exc:`UnicodeError`." +msgstr "" +"Викликається, коли під час декодування виникає помилка, пов’язана з Unicode. " +"Це підклас :exc:`UnicodeError`." + +msgid "" +"Raised when a Unicode-related error occurs during translating. It is a " +"subclass of :exc:`UnicodeError`." +msgstr "" +"Викликається, коли під час перекладу виникає помилка, пов’язана з Unicode. " +"Це підклас :exc:`UnicodeError`." + +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 " +"more precise exception such as :exc:`IndexError`." +msgstr "" +"Викликається, коли операція або функція отримує аргумент, який має " +"правильний тип, але невідповідне значення, і ситуація не описується більш " +"точним винятком, таким як :exc:`IndexError`." + +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 " +"operation." +msgstr "" +"Викликається, коли другий аргумент операції ділення або модуля дорівнює " +"нулю. Пов’язане значення — це рядок, що вказує тип операндів і операції." + +msgid "" +"The following exceptions are kept for compatibility with previous versions; " +"starting from Python 3.3, they are aliases of :exc:`OSError`." +msgstr "" +"Наступні винятки зберігаються для сумісності з попередніми версіями; " +"починаючи з Python 3.3, вони є псевдонімами :exc:`OSError`." + +msgid "Only available on Windows." +msgstr "Доступно лише для Windows." + +msgid "OS exceptions" +msgstr "Винятки ОС" + +msgid "" +"The following exceptions are subclasses of :exc:`OSError`, they get raised " +"depending on the system error code." +msgstr "" +"Наступні винятки є підкласами :exc:`OSError`, вони виникають залежно від " +"коду системної помилки." + +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`." +msgstr "" + +msgid "" +"In addition to those of :exc:`OSError`, :exc:`BlockingIOError` can have one " +"more attribute:" +msgstr "" +"Окрім атрибутів :exc:`OSError`, :exc:`BlockingIOError` може мати ще один " +"атрибут:" + +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 " +"from the :mod:`io` module." +msgstr "" +"Ціле число, що містить кількість символів, записаних у потік перед його " +"блокуванням. Цей атрибут доступний під час використання буферизованих класів " +"введення-виведення з модуля :mod:`io`." + +msgid "" +"Raised when an operation on a child process failed. Corresponds to :c:data:" +"`errno` :py:const:`~errno.ECHILD`." +msgstr "" + +msgid "A base class for connection-related issues." +msgstr "Базовий клас для проблем, пов’язаних із з’єднанням." + +msgid "" +"Subclasses are :exc:`BrokenPipeError`, :exc:`ConnectionAbortedError`, :exc:" +"`ConnectionRefusedError` and :exc:`ConnectionResetError`." +msgstr "" +"Підкласами є :exc:`BrokenPipeError`, :exc:`ConnectionAbortedError`, :exc:" +"`ConnectionRefusedError` і :exc:`ConnectionResetError`." + +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`." +msgstr "" + +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`." +msgstr "" + +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`." +msgstr "" + +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 "" + +msgid "" +"Raised when trying to create a file or directory which already exists. " +"Corresponds to :c:data:`errno` :py:const:`~errno.EEXIST`." +msgstr "" + +msgid "" +"Raised when a file or directory is requested but doesn't exist. Corresponds " +"to :c:data:`errno` :py:const:`~errno.ENOENT`." +msgstr "" + +msgid "" +"Raised when a system call is interrupted by an incoming signal. Corresponds " +"to :c:data:`errno` :py:const:`~errno.EINTR`." +msgstr "" + +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 повторює системні виклики, коли системний виклик переривається " +"сигналом, за винятком випадків, коли обробник сигналу викликає виняток " +"(обґрунтування див. :pep:`475`), замість того, щоб викликати :exc:" +"`InterruptedError`." + +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 "" + +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`." +msgstr "" + +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`." +msgstr "" + +msgid "" +"WASI's :py:const:`~errno.ENOTCAPABLE` is now mapped to :exc:" +"`PermissionError`." +msgstr "" + +msgid "" +"Raised when a given process doesn't exist. Corresponds to :c:data:`errno` :" +"py:const:`~errno.ESRCH`." +msgstr "" + +msgid "" +"Raised when a system function timed out at the system level. Corresponds to :" +"c:data:`errno` :py:const:`~errno.ETIMEDOUT`." +msgstr "" + +msgid "All the above :exc:`OSError` subclasses were added." +msgstr "Було додано всі наведені вище підкласи :exc:`OSError`." + +msgid ":pep:`3151` - Reworking the OS and IO exception hierarchy" +msgstr ":pep:`3151` - Переробка ієрархії винятків ОС та вводу-виводу" + +msgid "Warnings" +msgstr "Попередження" + +msgid "" +"The following exceptions are used as warning categories; see the :ref:" +"`warning-categories` documentation for more details." +msgstr "" +"Наступні винятки використовуються як категорії попереджень; подробиці " +"дивіться в документації :ref:`warning-categories`." + +msgid "Base class for warning categories." +msgstr "Базовий клас для категорій попереджень." + +msgid "Base class for warnings generated by user code." +msgstr "Базовий клас для попереджень, створених кодом користувача." + +msgid "" +"Base class for warnings about deprecated features when those warnings are " +"intended for other Python developers." +msgstr "" +"Базовий клас для попереджень про застарілі функції, якщо ці попередження " +"призначені для інших розробників Python." + +msgid "" +"Ignored by the default warning filters, except in the ``__main__`` module (:" +"pep:`565`). Enabling the :ref:`Python Development Mode ` shows this " +"warning." +msgstr "" +"Ігнорується стандартними фільтрами попереджень, окрім модуля ``__main__`` (:" +"pep:`565`). Увімкнення режиму :ref:`Python Development Mode ` " +"показує це попередження." + +msgid "The deprecation policy is described in :pep:`387`." +msgstr "Політика припинення підтримки описана в :pep:`387`." + +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 "" +"Базовий клас для попереджень про функції, які є застарілими та які, як " +"очікується, будуть застарілими в майбутньому, але наразі не застаріли." + +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 "" +"Цей клас рідко використовується, оскільки випромінювання попередження про " +"можливе припинення підтримки є незвичним, а :exc:`DeprecationWarning` є " +"кращим для вже активних застарілих функцій." + +msgid "" +"Ignored by the default warning filters. Enabling the :ref:`Python " +"Development Mode ` shows this warning." +msgstr "" +"Ігнорується стандартними фільтрами попереджень. Увімкнення режиму :ref:" +"`Python Development Mode ` показує це попередження." + +msgid "Base class for warnings about dubious syntax." +msgstr "Базовий клас для попереджень про сумнівний синтаксис." + +msgid "Base class for warnings about dubious runtime behavior." +msgstr "Базовий клас для попереджень про сумнівну поведінку під час виконання." + +msgid "" +"Base class for warnings about deprecated features when those warnings are " +"intended for end users of applications that are written in Python." +msgstr "" +"Базовий клас для попереджень про застарілі функції, якщо ці попередження " +"призначені для кінцевих користувачів програм, написаних на Python." + +msgid "Base class for warnings about probable mistakes in module imports." +msgstr "Базовий клас для попереджень про можливі помилки при імпорті модуля." + +msgid "Base class for warnings related to Unicode." +msgstr "Базовий клас для попереджень, пов’язаних із Unicode." + +msgid "Base class for warnings related to encodings." +msgstr "Базовий клас для попереджень щодо кодувань." + +msgid "See :ref:`io-encoding-warning` for details." +msgstr "Дивіться :ref:`io-encoding-warning` для деталей." + +msgid "" +"Base class for warnings related to :class:`bytes` and :class:`bytearray`." +msgstr "" +"Базовий клас для попереджень, пов’язаних із :class:`bytes` і :class:" +"`bytearray`." + +msgid "Base class for warnings related to resource usage." +msgstr "Базовий клас для попереджень щодо використання ресурсів." + +msgid "Exception groups" +msgstr "" + +msgid "" +"The following are used when it is necessary to raise multiple unrelated " +"exceptions. They are part of the exception hierarchy so they can be handled " +"with :keyword:`except` like all other exceptions. In addition, they are " +"recognised by :keyword:`except*`, which matches their subgroups " +"based on the types of the contained exceptions." +msgstr "" + +msgid "" +"Both of these exception types wrap the exceptions in the sequence ``excs``. " +"The ``msg`` parameter must be a string. The difference between the two " +"classes is that :exc:`BaseExceptionGroup` extends :exc:`BaseException` and " +"it can wrap any exception, while :exc:`ExceptionGroup` extends :exc:" +"`Exception` and it can only wrap subclasses of :exc:`Exception`. This design " +"is so that ``except Exception`` catches an :exc:`ExceptionGroup` but not :" +"exc:`BaseExceptionGroup`." +msgstr "" + +msgid "" +"The :exc:`BaseExceptionGroup` constructor returns an :exc:`ExceptionGroup` " +"rather than a :exc:`BaseExceptionGroup` if all contained exceptions are :exc:" +"`Exception` instances, so it can be used to make the selection automatic. " +"The :exc:`ExceptionGroup` constructor, on the other hand, raises a :exc:" +"`TypeError` if any contained exception is not an :exc:`Exception` subclass." +msgstr "" + +msgid "The ``msg`` argument to the constructor. This is a read-only attribute." +msgstr "" + +msgid "" +"A tuple of the exceptions in the ``excs`` sequence given to the constructor. " +"This is a read-only attribute." +msgstr "" + +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 "" + +msgid "" +"The condition can be an exception type or tuple of exception types, in which " +"case each exception is checked for a match using the same check that is used " +"in an ``except`` clause. The condition can also be a callable (other than a " +"type object) that accepts an exception as its single argument and returns " +"true for the exceptions that should be in the subgroup." +msgstr "" + +msgid "" +"The nesting structure of the current exception is preserved in the result, " +"as are the values of its :attr:`message`, :attr:`~BaseException." +"__traceback__`, :attr:`~BaseException.__cause__`, :attr:`~BaseException." +"__context__` and :attr:`~BaseException.__notes__` fields. Empty nested " +"groups are omitted from the result." +msgstr "" + +msgid "" +"The condition is checked for all exceptions in the nested exception group, " +"including the top-level and any nested exception groups. If the condition is " +"true for such an exception group, it is included in the result in full." +msgstr "" + +msgid "``condition`` can be any callable which is not a type object." +msgstr "" + +msgid "" +"Like :meth:`subgroup`, but returns the pair ``(match, rest)`` where " +"``match`` is ``subgroup(condition)`` and ``rest`` is the remaining non-" +"matching part." +msgstr "" + +msgid "" +"Returns an exception group with the same :attr:`message`, but which wraps " +"the exceptions in ``excs``." +msgstr "" + +msgid "" +"This method is used by :meth:`subgroup` and :meth:`split`, which are used in " +"various contexts to break up an exception group. A subclass needs to " +"override it in order to make :meth:`subgroup` and :meth:`split` return " +"instances of the subclass rather than :exc:`ExceptionGroup`." +msgstr "" + +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 "" + +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 "" + +msgid "" +"Note that :exc:`BaseExceptionGroup` defines :meth:`~object.__new__`, so " +"subclasses that need a different constructor signature need to override that " +"rather than :meth:`~object.__init__`. For example, the following defines an " +"exception group subclass which accepts an exit_code and and constructs the " +"group's message from it. ::" +msgstr "" + +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 "" + +msgid "" +"Like :exc:`ExceptionGroup`, any subclass of :exc:`BaseExceptionGroup` which " +"is also a subclass of :exc:`Exception` can only wrap instances of :exc:" +"`Exception`." +msgstr "" + +msgid "Exception hierarchy" +msgstr "Ієрархія винятків" + +msgid "The class hierarchy for built-in exceptions is:" +msgstr "Ієрархія класів для вбудованих винятків така:" + +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 "" + +msgid "statement" +msgstr "заява" + +msgid "try" +msgstr "" + +msgid "except" +msgstr "" + +msgid "raise" +msgstr "" + +msgid "exception" +msgstr "" + +msgid "chaining" +msgstr "" + +msgid "__cause__ (exception attribute)" +msgstr "" + +msgid "__context__ (exception attribute)" +msgstr "" + +msgid "__suppress_context__ (exception attribute)" +msgstr "" + +msgid "assert" +msgstr "" + +msgid "module" +msgstr "модуль" + +msgid "errno" +msgstr "" diff --git a/library/faulthandler.po b/library/faulthandler.po new file mode 100644 index 000000000..cf2d280d2 --- /dev/null +++ b/library/faulthandler.po @@ -0,0 +1,278 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 01:05+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!faulthandler` --- Dump the Python traceback" +msgstr "" + +msgid "" +"This module contains functions to dump Python tracebacks explicitly, on a " +"fault, after a timeout, or on a user signal. Call :func:`faulthandler." +"enable` to install fault handlers for the :const:`~signal.SIGSEGV`, :const:" +"`~signal.SIGFPE`, :const:`~signal.SIGABRT`, :const:`~signal.SIGBUS`, and :" +"const:`~signal.SIGILL` signals. You can also enable them at startup by " +"setting the :envvar:`PYTHONFAULTHANDLER` environment variable or by using " +"the :option:`-X` ``faulthandler`` command line option." +msgstr "" + +msgid "" +"The fault handler is compatible with system fault handlers like Apport or " +"the Windows fault handler. The module uses an alternative stack for signal " +"handlers if the :c:func:`!sigaltstack` function is available. This allows it " +"to dump the traceback even on a stack overflow." +msgstr "" + +msgid "" +"The fault handler is called on catastrophic cases and therefore can only use " +"signal-safe functions (e.g. it cannot allocate memory on the heap). Because " +"of this limitation traceback dumping is minimal compared to normal Python " +"tracebacks:" +msgstr "" +"Обробник помилок викликається в катастрофічних випадках і тому може " +"використовувати лише безпечні для сигналу функції (наприклад, він не може " +"виділяти пам’ять у купі). Через це обмеження дамп зворотного відстеження " +"мінімальний порівняно зі звичайним відстеженням Python:" + +msgid "" +"Only ASCII is supported. The ``backslashreplace`` error handler is used on " +"encoding." +msgstr "" +"Підтримується лише ASCII. Під час кодування використовується обробник " +"помилок ``backslashreplace``." + +msgid "Each string is limited to 500 characters." +msgstr "Довжина кожного рядка обмежена 500 символами." + +msgid "" +"Only the filename, the function name and the line number are displayed. (no " +"source code)" +msgstr "" +"Відображаються лише назва файлу, назва функції та номер рядка. (без " +"вихідного коду)" + +msgid "It is limited to 100 frames and 100 threads." +msgstr "Він обмежений 100 кадрами та 100 потоками." + +msgid "The order is reversed: the most recent call is shown first." +msgstr "Порядок зворотний: останній виклик відображається першим." + +msgid "" +"By default, the Python traceback is written to :data:`sys.stderr`. To see " +"tracebacks, applications must be run in the terminal. A log file can " +"alternatively be passed to :func:`faulthandler.enable`." +msgstr "" +"За замовчуванням відстеження Python записується в :data:`sys.stderr`. Щоб " +"побачити відстеження, програми мають бути запущені в терміналі. Файл журналу " +"також можна передати до :func:`faulthandler.enable`." + +msgid "" +"The module is implemented in C, so tracebacks can be dumped on a crash or " +"when Python is deadlocked." +msgstr "" +"Модуль реалізовано на C, тому трасування можна скинути під час збою або коли " +"Python заблоковано." + +msgid "" +"The :ref:`Python Development Mode ` calls :func:`faulthandler." +"enable` at Python startup." +msgstr "" +":ref:`Режим розробки Python ` викликає :func:`faulthandler.enable` " +"під час запуску Python." + +msgid "Module :mod:`pdb`" +msgstr "" + +msgid "Interactive source code debugger for Python programs." +msgstr "" + +msgid "Module :mod:`traceback`" +msgstr "" + +msgid "" +"Standard interface to extract, format and print stack traces of Python " +"programs." +msgstr "" + +msgid "Dumping the traceback" +msgstr "Викидання трасування" + +msgid "" +"Dump the tracebacks of all threads into *file*. If *all_threads* is " +"``False``, dump only the current thread." +msgstr "" +"Дамп трасування всіх потоків у *файл*. Якщо *all_threads* має значення " +"``False``, створювати дамп лише поточного потоку." + +msgid "" +":func:`traceback.print_tb`, which can be used to print a traceback object." +msgstr "" + +msgid "Added support for passing file descriptor to this function." +msgstr "Додано підтримку для передачі дескриптора файлу в цю функцію." + +msgid "Fault handler state" +msgstr "Стан обробника помилок" + +msgid "" +"Enable the fault handler: install handlers for the :const:`~signal." +"SIGSEGV`, :const:`~signal.SIGFPE`, :const:`~signal.SIGABRT`, :const:`~signal." +"SIGBUS` and :const:`~signal.SIGILL` signals to dump the Python traceback. If " +"*all_threads* is ``True``, produce tracebacks for every running thread. " +"Otherwise, dump only the current thread." +msgstr "" + +msgid "" +"The *file* must be kept open until the fault handler is disabled: see :ref:" +"`issue with file descriptors `." +msgstr "" +"*Файл* має бути відкритим, доки обробник помилок не буде вимкнено: див. :ref:" +"`проблему з дескрипторами файлів `." + +msgid "On Windows, a handler for Windows exception is also installed." +msgstr "У Windows також встановлено обробник винятків Windows." + +msgid "" +"The dump now mentions if a garbage collector collection is running if " +"*all_threads* is true." +msgstr "" +"Дамп тепер згадує, чи запущено збирач сміття, якщо *all_threads* має " +"значення true." + +msgid "" +"Disable the fault handler: uninstall the signal handlers installed by :func:" +"`enable`." +msgstr "" +"Вимкніть обробник помилок: видаліть обробники сигналів, встановлені :func:" +"`enable`." + +msgid "Check if the fault handler is enabled." +msgstr "Перевірте, чи ввімкнено обробник помилок." + +msgid "Dumping the tracebacks after a timeout" +msgstr "Викидання трасування після тайм-ауту" + +msgid "" +"Dump the tracebacks of all threads, after a timeout of *timeout* seconds, or " +"every *timeout* seconds if *repeat* is ``True``. If *exit* is ``True``, " +"call :c:func:`!_exit` with status=1 after dumping the tracebacks. (Note :c:" +"func:`!_exit` exits the process immediately, which means it doesn't do any " +"cleanup like flushing file buffers.) If the function is called twice, the " +"new call replaces previous parameters and resets the timeout. The timer has " +"a sub-second resolution." +msgstr "" + +msgid "" +"The *file* must be kept open until the traceback is dumped or :func:" +"`cancel_dump_traceback_later` is called: see :ref:`issue with file " +"descriptors `." +msgstr "" +"*Файл* має залишатися відкритим, доки не буде створено дамп трасування або :" +"func:`cancel_dump_traceback_later`: див. :ref:`проблему з дескрипторами " +"файлів `." + +msgid "This function is implemented using a watchdog thread." +msgstr "Ця функція реалізована за допомогою сторожового потоку." + +msgid "This function is now always available." +msgstr "Тепер ця функція доступна завжди." + +msgid "Cancel the last call to :func:`dump_traceback_later`." +msgstr "Скасувати останній виклик :func:`dump_traceback_later`." + +msgid "Dumping the traceback on a user signal" +msgstr "Скидання зворотного відстеження за сигналом користувача" + +msgid "" +"Register a user signal: install a handler for the *signum* signal to dump " +"the traceback of all threads, or of the current thread if *all_threads* is " +"``False``, into *file*. Call the previous handler if chain is ``True``." +msgstr "" +"Зареєструйте сигнал користувача: встановіть обробник для сигналу *signum*, " +"щоб скинути зворотне трасування всіх потоків або поточного потоку, якщо " +"*all_threads* має значення ``False``, у *файл*. Викликати попередній " +"обробник, якщо ланцюжок має значення ``True``." + +msgid "" +"The *file* must be kept open until the signal is unregistered by :func:" +"`unregister`: see :ref:`issue with file descriptors `." +msgstr "" +"*Файл* має залишатися відкритим, доки сигнал не буде скасовано :func:" +"`unregister`: див. :ref:`проблему з дескрипторами файлів `." + +msgid "Not available on Windows." +msgstr "Недоступно в Windows." + +msgid "" +"Unregister a user signal: uninstall the handler of the *signum* signal " +"installed by :func:`register`. Return ``True`` if the signal was registered, " +"``False`` otherwise." +msgstr "" +"Скасувати реєстрацію сигналу користувача: видалити обробник сигналу " +"*signum*, встановлений :func:`register`. Повертає ``True``, якщо сигнал був " +"зареєстрований, ``False`` інакше." + +msgid "Issue with file descriptors" +msgstr "Проблема з дескрипторами файлів" + +msgid "" +":func:`enable`, :func:`dump_traceback_later` and :func:`register` keep the " +"file descriptor of their *file* argument. If the file is closed and its file " +"descriptor is reused by a new file, or if :func:`os.dup2` is used to replace " +"the file descriptor, the traceback will be written into a different file. " +"Call these functions again each time that the file is replaced." +msgstr "" +":func:`enable`, :func:`dump_traceback_later` і :func:`register` зберігають " +"файловий дескриптор свого аргументу *file*. Якщо файл закрито і його " +"файловий дескриптор повторно використовується в новому файлі, або якщо :func:" +"`os.dup2` використовується для заміни файлового дескриптора, трасування буде " +"записане в інший файл. Викликайте ці функції знову щоразу, коли файл " +"замінюється." + +msgid "Example" +msgstr "приклад" + +msgid "" +"Example of a segmentation fault on Linux with and without enabling the fault " +"handler:" +msgstr "" +"Приклад помилки сегментації в Linux із увімкненням і без увімкнення " +"обробника помилок:" + +msgid "" +"$ python -c \"import ctypes; ctypes.string_at(0)\"\n" +"Segmentation fault\n" +"\n" +"$ python -q -X faulthandler\n" +">>> import ctypes\n" +">>> ctypes.string_at(0)\n" +"Fatal Python error: Segmentation fault\n" +"\n" +"Current thread 0x00007fb899f39700 (most recent call first):\n" +" File \"/home/python/cpython/Lib/ctypes/__init__.py\", line 486 in " +"string_at\n" +" File \"\", line 1 in \n" +"Segmentation fault" +msgstr "" diff --git a/library/fcntl.po b/library/fcntl.po new file mode 100644 index 000000000..725278e34 --- /dev/null +++ b/library/fcntl.po @@ -0,0 +1,364 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 01:06+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!fcntl` --- The ``fcntl`` and ``ioctl`` system calls" +msgstr "" + +msgid "" +"This module performs file and I/O control on file descriptors. It is an " +"interface to the :c:func:`fcntl` and :c:func:`ioctl` Unix routines. See the :" +"manpage:`fcntl(2)` and :manpage:`ioctl(2)` Unix manual pages for full " +"details." +msgstr "" + +msgid "Availability" +msgstr "" + +msgid "" +"All functions in this module take a file descriptor *fd* as their first " +"argument. This can be an integer file descriptor, such as returned by ``sys." +"stdin.fileno()``, or an :class:`io.IOBase` object, such as ``sys.stdin`` " +"itself, which provides a :meth:`~io.IOBase.fileno` that returns a genuine " +"file descriptor." +msgstr "" +"Усі функції в цьому модулі приймають файловий дескриптор *fd* як перший " +"аргумент. Це може бути цілочисельний файловий дескриптор, наприклад, " +"повернутий ``sys.stdin.fileno()``, або об’єкт :class:`io.IOBase`, як-от сам " +"``sys.stdin``, який надає :meth:`~io.IOBase.fileno`, який повертає справжній " +"дескриптор файлу." + +msgid "" +"Operations in this module used to raise an :exc:`IOError` where they now " +"raise an :exc:`OSError`." +msgstr "" +"Раніше операції в цьому модулі викликали :exc:`IOError`, а тепер вони " +"викликають :exc:`OSError`." + +msgid "" +"The :mod:`!fcntl` module now contains ``F_ADD_SEALS``, ``F_GET_SEALS``, and " +"``F_SEAL_*`` constants for sealing of :func:`os.memfd_create` file " +"descriptors." +msgstr "" + +msgid "" +"On macOS, the :mod:`!fcntl` module exposes the ``F_GETPATH`` constant, which " +"obtains the path of a file from a file descriptor. On Linux(>=3.15), the :" +"mod:`!fcntl` module exposes the ``F_OFD_GETLK``, ``F_OFD_SETLK`` and " +"``F_OFD_SETLKW`` constants, which are used when working with open file " +"description locks." +msgstr "" + +msgid "" +"On Linux >= 2.6.11, the :mod:`!fcntl` module exposes the ``F_GETPIPE_SZ`` " +"and ``F_SETPIPE_SZ`` constants, which allow to check and modify a pipe's " +"size respectively." +msgstr "" + +msgid "" +"On FreeBSD, the :mod:`!fcntl` module exposes the ``F_DUP2FD`` and " +"``F_DUP2FD_CLOEXEC`` constants, which allow to duplicate a file descriptor, " +"the latter setting ``FD_CLOEXEC`` flag in addition." +msgstr "" + +msgid "" +"On Linux >= 4.5, the :mod:`fcntl` module exposes the ``FICLONE`` and " +"``FICLONERANGE`` constants, which allow to share some data of one file with " +"another file by reflinking on some filesystems (e.g., btrfs, OCFS2, and " +"XFS). This behavior is commonly referred to as \"copy-on-write\"." +msgstr "" + +msgid "" +"On Linux >= 2.6.32, the :mod:`!fcntl` module exposes the ``F_GETOWN_EX``, " +"``F_SETOWN_EX``, ``F_OWNER_TID``, ``F_OWNER_PID``, ``F_OWNER_PGRP`` " +"constants, which allow to direct I/O availability signals to a specific " +"thread, process, or process group. On Linux >= 4.13, the :mod:`!fcntl` " +"module exposes the ``F_GET_RW_HINT``, ``F_SET_RW_HINT``, " +"``F_GET_FILE_RW_HINT``, ``F_SET_FILE_RW_HINT``, and ``RWH_WRITE_LIFE_*`` " +"constants, which allow to inform the kernel about the relative expected " +"lifetime of writes on a given inode or via a particular open file " +"description. On Linux >= 5.1 and NetBSD, the :mod:`!fcntl` module exposes " +"the ``F_SEAL_FUTURE_WRITE`` constant for use with ``F_ADD_SEALS`` and " +"``F_GET_SEALS`` operations. On FreeBSD, the :mod:`!fcntl` module exposes the " +"``F_READAHEAD``, ``F_ISUNIONSTACK``, and ``F_KINFO`` constants. On macOS and " +"FreeBSD, the :mod:`!fcntl` module exposes the ``F_RDAHEAD`` constant. On " +"NetBSD and AIX, the :mod:`!fcntl` module exposes the ``F_CLOSEM`` constant. " +"On NetBSD, the :mod:`!fcntl` module exposes the ``F_MAXFD`` constant. On " +"macOS and NetBSD, the :mod:`!fcntl` module exposes the ``F_GETNOSIGPIPE`` " +"and ``F_SETNOSIGPIPE`` constant." +msgstr "" + +msgid "The module defines the following functions:" +msgstr "Модуль визначає такі функції:" + +msgid "" +"Perform the operation *cmd* on file descriptor *fd* (file objects providing " +"a :meth:`~io.IOBase.fileno` method are accepted as well). The values used " +"for *cmd* are operating system dependent, and are available as constants in " +"the :mod:`fcntl` module, using the same names as used in the relevant C " +"header files. The argument *arg* can either be an integer value, a :class:" +"`bytes` object, or a string. The type and size of *arg* must match the type " +"and size of the argument of the operation as specified in the relevant C " +"documentation." +msgstr "" + +msgid "" +"When *arg* is an integer, the function returns the integer return value of " +"the C :c:func:`fcntl` call." +msgstr "" + +msgid "" +"When the argument is bytes, it represents a binary structure, for example, " +"created by :func:`struct.pack`. A string value is encoded to binary using " +"the UTF-8 encoding. The binary data is copied to a buffer whose address is " +"passed to the C :c:func:`fcntl` call. The return value after a successful " +"call is the contents of the buffer, converted to a :class:`bytes` object. " +"The length of the returned object will be the same as the length of the " +"*arg* argument. This is limited to 1024 bytes." +msgstr "" + +msgid "If the :c:func:`fcntl` call fails, an :exc:`OSError` is raised." +msgstr "" + +msgid "" +"If the type or the size of *arg* does not match the type or size of the " +"argument of the operation (for example, if an integer is passed when a " +"pointer is expected, or the information returned in the buffer by the " +"operating system is larger than 1024 bytes), this is most likely to result " +"in a segmentation violation or a more subtle data corruption." +msgstr "" + +msgid "" +"Raises an :ref:`auditing event ` ``fcntl.fcntl`` with arguments " +"``fd``, ``cmd``, ``arg``." +msgstr "" +"Викликає :ref:`подію аудиту ` ``fcntl.fcntl`` з аргументами " +"``fd``, ``cmd``, ``arg``." + +msgid "" +"This function is identical to the :func:`~fcntl.fcntl` function, except that " +"the argument handling is even more complicated." +msgstr "" +"Ця функція ідентична функції :func:`~fcntl.fcntl`, за винятком того, що " +"обробка аргументів ще складніша." + +msgid "" +"The *request* parameter is limited to values that can fit in 32-bits or 64-" +"bits, depending on the platform. Additional constants of interest for use as " +"the *request* argument can be found in the :mod:`termios` module, under the " +"same names as used in the relevant C header files." +msgstr "" + +msgid "" +"The parameter *arg* can be an integer, a :term:`bytes-like object`, or a " +"string. The type and size of *arg* must match the type and size of the " +"argument of the operation as specified in the relevant C documentation." +msgstr "" + +msgid "" +"If *arg* does not support the read-write buffer interface or the " +"*mutate_flag* is false, behavior is as for the :func:`~fcntl.fcntl` function." +msgstr "" + +msgid "" +"If *arg* supports the read-write buffer interface (like :class:`bytearray`) " +"and *mutate_flag* is true (the default), then the buffer is (in effect) " +"passed to the underlying :c:func:`!ioctl` system call, the latter's return " +"code is passed back to the calling Python, and the buffer's new contents " +"reflect the action of the :c:func:`ioctl`. This is a slight simplification, " +"because if the supplied buffer is less than 1024 bytes long it is first " +"copied into a static buffer 1024 bytes long which is then passed to :func:" +"`ioctl` and copied back into the supplied buffer." +msgstr "" + +msgid "" +"If the :c:func:`ioctl` call fails, an :exc:`OSError` exception is raised." +msgstr "" + +msgid "" +"If the type or size of *arg* does not match the type or size of the " +"operation's argument (for example, if an integer is passed when a pointer is " +"expected, or the information returned in the buffer by the operating system " +"is larger than 1024 bytes, or the size of the mutable bytes-like object is " +"too small), this is most likely to result in a segmentation violation or a " +"more subtle data corruption." +msgstr "" + +msgid "An example::" +msgstr "Приклад::" + +msgid "" +">>> import array, fcntl, struct, termios, os\n" +">>> os.getpgrp()\n" +"13341\n" +">>> struct.unpack('h', fcntl.ioctl(0, termios.TIOCGPGRP, \" \"))[0]\n" +"13341\n" +">>> buf = array.array('h', [0])\n" +">>> fcntl.ioctl(0, termios.TIOCGPGRP, buf, 1)\n" +"0\n" +">>> buf\n" +"array('h', [13341])" +msgstr "" + +msgid "" +"Raises an :ref:`auditing event ` ``fcntl.ioctl`` with arguments " +"``fd``, ``request``, ``arg``." +msgstr "" +"Викликає :ref:`подію аудиту ` ``fcntl.ioctl`` з аргументами " +"``fd``, ``request``, ``arg``." + +msgid "" +"Perform the lock operation *operation* on file descriptor *fd* (file objects " +"providing a :meth:`~io.IOBase.fileno` method are accepted as well). See the " +"Unix manual :manpage:`flock(2)` for details. (On some systems, this " +"function is emulated using :c:func:`fcntl`.)" +msgstr "" +"Виконайте операцію блокування *operation* для файлового дескриптора *fd* " +"(також приймаються файлові об’єкти, що містять метод :meth:`~io.IOBase." +"fileno`). Перегляньте посібник Unix :manpage:`flock(2)` для отримання " +"детальної інформації. (У деяких системах ця функція емулюється за допомогою :" +"c:func:`fcntl`.)" + +msgid "" +"If the :c:func:`flock` call fails, an :exc:`OSError` exception is raised." +msgstr "" + +msgid "" +"Raises an :ref:`auditing event ` ``fcntl.flock`` with arguments " +"``fd``, ``operation``." +msgstr "" +"Викликає :ref:`подію аудиту ` ``fcntl.flock`` з аргументами " +"``fd``, ``operation``." + +msgid "" +"This is essentially a wrapper around the :func:`~fcntl.fcntl` locking calls. " +"*fd* is the file descriptor (file objects providing a :meth:`~io.IOBase." +"fileno` method are accepted as well) of the file to lock or unlock, and " +"*cmd* is one of the following values:" +msgstr "" +"По суті, це обгортка викликів блокування :func:`~fcntl.fcntl`. *fd* — це " +"дескриптор файлу (також приймаються об’єкти файлу, що містять метод :meth:" +"`~io.IOBase.fileno`) файлу, який потрібно заблокувати або розблокувати, а " +"*cmd* — одне з таких значень:" + +msgid "Release an existing lock." +msgstr "" + +msgid "Acquire a shared lock." +msgstr "" + +msgid "Acquire an exclusive lock." +msgstr "" + +msgid "" +"Bitwise OR with any of the other three ``LOCK_*`` constants to make the " +"request non-blocking." +msgstr "" + +msgid "" +"If :const:`!LOCK_NB` is used and the lock cannot be acquired, an :exc:" +"`OSError` will be raised and the exception will have an *errno* attribute " +"set to :const:`~errno.EACCES` or :const:`~errno.EAGAIN` (depending on the " +"operating system; for portability, check for both values). On at least some " +"systems, :const:`!LOCK_EX` can only be used if the file descriptor refers to " +"a file opened for writing." +msgstr "" + +msgid "" +"*len* is the number of bytes to lock, *start* is the byte offset at which " +"the lock starts, relative to *whence*, and *whence* is as with :func:`io." +"IOBase.seek`, specifically:" +msgstr "" +"*len* — це кількість байтів для блокування, *start* — зсув у байтах, з якого " +"починається блокування, відносно *whence*, а *whence* — як у :func:`io." +"IOBase.seek`, зокрема:" + +msgid "``0`` -- relative to the start of the file (:const:`os.SEEK_SET`)" +msgstr "" + +msgid "``1`` -- relative to the current buffer position (:const:`os.SEEK_CUR`)" +msgstr "" + +msgid "``2`` -- relative to the end of the file (:const:`os.SEEK_END`)" +msgstr "" + +msgid "" +"The default for *start* is 0, which means to start at the beginning of the " +"file. The default for *len* is 0 which means to lock to the end of the " +"file. The default for *whence* is also 0." +msgstr "" +"Типовим значенням для *початку* є 0, що означає початок на початку файлу. " +"Типовим значенням для *len* є 0, що означає блокування до кінця файлу. За " +"замовчуванням для *whence* також дорівнює 0." + +msgid "" +"Raises an :ref:`auditing event ` ``fcntl.lockf`` with arguments " +"``fd``, ``cmd``, ``len``, ``start``, ``whence``." +msgstr "" +"Викликає :ref:`подію аудиту ` ``fcntl.lockf`` з аргументами " +"``fd``, ``cmd``, ``len``, ``start``, ``whence``." + +msgid "Examples (all on a SVR4 compliant system)::" +msgstr "Приклади (усі в системі, сумісній з SVR4):" + +msgid "" +"import struct, fcntl, os\n" +"\n" +"f = open(...)\n" +"rv = fcntl.fcntl(f, fcntl.F_SETFL, os.O_NDELAY)\n" +"\n" +"lockdata = struct.pack('hhllhh', fcntl.F_WRLCK, 0, 0, 0, 0, 0)\n" +"rv = fcntl.fcntl(f, fcntl.F_SETLKW, lockdata)" +msgstr "" + +msgid "" +"Note that in the first example the return value variable *rv* will hold an " +"integer value; in the second example it will hold a :class:`bytes` object. " +"The structure lay-out for the *lockdata* variable is system dependent --- " +"therefore using the :func:`flock` call may be better." +msgstr "" +"Зверніть увагу, що в першому прикладі змінна *rv* буде мати ціле значення; у " +"другому прикладі він буде містити об’єкт :class:`bytes`. Схема структури для " +"змінної *lockdata* залежить від системи --- тому використання виклику :func:" +"`flock` може бути кращим." + +msgid "Module :mod:`os`" +msgstr "Модуль :mod:`os`" + +msgid "" +"If the locking flags :const:`~os.O_SHLOCK` and :const:`~os.O_EXLOCK` are " +"present in the :mod:`os` module (on BSD only), the :func:`os.open` function " +"provides an alternative to the :func:`lockf` and :func:`flock` functions." +msgstr "" + +msgid "UNIX" +msgstr "" + +msgid "file control" +msgstr "" + +msgid "I/O control" +msgstr "" diff --git a/library/filecmp.po b/library/filecmp.po new file mode 100644 index 000000000..5832e0726 --- /dev/null +++ b/library/filecmp.po @@ -0,0 +1,272 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 01:06+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!filecmp` --- File and Directory Comparisons" +msgstr "" + +msgid "**Source code:** :source:`Lib/filecmp.py`" +msgstr "**Вихідний код:** :source:`Lib/filecmp.py`" + +msgid "" +"The :mod:`filecmp` module defines functions to compare files and " +"directories, with various optional time/correctness trade-offs. For " +"comparing files, see also the :mod:`difflib` module." +msgstr "" +"Модуль :mod:`filecmp` визначає функції для порівняння файлів і каталогів із " +"різними необов’язковими компромісами між часом і правильністю. Для " +"порівняння файлів див. також модуль :mod:`difflib`." + +msgid "The :mod:`filecmp` module defines the following functions:" +msgstr "Модуль :mod:`filecmp` визначає такі функції:" + +msgid "" +"Compare the files named *f1* and *f2*, returning ``True`` if they seem " +"equal, ``False`` otherwise." +msgstr "" +"Порівняйте файли з іменами *f1* і *f2*, повертаючи ``True``, якщо вони " +"здаються однаковими, ``False`` інакше." + +msgid "" +"If *shallow* is true and the :func:`os.stat` signatures (file type, size, " +"and modification time) of both files are identical, the files are taken to " +"be equal." +msgstr "" +"Якщо *shallow* має значення true і сигнатури :func:`os.stat` (тип файлу, " +"розмір і час модифікації) обох файлів ідентичні, файли вважаються однаковими." + +msgid "" +"Otherwise, the files are treated as different if their sizes or contents " +"differ." +msgstr "" +"В іншому випадку файли розглядаються як різні, якщо їхні розміри або вміст " +"відрізняються." + +msgid "" +"Note that no external programs are called from this function, giving it " +"portability and efficiency." +msgstr "" +"Зауважте, що жодні зовнішні програми не викликаються з цієї функції, що " +"забезпечує її переносимість та ефективність." + +msgid "" +"This function uses a cache for past comparisons and the results, with cache " +"entries invalidated if the :func:`os.stat` information for the file " +"changes. The entire cache may be cleared using :func:`clear_cache`." +msgstr "" +"Ця функція використовує кеш для попередніх порівнянь і результатів, при " +"цьому записи кешу стають недійсними, якщо інформація :func:`os.stat` для " +"файлу змінюється. Весь кеш можна очистити за допомогою :func:`clear_cache`." + +msgid "" +"Compare the files in the two directories *dir1* and *dir2* whose names are " +"given by *common*." +msgstr "" +"Порівняйте файли у двох каталогах *dir1* і *dir2*, імена яких задані " +"*common*." + +msgid "" +"Returns three lists of file names: *match*, *mismatch*, *errors*. *match* " +"contains the list of files that match, *mismatch* contains the names of " +"those that don't, and *errors* lists the names of files which could not be " +"compared. Files are listed in *errors* if they don't exist in one of the " +"directories, the user lacks permission to read them or if the comparison " +"could not be done for some other reason." +msgstr "" +"Повертає три списки імен файлів: *збіг*, *невідповідність*, *помилки*. " +"*match* містить список файлів, які збігаються, *mismatch* містить імена тих, " +"які не відповідають, а *errors* містить імена файлів, які не вдалося " +"порівняти. Файли перераховуються в *помилках*, якщо вони не існують в одному " +"з каталогів, у користувача немає дозволу на їх читання або якщо порівняння " +"не вдалося виконати з іншої причини." + +msgid "" +"The *shallow* parameter has the same meaning and default value as for :func:" +"`filecmp.cmp`." +msgstr "" +"Параметр *shallow* має те саме значення та значення за замовчуванням, що й " +"для :func:`filecmp.cmp`." + +msgid "" +"For example, ``cmpfiles('a', 'b', ['c', 'd/e'])`` will compare ``a/c`` with " +"``b/c`` and ``a/d/e`` with ``b/d/e``. ``'c'`` and ``'d/e'`` will each be in " +"one of the three returned lists." +msgstr "" +"Наприклад, ``cmpfiles('a', 'b', ['c', 'd/e'])`` порівнює ``a/c`` з ``b/c`` і " +"``a /d/e`` з ``b/d/e``. ``'c'`` і ``'d/e'`` будуть кожен в одному з трьох " +"повернутих списків." + +msgid "" +"Clear the filecmp cache. This may be useful if a file is compared so quickly " +"after it is modified that it is within the mtime resolution of the " +"underlying filesystem." +msgstr "" +"Очистіть кеш filecmp. Це може бути корисним, якщо файл порівнюється " +"настільки швидко після його модифікації, що він знаходиться в межах дозволу " +"mtime основної файлової системи." + +msgid "The :class:`dircmp` class" +msgstr "Клас :class:`dircmp`" + +msgid "" +"Construct a new directory comparison object, to compare the directories *a* " +"and *b*. *ignore* is a list of names to ignore, and defaults to :const:" +"`filecmp.DEFAULT_IGNORES`. *hide* is a list of names to hide, and defaults " +"to ``[os.curdir, os.pardir]``." +msgstr "" + +msgid "" +"The :class:`dircmp` class compares files by doing *shallow* comparisons as " +"described for :func:`filecmp.cmp` by default using the *shallow* parameter." +msgstr "" + +msgid "Added the *shallow* parameter." +msgstr "" + +msgid "The :class:`dircmp` class provides the following methods:" +msgstr "Клас :class:`dircmp` надає такі методи:" + +msgid "Print (to :data:`sys.stdout`) a comparison between *a* and *b*." +msgstr "Вивести (у :data:`sys.stdout`) порівняння між *a* і *b*." + +msgid "" +"Print a comparison between *a* and *b* and common immediate subdirectories." +msgstr "" +"Надрукуйте порівняння між *a* і *b* та загальними безпосередніми " +"підкаталогами." + +msgid "" +"Print a comparison between *a* and *b* and common subdirectories " +"(recursively)." +msgstr "" +"Вивести порівняння між *a* і *b* та загальними підкаталогами (рекурсивно)." + +msgid "" +"The :class:`dircmp` class offers a number of interesting attributes that may " +"be used to get various bits of information about the directory trees being " +"compared." +msgstr "" +"Клас :class:`dircmp` пропонує низку цікавих атрибутів, які можна " +"використовувати для отримання різноманітної інформації про порівнювані " +"дерева каталогів." + +msgid "" +"Note that via :meth:`~object.__getattr__` hooks, all attributes are computed " +"lazily, so there is no speed penalty if only those attributes which are " +"lightweight to compute are used." +msgstr "" + +msgid "The directory *a*." +msgstr "Каталог *a*." + +msgid "The directory *b*." +msgstr "Каталог *b*." + +msgid "Files and subdirectories in *a*, filtered by *hide* and *ignore*." +msgstr "" +"Файли та підкаталоги в *a*, відфільтровані за допомогою *hide* та *ignore*." + +msgid "Files and subdirectories in *b*, filtered by *hide* and *ignore*." +msgstr "" +"Файли та підкаталоги в *b*, відфільтровані за допомогою *hide* та *ignore*." + +msgid "Files and subdirectories in both *a* and *b*." +msgstr "Файли та підкаталоги в *a* і *b*." + +msgid "Files and subdirectories only in *a*." +msgstr "Файли та підкаталоги лише в *a*." + +msgid "Files and subdirectories only in *b*." +msgstr "Файли та підкаталоги лише в *b*." + +msgid "Subdirectories in both *a* and *b*." +msgstr "Підкаталоги в *a* і *b*." + +msgid "Files in both *a* and *b*." +msgstr "Файли в *a* і *b*." + +msgid "" +"Names in both *a* and *b*, such that the type differs between the " +"directories, or names for which :func:`os.stat` reports an error." +msgstr "" +"Імена як у *a*, так і в *b*, типи яких відрізняються в різних каталогах, або " +"імена, для яких :func:`os.stat` повідомляє про помилку." + +msgid "" +"Files which are identical in both *a* and *b*, using the class's file " +"comparison operator." +msgstr "" +"Файли, ідентичні як у *a*, так і в *b*, використовуючи оператор порівняння " +"файлів класу." + +msgid "" +"Files which are in both *a* and *b*, whose contents differ according to the " +"class's file comparison operator." +msgstr "" +"Файли, які містяться як у *a*, так і в *b*, вміст яких відрізняється " +"відповідно до оператора порівняння файлів класу." + +msgid "Files which are in both *a* and *b*, but could not be compared." +msgstr "Файли, які знаходяться як у *a*, так і в *b*, але не можна порівняти." + +msgid "" +"A dictionary mapping names in :attr:`common_dirs` to :class:`dircmp` " +"instances (or MyDirCmp instances if this instance is of type MyDirCmp, a " +"subclass of :class:`dircmp`)." +msgstr "" +"Словник, що відображає імена в :attr:`common_dirs` на екземпляри :class:" +"`dircmp` (або екземпляри MyDirCmp, якщо цей екземпляр має тип MyDirCmp, " +"підклас :class:`dircmp`)." + +msgid "" +"Previously entries were always :class:`dircmp` instances. Now entries are " +"the same type as *self*, if *self* is a subclass of :class:`dircmp`." +msgstr "" +"Раніше записи завжди були екземплярами :class:`dircmp`. Тепер записи того " +"самого типу, що й *self*, якщо *self* є підкласом :class:`dircmp`." + +msgid "List of directories ignored by :class:`dircmp` by default." +msgstr "Список каталогів, які :class:`dircmp` ігнорує за умовчанням." + +msgid "" +"Here is a simplified example of using the ``subdirs`` attribute to search " +"recursively through two directories to show common different files::" +msgstr "" +"Ось спрощений приклад використання атрибута ``subdirs`` для рекурсивного " +"пошуку в двох каталогах, щоб показати спільні різні файли::" + +msgid "" +">>> from filecmp import dircmp\n" +">>> def print_diff_files(dcmp):\n" +"... for name in dcmp.diff_files:\n" +"... print(\"diff_file %s found in %s and %s\" % (name, dcmp.left,\n" +"... dcmp.right))\n" +"... for sub_dcmp in dcmp.subdirs.values():\n" +"... print_diff_files(sub_dcmp)\n" +"...\n" +">>> dcmp = dircmp('dir1', 'dir2')\n" +">>> print_diff_files(dcmp)" +msgstr "" diff --git a/library/fileformats.po b/library/fileformats.po new file mode 100644 index 000000000..ace06eb03 --- /dev/null +++ b/library/fileformats.po @@ -0,0 +1,36 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 01:06+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "File Formats" +msgstr "Формати файлів" + +msgid "" +"The modules described in this chapter parse various miscellaneous file " +"formats that aren't markup languages and are not related to e-mail." +msgstr "" +"Модулі, описані в цьому розділі, аналізують різноманітні формати файлів, які " +"не є мовами розмітки та не пов’язані з електронною поштою." diff --git a/library/fileinput.po b/library/fileinput.po new file mode 100644 index 000000000..ee45bbc53 --- /dev/null +++ b/library/fileinput.po @@ -0,0 +1,366 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 01:06+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!fileinput` --- Iterate over lines from multiple input streams" +msgstr "" + +msgid "**Source code:** :source:`Lib/fileinput.py`" +msgstr "**Вихідний код:** :source:`Lib/fileinput.py`" + +msgid "" +"This module implements a helper class and functions to quickly write a loop " +"over standard input or a list of files. If you just want to read or write " +"one file see :func:`open`." +msgstr "" +"Цей модуль реалізує допоміжний клас і функції для швидкого запису циклу " +"через стандартний ввід або список файлів. Якщо ви просто хочете прочитати " +"або записати один файл, перегляньте :func:`open`." + +msgid "The typical use is::" +msgstr "Типове використання:" + +msgid "" +"import fileinput\n" +"for line in fileinput.input(encoding=\"utf-8\"):\n" +" process(line)" +msgstr "" + +msgid "" +"This iterates over the lines of all files listed in ``sys.argv[1:]``, " +"defaulting to ``sys.stdin`` if the list is empty. If a filename is ``'-'``, " +"it is also replaced by ``sys.stdin`` and the optional arguments *mode* and " +"*openhook* are ignored. To specify an alternative list of filenames, pass " +"it as the first argument to :func:`.input`. A single file name is also " +"allowed." +msgstr "" +"Це повторює рядки всіх файлів, перелічених у ``sys.argv[1:]``, за умовчанням " +"``sys.stdin``, якщо список порожній. Якщо ім’я файлу ``'-'``, воно також " +"замінюється на ``sys.stdin``, а додаткові аргументи *mode* і *openhook* " +"ігноруються. Щоб вказати альтернативний список імен файлів, передайте його " +"як перший аргумент у :func:`.input`. Допускається також одне ім’я файлу." + +msgid "" +"All files are opened in text mode by default, but you can override this by " +"specifying the *mode* parameter in the call to :func:`.input` or :class:" +"`FileInput`. If an I/O error occurs during opening or reading a file, :exc:" +"`OSError` is raised." +msgstr "" +"За замовчуванням усі файли відкриваються в текстовому режимі, але ви можете " +"змінити це, вказавши параметр *mode* у виклику :func:`.input` або :class:" +"`FileInput`. Якщо під час відкриття або читання файлу виникає помилка " +"введення-виведення, виникає :exc:`OSError`." + +msgid ":exc:`IOError` used to be raised; it is now an alias of :exc:`OSError`." +msgstr ":exc:`IOError` використовувався; тепер це псевдонім :exc:`OSError`." + +msgid "" +"If ``sys.stdin`` is used more than once, the second and further use will " +"return no lines, except perhaps for interactive use, or if it has been " +"explicitly reset (e.g. using ``sys.stdin.seek(0)``)." +msgstr "" +"Якщо ``sys.stdin`` використовується більше одного разу, друге і подальше " +"використання не поверне жодних рядків, за винятком, можливо, для " +"інтерактивного використання, або якщо його було явно скинуто (наприклад, за " +"допомогою ``sys.stdin.seek(0))``)." + +msgid "" +"Empty files are opened and immediately closed; the only time their presence " +"in the list of filenames is noticeable at all is when the last file opened " +"is empty." +msgstr "" +"Порожні файли відкриваються і негайно закриваються; єдиний раз, коли їх " +"присутність у списку імен файлів взагалі помітна, це коли останній відкритий " +"файл порожній." + +msgid "" +"Lines are returned with any newlines intact, which means that the last line " +"in a file may not have one." +msgstr "" +"Рядки повертаються з усіма новими рядками, що означає, що останній рядок у " +"файлі може їх не мати." + +msgid "" +"You can control how files are opened by providing an opening hook via the " +"*openhook* parameter to :func:`fileinput.input` or :func:`FileInput`. The " +"hook must be a function that takes two arguments, *filename* and *mode*, and " +"returns an accordingly opened file-like object. If *encoding* and/or " +"*errors* are specified, they will be passed to the hook as additional " +"keyword arguments. This module provides a :func:`hook_compressed` to support " +"compressed files." +msgstr "" + +msgid "The following function is the primary interface of this module:" +msgstr "Наступна функція є основним інтерфейсом цього модуля:" + +msgid "" +"Create an instance of the :class:`FileInput` class. The instance will be " +"used as global state for the functions of this module, and is also returned " +"to use during iteration. The parameters to this function will be passed " +"along to the constructor of the :class:`FileInput` class." +msgstr "" +"Створіть екземпляр класу :class:`FileInput`. Примірник використовуватиметься " +"як глобальний стан для функцій цього модуля, а також повертатиметься до " +"використання під час ітерації. Параметри цієї функції будуть передані " +"конструктору класу :class:`FileInput`." + +msgid "" +"The :class:`FileInput` instance can be used as a context manager in the :" +"keyword:`with` statement. In this example, *input* is closed after the :" +"keyword:`!with` statement is exited, even if an exception occurs::" +msgstr "" +"Екземпляр :class:`FileInput` можна використовувати як менеджер контексту в " +"операторі :keyword:`with`. У цьому прикладі *input* закривається після " +"завершення оператора :keyword:`!with`, навіть якщо виникає виняткова " +"ситуація::" + +msgid "" +"with fileinput.input(files=('spam.txt', 'eggs.txt'), encoding=\"utf-8\") as " +"f:\n" +" for line in f:\n" +" process(line)" +msgstr "" + +msgid "Can be used as a context manager." +msgstr "Може використовуватися як контекстний менеджер." + +msgid "The keyword parameters *mode* and *openhook* are now keyword-only." +msgstr "" +"Параметри ключових слів *mode* і *openhook* тепер є лише ключовими словами." + +msgid "The keyword-only parameter *encoding* and *errors* are added." +msgstr "Додано лише ключове слово *кодування* та *помилки*." + +msgid "" +"The following functions use the global state created by :func:`fileinput." +"input`; if there is no active state, :exc:`RuntimeError` is raised." +msgstr "" +"Наступні функції використовують глобальний стан, створений :func:`fileinput." +"input`; якщо активного стану немає, виникає :exc:`RuntimeError`." + +msgid "" +"Return the name of the file currently being read. Before the first line has " +"been read, returns ``None``." +msgstr "" +"Повертає назву файлу, який зараз читається. До того, як буде прочитано " +"перший рядок, повертає ``None``." + +msgid "" +"Return the integer \"file descriptor\" for the current file. When no file is " +"opened (before the first line and between files), returns ``-1``." +msgstr "" +"Повертає ціле число \"дескриптор файлу\" для поточного файлу. Якщо файл не " +"відкрито (перед першим рядком і між файлами), повертає ``-1``." + +msgid "" +"Return the cumulative line number of the line that has just been read. " +"Before the first line has been read, returns ``0``. After the last line of " +"the last file has been read, returns the line number of that line." +msgstr "" +"Повертає кумулятивний номер рядка, який щойно було прочитано. До прочитання " +"першого рядка повертає ``0``. Після прочитання останнього рядка останнього " +"файлу повертає номер цього рядка." + +msgid "" +"Return the line number in the current file. Before the first line has been " +"read, returns ``0``. After the last line of the last file has been read, " +"returns the line number of that line within the file." +msgstr "" +"Повертає номер рядка в поточному файлі. До прочитання першого рядка повертає " +"``0``. Після прочитання останнього рядка останнього файлу повертає номер " +"рядка цього рядка у файлі." + +msgid "" +"Return ``True`` if the line just read is the first line of its file, " +"otherwise return ``False``." +msgstr "" +"Повертає ``True``, якщо щойно прочитаний рядок є першим рядком його файлу, " +"інакше повертає ``False``." + +msgid "" +"Return ``True`` if the last line was read from ``sys.stdin``, otherwise " +"return ``False``." +msgstr "" +"Повертає ``True``, якщо останній рядок було прочитано з ``sys.stdin``, " +"інакше повертає ``False``." + +msgid "" +"Close the current file so that the next iteration will read the first line " +"from the next file (if any); lines not read from the file will not count " +"towards the cumulative line count. The filename is not changed until after " +"the first line of the next file has been read. Before the first line has " +"been read, this function has no effect; it cannot be used to skip the first " +"file. After the last line of the last file has been read, this function has " +"no effect." +msgstr "" +"Закрийте поточний файл, щоб наступна ітерація прочитала перший рядок із " +"наступного файлу (якщо такий є); рядки, не прочитані з файлу, не " +"враховуватимуться до загальної кількості рядків. Ім'я файлу не змінюється, " +"доки не буде прочитано перший рядок наступного файлу. До прочитання першого " +"рядка ця функція не діє; його не можна використовувати для пропуску першого " +"файлу. Після прочитання останнього рядка останнього файлу ця функція не діє." + +msgid "Close the sequence." +msgstr "Закрийте послідовність." + +msgid "" +"The class which implements the sequence behavior provided by the module is " +"available for subclassing as well:" +msgstr "" +"Клас, який реалізує поведінку послідовності, надану модулем, також доступний " +"для підкласів:" + +msgid "" +"Class :class:`FileInput` is the implementation; its methods :meth:" +"`filename`, :meth:`fileno`, :meth:`lineno`, :meth:`filelineno`, :meth:" +"`isfirstline`, :meth:`isstdin`, :meth:`nextfile` and :meth:`close` " +"correspond to the functions of the same name in the module. In addition it " +"is :term:`iterable` and has a :meth:`~io.TextIOBase.readline` method which " +"returns the next input line. The sequence must be accessed in strictly " +"sequential order; random access and :meth:`~io.TextIOBase.readline` cannot " +"be mixed." +msgstr "" + +msgid "" +"With *mode* you can specify which file mode will be passed to :func:`open`. " +"It must be one of ``'r'`` and ``'rb'``." +msgstr "" + +msgid "" +"The *openhook*, when given, must be a function that takes two arguments, " +"*filename* and *mode*, and returns an accordingly opened file-like object. " +"You cannot use *inplace* and *openhook* together." +msgstr "" +"*Openhook*, якщо його надано, має бути функцією, яка приймає два аргументи, " +"*filename* і *mode*, і повертає відповідний відкритий файлоподібний об’єкт. " +"Ви не можете використовувати *inplace* і *openhook* разом." + +msgid "" +"You can specify *encoding* and *errors* that is passed to :func:`open` or " +"*openhook*." +msgstr "" +"Ви можете вказати *кодування* та *помилки*, які передаються в :func:`open` " +"або *openhook*." + +msgid "" +"A :class:`FileInput` instance can be used as a context manager in the :" +"keyword:`with` statement. In this example, *input* is closed after the :" +"keyword:`!with` statement is exited, even if an exception occurs::" +msgstr "" +"Екземпляр :class:`FileInput` можна використовувати як менеджер контексту в " +"операторі :keyword:`with`. У цьому прикладі *input* закривається після " +"завершення оператора :keyword:`!with`, навіть якщо виникає виняткова " +"ситуація::" + +msgid "" +"with FileInput(files=('spam.txt', 'eggs.txt')) as input:\n" +" process(input)" +msgstr "" + +msgid "The keyword parameter *mode* and *openhook* are now keyword-only." +msgstr "Ключові параметри *mode* і *openhook* тепер є лише ключовими словами." + +msgid "" +"The ``'rU'`` and ``'U'`` modes and the :meth:`!__getitem__` method have been " +"removed." +msgstr "" + +msgid "" +"**Optional in-place filtering:** if the keyword argument ``inplace=True`` is " +"passed to :func:`fileinput.input` or to the :class:`FileInput` constructor, " +"the file is moved to a backup file and standard output is directed to the " +"input file (if a file of the same name as the backup file already exists, it " +"will be replaced silently). This makes it possible to write a filter that " +"rewrites its input file in place. If the *backup* parameter is given " +"(typically as ``backup='.'``), it specifies the extension " +"for the backup file, and the backup file remains around; by default, the " +"extension is ``'.bak'`` and it is deleted when the output file is closed. " +"In-place filtering is disabled when standard input is read." +msgstr "" +"**Додаткова фільтрація на місці:** якщо ключовий аргумент ``inplace=True`` " +"передається до :func:`fileinput.input` або до конструктора :class:" +"`FileInput`, файл переміщується до резервної копії файл, а стандартний вивід " +"спрямовується до вхідного файлу (якщо файл із такою ж назвою, як і файл " +"резервної копії, уже існує, його буде замінено мовчки). Це дає змогу " +"написати фільтр, який перезаписує свій вхідний файл на місці. Якщо вказано " +"параметр *backup* (зазвичай як ``backup='. ''``), він " +"визначає розширення файлу резервної копії, і файл резервної копії " +"залишається; за замовчуванням розширення має ``'.bak'`` і воно видаляється, " +"коли вихідний файл закривається. Фільтрування на місці вимкнено, коли " +"зчитується стандартний ввід." + +msgid "The two following opening hooks are provided by this module:" +msgstr "Цей модуль забезпечує два наступних відкриваючі гачки:" + +msgid "" +"Transparently opens files compressed with gzip and bzip2 (recognized by the " +"extensions ``'.gz'`` and ``'.bz2'``) using the :mod:`gzip` and :mod:`bz2` " +"modules. If the filename extension is not ``'.gz'`` or ``'.bz2'``, the file " +"is opened normally (ie, using :func:`open` without any decompression)." +msgstr "" +"Прозоро відкриває файли, стиснуті за допомогою gzip і bzip2 (розпізнаються " +"за розширеннями ``'.gz''`` і ``'.bz2``) за допомогою модулів :mod:`gzip` і :" +"mod:`bz2`. Якщо розширення назви файлу не є ``'.gz''`` або ``'.bz2''``, файл " +"відкривається нормально (тобто за допомогою :func:`open` без будь-якої " +"декомпресії)." + +msgid "" +"The *encoding* and *errors* values are passed to :class:`io.TextIOWrapper` " +"for compressed files and open for normal files." +msgstr "" +"Значення *encoding* і *errors* передаються в :class:`io.TextIOWrapper` для " +"стиснутих файлів і відкриваються для звичайних файлів." + +msgid "" +"Usage example: ``fi = fileinput.FileInput(openhook=fileinput." +"hook_compressed, encoding=\"utf-8\")``" +msgstr "" +"Приклад використання: ``fi = fileinput.FileInput(openhook=fileinput." +"hook_compressed, encoding=\"utf-8\")``" + +msgid "" +"Returns a hook which opens each file with :func:`open`, using the given " +"*encoding* and *errors* to read the file." +msgstr "" +"Повертає хук, який відкриває кожен файл за допомогою :func:`open`, " +"використовуючи задане *кодування* та *помилки* для читання файлу." + +msgid "" +"Usage example: ``fi = fileinput.FileInput(openhook=fileinput." +"hook_encoded(\"utf-8\", \"surrogateescape\"))``" +msgstr "" +"Приклад використання: ``fi = fileinput.FileInput(openhook=fileinput." +"hook_encoded(\"utf-8\", \"surrogateescape\"))``" + +msgid "Added the optional *errors* parameter." +msgstr "Додано необов’язковий параметр *errors*." + +msgid "" +"This function is deprecated since :func:`fileinput.input` and :class:" +"`FileInput` now have *encoding* and *errors* parameters." +msgstr "" +"Ця функція застаріла, оскільки :func:`fileinput.input` і :class:`FileInput` " +"тепер мають параметри *encoding* і *errors*." diff --git a/library/filesys.po b/library/filesys.po new file mode 100644 index 000000000..1dd5f8eec --- /dev/null +++ b/library/filesys.po @@ -0,0 +1,68 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 01:06+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "File and Directory Access" +msgstr "Доступ до файлів і каталогів" + +msgid "" +"The modules described in this chapter deal with disk files and directories. " +"For example, there are modules for reading the properties of files, " +"manipulating paths in a portable way, and creating temporary files. The " +"full list of modules in this chapter is:" +msgstr "" +"Модулі, описані в цьому розділі, стосуються дискових файлів і каталогів. " +"Наприклад, існують модулі для читання властивостей файлів, маніпулювання " +"шляхами переносним способом і створення тимчасових файлів. Повний список " +"модулів у цьому розділі:" + +msgid "Module :mod:`os`" +msgstr "Модуль :mod:`os`" + +msgid "" +"Operating system interfaces, including functions to work with files at a " +"lower level than Python :term:`file objects `." +msgstr "" +"Інтерфейси операційної системи, включаючи функції для роботи з файлами на " +"нижчому рівні, ніж Python :term:`file objects `." + +msgid "Module :mod:`io`" +msgstr "Модуль :mod:`io`" + +msgid "" +"Python's built-in I/O library, including both abstract classes and some " +"concrete classes such as file I/O." +msgstr "" +"Вбудована бібліотека вводу-виводу Python, що включає як абстрактні класи, " +"так і деякі конкретні класи, такі як файловий ввід-вивід." + +msgid "Built-in function :func:`open`" +msgstr "Вбудована функція :func:`open`" + +msgid "The standard way to open files for reading and writing with Python." +msgstr "" +"Стандартний спосіб відкриття файлів для читання та запису за допомогою " +"Python." diff --git a/library/fnmatch.po b/library/fnmatch.po new file mode 100644 index 000000000..15757fcbf --- /dev/null +++ b/library/fnmatch.po @@ -0,0 +1,188 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 01:06+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!fnmatch` --- Unix filename pattern matching" +msgstr ":mod:`!fnmatch` --- зіставлення імен файлів у Unix" + +msgid "**Source code:** :source:`Lib/fnmatch.py`" +msgstr "**Вихідний код:** :source:`Lib/fnmatch.py`" + +msgid "" +"This module provides support for Unix shell-style wildcards, which are *not* " +"the same as regular expressions (which are documented in the :mod:`re` " +"module). The special characters used in shell-style wildcards are:" +msgstr "" +"Цей модуль підтримує символи підстановки у стилі оболонки Unix, які які *не* " +"відповідають регулярним виразам (що задокументовані в модулі :mod:`re`). " +"Спеціальні символи, які використовуються в символах підстановки у стилі " +"оболонки:" + +msgid "Pattern" +msgstr "Візерунок" + +msgid "Meaning" +msgstr "Значення" + +msgid "``*``" +msgstr "``*``" + +msgid "matches everything" +msgstr "відповідає всьому" + +msgid "``?``" +msgstr "``?``" + +msgid "matches any single character" +msgstr "відповідає будь-якому окремому символу" + +msgid "``[seq]``" +msgstr "``[seq]``" + +msgid "matches any character in *seq*" +msgstr "відповідає будь-якому символу в *seq*" + +msgid "``[!seq]``" +msgstr "``[!seq]``" + +msgid "matches any character not in *seq*" +msgstr "відповідає будь-якому символу не в *seq*" + +msgid "" +"For a literal match, wrap the meta-characters in brackets. For example, " +"``'[?]'`` matches the character ``'?'``." +msgstr "" +"Для буквального збігу заберіть метасимволи в дужки. Наприклад, ``''[?]'`` " +"відповідає символу ``''?'``." + +msgid "" +"Note that the filename separator (``'/'`` on Unix) is *not* special to this " +"module. See module :mod:`glob` for pathname expansion (:mod:`glob` uses :" +"func:`.filter` to match pathname segments). Similarly, filenames starting " +"with a period are not special for this module, and are matched by the ``*`` " +"and ``?`` patterns." +msgstr "" +"Зауважте, що роздільник імен файлів (``'/'`` в Unix) *не* є особливим для " +"цього модуля. Дивіться модуль :mod:`glob` для розширення імені шляху (:mod:" +"`glob` використовує :func:`.filter` для відповідності сегментам імені " +"шляху). Подібним чином назви файлів, що починаються з крапки, не є " +"спеціальними для цього модуля та відповідають шаблонам ``*`` і ``?``." + +msgid "" +"Unless stated otherwise, \"filename string\" and \"pattern string\" either " +"refer to :class:`str` or ``ISO-8859-1`` encoded :class:`bytes` objects. Note " +"that the functions documented below do not allow to mix a :class:`!bytes` " +"pattern with a :class:`!str` filename, and vice-versa." +msgstr "" + +msgid "" +"Finally, note that :func:`functools.lru_cache` with a *maxsize* of 32768 is " +"used to cache the (typed) compiled regex patterns in the following " +"functions: :func:`fnmatch`, :func:`fnmatchcase`, :func:`.filter`." +msgstr "" + +msgid "" +"Test whether the filename string *name* matches the pattern string *pat*, " +"returning ``True`` or ``False``. Both parameters are case-normalized using :" +"func:`os.path.normcase`. :func:`fnmatchcase` can be used to perform a case-" +"sensitive comparison, regardless of whether that's standard for the " +"operating system." +msgstr "" + +msgid "" +"This example will print all file names in the current directory with the " +"extension ``.txt``::" +msgstr "" +"У цьому прикладі буде надруковано всі імена файлів у поточному каталозі з " +"розширенням ``.txt``::" + +msgid "" +"import fnmatch\n" +"import os\n" +"\n" +"for file in os.listdir('.'):\n" +" if fnmatch.fnmatch(file, '*.txt'):\n" +" print(file)" +msgstr "" + +msgid "" +"Test whether the filename string *name* matches the pattern string *pat*, " +"returning ``True`` or ``False``; the comparison is case-sensitive and does " +"not apply :func:`os.path.normcase`." +msgstr "" + +msgid "" +"Construct a list from those elements of the :term:`iterable` of filename " +"strings *names* that match the pattern string *pat*. It is the same as ``[n " +"for n in names if fnmatch(n, pat)]``, but implemented more efficiently." +msgstr "" + +msgid "" +"Return the shell-style pattern *pat* converted to a regular expression for " +"using with :func:`re.match`. The pattern is expected to be a :class:`str`." +msgstr "" + +msgid "Example:" +msgstr "Приклад:" + +msgid "Module :mod:`glob`" +msgstr "Модуль :mod:`glob`" + +msgid "Unix shell-style path expansion." +msgstr "Розширення шляху у стилі оболонки Unix." + +msgid "filenames" +msgstr "назви файлів" + +msgid "wildcard expansion" +msgstr "розширення символів підстановки" + +msgid "module" +msgstr "модуль" + +msgid "re" +msgstr "re" + +msgid "* (asterisk)" +msgstr "* (зірочка)" + +msgid "in glob-style wildcards" +msgstr "символами узагальнення у стилі glob" + +msgid "? (question mark)" +msgstr "? (знак питання)" + +msgid "[] (square brackets)" +msgstr "[] (квадратні дужки)" + +msgid "! (exclamation)" +msgstr "! (знак оклику)" + +msgid "- (minus)" +msgstr "- (мінус)" + +msgid "glob" +msgstr "glob" diff --git a/library/fractions.po b/library/fractions.po new file mode 100644 index 000000000..3c3c9dbae --- /dev/null +++ b/library/fractions.po @@ -0,0 +1,286 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2023 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 01:06+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2023\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!fractions` --- Rational numbers" +msgstr "" + +msgid "**Source code:** :source:`Lib/fractions.py`" +msgstr "**Вихідний код:** :source:`Lib/fractions.py`" + +msgid "" +"The :mod:`fractions` module provides support for rational number arithmetic." +msgstr "" +"Модуль :mod:`fractions` забезпечує підтримку арифметики раціональних чисел." + +msgid "" +"A Fraction instance can be constructed from a pair of integers, from another " +"rational number, or from a string." +msgstr "" +"Екземпляр Fraction можна побудувати з пари цілих чисел, з іншого " +"раціонального числа або з рядка." + +msgid "" +"The first version requires that *numerator* and *denominator* are instances " +"of :class:`numbers.Rational` and returns a new :class:`Fraction` instance " +"with value ``numerator/denominator``. If *denominator* is ``0``, it raises " +"a :exc:`ZeroDivisionError`. The second version requires that " +"*other_fraction* is an instance of :class:`numbers.Rational` and returns a :" +"class:`Fraction` instance with the same value. The next two versions accept " +"either a :class:`float` or a :class:`decimal.Decimal` instance, and return " +"a :class:`Fraction` instance with exactly the same value. Note that due to " +"the usual issues with binary floating point (see :ref:`tut-fp-issues`), the " +"argument to ``Fraction(1.1)`` is not exactly equal to 11/10, and so " +"``Fraction(1.1)`` does *not* return ``Fraction(11, 10)`` as one might " +"expect. (But see the documentation for the :meth:`limit_denominator` method " +"below.) The last version of the constructor expects a string or unicode " +"instance. The usual form for this instance is::" +msgstr "" + +msgid "[sign] numerator ['/' denominator]" +msgstr "" + +msgid "" +"where the optional ``sign`` may be either '+' or '-' and ``numerator`` and " +"``denominator`` (if present) are strings of decimal digits (underscores may " +"be used to delimit digits as with integral literals in code). In addition, " +"any string that represents a finite value and is accepted by the :class:" +"`float` constructor is also accepted by the :class:`Fraction` constructor. " +"In either form the input string may also have leading and/or trailing " +"whitespace. Here are some examples::" +msgstr "" + +msgid "" +">>> from fractions import Fraction\n" +">>> Fraction(16, -10)\n" +"Fraction(-8, 5)\n" +">>> Fraction(123)\n" +"Fraction(123, 1)\n" +">>> Fraction()\n" +"Fraction(0, 1)\n" +">>> Fraction('3/7')\n" +"Fraction(3, 7)\n" +">>> Fraction(' -3/7 ')\n" +"Fraction(-3, 7)\n" +">>> Fraction('1.414213 \\t\\n')\n" +"Fraction(1414213, 1000000)\n" +">>> Fraction('-.125')\n" +"Fraction(-1, 8)\n" +">>> Fraction('7e-6')\n" +"Fraction(7, 1000000)\n" +">>> Fraction(2.25)\n" +"Fraction(9, 4)\n" +">>> Fraction(1.1)\n" +"Fraction(2476979795053773, 2251799813685248)\n" +">>> from decimal import Decimal\n" +">>> Fraction(Decimal('1.1'))\n" +"Fraction(11, 10)" +msgstr "" + +msgid "" +"The :class:`Fraction` class inherits from the abstract base class :class:" +"`numbers.Rational`, and implements all of the methods and operations from " +"that class. :class:`Fraction` instances are :term:`hashable`, and should be " +"treated as immutable. In addition, :class:`Fraction` has the following " +"properties and methods:" +msgstr "" + +msgid "" +"The :class:`Fraction` constructor now accepts :class:`float` and :class:" +"`decimal.Decimal` instances." +msgstr "" +"Конструктор :class:`Fraction` тепер приймає екземпляри :class:`float` і :" +"class:`decimal.Decimal`." + +msgid "" +"The :func:`math.gcd` function is now used to normalize the *numerator* and " +"*denominator*. :func:`math.gcd` always returns an :class:`int` type. " +"Previously, the GCD type depended on *numerator* and *denominator*." +msgstr "" + +msgid "" +"Underscores are now permitted when creating a :class:`Fraction` instance " +"from a string, following :PEP:`515` rules." +msgstr "" + +msgid "" +":class:`Fraction` implements ``__int__`` now to satisfy ``typing." +"SupportsInt`` instance checks." +msgstr "" + +msgid "" +"Space is allowed around the slash for string inputs: ``Fraction('2 / 3')``." +msgstr "" + +msgid "" +":class:`Fraction` instances now support float-style formatting, with " +"presentation types ``\"e\"``, ``\"E\"``, ``\"f\"``, ``\"F\"``, ``\"g\"``, " +"``\"G\"`` and ``\"%\"\"``." +msgstr "" + +msgid "" +"Formatting of :class:`Fraction` instances without a presentation type now " +"supports fill, alignment, sign handling, minimum width and grouping." +msgstr "" + +msgid "Numerator of the Fraction in lowest term." +msgstr "Чисельник дробу в молодшому члені." + +msgid "Denominator of the Fraction in lowest term." +msgstr "Знаменник дробу в найменшому члені." + +msgid "" +"Return a tuple of two integers, whose ratio is equal to the original " +"Fraction. The ratio is in lowest terms and has a positive denominator." +msgstr "" + +msgid "Return ``True`` if the Fraction is an integer." +msgstr "" + +msgid "" +"Alternative constructor which only accepts instances of :class:`float` or :" +"class:`numbers.Integral`. Beware that ``Fraction.from_float(0.3)`` is not " +"the same value as ``Fraction(3, 10)``." +msgstr "" +"Альтернативний конструктор, який приймає лише екземпляри :class:`float` або :" +"class:`numbers.Integral`. Майте на увазі, що ``Fraction.from_float(0.3)`` не " +"є тим самим значенням ``Fraction(3, 10)``." + +msgid "" +"From Python 3.2 onwards, you can also construct a :class:`Fraction` instance " +"directly from a :class:`float`." +msgstr "" +"Починаючи з Python 3.2 і далі, ви також можете створити екземпляр :class:" +"`Fraction` безпосередньо з :class:`float`." + +msgid "" +"Alternative constructor which only accepts instances of :class:`decimal." +"Decimal` or :class:`numbers.Integral`." +msgstr "" +"Альтернативний конструктор, який приймає лише екземпляри :class:`decimal." +"Decimal` або :class:`numbers.Integral`." + +msgid "" +"From Python 3.2 onwards, you can also construct a :class:`Fraction` instance " +"directly from a :class:`decimal.Decimal` instance." +msgstr "" +"Починаючи з Python 3.2 і далі, ви також можете створити екземпляр :class:" +"`Fraction` безпосередньо з екземпляра :class:`decimal.Decimal`." + +msgid "" +"Finds and returns the closest :class:`Fraction` to ``self`` that has " +"denominator at most max_denominator. This method is useful for finding " +"rational approximations to a given floating-point number:" +msgstr "" +"Знаходить і повертає найближчий :class:`Fraction` до ``self``, який має " +"знаменник не більше max_denominator. Цей метод корисний для знаходження " +"раціональних наближень до даного числа з плаваючою комою:" + +msgid "or for recovering a rational number that's represented as a float:" +msgstr "" +"або для відновлення раціонального числа, представленого як число з плаваючою " +"точкою:" + +msgid "" +"Returns the greatest :class:`int` ``<= self``. This method can also be " +"accessed through the :func:`math.floor` function:" +msgstr "" +"Повертає найбільше :class:`int` ``<= self``. Цей метод також можна отримати " +"через функцію :func:`math.floor`:" + +msgid "" +"Returns the least :class:`int` ``>= self``. This method can also be " +"accessed through the :func:`math.ceil` function." +msgstr "" +"Повертає найменше :class:`int` ``>= self``. Цей метод також можна отримати " +"через функцію :func:`math.ceil`." + +msgid "" +"The first version returns the nearest :class:`int` to ``self``, rounding " +"half to even. The second version rounds ``self`` to the nearest multiple of " +"``Fraction(1, 10**ndigits)`` (logically, if ``ndigits`` is negative), again " +"rounding half toward even. This method can also be accessed through the :" +"func:`round` function." +msgstr "" +"Перша версія повертає найближчий :class:`int` до ``self``, округляючи " +"половину до парного. Друга версія округлює ``self`` до найближчого кратного " +"``Fraction(1, 10**ndigits)`` (логічно, якщо ``ndigits`` є від'ємним), знову " +"округлюючи половину до парного. Цей метод також можна отримати через " +"функцію :func:`round`." + +msgid "" +"Provides support for formatting of :class:`Fraction` instances via the :meth:" +"`str.format` method, the :func:`format` built-in function, or :ref:" +"`Formatted string literals `." +msgstr "" + +msgid "" +"If the ``format_spec`` format specification string does not end with one of " +"the presentation types ``'e'``, ``'E'``, ``'f'``, ``'F'``, ``'g'``, ``'G'`` " +"or ``'%'`` then formatting follows the general rules for fill, alignment, " +"sign handling, minimum width, and grouping as described in the :ref:`format " +"specification mini-language `. The \"alternate form\" flag " +"``'#'`` is supported: if present, it forces the output string to always " +"include an explicit denominator, even when the value being formatted is an " +"exact integer. The zero-fill flag ``'0'`` is not supported." +msgstr "" + +msgid "" +"If the ``format_spec`` format specification string ends with one of the " +"presentation types ``'e'``, ``'E'``, ``'f'``, ``'F'``, ``'g'``, ``'G'`` or " +"``'%'`` then formatting follows the rules outlined for the :class:`float` " +"type in the :ref:`formatspec` section." +msgstr "" + +msgid "Here are some examples::" +msgstr "Ось кілька прикладів:" + +msgid "" +">>> from fractions import Fraction\n" +">>> format(Fraction(103993, 33102), '_')\n" +"'103_993/33_102'\n" +">>> format(Fraction(1, 7), '.^+10')\n" +"'...+1/7...'\n" +">>> format(Fraction(3, 1), '')\n" +"'3'\n" +">>> format(Fraction(3, 1), '#')\n" +"'3/1'\n" +">>> format(Fraction(1, 7), '.40g')\n" +"'0.1428571428571428571428571428571428571429'\n" +">>> format(Fraction('1234567.855'), '_.2f')\n" +"'1_234_567.86'\n" +">>> f\"{Fraction(355, 113):*>20.6e}\"\n" +"'********3.141593e+00'\n" +">>> old_price, new_price = 499, 672\n" +">>> \"{:.2%} price increase\".format(Fraction(new_price, old_price) - 1)\n" +"'34.67% price increase'" +msgstr "" + +msgid "Module :mod:`numbers`" +msgstr "Модуль :mod:`numbers`" + +msgid "The abstract base classes making up the numeric tower." +msgstr "Абстрактні базові класи, що утворюють числову вежу." diff --git a/library/frameworks.po b/library/frameworks.po new file mode 100644 index 000000000..56c19b5b8 --- /dev/null +++ b/library/frameworks.po @@ -0,0 +1,41 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 01:06+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Program Frameworks" +msgstr "Програмні рамки" + +msgid "" +"The modules described in this chapter are frameworks that will largely " +"dictate the structure of your program. Currently the modules described " +"here are all oriented toward writing command-line interfaces." +msgstr "" +"Модулі, описані в цьому розділі, є фреймворками, які значною мірою " +"визначатимуть структуру вашої програми. Наразі описані тут модулі " +"орієнтовані на написання інтерфейсів командного рядка." + +msgid "The full list of modules described in this chapter is:" +msgstr "Повний перелік модулів, описаних у цьому розділі:" diff --git a/library/ftplib.po b/library/ftplib.po new file mode 100644 index 000000000..03561d99d --- /dev/null +++ b/library/ftplib.po @@ -0,0 +1,618 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Olga Tomakhina, 2024 +# Dmytro Kazanzhy, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 01:06+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!ftplib` --- FTP protocol client" +msgstr "" + +msgid "**Source code:** :source:`Lib/ftplib.py`" +msgstr "**Вихідний код:** :source:`Lib/ftplib.py`" + +msgid "" +"This module defines the class :class:`FTP` and a few related items. The :" +"class:`FTP` class implements the client side of the FTP protocol. You can " +"use this to write Python programs that perform a variety of automated FTP " +"jobs, such as mirroring other FTP servers. It is also used by the module :" +"mod:`urllib.request` to handle URLs that use FTP. For more information on " +"FTP (File Transfer Protocol), see internet :rfc:`959`." +msgstr "" +"Цей модуль визначає клас :class:`FTP` і кілька пов’язаних елементів. Клас :" +"class:`FTP` реалізує клієнтську сторону протоколу FTP. Ви можете " +"використовувати це для написання програм на Python, які виконують " +"різноманітні автоматизовані завдання FTP, такі як віддзеркалення інших " +"серверів FTP. Він також використовується модулем :mod:`urllib.request` для " +"обробки URL-адрес, які використовують FTP. Додаткову інформацію про FTP " +"(протокол передачі файлів) див. в Інтернеті :rfc:`959`." + +msgid "The default encoding is UTF-8, following :rfc:`2640`." +msgstr "Стандартне кодування – UTF-8, наступне :rfc:`2640`." + +msgid "Availability" +msgstr "" + +msgid "" +"This module does not work or is not available on WebAssembly. See :ref:`wasm-" +"availability` for more information." +msgstr "" + +msgid "Here's a sample session using the :mod:`ftplib` module::" +msgstr "Ось зразок сеансу з використанням модуля :mod:`ftplib`::" + +msgid "" +">>> from ftplib import FTP\n" +">>> ftp = FTP('ftp.us.debian.org') # connect to host, default port\n" +">>> ftp.login() # user anonymous, passwd anonymous@\n" +"'230 Login successful.'\n" +">>> ftp.cwd('debian') # change into \"debian\" directory\n" +"'250 Directory successfully changed.'\n" +">>> ftp.retrlines('LIST') # list directory contents\n" +"-rw-rw-r-- 1 1176 1176 1063 Jun 15 10:18 README\n" +"...\n" +"drwxr-sr-x 5 1176 1176 4096 Dec 19 2000 pool\n" +"drwxr-sr-x 4 1176 1176 4096 Nov 17 2008 project\n" +"drwxr-xr-x 3 1176 1176 4096 Oct 10 2012 tools\n" +"'226 Directory send OK.'\n" +">>> with open('README', 'wb') as fp:\n" +">>> ftp.retrbinary('RETR README', fp.write)\n" +"'226 Transfer complete.'\n" +">>> ftp.quit()\n" +"'221 Goodbye.'" +msgstr "" + +msgid "Reference" +msgstr "Посилання" + +msgid "FTP objects" +msgstr "" + +msgid "Return a new instance of the :class:`FTP` class." +msgstr "" + +msgid "Parameters" +msgstr "Параметри" + +msgid "" +"The hostname to connect to. If given, :code:`connect(host)` is implicitly " +"called by the constructor." +msgstr "" + +msgid "" +"|param_doc_user| If given, :code:`login(host, passwd, acct)` is implicitly " +"called by the constructor." +msgstr "" + +msgid "|param_doc_passwd|" +msgstr "" + +msgid "|param_doc_acct|" +msgstr "" + +msgid "" +"A timeout in seconds for blocking operations like :meth:`connect` (default: " +"the global default timeout setting)." +msgstr "" + +msgid "|param_doc_source_address|" +msgstr "" + +msgid "|param_doc_encoding|" +msgstr "" + +msgid "The :class:`FTP` class supports the :keyword:`with` statement, e.g.:" +msgstr "Клас :class:`FTP` підтримує оператор :keyword:`with`, наприклад:" + +msgid "Support for the :keyword:`with` statement was added." +msgstr "Додано підтримку оператора :keyword:`with`." + +msgid "*source_address* parameter was added." +msgstr "Додано параметр *source_address*." + +msgid "" +"If the *timeout* parameter is set to be zero, it will raise a :class:" +"`ValueError` to prevent the creation of a non-blocking socket. The " +"*encoding* parameter was added, and the default was changed from Latin-1 to " +"UTF-8 to follow :rfc:`2640`." +msgstr "" +"Якщо параметр *timeout* дорівнює нулю, це викличе :class:`ValueError`, щоб " +"запобігти створенню неблокуючого сокета. Параметр *encoding* було додано, а " +"значення за замовчуванням змінено з Latin-1 на UTF-8 на :rfc:`2640`." + +msgid "" +"Several :class:`!FTP` methods are available in two flavors: one for handling " +"text files and another for binary files. The methods are named for the " +"command which is used followed by ``lines`` for the text version or " +"``binary`` for the binary version." +msgstr "" + +msgid ":class:`FTP` instances have the following methods:" +msgstr "Екземпляри :class:`FTP` мають такі методи:" + +msgid "" +"Set the instance's debugging level as an :class:`int`. This controls the " +"amount of debugging output printed. The debug levels are:" +msgstr "" + +msgid "``0`` (default): No debug output." +msgstr "" + +msgid "" +"``1``: Produce a moderate amount of debug output, generally a single line " +"per request." +msgstr "" + +msgid "" +"``2`` or higher: Produce the maximum amount of debugging output, logging " +"each line sent and received on the control connection." +msgstr "" + +msgid "" +"Connect to the given host and port. This function should be called only once " +"for each instance; it should not be called if a *host* argument was given " +"when the :class:`FTP` instance was created. All other :class:`!FTP` methods " +"can only be called after a connection has successfully been made." +msgstr "" + +msgid "The host to connect to." +msgstr "" + +msgid "" +"The TCP port to connect to (default: ``21``, as specified by the FTP " +"protocol specification). It is rarely needed to specify a different port " +"number." +msgstr "" + +msgid "" +"A timeout in seconds for the connection attempt (default: the global default " +"timeout setting)." +msgstr "" + +msgid "" +"Raises an :ref:`auditing event ` ``ftplib.connect`` with arguments " +"``self``, ``host``, ``port``." +msgstr "" +"Викликає :ref:`подію аудиту ` ``ftplib.connect`` з аргументами " +"``self``, ``host``, ``port``." + +msgid "" +"Return the welcome message sent by the server in reply to the initial " +"connection. (This message sometimes contains disclaimers or help " +"information that may be relevant to the user.)" +msgstr "" +"Повернути вітальне повідомлення, надіслане сервером у відповідь на початкове " +"підключення. (Це повідомлення іноді містить застереження або довідкову " +"інформацію, яка може бути актуальною для користувача.)" + +msgid "" +"Log on to the connected FTP server. This function should be called only once " +"for each instance, after a connection has been established; it should not be " +"called if the *host* and *user* arguments were given when the :class:`FTP` " +"instance was created. Most FTP commands are only allowed after the client " +"has logged in." +msgstr "" + +msgid "|param_doc_user|" +msgstr "" + +msgid "" +"Abort a file transfer that is in progress. Using this does not always work, " +"but it's worth a try." +msgstr "" +"Перервати передачу файлу, що триває. Використання цього не завжди працює, " +"але варто спробувати." + +msgid "" +"Send a simple command string to the server and return the response string." +msgstr "Надішліть простий рядок команди на сервер і поверніть рядок відповіді." + +msgid "" +"Raises an :ref:`auditing event ` ``ftplib.sendcmd`` with arguments " +"``self``, ``cmd``." +msgstr "" +"Викликає :ref:`подію аудиту ` ``ftplib.sendcmd`` з аргументами " +"``self``, ``cmd``." + +msgid "" +"Send a simple command string to the server and handle the response. Return " +"the response string if the response code corresponds to success (codes in " +"the range 200--299). Raise :exc:`error_reply` otherwise." +msgstr "" + +msgid "Retrieve a file in binary transfer mode." +msgstr "" + +msgid "An appropriate ``RETR`` command: :samp:`\"RETR {filename}\"`." +msgstr "" + +msgid "" +"A single parameter callable that is called for each block of data received, " +"with its single argument being the data as :class:`bytes`." +msgstr "" + +msgid "" +"The maximum chunk size to read on the low-level :class:`~socket.socket` " +"object created to do the actual transfer. This also corresponds to the " +"largest size of data that will be passed to *callback*. Defaults to ``8192``." +msgstr "" + +msgid "" +"A ``REST`` command to be sent to the server. See the documentation for the " +"*rest* parameter of the :meth:`transfercmd` method." +msgstr "" + +msgid "" +"Retrieve a file or directory listing in the encoding specified by the " +"*encoding* parameter at initialization. *cmd* should be an appropriate " +"``RETR`` command (see :meth:`retrbinary`) or a command such as ``LIST`` or " +"``NLST`` (usually just the string ``'LIST'``). ``LIST`` retrieves a list of " +"files and information about those files. ``NLST`` retrieves a list of file " +"names. The *callback* function is called for each line with a string " +"argument containing the line with the trailing CRLF stripped. The default " +"*callback* prints the line to :data:`sys.stdout`." +msgstr "" + +msgid "" +"Enable \"passive\" mode if *val* is true, otherwise disable passive mode. " +"Passive mode is on by default." +msgstr "" +"Увімкніть \"пасивний\" режим, якщо *val* має значення true, інакше вимкніть " +"пасивний режим. Пасивний режим увімкнено за замовчуванням." + +msgid "Store a file in binary transfer mode." +msgstr "" + +msgid "An appropriate ``STOR`` command: :samp:`\"STOR {filename}\"`." +msgstr "" + +msgid "" +"A file object (opened in binary mode) which is read until EOF, using its :" +"meth:`~io.RawIOBase.read` method in blocks of size *blocksize* to provide " +"the data to be stored." +msgstr "" + +msgid "The read block size. Defaults to ``8192``." +msgstr "" + +msgid "" +"A single parameter callable that is called for each block of data sent, with " +"its single argument being the data as :class:`bytes`." +msgstr "" + +msgid "The *rest* parameter was added." +msgstr "" + +msgid "" +"Store a file in line mode. *cmd* should be an appropriate ``STOR`` command " +"(see :meth:`storbinary`). Lines are read until EOF from the :term:`file " +"object` *fp* (opened in binary mode) using its :meth:`~io.IOBase.readline` " +"method to provide the data to be stored. *callback* is an optional single " +"parameter callable that is called on each line after it is sent." +msgstr "" +"Зберігайте файл у рядковому режимі. *cmd* має бути відповідною командою " +"``STOR`` (див. :meth:`storbinary`). Рядки зчитуються до EOF з :term:`file " +"object` *fp* (відкритого у двійковому режимі) за допомогою його методу :meth:" +"`~io.IOBase.readline` для надання даних для збереження. *callback* — " +"необов’язковий єдиний параметр, який викликається в кожному рядку після " +"надсилання." + +msgid "" +"Initiate a transfer over the data connection. If the transfer is active, " +"send an ``EPRT`` or ``PORT`` command and the transfer command specified by " +"*cmd*, and accept the connection. If the server is passive, send an " +"``EPSV`` or ``PASV`` command, connect to it, and start the transfer " +"command. Either way, return the socket for the connection." +msgstr "" +"Ініціювати передачу через з’єднання даних. Якщо передача активна, надішліть " +"команду ``EPRT`` або ``PORT`` і команду передачі, визначену *cmd*, і " +"прийміть з’єднання. Якщо сервер пасивний, надішліть команду ``EPSV`` або " +"``PASV``, підключіться до нього та запустіть команду передачі. У будь-якому " +"випадку поверніть розетку для підключення." + +msgid "" +"If optional *rest* is given, a ``REST`` command is sent to the server, " +"passing *rest* as an argument. *rest* is usually a byte offset into the " +"requested file, telling the server to restart sending the file's bytes at " +"the requested offset, skipping over the initial bytes. Note however that " +"the :meth:`transfercmd` method converts *rest* to a string with the " +"*encoding* parameter specified at initialization, but no check is performed " +"on the string's contents. If the server does not recognize the ``REST`` " +"command, an :exc:`error_reply` exception will be raised. If this happens, " +"simply call :meth:`transfercmd` without a *rest* argument." +msgstr "" +"Якщо вказано необов’язковий *rest*, команда ``REST`` надсилається на сервер, " +"передаючи *rest* як аргумент. *rest* зазвичай є зміщенням байтів у " +"запитуваному файлі, повідомляючи серверу перезапустити надсилання байтів " +"файлу із запитаним зміщенням, пропускаючи початкові байти. Однак зауважте, " +"що метод :meth:`transfercmd` перетворює *rest* на рядок із параметром " +"*encoding*, указаним під час ініціалізації, але перевірка вмісту рядка не " +"виконується. Якщо сервер не розпізнає команду ``REST``, буде викликано " +"виняток :exc:`error_reply`. Якщо це станеться, просто викличте :meth:" +"`transfercmd` без аргументу *rest*." + +msgid "" +"Like :meth:`transfercmd`, but returns a tuple of the data connection and the " +"expected size of the data. If the expected size could not be computed, " +"``None`` will be returned as the expected size. *cmd* and *rest* means the " +"same thing as in :meth:`transfercmd`." +msgstr "" +"Подібно до :meth:`transfercmd`, але повертає кортеж з’єднання даних і " +"очікуваний розмір даних. Якщо очікуваний розмір не вдалося обчислити, як " +"очікуваний розмір буде повернено \"Немає\". *cmd* і *rest* означають те " +"саме, що й у :meth:`transfercmd`." + +msgid "" +"List a directory in a standardized format by using ``MLSD`` command (:rfc:" +"`3659`). If *path* is omitted the current directory is assumed. *facts* is " +"a list of strings representing the type of information desired (e.g. " +"``[\"type\", \"size\", \"perm\"]``). Return a generator object yielding a " +"tuple of two elements for every file found in path. First element is the " +"file name, the second one is a dictionary containing facts about the file " +"name. Content of this dictionary might be limited by the *facts* argument " +"but server is not guaranteed to return all requested facts." +msgstr "" +"Перерахуйте каталог у стандартизованому форматі за допомогою команди " +"``MLSD`` (:rfc:`3659`). Якщо *шлях* опущено, передбачається поточний " +"каталог. *факти* — це список рядків, що представляють тип бажаної інформації " +"(наприклад, ``[\"тип\", \"розмір\", \"перм\"]``). Повертає об’єкт-генератор, " +"утворюючи кортеж із двох елементів для кожного файлу, знайденого на шляху. " +"Перший елемент – ім’я файлу, другий – словник, що містить інформацію про " +"ім’я файлу. Вміст цього словника може бути обмежений аргументом *факти*, але " +"сервер не гарантує повернення всіх запитуваних фактів." + +msgid "" +"Return a list of file names as returned by the ``NLST`` command. The " +"optional *argument* is a directory to list (default is the current server " +"directory). Multiple arguments can be used to pass non-standard options to " +"the ``NLST`` command." +msgstr "" +"Повертає список імен файлів, які повертає команда ``NLST``. Необов’язковий " +"*аргумент* — це каталог для переліку (за замовчуванням — це поточний каталог " +"сервера). Для передачі нестандартних параметрів команді ``NLST`` можна " +"використовувати кілька аргументів." + +msgid "If your server supports the command, :meth:`mlsd` offers a better API." +msgstr "Якщо ваш сервер підтримує команду, :meth:`mlsd` пропонує кращий API." + +msgid "" +"Produce a directory listing as returned by the ``LIST`` command, printing it " +"to standard output. The optional *argument* is a directory to list (default " +"is the current server directory). Multiple arguments can be used to pass " +"non-standard options to the ``LIST`` command. If the last argument is a " +"function, it is used as a *callback* function as for :meth:`retrlines`; the " +"default prints to :data:`sys.stdout`. This method returns ``None``." +msgstr "" + +msgid "Rename file *fromname* on the server to *toname*." +msgstr "Перейменуйте файл *fromname* на сервері на *toname*." + +msgid "" +"Remove the file named *filename* from the server. If successful, returns " +"the text of the response, otherwise raises :exc:`error_perm` on permission " +"errors or :exc:`error_reply` on other errors." +msgstr "" +"Видаліть файл із назвою *filename* із сервера. У разі успіху повертає текст " +"відповіді, інакше викликає :exc:`error_perm` у разі помилки дозволу або :exc:" +"`error_reply` у випадку інших помилок." + +msgid "Set the current directory on the server." +msgstr "Встановити поточний каталог на сервері." + +msgid "Create a new directory on the server." +msgstr "Створіть новий каталог на сервері." + +msgid "Return the pathname of the current directory on the server." +msgstr "Повертає шлях до поточного каталогу на сервері." + +msgid "Remove the directory named *dirname* on the server." +msgstr "Видаліть каталог із назвою *dirname* на сервері." + +msgid "" +"Request the size of the file named *filename* on the server. On success, " +"the size of the file is returned as an integer, otherwise ``None`` is " +"returned. Note that the ``SIZE`` command is not standardized, but is " +"supported by many common server implementations." +msgstr "" +"Запитати розмір файлу з назвою *filename* на сервері. У разі успіху розмір " +"файлу повертається як ціле число, інакше повертається ``None``. Зауважте, що " +"команда ``SIZE`` не стандартизована, але підтримується багатьма поширеними " +"серверними реалізаціями." + +msgid "" +"Send a ``QUIT`` command to the server and close the connection. This is the " +"\"polite\" way to close a connection, but it may raise an exception if the " +"server responds with an error to the ``QUIT`` command. This implies a call " +"to the :meth:`close` method which renders the :class:`FTP` instance useless " +"for subsequent calls (see below)." +msgstr "" +"Надішліть команду ``QUIT`` на сервер і закрийте з'єднання. Це \"ввічливий\" " +"спосіб закрити з’єднання, але він може спричинити виключення, якщо сервер " +"відповість помилкою на команду ``QUIT``. Це передбачає виклик методу :meth:" +"`close`, який робить екземпляр :class:`FTP` марним для наступних викликів " +"(див. нижче)." + +msgid "" +"Close the connection unilaterally. This should not be applied to an already " +"closed connection such as after a successful call to :meth:`~FTP.quit`. " +"After this call the :class:`FTP` instance should not be used any more (after " +"a call to :meth:`close` or :meth:`~FTP.quit` you cannot reopen the " +"connection by issuing another :meth:`login` method)." +msgstr "" +"Закрийте з'єднання в односторонньому порядку. Це не слід застосовувати до " +"вже закритого з’єднання, наприклад після успішного виклику :meth:`~FTP." +"quit`. Після цього виклику екземпляр :class:`FTP` більше не слід " +"використовувати (після виклику :meth:`close` або :meth:`~FTP.quit` ви не " +"можете повторно відкрити з’єднання, виконавши інший спосіб :meth:`login`)." + +msgid "FTP_TLS objects" +msgstr "" + +msgid "" +"An :class:`FTP` subclass which adds TLS support to FTP as described in :rfc:" +"`4217`. Connect to port 21 implicitly securing the FTP control connection " +"before authenticating." +msgstr "" + +msgid "" +"The user must explicitly secure the data connection by calling the :meth:" +"`prot_p` method." +msgstr "" + +msgid "" +"An SSL context object which allows bundling SSL configuration options, " +"certificates and private keys into a single, potentially long-lived, " +"structure. Please read :ref:`ssl-security` for best practices." +msgstr "" + +msgid "" +"A timeout in seconds for blocking operations like :meth:`~FTP.connect` " +"(default: the global default timeout setting)." +msgstr "" + +msgid "Added the *source_address* parameter." +msgstr "" + +msgid "" +"The class now supports hostname check with :attr:`ssl.SSLContext." +"check_hostname` and *Server Name Indication* (see :const:`ssl.HAS_SNI`)." +msgstr "" + +msgid "The deprecated *keyfile* and *certfile* parameters have been removed." +msgstr "" + +msgid "Here's a sample session using the :class:`FTP_TLS` class::" +msgstr "Ось зразок сеансу з використанням класу :class:`FTP_TLS`::" + +msgid "" +">>> ftps = FTP_TLS('ftp.pureftpd.org')\n" +">>> ftps.login()\n" +"'230 Anonymous user logged in'\n" +">>> ftps.prot_p()\n" +"'200 Data protection level set to \"private\"'\n" +">>> ftps.nlst()\n" +"['6jack', 'OpenBSD', 'antilink', 'blogbench', 'bsdcam', 'clockspeed', " +"'djbdns-jedi', 'docs', 'eaccelerator-jedi', 'favicon.ico', 'francotone', " +"'fugu', 'ignore', 'libpuzzle', 'metalog', 'minidentd', 'misc', 'mysql-udf-" +"global-user-variables', 'php-jenkins-hash', 'php-skein-hash', 'php-webdav', " +"'phpaudit', 'phpbench', 'pincaster', 'ping', 'posto', 'pub', 'public', " +"'public_keys', 'pure-ftpd', 'qscan', 'qtc', 'sharedance', 'skycache', " +"'sound', 'tmp', 'ucarp']" +msgstr "" + +msgid "" +":class:`!FTP_TLS` class inherits from :class:`FTP`, defining these " +"additional methods and attributes:" +msgstr "" + +msgid "The SSL version to use (defaults to :data:`ssl.PROTOCOL_SSLv23`)." +msgstr "" + +msgid "" +"Set up a secure control connection by using TLS or SSL, depending on what is " +"specified in the :attr:`ssl_version` attribute." +msgstr "" +"Налаштуйте безпечне контрольне з’єднання за допомогою TLS або SSL, залежно " +"від того, що вказано в атрибуті :attr:`ssl_version`." + +msgid "" +"The method now supports hostname check with :attr:`ssl.SSLContext." +"check_hostname` and *Server Name Indication* (see :const:`ssl.HAS_SNI`)." +msgstr "" + +msgid "" +"Revert control channel back to plaintext. This can be useful to take " +"advantage of firewalls that know how to handle NAT with non-secure FTP " +"without opening fixed ports." +msgstr "" +"Повернути канал керування назад до відкритого тексту. Це може бути корисним, " +"щоб скористатися перевагами брандмауерів, які знають, як обробляти NAT із " +"незахищеним FTP без відкриття фіксованих портів." + +msgid "Set up secure data connection." +msgstr "Налаштуйте безпечне з’єднання даних." + +msgid "Set up clear text data connection." +msgstr "Налаштуйте підключення для передачі даних у відкритому тексті." + +msgid "Module variables" +msgstr "" + +msgid "Exception raised when an unexpected reply is received from the server." +msgstr "Виняток виникає, коли від сервера надходить неочікувана відповідь." + +msgid "" +"Exception raised when an error code signifying a temporary error (response " +"codes in the range 400--499) is received." +msgstr "" +"Виняток виникає, коли отримано код помилки, що означає тимчасову помилку " +"(коди відповіді в діапазоні 400--499)." + +msgid "" +"Exception raised when an error code signifying a permanent error (response " +"codes in the range 500--599) is received." +msgstr "" +"Виняток виникає, коли отримано код помилки, який означає постійну помилку " +"(коди відповіді в діапазоні 500--599)." + +msgid "" +"Exception raised when a reply is received from the server that does not fit " +"the response specifications of the File Transfer Protocol, i.e. begin with a " +"digit in the range 1--5." +msgstr "" +"Виняток виникає, коли відповідь, отримана від сервера, не відповідає " +"специфікаціям відповіді протоколу передачі файлів, тобто починається з цифри " +"в діапазоні 1--5." + +msgid "" +"The set of all exceptions (as a tuple) that methods of :class:`FTP` " +"instances may raise as a result of problems with the FTP connection (as " +"opposed to programming errors made by the caller). This set includes the " +"four exceptions listed above as well as :exc:`OSError` and :exc:`EOFError`." +msgstr "" +"Набір усіх винятків (у вигляді кортежу), які методи екземплярів :class:`FTP` " +"можуть викликати в результаті проблем із з’єднанням FTP (на відміну від " +"програмних помилок, зроблених абонентом). Цей набір включає чотири винятки, " +"перелічені вище, а також :exc:`OSError` і :exc:`EOFError`." + +msgid "Module :mod:`netrc`" +msgstr "Модуль :mod:`netrc`" + +msgid "" +"Parser for the :file:`.netrc` file format. The file :file:`.netrc` is " +"typically used by FTP clients to load user authentication information before " +"prompting the user." +msgstr "" +"Парсер для формату файлу :file:`.netrc`. Файл :file:`.netrc` зазвичай " +"використовується FTP-клієнтами для завантаження інформації про " +"автентифікацію користувача перед запитом користувача." + +msgid "FTP" +msgstr "" + +msgid "protocol" +msgstr "" + +msgid "ftplib (standard module)" +msgstr "" diff --git a/library/functional.po b/library/functional.po new file mode 100644 index 000000000..e582bf9bd --- /dev/null +++ b/library/functional.po @@ -0,0 +1,39 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 01:06+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Functional Programming Modules" +msgstr "Модулі функціонального програмування" + +msgid "" +"The modules described in this chapter provide functions and classes that " +"support a functional programming style, and general operations on callables." +msgstr "" +"Модулі, описані в цій главі, надають функції та класи, які підтримують " +"функціональний стиль програмування, і загальні операції над викликами." + +msgid "The following modules are documented in this chapter:" +msgstr "У цьому розділі описано наступні модулі:" diff --git a/library/functions.po b/library/functions.po new file mode 100644 index 000000000..e7782e5b9 --- /dev/null +++ b/library/functions.po @@ -0,0 +1,3404 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Taras Kuzyo , 2023 +# Ivan Prytula, 2023 +# Yuliia Shevchenko, 2024 +# Dmytro Kazanzhy, 2025 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 01:06+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2025\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "Built-in Functions" +msgstr "Вбудовані функції" + +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." +msgstr "" +"Інтерпретатор Python має низку функцій і типів, які вбудовані в нього та " +"завжди доступні. Вони перераховані тут в алфавітному порядку." + +msgid "**A**" +msgstr "**A**" + +msgid ":func:`abs`" +msgstr ":func:`abs`" + +msgid ":func:`aiter`" +msgstr ":func:`aiter`" + +msgid ":func:`all`" +msgstr ":func:`all`" + +msgid ":func:`anext`" +msgstr ":func:`anext`" + +msgid ":func:`any`" +msgstr ":func:`any`" + +msgid ":func:`ascii`" +msgstr ":func:`ascii`" + +msgid "**B**" +msgstr "**B**" + +msgid ":func:`bin`" +msgstr ":func:`bin`" + +msgid ":func:`bool`" +msgstr ":func:`bool`" + +msgid ":func:`breakpoint`" +msgstr ":func:`breakpoint`" + +msgid "|func-bytearray|_" +msgstr "|func-bytearray|_" + +msgid "|func-bytes|_" +msgstr "|func-bytes|_" + +msgid "**C**" +msgstr "**C**" + +msgid ":func:`callable`" +msgstr ":func:`callable`" + +msgid ":func:`chr`" +msgstr ":func:`chr`" + +msgid ":func:`classmethod`" +msgstr ":func:`classmethod`" + +msgid ":func:`compile`" +msgstr ":func:`compile`" + +msgid ":func:`complex`" +msgstr ":func:`complex`" + +msgid "**D**" +msgstr "**D**" + +msgid ":func:`delattr`" +msgstr ":func:`delattr`" + +msgid "|func-dict|_" +msgstr "|func-dict|_" + +msgid ":func:`dir`" +msgstr ":func:`dir`" + +msgid ":func:`divmod`" +msgstr ":func:`divmod`" + +msgid "**E**" +msgstr "**E**" + +msgid ":func:`enumerate`" +msgstr ":func:`enumerate`" + +msgid ":func:`eval`" +msgstr ":func:`eval`" + +msgid ":func:`exec`" +msgstr ":func:`exec`" + +msgid "**F**" +msgstr "**F**" + +msgid ":func:`filter`" +msgstr ":func:`filter`" + +msgid ":func:`float`" +msgstr ":func:`float`" + +msgid ":func:`format`" +msgstr ":func:`format`" + +msgid "|func-frozenset|_" +msgstr "|func-frozenset|_" + +msgid "**G**" +msgstr "**G**" + +msgid ":func:`getattr`" +msgstr ":func:`getattr`" + +msgid ":func:`globals`" +msgstr ":func:`globals`" + +msgid "**H**" +msgstr "**H**" + +msgid ":func:`hasattr`" +msgstr ":func:`hasattr`" + +msgid ":func:`hash`" +msgstr ":func:`hash`" + +msgid ":func:`help`" +msgstr ":func:`help`" + +msgid ":func:`hex`" +msgstr ":func:`hex`" + +msgid "**I**" +msgstr "**I**" + +msgid ":func:`id`" +msgstr ":func:`id`" + +msgid ":func:`input`" +msgstr ":func:`input`" + +msgid ":func:`int`" +msgstr ":func:`int`" + +msgid ":func:`isinstance`" +msgstr ":func:`isinstance`" + +msgid ":func:`issubclass`" +msgstr ":func:`issubclass`" + +msgid ":func:`iter`" +msgstr ":func:`iter`" + +msgid "**L**" +msgstr "**L**" + +msgid ":func:`len`" +msgstr ":func:`len`" + +msgid "|func-list|_" +msgstr "|func-list|_" + +msgid ":func:`locals`" +msgstr ":func:`locals`" + +msgid "**M**" +msgstr "**М**" + +msgid ":func:`map`" +msgstr ":func:`map`" + +msgid ":func:`max`" +msgstr ":func:`max`" + +msgid "|func-memoryview|_" +msgstr "|func-memoryview|_" + +msgid ":func:`min`" +msgstr ":func:`min`" + +msgid "**N**" +msgstr "**Н**" + +msgid ":func:`next`" +msgstr ":func:`anext`" + +msgid "**O**" +msgstr "**O**" + +msgid ":func:`object`" +msgstr ":func:`object`" + +msgid ":func:`oct`" +msgstr ":func:`oct`" + +msgid ":func:`open`" +msgstr ":func:`open`" + +msgid ":func:`ord`" +msgstr ":func:`ord`" + +msgid "**P**" +msgstr "**P**" + +msgid ":func:`pow`" +msgstr ":func:`pow`" + +msgid ":func:`print`" +msgstr ":func:`print`" + +msgid ":func:`property`" +msgstr ":func:`property`" + +msgid "**R**" +msgstr "**R**" + +msgid "|func-range|_" +msgstr "|func-range|_" + +msgid ":func:`repr`" +msgstr ":func:`repr`" + +msgid ":func:`reversed`" +msgstr ":func:`reversed`" + +msgid ":func:`round`" +msgstr ":func:`round`" + +msgid "**S**" +msgstr "**S**" + +msgid "|func-set|_" +msgstr "|func-set|_" + +msgid ":func:`setattr`" +msgstr ":func:`setattr`" + +msgid ":func:`slice`" +msgstr ":func:`slice`" + +msgid ":func:`sorted`" +msgstr ":func:`sorted`" + +msgid ":func:`staticmethod`" +msgstr ":func:`staticmethod`" + +msgid "|func-str|_" +msgstr "|func-str|_" + +msgid ":func:`sum`" +msgstr ":func:`sum`" + +msgid ":func:`super`" +msgstr ":func:`super`" + +msgid "**T**" +msgstr "**T**" + +msgid "|func-tuple|_" +msgstr "|func-tuple|_" + +msgid ":func:`type`" +msgstr ":func:`type`" + +msgid "**V**" +msgstr "**V**" + +msgid ":func:`vars`" +msgstr ":func:`vars`" + +msgid "**Z**" +msgstr "**Z**" + +msgid ":func:`zip`" +msgstr ":func:`zip`" + +msgid "**_**" +msgstr "**_**" + +msgid ":func:`__import__`" +msgstr ":func:`__import__`" + +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 "" + +msgid "" +"Return an :term:`asynchronous iterator` for an :term:`asynchronous " +"iterable`. Equivalent to calling ``x.__aiter__()``." +msgstr "" +"Повертає :term:`асинхронний ітератор ` для :term:" +"`asynchronous iterable`. Еквівалент виклику ``x.__aiter__()``." + +msgid "Note: Unlike :func:`iter`, :func:`aiter` has no 2-argument variant." +msgstr "" +"Примітка. На відміну від :func:`iter`, :func:`aiter` не має 2х-аргументного " +"варіанту." + +msgid "" +"Return ``True`` if all elements of the *iterable* are true (or if the " +"iterable is empty). Equivalent to::" +msgstr "" +"Повертає ``True``, якщо всі елементи *iterable* є істинними (або якщо " +"iterable порожній). Дорівнює::" + +msgid "" +"def all(iterable):\n" +" for element in iterable:\n" +" if not element:\n" +" return False\n" +" return True" +msgstr "" + +msgid "" +"When awaited, return the next item from the given :term:`asynchronous " +"iterator`, or *default* if given and the iterator is exhausted." +msgstr "" +"Коли очікується, повертає наступний елемент із заданого :term:`asynchronous " +"iterator` або *default*, якщо задано, а ітератор вичерпано." + +msgid "" +"This is the async variant of the :func:`next` builtin, and behaves similarly." +msgstr "" +"Це асинхронний варіант вбудованої функції :func:`next`, і він поводиться " +"аналогічно." + +msgid "" +"This calls the :meth:`~object.__anext__` method of *async_iterator*, " +"returning an :term:`awaitable`. Awaiting this returns the next value of the " +"iterator. If *default* is given, it is returned if the iterator is " +"exhausted, otherwise :exc:`StopAsyncIteration` is raised." +msgstr "" +"Це викликає метод :meth:`~object.__anext__` *async_iterator*, повертаючи :" +"term:`awaitable`. Очікування цього повертає наступне значення ітератора. " +"Якщо вказано *default*, воно повертається, якщо ітератор вичерпано, інакше :" +"exc:`StopAsyncIteration` викликається." + +msgid "" +"Return ``True`` if any element of the *iterable* is true. If the iterable " +"is empty, return ``False``. Equivalent to::" +msgstr "" +"Повертає ``True``, якщо будь-який елемент *iterable* є істинним. Якщо " +"iterable порожній, поверніть ``False``. Дорівнює::" + +msgid "" +"def any(iterable):\n" +" for element in iterable:\n" +" if element:\n" +" return True\n" +" return False" +msgstr "" + +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." +msgstr "" +"Як :func:`repr` повертає рядок, що містить представлення об’єкта для друку, " +"але екранує символи, відмінні від ASCII, у рядку, який повертає :func:" +"`repr`, використовуючи ``\\x``, ``\\u`` або ``\\U`` екранує. Це генерує " +"рядок, подібний до того, який повертає :func:`repr` у Python 2." + +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:" +msgstr "" + +msgid "" +"If the prefix \"0b\" is desired or not, you can use either of the following " +"ways." +msgstr "" +"Якщо префікс \"0b\" потрібний чи ні, ви можете скористатися одним із " +"наведених нижче способів." + +msgid "See also :func:`format` for more information." +msgstr "Дивіться також :func:`format` для отримання додаткової інформації." + +msgid "" +"Return a Boolean value, i.e. one of ``True`` or ``False``. The argument is " +"converted using the standard :ref:`truth testing procedure `. If the " +"argument is false or omitted, this returns ``False``; otherwise, it returns " +"``True``. The :class:`bool` class is a subclass of :class:`int` (see :ref:" +"`typesnumeric`). It cannot be subclassed further. Its only instances are " +"``False`` and ``True`` (see :ref:`typebool`)." +msgstr "" + +msgid "The parameter is now positional-only." +msgstr "Тепер параметр є лише позиційним." + +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` " +"expecting no arguments. In this case, it is purely a convenience function " +"so you don't have to explicitly import :mod:`pdb` or type as much code to " +"enter the debugger. However, :func:`sys.breakpointhook` can be set to some " +"other function and :func:`breakpoint` will automatically call that, allowing " +"you to drop into the debugger of choice. If :func:`sys.breakpointhook` is " +"not accessible, this function will raise :exc:`RuntimeError`." +msgstr "" + +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 "" + +msgid "" +"Note that this is not guaranteed if :func:`sys.breakpointhook` has been " +"replaced." +msgstr "" + +msgid "" +"Raises an :ref:`auditing event ` ``builtins.breakpoint`` with " +"argument ``breakpointhook``." +msgstr "" +"Викликає :ref:`подію аудиту ` ``builtins.breakpoint`` з аргументом " +"``breakpointhook``." + +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 " +"methods of mutable sequences, described in :ref:`typesseq-mutable`, as well " +"as most methods that the :class:`bytes` type has, see :ref:`bytes-methods`." +msgstr "" +"Повертає новий масив байтів. Клас :class:`bytearray` — це змінна " +"послідовність цілих чисел у діапазоні 0 <= x < 256. Він містить більшість " +"звичайних методів змінних послідовностей, описаних у :ref:`typesseq-" +"mutable`, а також більшість методи, які має тип :class:`bytes`, див. :ref:" +"`bytes-methods`." + +msgid "" +"The optional *source* parameter can be used to initialize the array in a few " +"different ways:" +msgstr "" +"Додатковий параметр *source* можна використовувати для ініціалізації масиву " +"кількома різними способами:" + +msgid "" +"If it is a *string*, you must also give the *encoding* (and optionally, " +"*errors*) parameters; :func:`bytearray` then converts the string to bytes " +"using :meth:`str.encode`." +msgstr "" +"Якщо це *рядок*, ви також повинні надати параметри *encoding* (і, " +"необов’язково, *errors*); Потім :func:`bytearray` перетворює рядок на байти " +"за допомогою :meth:`str.encode`." + +msgid "" +"If it is an *integer*, the array will have that size and will be initialized " +"with null bytes." +msgstr "" +"Якщо це *ціле число*, масив матиме такий розмір і буде ініціалізовано " +"нульовими байтами." + +msgid "" +"If it is an object conforming to the :ref:`buffer interface " +"`, a read-only buffer of the object will be used to " +"initialize the bytes array." +msgstr "" +"Якщо це об’єкт, що відповідає :ref:`інтерфейсу буфера `, для " +"ініціалізації масиву байтів буде використано буфер лише для читання об’єкта." + +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." +msgstr "" +"Якщо це *iterable*, це має бути iterable цілих чисел у діапазоні ``0 <= x < " +"256``, які використовуються як початковий вміст масиву." + +msgid "Without an argument, an array of size 0 is created." +msgstr "Без аргументу створюється масив розміром 0." + +msgid "See also :ref:`binaryseq` and :ref:`typebytearray`." +msgstr "Дивіться також :ref:`binaryseq` і :ref:`typebytearray`." + +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 " +"indexing and slicing behavior." +msgstr "" +"Повертає новий об’єкт \"bytes\", який є незмінною послідовністю цілих чисел " +"у діапазоні \"0 <= x < 256\". :class:`bytes` є незмінною версією :class:" +"`bytearray` -- вона має ті самі методи без мутації та таку саму поведінку " +"індексування та зрізання." + +msgid "" +"Accordingly, constructor arguments are interpreted as for :func:`bytearray`." +msgstr "" +"Відповідно, аргументи конструктора інтерпретуються як для :func:`bytearray`." + +msgid "Bytes objects can also be created with literals, see :ref:`strings`." +msgstr "" +"Об’єкти Bytes також можна створювати за допомогою літералів, див. :ref:" +"`strings`." + +msgid "See also :ref:`binaryseq`, :ref:`typebytes`, and :ref:`bytes-methods`." +msgstr "" +"Дивіться також :ref:`binaryseq`, :ref:`typebytes` і :ref:`bytes-methods`." + +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." +msgstr "" + +msgid "" +"This function was first removed in Python 3.0 and then brought back in " +"Python 3.2." +msgstr "" +"Цю функцію спочатку було видалено в Python 3.0, а потім повернуто в Python " +"3.2." + +msgid "" +"Return the string representing a character whose Unicode code point is the " +"integer *i*. For example, ``chr(97)`` returns the string ``'a'``, while " +"``chr(8364)`` returns the string ``'€'``. This is the inverse of :func:`ord`." +msgstr "" +"Повертає рядок, що представляє символ, кодовою точкою Unicode якого є ціле " +"число *i*. Наприклад, ``chr(97)`` повертає рядок ``'a''``, а ``chr(8364)`` " +"повертає рядок ``'€'``. Це зворотне до :func:`ord`." + +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." +msgstr "" +"Допустимий діапазон для аргументу – від 0 до 1 114 111 (0x10FFFF за основою " +"16). :exc:`ValueError` буде викликано, якщо *i* знаходиться за межами цього " +"діапазону." + +msgid "Transform a method into a class method." +msgstr "Перетворення методу в метод класу." + +msgid "" +"A class method receives the class as an implicit first argument, just like " +"an instance method receives the instance. To declare a class method, use " +"this idiom::" +msgstr "" +"Метод класу отримує клас як неявний перший аргумент, так само як метод " +"екземпляра отримує екземпляр. Щоб оголосити метод класу, використовуйте цю " +"ідіому::" + +msgid "" +"class C:\n" +" @classmethod\n" +" def f(cls, arg1, arg2): ..." +msgstr "" + +msgid "" +"The ``@classmethod`` form is a function :term:`decorator` -- see :ref:" +"`function` for details." +msgstr "" +"Форма ``@classmethod`` є функцією :term:`decorator` -- подробиці див. :ref:" +"`function`." + +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 " +"class. If a class method is called for a derived class, the derived class " +"object is passed as the implied first argument." +msgstr "" +"Метод класу можна викликати або в класі (наприклад, ``C.f()``), або в " +"екземплярі (такому як ``C().f()``). Примірник ігнорується, за винятком його " +"класу. Якщо метод класу викликається для похідного класу, об’єкт похідного " +"класу передається як неявний перший аргумент." + +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 " +"class methods, see :ref:`types`." +msgstr "" +"Методи класу відрізняються від статичних методів C++ або Java. Якщо ви " +"хочете їх, перегляньте :func:`staticmethod` у цьому розділі. Для отримання " +"додаткової інформації про методи класу див. :ref:`types`." + +msgid "" +"Class methods can now wrap other :term:`descriptors ` such as :" +"func:`property`." +msgstr "" +"Методи класу тепер можуть обгортати інші :term:`дескриптори `, " +"такі як :func:`property`." + +msgid "" +"Class methods now inherit the method attributes (:attr:`~function." +"__module__`, :attr:`~function.__name__`, :attr:`~function.__qualname__`, :" +"attr:`~function.__doc__` and :attr:`~function.__annotations__`) and have a " +"new ``__wrapped__`` attribute." +msgstr "" + +msgid "" +"Class methods can no longer wrap other :term:`descriptors ` such " +"as :func:`property`." +msgstr "" + +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 " +"string, a byte string, or an AST object. Refer to the :mod:`ast` module " +"documentation for information on how to work with AST objects." +msgstr "" +"Скомпілюйте *джерело* в код або об’єкт AST. Об’єкти коду можуть бути " +"виконані за допомогою :func:`exec` або :func:`eval`. *джерело* може бути " +"звичайним рядком, рядком байтів або об’єктом AST. Зверніться до документації " +"модуля :mod:`ast`, щоб дізнатися, як працювати з об’єктами AST." + +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 (``''`` " +"is commonly used)." +msgstr "" +"Аргумент *ім'я_файлу* повинен давати файл, з якого було прочитано код; " +"передати певне розпізнаване значення, якщо воно не було прочитано з файлу " +"(зазвичай використовується ``' '``)." + +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 " +"it consists of a single expression, or ``'single'`` if it consists of a " +"single interactive statement (in the latter case, expression statements that " +"evaluate to something other than ``None`` will be printed)." +msgstr "" +"Аргумент *mode* визначає тип коду, який потрібно скомпілювати; це може бути " +"``'exec'``, якщо *source* складається з послідовності операторів, " +"``'eval'``, якщо воно складається з одного виразу, або ``'single'``, якщо " +"воно складається з одного інтерактивний оператор (в останньому випадку " +"оператори-вирази, які мають значення, відмінне від ``None``, будуть " +"надруковані)." + +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 "" +"Необов’язкові аргументи *flags* і *dont_inherit* визначають, які :ref:" +"`параметри компілятора ` мають бути активовані та які :" +"ref:`майбутні функції ` мають бути дозволені. Якщо жоден не " +"присутній (або обидва дорівнюють нулю), код компілюється з тими самими " +"прапорцями, які впливають на код, який викликає :func:`compile`. Якщо надано " +"аргумент *flags*, а *dont_inherit* — ні (або дорівнює нулю), то параметри " +"компілятора та майбутні оператори, визначені аргументом *flags*, " +"використовуються на додаток до тих, які були б використані в будь-якому " +"випадку. Якщо *dont_inherit* є ненульовим цілим числом, то це аргумент " +"*flags* — прапори (майбутні функції та параметри компілятора) у " +"навколишньому коді ігноруються." + +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." +msgstr "" +"Параметри компілятора та майбутні оператори визначаються бітами, які можна " +"об’єднати порозрядним АБО, щоб визначити кілька параметрів. Бітове поле, " +"необхідне для вказівки певної майбутньої функції, можна знайти як атрибут :" +"attr:`~__future__._Feature.compiler_flag` екземпляра :class:`~__future__." +"_Feature` у модулі :mod:`__future__`. :ref:`Прапори компілятора ` можна знайти в :mod:`ast` модулі з префіксом ``PyCF_``." + +msgid "" +"The argument *optimize* specifies the optimization level of the compiler; " +"the default value of ``-1`` selects the optimization level of the " +"interpreter as given by :option:`-O` options. Explicit levels are ``0`` (no " +"optimization; ``__debug__`` is true), ``1`` (asserts are removed, " +"``__debug__`` is false) or ``2`` (docstrings are removed too)." +msgstr "" +"Аргумент *optimize* визначає рівень оптимізації компілятора; значення за " +"замовчуванням ``-1`` вибирає рівень оптимізації інтерпретатора, як задано " +"параметрами :option:`-O`. Явні рівні: ``0`` (немає оптимізації; " +"``__debug__`` є істинним), ``1`` (затвердження видалено, ``__debug__`` є " +"хибним) або ``2`` (рядки документа також видалено )." + +msgid "" +"This function raises :exc:`SyntaxError` if the compiled source is invalid, " +"and :exc:`ValueError` if the source contains null bytes." +msgstr "" +"Ця функція викликає :exc:`SyntaxError`, якщо скомпільоване джерело недійсне, " +"і :exc:`ValueError`, якщо джерело містить нульові байти." + +msgid "" +"If you want to parse Python code into its AST representation, see :func:`ast." +"parse`." +msgstr "" +"Якщо ви хочете розібрати код Python у його представлення AST, перегляньте :" +"func:`ast.parse`." + +msgid "" +"Raises an :ref:`auditing event ` ``compile`` with arguments " +"``source`` and ``filename``. This event may also be raised by implicit " +"compilation." +msgstr "" +"Викликає :ref:`подію аудиту ` ``компіляція`` з аргументами " +"``джерело`` та ``назва файлу``. Ця подія також може бути викликана неявною " +"компіляцією." + +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." +msgstr "" +"Під час компіляції рядка з багаторядковим кодом у режимі ``'single'`` або " +"``'eval'`` вхідні дані мають завершуватися принаймні одним символом нового " +"рядка. Це робиться для полегшення виявлення неповних і повних операторів у " +"модулі :mod:`code`." + +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 " +"limitations in Python's AST compiler." +msgstr "" +"Можливий збій інтерпретатора Python із досить великим/складним рядком під " +"час компіляції в об’єкт AST через обмеження глибини стеку в компіляторі AST " +"Python." + +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." +msgstr "" +"Дозволено використання нових рядків у Windows і Mac. Крім того, введення в " +"режимі ``'exec''`` більше не повинно закінчуватися символом нового рядка. " +"Додано параметр *optimize*." + +msgid "" +"Previously, :exc:`TypeError` was raised when null bytes were encountered in " +"*source*." +msgstr "" +"Раніше :exc:`TypeError` виникало, коли в *source* зустрічалися нульові байти." + +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``." +msgstr "" +"``ast.PyCF_ALLOW_TOP_LEVEL_AWAIT`` тепер можна передавати у прапорах, щоб " +"увімкнути підтримку верхнього рівня ``await``, ``async for`` і ``async " +"with``." + +msgid "" +"Convert a single string or number to a complex number, or create a complex " +"number from real and imaginary parts." +msgstr "" +"Перетворює окремий рядок або число на комплексне число, або створює " +"комплексне число з дійсної та уявної частин." + +msgid "Examples:" +msgstr "приклади:" + +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 "" + +msgid "" +"If the argument is a string, it must contain either a real part (in the same " +"format as for :func:`float`) or an imaginary part (in the same format but " +"with a ``'j'`` or ``'J'`` suffix), or both real and imaginary parts (the " +"sign of the imaginary part is mandatory in this case). The string can " +"optionally be surrounded by whitespaces and the round parentheses ``'('`` " +"and ``')'``, which are ignored. The string must not contain whitespace " +"between ``'+'``, ``'-'``, the ``'j'`` or ``'J'`` suffix, and the decimal " +"number. For example, ``complex('1+2j')`` is fine, but ``complex('1 + 2j')`` " +"raises :exc:`ValueError`. More precisely, the input must conform to the :" +"token:`~float:complexvalue` production rule in the following grammar, after " +"parentheses and leading and trailing whitespace characters are removed:" +msgstr "" + +msgid "" +"If the argument is a number, the constructor serves as a numeric conversion " +"like :class:`int` and :class:`float`. For a general Python object ``x``, " +"``complex(x)`` delegates to ``x.__complex__()``. If :meth:`~object." +"__complex__` is not defined then it falls back to :meth:`~object.__float__`. " +"If :meth:`!__float__` is not defined then it falls back to :meth:`~object." +"__index__`." +msgstr "" + +msgid "" +"If two arguments are provided or keyword arguments are used, each argument " +"may be any numeric type (including complex). If both arguments are real " +"numbers, return a complex number with the real component *real* and the " +"imaginary component *imag*. If both arguments are complex numbers, return a " +"complex number with the real component ``real.real-imag.imag`` and the " +"imaginary component ``real.imag+imag.real``. If one of arguments is a real " +"number, only its real component is used in the above expressions." +msgstr "" + +msgid "If all arguments are omitted, returns ``0j``." +msgstr "" + +msgid "The complex type is described in :ref:`typesnumeric`." +msgstr "Складний тип описано в :ref:`typesnumeric`." + +msgid "Grouping digits with underscores as in code literals is allowed." +msgstr "Допускається групування цифр із підкресленням, як у кодових літералах." + +msgid "" +"Falls back to :meth:`~object.__index__` if :meth:`~object.__complex__` and :" +"meth:`~object.__float__` are not defined." +msgstr "" + +msgid "" +"This is a relative of :func:`setattr`. The arguments are an object and a " +"string. The string must be the name of one of the object's attributes. The " +"function deletes the named attribute, provided the object allows it. For " +"example, ``delattr(x, 'foobar')`` is equivalent to ``del x.foobar``. *name* " +"need not be a Python identifier (see :func:`setattr`)." +msgstr "" + +msgid "" +"Create a new dictionary. The :class:`dict` object is the dictionary class. " +"See :class:`dict` and :ref:`typesmapping` for documentation about this class." +msgstr "" +"Створіть новий словник. Об’єкт :class:`dict` є класом словника. Перегляньте :" +"class:`dict` і :ref:`typesmapping` для документації про цей клас." + +msgid "" +"For other containers see the built-in :class:`list`, :class:`set`, and :" +"class:`tuple` classes, as well as the :mod:`collections` module." +msgstr "" +"Для інших контейнерів перегляньте вбудовані класи :class:`list`, :class:" +"`set` і :class:`tuple`, а також модуль :mod:`collections`." + +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 " +"object." +msgstr "" +"Без аргументів повертає список імен у поточній локальній області. За " +"допомогою аргументу спробуйте повернути список дійсних атрибутів для цього " +"об’єкта." + +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." +msgstr "" + +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__`." +msgstr "" + +msgid "" +"The default :func:`dir` mechanism behaves differently with different types " +"of objects, as it attempts to produce the most relevant, rather than " +"complete, information:" +msgstr "" +"Механізм за замовчуванням :func:`dir` поводиться по-різному з різними типами " +"об’єктів, оскільки він намагається створити найбільш релевантну, а не повну " +"інформацію:" + +msgid "" +"If the object is a module object, the list contains the names of the " +"module's attributes." +msgstr "Якщо об’єкт є об’єктом модуля, список містить назви атрибутів модуля." + +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." +msgstr "" +"Якщо об’єкт є об’єктом типу або класу, список містить імена його атрибутів і " +"рекурсивно атрибутів його баз." + +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 " +"base classes." +msgstr "" +"В іншому випадку список містить назви атрибутів об’єкта, назви атрибутів " +"його класу та рекурсивно атрибутів базових класів його класу." + +msgid "The resulting list is sorted alphabetically. For example:" +msgstr "Отриманий список відсортовано за алфавітом. Наприклад:" + +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 " +"it tries to supply a rigorously or consistently defined set of names, and " +"its detailed behavior may change across releases. For example, metaclass " +"attributes are not in the result list when the argument is a class." +msgstr "" +"Оскільки :func:`dir` надається насамперед для зручності використання в " +"інтерактивному запиті, він намагається надати цікавий набір імен більше, ніж " +"намагається надати чітко або послідовно визначений набір імен, і його " +"детальна поведінка може змінитися через випуски. Наприклад, атрибути " +"метакласу відсутні в списку результатів, якщо аргументом є клас." + +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)``." +msgstr "" + +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*." +msgstr "" +"Повертає об’єкт перерахування. *iterable* має бути послідовністю, :term:" +"`iterator` або іншим об’єктом, який підтримує ітерацію. Метод :meth:" +"`~iterator.__next__` ітератора, який повертає :func:`enumerate`, повертає " +"кортеж, що містить лічильник (від *start*, який за замовчуванням дорівнює 0) " +"і значення, отримані в результаті ітерації над *iterable*." + +msgid "Equivalent to::" +msgstr "Дорівнює::" + +msgid "" +"def enumerate(iterable, start=0):\n" +" n = start\n" +" for elem in iterable:\n" +" yield n, elem\n" +" n += 1" +msgstr "" + +msgid "Parameters" +msgstr "Параметри" + +msgid "A Python expression." +msgstr "Вираз Python." + +msgid "The global namespace (default: ``None``)." +msgstr "" + +msgid "The local namespace (default: ``None``)." +msgstr "" + +msgid "Returns" +msgstr "Повернення" + +msgid "The result of the evaluated expression." +msgstr "Результат обчисленого виразу." + +msgid "raises" +msgstr "" + +msgid "Syntax errors are reported as exceptions." +msgstr "Синтаксичні помилки повідомляються як винятки." + +msgid "" +"This function executes arbitrary code. Calling it with user-supplied input " +"may lead to security vulnerabilities." +msgstr "" + +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 "" + +msgid "Example:" +msgstr "приклад:" + +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 " +"of a string. If the code object has been compiled with ``'exec'`` as the " +"*mode* argument, :func:`eval`\\'s return value will be ``None``." +msgstr "" +"Ця функція також може бути використана для виконання довільних об’єктів коду " +"(наприклад, створених :func:`compile`). У цьому випадку передавайте об’єкт " +"коду замість рядка. Якщо об’єкт коду було скомпільовано з ``'exec'`` як " +"аргументом *mode*, значення, що повертається :func:`eval`\\, буде ``None``." + +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 "" +"Підказки: динамічне виконання операторів підтримується функцією :func:" +"`exec`. Функції :func:`globals` і :func:`locals` повертають поточний " +"глобальний і локальний словники відповідно, які можуть бути корисними " +"передати для використання :func:`eval` або :func:`exec`." + +msgid "" +"If the given source is a string, then leading and trailing spaces and tabs " +"are stripped." +msgstr "" +"Якщо дане джерело є рядком, то пробіли та табуляції на початку та в кінці " +"видаляються." + +msgid "" +"See :func:`ast.literal_eval` for a function that can safely evaluate strings " +"with expressions containing only literals." +msgstr "" +"Перегляньте :func:`ast.literal_eval` для функції, яка може безпечно " +"обчислювати рядки з виразами, що містять лише літерали." + +msgid "" +"Raises an :ref:`auditing event ` ``exec`` with the code object as " +"the argument. Code compilation events may also be raised." +msgstr "" +"Викликає :ref:`подію аудиту ` ``exec`` з об’єктом коду як " +"аргументом. Також можуть виникати події компіляції коду." + +msgid "The *globals* and *locals* arguments can now be passed as keywords." +msgstr "" +"Аргументи *globals* і *locals* тепер можуть передаватися як ключові слова." + +msgid "" +"The semantics of the default *locals* namespace have been adjusted as " +"described for the :func:`locals` builtin." +msgstr "" + +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``." +msgstr "" + +msgid "" +"In all cases, if the optional parts are omitted, the code is executed in the " +"current scope. If only *globals* is provided, it must be a dictionary (and " +"not a subclass of dictionary), which will be used for both the global and " +"the local variables. If *globals* and *locals* are given, they are used for " +"the global and local variables, respectively. If provided, *locals* can be " +"any mapping object. Remember that at the module level, globals and locals " +"are the same dictionary." +msgstr "" +"У всіх випадках, якщо опціональні частини пропущені, код виконується в " +"поточній області видимості. Якщо передано тільки *globals*, це має бути " +"словником (а не підкласом словника), який використовуватиметься як для " +"глобальних, так і для локальних змінних. Якщо передано *globals* і *locals*, " +"вони використовуються для глобальних і локальних змінних відповідно. Якщо " +"передано *locals*, це може бути будь-яким об'єктом зіставлення. Пам'ятайте, " +"що на рівні модуля глобальні й локальні змінні є одним і тим самим словником." + +msgid "" +"When ``exec`` gets two separate objects as *globals* and *locals*, the code " +"will be executed as if it were embedded in a class definition. This means " +"functions and classes defined in the executed code will not be able to " +"access variables assigned at the top level (as the \"top level\" variables " +"are treated as class variables in a class definition)." +msgstr "" + +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`." +msgstr "" +"Якщо словник *globals* не містить значення для ключа ``__builtins__``, під " +"цим ключем вставляється посилання на словник вбудованого модуля :mod:" +"`builtins`. Таким чином ви можете контролювати, які вбудовані елементи " +"доступні для виконуваного коду, вставивши свій власний словник " +"``__builtins__`` у *globals* перед передачею його в :func:`exec`." + +msgid "" +"The *closure* argument specifies a closure--a tuple of cellvars. It's only " +"valid when the *object* is a code object containing :term:`free (closure) " +"variables `. The length of the tuple must exactly match " +"the length of the code object's :attr:`~codeobject.co_freevars` attribute." +msgstr "" + +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 "" + +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 "" + +msgid "Added the *closure* parameter." +msgstr "Додано параметр *closure*." + +msgid "" +"Construct an iterator from those elements of *iterable* for which *function* " +"is true. *iterable* may be either a sequence, a container which supports " +"iteration, or an iterator. If *function* is ``None``, the identity function " +"is assumed, that is, all elements of *iterable* that are false are removed." +msgstr "" + +msgid "" +"Note that ``filter(function, iterable)`` is equivalent to the generator " +"expression ``(item for item in iterable if function(item))`` if function is " +"not ``None`` and ``(item for item in iterable if item)`` if function is " +"``None``." +msgstr "" +"Зауважте, що ``filter(function, iterable)`` еквівалентний виразу генератора " +"``(item for item в iterable if function(item))``, якщо функція не є ``None`` " +"і ``(item for item в iterable if item)`` якщо функція ``None``." + +msgid "" +"See :func:`itertools.filterfalse` for the complementary function that " +"returns elements of *iterable* for which *function* is false." +msgstr "" + +msgid "Return a floating-point number constructed from a number or a string." +msgstr "Повертає число з рухомою комою, створене з числа або рядка." + +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 "" + +msgid "" +"If the argument is a string, it should contain a decimal number, optionally " +"preceded by a sign, and optionally embedded in whitespace. The optional " +"sign may be ``'+'`` or ``'-'``; a ``'+'`` sign has no effect on the value " +"produced. The argument may also be a string representing a NaN (not-a-" +"number), or positive or negative infinity. More precisely, the input must " +"conform to the :token:`~float:floatvalue` production rule in the following " +"grammar, after leading and trailing whitespace characters are removed:" +msgstr "" + +msgid "" +"Case is not significant, so, for example, \"inf\", \"Inf\", \"INFINITY\", " +"and \"iNfINity\" are all acceptable spellings for positive infinity." +msgstr "" +"Регістр не має значення, тому, наприклад, \"inf\", \"Inf\", \"INFINITY\" і " +"\"iNfINity\" є прийнятними формами запису для позитивної нескінченності." + +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 " +"precision) is returned. If the argument is outside the range of a Python " +"float, an :exc:`OverflowError` will be raised." +msgstr "" + +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__`." +msgstr "" + +msgid "If no argument is given, ``0.0`` is returned." +msgstr "Якщо аргумент не вказано, повертається ``0.0``." + +msgid "The float type is described in :ref:`typesnumeric`." +msgstr "Тип float описано в :ref:`typesnumeric`." + +msgid "" +"Falls back to :meth:`~object.__index__` if :meth:`~object.__float__` is not " +"defined." +msgstr "" + +msgid "" +"Convert a *value* to a \"formatted\" representation, as controlled by " +"*format_spec*. The interpretation of *format_spec* will depend on the type " +"of the *value* argument; however, there is a standard formatting syntax that " +"is used by most built-in types: :ref:`formatspec`." +msgstr "" +"Перетворення *значення* на \"форматований\" представлення, як керується " +"*format_spec*. Інтерпретація *format_spec* залежатиме від типу аргументу " +"*value*; проте існує стандартний синтаксис форматування, який " +"використовується більшістю вбудованих типів: :ref:`formatspec`." + +msgid "" +"The default *format_spec* is an empty string which usually gives the same " +"effect as calling :func:`str(value) `." +msgstr "" +"За замовчуванням *format_spec* є порожнім рядком, який зазвичай дає той " +"самий ефект, що й виклик :func:`str(value) `." + +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." +msgstr "" + +msgid "" +"``object().__format__(format_spec)`` raises :exc:`TypeError` if " +"*format_spec* is not an empty string." +msgstr "" +"``object().__format__(format_spec)`` викликає :exc:`TypeError`, якщо " +"*format_spec* не є порожнім рядком." + +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." +msgstr "" +"Повертає новий об’єкт :class:`frozenset`, необов’язково з елементами, " +"взятими з *iterable*. ``frozenset`` є вбудованим класом. Перегляньте :class:" +"`frozenset` і :ref:`types-set` для документації про цей клас." + +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." +msgstr "" +"Для інших контейнерів перегляньте вбудовані класи :class:`set`, :class:" +"`list`, :class:`tuple` і :class:`dict`, а також модуль :mod:`collections`." + +msgid "" +"Return the value of the named attribute of *object*. *name* must be a " +"string. If the string is the name of one of the object's attributes, the " +"result is the value of that attribute. For example, ``getattr(x, " +"'foobar')`` is equivalent to ``x.foobar``. If the named attribute does not " +"exist, *default* is returned if provided, otherwise :exc:`AttributeError` is " +"raised. *name* need not be a Python identifier (see :func:`setattr`)." +msgstr "" + +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`." +msgstr "" +"Оскільки :ref:`викривлення приватного імені ` " +"відбувається під час компіляції, потрібно вручну спотворити ім’я приватного " +"атрибута (атрибути з двома символами підкреслення на початку), щоб отримати " +"його за допомогою :func:`getattr`." + +msgid "" +"Return the dictionary implementing the current module namespace. For code " +"within functions, this is set when the function is defined and remains the " +"same regardless of where the function is called." +msgstr "" +"Повертає словник, що реалізує поточний простір імен модуля. Для коду " +"всередині функцій це значення встановлюється під час визначення функції та " +"залишається незмінним незалежно від місця виклику функції." + +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. " +"(This is implemented by calling ``getattr(object, name)`` and seeing whether " +"it raises an :exc:`AttributeError` or not.)" +msgstr "" +"Аргументами є об’єкт і рядок. Результатом є ``True``, якщо рядок є назвою " +"одного з атрибутів об’єкта, ``False``, якщо ні. (Це реалізується шляхом " +"виклику ``getattr(object, name)`` і перевірки, чи викликає це :exc:" +"`AttributeError` чи ні.)" + +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 " +"dictionary lookup. Numeric values that compare equal have the same hash " +"value (even if they are of different types, as is the case for 1 and 1.0)." +msgstr "" +"Повертає хеш-значення об’єкта (якщо воно є). Хеш-значення є цілими числами. " +"Вони використовуються для швидкого порівняння ключів словника під час пошуку " +"в словнику. Числові значення, які порівнюються, мають однакове хеш-значення " +"(навіть якщо вони мають різні типи, як у випадку 1 і 1.0)." + +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." +msgstr "" + +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 " +"interpreter console. If the argument is a string, then the string is looked " +"up as the name of a module, function, class, method, keyword, or " +"documentation topic, and a help page is printed on the console. If the " +"argument is any other kind of object, a help page on the object is generated." +msgstr "" +"Виклик вбудованої довідкової системи. (Ця функція призначена для " +"інтерактивного використання.) Якщо аргумент не задано, інтерактивна " +"довідкова система запускається на консолі інтерпретатора. Якщо аргументом є " +"рядок, то цей рядок шукається як ім’я модуля, функції, класу, методу, " +"ключового слова чи розділу документації, а на консолі друкується довідкова " +"сторінка. Якщо аргументом є об’єкт будь-якого іншого типу, для цього об’єкта " +"буде створено сторінку довідки." + +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 " +"positional-only. For more info, see :ref:`the FAQ entry on positional-only " +"parameters `." +msgstr "" +"Зауважте, що якщо скісна риска (/) з’являється у списку параметрів функції " +"під час виклику :func:`help`, це означає, що параметри перед скісною рискою " +"є лише позиційними. Для отримання додаткової інформації див. :ref:`запис у " +"поширених питаннях щодо позиційних параметрів `." + +msgid "" +"This function is added to the built-in namespace by the :mod:`site` module." +msgstr "Ця функція додається до вбудованого простору імен модулем :mod:`site`." + +msgid "" +"Changes to :mod:`pydoc` and :mod:`inspect` mean that the reported signatures " +"for callables are now more comprehensive and consistent." +msgstr "" +"Зміни в :mod:`pydoc` і :mod:`inspect` означають, що звітні підписи для " +"викликів тепер більш повні та узгоджені." + +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:" +msgstr "" + +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 " +"ways:" +msgstr "" +"Якщо ви хочете перетворити ціле число у верхній або нижній шістнадцятковий " +"рядок із префіксом або без нього, ви можете скористатися одним із наведених " +"нижче способів:" + +msgid "" +"See also :func:`int` for converting a hexadecimal string to an integer using " +"a base of 16." +msgstr "" +"Дивіться також :func:`int` для перетворення шістнадцяткового рядка в ціле " +"число за основою 16." + +msgid "" +"To obtain a hexadecimal string representation for a float, use the :meth:" +"`float.hex` method." +msgstr "" +"Щоб отримати шістнадцяткове представлення рядка для float, використовуйте " +"метод :meth:`float.hex`." + +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. " +"Two objects with non-overlapping lifetimes may have the same :func:`id` " +"value." +msgstr "" +"Повернути \"ідентичність\" об'єкта. Це ціле число, яке гарантовано буде " +"унікальним і постійним для цього об’єкта протягом усього його існування. Два " +"об’єкти з що існують у різні проміжки часу можуть мати однакові значення :" +"func:`id`." + +msgid "This is the address of the object in memory." +msgstr "Це адреса об'єкта в пам'яті." + +msgid "" +"Raises an :ref:`auditing event ` ``builtins.id`` with argument " +"``id``." +msgstr "" +"Викликає :ref:`подію аудиту ` ``builtins.id`` з аргументом ``id``." + +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, " +"converts it to a string (stripping a trailing newline), and returns that. " +"When EOF is read, :exc:`EOFError` is raised. Example::" +msgstr "" +"Якщо присутній аргумент *prompt*, він записується в стандартний вивід без " +"символу нового рядка. Потім функція зчитує рядок із вхідних даних, " +"перетворює його на рядок (вилучаючи кінцевий новий рядок) і повертає його. " +"Під час читання EOF виникає :exc:`EOFError`. Приклад::" + +msgid "" +">>> s = input('--> ')\n" +"--> Monty Python's Flying Circus\n" +">>> s\n" +"\"Monty Python's Flying Circus\"" +msgstr "" + +msgid "" +"If the :mod:`readline` module was loaded, then :func:`input` will use it to " +"provide elaborate line editing and history features." +msgstr "" +"Якщо модуль :mod:`readline` було завантажено, то :func:`input` " +"використовуватиме його для забезпечення складних функцій редагування рядка " +"та історії." + +msgid "" +"Raises an :ref:`auditing event ` ``builtins.input`` with argument " +"``prompt`` before reading input" +msgstr "" +"Викликає :ref:`подію аудиту ` ``builtins.input`` з аргументом " +"``prompt`` перед читанням введення" + +msgid "" +"Raises an :ref:`auditing event ` ``builtins.input/result`` with " +"the result after successfully reading input." +msgstr "" +"Викликає :ref:`подію аудиту ` ``builtins.input/result`` з " +"результатом після успішного читання введення." + +msgid "" +"Return an integer object constructed from a number or a string, or return " +"``0`` if no arguments are given." +msgstr "" + +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 "" + +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 "" + +msgid "" +"If the argument is not a number or if *base* is given, then it must be a " +"string, :class:`bytes`, or :class:`bytearray` instance representing an " +"integer in radix *base*. Optionally, the string can be preceded by ``+`` or " +"``-`` (with no space in between), have leading zeros, be surrounded by " +"whitespace, and have single underscores interspersed between digits." +msgstr "" + +msgid "" +"A base-n integer string contains digits, each representing a value from 0 to " +"n-1. The values 0--9 can be represented by any Unicode decimal digit. The " +"values 10--35 can be represented by ``a`` to ``z`` (or ``A`` to ``Z``). The " +"default *base* is 10. The allowed bases are 0 and 2--36. Base-2, -8, and -16 " +"strings can be optionally prefixed with ``0b``/``0B``, ``0o``/``0O``, or " +"``0x``/``0X``, as with integer literals in code. For base 0, the string is " +"interpreted in a similar way to an :ref:`integer literal in code " +"`, in that the actual base is 2, 8, 10, or 16 as determined by the " +"prefix. Base 0 also disallows leading zeros: ``int('010', 0)`` is not legal, " +"while ``int('010')`` and ``int('010', 8)`` are." +msgstr "" + +msgid "The integer type is described in :ref:`typesnumeric`." +msgstr "Цілочисельний тип описано в :ref:`typesnumeric`." + +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 " +"obtain an integer for the base. Previous versions used :meth:`base.__int__ " +"` instead of :meth:`base.__index__ `." +msgstr "" +"Якщо *base* не є екземпляром :class:`int` і об’єкт *base* має метод :meth:" +"`base.__index__ `, цей метод викликається для отримання " +"цілого числа для бази. У попередніх версіях використовувався :meth:`base." +"__int__ ` замість :meth:`base.__index__ `." + +msgid "The first parameter is now positional-only." +msgstr "Перший параметр тепер є лише позиційним." + +msgid "" +"Falls back to :meth:`~object.__index__` if :meth:`~object.__int__` is not " +"defined." +msgstr "" + +msgid "The delegation to :meth:`~object.__trunc__` is deprecated." +msgstr "" + +msgid "" +":class:`int` string inputs and string representations can be limited to help " +"avoid denial of service attacks. A :exc:`ValueError` is raised when the " +"limit is exceeded while converting a string to an :class:`int` or when " +"converting an :class:`int` into a string would exceed the limit. See the :" +"ref:`integer string conversion length limitation ` " +"documentation." +msgstr "" + +msgid "" +"Return ``True`` if the *object* argument is an instance of the *classinfo* " +"argument, or of a (direct, indirect, or :term:`virtual `) subclass thereof. If *object* is not an object of the given type, " +"the function always returns ``False``. If *classinfo* is a tuple of type " +"objects (or recursively, other such tuples) or a :ref:`types-union` of " +"multiple types, return ``True`` if *object* is an instance of any of the " +"types. If *classinfo* is not a type or tuple of types and such tuples, a :" +"exc:`TypeError` exception is raised. :exc:`TypeError` may not be raised for " +"an invalid type if an earlier check succeeds." +msgstr "" + +msgid "*classinfo* can be a :ref:`types-union`." +msgstr "*classinfo* може бути :ref:`types-union`." + +msgid "" +"Return ``True`` if *class* is a subclass (direct, indirect, or :term:" +"`virtual `) of *classinfo*. A class is considered a " +"subclass of itself. *classinfo* may be a tuple of class objects (or " +"recursively, other such tuples) or a :ref:`types-union`, in which case " +"return ``True`` if *class* is a subclass of any entry in *classinfo*. In " +"any other case, a :exc:`TypeError` exception is raised." +msgstr "" +"Повертає ``True``, якщо *class* є підкласом (прямим, непрямим або :term:" +"`віртуальним `) *classinfo*. Клас вважається підкласом " +"самого себе. *classinfo* може бути кортежем об’єктів класу (або рекурсивно " +"іншими подібними кортежами) або :ref:`types-union`, у цьому випадку повертає " +"``True``, якщо *class* є підкласом будь-якого запису в *інформація про " +"клас*. У будь-якому іншому випадку виникає виняток :exc:`TypeError`." + +msgid "" +"Return an :term:`iterator` object. The first argument is interpreted very " +"differently depending on the presence of the second argument. Without a " +"second argument, *object* must be a collection object which supports the :" +"term:`iterable` protocol (the :meth:`~object.__iter__` method), or it must " +"support the sequence protocol (the :meth:`~object.__getitem__` method with " +"integer arguments starting at ``0``). If it does not support either of " +"those protocols, :exc:`TypeError` is raised. If the second argument, " +"*sentinel*, is given, then *object* must be a callable object. The iterator " +"created in this case will call *object* with no arguments for each call to " +"its :meth:`~iterator.__next__` method; if the value returned is equal to " +"*sentinel*, :exc:`StopIteration` will be raised, otherwise the value will be " +"returned." +msgstr "" + +msgid "See also :ref:`typeiter`." +msgstr "Дивіться також :ref:`typeiter`." + +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 " +"file until the end of file is reached::" +msgstr "" +"Одним із корисних застосувань другої форми :func:`iter` є створення програми " +"для читання блоків. Наприклад, читання блоків фіксованої ширини з бінарного " +"файлу бази даних до досягнення кінця файлу::" + +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 "" + +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 " +"(such as a dictionary, set, or frozen set)." +msgstr "" +"Повертає довжину (кількість елементів) об’єкта. Аргументом може бути " +"послідовність (наприклад, рядок, байти, кортеж, список або діапазон) або " +"колекція (наприклад, словник, набір або заморожений набір)." + +msgid "" +"``len`` raises :exc:`OverflowError` on lengths larger than :data:`sys." +"maxsize`, such as :class:`range(2 ** 100) `." +msgstr "" +"``len`` викликає :exc:`OverflowError` для довжин, більших за :data:`sys." +"maxsize`, наприклад :class:`range(2 ** 100) `." + +msgid "" +"Rather than being a function, :class:`list` is actually a mutable sequence " +"type, as documented in :ref:`typesseq-list` and :ref:`typesseq`." +msgstr "" +"Замість того, щоб бути функцією, :class:`list` насправді є змінним типом " +"послідовності, як описано в :ref:`typesseq-list` і :ref:`typesseq`." + +msgid "" +"Return a mapping object representing the current local symbol table, with " +"variable names as the keys, and their currently bound references as the " +"values." +msgstr "" +" \n" +"Повертає об'єкт зіставлення, що представляє поточну локальну таблицю " +"символів, де імена змінних є ключами, а їх поточні прив'язані посилання — " +"значеннями." + +msgid "" +"At module scope, as well as when using :func:`exec` or :func:`eval` with a " +"single namespace, this function returns the same namespace as :func:" +"`globals`." +msgstr "" + +msgid "" +"At class scope, it returns the namespace that will be passed to the " +"metaclass constructor." +msgstr "" +"У класовій області видимості він повертає простір імен, який буде передано " +"конструктору метакласу." + +msgid "" +"When using ``exec()`` or ``eval()`` with separate local and global " +"arguments, it returns the local namespace passed in to the function call." +msgstr "" + +msgid "" +"In all of the above cases, each call to ``locals()`` in a given frame of " +"execution will return the *same* mapping object. Changes made through the " +"mapping object returned from ``locals()`` will be visible as assigned, " +"reassigned, or deleted local variables, and assigning, reassigning, or " +"deleting local variables will immediately affect the contents of the " +"returned mapping object." +msgstr "" + +msgid "" +"In an :term:`optimized scope` (including functions, generators, and " +"coroutines), each call to ``locals()`` instead returns a fresh dictionary " +"containing the current bindings of the function's local variables and any " +"nonlocal cell references. In this case, name binding changes made via the " +"returned dict are *not* written back to the corresponding local variables or " +"nonlocal cell references, and assigning, reassigning, or deleting local " +"variables and nonlocal cell references does *not* affect the contents of " +"previously returned dictionaries." +msgstr "" + +msgid "" +"Calling ``locals()`` as part of a comprehension in a function, generator, or " +"coroutine is equivalent to calling it in the containing scope, except that " +"the comprehension's initialised iteration variables will be included. In " +"other scopes, it behaves as if the comprehension were running as a nested " +"function." +msgstr "" + +msgid "" +"Calling ``locals()`` as part of a generator expression is equivalent to " +"calling it in a nested generator function." +msgstr "" + +msgid "" +"The behaviour of ``locals()`` in a comprehension has been updated as " +"described in :pep:`709`." +msgstr "" + +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." +msgstr "" + +msgid "" +"Return an iterator that applies *function* to every item of *iterable*, " +"yielding the results. If additional *iterables* arguments are passed, " +"*function* must take that many arguments and is applied to the items from " +"all iterables in parallel. With multiple iterables, the iterator stops when " +"the shortest iterable is exhausted. For cases where the function inputs are " +"already arranged into argument tuples, see :func:`itertools.starmap`\\." +msgstr "" + +msgid "" +"Return the largest item in an iterable or the largest of two or more " +"arguments." +msgstr "" +"Повертає найбільший елемент у ітерації або найбільший з двох чи більше " +"аргументів." + +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 " +"arguments are provided, the largest of the positional arguments is returned." +msgstr "" +"Якщо надається один позиційний аргумент, це має бути :term:`iterable`. " +"Повертається найбільший елемент ітерації. Якщо надано два або більше " +"позиційних аргументів, повертається найбільший із позиційних аргументів." + +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." +msgstr "" +"Є два необов’язкові аргументи лише для ключових слів. Аргумент *key* " +"визначає функцію впорядкування з одним аргументом, подібну до тієї, яка " +"використовується для :meth:`list.sort`. Аргумент *default* визначає об’єкт, " +"який повертається, якщо наданий ітераційний елемент порожній. Якщо iterable " +"порожній і *default* не вказано, виникає :exc:`ValueError`." + +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)``." +msgstr "" +"Якщо кілька елементів є максимальними, функція повертає перший знайдений. Це " +"узгоджується з іншими інструментами збереження стабільності сортування, " +"такими як ``sorted(iterable, key=keyfunc, reverse=True)[0]`` і ``heapq." +"nlargest(1, iterable, key=keyfunc)``." + +msgid "Added the *default* keyword-only parameter." +msgstr "Додано параметр *default*, який можна передавати тільки за ключем." + +msgid "The *key* can be ``None``." +msgstr "*Ключ* може бути ``None``." + +msgid "" +"Return a \"memory view\" object created from the given argument. See :ref:" +"`typememoryview` for more information." +msgstr "" +"Повертає об’єкт \"перегляд пам’яті\", створений із заданого аргументу. " +"Перегляньте :ref:`typememoryview` для отримання додаткової інформації." + +msgid "" +"Return the smallest item in an iterable or the smallest of two or more " +"arguments." +msgstr "" +"Повертає найменший елемент у ітерації або найменший з двох чи більше " +"аргументів." + +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 " +"arguments are provided, the smallest of the positional arguments is returned." +msgstr "" +"Якщо надається один позиційний аргумент, це має бути :term:`iterable`. " +"Повертається найменший елемент ітерації. Якщо надано два або більше " +"позиційних аргументів, повертається найменший із позиційних аргументів." + +msgid "" +"If multiple items are minimal, the function returns the first one " +"encountered. This is consistent with other sort-stability preserving tools " +"such as ``sorted(iterable, key=keyfunc)[0]`` and ``heapq.nsmallest(1, " +"iterable, key=keyfunc)``." +msgstr "" +"Якщо декілька елементів є мінімальними, функція повертає перший знайдений. " +"Це узгоджується з іншими інструментами збереження стабільності сортування, " +"такими як ``sorted(iterable, key=keyfunc)[0]`` і ``heapq.nsmallest(1, " +"iterable, key=keyfunc)``." + +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." +msgstr "" +"Отримайте наступний елемент із :term:`iterator`, викликавши його метод :meth:" +"`~iterator.__next__`. Якщо задано *default*, воно повертається, якщо " +"ітератор вичерпано, інакше :exc:`StopIteration` викликається." + +msgid "" +"This is the ultimate base class of all other classes. It has methods that " +"are common to all instances of Python classes. When the constructor is " +"called, it returns a new featureless object. The constructor does not accept " +"any arguments." +msgstr "" + +msgid "" +":class:`object` instances do *not* have :attr:`~object.__dict__` attributes, " +"so you can't assign arbitrary attributes to an instance of :class:`object`." +msgstr "" + +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:" +msgstr "" + +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." +msgstr "" +"Якщо ви хочете перетворити ціле число на вісімковий рядок із префіксом " +"\"0o\" чи ні, ви можете скористатися одним із наведених нижче способів." + +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 " +"examples of how to use this function." +msgstr "" +"Відкрийте *файл* і поверніть відповідний :term:`file object`. Якщо файл " +"неможливо відкрити, виникає :exc:`OSError`. Перегляньте :ref:`tut-files` для " +"отримання додаткових прикладів використання цієї функції." + +msgid "" +"*file* is a :term:`path-like object` giving the pathname (absolute or " +"relative to the current working directory) of the file to be opened or an " +"integer file descriptor of the file to be wrapped. (If a file descriptor is " +"given, it is closed when the returned I/O object is closed unless *closefd* " +"is set to ``False``.)" +msgstr "" +"*file* — це :term:`path-like object`, що надає шлях (абсолютний або " +"відносний до поточного робочого каталогу) до файлу, який потрібно відкрити, " +"або цілочисельний файловий дескриптор файлу, який потрібно обернути. (Якщо " +"задано дескриптор файлу, він закривається, коли повертається об’єкт вводу/" +"виводу, якщо *closefd* не має значення ``False``.)" + +msgid "" +"*mode* is an optional string that specifies the mode in which the file is " +"opened. It defaults to ``'r'`` which means open for reading in text mode. " +"Other common values are ``'w'`` for writing (truncating the file if it " +"already exists), ``'x'`` for exclusive creation, and ``'a'`` for appending " +"(which on *some* Unix systems, means that *all* writes append to the end of " +"the file regardless of the current seek position). In text mode, if " +"*encoding* is not specified the encoding used is platform-dependent: :func:" +"`locale.getencoding` is called to get the current locale encoding. (For " +"reading and writing raw bytes use binary mode and leave *encoding* " +"unspecified.) The available modes are:" +msgstr "" + +msgid "Character" +msgstr "характер" + +msgid "Meaning" +msgstr "Значення" + +msgid "``'r'``" +msgstr "``'r''``" + +msgid "open for reading (default)" +msgstr "відкритий для читання (за замовчуванням)" + +msgid "``'w'``" +msgstr "``'w'``" + +msgid "open for writing, truncating the file first" +msgstr "відкрити для запису, спочатку скоротивши файл" + +msgid "``'x'``" +msgstr "``'x''``" + +msgid "open for exclusive creation, failing if the file already exists" +msgstr "відкрити для ексклюзивного створення, якщо файл уже існує" + +msgid "``'a'``" +msgstr "``'a'``" + +msgid "open for writing, appending to the end of file if it exists" +msgstr "відкрито для запису, додаючи в кінець файлу, якщо він існує" + +msgid "``'b'``" +msgstr "``'b''``" + +msgid "binary mode" +msgstr "двійковий режим" + +msgid "``'t'``" +msgstr "``'t''``" + +msgid "text mode (default)" +msgstr "текстовий режим (за замовчуванням)" + +msgid "``'+'``" +msgstr "``'+'``" + +msgid "open for updating (reading and writing)" +msgstr "відкритий для оновлення (читання та запис)" + +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 " +"``'r+b'`` open the file with no truncation." +msgstr "" +"Типовим режимом є ``'r'`` (відкритий для читання тексту, синонім ``'rt'``). " +"Режими ``'w+'`` і ``'w+b'`` відкривають і скорочують файл. Режими ``'r+'`` і " +"``'r+b'`` відкривають файл без скорочення." + +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* " +"argument) return contents as :class:`bytes` objects without any decoding. " +"In text mode (the default, or when ``'t'`` is included in the *mode* " +"argument), the contents of the file are returned as :class:`str`, the bytes " +"having been first decoded using a platform-dependent encoding or using the " +"specified *encoding* if given." +msgstr "" +"Як згадувалося в :ref:`io-overview`, Python розрізняє двійковий і текстовий " +"ввід-вивід. Файли, відкриті в двійковому режимі (включаючи ``'b'`` в " +"аргументі *mode*) повертають вміст як об’єкти :class:`bytes` без будь-якого " +"декодування. У текстовому режимі (за замовчуванням або коли ``'t'`` включено " +"в аргумент *mode*) вміст файлу повертається як :class:`str`, байти, які " +"спочатку були декодовані за допомогою платформи -залежне кодування або " +"використання зазначеного *кодування*, якщо воно вказано." + +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 " +"platform-independent." +msgstr "" +"Python не залежить від поняття текстових файлів базової операційної системи; " +"вся обробка виконується самим Python, і тому вона не залежить від платформи." + +msgid "" +"*buffering* is an optional integer used to set the buffering policy. Pass 0 " +"to switch buffering off (only allowed in binary mode), 1 to select line " +"buffering (only usable when writing in text mode), and an integer > 1 to " +"indicate the size in bytes of a fixed-size chunk buffer. Note that " +"specifying a buffer size this way applies for binary buffered I/O, but " +"``TextIOWrapper`` (i.e., files opened with ``mode='r+'``) would have another " +"buffering. To disable buffering in ``TextIOWrapper``, consider using the " +"``write_through`` flag for :func:`io.TextIOWrapper.reconfigure`. When no " +"*buffering* argument is given, the default buffering policy works as follows:" +msgstr "" + +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 " +"size\" and falling back on :const:`io.DEFAULT_BUFFER_SIZE`. On many " +"systems, the buffer will typically be 4096 or 8192 bytes long." +msgstr "" + +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 "" +"\"Інтерактивні\" текстові файли (файли, для яких :meth:`~io.IOBase.isatty` " +"повертає ``True``) використовують буферизацію рядка. Інші текстові файли " +"використовують політику, описану вище для двійкових файлів." + +msgid "" +"*encoding* is the name of the encoding used to decode or encode the file. " +"This should only be used in text mode. The default encoding is platform " +"dependent (whatever :func:`locale.getencoding` returns), but any :term:`text " +"encoding` supported by Python can be used. See the :mod:`codecs` module for " +"the list of supported encodings." +msgstr "" + +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:" +msgstr "" +"*errors* — це необов’язковий рядок, який визначає, як мають оброблятися " +"помилки кодування та декодування — це не можна використовувати в двійковому " +"режимі. Доступні різноманітні стандартні обробники помилок (перераховані в :" +"ref:`error-handlers`), хоча будь-яка назва обробки помилок, зареєстрована в :" +"func:`codecs.register_error`, також дійсна. Стандартні назви включають:" + +msgid "" +"``'strict'`` to raise a :exc:`ValueError` exception if there is an encoding " +"error. The default value of ``None`` has the same effect." +msgstr "" +"``'strict'``, щоб викликати виключення :exc:`ValueError`, якщо є помилка " +"кодування. Значення за замовчуванням \"Немає\" має той самий ефект." + +msgid "" +"``'ignore'`` ignores errors. Note that ignoring encoding errors can lead to " +"data loss." +msgstr "" +"``'ignore''`` ігнорує помилки. Зауважте, що ігнорування помилок кодування " +"може призвести до втрати даних." + +msgid "" +"``'replace'`` causes a replacement marker (such as ``'?'``) to be inserted " +"where there is malformed data." +msgstr "" +"``'replace'`` вставляє маркер заміни (наприклад, ``'?'``), де є неправильно " +"сформовані дані." + +msgid "" +"``'surrogateescape'`` will represent any incorrect bytes as low surrogate " +"code units ranging from U+DC80 to U+DCFF. These surrogate code units will " +"then be turned back into the same bytes when the ``surrogateescape`` error " +"handler is used when writing data. This is useful for processing files in " +"an unknown encoding." +msgstr "" +"``'surrogateescape'`` представлятиме будь-які неправильні байти як одиниці " +"нижнього сурогатного коду в діапазоні від U+DC80 до U+DCFF. Ці одиниці " +"сурогатного коду потім будуть перетворені назад у ті самі байти, коли під " +"час запису даних використовується обробник помилок ``surrogateescape``. Це " +"корисно для обробки файлів у невідомому кодуванні." + +msgid "" +"``'xmlcharrefreplace'`` is only supported when writing to a file. Characters " +"not supported by the encoding are replaced with the appropriate XML " +"character reference :samp:`&#{nnn};`." +msgstr "" + +msgid "" +"``'backslashreplace'`` replaces malformed data by Python's backslashed " +"escape sequences." +msgstr "" +"``'backslashreplace'`` замінює некоректні дані керуючими послідовностями " +"Python зі зворотною похилою рискою." + +msgid "" +"``'namereplace'`` (also only supported when writing) replaces unsupported " +"characters with ``\\N{...}`` escape sequences." +msgstr "" +"``'namereplace'`` (також підтримується лише під час запису) замінює " +"непідтримувані символи ``\\N{...}`` керуючими послідовностями." + +msgid "" +"*newline* determines how to parse newline characters from the stream. It can " +"be ``None``, ``''``, ``'\\n'``, ``'\\r'``, and ``'\\r\\n'``. It works as " +"follows:" +msgstr "" + +msgid "" +"When reading input from the stream, if *newline* is ``None``, universal " +"newlines mode is enabled. Lines in the input can end in ``'\\n'``, " +"``'\\r'``, or ``'\\r\\n'``, and these are translated into ``'\\n'`` before " +"being returned to the caller. If it is ``''``, universal newlines mode is " +"enabled, but line endings are returned to the caller untranslated. If it " +"has any of the other legal values, input lines are only terminated by the " +"given string, and the line ending is returned to the caller untranslated." +msgstr "" +"Під час читання вхідних даних із потоку, якщо *новий рядок* має значення " +"``None``, увімкнено універсальний режим нових рядків. Рядки у вхідних даних " +"можуть закінчуватися на ``'\\n'``, ``'\\r'`` або ``'\\r\\n'``, і вони " +"перекладаються на ``'\\n'`` перед поверненням до абонента. Якщо це ``''``, " +"універсальний режим нових рядків увімкнено, але закінчення рядків " +"повертаються абоненту без перекладу. Якщо він має будь-яке з інших " +"дозволених значень, рядки введення завершуються лише заданим рядком, а " +"закінчення рядка повертається до викликаючого без перекладу." + +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." +msgstr "" +"Під час запису вихідних даних у потік, якщо *новий рядок* має значення " +"``None``, будь-які записані символи ``'\\n'`` переводяться в системний " +"роздільник рядків за умовчанням, :data:`os.linesep`. Якщо *новий рядок* є " +"``''`` або ``'\\n'``, переклад не відбувається. Якщо *новий рядок* є будь-" +"яким іншим допустимим значенням, будь-які написані символи ``'\\n'`` " +"переводяться в заданий рядок." + +msgid "" +"If *closefd* is ``False`` and a file descriptor rather than a filename was " +"given, the underlying file descriptor will be kept open when the file is " +"closed. If a filename is given *closefd* must be ``True`` (the default); " +"otherwise, an error will be raised." +msgstr "" +"Якщо *closefd* має значення ``False`` і вказано дескриптор файлу, а не ім’я " +"файлу, базовий дескриптор файлу залишатиметься відкритим, коли файл буде " +"закрито. Якщо вказано ім’я файлу *closefd* має бути ``True`` (за " +"замовчуванням); інакше виникне помилка." + +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 " +"*opener* with (*file*, *flags*). *opener* must return an open file " +"descriptor (passing :mod:`os.open` as *opener* results in functionality " +"similar to passing ``None``)." +msgstr "" +"Спеціальний відкривач можна використовувати, передавши виклик як *opener*. " +"Базовий файловий дескриптор для об’єкта файлу потім отримується шляхом " +"виклику *opener* за допомогою (*file*, *flags*). *opener* має повертати " +"дескриптор відкритого файлу (передача :mod:`os.open` як *opener* призводить " +"до функціональності, подібної до передачі ``None``)." + +msgid "The newly created file is :ref:`non-inheritable `." +msgstr "Щойно створений файл :ref:`не успадковується `." + +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::" +msgstr "" +"У наступному прикладі використовується параметр :ref:`dir_fd ` " +"функції :func:`os.open` для відкриття файлу відносно заданого каталогу::" + +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 "" + +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 " +"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 "" +"Тип об’єкта :term:`file object`, який повертає функція :func:`open`, " +"залежить від режиму. Коли :func:`open` використовується для відкриття файлу " +"в текстовому режимі (``'w'``, ``'r'``, ``'wt'``, ``'rt'``, тощо), він " +"повертає підклас :class:`io.TextIOBase` (зокрема :class:`io.TextIOWrapper`). " +"Коли файл використовується для відкриття файлу в бінарному режимі з " +"буферизацією, повертається клас є підкласом :class:`io.BufferedIOBase`. " +"Точний клас різниться: у бінарному режимі читання він повертає :class:`io." +"BufferedReader`; у двійкових режимах запису та додавання повертає :class:`io." +"BufferedWriter`, а в режимі читання/запису повертає :class:`io." +"BufferedRandom`. Коли буферизацію вимкнено, повертається необроблений потік, " +"підклас :class:`io.RawIOBase`, :class:`io.FileIO`." + +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`." +msgstr "" +"Перегляньте також модулі обробки файлів, такі як :mod:`fileinput`, :mod:`io` " +"(де оголошено :func:`open`), :mod:`os`, :mod:`os.path`, :mod:`tempfile` і :" +"mod:`shutil`." + +msgid "" +"Raises an :ref:`auditing event ` ``open`` with arguments ``path``, " +"``mode``, ``flags``." +msgstr "" +"Викликає :ref:`подію аудиту ` ``open`` з аргументами ``path``, " +"``mode``, ``flags``." + +msgid "" +"The ``mode`` and ``flags`` arguments may have been modified or inferred from " +"the original call." +msgstr "" +"Аргументи ``mode`` і ``flags`` могли бути змінені або виведені з початкового " +"виклику." + +msgid "The *opener* parameter was added." +msgstr "Додано параметр *opener*." + +msgid "The ``'x'`` mode was added." +msgstr "Додано режим ``'x``." + +msgid ":exc:`IOError` used to be raised, it is now an alias of :exc:`OSError`." +msgstr ":exc:`IOError` раніше викликався, тепер це псевдонім :exc:`OSError`." + +msgid "" +":exc:`FileExistsError` is now raised if the file opened in exclusive " +"creation mode (``'x'``) already exists." +msgstr "" +":exc:`FileExistsError` тепер викликається, якщо файл, відкритий у " +"монопольному режимі створення (``'x'``), уже існує." + +msgid "The file is now non-inheritable." +msgstr "Тепер файл не успадковується." + +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)." +msgstr "" +"Якщо системний виклик перервано, а обробник сигналу не викликає виключення, " +"функція тепер повторює системний виклик замість того, щоб викликати виняток :" +"exc:`InterruptedError` (перегляньте :pep:`475` для обґрунтування)." + +msgid "The ``'namereplace'`` error handler was added." +msgstr "Додано обробник помилок ``'namereplace'``." + +msgid "Support added to accept objects implementing :class:`os.PathLike`." +msgstr "" +"Додано підтримку прийняття об’єктів, що реалізують :class:`os.PathLike`." + +msgid "" +"On Windows, opening a console buffer may return a subclass of :class:`io." +"RawIOBase` other than :class:`io.FileIO`." +msgstr "" +"У Windows відкриття буфера консолі може повернути підклас :class:`io." +"RawIOBase`, відмінний від :class:`io.FileIO`." + +msgid "The ``'U'`` mode has been removed." +msgstr "" + +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`." +msgstr "" +"Дано рядок, що представляє один символ Unicode, повертає ціле число, що " +"представляє код Unicode цього символу. Наприклад, ``ord('a')`` повертає ціле " +"число ``97``, ``ord('€')`` (знак євро) повертає ``8364``. Це зворотне до :" +"func:`chr`." + +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) % " +"mod``). The two-argument form ``pow(base, exp)`` is equivalent to using the " +"power operator: ``base**exp``." +msgstr "" +"Повернути *base* до потужності *exp*; якщо присутній *mod*, повертає *base* " +"до ступеня *exp*, за модулем *mod* (обчислюється ефективніше, ніж " +"``pow(base, exp) % mod``). Форма з двома аргументами ``pow(base, exp)`` " +"еквівалентна використанню оператора ступеня: ``base**exp``." + +msgid "" +"The arguments must have numeric types. With mixed operand types, the " +"coercion rules for binary arithmetic operators apply. For :class:`int` " +"operands, the result has the same type as the operands (after coercion) " +"unless the second argument is negative; in that case, all arguments are " +"converted to float and a float result is delivered. For example, ``pow(10, " +"2)`` returns ``100``, but ``pow(10, -2)`` returns ``0.01``. For a negative " +"base of type :class:`int` or :class:`float` and a non-integral exponent, a " +"complex result is delivered. For example, ``pow(-9, 0.5)`` returns a value " +"close to ``3j``. Whereas, for a negative base of type :class:`int` or :class:" +"`float` with an integral exponent, a float result is delivered. For example, " +"``pow(-9, 2.0)`` returns ``81.0``." +msgstr "" + +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 " +"*exp* is negative, *base* must be relatively prime to *mod*. In that case, " +"``pow(inv_base, -exp, mod)`` is returned, where *inv_base* is an inverse to " +"*base* modulo *mod*." +msgstr "" +"Для :class:`int` операндів *base* і *exp*, якщо присутній *mod*, *mod* також " +"має бути цілого типу, а *mod* має бути ненульовим. Якщо *mod* присутній і " +"*exp* від’ємний, *base* має бути відносно простим до *mod*. У цьому випадку " +"повертається ``pow(inv_base, -exp, mod)``, де *inv_base* є оберненим до " +"*base* за модулем *mod*." + +msgid "Here's an example of computing an inverse for ``38`` modulo ``97``::" +msgstr "Ось приклад обчислення оберненого числа для ``38`` за модулем ``97``::" + +msgid "" +">>> pow(38, -1, mod=97)\n" +"23\n" +">>> 23 * 38 % 97 == 1\n" +"True" +msgstr "" + +msgid "" +"For :class:`int` operands, the three-argument form of ``pow`` now allows the " +"second argument to be negative, permitting computation of modular inverses." +msgstr "" +"Для операндів :class:`int` форма з трьома аргументами ``pow`` тепер дозволяє " +"другому аргументу бути від’ємним, що дозволяє обчислювати модульні обернені." + +msgid "" +"Allow keyword arguments. Formerly, only positional arguments were supported." +msgstr "" +"Дозволити аргументи ключових слів. Раніше підтримувалися лише позиційні " +"аргументи." + +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 " +"keyword arguments." +msgstr "" +"Вивести *об’єкти* в *файл* текстового потоку, розділивши *sep* і " +"супроводжуючи *end*. *sep*, *end*, *file* і *flush*, якщо вони присутні, " +"потрібно надати як аргументи ключового слова." + +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* " +"and *end* must be strings; they can also be ``None``, which means to use the " +"default values. If no *objects* are given, :func:`print` will just write " +"*end*." +msgstr "" +"Усі аргументи, не пов’язані з ключовими словами, перетворюються на рядки, як " +"це робить :func:`str`, і записуються в потік, розділені символом *sep* і " +"після нього *end*. І *sep*, і *end* повинні бути рядками; вони також можуть " +"бути ``None``, що означає використання стандартних значень. Якщо *об’єктів* " +"не надано, :func:`print` просто напише *end*." + +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 " +"arguments are converted to text strings, :func:`print` cannot be used with " +"binary mode file objects. For these, use ``file.write(...)`` instead." +msgstr "" +"Аргумент *file* має бути об’єктом із методом ``write(string)``; якщо його " +"немає або ``None``, буде використано :data:`sys.stdout`. Оскільки " +"надруковані аргументи перетворюються на текстові рядки, :func:`print` не " +"можна використовувати з об’єктами файлу двійкового режиму. Для цього замість " +"цього використовуйте ``file.write(...)``." + +msgid "" +"Output buffering is usually determined by *file*. However, if *flush* is " +"true, the stream is forcibly flushed." +msgstr "" +" Буферизація виходу зазвичай визначається параметром *file*. Однак, якщо " +"*flush* дорівнює true, потік примусово очищується." + +msgid "Added the *flush* keyword argument." +msgstr "Додано аргумент ключового слова *flush*." + +msgid "Return a property attribute." +msgstr "Повертає атрибут властивості." + +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 " +"attribute value. And *doc* creates a docstring for the attribute." +msgstr "" +"*fget* — це функція для отримання значення атрибута. *fset* — це функція для " +"встановлення значення атрибута. *fdel* — це функція для видалення значення " +"атрибута. А *doc* створює рядок документації для атрибута." + +msgid "A typical use is to define a managed attribute ``x``::" +msgstr "Типовим використанням є визначення керованого атрибута ``x``::" + +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 "" + +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 "" +"Якщо *c* є екземпляром *C*, ``c.x`` викличе засіб отримання, ``c.x = value`` " +"викличе установник, а ``del c.x`` засіб видалення." + +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`::" +msgstr "" +"Якщо вказано, *doc* буде рядком документації атрибута властивості. В іншому " +"випадку властивість скопіює рядок документа *fget* (якщо він існує). Це дає " +"змогу легко створювати властивості лише для читання, використовуючи :func:" +"`property` як :term:`decorator`::" + +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 "" + +msgid "" +"The ``@property`` decorator turns the :meth:`!voltage` method into a " +"\"getter\" for a read-only attribute with the same name, and it sets the " +"docstring for *voltage* to \"Get the current voltage.\"" +msgstr "" + +msgid "" +"A property object has ``getter``, ``setter``, and ``deleter`` methods usable " +"as decorators that create a copy of the property with the corresponding " +"accessor function set to the decorated function. This is best explained " +"with an example:" +msgstr "" + +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 "" + +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 " +"case.)" +msgstr "" +"Цей код точно еквівалентний першому прикладу. Обов’язково дайте додатковим " +"функціям те саме ім’я, що й початкова властивість (у цьому випадку ``x``)." + +msgid "" +"The returned property object also has the attributes ``fget``, ``fset``, and " +"``fdel`` corresponding to the constructor arguments." +msgstr "" +"Повернений об’єкт властивості також має атрибути ``fget``, ``fset`` і " +"``fdel``, що відповідають аргументам конструктора." + +msgid "The docstrings of property objects are now writeable." +msgstr "Рядки документації об’єктів властивості тепер доступні для запису." + +msgid "" +"Attribute holding the name of the property. The name of the property can be " +"changed at runtime." +msgstr "" +"Атрибут, що містить ім'я властивості. Ім'я властивості можна змінити під час " +"виконання програми." + +msgid "" +"Rather than being a function, :class:`range` is actually an immutable " +"sequence type, as documented in :ref:`typesseq-range` and :ref:`typesseq`." +msgstr "" +"Замість того, щоб бути функцією, :class:`range` насправді є незмінним типом " +"послідовності, як описано в :ref:`typesseq-range` і :ref:`typesseq`." + +msgid "" +"Return a string containing a printable representation of an object. For " +"many types, this function makes an attempt to return a string that would " +"yield an object with the same value when passed to :func:`eval`; otherwise, " +"the representation is a string enclosed in angle brackets that contains the " +"name of the type of the object together with additional information often " +"including the name and address of the object. A class can control what this " +"function returns for its instances by defining a :meth:`~object.__repr__` " +"method. If :func:`sys.displayhook` is not accessible, this function will " +"raise :exc:`RuntimeError`." +msgstr "" + +msgid "This class has a custom representation that can be evaluated::" +msgstr "Цей клас має власне представлення, яке можна оцінити::" + +msgid "" +"class Person:\n" +" def __init__(self, name, age):\n" +" self.name = name\n" +" self.age = age\n" +"\n" +" def __repr__(self):\n" +" return f\"Person('{self.name}', {self.age})\"" +msgstr "" + +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``)." +msgstr "" + +msgid "" +"Return *number* rounded to *ndigits* precision after the decimal point. If " +"*ndigits* is omitted or is ``None``, it returns the nearest integer to its " +"input." +msgstr "" +"Повертає *число*, округлене до *nцифр* з точністю після коми. Якщо *ndigits* " +"опущено або має значення ``None``, він повертає найближче ціле число до " +"вхідних даних." + +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 " +"equally close, rounding is done toward the even choice (so, for example, " +"both ``round(0.5)`` and ``round(-0.5)`` are ``0``, and ``round(1.5)`` is " +"``2``). Any integer value is valid for *ndigits* (positive, zero, or " +"negative). The return value is an integer if *ndigits* is omitted or " +"``None``. Otherwise, the return value has the same type as *number*." +msgstr "" +"Для вбудованих типів, які підтримують :func:`round`, значення округлюються " +"до найближчого кратного 10 у степені мінус *ndigits*; якщо два кратні " +"однаково близькі, округлення виконується в бік парного вибору (тому, " +"наприклад, як ``round(0.5)``, так і ``round(-0.5)`` є ``0``, а " +"``round(1.5)`` є ``2``). Будь-яке ціле значення є дійсним для *nцифр* " +"(додатне, нульове або від’ємне). Повернене значення є цілим числом, якщо " +"*ndigits* пропущено або ``None``. В іншому випадку значення, що " +"повертається, має той самий тип, що й *число*." + +msgid "" +"For a general Python object ``number``, ``round`` delegates to ``number." +"__round__``." +msgstr "" +"Для загального об’єкта Python ``number`` ``round`` делегує ``number." +"__round__``." + +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 " +"not a bug: it's a result of the fact that most decimal fractions can't be " +"represented exactly as a float. See :ref:`tut-fp-issues` for more " +"information." +msgstr "" +"Поведінка :func:`round` для числа з плаваючою точкою може бути несподіваною: " +"наприклад, ``round(2.675, 2)`` дає ``2.67`` замість очікуваного ``2.68``. Це " +"не помилка: це результат того факту, що більшість десяткових дробів не можна " +"представити точно як число з плаваючою точкою. Перегляньте :ref:`tut-fp-" +"issues` для отримання додаткової інформації." + +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." +msgstr "" +"Повертає новий об’єкт :class:`set`, необов’язково з елементами, взятими з " +"*iterable*. ``набір`` є вбудованим класом. Перегляньте :class:`set` і :ref:" +"`types-set` для документації про цей клас." + +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." +msgstr "" +"Для інших контейнерів перегляньте вбудовані класи :class:`frozenset`, :class:" +"`list`, :class:`tuple` і :class:`dict`, а також модуль :mod:`collections`." + +msgid "" +"This is the counterpart of :func:`getattr`. The arguments are an object, a " +"string, and an arbitrary value. The string may name an existing attribute " +"or a new attribute. The function assigns the value to the attribute, " +"provided the object allows it. For example, ``setattr(x, 'foobar', 123)`` " +"is equivalent to ``x.foobar = 123``." +msgstr "" +"Це відповідник :func:`getattr`. Аргументами є об’єкт, рядок і довільне " +"значення. Рядок може називати існуючий атрибут або новий атрибут. Функція " +"присвоює значення атрибуту, якщо це дозволяє об’єкт. Наприклад, ``setattr(x, " +"'foobar', 123)`` еквівалентно ``x.foobar = 123``." + +msgid "" +"*name* need not be a Python identifier as defined in :ref:`identifiers` " +"unless the object chooses to enforce that, for example in a custom :meth:" +"`~object.__getattribute__` or via :attr:`~object.__slots__`. An attribute " +"whose name is not an identifier will not be accessible using the dot " +"notation, but is accessible through :func:`getattr` etc.." +msgstr "" + +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 set it with :func:`setattr`." +msgstr "" +"Оскільки :ref:`викривлення приватного імені ` " +"відбувається під час компіляції, потрібно вручну спотворити ім’я приватного " +"атрибута (атрибути з двома символами підкреслення на початку), щоб " +"встановити його за допомогою :func:`setattr`." + +msgid "" +"Return a :term:`slice` object representing the set of indices specified by " +"``range(start, stop, step)``. The *start* and *step* arguments default to " +"``None``." +msgstr "" + +msgid "" +"Slice objects have read-only data attributes :attr:`!start`, :attr:`!stop`, " +"and :attr:`!step` which merely return the argument values (or their " +"default). They have no other explicit functionality; however, they are used " +"by NumPy and other third-party packages." +msgstr "" + +msgid "" +"Slice objects are also generated when extended indexing syntax is used. For " +"example: ``a[start:stop:step]`` or ``a[start:stop, i]``. See :func:" +"`itertools.islice` for an alternate version that returns an :term:`iterator`." +msgstr "" + +msgid "" +"Slice objects are now :term:`hashable` (provided :attr:`~slice.start`, :attr:" +"`~slice.stop`, and :attr:`~slice.step` are hashable)." +msgstr "" + +msgid "Return a new sorted list from the items in *iterable*." +msgstr "Повертає новий відсортований список з елементів у *iterable*." + +msgid "" +"Has two optional arguments which must be specified as keyword arguments." +msgstr "" +"Має два необов’язкові аргументи, які необхідно вказати як аргументи " +"ключового слова." + +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)." +msgstr "" +"*key* визначає функцію одного аргументу, яка використовується для отримання " +"ключа порівняння з кожного елемента в *iterable* (наприклад, ``key=str." +"lower``). Значення за замовчуванням – ``None`` (пряме порівняння елементів)." + +msgid "" +"*reverse* is a boolean value. If set to ``True``, then the list elements " +"are sorted as if each comparison were reversed." +msgstr "" +"*reverse* — це логічне значення. Якщо встановлено значення ``True``, " +"елементи списку сортуються так, ніби кожне порівняння було зворотним." + +msgid "" +"Use :func:`functools.cmp_to_key` to convert an old-style *cmp* function to a " +"*key* function." +msgstr "" +"Використовуйте :func:`functools.cmp_to_key`, щоб перетворити функцію *cmp* " +"старого стилю на функцію *key*." + +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 " +"compare equal --- this is helpful for sorting in multiple passes (for " +"example, sort by department, then by salary grade)." +msgstr "" +"Вбудована функція :func:`sorted` гарантовано буде стабільною. Сортування є " +"стабільним, якщо воно гарантує відсутність зміни відносного порядку " +"порівнюваних рівних елементів --- це корисно для сортування за кілька " +"проходів (наприклад, сортування за відділом, а потім за ступенем заробітної " +"плати)." + +msgid "" +"The sort algorithm uses only ``<`` comparisons between items. While " +"defining an :meth:`~object.__lt__` method will suffice for sorting, :PEP:`8` " +"recommends that all six :ref:`rich comparisons ` be " +"implemented. This will help avoid bugs when using the same data with other " +"ordering tools such as :func:`max` that rely on a different underlying " +"method. Implementing all six comparisons also helps avoid confusion for " +"mixed type comparisons which can call reflected the :meth:`~object.__gt__` " +"method." +msgstr "" +"Алгоритм сортування використовує лише ``<`` comparisons between items. " +"While defining an :meth:`~object.__lt__` method will suffice for sorting, :" +"PEP:`8` recommends that all six :ref:`rich comparisons `. Це " +"допоможе уникнути помилок під час використання тих самих даних з іншими " +"інструментами впорядкування, такими як :func:`max`, які покладаються на " +"інший базовий метод. Реалізація всіх шести порівнянь також допомагає " +"уникнути плутанини для порівнянь змішаного типу, які можуть викликати " +"відображений метод :meth:`~object.__gt__`." + +msgid "" +"For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`." +msgstr "" +"Приклади сортування та короткий посібник із сортування див. :ref:" +"`sortinghowto`." + +msgid "Transform a method into a static method." +msgstr "Перетворення методу в статичний метод." + +msgid "" +"A static method does not receive an implicit first argument. To declare a " +"static method, use this idiom::" +msgstr "" +"Статичний метод не отримує неявний перший аргумент. Щоб оголосити статичний " +"метод, використовуйте цю ідіому::" + +msgid "" +"class C:\n" +" @staticmethod\n" +" def f(arg1, arg2, argN): ..." +msgstr "" + +msgid "" +"The ``@staticmethod`` form is a function :term:`decorator` -- see :ref:" +"`function` for details." +msgstr "" +"Форма ``@staticmethod`` є функцією :term:`decorator` -- подробиці див. :ref:" +"`function`." + +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()``)." +msgstr "" + +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 " +"class constructors." +msgstr "" +"Статичні методи в Python подібні до методів Java або C++. Також перегляньте :" +"func:`classmethod` варіант, який корисний для створення альтернативних " +"конструкторів класів." + +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 " +"cases where you need a reference to a function from a class body and you " +"want to avoid the automatic transformation to instance method. For these " +"cases, use this idiom::" +msgstr "" +"Як і в усіх декораторах, також можна викликати ``staticmethod`` як звичайну " +"функцію та щось робити з його результатом. Це необхідно в деяких випадках, " +"коли вам потрібно посилання на функцію з тіла класу, і ви хочете уникнути " +"автоматичного перетворення в метод екземпляра. Для цих випадків " +"використовуйте цю ідіому::" + +msgid "" +"def regular_function():\n" +" ...\n" +"\n" +"class C:\n" +" method = staticmethod(regular_function)" +msgstr "" + +msgid "For more information on static methods, see :ref:`types`." +msgstr "" +"Для отримання додаткової інформації про статичні методи див. :ref:`types`." + +msgid "" +"Static methods now inherit the method attributes (:attr:`~function." +"__module__`, :attr:`~function.__name__`, :attr:`~function.__qualname__`, :" +"attr:`~function.__doc__` and :attr:`~function.__annotations__`), have a new " +"``__wrapped__`` attribute, and are now callable as regular functions." +msgstr "" + +msgid "" +"Return a :class:`str` version of *object*. See :func:`str` for details." +msgstr "" +"Повертає :class:`str` версію *object*. Дивіться :func:`str` для деталей." + +msgid "" +"``str`` is the built-in string :term:`class`. For general information about " +"strings, see :ref:`textseq`." +msgstr "" +"``str`` — це вбудований рядок :term:`class`. Щоб отримати загальну " +"інформацію про рядки, перегляньте :ref:`textseq`." + +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 " +"is not allowed to be a string." +msgstr "" +"Сумує *start* і елементи *iterable* зліва направо та повертає підсумок. " +"Елементи *iterable* зазвичай є числами, а початкове значення не може бути " +"рядком." + +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`." +msgstr "" + +msgid "The *start* parameter can be specified as a keyword argument." +msgstr "Параметр *start* можна вказати як аргумент ключового слова." + +msgid "" +"Summation of floats switched to an algorithm that gives higher accuracy and " +"better commutativity on most builds." +msgstr "" +"Сумування чисел з рухомою комою перейшло на алгоритм, який забезпечує вищу " +"точність і кращу комутативність на більшості збірок." + +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 " +"been overridden in a class." +msgstr "" +"Повертає проксі-об’єкт, який делегує виклики методу батьківському або " +"рідному класу *типу*. Це корисно для доступу до успадкованих методів, які " +"були перевизначені в класі." + +msgid "" +"The *object_or_type* determines the :term:`method resolution order` to be " +"searched. The search starts from the class right after the *type*." +msgstr "" +"*object_or_type* визначає :term:`method resolution order`, який потрібно " +"шукати. Пошук починається з класу, що йде безпосередньо після *type*." + +msgid "" +"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 "" + +msgid "" +"The :attr:`~type.__mro__` attribute of the class corresponding to " +"*object_or_type* lists the method resolution search order used by both :func:" +"`getattr` and :func:`super`. The attribute is dynamic and can change " +"whenever the inheritance hierarchy is updated." +msgstr "" + +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. " +"If the second argument is a type, ``issubclass(type2, type)`` must be true " +"(this is useful for classmethods)." +msgstr "" +"Якщо другий аргумент опущено, повернутий супероб’єкт не зв’язаний. Якщо " +"другий аргумент є об’єктом, ``isinstance(obj, type)`` має бути істинним. " +"Якщо другий аргумент є типом, ``issubclass(type2, type)`` має бути істинним " +"(це корисно для методів класу)." + +msgid "" +"When called directly within an ordinary method of a class, both arguments " +"may be omitted (\"zero-argument :func:`!super`\"). In this case, *type* will " +"be the enclosing class, and *obj* will be the first argument of the " +"immediately enclosing function (typically ``self``). (This means that zero-" +"argument :func:`!super` will not work as expected within nested functions, " +"including generator expressions, which implicitly create nested functions.)" +msgstr "" + +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 " +"naming them explicitly, thus making the code more maintainable. This use " +"closely parallels the use of *super* in other programming languages." +msgstr "" +"Є два типових випадки використання *super*. В ієрархії класів з єдиним " +"успадкуванням *super* можна використовувати для посилання на батьківські " +"класи, не вказуючи їх явно, що робить код більш придатним для " +"обслуговування. Це використання дуже схоже на використання *super* в інших " +"мовах програмування." + +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 " +"found in statically compiled languages or languages that only support single " +"inheritance. This makes it possible to implement \"diamond diagrams\" where " +"multiple base classes implement the same method. Good design dictates that " +"such implementations have the same calling signature in every case (because " +"the order of calls is determined at runtime, because that order adapts to " +"changes in the class hierarchy, and because that order can include sibling " +"classes that are unknown prior to runtime)." +msgstr "" +"Другий варіант використання — це підтримка кооперативного множинного " +"успадкування в динамічному середовищі виконання. Цей варіант використання " +"унікальний для Python і не зустрічається в статично скомпільованих мовах або " +"мовах, які підтримують лише одне успадкування. Це дає змогу реалізувати " +"\"діамантові діаграми\", де кілька базових класів реалізують один і той же " +"метод. Хороший дизайн вимагає, щоб такі реалізації мали однакову сигнатуру " +"виклику в кожному випадку (оскільки порядок викликів визначається під час " +"виконання, оскільки цей порядок адаптується до змін в ієрархії класів, і " +"оскільки цей порядок може включати однотипні класи, які невідомі до " +"виконання )." + +msgid "For both use cases, a typical superclass call looks like this::" +msgstr "Для обох випадків типовий виклик суперкласу виглядає так:" + +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 "" + +msgid "" +"In addition to method lookups, :func:`super` also works for attribute " +"lookups. One possible use case for this is calling :term:`descriptors " +"` in a parent or sibling class." +msgstr "" +"Окрім пошуку методів, :func:`super` також працює для пошуку атрибутів. Одним " +"із можливих варіантів використання цього є виклик :term:`дескрипторів " +"` у батьківському або рідному класі." + +msgid "" +"Note that :func:`super` is implemented as part of the binding process for " +"explicit dotted attribute lookups such as ``super().__getitem__(name)``. It " +"does so by implementing its own :meth:`~object.__getattribute__` method for " +"searching classes in a predictable order that supports cooperative multiple " +"inheritance. Accordingly, :func:`super` is undefined for implicit lookups " +"using statements or operators such as ``super()[name]``." +msgstr "" + +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 " +"arguments exactly and makes the appropriate references. The zero argument " +"form only works inside a class definition, as the compiler fills in the " +"necessary details to correctly retrieve the class being defined, as well as " +"accessing the current instance for ordinary methods." +msgstr "" +"Також зауважте, що, окрім форми нульового аргументу, :func:`super` не " +"обмежується використанням внутрішніх методів. Форма з двома аргументами " +"точно визначає аргументи та робить відповідні посилання. Форма нульового " +"аргументу працює лише всередині визначення класу, оскільки компілятор " +"заповнює необхідні деталі для правильного отримання визначеного класу, а " +"також для доступу до поточного екземпляра для звичайних методів." + +msgid "" +"For practical suggestions on how to design cooperative classes using :func:" +"`super`, see `guide to using super() `_." +msgstr "" +"Щоб отримати практичні поради щодо створення кооперативних класів за " +"допомогою :func:`super`, перегляньте `посібник із використання super() " +"`_." + +msgid "" +"Rather than being a function, :class:`tuple` is actually an immutable " +"sequence type, as documented in :ref:`typesseq-tuple` and :ref:`typesseq`." +msgstr "" +"Замість того, щоб бути функцією, :class:`tuple` насправді є незмінним типом " +"послідовності, як описано в :ref:`typesseq-tuple` і :ref:`typesseq`." + +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__`." +msgstr "" + +msgid "" +"The :func:`isinstance` built-in function is recommended for testing the type " +"of an object, because it takes subclasses into account." +msgstr "" +"Для перевірки типу об’єкта рекомендується використовувати вбудовану функцію :" +"func:`isinstance`, оскільки вона враховує підкласи." + +msgid "" +"With three arguments, return a new type object. This is essentially a " +"dynamic form of the :keyword:`class` statement. The *name* string is the " +"class name and becomes the :attr:`~type.__name__` attribute. The *bases* " +"tuple contains the base classes and becomes the :attr:`~type.__bases__` " +"attribute; if empty, :class:`object`, the ultimate base of all classes, is " +"added. The *dict* dictionary contains attribute and method definitions for " +"the class body; it may be copied or wrapped before becoming the :attr:`~type." +"__dict__` attribute. The following two statements create identical :class:`!" +"type` objects:" +msgstr "" + +msgid "See also:" +msgstr "Дивіться також:" + +msgid "" +":ref:`Documentation on attributes and methods on classes `." +msgstr "" + +msgid ":ref:`bltin-type-objects`" +msgstr "" + +msgid "" +"Keyword arguments provided to the three argument form are passed to the " +"appropriate metaclass machinery (usually :meth:`~object.__init_subclass__`) " +"in the same way that keywords in a class definition (besides *metaclass*) " +"would." +msgstr "" +"Аргументи ключових слів, надані у формі з трьома аргументами, передаються у " +"відповідний механізм метакласу (зазвичай :meth:`~object.__init_subclass__`) " +"так само, як ключові слова у визначенні класу (крім *metaclass*)." + +msgid "See also :ref:`class-customization`." +msgstr "Дивіться також :ref:`class-customization`." + +msgid "" +"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 "" + +msgid "" +"Return the :attr:`~object.__dict__` attribute for a module, class, instance, " +"or any other object with a :attr:`!__dict__` attribute." +msgstr "" + +msgid "" +"Objects such as modules and instances have an updateable :attr:`~object." +"__dict__` attribute; however, other objects may have write restrictions on " +"their :attr:`!__dict__` attributes (for example, classes use a :class:`types." +"MappingProxyType` to prevent direct dictionary updates)." +msgstr "" + +msgid "Without an argument, :func:`vars` acts like :func:`locals`." +msgstr "" + +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 " +"defines the :attr:`~object.__slots__` attribute)." +msgstr "" +"Виняток :exc:`TypeError` виникає, якщо об’єкт указано, але він не має " +"атрибута :attr:`~object.__dict__` (наприклад, якщо його клас визначає :attr:" +"`~object.__slots__` атрибут)." + +msgid "" +"The result of calling this function without an argument has been updated as " +"described for the :func:`locals` builtin." +msgstr "" + +msgid "" +"Iterate over several iterables in parallel, producing tuples with an item " +"from each one." +msgstr "" +"Виконайте ітерацію кількох ітерацій паралельно, створюючи кортежі з " +"елементом з кожного." + +msgid "Example::" +msgstr "Приклад::" + +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 "" + +msgid "" +"More formally: :func:`zip` returns an iterator of tuples, where the *i*-th " +"tuple contains the *i*-th element from each of the argument iterables." +msgstr "" +"Більш формально: :func:`zip` повертає ітератор кортежів, де *i*-й кортеж " +"містить *i*-й елемент з кожного з ітерованих аргументів." + +msgid "" +"Another way to think of :func:`zip` is that it turns rows into columns, and " +"columns into rows. This is similar to `transposing a matrix `_." +msgstr "" +"Інший спосіб уявлення про :func:`zip` полягає в тому, що він перетворює " +"рядки на стовпці, а стовпці — на рядки. Це схоже на `транспонування матриці " +"`_." + +msgid "" +":func:`zip` is lazy: The elements won't be processed until the iterable is " +"iterated on, e.g. by a :keyword:`!for` loop or by wrapping in a :class:" +"`list`." +msgstr "" +":func:`zip` ледачий: елементи не будуть оброблені, доки не буде виконано " +"ітерацію, напр. за допомогою циклу :keyword:`!for` або загортання в :class:" +"`list`." + +msgid "" +"One thing to consider is that the iterables passed to :func:`zip` could have " +"different lengths; sometimes by design, and sometimes because of a bug in " +"the code that prepared these iterables. Python offers three different " +"approaches to dealing with this issue:" +msgstr "" +"Варто взяти до уваги те, що ітератори, передані :func:`zip`, можуть мати " +"різну довжину; іноді задумом, а іноді через помилку в коді, який підготував " +"ці ітерації. Python пропонує три різні підходи до вирішення цієї проблеми:" + +msgid "" +"By default, :func:`zip` stops when the shortest iterable is exhausted. It " +"will ignore the remaining items in the longer iterables, cutting off the " +"result to the length of the shortest iterable::" +msgstr "" +"За замовчуванням :func:`zip` зупиняється, коли вичерпується найкоротша " +"ітерація. Він ігноруватиме решта елементів у довших ітераціях, відрізаючи " +"результат до довжини найкоротшої ітерації::" + +msgid "" +">>> list(zip(range(3), ['fee', 'fi', 'fo', 'fum']))\n" +"[(0, 'fee'), (1, 'fi'), (2, 'fo')]" +msgstr "" + +msgid "" +":func:`zip` is often used in cases where the iterables are assumed to be of " +"equal length. In such cases, it's recommended to use the ``strict=True`` " +"option. Its output is the same as regular :func:`zip`::" +msgstr "" +":func:`zip` часто використовується у випадках, коли передбачається, що " +"ітератори мають однакову довжину. У таких випадках рекомендується " +"використовувати параметр ``strict=True``. Його вихід такий самий, як і " +"звичайний :func:`zip`::" + +msgid "" +">>> list(zip(('a', 'b', 'c'), (1, 2, 3), strict=True))\n" +"[('a', 1), ('b', 2), ('c', 3)]" +msgstr "" + +msgid "" +"Unlike the default behavior, it raises a :exc:`ValueError` if one iterable " +"is exhausted before the others:" +msgstr "" + +msgid "" +"Without the ``strict=True`` argument, any bug that results in iterables of " +"different lengths will be silenced, possibly manifesting as a hard-to-find " +"bug in another part of the program." +msgstr "" +"Без аргументу ``strict=True`` будь-яка помилка, яка призводить до ітерацій " +"різної довжини, буде замовчена, можливо, проявляючись як помилка, яку важко " +"знайти в іншій частині програми." + +msgid "" +"Shorter iterables can be padded with a constant value to make all the " +"iterables have the same length. This is done by :func:`itertools." +"zip_longest`." +msgstr "" +"Коротші ітератори можна доповнити постійним значенням, щоб усі ітератори " +"мали однакову довжину. Це робить :func:`itertools.zip_longest`." + +msgid "" +"Edge cases: With a single iterable argument, :func:`zip` returns an iterator " +"of 1-tuples. With no arguments, it returns an empty iterator." +msgstr "" +"Граничні випадки: з одним ітерованим аргументом :func:`zip` повертає " +"ітератор 1-кортежів. Без аргументів він повертає порожній ітератор." + +msgid "Tips and tricks:" +msgstr "Поради та підказки:" + +msgid "" +"The left-to-right evaluation order of the iterables is guaranteed. This " +"makes possible an idiom for clustering a data series into n-length groups " +"using ``zip(*[iter(s)]*n, strict=True)``. This repeats the *same* iterator " +"``n`` times so that each output tuple has the result of ``n`` calls to the " +"iterator. This has the effect of dividing the input into n-length chunks." +msgstr "" +"Порядок оцінки ітерацій зліва направо гарантується. Це робить можливою " +"ідіому для кластеризації рядів даних у групи довжини n за допомогою " +"``zip(*[iter(s)]*n, strict=True)``. Це повторює *той самий* ітератор ``n`` " +"разів, щоб кожен вихідний кортеж мав результат ``n`` викликів ітератора. Це " +"призводить до поділу вхідних даних на фрагменти довжиною n." + +msgid "" +":func:`zip` in conjunction with the ``*`` operator can be used to unzip a " +"list::" +msgstr "" +":func:`zip` у поєднанні з оператором ``*`` можна використовувати для " +"розпакування списку::" + +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 "" + +msgid "Added the ``strict`` argument." +msgstr "Додано аргумент ``строгий``." + +msgid "" +"This is an advanced function that is not needed in everyday Python " +"programming, unlike :func:`importlib.import_module`." +msgstr "" +"Це розширена функція, яка не потрібна в повсякденному програмуванні на " +"Python, на відміну від :func:`importlib.import_module`." + +msgid "" +"This function is invoked by the :keyword:`import` statement. It can be " +"replaced (by importing the :mod:`builtins` module and assigning to " +"``builtins.__import__``) in order to change semantics of the :keyword:`!" +"import` statement, but doing so is **strongly** discouraged as it is usually " +"simpler to use import hooks (see :pep:`302`) to attain the same goals and " +"does not cause issues with code which assumes the default import " +"implementation is in use. Direct use of :func:`__import__` is also " +"discouraged in favor of :func:`importlib.import_module`." +msgstr "" +"Ця функція викликається оператором :keyword:`import`. Його можна замінити " +"(імпортувавши модуль :mod:`builtins` і призначивши ``builtins.__import__``), " +"щоб змінити семантику оператора :keyword:`!import`, але це **настійно** не " +"рекомендується, оскільки зазвичай простіше використовувати перехоплювачі " +"імпорту (див. :pep:`302`) для досягнення тих самих цілей і не викликає " +"проблем із кодом, який припускає, що використовується реалізація імпорту за " +"замовчуванням. Пряме використання :func:`__import__` також не рекомендується " +"на користь :func:`importlib.import_module`." + +msgid "" +"The function imports the module *name*, potentially using the given " +"*globals* and *locals* to determine how to interpret the name in a package " +"context. The *fromlist* gives the names of objects or submodules that should " +"be imported from the module given by *name*. The standard implementation " +"does not use its *locals* argument at all and uses its *globals* only to " +"determine the package context of the :keyword:`import` statement." +msgstr "" +"Функція імпортує *name* модуля, потенційно використовуючи задані *globals* і " +"*locals*, щоб визначити, як інтерпретувати назву в контексті пакета. Список " +"*fromlist* надає імена об’єктів або підмодулів, які слід імпортувати з " +"модуля, заданого *name*. Стандартна реалізація взагалі не використовує свій " +"аргумент *locals* і використовує його *globals* лише для визначення " +"контексту пакета оператора :keyword:`import`." + +msgid "" +"*level* specifies whether to use absolute or relative imports. ``0`` (the " +"default) means only perform absolute imports. Positive values for *level* " +"indicate the number of parent directories to search relative to the " +"directory of the module calling :func:`__import__` (see :pep:`328` for the " +"details)." +msgstr "" +"*рівень* визначає, чи використовувати абсолютний чи відносний імпорт. ``0`` " +"(за замовчуванням) означає виконання лише абсолютного імпорту. Позитивні " +"значення для *level* вказують на кількість батьківських каталогів для пошуку " +"відносно каталогу модуля, який викликає :func:`__import__` (див. :pep:`328` " +"для деталей)." + +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 "" +"Якщо змінна *name* має форму ``package.module``, зазвичай повертається пакет " +"верхнього рівня (ім’я до першої крапки), *а не* модуль, названий *name*. " +"Однак, якщо вказано непорожній аргумент *fromlist*, повертається модуль, " +"названий *name*." + +msgid "" +"For example, the statement ``import spam`` results in bytecode resembling " +"the following code::" +msgstr "" +"Наприклад, оператор ``import spam`` призводить до байт-коду, схожого на " +"такий код:" + +msgid "spam = __import__('spam', globals(), locals(), [], 0)" +msgstr "" + +msgid "The statement ``import spam.ham`` results in this call::" +msgstr "Інструкція ``import spam.ham`` призводить до цього виклику::" + +msgid "spam = __import__('spam.ham', globals(), locals(), [], 0)" +msgstr "" + +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." +msgstr "" +"Зверніть увагу, як :func:`__import__` повертає тут модуль верхнього рівня, " +"оскільки це об’єкт, який прив’язаний до імені оператором :keyword:`import`." + +msgid "" +"On the other hand, the statement ``from spam.ham import eggs, sausage as " +"saus`` results in ::" +msgstr "" +"З іншого боку, заява ``from spam.ham import eggs, sausage as saus`` " +"призводить до:" + +msgid "" +"_temp = __import__('spam.ham', globals(), locals(), ['eggs', 'sausage'], 0)\n" +"eggs = _temp.eggs\n" +"saus = _temp.sausage" +msgstr "" + +msgid "" +"Here, the ``spam.ham`` module is returned from :func:`__import__`. From " +"this object, the names to import are retrieved and assigned to their " +"respective names." +msgstr "" +"Тут модуль ``spam.ham`` повертається з :func:`__import__`. З цього об’єкта " +"витягуються імена для імпорту та призначаються їх відповідні імена." + +msgid "" +"If you simply want to import a module (potentially within a package) by " +"name, use :func:`importlib.import_module`." +msgstr "" +"Якщо ви просто хочете імпортувати модуль (можливо, у пакеті) за назвою, " +"використовуйте :func:`importlib.import_module`." + +msgid "" +"Negative values for *level* are no longer supported (which also changes the " +"default value to 0)." +msgstr "" +"Від’ємні значення для *рівня* більше не підтримуються (що також змінює " +"значення за замовчуванням на 0)." + +msgid "" +"When the command line options :option:`-E` or :option:`-I` are being used, " +"the environment variable :envvar:`PYTHONCASEOK` is now ignored." +msgstr "" +"Коли використовуються параметри командного рядка :option:`-E` або :option:`-" +"I`, змінна середовища :envvar:`PYTHONCASEOK` ігнорується." + +msgid "Footnotes" +msgstr "Примітки" + +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 " +"mode to convert Windows or Mac-style newlines." +msgstr "" +"Зауважте, що синтаксичний аналізатор приймає символ кінця рядка лише в стилі " +"Unix. Якщо ви читаєте код з файлу, обов’язково використовуйте режим " +"перетворення нового рядка для перетворення символів нового рядка з Windows " +"або Mac." + +msgid "Boolean" +msgstr "Булевий" + +msgid "type" +msgstr "тип" + +msgid "built-in function" +msgstr "вбудована функція" + +msgid "exec" +msgstr "" + +msgid "NaN" +msgstr "" + +msgid "Infinity" +msgstr "" + +msgid "__format__" +msgstr "" + +msgid "string" +msgstr "рядок" + +msgid "format() (built-in function)" +msgstr "" + +msgid "file object" +msgstr "файловий об'єкт" + +msgid "open() built-in function" +msgstr "" + +msgid "file" +msgstr "" + +msgid "modes" +msgstr "" + +msgid "universal newlines" +msgstr "універсальні символи нового рядка" + +msgid "line-buffered I/O" +msgstr "" + +msgid "unbuffered I/O" +msgstr "" + +msgid "buffer size, I/O" +msgstr "" + +msgid "I/O control" +msgstr "" + +msgid "buffering" +msgstr "" + +msgid "text mode" +msgstr "" + +msgid "module" +msgstr "модуль" + +msgid "sys" +msgstr "система" + +msgid "str() (built-in function)" +msgstr "" + +msgid "object" +msgstr "об'єкт" + +msgid "statement" +msgstr "заява" + +msgid "import" +msgstr "" + +msgid "builtins" +msgstr "вбудовані елементи" diff --git a/library/functools.po b/library/functools.po new file mode 100644 index 000000000..528e265c5 --- /dev/null +++ b/library/functools.po @@ -0,0 +1,1089 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 01:06+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "" +":mod:`!functools` --- Higher-order functions and operations on callable " +"objects" +msgstr "" + +msgid "**Source code:** :source:`Lib/functools.py`" +msgstr "**Вихідний код:** :source:`Lib/functools.py`" + +msgid "" +"The :mod:`functools` module is for higher-order functions: functions that " +"act on or return other functions. In general, any callable object can be " +"treated as a function for the purposes of this module." +msgstr "" +"Модуль :mod:`functools` призначений для функцій вищого порядку: функцій, які " +"діють або повертають інші функції. Загалом, будь-який викликуваний об’єкт " +"можна розглядати як функцію для цілей цього модуля." + +msgid "The :mod:`functools` module defines the following functions:" +msgstr "Модуль :mod:`functools` визначає такі функції:" + +msgid "" +"Simple lightweight unbounded function cache. Sometimes called `\"memoize\" " +"`_." +msgstr "" +"Простий легкий необмежений кеш функцій. Іноді називається `\"memoize\" " +"`_." + +msgid "" +"Returns the same as ``lru_cache(maxsize=None)``, creating a thin wrapper " +"around a dictionary lookup for the function arguments. Because it never " +"needs to evict old values, this is smaller and faster than :func:`lru_cache` " +"with a size limit." +msgstr "" + +msgid "For example::" +msgstr "Наприклад::" + +msgid "" +"@cache\n" +"def factorial(n):\n" +" return n * factorial(n-1) if n else 1\n" +"\n" +">>> factorial(10) # no previously cached result, makes 11 recursive " +"calls\n" +"3628800\n" +">>> factorial(5) # just looks up cached value result\n" +"120\n" +">>> factorial(12) # makes two new recursive calls, the other 10 are " +"cached\n" +"479001600" +msgstr "" + +msgid "" +"The cache is threadsafe so that the wrapped function can be used in multiple " +"threads. This means that the underlying data structure will remain coherent " +"during concurrent updates." +msgstr "" + +msgid "" +"It is possible for the wrapped function to be called more than once if " +"another thread makes an additional call before the initial call has been " +"completed and cached." +msgstr "" + +msgid "" +"Transform a method of a class into a property whose value is computed once " +"and then cached as a normal attribute for the life of the instance. Similar " +"to :func:`property`, with the addition of caching. Useful for expensive " +"computed properties of instances that are otherwise effectively immutable." +msgstr "" +"Перетворення методу класу на властивість, значення якого обчислюється один " +"раз, а потім кешується як звичайний атрибут протягом життя екземпляра. " +"Подібно до :func:`property`, з додаванням кешування. Корисно для дорогих " +"обчислених властивостей екземплярів, які в іншому випадку є фактично " +"незмінними." + +msgid "Example::" +msgstr "Приклад::" + +msgid "" +"class DataSet:\n" +"\n" +" def __init__(self, sequence_of_numbers):\n" +" self._data = tuple(sequence_of_numbers)\n" +"\n" +" @cached_property\n" +" def stdev(self):\n" +" return statistics.stdev(self._data)" +msgstr "" + +msgid "" +"The mechanics of :func:`cached_property` are somewhat different from :func:" +"`property`. A regular property blocks attribute writes unless a setter is " +"defined. In contrast, a *cached_property* allows writes." +msgstr "" +"Механіка :func:`cached_property` дещо відрізняється від :func:`property`. " +"Звичайна властивість блокує запис атрибута, якщо не визначено установщик. На " +"відміну від цього, *cached_property* дозволяє запис." + +msgid "" +"The *cached_property* decorator only runs on lookups and only when an " +"attribute of the same name doesn't exist. When it does run, the " +"*cached_property* writes to the attribute with the same name. Subsequent " +"attribute reads and writes take precedence over the *cached_property* method " +"and it works like a normal attribute." +msgstr "" +"Декоратор *cached_property* працює лише під час пошуку й лише тоді, коли " +"атрибут із такою ж назвою не існує. Коли він виконується, *cached_property* " +"записує в атрибут з таким же ім’ям. Наступні атрибути читання та запису " +"мають пріоритет над методом *cached_property*, і він працює як звичайний " +"атрибут." + +msgid "" +"The cached value can be cleared by deleting the attribute. This allows the " +"*cached_property* method to run again." +msgstr "" +"Кешоване значення можна очистити, видаливши атрибут. Це дозволяє знову " +"запустити метод *cached_property*." + +msgid "" +"The *cached_property* does not prevent a possible race condition in multi-" +"threaded usage. The getter function could run more than once on the same " +"instance, with the latest run setting the cached value. If the cached " +"property is idempotent or otherwise not harmful to run more than once on an " +"instance, this is fine. If synchronization is needed, implement the " +"necessary locking inside the decorated getter function or around the cached " +"property access." +msgstr "" + +msgid "" +"Note, this decorator interferes with the operation of :pep:`412` key-sharing " +"dictionaries. This means that instance dictionaries can take more space " +"than usual." +msgstr "" +"Зауважте, що цей декоратор заважає роботі словників спільного ключа :pep:" +"`412`. Це означає, що словники примірників можуть займати більше місця, ніж " +"зазвичай." + +msgid "" +"Also, this decorator requires that the ``__dict__`` attribute on each " +"instance be a mutable mapping. This means it will not work with some types, " +"such as metaclasses (since the ``__dict__`` attributes on type instances are " +"read-only proxies for the class namespace), and those that specify " +"``__slots__`` without including ``__dict__`` as one of the defined slots (as " +"such classes don't provide a ``__dict__`` attribute at all)." +msgstr "" +"Крім того, цей декоратор вимагає, щоб атрибут ``__dict__`` для кожного " +"екземпляра був змінним відображенням. Це означає, що він не працюватиме з " +"деякими типами, такими як метакласи (оскільки атрибути ``__dict__`` в " +"екземплярах типу є проксі-серверами лише для читання для простору імен " +"класу), і ті, які вказують ``__slots__`` без включення ``__dict__`` як один " +"із визначених слотів (оскільки такі класи взагалі не надають атрибут " +"``__dict__``)." + +msgid "" +"If a mutable mapping is not available or if space-efficient key sharing is " +"desired, an effect similar to :func:`cached_property` can also be achieved " +"by stacking :func:`property` on top of :func:`lru_cache`. See :ref:`faq-" +"cache-method-calls` for more details on how this differs from :func:" +"`cached_property`." +msgstr "" + +msgid "" +"Prior to Python 3.12, ``cached_property`` included an undocumented lock to " +"ensure that in multi-threaded usage the getter function was guaranteed to " +"run only once per instance. However, the lock was per-property, not per-" +"instance, which could result in unacceptably high lock contention. In Python " +"3.12+ this locking is removed." +msgstr "" + +msgid "" +"Transform an old-style comparison function to a :term:`key function`. Used " +"with tools that accept key functions (such as :func:`sorted`, :func:`min`, :" +"func:`max`, :func:`heapq.nlargest`, :func:`heapq.nsmallest`, :func:" +"`itertools.groupby`). This function is primarily used as a transition tool " +"for programs being converted from Python 2 which supported the use of " +"comparison functions." +msgstr "" +"Перетворіть функцію порівняння старого стилю на :term:`key function`. " +"Використовується з інструментами, які приймають ключові функції (такі як :" +"func:`sorted`, :func:`min`, :func:`max`, :func:`heapq.nlargest`, :func:" +"`heapq.nsmallest`, :func:`itertools.groupby`). Ця функція в основному " +"використовується як інструмент переходу для програм, які перетворюються з " +"Python 2, який підтримує використання функцій порівняння." + +msgid "" +"A comparison function is any callable that accepts two arguments, compares " +"them, and returns a negative number for less-than, zero for equality, or a " +"positive number for greater-than. A key function is a callable that accepts " +"one argument and returns another value to be used as the sort key." +msgstr "" + +msgid "" +"sorted(iterable, key=cmp_to_key(locale.strcoll)) # locale-aware sort order" +msgstr "" + +msgid "" +"For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`." +msgstr "" +"Приклади сортування та короткий посібник із сортування див. :ref:" +"`sortinghowto`." + +msgid "" +"Decorator to wrap a function with a memoizing callable that saves up to the " +"*maxsize* most recent calls. It can save time when an expensive or I/O " +"bound function is periodically called with the same arguments." +msgstr "" +"Декоратор для обгортання функції викликом мемоізації, який зберігає до " +"*maxsize* останніх викликів. Це може заощадити час, коли дорога функція або " +"функція, пов’язана з вводом/виводом, періодично викликається з однаковими " +"аргументами." + +msgid "" +"Since a dictionary is used to cache results, the positional and keyword " +"arguments to the function must be :term:`hashable`." +msgstr "" + +msgid "" +"Distinct argument patterns may be considered to be distinct calls with " +"separate cache entries. For example, ``f(a=1, b=2)`` and ``f(b=2, a=1)`` " +"differ in their keyword argument order and may have two separate cache " +"entries." +msgstr "" + +msgid "" +"If *user_function* is specified, it must be a callable. This allows the " +"*lru_cache* decorator to be applied directly to a user function, leaving the " +"*maxsize* at its default value of 128::" +msgstr "" +"Якщо вказано *user_function*, вона має бути викликаною. Це дозволяє " +"застосувати декоратор *lru_cache* безпосередньо до функції користувача, " +"залишаючи значення *maxsize* за замовчуванням 128::" + +msgid "" +"@lru_cache\n" +"def count_vowels(sentence):\n" +" return sum(sentence.count(vowel) for vowel in 'AEIOUaeiou')" +msgstr "" + +msgid "" +"If *maxsize* is set to ``None``, the LRU feature is disabled and the cache " +"can grow without bound." +msgstr "" +"Якщо для параметра *maxsize* встановлено значення ``None``, функція LRU " +"вимкнена, і кеш може збільшуватися без обмежень." + +msgid "" +"If *typed* is set to true, function arguments of different types will be " +"cached separately. If *typed* is false, the implementation will usually " +"regard them as equivalent calls and only cache a single result. (Some types " +"such as *str* and *int* may be cached separately even when *typed* is false.)" +msgstr "" +"Якщо *typed* має значення true, аргументи функції різних типів " +"кешуватимуться окремо. Якщо *typed* має значення false, реалізація зазвичай " +"розглядатиме їх як еквівалентні виклики та кешуватиме лише один результат. " +"(Деякі типи, такі як *str* і *int*, можуть кешуватися окремо, навіть якщо " +"*typed* має значення false.)" + +msgid "" +"Note, type specificity applies only to the function's immediate arguments " +"rather than their contents. The scalar arguments, ``Decimal(42)`` and " +"``Fraction(42)`` are be treated as distinct calls with distinct results. In " +"contrast, the tuple arguments ``('answer', Decimal(42))`` and ``('answer', " +"Fraction(42))`` are treated as equivalent." +msgstr "" +"Зауважте, що специфічність типу застосовується лише до безпосередніх " +"аргументів функції, а не до їх вмісту. Скалярні аргументи ``Decimal(42)`` і " +"``Fraction(42)`` розглядаються як окремі виклики з різними результатами. " +"Навпаки, аргументи кортежу ``('answer', Decimal(42))`` і ``('answer', " +"Fraction(42))`` розглядаються як еквівалентні." + +msgid "" +"The wrapped function is instrumented with a :func:`!cache_parameters` " +"function that returns a new :class:`dict` showing the values for *maxsize* " +"and *typed*. This is for information purposes only. Mutating the values " +"has no effect." +msgstr "" + +msgid "" +"To help measure the effectiveness of the cache and tune the *maxsize* " +"parameter, the wrapped function is instrumented with a :func:`cache_info` " +"function that returns a :term:`named tuple` showing *hits*, *misses*, " +"*maxsize* and *currsize*." +msgstr "" +"Щоб допомогти виміряти ефективність кешу та налаштувати параметр *maxsize*, " +"обгорнута функція обладнана функцією :func:`cache_info`, яка повертає :term:" +"`named tuple`, що показує *влучення*, *промахи*, *maxsize* і *currsize*." + +msgid "" +"The decorator also provides a :func:`cache_clear` function for clearing or " +"invalidating the cache." +msgstr "" +"Декоратор також надає функцію :func:`cache_clear` для очищення або " +"анулювання кешу." + +msgid "" +"The original underlying function is accessible through the :attr:" +"`__wrapped__` attribute. This is useful for introspection, for bypassing " +"the cache, or for rewrapping the function with a different cache." +msgstr "" +"Оригінальна базова функція доступна через атрибут :attr:`__wrapped__`. Це " +"корисно для самоаналізу, для обходу кешу або для перезагортання функції в " +"інший кеш." + +msgid "" +"The cache keeps references to the arguments and return values until they age " +"out of the cache or until the cache is cleared." +msgstr "" +"Кеш зберігає посилання на аргументи та значення, що повертаються, доки вони " +"не вичерпаються з кешу або поки кеш не буде очищено." + +msgid "" +"If a method is cached, the ``self`` instance argument is included in the " +"cache. See :ref:`faq-cache-method-calls`" +msgstr "" + +msgid "" +"An `LRU (least recently used) cache `_ works best when the " +"most recent calls are the best predictors of upcoming calls (for example, " +"the most popular articles on a news server tend to change each day). The " +"cache's size limit assures that the cache does not grow without bound on " +"long-running processes such as web servers." +msgstr "" + +msgid "" +"In general, the LRU cache should only be used when you want to reuse " +"previously computed values. Accordingly, it doesn't make sense to cache " +"functions with side-effects, functions that need to create distinct mutable " +"objects on each call (such as generators and async functions), or impure " +"functions such as time() or random()." +msgstr "" + +msgid "Example of an LRU cache for static web content::" +msgstr "Приклад кешу LRU для статичного веб-контенту::" + +msgid "" +"@lru_cache(maxsize=32)\n" +"def get_pep(num):\n" +" 'Retrieve text of a Python Enhancement Proposal'\n" +" resource = f'https://peps.python.org/pep-{num:04d}'\n" +" try:\n" +" with urllib.request.urlopen(resource) as s:\n" +" return s.read()\n" +" except urllib.error.HTTPError:\n" +" return 'Not Found'\n" +"\n" +">>> for n in 8, 290, 308, 320, 8, 218, 320, 279, 289, 320, 9991:\n" +"... pep = get_pep(n)\n" +"... print(n, len(pep))\n" +"\n" +">>> get_pep.cache_info()\n" +"CacheInfo(hits=3, misses=8, maxsize=32, currsize=8)" +msgstr "" + +msgid "" +"Example of efficiently computing `Fibonacci numbers `_ using a cache to implement a `dynamic " +"programming `_ technique::" +msgstr "" +"Приклад ефективного обчислення `чисел Фібоначчі `_ з використанням кешу для реалізації техніки " +"`динамічного програмування `_::" + +msgid "" +"@lru_cache(maxsize=None)\n" +"def fib(n):\n" +" if n < 2:\n" +" return n\n" +" return fib(n-1) + fib(n-2)\n" +"\n" +">>> [fib(n) for n in range(16)]\n" +"[0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610]\n" +"\n" +">>> fib.cache_info()\n" +"CacheInfo(hits=28, misses=16, maxsize=None, currsize=16)" +msgstr "" + +msgid "Added the *typed* option." +msgstr "Додано параметр *введений*." + +msgid "Added the *user_function* option." +msgstr "Додано опцію *user_function*." + +msgid "Added the function :func:`!cache_parameters`" +msgstr "" + +msgid "" +"Given a class defining one or more rich comparison ordering methods, this " +"class decorator supplies the rest. This simplifies the effort involved in " +"specifying all of the possible rich comparison operations:" +msgstr "" +"Враховуючи клас, що визначає один або більше методів розширеного " +"впорядкування порівняння, цей декоратор класу забезпечує решту. Це спрощує " +"завдання, пов’язані з визначенням усіх можливих операцій розширеного " +"порівняння:" + +msgid "" +"The class must define one of :meth:`__lt__`, :meth:`__le__`, :meth:`__gt__`, " +"or :meth:`__ge__`. In addition, the class should supply an :meth:`__eq__` " +"method." +msgstr "" +"Клас має визначати одне з :meth:`__lt__`, :meth:`__le__`, :meth:`__gt__` " +"або :meth:`__ge__`. Крім того, клас повинен надати метод :meth:`__eq__`." + +msgid "" +"@total_ordering\n" +"class Student:\n" +" def _is_valid_operand(self, other):\n" +" return (hasattr(other, \"lastname\") and\n" +" hasattr(other, \"firstname\"))\n" +" def __eq__(self, other):\n" +" if not self._is_valid_operand(other):\n" +" return NotImplemented\n" +" return ((self.lastname.lower(), self.firstname.lower()) ==\n" +" (other.lastname.lower(), other.firstname.lower()))\n" +" def __lt__(self, other):\n" +" if not self._is_valid_operand(other):\n" +" return NotImplemented\n" +" return ((self.lastname.lower(), self.firstname.lower()) <\n" +" (other.lastname.lower(), other.firstname.lower()))" +msgstr "" + +msgid "" +"While this decorator makes it easy to create well behaved totally ordered " +"types, it *does* come at the cost of slower execution and more complex stack " +"traces for the derived comparison methods. If performance benchmarking " +"indicates this is a bottleneck for a given application, implementing all six " +"rich comparison methods instead is likely to provide an easy speed boost." +msgstr "" +"Незважаючи на те, що цей декоратор дозволяє легко створювати повністю " +"впорядковані типи, що добре ведуть себе, це *ціна* відбувається за рахунок " +"повільнішого виконання та більш складних трасувань стека для похідних " +"методів порівняння. Якщо порівняльний аналіз продуктивності вказує на те, що " +"це вузьке місце для даної програми, впровадження всіх шести розширених " +"методів порівняння натомість, ймовірно, забезпечить легке підвищення " +"швидкості." + +msgid "" +"This decorator makes no attempt to override methods that have been declared " +"in the class *or its superclasses*. Meaning that if a superclass defines a " +"comparison operator, *total_ordering* will not implement it again, even if " +"the original method is abstract." +msgstr "" +"Цей декоратор не намагається перевизначити методи, які були оголошені в " +"класі *або його суперкласах*. Це означає, що якщо суперклас визначає " +"оператор порівняння, *total_ordering* не реалізує його знову, навіть якщо " +"вихідний метод є абстрактним." + +msgid "" +"Returning ``NotImplemented`` from the underlying comparison function for " +"unrecognised types is now supported." +msgstr "" + +msgid "" +"Return a new :ref:`partial object` which when called will " +"behave like *func* called with the positional arguments *args* and keyword " +"arguments *keywords*. If more arguments are supplied to the call, they are " +"appended to *args*. If additional keyword arguments are supplied, they " +"extend and override *keywords*. Roughly equivalent to::" +msgstr "" +"Повертає новий :ref:`частковий об’єкт `, який під час " +"виклику поводитиметься як *func*, що викликається з позиційними аргументами " +"*args* і ключовими аргументами *keywords*. Якщо до виклику надається більше " +"аргументів, вони додаються до *args*. Якщо надаються додаткові ключові " +"аргументи, вони розширюють і замінюють *ключові слова*. Приблизно " +"еквівалентно::" + +msgid "" +"def partial(func, /, *args, **keywords):\n" +" def newfunc(*fargs, **fkeywords):\n" +" newkeywords = {**keywords, **fkeywords}\n" +" return func(*args, *fargs, **newkeywords)\n" +" newfunc.func = func\n" +" newfunc.args = args\n" +" newfunc.keywords = keywords\n" +" return newfunc" +msgstr "" + +msgid "" +"The :func:`partial` is used for partial function application which " +"\"freezes\" some portion of a function's arguments and/or keywords resulting " +"in a new object with a simplified signature. For example, :func:`partial` " +"can be used to create a callable that behaves like the :func:`int` function " +"where the *base* argument defaults to two:" +msgstr "" +":func:`partial` використовується для застосування часткової функції, яка " +"\"заморожує\" деяку частину аргументів функції та/або ключових слів, у " +"результаті чого створюється новий об’єкт зі спрощеною сигнатурою. " +"Наприклад, :func:`partial` можна використовувати для створення виклику, який " +"поводиться як функція :func:`int`, де аргумент *base* за замовчуванням " +"дорівнює двом:" + +msgid "" +"Return a new :class:`partialmethod` descriptor which behaves like :class:" +"`partial` except that it is designed to be used as a method definition " +"rather than being directly callable." +msgstr "" +"Повертає новий дескриптор :class:`partialmethod`, який поводиться як :class:" +"`partial`, за винятком того, що він призначений для використання як " +"визначення методу, а не для безпосереднього виклику." + +msgid "" +"*func* must be a :term:`descriptor` or a callable (objects which are both, " +"like normal functions, are handled as descriptors)." +msgstr "" +"*func* має бути :term:`descriptor` або викликаним (об’єкти, які, як і " +"звичайні функції, обробляються як дескриптори)." + +msgid "" +"When *func* is a descriptor (such as a normal Python function, :func:" +"`classmethod`, :func:`staticmethod`, :func:`abstractmethod` or another " +"instance of :class:`partialmethod`), calls to ``__get__`` are delegated to " +"the underlying descriptor, and an appropriate :ref:`partial object` returned as the result." +msgstr "" +"Коли *func* є дескриптором (наприклад, звичайною функцією Python, :func:" +"`classmethod`, :func:`staticmethod`, :func:`abstractmethod` або іншим " +"екземпляром :class:`partialmethod`), викликається ``__get__`` делегуються " +"базовому дескриптору, а в результаті повертається відповідний :ref:" +"`частковий об’єкт `." + +msgid "" +"When *func* is a non-descriptor callable, an appropriate bound method is " +"created dynamically. This behaves like a normal Python function when used as " +"a method: the *self* argument will be inserted as the first positional " +"argument, even before the *args* and *keywords* supplied to the :class:" +"`partialmethod` constructor." +msgstr "" +"Коли *func* є недескрипторним викликом, відповідний пов’язаний метод " +"створюється динамічно. Це поводиться як звичайна функція Python, коли " +"використовується як метод: аргумент *self* буде вставлено як перший " +"позиційний аргумент, навіть перед *args* і *keywords*, наданими " +"конструктору :class:`partialmethod`." + +msgid "" +">>> class Cell:\n" +"... def __init__(self):\n" +"... self._alive = False\n" +"... @property\n" +"... def alive(self):\n" +"... return self._alive\n" +"... def set_state(self, state):\n" +"... self._alive = bool(state)\n" +"... set_alive = partialmethod(set_state, True)\n" +"... set_dead = partialmethod(set_state, False)\n" +"...\n" +">>> c = Cell()\n" +">>> c.alive\n" +"False\n" +">>> c.set_alive()\n" +">>> c.alive\n" +"True" +msgstr "" + +msgid "" +"Apply *function* of two arguments cumulatively to the items of *iterable*, " +"from left to right, so as to reduce the iterable to a single value. For " +"example, ``reduce(lambda x, y: x+y, [1, 2, 3, 4, 5])`` calculates " +"``((((1+2)+3)+4)+5)``. The left argument, *x*, is the accumulated value and " +"the right argument, *y*, is the update value from the *iterable*. If the " +"optional *initial* is present, it is placed before the items of the iterable " +"in the calculation, and serves as a default when the iterable is empty. If " +"*initial* is not given and *iterable* contains only one item, the first item " +"is returned." +msgstr "" + +msgid "Roughly equivalent to::" +msgstr "Приблизно еквівалентно::" + +msgid "" +"initial_missing = object()\n" +"\n" +"def reduce(function, iterable, initial=initial_missing, /):\n" +" it = iter(iterable)\n" +" if initial is initial_missing:\n" +" value = next(it)\n" +" else:\n" +" value = initial\n" +" for element in it:\n" +" value = function(value, element)\n" +" return value" +msgstr "" + +msgid "" +"See :func:`itertools.accumulate` for an iterator that yields all " +"intermediate values." +msgstr "" +"Перегляньте :func:`itertools.accumulate` для ітератора, який видає всі " +"проміжні значення." + +msgid "" +"Transform a function into a :term:`single-dispatch ` :term:" +"`generic function`." +msgstr "" +"Перетворення функції на :term:`single-dispatch ` :term:" +"`generic function`." + +msgid "" +"To define a generic function, decorate it with the ``@singledispatch`` " +"decorator. When defining a function using ``@singledispatch``, note that the " +"dispatch happens on the type of the first argument::" +msgstr "" +"Щоб визначити загальну функцію, прикрасьте її за допомогою декоратора " +"``@singledispatch``. Визначаючи функцію за допомогою ``@singledispatch``, " +"зауважте, що відправлення відбувається за типом першого аргументу::" + +msgid "" +">>> from functools import singledispatch\n" +">>> @singledispatch\n" +"... def fun(arg, verbose=False):\n" +"... if verbose:\n" +"... print(\"Let me just say,\", end=\" \")\n" +"... print(arg)" +msgstr "" + +msgid "" +"To add overloaded implementations to the function, use the :func:`register` " +"attribute of the generic function, which can be used as a decorator. For " +"functions annotated with types, the decorator will infer the type of the " +"first argument automatically::" +msgstr "" +"Щоб додати перевантажені реалізації до функції, використовуйте атрибут :func:" +"`register` загальної функції, який можна використовувати як декоратор. Для " +"функцій, анотованих типами, декоратор автоматично визначить тип першого " +"аргументу:" + +msgid "" +">>> @fun.register\n" +"... def _(arg: int, verbose=False):\n" +"... if verbose:\n" +"... print(\"Strength in numbers, eh?\", end=\" \")\n" +"... print(arg)\n" +"...\n" +">>> @fun.register\n" +"... def _(arg: list, verbose=False):\n" +"... if verbose:\n" +"... print(\"Enumerate this:\")\n" +"... for i, elem in enumerate(arg):\n" +"... print(i, elem)" +msgstr "" + +msgid ":data:`types.UnionType` and :data:`typing.Union` can also be used::" +msgstr "" + +msgid "" +">>> @fun.register\n" +"... def _(arg: int | float, verbose=False):\n" +"... if verbose:\n" +"... print(\"Strength in numbers, eh?\", end=\" \")\n" +"... print(arg)\n" +"...\n" +">>> from typing import Union\n" +">>> @fun.register\n" +"... def _(arg: Union[list, set], verbose=False):\n" +"... if verbose:\n" +"... print(\"Enumerate this:\")\n" +"... for i, elem in enumerate(arg):\n" +"... print(i, elem)\n" +"..." +msgstr "" + +msgid "" +"For code which doesn't use type annotations, the appropriate type argument " +"can be passed explicitly to the decorator itself::" +msgstr "" +"Для коду, який не використовує анотації типу, відповідний аргумент типу " +"можна явно передати самому декоратору::" + +msgid "" +">>> @fun.register(complex)\n" +"... def _(arg, verbose=False):\n" +"... if verbose:\n" +"... print(\"Better than complicated.\", end=\" \")\n" +"... print(arg.real, arg.imag)\n" +"..." +msgstr "" + +msgid "" +"For code that dispatches on a collections type (e.g., ``list``), but wants " +"to typehint the items of the collection (e.g., ``list[int]``), the dispatch " +"type should be passed explicitly to the decorator itself with the typehint " +"going into the function definition::" +msgstr "" + +msgid "" +">>> @fun.register(list)\n" +"... def _(arg: list[int], verbose=False):\n" +"... if verbose:\n" +"... print(\"Enumerate this:\")\n" +"... for i, elem in enumerate(arg):\n" +"... print(i, elem)" +msgstr "" + +msgid "" +"At runtime the function will dispatch on an instance of a list regardless of " +"the type contained within the list i.e. ``[1,2,3]`` will be dispatched the " +"same as ``[\"foo\", \"bar\", \"baz\"]``. The annotation provided in this " +"example is for static type checkers only and has no runtime impact." +msgstr "" + +msgid "" +"To enable registering :term:`lambdas` and pre-existing functions, " +"the :func:`register` attribute can also be used in a functional form::" +msgstr "" +"Щоб увімкнути реєстрацію :term:`lambdas ` і вже існуючих функцій, " +"атрибут :func:`register` також можна використовувати у функціональній формі:" + +msgid "" +">>> def nothing(arg, verbose=False):\n" +"... print(\"Nothing.\")\n" +"...\n" +">>> fun.register(type(None), nothing)" +msgstr "" + +msgid "" +"The :func:`register` attribute returns the undecorated function. This " +"enables decorator stacking, :mod:`pickling`, and the creation of " +"unit tests for each variant independently::" +msgstr "" +"Атрибут :func:`register` повертає недекоровану функцію. Це дозволяє " +"стекувати декоратор, :mod:`піклінг ` і створювати модульні тести для " +"кожного варіанту незалежно:" + +msgid "" +">>> @fun.register(float)\n" +"... @fun.register(Decimal)\n" +"... def fun_num(arg, verbose=False):\n" +"... if verbose:\n" +"... print(\"Half of your number:\", end=\" \")\n" +"... print(arg / 2)\n" +"...\n" +">>> fun_num is fun\n" +"False" +msgstr "" + +msgid "" +"When called, the generic function dispatches on the type of the first " +"argument::" +msgstr "Під час виклику загальна функція надсилає тип першого аргументу::" + +msgid "" +">>> fun(\"Hello, world.\")\n" +"Hello, world.\n" +">>> fun(\"test.\", verbose=True)\n" +"Let me just say, test.\n" +">>> fun(42, verbose=True)\n" +"Strength in numbers, eh? 42\n" +">>> fun(['spam', 'spam', 'eggs', 'spam'], verbose=True)\n" +"Enumerate this:\n" +"0 spam\n" +"1 spam\n" +"2 eggs\n" +"3 spam\n" +">>> fun(None)\n" +"Nothing.\n" +">>> fun(1.23)\n" +"0.615" +msgstr "" + +msgid "" +"Where there is no registered implementation for a specific type, its method " +"resolution order is used to find a more generic implementation. The original " +"function decorated with ``@singledispatch`` is registered for the base :" +"class:`object` type, which means it is used if no better implementation is " +"found." +msgstr "" +"Якщо немає зареєстрованої реалізації для певного типу, його порядок " +"вирішення методів використовується для пошуку більш загальної реалізації. " +"Оригінальна функція, прикрашена ``@singledispatch``, зареєстрована для " +"базового типу :class:`object`, що означає, що вона використовується, якщо не " +"знайдено кращої реалізації." + +msgid "" +"If an implementation is registered to an :term:`abstract base class`, " +"virtual subclasses of the base class will be dispatched to that " +"implementation::" +msgstr "" +"Якщо реалізацію зареєстровано в :term:`abstract base class`, віртуальні " +"підкласи базового класу будуть відправлені до цієї реалізації::" + +msgid "" +">>> from collections.abc import Mapping\n" +">>> @fun.register\n" +"... def _(arg: Mapping, verbose=False):\n" +"... if verbose:\n" +"... print(\"Keys & Values\")\n" +"... for key, value in arg.items():\n" +"... print(key, \"=>\", value)\n" +"...\n" +">>> fun({\"a\": \"b\"})\n" +"a => b" +msgstr "" + +msgid "" +"To check which implementation the generic function will choose for a given " +"type, use the ``dispatch()`` attribute::" +msgstr "" +"Щоб перевірити, яку реалізацію вибере загальна функція для заданого типу, " +"використовуйте атрибут ``dispatch()``::" + +msgid "" +">>> fun.dispatch(float)\n" +"\n" +">>> fun.dispatch(dict) # note: default implementation\n" +"" +msgstr "" + +msgid "" +"To access all registered implementations, use the read-only ``registry`` " +"attribute::" +msgstr "" +"Щоб отримати доступ до всіх зареєстрованих реалізацій, використовуйте " +"атрибут ``registry`` лише для читання::" + +msgid "" +">>> fun.registry.keys()\n" +"dict_keys([, , ,\n" +" , ,\n" +" ])\n" +">>> fun.registry[float]\n" +"\n" +">>> fun.registry[object]\n" +"" +msgstr "" + +msgid "The :func:`register` attribute now supports using type annotations." +msgstr "Атрибут :func:`register` тепер підтримує використання анотацій типу." + +msgid "" +"The :func:`register` attribute now supports :data:`types.UnionType` and :" +"data:`typing.Union` as type annotations." +msgstr "" + +msgid "" +"Transform a method into a :term:`single-dispatch ` :term:" +"`generic function`." +msgstr "" +"Перетворення методу на :term:`single-dispatch ` :term:" +"`generic function`." + +msgid "" +"To define a generic method, decorate it with the ``@singledispatchmethod`` " +"decorator. When defining a function using ``@singledispatchmethod``, note " +"that the dispatch happens on the type of the first non-*self* or non-*cls* " +"argument::" +msgstr "" +"Щоб визначити загальний метод, прикрасьте його декоратором " +"``@singledispatchmethod``. Визначаючи функцію за допомогою " +"``@singledispatchmethod``, зауважте, що відправлення відбувається за типом " +"першого не*self* або не*cls* аргументу::" + +msgid "" +"class Negator:\n" +" @singledispatchmethod\n" +" def neg(self, arg):\n" +" raise NotImplementedError(\"Cannot negate a\")\n" +"\n" +" @neg.register\n" +" def _(self, arg: int):\n" +" return -arg\n" +"\n" +" @neg.register\n" +" def _(self, arg: bool):\n" +" return not arg" +msgstr "" + +msgid "" +"``@singledispatchmethod`` supports nesting with other decorators such as :" +"func:`@classmethod`. Note that to allow for ``dispatcher." +"register``, ``singledispatchmethod`` must be the *outer most* decorator. " +"Here is the ``Negator`` class with the ``neg`` methods bound to the class, " +"rather than an instance of the class::" +msgstr "" +"``@singledispatchmethod`` підтримує вкладення з іншими декораторами, такими " +"як :func:`@classmethod `. Зауважте, що для того, щоб дозволити " +"``dispatcher.register``, ``singledispatchmethod`` має бути *зовнішнім* " +"декоратором. Ось клас ``Negator`` з методами ``neg``, прив'язаними до класу, " +"а не екземпляр класу::" + +msgid "" +"class Negator:\n" +" @singledispatchmethod\n" +" @classmethod\n" +" def neg(cls, arg):\n" +" raise NotImplementedError(\"Cannot negate a\")\n" +"\n" +" @neg.register\n" +" @classmethod\n" +" def _(cls, arg: int):\n" +" return -arg\n" +"\n" +" @neg.register\n" +" @classmethod\n" +" def _(cls, arg: bool):\n" +" return not arg" +msgstr "" + +msgid "" +"The same pattern can be used for other similar decorators: :func:" +"`@staticmethod`, :func:`@abstractmethod`, " +"and others." +msgstr "" +"Той самий шаблон можна використовувати для інших подібних декораторів: :func:" +"`@staticmethod `, :func:`@abstractmethod ` " +"та інших." + +msgid "" +"Update a *wrapper* function to look like the *wrapped* function. The " +"optional arguments are tuples to specify which attributes of the original " +"function are assigned directly to the matching attributes on the wrapper " +"function and which attributes of the wrapper function are updated with the " +"corresponding attributes from the original function. The default values for " +"these arguments are the module level constants ``WRAPPER_ASSIGNMENTS`` " +"(which assigns to the wrapper function's :attr:`~function.__module__`, :attr:" +"`~function.__name__`, :attr:`~function.__qualname__`, :attr:`~function." +"__annotations__`, :attr:`~function.__type_params__`, and :attr:`~function." +"__doc__`, the documentation string) and ``WRAPPER_UPDATES`` (which updates " +"the wrapper function's :attr:`~function.__dict__`, i.e. the instance " +"dictionary)." +msgstr "" + +msgid "" +"To allow access to the original function for introspection and other " +"purposes (e.g. bypassing a caching decorator such as :func:`lru_cache`), " +"this function automatically adds a ``__wrapped__`` attribute to the wrapper " +"that refers to the function being wrapped." +msgstr "" +"Щоб дозволити доступ до оригінальної функції для самоаналізу та інших цілей " +"(наприклад, обхід декоратора кешування, такого як :func:`lru_cache`), ця " +"функція автоматично додає атрибут ``__wrapped__`` до оболонки, яка " +"посилається на функцію, яку обгортають." + +msgid "" +"The main intended use for this function is in :term:`decorator` functions " +"which wrap the decorated function and return the wrapper. If the wrapper " +"function is not updated, the metadata of the returned function will reflect " +"the wrapper definition rather than the original function definition, which " +"is typically less than helpful." +msgstr "" +"Основним призначенням цієї функції є функції :term:`decorator`, які " +"обертають декоровану функцію та повертають оболонку. Якщо функція-оболонка " +"не оновлена, метадані повернутої функції відображатимуть визначення " +"оболонки, а не початкове визначення функції, що зазвичай не дуже корисно." + +msgid "" +":func:`update_wrapper` may be used with callables other than functions. Any " +"attributes named in *assigned* or *updated* that are missing from the object " +"being wrapped are ignored (i.e. this function will not attempt to set them " +"on the wrapper function). :exc:`AttributeError` is still raised if the " +"wrapper function itself is missing any attributes named in *updated*." +msgstr "" +":func:`update_wrapper` можна використовувати з іншими викликами, ніж " +"функції. Будь-які атрибути з іменами *assigned* або *updated*, яких немає в " +"об’єкті, що обгортається, ігноруються (тобто ця функція не намагатиметься " +"встановити їх у функції обгортки). :exc:`AttributeError` все ще виникає, " +"якщо в самій функції-обгортки відсутні будь-які атрибути, названі в " +"*updated*." + +msgid "" +"The ``__wrapped__`` attribute is now automatically added. The :attr:" +"`~function.__annotations__` attribute is now copied by default. Missing " +"attributes no longer trigger an :exc:`AttributeError`." +msgstr "" + +msgid "" +"The ``__wrapped__`` attribute now always refers to the wrapped function, " +"even if that function defined a ``__wrapped__`` attribute. (see :issue:" +"`17482`)" +msgstr "" +"Атрибут ``__wrapped__`` тепер завжди посилається на обгорнуту функцію, " +"навіть якщо ця функція визначила атрибут ``__wrapped__``. (див. :issue:" +"`17482`)" + +msgid "" +"The :attr:`~function.__type_params__` attribute is now copied by default." +msgstr "" + +msgid "" +"This is a convenience function for invoking :func:`update_wrapper` as a " +"function decorator when defining a wrapper function. It is equivalent to " +"``partial(update_wrapper, wrapped=wrapped, assigned=assigned, " +"updated=updated)``. For example::" +msgstr "" +"Це зручна функція для виклику :func:`update_wrapper` як декоратора функції " +"під час визначення функції-огортки. Це еквівалентно " +"``partial(update_wrapper, wrapped=wrapped, assigned=призначено, " +"updated=updated)``. Наприклад::" + +msgid "" +">>> from functools import wraps\n" +">>> def my_decorator(f):\n" +"... @wraps(f)\n" +"... def wrapper(*args, **kwds):\n" +"... print('Calling decorated function')\n" +"... return f(*args, **kwds)\n" +"... return wrapper\n" +"...\n" +">>> @my_decorator\n" +"... def example():\n" +"... \"\"\"Docstring\"\"\"\n" +"... print('Called example function')\n" +"...\n" +">>> example()\n" +"Calling decorated function\n" +"Called example function\n" +">>> example.__name__\n" +"'example'\n" +">>> example.__doc__\n" +"'Docstring'" +msgstr "" + +msgid "" +"Without the use of this decorator factory, the name of the example function " +"would have been ``'wrapper'``, and the docstring of the original :func:" +"`example` would have been lost." +msgstr "" +"Без використання цієї фабрики декораторів назва функції прикладу була б " +"``'wrapper``, а рядок документації оригінального :func:`example` було б " +"втрачено." + +msgid ":class:`partial` Objects" +msgstr ":class:`partial` Об'єкти" + +msgid "" +":class:`partial` objects are callable objects created by :func:`partial`. " +"They have three read-only attributes:" +msgstr "" +":class:`partial` об’єкти – це викликані об’єкти, створені :func:`partial`. " +"Вони мають три атрибути лише для читання:" + +msgid "" +"A callable object or function. Calls to the :class:`partial` object will be " +"forwarded to :attr:`func` with new arguments and keywords." +msgstr "" +"Викликаний об’єкт або функція. Виклики об’єкта :class:`partial` будуть " +"перенаправлені до :attr:`func` з новими аргументами та ключовими словами." + +msgid "" +"The leftmost positional arguments that will be prepended to the positional " +"arguments provided to a :class:`partial` object call." +msgstr "" +"Крайні ліві позиційні аргументи, які будуть додані до позиційних аргументів, " +"наданих до виклику об’єкта :class:`partial`." + +msgid "" +"The keyword arguments that will be supplied when the :class:`partial` object " +"is called." +msgstr "" +"Ключові аргументи, які будуть надані під час виклику об’єкта :class:" +"`partial`." + +msgid "" +":class:`partial` objects are like :ref:`function objects ` in that they are callable, weak referenceable, and can have " +"attributes. There are some important differences. For instance, the :attr:" +"`~function.__name__` and :attr:`function.__doc__` attributes are not created " +"automatically. Also, :class:`partial` objects defined in classes behave " +"like static methods and do not transform into bound methods during instance " +"attribute look-up." +msgstr "" diff --git a/library/gc.po b/library/gc.po new file mode 100644 index 000000000..5e6b47201 --- /dev/null +++ b/library/gc.po @@ -0,0 +1,487 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 01:06+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!gc` --- Garbage Collector interface" +msgstr "" + +msgid "" +"This module provides an interface to the optional garbage collector. It " +"provides the ability to disable the collector, tune the collection " +"frequency, and set debugging options. It also provides access to " +"unreachable objects that the collector found but cannot free. Since the " +"collector supplements the reference counting already used in Python, you can " +"disable the collector if you are sure your program does not create reference " +"cycles. Automatic collection can be disabled by calling ``gc.disable()``. " +"To debug a leaking program call ``gc.set_debug(gc.DEBUG_LEAK)``. Notice that " +"this includes ``gc.DEBUG_SAVEALL``, causing garbage-collected objects to be " +"saved in gc.garbage for inspection." +msgstr "" +"Цей модуль забезпечує інтерфейс для додаткового збирача сміття. Він надає " +"можливість вимкнути збирач, налаштувати частоту збирання та встановити " +"параметри налагодження. Він також надає доступ до недоступних об'єктів, які " +"збирач знайшов, але не може звільнити. Оскільки збирач доповнює підрахунок " +"посилань, який уже використовується в Python, ви можете вимкнути збирач, " +"якщо ви впевнені, що ваша програма не створює цикли посилань. Автоматичний " +"збір можна вимкнути, викликавши ``gc.disable()``. Щоб налагодити витік " +"програми, викличте ``gc.set_debug(gc.DEBUG_LEAK)``. Зверніть увагу, що це " +"включає ``gc.DEBUG_SAVEALL``, змушуючи зібрані об’єкти сміття зберігатися в " +"gc.garbage для перевірки." + +msgid "The :mod:`gc` module provides the following functions:" +msgstr "Модуль :mod:`gc` забезпечує такі функції:" + +msgid "Enable automatic garbage collection." +msgstr "Увімкнути автоматичний збір сміття." + +msgid "Disable automatic garbage collection." +msgstr "Вимкнути автоматичний збір сміття." + +msgid "Return ``True`` if automatic collection is enabled." +msgstr "Повертає ``True``, якщо ввімкнено автоматичний збір." + +msgid "" +"With no arguments, run a full collection. The optional argument " +"*generation* may be an integer specifying which generation to collect (from " +"0 to 2). A :exc:`ValueError` is raised if the generation number is invalid. " +"The sum of collected objects and uncollectable objects is returned." +msgstr "" + +msgid "" +"The free lists maintained for a number of built-in types are cleared " +"whenever a full collection or collection of the highest generation (2) is " +"run. Not all items in some free lists may be freed due to the particular " +"implementation, in particular :class:`float`." +msgstr "" +"Безкоштовні списки, які підтримуються для ряду вбудованих типів, очищаються " +"щоразу, коли запускається повна колекція або колекція найвищого покоління " +"(2). Не всі елементи в деяких вільних списках можуть бути звільнені через " +"певну реалізацію, зокрема :class:`float`." + +msgid "" +"The effect of calling ``gc.collect()`` while the interpreter is already " +"performing a collection is undefined." +msgstr "" + +msgid "" +"Set the garbage collection debugging flags. Debugging information will be " +"written to ``sys.stderr``. See below for a list of debugging flags which " +"can be combined using bit operations to control debugging." +msgstr "" +"Встановіть позначки налагодження збору сміття. Інформація про налагодження " +"буде записана в ``sys.stderr``. Нижче наведено список прапорів налагодження, " +"які можна комбінувати за допомогою бітових операцій для керування " +"налагодженням." + +msgid "Return the debugging flags currently set." +msgstr "Повернути поточні встановлені позначки налагодження." + +msgid "" +"Returns a list of all objects tracked by the collector, excluding the list " +"returned. If *generation* is not ``None``, return only the objects tracked " +"by the collector that are in that generation." +msgstr "" + +msgid "New *generation* parameter." +msgstr "Новий параметр *generation*." + +msgid "" +"Raises an :ref:`auditing event ` ``gc.get_objects`` with argument " +"``generation``." +msgstr "" +"Викликає :ref:`подію аудиту ` ``gc.get_objects`` з аргументом " +"``generation``." + +msgid "" +"Return a list of three per-generation dictionaries containing collection " +"statistics since interpreter start. The number of keys may change in the " +"future, but currently each dictionary will contain the following items:" +msgstr "" +"Повертає список із трьох словників для кожного покоління, що містить " +"статистику збору з моменту запуску інтерпретатора. У майбутньому кількість " +"ключів може змінитися, але наразі кожен словник міститиме такі елементи:" + +msgid "``collections`` is the number of times this generation was collected;" +msgstr "``колекції`` — це кількість разів, коли було зібрано це покоління;" + +msgid "" +"``collected`` is the total number of objects collected inside this " +"generation;" +msgstr "" +"``collected`` - це загальна кількість об'єктів, зібраних у цій генерації;" + +msgid "" +"``uncollectable`` is the total number of objects which were found to be " +"uncollectable (and were therefore moved to the :data:`garbage` list) inside " +"this generation." +msgstr "" +"``uncollectable`` — це загальна кількість об’єктів, які були визнані такими, " +"що неможливо зібрати (і тому були переміщені до списку :data:`garbage`) у " +"цьому поколінні." + +msgid "" +"Set the garbage collection thresholds (the collection frequency). Setting " +"*threshold0* to zero disables collection." +msgstr "" +"Встановіть порогові значення збору сміття (частоту збору). Встановлення " +"*threshold0* на нуль вимикає збір." + +msgid "" +"The GC classifies objects into three generations depending on how many " +"collection sweeps they have survived. New objects are placed in the " +"youngest generation (generation ``0``). If an object survives a collection " +"it is moved into the next older generation. Since generation ``2`` is the " +"oldest generation, objects in that generation remain there after a " +"collection. In order to decide when to run, the collector keeps track of " +"the number object allocations and deallocations since the last collection. " +"When the number of allocations minus the number of deallocations exceeds " +"*threshold0*, collection starts. Initially only generation ``0`` is " +"examined. If generation ``0`` has been examined more than *threshold1* " +"times since generation ``1`` has been examined, then generation ``1`` is " +"examined as well. With the third generation, things are a bit more " +"complicated, see `Collecting the oldest generation `_ for more " +"information." +msgstr "" +"GC класифікує об’єкти за трьома поколіннями залежно від того, скільки циклів " +"збирання вони пережили. Нові об'єкти поміщаються в наймолодше покоління " +"(генерація ``0``). Якщо об’єкт переживає колекцію, він переміщується до " +"наступного старшого покоління. Оскільки покоління ``2`` є найстарішим " +"поколінням, об'єкти цього покоління залишаються там після колекції. Щоб " +"вирішити, коли запускати, збирач відстежує кількість виділень і звільнень " +"об’єктів з моменту останнього збору. Коли кількість виділень мінус кількість " +"звільнень перевищує *поріг0*, починається збір. Спочатку перевіряється лише " +"покоління ``0``. Якщо покоління ``0`` перевірялося більше ніж *threshold1* " +"разів після перевірки покоління ``1``, тоді також перевіряється покоління " +"``1``. З третім поколінням все трохи складніше, див. `Збір найстарішого " +"покоління `_ для отримання додаткової інформації." + +msgid "" +"Return the current collection counts as a tuple of ``(count0, count1, " +"count2)``." +msgstr "" +"Повертає поточну колекцію підрахунків як кортеж ``(count0, count1, count2)``." + +msgid "" +"Return the current collection thresholds as a tuple of ``(threshold0, " +"threshold1, threshold2)``." +msgstr "" +"Повертає поточні порогові значення збору як кортеж ``(threshold0, " +"threshold1, threshold2)``." + +msgid "" +"Return the list of objects that directly refer to any of objs. This function " +"will only locate those containers which support garbage collection; " +"extension types which do refer to other objects but do not support garbage " +"collection will not be found." +msgstr "" +"Повертає список об’єктів, які безпосередньо посилаються на будь-який з " +"об’єктів. Ця функція знаходитиме лише ті контейнери, які підтримують збір " +"сміття; типи розширень, які посилаються на інші об’єкти, але не підтримують " +"збирання сміття, не будуть знайдені." + +msgid "" +"Note that objects which have already been dereferenced, but which live in " +"cycles and have not yet been collected by the garbage collector can be " +"listed among the resulting referrers. To get only currently live objects, " +"call :func:`collect` before calling :func:`get_referrers`." +msgstr "" +"Зауважте, що об’єкти, які вже було розіменовано, але які живуть у циклах і " +"ще не були зібрані збирачем сміття, можуть бути перераховані серед отриманих " +"посилань. Щоб отримати лише активні об’єкти, викликайте :func:`collect` " +"перед викликом :func:`get_referrers`." + +msgid "" +"Care must be taken when using objects returned by :func:`get_referrers` " +"because some of them could still be under construction and hence in a " +"temporarily invalid state. Avoid using :func:`get_referrers` for any purpose " +"other than debugging." +msgstr "" +"Необхідно бути обережним, використовуючи об’єкти, які повертає :func:" +"`get_referrers`, тому що деякі з них все ще можуть перебувати в стадії " +"розробки і, отже, у тимчасово недійсному стані. Уникайте використання :func:" +"`get_referrers` для будь-яких цілей, окрім налагодження." + +msgid "" +"Raises an :ref:`auditing event ` ``gc.get_referrers`` with " +"argument ``objs``." +msgstr "" +"Викликає :ref:`подію аудиту ` ``gc.get_referrers`` з аргументом " +"``objs``." + +msgid "" +"Return a list of objects directly referred to by any of the arguments. The " +"referents returned are those objects visited by the arguments' C-level :c:" +"member:`~PyTypeObject.tp_traverse` methods (if any), and may not be all " +"objects actually directly reachable. :c:member:`~PyTypeObject.tp_traverse` " +"methods are supported only by objects that support garbage collection, and " +"are only required to visit objects that may be involved in a cycle. So, for " +"example, if an integer is directly reachable from an argument, that integer " +"object may or may not appear in the result list." +msgstr "" +"Повертає список об’єктів, на які безпосередньо посилається будь-який з " +"аргументів. Повернуті референти — це ті об’єкти, відвідані методами " +"аргументів C-level :c:member:`~PyTypeObject.tp_traverse` (якщо такі є), і " +"можуть бути не всі об’єкти, фактично доступні безпосередньо. :c:member:" +"`~PyTypeObject.tp_traverse` методи підтримуються лише об’єктами, які " +"підтримують збирання сміття, і потрібні лише для відвідування об’єктів, які " +"можуть брати участь у циклі. Так, наприклад, якщо ціле число доступне " +"безпосередньо з аргументу, цей цілочисельний об’єкт може з’явитися або не " +"з’явитися у списку результатів." + +msgid "" +"Raises an :ref:`auditing event ` ``gc.get_referents`` with " +"argument ``objs``." +msgstr "" +"Викликає :ref:`подію аудиту ` ``gc.get_referents`` з аргументом " +"``objs``." + +msgid "" +"Returns ``True`` if the object is currently tracked by the garbage " +"collector, ``False`` otherwise. As a general rule, instances of atomic " +"types aren't tracked and instances of non-atomic types (containers, user-" +"defined objects...) are. However, some type-specific optimizations can be " +"present in order to suppress the garbage collector footprint of simple " +"instances (e.g. dicts containing only atomic keys and values)::" +msgstr "" +"Повертає ``True``, якщо об’єкт наразі відстежується збирачем сміття, " +"``False`` інакше. Як правило, екземпляри атомарних типів не відстежуються, а " +"екземпляри неатомарних типів (контейнери, об’єкти, визначені " +"користувачем...) відстежуються. Проте деякі типи оптимізації можуть бути " +"присутні, щоб придушити слід збирача сміття простих екземплярів (наприклад, " +"dicts, що містять лише атомарні ключі та значення):" + +msgid "" +">>> gc.is_tracked(0)\n" +"False\n" +">>> gc.is_tracked(\"a\")\n" +"False\n" +">>> gc.is_tracked([])\n" +"True\n" +">>> gc.is_tracked({})\n" +"False\n" +">>> gc.is_tracked({\"a\": 1})\n" +"False\n" +">>> gc.is_tracked({\"a\": []})\n" +"True" +msgstr "" + +msgid "" +"Returns ``True`` if the given object has been finalized by the garbage " +"collector, ``False`` otherwise. ::" +msgstr "" +"Повертає ``True``, якщо даний об’єкт був завершений збирачем сміття, " +"``False`` інакше. ::" + +msgid "" +">>> x = None\n" +">>> class Lazarus:\n" +"... def __del__(self):\n" +"... global x\n" +"... x = self\n" +"...\n" +">>> lazarus = Lazarus()\n" +">>> gc.is_finalized(lazarus)\n" +"False\n" +">>> del lazarus\n" +">>> gc.is_finalized(x)\n" +"True" +msgstr "" + +msgid "" +"Freeze all the objects tracked by the garbage collector; move them to a " +"permanent generation and ignore them in all the future collections." +msgstr "" + +msgid "" +"If a process will ``fork()`` without ``exec()``, avoiding unnecessary copy-" +"on-write in child processes will maximize memory sharing and reduce overall " +"memory usage. This requires both avoiding creation of freed \"holes\" in " +"memory pages in the parent process and ensuring that GC collections in child " +"processes won't touch the ``gc_refs`` counter of long-lived objects " +"originating in the parent process. To accomplish both, call ``gc.disable()`` " +"early in the parent process, ``gc.freeze()`` right before ``fork()``, and " +"``gc.enable()`` early in child processes." +msgstr "" + +msgid "" +"Unfreeze the objects in the permanent generation, put them back into the " +"oldest generation." +msgstr "" +"Розморозити об’єкти в постійному поколінні, повернути їх у найстаріше " +"покоління." + +msgid "Return the number of objects in the permanent generation." +msgstr "Повертає кількість об’єктів у постійній генерації." + +msgid "" +"The following variables are provided for read-only access (you can mutate " +"the values but should not rebind them):" +msgstr "" +"Наступні змінні надаються для доступу лише для читання (ви можете змінити " +"значення, але не повинні їх повторно прив’язувати):" + +msgid "" +"A list of objects which the collector found to be unreachable but could not " +"be freed (uncollectable objects). Starting with Python 3.4, this list " +"should be empty most of the time, except when using instances of C extension " +"types with a non-``NULL`` ``tp_del`` slot." +msgstr "" +"Список об’єктів, які збирач виявив недоступними, але не міг звільнити " +"(незбірні об’єкти). Починаючи з Python 3.4, цей список має бути порожнім " +"більшу частину часу, за винятком випадків використання екземплярів типів " +"розширень C із слотом ``tp_del``, відмінним від ``NULL``." + +msgid "" +"If :const:`DEBUG_SAVEALL` is set, then all unreachable objects will be added " +"to this list rather than freed." +msgstr "" +"Якщо встановлено :const:`DEBUG_SAVEALL`, усі недоступні об’єкти будуть " +"додані до цього списку, а не звільнені." + +msgid "" +"If this list is non-empty at :term:`interpreter shutdown`, a :exc:" +"`ResourceWarning` is emitted, which is silent by default. If :const:" +"`DEBUG_UNCOLLECTABLE` is set, in addition all uncollectable objects are " +"printed." +msgstr "" +"Якщо цей список не порожній під час :term:`interpreter shutdown`, видається :" +"exc:`ResourceWarning`, яке за замовчуванням мовчить. Якщо встановлено :const:" +"`DEBUG_UNCOLLECTABLE`, додатково друкуються всі об’єкти, які неможливо " +"зібрати." + +msgid "" +"Following :pep:`442`, objects with a :meth:`~object.__del__` method don't " +"end up in :data:`gc.garbage` anymore." +msgstr "" + +msgid "" +"A list of callbacks that will be invoked by the garbage collector before and " +"after collection. The callbacks will be called with two arguments, *phase* " +"and *info*." +msgstr "" +"Список зворотних викликів, які будуть викликані збирачем сміття до і після " +"збирання. Зворотні виклики будуть викликані з двома аргументами, *phase* та " +"*info*." + +msgid "*phase* can be one of two values:" +msgstr "*phase* може бути одним із двох значень:" + +msgid "\"start\": The garbage collection is about to start." +msgstr "\"start\": збирання сміття ось-ось розпочнеться." + +msgid "\"stop\": The garbage collection has finished." +msgstr "\"стоп\": збирання сміття завершено." + +msgid "" +"*info* is a dict providing more information for the callback. The following " +"keys are currently defined:" +msgstr "" +"*info* — це dict, що надає більше інформації для зворотного виклику. Наразі " +"визначено такі ключі:" + +msgid "\"generation\": The oldest generation being collected." +msgstr "\"генерація\": збирається найстаріше покоління." + +msgid "" +"\"collected\": When *phase* is \"stop\", the number of objects successfully " +"collected." +msgstr "" +"\"collected\": коли *phase* має значення \"stop\", кількість успішно " +"зібраних об'єктів." + +msgid "" +"\"uncollectable\": When *phase* is \"stop\", the number of objects that " +"could not be collected and were put in :data:`garbage`." +msgstr "" +"\"uncollectable\": коли *phase* має значення \"stop\", кількість об'єктів, " +"які не вдалося зібрати та були поміщені в :data:`garbage`." + +msgid "" +"Applications can add their own callbacks to this list. The primary use " +"cases are:" +msgstr "" +"Програми можуть додавати власні зворотні виклики до цього списку. Основні " +"випадки використання:" + +msgid "" +"Gathering statistics about garbage collection, such as how often various " +"generations are collected, and how long the collection takes." +msgstr "" +"Збір статистики щодо збирання сміття, наприклад, як часто збираються різні " +"покоління та скільки часу займає збір." + +msgid "" +"Allowing applications to identify and clear their own uncollectable types " +"when they appear in :data:`garbage`." +msgstr "" +"Дозволяє програмам ідентифікувати та очищати власні типи, які не можна " +"збирати, коли вони з’являються в :data:`garbage`." + +msgid "The following constants are provided for use with :func:`set_debug`:" +msgstr "Наступні константи надаються для використання з :func:`set_debug`:" + +msgid "" +"Print statistics during collection. This information can be useful when " +"tuning the collection frequency." +msgstr "" +"Роздрукувати статистику під час збору. Ця інформація може бути корисною під " +"час налаштування частоти збору." + +msgid "Print information on collectable objects found." +msgstr "Роздрукуйте інформацію про знайдені предмети колекціонування." + +msgid "" +"Print information of uncollectable objects found (objects which are not " +"reachable but cannot be freed by the collector). These objects will be " +"added to the ``garbage`` list." +msgstr "" +"Друк інформації про знайдені об’єкти, які не можна збирати (об’єкти, які " +"недоступні, але не можуть бути звільнені колекціонером). Ці об’єкти будуть " +"додані до списку ``сміття``." + +msgid "" +"Also print the contents of the :data:`garbage` list at :term:`interpreter " +"shutdown`, if it isn't empty." +msgstr "" +"Також вивести вміст списку :data:`garbage` у :term:`interpreter shutdown`, " +"якщо він не порожній." + +msgid "" +"When set, all unreachable objects found will be appended to *garbage* rather " +"than being freed. This can be useful for debugging a leaking program." +msgstr "" +"Якщо встановлено, усі знайдені недоступні об’єкти будуть додані до *сміття*, " +"а не звільнені. Це може бути корисно для налагодження витоку програми." + +msgid "" +"The debugging flags necessary for the collector to print information about a " +"leaking program (equal to ``DEBUG_COLLECTABLE | DEBUG_UNCOLLECTABLE | " +"DEBUG_SAVEALL``)." +msgstr "" +"Прапори налагодження, необхідні збирачеві для друку інформації про витік " +"програми (рівні ``DEBUG_COLLECTABLE | DEBUG_UNCOLLECTABLE | DEBUG_SAVEALL``)." diff --git a/library/getopt.po b/library/getopt.po new file mode 100644 index 000000000..ef36ff4fd --- /dev/null +++ b/library/getopt.po @@ -0,0 +1,269 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 01:06+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!getopt` --- C-style parser for command line options" +msgstr "" + +msgid "**Source code:** :source:`Lib/getopt.py`" +msgstr "**Вихідний код:** :source:`Lib/getopt.py`" + +msgid "" +"This module is considered feature complete. A more declarative and " +"extensible alternative to this API is provided in the :mod:`optparse` " +"module. Further functional enhancements for command line parameter " +"processing are provided either as third party modules on PyPI, or else as " +"features in the :mod:`argparse` module." +msgstr "" + +msgid "" +"This module helps scripts to parse the command line arguments in ``sys." +"argv``. It supports the same conventions as the Unix :c:func:`!getopt` " +"function (including the special meanings of arguments of the form '``-``' " +"and '``--``'). Long options similar to those supported by GNU software may " +"be used as well via an optional third argument." +msgstr "" + +msgid "" +"Users who are unfamiliar with the Unix :c:func:`!getopt` function should " +"consider using the :mod:`argparse` module instead. Users who are familiar " +"with the Unix :c:func:`!getopt` function, but would like to get equivalent " +"behavior while writing less code and getting better help and error messages " +"should consider using the :mod:`optparse` module. See :ref:`choosing-an-" +"argument-parser` for additional details." +msgstr "" + +msgid "This module provides two functions and an exception:" +msgstr "Цей модуль забезпечує дві функції та виняток:" + +msgid "" +"Parses command line options and parameter list. *args* is the argument list " +"to be parsed, without the leading reference to the running program. " +"Typically, this means ``sys.argv[1:]``. *shortopts* is the string of option " +"letters that the script wants to recognize, with options that require an " +"argument followed by a colon (``':'``; i.e., the same format that Unix :c:" +"func:`!getopt` uses)." +msgstr "" + +msgid "" +"Unlike GNU :c:func:`!getopt`, after a non-option argument, all further " +"arguments are considered also non-options. This is similar to the way non-" +"GNU Unix systems work." +msgstr "" + +msgid "" +"*longopts*, if specified, must be a list of strings with the names of the " +"long options which should be supported. The leading ``'--'`` characters " +"should not be included in the option name. Long options which require an " +"argument should be followed by an equal sign (``'='``). Optional arguments " +"are not supported. To accept only long options, *shortopts* should be an " +"empty string. Long options on the command line can be recognized so long as " +"they provide a prefix of the option name that matches exactly one of the " +"accepted options. For example, if *longopts* is ``['foo', 'frob']``, the " +"option ``--fo`` will match as ``--foo``, but ``--f`` will not match " +"uniquely, so :exc:`GetoptError` will be raised." +msgstr "" +"*longopts*, якщо вказано, має бути списком рядків із іменами довгих " +"параметрів, які мають підтримуватися. Початкові символи ``''--'`` не повинні " +"включатися в назву опції. Довгі параметри, які потребують аргументу, повинні " +"супроводжуватися знаком рівності (``'='``). Необов'язкові аргументи не " +"підтримуються. Щоб приймати лише довгі варіанти, *shortopts* має бути " +"порожнім рядком. Довгі параметри в командному рядку можна розпізнати, якщо " +"вони містять префікс назви параметра, який точно відповідає одному з " +"прийнятих параметрів. Наприклад, якщо *longopts* є ``['foo', 'frob']``, " +"опція ``--fo`` відповідатиме ``--foo``, але ``--f`` не збігатиметься " +"однозначно, тому буде викликано :exc:`GetoptError`." + +msgid "" +"The return value consists of two elements: the first is a list of ``(option, " +"value)`` pairs; the second is the list of program arguments left after the " +"option list was stripped (this is a trailing slice of *args*). Each option-" +"and-value pair returned has the option as its first element, prefixed with a " +"hyphen for short options (e.g., ``'-x'``) or two hyphens for long options (e." +"g., ``'--long-option'``), and the option argument as its second element, or " +"an empty string if the option has no argument. The options occur in the " +"list in the same order in which they were found, thus allowing multiple " +"occurrences. Long and short options may be mixed." +msgstr "" +"Повернене значення складається з двох елементів: перший – це список пар " +"``(параметр, значення)``; другий — список аргументів програми, що залишився " +"після видалення списку параметрів (це кінцевий фрагмент *args*). Кожна " +"повернута пара параметрів і значень має параметр як перший елемент із " +"префіксом дефіса для коротких варіантів (наприклад, ``'-x''``) або двох " +"дефісів для довгих варіантів (наприклад, ``'--long-option'``), і аргумент " +"параметра як його другий елемент або порожній рядок, якщо параметр не має " +"аргументу. Параметри з’являються в списку в тому самому порядку, в якому " +"вони були знайдені, таким чином допускаючи багатократне повторення. Довгі та " +"короткі варіанти можуть змішуватися." + +msgid "" +"This function works like :func:`getopt`, except that GNU style scanning mode " +"is used by default. This means that option and non-option arguments may be " +"intermixed. The :func:`getopt` function stops processing options as soon as " +"a non-option argument is encountered." +msgstr "" +"Ця функція працює як :func:`getopt`, за винятком того, що за замовчуванням " +"використовується режим сканування у стилі GNU. Це означає, що аргументи " +"варіантів і неваріантів можуть змішуватися. Функція :func:`getopt` припиняє " +"обробку опцій, щойно зустрічається аргумент, що не є опцією." + +msgid "" +"If the first character of the option string is ``'+'``, or if the " +"environment variable :envvar:`!POSIXLY_CORRECT` is set, then option " +"processing stops as soon as a non-option argument is encountered." +msgstr "" + +msgid "" +"This is raised when an unrecognized option is found in the argument list or " +"when an option requiring an argument is given none. The argument to the " +"exception is a string indicating the cause of the error. For long options, " +"an argument given to an option which does not require one will also cause " +"this exception to be raised. The attributes :attr:`!msg` and :attr:`!opt` " +"give the error message and related option; if there is no specific option to " +"which the exception relates, :attr:`!opt` is an empty string." +msgstr "" + +msgid "Alias for :exc:`GetoptError`; for backward compatibility." +msgstr "Псевдонім для :exc:`GetoptError`; для зворотної сумісності." + +msgid "An example using only Unix style options:" +msgstr "Приклад використання лише параметрів стилю Unix:" + +msgid "" +">>> import getopt\n" +">>> args = '-a -b -cfoo -d bar a1 a2'.split()\n" +">>> args\n" +"['-a', '-b', '-cfoo', '-d', 'bar', 'a1', 'a2']\n" +">>> optlist, args = getopt.getopt(args, 'abc:d:')\n" +">>> optlist\n" +"[('-a', ''), ('-b', ''), ('-c', 'foo'), ('-d', 'bar')]\n" +">>> args\n" +"['a1', 'a2']" +msgstr "" + +msgid "Using long option names is equally easy:" +msgstr "Використовувати довгі назви параметрів так само легко:" + +msgid "" +">>> s = '--condition=foo --testing --output-file abc.def -x a1 a2'\n" +">>> args = s.split()\n" +">>> args\n" +"['--condition=foo', '--testing', '--output-file', 'abc.def', '-x', 'a1', " +"'a2']\n" +">>> optlist, args = getopt.getopt(args, 'x', [\n" +"... 'condition=', 'output-file=', 'testing'])\n" +">>> optlist\n" +"[('--condition', 'foo'), ('--testing', ''), ('--output-file', 'abc.def'), ('-" +"x', '')]\n" +">>> args\n" +"['a1', 'a2']" +msgstr "" + +msgid "In a script, typical usage is something like this:" +msgstr "" + +msgid "" +"import getopt, sys\n" +"\n" +"def main():\n" +" try:\n" +" opts, args = getopt.getopt(sys.argv[1:], \"ho:v\", [\"help\", " +"\"output=\"])\n" +" except getopt.GetoptError as err:\n" +" # print help information and exit:\n" +" print(err) # will print something like \"option -a not " +"recognized\"\n" +" usage()\n" +" sys.exit(2)\n" +" output = None\n" +" verbose = False\n" +" for o, a in opts:\n" +" if o == \"-v\":\n" +" verbose = True\n" +" elif o in (\"-h\", \"--help\"):\n" +" usage()\n" +" sys.exit()\n" +" elif o in (\"-o\", \"--output\"):\n" +" output = a\n" +" else:\n" +" assert False, \"unhandled option\"\n" +" process(args, output=output, verbose=verbose)\n" +"\n" +"if __name__ == \"__main__\":\n" +" main()" +msgstr "" + +msgid "" +"Note that an equivalent command line interface could be produced with less " +"code and more informative help and error messages by using the :mod:" +"`optparse` module:" +msgstr "" + +msgid "" +"import optparse\n" +"\n" +"if __name__ == '__main__':\n" +" parser = optparse.OptionParser()\n" +" parser.add_option('-o', '--output')\n" +" parser.add_option('-v', dest='verbose', action='store_true')\n" +" opts, args = parser.parse_args()\n" +" process(args, output=opts.output, verbose=opts.verbose)" +msgstr "" + +msgid "" +"A roughly equivalent command line interface for this case can also be " +"produced by using the :mod:`argparse` module:" +msgstr "" + +msgid "" +"import argparse\n" +"\n" +"if __name__ == '__main__':\n" +" parser = argparse.ArgumentParser()\n" +" parser.add_argument('-o', '--output')\n" +" parser.add_argument('-v', dest='verbose', action='store_true')\n" +" parser.add_argument('rest', nargs='*')\n" +" args = parser.parse_args()\n" +" process(args.rest, output=args.output, verbose=args.verbose)" +msgstr "" + +msgid "" +"See :ref:`choosing-an-argument-parser` for details on how the ``argparse`` " +"version of this code differs in behaviour from the ``optparse`` (and " +"``getopt``) version." +msgstr "" + +msgid "Module :mod:`optparse`" +msgstr "" + +msgid "Declarative command line option parsing." +msgstr "" + +msgid "Module :mod:`argparse`" +msgstr "Модуль :mod:`argparse`" + +msgid "More opinionated command line option and argument parsing library." +msgstr "" diff --git a/library/getpass.po b/library/getpass.po new file mode 100644 index 000000000..da10fefcf --- /dev/null +++ b/library/getpass.po @@ -0,0 +1,96 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 01:06+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!getpass` --- Portable password input" +msgstr "" + +msgid "**Source code:** :source:`Lib/getpass.py`" +msgstr "**Вихідний код:** :source:`Lib/getpass.py`" + +msgid "Availability" +msgstr "" + +msgid "" +"This module does not work or is not available on WebAssembly. See :ref:`wasm-" +"availability` for more information." +msgstr "" + +msgid "The :mod:`getpass` module provides two functions:" +msgstr "Модуль :mod:`getpass` забезпечує дві функції:" + +msgid "" +"Prompt the user for a password without echoing. The user is prompted using " +"the string *prompt*, which defaults to ``'Password: '``. On Unix, the " +"prompt is written to the file-like object *stream* using the replace error " +"handler if needed. *stream* defaults to the controlling terminal (:file:`/" +"dev/tty`) or if that is unavailable to ``sys.stderr`` (this argument is " +"ignored on Windows)." +msgstr "" +"Запитувати в користувача пароль без луни. Користувач отримує запит за " +"допомогою рядка *prompt*, який за замовчуванням має значення ``'Пароль:'``. " +"В Unix підказка записується у файлоподібний об’єкт *stream* за допомогою " +"обробника помилок заміни, якщо потрібно. *stream* за замовчуванням " +"використовується для керуючого терміналу (:file:`/dev/tty`) або, якщо він " +"недоступний, для ``sys.stderr`` (цей аргумент ігнорується в Windows)." + +msgid "" +"If echo free input is unavailable getpass() falls back to printing a warning " +"message to *stream* and reading from ``sys.stdin`` and issuing a :exc:" +"`GetPassWarning`." +msgstr "" +"Якщо введення без відлуння недоступне, getpass() повертається до друку " +"повідомлення попередження в *stream* і читання з ``sys.stdin`` і видачі :exc:" +"`GetPassWarning`." + +msgid "" +"If you call getpass from within IDLE, the input may be done in the terminal " +"you launched IDLE from rather than the idle window itself." +msgstr "" +"Якщо ви викликаєте getpass із IDLE, введення може здійснюватися в терміналі, " +"з якого ви запустили IDLE, а не в самому вікні очікування." + +msgid "A :exc:`UserWarning` subclass issued when password input may be echoed." +msgstr "" +"Підклас :exc:`UserWarning` видається, коли введення пароля може " +"повторюватися." + +msgid "Return the \"login name\" of the user." +msgstr "Повернути \"ім’я для входу\" користувача." + +msgid "" +"This function checks the environment variables :envvar:`LOGNAME`, :envvar:" +"`USER`, :envvar:`!LNAME` and :envvar:`USERNAME`, in order, and returns the " +"value of the first one which is set to a non-empty string. If none are set, " +"the login name from the password database is returned on systems which " +"support the :mod:`pwd` module, otherwise, an :exc:`OSError` is raised." +msgstr "" + +msgid "In general, this function should be preferred over :func:`os.getlogin`." +msgstr "" + +msgid "Previously, various exceptions beyond just :exc:`OSError` were raised." +msgstr "" diff --git a/library/gettext.po b/library/gettext.po new file mode 100644 index 000000000..b7e75cd7c --- /dev/null +++ b/library/gettext.po @@ -0,0 +1,969 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2023 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 01:06+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2023\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!gettext` --- Multilingual internationalization services" +msgstr "" + +msgid "**Source code:** :source:`Lib/gettext.py`" +msgstr "**Вихідний код:** :source:`Lib/gettext.py`" + +msgid "" +"The :mod:`gettext` module provides internationalization (I18N) and " +"localization (L10N) services for your Python modules and applications. It " +"supports both the GNU :program:`gettext` message catalog API and a higher " +"level, class-based API that may be more appropriate for Python files. The " +"interface described below allows you to write your module and application " +"messages in one natural language, and provide a catalog of translated " +"messages for running under different natural languages." +msgstr "" +"Модуль :mod:`gettext` надає служби інтернаціоналізації (I18N) і локалізації " +"(L10N) для ваших модулів і програм Python. Він підтримує як API каталогу " +"повідомлень GNU :program:`gettext`, так і API вищого рівня на основі класів, " +"який може бути більш відповідним для файлів Python. Інтерфейс, описаний " +"нижче, дозволяє вам писати повідомлення модуля та додатка однією природною " +"мовою та надавати каталог перекладених повідомлень для роботи на різних " +"природних мовах." + +msgid "" +"Some hints on localizing your Python modules and applications are also given." +msgstr "" +"Також подано деякі підказки щодо локалізації ваших модулів і програм Python." + +msgid "GNU :program:`gettext` API" +msgstr "GNU :program:`gettext` API" + +msgid "" +"The :mod:`gettext` module defines the following API, which is very similar " +"to the GNU :program:`gettext` API. If you use this API you will affect the " +"translation of your entire application globally. Often this is what you " +"want if your application is monolingual, with the choice of language " +"dependent on the locale of your user. If you are localizing a Python " +"module, or if your application needs to switch languages on the fly, you " +"probably want to use the class-based API instead." +msgstr "" +"Модуль :mod:`gettext` визначає наступний API, який дуже схожий на GNU :" +"program:`gettext` API. Якщо ви використовуєте цей API, ви вплинете на " +"глобальний переклад усієї вашої програми. Часто це те, що вам потрібно, якщо " +"ваша програма є одномовною, а вибір мови залежить від локалі вашого " +"користувача. Якщо ви локалізуєте модуль Python або якщо вашій програмі " +"потрібно миттєво перемикати мови, ви, ймовірно, захочете замість цього " +"використовувати API на основі класів." + +msgid "" +"Bind the *domain* to the locale directory *localedir*. More concretely, :" +"mod:`gettext` will look for binary :file:`.mo` files for the given domain " +"using the path (on Unix): :file:`{localedir}/{language}/LC_MESSAGES/{domain}." +"mo`, where *language* is searched for in the environment variables :envvar:" +"`LANGUAGE`, :envvar:`LC_ALL`, :envvar:`LC_MESSAGES`, and :envvar:`LANG` " +"respectively." +msgstr "" +"Прив’яжіть *домен* до каталогу локалі *localedir*. Точніше, :mod:`gettext` " +"шукатиме двійкові файли :file:`.mo` для вказаного домену за шляхом (в " +"Unix): :file:`{localedir}/{language}/LC_MESSAGES/{domain} .mo`, де *мова* " +"шукається в змінних середовища :envvar:`LANGUAGE`, :envvar:`LC_ALL`, :envvar:" +"`LC_MESSAGES` та :envvar:`LANG` відповідно." + +msgid "" +"If *localedir* is omitted or ``None``, then the current binding for *domain* " +"is returned. [#]_" +msgstr "" +"Якщо *localedir* пропущено або ``None``, повертається поточне прив’язування " +"для *domain*. [#]_" + +msgid "" +"Change or query the current global domain. If *domain* is ``None``, then " +"the current global domain is returned, otherwise the global domain is set to " +"*domain*, which is returned." +msgstr "" +"Змініть або запитайте поточний глобальний домен. Якщо *domain* має значення " +"``None``, тоді повертається поточний глобальний домен, інакше глобальний " +"домен встановлюється на *domain*, який повертається." + +msgid "" +"Return the localized translation of *message*, based on the current global " +"domain, language, and locale directory. This function is usually aliased " +"as :func:`!_` in the local namespace (see examples below)." +msgstr "" + +msgid "" +"Like :func:`.gettext`, but look the message up in the specified *domain*." +msgstr "Як :func:`.gettext`, але шукайте повідомлення у вказаному *доміні*." + +msgid "" +"Like :func:`.gettext`, but consider plural forms. If a translation is found, " +"apply the plural formula to *n*, and return the resulting message (some " +"languages have more than two plural forms). If no translation is found, " +"return *singular* if *n* is 1; return *plural* otherwise." +msgstr "" +"Як :func:`.gettext`, але враховуйте форми множини. Якщо переклад знайдено, " +"застосуйте формулу множини до *n* та поверніть отримане повідомлення (деякі " +"мови мають більше двох форм множини). Якщо переклад не знайдено, поверніть " +"*singular*, якщо *n* дорівнює 1; повернути *множину* інакше." + +msgid "" +"The Plural formula is taken from the catalog header. It is a C or Python " +"expression that has a free variable *n*; the expression evaluates to the " +"index of the plural in the catalog. See `the GNU gettext documentation " +"`__ for the " +"precise syntax to be used in :file:`.po` files and the formulas for a " +"variety of languages." +msgstr "" +"Формула множини взята із заголовка каталогу. Це вираз C або Python, який має " +"вільну змінну *n*; вираз обчислюється відповідно до індексу множини в " +"каталозі. Перегляньте `документацію GNU gettext `__ для точного синтаксису, який буде " +"використовуватися у файлах :file:`.po` та формул для різних мов." + +msgid "" +"Like :func:`ngettext`, but look the message up in the specified *domain*." +msgstr "Як :func:`ngettext`, але шукайте повідомлення у вказаному *доміні*." + +msgid "" +"Similar to the corresponding functions without the ``p`` in the prefix (that " +"is, :func:`gettext`, :func:`dgettext`, :func:`ngettext`, :func:`dngettext`), " +"but the translation is restricted to the given message *context*." +msgstr "" +"Подібно до відповідних функцій без ``p`` у префіксі (тобто :func:`gettext`, :" +"func:`dgettext`, :func:`ngettext`, :func:`dngettext`), але переклад обмежено " +"даним *контекстом* повідомлення." + +msgid "" +"Note that GNU :program:`gettext` also defines a :func:`!dcgettext` method, " +"but this was deemed not useful and so it is currently unimplemented." +msgstr "" + +msgid "Here's an example of typical usage for this API::" +msgstr "Ось приклад типового використання цього API:" + +msgid "" +"import gettext\n" +"gettext.bindtextdomain('myapplication', '/path/to/my/language/directory')\n" +"gettext.textdomain('myapplication')\n" +"_ = gettext.gettext\n" +"# ...\n" +"print(_('This is a translatable string.'))" +msgstr "" + +msgid "Class-based API" +msgstr "API на основі класів" + +msgid "" +"The class-based API of the :mod:`gettext` module gives you more flexibility " +"and greater convenience than the GNU :program:`gettext` API. It is the " +"recommended way of localizing your Python applications and modules. :mod:`!" +"gettext` defines a :class:`GNUTranslations` class which implements the " +"parsing of GNU :file:`.mo` format files, and has methods for returning " +"strings. Instances of this class can also install themselves in the built-in " +"namespace as the function :func:`!_`." +msgstr "" + +msgid "" +"This function implements the standard :file:`.mo` file search algorithm. It " +"takes a *domain*, identical to what :func:`textdomain` takes. Optional " +"*localedir* is as in :func:`bindtextdomain`. Optional *languages* is a list " +"of strings, where each string is a language code." +msgstr "" +"Ця функція реалізує стандартний алгоритм пошуку файлів :file:`.mo`. Для " +"цього потрібно *домен*, ідентичний тому, що приймає :func:`textdomain`. " +"Необов’язковий *localedir* такий, як у :func:`bindtextdomain`. Необов’язкові " +"*мови* – це список рядків, де кожен рядок є кодом мови." + +msgid "" +"If *localedir* is not given, then the default system locale directory is " +"used. [#]_ If *languages* is not given, then the following environment " +"variables are searched: :envvar:`LANGUAGE`, :envvar:`LC_ALL`, :envvar:" +"`LC_MESSAGES`, and :envvar:`LANG`. The first one returning a non-empty " +"value is used for the *languages* variable. The environment variables should " +"contain a colon separated list of languages, which will be split on the " +"colon to produce the expected list of language code strings." +msgstr "" +"Якщо *localedir* не вказано, використовується каталог локалі системи за " +"замовчуванням. [#]_ Якщо *мови* не вказано, шукаються такі змінні " +"середовища: :envvar:`LANGUAGE`, :envvar:`LC_ALL`, :envvar:`LC_MESSAGES` і :" +"envvar:`LANG`. Перше, що повертає непорожнє значення, використовується для " +"змінної *languages*. Змінні середовища мають містити розділений двокрапкою " +"список мов, який буде розділено на двокрапку для створення очікуваного " +"списку рядків коду мови." + +msgid "" +":func:`find` then expands and normalizes the languages, and then iterates " +"through them, searching for an existing file built of these components:" +msgstr "" +":func:`find` потім розширює та нормалізує мови, а потім перебирає їх, " +"шукаючи існуючий файл, створений із цих компонентів:" + +msgid ":file:`{localedir}/{language}/LC_MESSAGES/{domain}.mo`" +msgstr ":file:`{localedir}/{language}/LC_MESSAGES/{domain}.mo`" + +msgid "" +"The first such file name that exists is returned by :func:`find`. If no such " +"file is found, then ``None`` is returned. If *all* is given, it returns a " +"list of all file names, in the order in which they appear in the languages " +"list or the environment variables." +msgstr "" +"Перше таке ім’я файлу, яке існує, повертається :func:`find`. Якщо такий файл " +"не знайдено, повертається ``None``. Якщо задано *all*, повертається список " +"усіх імен файлів у порядку, у якому вони з’являються у списку мов або " +"змінних середовища." + +msgid "" +"Return a ``*Translations`` instance based on the *domain*, *localedir*, and " +"*languages*, which are first passed to :func:`find` to get a list of the " +"associated :file:`.mo` file paths. Instances with identical :file:`.mo` " +"file names are cached. The actual class instantiated is *class_* if " +"provided, otherwise :class:`GNUTranslations`. The class's constructor must " +"take a single :term:`file object` argument." +msgstr "" + +msgid "" +"If multiple files are found, later files are used as fallbacks for earlier " +"ones. To allow setting the fallback, :func:`copy.copy` is used to clone each " +"translation object from the cache; the actual instance data is still shared " +"with the cache." +msgstr "" +"Якщо знайдено декілька файлів, пізніші файли використовуються як запасні для " +"попередніх. Щоб дозволити встановлення запасного варіанта, :func:`copy.copy` " +"використовується для клонування кожного об’єкта перекладу з кешу; фактичні " +"дані екземпляра все ще використовуються в кеші." + +msgid "" +"If no :file:`.mo` file is found, this function raises :exc:`OSError` if " +"*fallback* is false (which is the default), and returns a :class:" +"`NullTranslations` instance if *fallback* is true." +msgstr "" +"Якщо файл :file:`.mo` не знайдено, ця функція викликає :exc:`OSError`, якщо " +"*fallback* має значення false (що є типовим), і повертає екземпляр :class:" +"`NullTranslations`, якщо *fallback* є правда." + +msgid ":exc:`IOError` used to be raised, it is now an alias of :exc:`OSError`." +msgstr ":exc:`IOError` раніше викликався, тепер це псевдонім :exc:`OSError`." + +msgid "*codeset* parameter is removed." +msgstr "" + +msgid "" +"This installs the function :func:`!_` in Python's builtins namespace, based " +"on *domain* and *localedir* which are passed to the function :func:" +"`translation`." +msgstr "" + +msgid "" +"For the *names* parameter, please see the description of the translation " +"object's :meth:`~NullTranslations.install` method." +msgstr "" +"Для параметра *names* див. опис методу :meth:`~NullTranslations.install` " +"об’єкта перекладу." + +msgid "" +"As seen below, you usually mark the strings in your application that are " +"candidates for translation, by wrapping them in a call to the :func:`!_` " +"function, like this::" +msgstr "" + +msgid "print(_('This string will be translated.'))" +msgstr "" + +msgid "" +"For convenience, you want the :func:`!_` function to be installed in " +"Python's builtins namespace, so it is easily accessible in all modules of " +"your application." +msgstr "" + +msgid "*names* is now a keyword-only parameter." +msgstr "" + +msgid "The :class:`NullTranslations` class" +msgstr "Клас :class:`NullTranslations`" + +msgid "" +"Translation classes are what actually implement the translation of original " +"source file message strings to translated message strings. The base class " +"used by all translation classes is :class:`NullTranslations`; this provides " +"the basic interface you can use to write your own specialized translation " +"classes. Here are the methods of :class:`!NullTranslations`:" +msgstr "" +"Класи перекладу — це те, що фактично реалізує переклад рядків повідомлень " +"вихідного файлу в перекладені рядки повідомлень. Базовим класом, який " +"використовується всіма класами перекладу, є :class:`NullTranslations`; це " +"забезпечує базовий інтерфейс, який можна використовувати для написання " +"власних спеціалізованих класів перекладу. Ось методи :class:`!" +"NullTranslations`:" + +msgid "" +"Takes an optional :term:`file object` *fp*, which is ignored by the base " +"class. Initializes \"protected\" instance variables *_info* and *_charset* " +"which are set by derived classes, as well as *_fallback*, which is set " +"through :meth:`add_fallback`. It then calls ``self._parse(fp)`` if *fp* is " +"not ``None``." +msgstr "" +"Приймає необов’язковий :term:`file object` *fp*, який ігнорується базовим " +"класом. Ініціалізує \"захищені\" змінні екземпляра *_info* та *_charset*, " +"які встановлюються похідними класами, а також *_fallback*, який " +"встановлюється через :meth:`add_fallback`. Потім він викликає ``self." +"_parse(fp)``, якщо *fp* не є ``None``." + +msgid "" +"No-op in the base class, this method takes file object *fp*, and reads the " +"data from the file, initializing its message catalog. If you have an " +"unsupported message catalog file format, you should override this method to " +"parse your format." +msgstr "" +"No-op у базовому класі, цей метод бере файловий об’єкт *fp* і читає дані з " +"файлу, ініціалізуючи його каталог повідомлень. Якщо у вас є непідтримуваний " +"формат файлу каталогу повідомлень, вам слід замінити цей метод для аналізу " +"вашого формату." + +msgid "" +"Add *fallback* as the fallback object for the current translation object. A " +"translation object should consult the fallback if it cannot provide a " +"translation for a given message." +msgstr "" +"Додайте *резервний* як резервний об’єкт для поточного об’єкта перекладу. " +"Об’єкт перекладу має звернутися до резервного варіанту, якщо він не може " +"надати переклад для даного повідомлення." + +msgid "" +"If a fallback has been set, forward :meth:`!gettext` to the fallback. " +"Otherwise, return *message*. Overridden in derived classes." +msgstr "" +"Якщо встановлено запасний варіант, перешліть :meth:`!gettext` на резервний " +"варіант. В іншому випадку поверніть *повідомлення*. Перевизначено в похідних " +"класах." + +msgid "" +"If a fallback has been set, forward :meth:`!ngettext` to the fallback. " +"Otherwise, return *singular* if *n* is 1; return *plural* otherwise. " +"Overridden in derived classes." +msgstr "" +"Якщо встановлено запасний варіант, перешліть :meth:`!ngettext` до резервного " +"варіанту. В іншому випадку поверніть *singular*, якщо *n* дорівнює 1; " +"повернути *множину* інакше. Перевизначено в похідних класах." + +msgid "" +"If a fallback has been set, forward :meth:`pgettext` to the fallback. " +"Otherwise, return the translated message. Overridden in derived classes." +msgstr "" +"Якщо встановлено запасний варіант, перешліть :meth:`pgettext` на резервний " +"варіант. В іншому випадку поверніть перекладене повідомлення. Перевизначено " +"в похідних класах." + +msgid "" +"If a fallback has been set, forward :meth:`npgettext` to the fallback. " +"Otherwise, return the translated message. Overridden in derived classes." +msgstr "" +"Якщо встановлено запасний варіант, перешліть :meth:`npgettext` резервному " +"варіанту. В іншому випадку поверніть перекладене повідомлення. Перевизначено " +"в похідних класах." + +msgid "" +"Return a dictionary containing the metadata found in the message catalog " +"file." +msgstr "" + +msgid "Return the encoding of the message catalog file." +msgstr "Повернути кодування файлу каталогу повідомлень." + +msgid "" +"This method installs :meth:`.gettext` into the built-in namespace, binding " +"it to ``_``." +msgstr "" +"Цей метод встановлює :meth:`.gettext` у вбудований простір імен, прив’язуючи " +"його до ``_``." + +msgid "" +"If the *names* parameter is given, it must be a sequence containing the " +"names of functions you want to install in the builtins namespace in addition " +"to :func:`!_`. Supported names are ``'gettext'``, ``'ngettext'``, " +"``'pgettext'``, and ``'npgettext'``." +msgstr "" + +msgid "" +"Note that this is only one way, albeit the most convenient way, to make the :" +"func:`!_` function available to your application. Because it affects the " +"entire application globally, and specifically the built-in namespace, " +"localized modules should never install :func:`!_`. Instead, they should use " +"this code to make :func:`!_` available to their module::" +msgstr "" + +msgid "" +"import gettext\n" +"t = gettext.translation('mymodule', ...)\n" +"_ = t.gettext" +msgstr "" + +msgid "" +"This puts :func:`!_` only in the module's global namespace and so only " +"affects calls within this module." +msgstr "" + +msgid "Added ``'pgettext'`` and ``'npgettext'``." +msgstr "Додано ``'pgettext'`` і ``'npgettext'``." + +msgid "The :class:`GNUTranslations` class" +msgstr "Клас :class:`GNUTranslations`" + +msgid "" +"The :mod:`!gettext` module provides one additional class derived from :class:" +"`NullTranslations`: :class:`GNUTranslations`. This class overrides :meth:`!" +"_parse` to enable reading GNU :program:`gettext` format :file:`.mo` files in " +"both big-endian and little-endian format." +msgstr "" + +msgid "" +":class:`GNUTranslations` parses optional metadata out of the translation " +"catalog. It is convention with GNU :program:`gettext` to include metadata as " +"the translation for the empty string. This metadata is in :rfc:`822`\\ -" +"style ``key: value`` pairs, and should contain the ``Project-Id-Version`` " +"key. If the key ``Content-Type`` is found, then the ``charset`` property is " +"used to initialize the \"protected\" :attr:`!_charset` instance variable, " +"defaulting to ``None`` if not found. If the charset encoding is specified, " +"then all message ids and message strings read from the catalog are converted " +"to Unicode using this encoding, else ASCII is assumed." +msgstr "" + +msgid "" +"Since message ids are read as Unicode strings too, all ``*gettext()`` " +"methods will assume message ids as Unicode strings, not byte strings." +msgstr "" + +msgid "" +"The entire set of key/value pairs are placed into a dictionary and set as " +"the \"protected\" :attr:`!_info` instance variable." +msgstr "" + +msgid "" +"If the :file:`.mo` file's magic number is invalid, the major version number " +"is unexpected, or if other problems occur while reading the file, " +"instantiating a :class:`GNUTranslations` class can raise :exc:`OSError`." +msgstr "" +"Якщо магічне число файлу :file:`.mo` недійсне, основний номер версії " +"неочікуваний або якщо під час читання файлу виникають інші проблеми, " +"створення екземпляра класу :class:`GNUTranslations` може викликати :exc:" +"`OSError`." + +msgid "" +"The following methods are overridden from the base class implementation:" +msgstr "Наступні методи перевизначені з реалізації базового класу:" + +msgid "" +"Look up the *message* id in the catalog and return the corresponding message " +"string, as a Unicode string. If there is no entry in the catalog for the " +"*message* id, and a fallback has been set, the look up is forwarded to the " +"fallback's :meth:`~NullTranslations.gettext` method. Otherwise, the " +"*message* id is returned." +msgstr "" +"Знайдіть ідентифікатор *повідомлення* в каталозі та поверніть відповідний " +"рядок повідомлення як рядок Unicode. Якщо в каталозі немає запису для " +"ідентифікатора *message* і встановлено резервний варіант, пошук " +"пересилається до резервного методу :meth:`~NullTranslations.gettext`. В " +"іншому випадку повертається ідентифікатор *повідомлення*." + +msgid "" +"Do a plural-forms lookup of a message id. *singular* is used as the message " +"id for purposes of lookup in the catalog, while *n* is used to determine " +"which plural form to use. The returned message string is a Unicode string." +msgstr "" +"Виконайте пошук у формі множини ідентифікатора повідомлення. *singular* " +"використовується як ідентифікатор повідомлення для цілей пошуку в каталозі, " +"тоді як *n* використовується, щоб визначити, яку форму множини " +"використовувати. Повернений рядок повідомлення є рядком Unicode." + +msgid "" +"If the message id is not found in the catalog, and a fallback is specified, " +"the request is forwarded to the fallback's :meth:`~NullTranslations." +"ngettext` method. Otherwise, when *n* is 1 *singular* is returned, and " +"*plural* is returned in all other cases." +msgstr "" +"Якщо ідентифікатор повідомлення не знайдено в каталозі та вказано запасний " +"варіант, запит пересилається до резервного методу :meth:`~NullTranslations." +"ngettext`. В іншому випадку, коли *n* дорівнює 1, повертається *однина*, а " +"*множина* повертається в усіх інших випадках." + +msgid "Here is an example::" +msgstr "Ось приклад::" + +msgid "" +"n = len(os.listdir('.'))\n" +"cat = GNUTranslations(somefile)\n" +"message = cat.ngettext(\n" +" 'There is %(num)d file in this directory',\n" +" 'There are %(num)d files in this directory',\n" +" n) % {'num': n}" +msgstr "" + +msgid "" +"Look up the *context* and *message* id in the catalog and return the " +"corresponding message string, as a Unicode string. If there is no entry in " +"the catalog for the *message* id and *context*, and a fallback has been set, " +"the look up is forwarded to the fallback's :meth:`pgettext` method. " +"Otherwise, the *message* id is returned." +msgstr "" +"Знайдіть *контекст* і ідентифікатор *повідомлення* в каталозі та поверніть " +"відповідний рядок повідомлення як рядок Unicode. Якщо в каталозі немає " +"запису для ідентифікатора *повідомлення* та *контексту*, і було встановлено " +"резервний варіант, пошук пересилається до резервного методу :meth:" +"`pgettext`. В іншому випадку повертається ідентифікатор *повідомлення*." + +msgid "" +"Do a plural-forms lookup of a message id. *singular* is used as the message " +"id for purposes of lookup in the catalog, while *n* is used to determine " +"which plural form to use." +msgstr "" +"Виконайте пошук у формі множини ідентифікатора повідомлення. *singular* " +"використовується як ідентифікатор повідомлення для цілей пошуку в каталозі, " +"тоді як *n* використовується, щоб визначити, яку форму множини " +"використовувати." + +msgid "" +"If the message id for *context* is not found in the catalog, and a fallback " +"is specified, the request is forwarded to the fallback's :meth:`npgettext` " +"method. Otherwise, when *n* is 1 *singular* is returned, and *plural* is " +"returned in all other cases." +msgstr "" +"Якщо ідентифікатор повідомлення для *контексту* не знайдено в каталозі, і " +"вказано резервний варіант, запит пересилається на резервний метод :meth:" +"`npgettext`. В іншому випадку, коли *n* дорівнює 1, повертається *однина*, а " +"*множина* повертається в усіх інших випадках." + +msgid "Solaris message catalog support" +msgstr "Підтримка каталогу повідомлень Solaris" + +msgid "" +"The Solaris operating system defines its own binary :file:`.mo` file format, " +"but since no documentation can be found on this format, it is not supported " +"at this time." +msgstr "" +"Операційна система Solaris визначає власний двійковий формат файлу :file:`." +"mo`, але оскільки документацію щодо цього формату немає, він наразі не " +"підтримується." + +msgid "The Catalog constructor" +msgstr "Конструктор каталогу" + +msgid "" +"GNOME uses a version of the :mod:`gettext` module by James Henstridge, but " +"this version has a slightly different API. Its documented usage was::" +msgstr "" +"GNOME використовує версію модуля :mod:`gettext` від Джеймса Хенстріджа, але " +"ця версія має дещо інший API. Його задокументоване використання:" + +msgid "" +"import gettext\n" +"cat = gettext.Catalog(domain, localedir)\n" +"_ = cat.gettext\n" +"print(_('hello world'))" +msgstr "" + +msgid "" +"For compatibility with this older module, the function :func:`!Catalog` is " +"an alias for the :func:`translation` function described above." +msgstr "" + +msgid "" +"One difference between this module and Henstridge's: his catalog objects " +"supported access through a mapping API, but this appears to be unused and so " +"is not currently supported." +msgstr "" +"Одна відмінність між цим модулем і модулем Хенстріджа: його об’єкти каталогу " +"підтримували доступ через API відображення, але він, здається, не " +"використовується, тому наразі не підтримується." + +msgid "Internationalizing your programs and modules" +msgstr "Інтернаціоналізація ваших програм і модулів" + +msgid "" +"Internationalization (I18N) refers to the operation by which a program is " +"made aware of multiple languages. Localization (L10N) refers to the " +"adaptation of your program, once internationalized, to the local language " +"and cultural habits. In order to provide multilingual messages for your " +"Python programs, you need to take the following steps:" +msgstr "" +"Інтернаціоналізація (I18N) відноситься до операції, за допомогою якої " +"програма дізнається про декілька мов. Локалізація (L10N) означає адаптацію " +"вашої програми після її інтернаціоналізації до місцевої мови та культурних " +"звичок. Щоб надати багатомовні повідомлення для своїх програм на Python, " +"потрібно виконати наступні кроки:" + +msgid "" +"prepare your program or module by specially marking translatable strings" +msgstr "" +"підготуйте свою програму або модуль, спеціально позначивши рядки для " +"перекладу" + +msgid "" +"run a suite of tools over your marked files to generate raw messages catalogs" +msgstr "" +"запустіть набір інструментів над позначеними файлами, щоб створити каталоги " +"необроблених повідомлень" + +msgid "create language-specific translations of the message catalogs" +msgstr "створювати переклади каталогів повідомлень на певну мову" + +msgid "" +"use the :mod:`gettext` module so that message strings are properly translated" +msgstr "" +"використовуйте модуль :mod:`gettext`, щоб рядки повідомлень були правильно " +"перекладені" + +msgid "" +"In order to prepare your code for I18N, you need to look at all the strings " +"in your files. Any string that needs to be translated should be marked by " +"wrapping it in ``_('...')`` --- that is, a call to the function :func:`_ " +"`. For example::" +msgstr "" + +msgid "" +"filename = 'mylog.txt'\n" +"message = _('writing a log message')\n" +"with open(filename, 'w') as fp:\n" +" fp.write(message)" +msgstr "" + +msgid "" +"In this example, the string ``'writing a log message'`` is marked as a " +"candidate for translation, while the strings ``'mylog.txt'`` and ``'w'`` are " +"not." +msgstr "" +"У цьому прикладі рядок \"writing a log message\" позначено як кандидат на " +"переклад, тоді як рядки \"mylog.txt\" і \"w\" — ні." + +msgid "" +"There are a few tools to extract the strings meant for translation. The " +"original GNU :program:`gettext` only supported C or C++ source code but its " +"extended version :program:`xgettext` scans code written in a number of " +"languages, including Python, to find strings marked as translatable. `Babel " +"`__ is a Python internationalization library that " +"includes a :file:`pybabel` script to extract and compile message catalogs. " +"François Pinard's program called :program:`xpot` does a similar job and is " +"available as part of his `po-utils package `__." +msgstr "" + +msgid "" +"(Python also includes pure-Python versions of these programs, called :" +"program:`pygettext.py` and :program:`msgfmt.py`; some Python distributions " +"will install them for you. :program:`pygettext.py` is similar to :program:" +"`xgettext`, but only understands Python source code and cannot handle other " +"programming languages such as C or C++. :program:`pygettext.py` supports a " +"command-line interface similar to :program:`xgettext`; for details on its " +"use, run ``pygettext.py --help``. :program:`msgfmt.py` is binary compatible " +"with GNU :program:`msgfmt`. With these two programs, you may not need the " +"GNU :program:`gettext` package to internationalize your Python applications.)" +msgstr "" +"(Python також включає версії цих програм на чистому Python, які називаються :" +"program:`pygettext.py` і :program:`msgfmt.py`; деякі дистрибутиви Python " +"встановлять їх для вас. :program:`pygettext.py` схоже до :program:" +"`xgettext`, але розуміє лише вихідний код Python і не може працювати з " +"іншими мовами програмування, такими як C або C++. :program:`pygettext.py` " +"підтримує інтерфейс командного рядка, подібний до :program:`xgettext`; для " +"детальніше про його використання, запустіть ``pygettext.py --help``. :" +"program:`msgfmt.py` бінарно сумісний із GNU :program:`msgfmt`. З цими двома " +"програмами вам може не знадобитися GNU :program:`gettext` пакет для " +"інтернаціоналізації ваших програм Python.)" + +msgid "" +":program:`xgettext`, :program:`pygettext`, and similar tools generate :file:" +"`.po` files that are message catalogs. They are structured human-readable " +"files that contain every marked string in the source code, along with a " +"placeholder for the translated versions of these strings." +msgstr "" +":program:`xgettext`, :program:`pygettext` та подібні інструменти створюють " +"файли :file:`.po`, які є каталогами повідомлень. Це структуровані зрозумілі " +"для людини файли, які містять кожен позначений рядок у вихідному коді разом " +"із заповнювачем для перекладених версій цих рядків." + +msgid "" +"Copies of these :file:`.po` files are then handed over to the individual " +"human translators who write translations for every supported natural " +"language. They send back the completed language-specific versions as a :" +"file:`.po` file that's compiled into a machine-readable :file:" +"`.mo` binary catalog file using the :program:`msgfmt` program. The :file:`." +"mo` files are used by the :mod:`gettext` module for the actual translation " +"processing at run-time." +msgstr "" +"Потім копії цих файлів :file:`.po` передаються окремим перекладачам, які " +"пишуть переклади для кожної підтримуваної природної мови. Вони надсилають " +"назад завершені версії для певної мови у вигляді файлу :file:` .po`, який скомпільовано в машиночитаний файл бінарного каталогу :file:" +"`.mo` за допомогою програми :program:`msgfmt`. Файли :file:`.mo` " +"використовуються модулем :mod:`gettext` для фактичної обробки перекладу під " +"час виконання." + +msgid "" +"How you use the :mod:`gettext` module in your code depends on whether you " +"are internationalizing a single module or your entire application. The next " +"two sections will discuss each case." +msgstr "" +"Те, як ви використовуєте модуль :mod:`gettext` у своєму коді, залежить від " +"того, чи інтернаціоналізуєте ви один модуль чи всю програму. У наступних " +"двох розділах буде розглянуто кожен випадок." + +msgid "Localizing your module" +msgstr "Локалізація вашого модуля" + +msgid "" +"If you are localizing your module, you must take care not to make global " +"changes, e.g. to the built-in namespace. You should not use the GNU :program:" +"`gettext` API but instead the class-based API." +msgstr "" +"Якщо ви локалізуєте свій модуль, ви повинні подбати про те, щоб не вносити " +"глобальних змін, напр. до вбудованого простору імен. Вам слід " +"використовувати не GNU :program:`gettext` API, а замість нього API на основі " +"класів." + +msgid "" +"Let's say your module is called \"spam\" and the module's various natural " +"language translation :file:`.mo` files reside in :file:`/usr/share/locale` " +"in GNU :program:`gettext` format. Here's what you would put at the top of " +"your module::" +msgstr "" +"Припустімо, що ваш модуль називається \"спамом\", і різні файли перекладу " +"природної мови модуля :file:`.mo` містяться в :file:`/usr/share/locale` у " +"форматі GNU :program:`gettext`. Ось що ви б розмістили у верхній частині " +"свого модуля:" + +msgid "" +"import gettext\n" +"t = gettext.translation('spam', '/usr/share/locale')\n" +"_ = t.gettext" +msgstr "" + +msgid "Localizing your application" +msgstr "Локалізація вашої програми" + +msgid "" +"If you are localizing your application, you can install the :func:`!_` " +"function globally into the built-in namespace, usually in the main driver " +"file of your application. This will let all your application-specific files " +"just use ``_('...')`` without having to explicitly install it in each file." +msgstr "" + +msgid "" +"In the simple case then, you need only add the following bit of code to the " +"main driver file of your application::" +msgstr "" +"У простому випадку вам потрібно лише додати наступний біт коду до основного " +"файлу драйвера вашої програми:" + +msgid "" +"import gettext\n" +"gettext.install('myapplication')" +msgstr "" + +msgid "" +"If you need to set the locale directory, you can pass it into the :func:" +"`install` function::" +msgstr "" +"Якщо вам потрібно встановити каталог локалі, ви можете передати його у " +"функцію :func:`install`::" + +msgid "" +"import gettext\n" +"gettext.install('myapplication', '/usr/share/locale')" +msgstr "" + +msgid "Changing languages on the fly" +msgstr "Зміна мов на льоту" + +msgid "" +"If your program needs to support many languages at the same time, you may " +"want to create multiple translation instances and then switch between them " +"explicitly, like so::" +msgstr "" +"Якщо ваша програма повинна підтримувати багато мов одночасно, ви можете " +"створити кілька екземплярів перекладу, а потім явно перемикатися між ними, " +"наприклад:" + +msgid "" +"import gettext\n" +"\n" +"lang1 = gettext.translation('myapplication', languages=['en'])\n" +"lang2 = gettext.translation('myapplication', languages=['fr'])\n" +"lang3 = gettext.translation('myapplication', languages=['de'])\n" +"\n" +"# start by using language1\n" +"lang1.install()\n" +"\n" +"# ... time goes by, user selects language 2\n" +"lang2.install()\n" +"\n" +"# ... more time goes by, user selects language 3\n" +"lang3.install()" +msgstr "" + +msgid "Deferred translations" +msgstr "Відкладені переклади" + +msgid "" +"In most coding situations, strings are translated where they are coded. " +"Occasionally however, you need to mark strings for translation, but defer " +"actual translation until later. A classic example is::" +msgstr "" +"У більшості ситуацій кодування рядки перекладаються там, де вони закодовані. " +"Однак інколи вам потрібно позначити рядки для перекладу, але відкласти " +"фактичний переклад на потім. Класичний приклад::" + +msgid "" +"animals = ['mollusk',\n" +" 'albatross',\n" +" 'rat',\n" +" 'penguin',\n" +" 'python', ]\n" +"# ...\n" +"for a in animals:\n" +" print(a)" +msgstr "" + +msgid "" +"Here, you want to mark the strings in the ``animals`` list as being " +"translatable, but you don't actually want to translate them until they are " +"printed." +msgstr "" +"Тут ви хочете позначити рядки у списку ``animals`` як такі, що можна " +"перекладати, але насправді ви не хочете їх перекладати, поки вони не будуть " +"надруковані." + +msgid "Here is one way you can handle this situation::" +msgstr "Ось один із способів вирішення цієї ситуації:" + +msgid "" +"def _(message): return message\n" +"\n" +"animals = [_('mollusk'),\n" +" _('albatross'),\n" +" _('rat'),\n" +" _('penguin'),\n" +" _('python'), ]\n" +"\n" +"del _\n" +"\n" +"# ...\n" +"for a in animals:\n" +" print(_(a))" +msgstr "" + +msgid "" +"This works because the dummy definition of :func:`!_` simply returns the " +"string unchanged. And this dummy definition will temporarily override any " +"definition of :func:`!_` in the built-in namespace (until the :keyword:`del` " +"command). Take care, though if you have a previous definition of :func:`!_` " +"in the local namespace." +msgstr "" + +msgid "" +"Note that the second use of :func:`!_` will not identify \"a\" as being " +"translatable to the :program:`gettext` program, because the parameter is not " +"a string literal." +msgstr "" + +msgid "Another way to handle this is with the following example::" +msgstr "Ще один спосіб вирішити це за допомогою наступного прикладу::" + +msgid "" +"def N_(message): return message\n" +"\n" +"animals = [N_('mollusk'),\n" +" N_('albatross'),\n" +" N_('rat'),\n" +" N_('penguin'),\n" +" N_('python'), ]\n" +"\n" +"# ...\n" +"for a in animals:\n" +" print(_(a))" +msgstr "" + +msgid "" +"In this case, you are marking translatable strings with the function :func:`!" +"N_`, which won't conflict with any definition of :func:`!_`. However, you " +"will need to teach your message extraction program to look for translatable " +"strings marked with :func:`!N_`. :program:`xgettext`, :program:`pygettext`, " +"``pybabel extract``, and :program:`xpot` all support this through the use of " +"the :option:`!-k` command-line switch. The choice of :func:`!N_` here is " +"totally arbitrary; it could have just as easily been :func:`!" +"MarkThisStringForTranslation`." +msgstr "" + +msgid "Acknowledgements" +msgstr "Подяки" + +msgid "" +"The following people contributed code, feedback, design suggestions, " +"previous implementations, and valuable experience to the creation of this " +"module:" +msgstr "" +"Наступні люди надали код, відгуки, пропозиції щодо дизайну, попередні " +"реалізації та цінний досвід для створення цього модуля:" + +msgid "Peter Funk" +msgstr "Пітер Функ" + +msgid "James Henstridge" +msgstr "Джеймс Хенстрідж" + +msgid "Juan David Ibáñez Palomar" +msgstr "Хуан Давид Ібаньес Паломар" + +msgid "Marc-André Lemburg" +msgstr "Марк-Андре Лембург" + +msgid "Martin von Löwis" +msgstr "Мартін фон Льовіс" + +msgid "François Pinard" +msgstr "Франсуа Пінар" + +msgid "Barry Warsaw" +msgstr "Баррі Варшава" + +msgid "Gustavo Niemeyer" +msgstr "Густаво Німейєр" + +msgid "Footnotes" +msgstr "Виноски" + +msgid "" +"The default locale directory is system dependent; for example, on Red Hat " +"Linux it is :file:`/usr/share/locale`, but on Solaris it is :file:`/usr/lib/" +"locale`. The :mod:`!gettext` module does not try to support these system " +"dependent defaults; instead its default is :file:`{sys.base_prefix}/share/" +"locale` (see :data:`sys.base_prefix`). For this reason, it is always best to " +"call :func:`bindtextdomain` with an explicit absolute path at the start of " +"your application." +msgstr "" + +msgid "See the footnote for :func:`bindtextdomain` above." +msgstr "Див. виноску для :func:`bindtextdomain` вище." + +msgid "_ (underscore)" +msgstr "" + +msgid "gettext" +msgstr "gettext" + +msgid "GNOME" +msgstr "" diff --git a/library/glob.po b/library/glob.po new file mode 100644 index 000000000..a8e9b16a2 --- /dev/null +++ b/library/glob.po @@ -0,0 +1,282 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 01:06+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!glob` --- Unix style pathname pattern expansion" +msgstr "" + +msgid "**Source code:** :source:`Lib/glob.py`" +msgstr "**Вихідний код:** :source:`Lib/glob.py`" + +msgid "" +"The :mod:`glob` module finds all the pathnames matching a specified pattern " +"according to the rules used by the Unix shell, although results are returned " +"in arbitrary order. No tilde expansion is done, but ``*``, ``?``, and " +"character ranges expressed with ``[]`` will be correctly matched. This is " +"done by using the :func:`os.scandir` and :func:`fnmatch.fnmatch` functions " +"in concert, and not by actually invoking a subshell." +msgstr "" +"Модуль :mod:`glob` знаходить усі імена шляхів, що відповідають заданому " +"шаблону, згідно з правилами, що використовуються оболонкою Unix, хоча " +"результати повертаються в довільному порядку. Розгортання тильди не " +"виконується, але ``*``, ``?`` і діапазони символів, виражені ``[]``, будуть " +"правильно зіставлені. Це робиться за допомогою спільного використання " +"функцій :func:`os.scandir` і :func:`fnmatch.fnmatch`, а не шляхом фактичного " +"виклику підоболонки." + +msgid "" +"Note that files beginning with a dot (``.``) can only be matched by patterns " +"that also start with a dot, unlike :func:`fnmatch.fnmatch` or :func:`pathlib." +"Path.glob`. (For tilde and shell variable expansion, use :func:`os.path." +"expanduser` and :func:`os.path.expandvars`.)" +msgstr "" +"Зауважте, що файли, які починаються з крапки (``.``), можуть бути зіставлені " +"лише шаблонами, які також починаються з крапки, на відміну від :func:" +"`fnmatch.fnmatch` або :func:`pathlib.Path.glob`. (Для розширення змінної " +"тильди та оболонки використовуйте :func:`os.path.expanduser` і :func:`os." +"path.expandvars`.)" + +msgid "" +"For a literal match, wrap the meta-characters in brackets. For example, " +"``'[?]'`` matches the character ``'?'``." +msgstr "" +"Для буквального збігу заберіть метасимволи в дужки. Наприклад, ``''[?]'`` " +"відповідає символу ``''?'``." + +msgid "The :mod:`glob` module defines the following functions:" +msgstr "" + +msgid "" +"Return a possibly empty list of path names that match *pathname*, which must " +"be a string containing a path specification. *pathname* can be either " +"absolute (like :file:`/usr/src/Python-1.5/Makefile`) or relative (like :file:" +"`../../Tools/\\*/\\*.gif`), and can contain shell-style wildcards. Broken " +"symlinks are included in the results (as in the shell). Whether or not the " +"results are sorted depends on the file system. If a file that satisfies " +"conditions is removed or added during the call of this function, whether a " +"path name for that file will be included is unspecified." +msgstr "" + +msgid "" +"If *root_dir* is not ``None``, it should be a :term:`path-like object` " +"specifying the root directory for searching. It has the same effect on :" +"func:`glob` as changing the current directory before calling it. If " +"*pathname* is relative, the result will contain paths relative to *root_dir*." +msgstr "" +"Якщо *root_dir* не ``None``, це має бути :term:`path-like object`, що вказує " +"кореневий каталог для пошуку. Це має такий самий вплив на :func:`glob`, як і " +"зміна поточного каталогу перед його викликом. Якщо *pathname* є відносним, " +"результат міститиме шляхи відносно *root_dir*." + +msgid "" +"This function can support :ref:`paths relative to directory descriptors " +"` with the *dir_fd* parameter." +msgstr "" +"Ця функція може підтримувати :ref:`шляхи відносно дескрипторів каталогу " +"` з параметром *dir_fd*." + +msgid "" +"If *recursive* is true, the pattern \"``**``\" will match any files and zero " +"or more directories, subdirectories and symbolic links to directories. If " +"the pattern is followed by an :data:`os.sep` or :data:`os.altsep` then files " +"will not match." +msgstr "" +"Якщо *recursive* має значення true, шаблон \"``**``\" відповідатиме будь-" +"яким файлам і нулю або більше каталогів, підкаталогів і символічних посилань " +"на каталоги. Якщо за шаблоном йде :data:`os.sep` або :data:`os.altsep`, " +"файли не збігатимуться." + +msgid "" +"If *include_hidden* is true, \"``**``\" pattern will match hidden " +"directories." +msgstr "" + +msgid "" +"Raises an :ref:`auditing event ` ``glob.glob`` with arguments " +"``pathname``, ``recursive``." +msgstr "" +"Викликає :ref:`подію аудиту ` ``glob.glob`` з аргументами " +"``pathname``, ``recursive``." + +msgid "" +"Raises an :ref:`auditing event ` ``glob.glob/2`` with arguments " +"``pathname``, ``recursive``, ``root_dir``, ``dir_fd``." +msgstr "" +"Викликає :ref:`подію аудиту ` ``glob.glob/2`` з аргументами " +"``pathname``, ``recursive``, ``root_dir``, ``dir_fd``." + +msgid "" +"Using the \"``**``\" pattern in large directory trees may consume an " +"inordinate amount of time." +msgstr "" +"Використання шаблону \"``**``\" у великих деревах каталогів може зайняти " +"надто багато часу." + +msgid "" +"This function may return duplicate path names if *pathname* contains " +"multiple \"``**``\" patterns and *recursive* is true." +msgstr "" + +msgid "Support for recursive globs using \"``**``\"." +msgstr "Підтримка рекурсивних глобусів з використанням \"``**``\"." + +msgid "Added the *root_dir* and *dir_fd* parameters." +msgstr "Додано параметри *root_dir* і *dir_fd*." + +msgid "Added the *include_hidden* parameter." +msgstr "" + +msgid "" +"Return an :term:`iterator` which yields the same values as :func:`glob` " +"without actually storing them all simultaneously." +msgstr "" +"Повертає :term:`iterator`, який дає ті самі значення, що й :func:`glob`, " +"фактично не зберігаючи їх усі одночасно." + +msgid "" +"Escape all special characters (``'?'``, ``'*'`` and ``'['``). This is useful " +"if you want to match an arbitrary literal string that may have special " +"characters in it. Special characters in drive/UNC sharepoints are not " +"escaped, e.g. on Windows ``escape('//?/c:/Quo vadis?.txt')`` returns ``'//?/" +"c:/Quo vadis[?].txt'``." +msgstr "" +"Екранування всіх спеціальних символів (``'?'``, ``'*'`` і ``'['``). Це " +"корисно, якщо ви хочете зіставити довільний літеральний рядок, який може " +"містити спеціальні символи. Спеціальні символи в точках доступу/UNC не " +"екрануються, напр. у Windows ``escape('//?/c:/Quo vadis?.txt')`` повертає " +"``'//?/c:/Quo vadis[?].txt''``." + +msgid "" +"Convert the given path specification to a regular expression for use with :" +"func:`re.match`. The path specification can contain shell-style wildcards." +msgstr "" + +msgid "For example:" +msgstr "Наприклад:" + +msgid "" +"Path separators and segments are meaningful to this function, unlike :func:" +"`fnmatch.translate`. By default wildcards do not match path separators, and " +"``*`` pattern segments match precisely one path segment." +msgstr "" + +msgid "" +"If *recursive* is true, the pattern segment \"``**``\" will match any number " +"of path segments." +msgstr "" + +msgid "" +"If *include_hidden* is true, wildcards can match path segments that start " +"with a dot (``.``)." +msgstr "" + +msgid "" +"A sequence of path separators may be supplied to the *seps* argument. If not " +"given, :data:`os.sep` and :data:`~os.altsep` (if available) are used." +msgstr "" + +msgid "" +":meth:`pathlib.PurePath.full_match` and :meth:`pathlib.Path.glob` methods, " +"which call this function to implement pattern matching and globbing." +msgstr "" + +msgid "Examples" +msgstr "Приклади" + +msgid "" +"Consider a directory containing the following files: :file:`1.gif`, :file:`2." +"txt`, :file:`card.gif` and a subdirectory :file:`sub` which contains only " +"the file :file:`3.txt`. :func:`glob` will produce the following results. " +"Notice how any leading components of the path are preserved. ::" +msgstr "" + +msgid "" +">>> import glob\n" +">>> glob.glob('./[0-9].*')\n" +"['./1.gif', './2.txt']\n" +">>> glob.glob('*.gif')\n" +"['1.gif', 'card.gif']\n" +">>> glob.glob('?.gif')\n" +"['1.gif']\n" +">>> glob.glob('**/*.txt', recursive=True)\n" +"['2.txt', 'sub/3.txt']\n" +">>> glob.glob('./**/', recursive=True)\n" +"['./', './sub/']" +msgstr "" + +msgid "" +"If the directory contains files starting with ``.`` they won't be matched by " +"default. For example, consider a directory containing :file:`card.gif` and :" +"file:`.card.gif`::" +msgstr "" +"Якщо каталог містить файли, які починаються з ``.``, вони не будуть " +"зіставлені за умовчанням. Наприклад, розглянемо каталог, що містить :file:" +"`card.gif` і :file:`.card.gif`::" + +msgid "" +">>> import glob\n" +">>> glob.glob('*.gif')\n" +"['card.gif']\n" +">>> glob.glob('.c*')\n" +"['.card.gif']" +msgstr "" + +msgid "" +"The :mod:`fnmatch` module offers shell-style filename (not path) expansion." +msgstr "" + +msgid "The :mod:`pathlib` module offers high-level path objects." +msgstr "Модуль :mod:`pathlib` пропонує об’єкти шляху високого рівня." + +msgid "filenames" +msgstr "назви файлів" + +msgid "pathname expansion" +msgstr "" + +msgid "* (asterisk)" +msgstr "* (зірочка)" + +msgid "in glob-style wildcards" +msgstr "символами узагальнення у стилі glob" + +msgid "? (question mark)" +msgstr "? (знак питання)" + +msgid "[] (square brackets)" +msgstr "[] (квадратні дужки)" + +msgid "! (exclamation)" +msgstr "! (знак оклику)" + +msgid "- (minus)" +msgstr "- (мінус)" + +msgid ". (dot)" +msgstr "" + +msgid "**" +msgstr "" diff --git a/library/graphlib.po b/library/graphlib.po new file mode 100644 index 000000000..93917b52b --- /dev/null +++ b/library/graphlib.po @@ -0,0 +1,344 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 01:06+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid "" +":mod:`!graphlib` --- Functionality to operate with graph-like structures" +msgstr "" + +msgid "**Source code:** :source:`Lib/graphlib.py`" +msgstr "**Вихідний код:** :source:`Lib/graphlib.py`" + +msgid "" +"Provides functionality to topologically sort a graph of :term:`hashable` " +"nodes." +msgstr "" + +msgid "" +"A topological order is a linear ordering of the vertices in a graph such " +"that for every directed edge u -> v from vertex u to vertex v, vertex u " +"comes before vertex v in the ordering. For instance, the vertices of the " +"graph may represent tasks to be performed, and the edges may represent " +"constraints that one task must be performed before another; in this example, " +"a topological ordering is just a valid sequence for the tasks. A complete " +"topological ordering is possible if and only if the graph has no directed " +"cycles, that is, if it is a directed acyclic graph." +msgstr "" +"Топологічний порядок — це лінійне впорядкування вершин графа таким чином, що " +"для кожного спрямованого ребра u -> v від вершини u до вершини v вершина u " +"стоїть перед вершиною v у порядку. Наприклад, вершини графа можуть " +"представляти завдання, які потрібно виконати, а ребра можуть представляти " +"обмеження, згідно з якими одне завдання має бути виконане раніше іншого; у " +"цьому прикладі топологічне впорядкування – це лише дійсна послідовність для " +"завдань. Повний топологічний порядок можливий тоді і тільки тоді, коли граф " +"не має орієнтованих циклів, тобто якщо він є орієнтованим ациклічним графом." + +msgid "" +"If the optional *graph* argument is provided it must be a dictionary " +"representing a directed acyclic graph where the keys are nodes and the " +"values are iterables of all predecessors of that node in the graph (the " +"nodes that have edges that point to the value in the key). Additional nodes " +"can be added to the graph using the :meth:`~TopologicalSorter.add` method." +msgstr "" +"Якщо надається необов’язковий аргумент *graph*, це має бути словник, що " +"представляє спрямований ациклічний граф, де ключі є вузлами, а значення є " +"ітерованими для всіх попередників цього вузла в графі (вузли, які мають " +"ребра, які вказують на значення в ключ). Додаткові вузли можна додати до " +"графіка за допомогою методу :meth:`~TopologicalSorter.add`." + +msgid "" +"In the general case, the steps required to perform the sorting of a given " +"graph are as follows:" +msgstr "" +"У загальному випадку кроки, необхідні для виконання сортування даного графа, " +"такі:" + +msgid "" +"Create an instance of the :class:`TopologicalSorter` with an optional " +"initial graph." +msgstr "" +"Створіть екземпляр :class:`TopologicalSorter` із необов’язковим початковим " +"графом." + +msgid "Add additional nodes to the graph." +msgstr "Додайте додаткові вузли на графік." + +msgid "Call :meth:`~TopologicalSorter.prepare` on the graph." +msgstr "Викличте :meth:`~TopologicalSorter.prepare` на графіку." + +msgid "" +"While :meth:`~TopologicalSorter.is_active` is ``True``, iterate over the " +"nodes returned by :meth:`~TopologicalSorter.get_ready` and process them. " +"Call :meth:`~TopologicalSorter.done` on each node as it finishes processing." +msgstr "" +"Поки :meth:`~TopologicalSorter.is_active` має значення ``True``, перебирайте " +"вузли, повернуті :meth:`~TopologicalSorter.get_ready`, і обробіть їх. " +"Викликайте :meth:`~TopologicalSorter.done` на кожному вузлі після завершення " +"обробки." + +msgid "" +"In case just an immediate sorting of the nodes in the graph is required and " +"no parallelism is involved, the convenience method :meth:`TopologicalSorter." +"static_order` can be used directly:" +msgstr "" +"Якщо потрібне лише негайне сортування вузлів у графі, а паралелізм не " +"задіяний, допоміжний метод :meth:`TopologicalSorter.static_order` можна " +"використати безпосередньо:" + +msgid "" +">>> graph = {\"D\": {\"B\", \"C\"}, \"C\": {\"A\"}, \"B\": {\"A\"}}\n" +">>> ts = TopologicalSorter(graph)\n" +">>> tuple(ts.static_order())\n" +"('A', 'C', 'B', 'D')" +msgstr "" + +msgid "" +"The class is designed to easily support parallel processing of the nodes as " +"they become ready. For instance::" +msgstr "" +"Клас розроблений для легкої підтримки паралельної обробки вузлів, коли вони " +"стають готовими. Наприклад::" + +msgid "" +"topological_sorter = TopologicalSorter()\n" +"\n" +"# Add nodes to 'topological_sorter'...\n" +"\n" +"topological_sorter.prepare()\n" +"while topological_sorter.is_active():\n" +" for node in topological_sorter.get_ready():\n" +" # Worker threads or processes take nodes to work on off the\n" +" # 'task_queue' queue.\n" +" task_queue.put(node)\n" +"\n" +" # When the work for a node is done, workers put the node in\n" +" # 'finalized_tasks_queue' so we can get more nodes to work on.\n" +" # The definition of 'is_active()' guarantees that, at this point, at\n" +" # least one node has been placed on 'task_queue' that hasn't yet\n" +" # been passed to 'done()', so this blocking 'get()' must (eventually)\n" +" # succeed. After calling 'done()', we loop back to call 'get_ready()'\n" +" # again, so put newly freed nodes on 'task_queue' as soon as\n" +" # logically possible.\n" +" node = finalized_tasks_queue.get()\n" +" topological_sorter.done(node)" +msgstr "" + +msgid "" +"Add a new node and its predecessors to the graph. Both the *node* and all " +"elements in *predecessors* must be :term:`hashable`." +msgstr "" + +msgid "" +"If called multiple times with the same node argument, the set of " +"dependencies will be the union of all dependencies passed in." +msgstr "" +"Якщо викликати кілька разів з тим самим аргументом node, набір залежностей " +"буде об’єднанням усіх переданих залежностей." + +msgid "" +"It is possible to add a node with no dependencies (*predecessors* is not " +"provided) or to provide a dependency twice. If a node that has not been " +"provided before is included among *predecessors* it will be automatically " +"added to the graph with no predecessors of its own." +msgstr "" +"Можна додати вузол без залежностей (*попередники* не надаються) або надати " +"залежність двічі. Якщо вузол, який не було надано раніше, включено до " +"*попередників*, він буде автоматично доданий до графу без власних " +"попередників." + +msgid "" +"Raises :exc:`ValueError` if called after :meth:`~TopologicalSorter.prepare`." +msgstr "" +"Викликає :exc:`ValueError`, якщо викликається після :meth:" +"`~TopologicalSorter.prepare`." + +msgid "" +"Mark the graph as finished and check for cycles in the graph. If any cycle " +"is detected, :exc:`CycleError` will be raised, but :meth:`~TopologicalSorter." +"get_ready` can still be used to obtain as many nodes as possible until " +"cycles block more progress. After a call to this function, the graph cannot " +"be modified, and therefore no more nodes can be added using :meth:" +"`~TopologicalSorter.add`." +msgstr "" +"Позначте графік як готовий і перевірте наявність циклів у ньому. Якщо буде " +"виявлено будь-який цикл, :exc:`CycleError` буде викликано, але :meth:" +"`~TopologicalSorter.get_ready` все ще можна використовувати для отримання " +"якомога більшої кількості вузлів, доки цикли не заблокують подальший " +"прогрес. Після виклику цієї функції граф не можна змінити, і тому більше " +"вузлів не можна додавати за допомогою :meth:`~TopologicalSorter.add`." + +msgid "" +"Returns ``True`` if more progress can be made and ``False`` otherwise. " +"Progress can be made if cycles do not block the resolution and either there " +"are still nodes ready that haven't yet been returned by :meth:" +"`TopologicalSorter.get_ready` or the number of nodes marked :meth:" +"`TopologicalSorter.done` is less than the number that have been returned by :" +"meth:`TopologicalSorter.get_ready`." +msgstr "" +"Повертає ``True``, якщо можна досягти більшого прогресу, і ``False`` в " +"іншому випадку. Прогрес може бути досягнутий, якщо цикли не блокують " +"розв’язку та або ще є готові вузли, які ще не повернув :meth:" +"`TopologicalSorter.get_ready`, або кількість вузлів, позначених :meth:" +"`TopologicalSorter.done`, менша ніж число, яке повернув :meth:" +"`TopologicalSorter.get_ready`." + +msgid "" +"The :meth:`~object.__bool__` method of this class defers to this function, " +"so instead of::" +msgstr "" + +msgid "" +"if ts.is_active():\n" +" ..." +msgstr "" + +msgid "it is possible to simply do::" +msgstr "можна просто зробити::" + +msgid "" +"if ts:\n" +" ..." +msgstr "" + +msgid "" +"Raises :exc:`ValueError` if called without calling :meth:`~TopologicalSorter." +"prepare` previously." +msgstr "" +"Викликає :exc:`ValueError`, якщо викликається без попереднього виклику :meth:" +"`~TopologicalSorter.prepare`." + +msgid "" +"Marks a set of nodes returned by :meth:`TopologicalSorter.get_ready` as " +"processed, unblocking any successor of each node in *nodes* for being " +"returned in the future by a call to :meth:`TopologicalSorter.get_ready`." +msgstr "" +"Позначає набір вузлів, повернутий :meth:`TopologicalSorter.get_ready`, як " +"оброблений, розблоковуючи будь-якого наступника кожного вузла в *nodes* для " +"повернення в майбутньому за допомогою виклику :meth:`TopologicalSorter." +"get_ready`." + +msgid "" +"Raises :exc:`ValueError` if any node in *nodes* has already been marked as " +"processed by a previous call to this method or if a node was not added to " +"the graph by using :meth:`TopologicalSorter.add`, if called without calling :" +"meth:`~TopologicalSorter.prepare` or if node has not yet been returned by :" +"meth:`~TopologicalSorter.get_ready`." +msgstr "" +"Викликає :exc:`ValueError`, якщо будь-який вузол у *nodes* вже було " +"позначено як оброблений попереднім викликом цього методу або якщо вузол не " +"було додано до графіка за допомогою :meth:`TopologicalSorter.add`, якщо він " +"викликається без виклику :meth:`~TopologicalSorter.prepare` або якщо вузол " +"ще не повернуто :meth:`~TopologicalSorter.get_ready`." + +msgid "" +"Returns a ``tuple`` with all the nodes that are ready. Initially it returns " +"all nodes with no predecessors, and once those are marked as processed by " +"calling :meth:`TopologicalSorter.done`, further calls will return all new " +"nodes that have all their predecessors already processed. Once no more " +"progress can be made, empty tuples are returned." +msgstr "" +"Повертає ``кортеж`` з усіма готовими вузлами. Спочатку він повертає всі " +"вузли без попередників, і коли вони позначаються як оброблені за допомогою " +"виклику :meth:`TopologicalSorter.done`, подальші виклики повертатимуть усі " +"нові вузли, усі їхні попередники вже оброблені. Якщо неможливо більше " +"досягти прогресу, повертаються порожні кортежі." + +msgid "" +"Returns an iterator object which will iterate over nodes in a topological " +"order. When using this method, :meth:`~TopologicalSorter.prepare` and :meth:" +"`~TopologicalSorter.done` should not be called. This method is equivalent " +"to::" +msgstr "" +"Повертає об’єкт-ітератор, який виконуватиме ітерацію по вузлах у " +"топологічному порядку. Під час використання цього методу не слід викликати :" +"meth:`~TopologicalSorter.prepare` і :meth:`~TopologicalSorter.done`. Цей " +"метод еквівалентний:" + +msgid "" +"def static_order(self):\n" +" self.prepare()\n" +" while self.is_active():\n" +" node_group = self.get_ready()\n" +" yield from node_group\n" +" self.done(*node_group)" +msgstr "" + +msgid "" +"The particular order that is returned may depend on the specific order in " +"which the items were inserted in the graph. For example:" +msgstr "" +"Конкретний порядок, який повертається, може залежати від конкретного " +"порядку, у якому елементи були вставлені в графік. Наприклад:" + +msgid "" +">>> ts = TopologicalSorter()\n" +">>> ts.add(3, 2, 1)\n" +">>> ts.add(1, 0)\n" +">>> print([*ts.static_order()])\n" +"[2, 0, 1, 3]\n" +"\n" +">>> ts2 = TopologicalSorter()\n" +">>> ts2.add(1, 0)\n" +">>> ts2.add(3, 2, 1)\n" +">>> print([*ts2.static_order()])\n" +"[0, 2, 1, 3]" +msgstr "" + +msgid "" +"This is due to the fact that \"0\" and \"2\" are in the same level in the " +"graph (they would have been returned in the same call to :meth:" +"`~TopologicalSorter.get_ready`) and the order between them is determined by " +"the order of insertion." +msgstr "" +"Це пов’язано з тим, що \"0\" і \"2\" знаходяться на одному рівні графіка " +"(вони були б повернені під час того самого виклику :meth:`~TopologicalSorter." +"get_ready`), і порядок між ними визначається за порядком вставлення." + +msgid "If any cycle is detected, :exc:`CycleError` will be raised." +msgstr "Якщо буде виявлено будь-який цикл, буде викликано :exc:`CycleError`." + +msgid "Exceptions" +msgstr "Винятки" + +msgid "The :mod:`graphlib` module defines the following exception classes:" +msgstr "Модуль :mod:`graphlib` визначає такі класи винятків:" + +msgid "" +"Subclass of :exc:`ValueError` raised by :meth:`TopologicalSorter.prepare` if " +"cycles exist in the working graph. If multiple cycles exist, only one " +"undefined choice among them will be reported and included in the exception." +msgstr "" +"Підклас :exc:`ValueError`, створений :meth:`TopologicalSorter.prepare`, якщо " +"в робочому графі існують цикли. Якщо існує кілька циклів, лише один " +"невизначений вибір серед них буде повідомлено та включено до винятку." + +msgid "" +"The detected cycle can be accessed via the second element in the :attr:" +"`~BaseException.args` attribute of the exception instance and consists in a " +"list of nodes, such that each node is, in the graph, an immediate " +"predecessor of the next node in the list. In the reported list, the first " +"and the last node will be the same, to make it clear that it is cyclic." +msgstr "" diff --git a/library/grp.po b/library/grp.po new file mode 100644 index 000000000..2e974df1c --- /dev/null +++ b/library/grp.po @@ -0,0 +1,140 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 01:07+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!grp` --- The group database" +msgstr "" + +msgid "" +"This module provides access to the Unix group database. It is available on " +"all Unix versions." +msgstr "" +"Цей модуль забезпечує доступ до бази даних групи Unix. Він доступний у всіх " +"версіях Unix." + +msgid "Availability" +msgstr "" + +msgid "" +"Group database entries are reported as a tuple-like object, whose attributes " +"correspond to the members of the ``group`` structure (Attribute field below, " +"see ````):" +msgstr "" +"Записи бази даних групи повідомляються як кортежний об’єкт, атрибути якого " +"відповідають членам структури ``групи`` (поле атрибута нижче, див. ````):" + +msgid "Index" +msgstr "Індекс" + +msgid "Attribute" +msgstr "Атрибут" + +msgid "Meaning" +msgstr "Значення" + +msgid "0" +msgstr "0" + +msgid "gr_name" +msgstr "gr_name" + +msgid "the name of the group" +msgstr "назва групи" + +msgid "1" +msgstr "1" + +msgid "gr_passwd" +msgstr "gr_passwd" + +msgid "the (encrypted) group password; often empty" +msgstr "(зашифрований) пароль групи; часто порожній" + +msgid "2" +msgstr "2" + +msgid "gr_gid" +msgstr "gr_gid" + +msgid "the numerical group ID" +msgstr "ідентифікатор числової групи" + +msgid "3" +msgstr "3" + +msgid "gr_mem" +msgstr "gr_mem" + +msgid "all the group member's user names" +msgstr "імена всіх учасників групи" + +msgid "" +"The gid is an integer, name and password are strings, and the member list is " +"a list of strings. (Note that most users are not explicitly listed as " +"members of the group they are in according to the password database. Check " +"both databases to get complete membership information. Also note that a " +"``gr_name`` that starts with a ``+`` or ``-`` is likely to be a YP/NIS " +"reference and may not be accessible via :func:`getgrnam` or :func:" +"`getgrgid`.)" +msgstr "" +"Gid — це ціле число, ім’я та пароль — це рядки, а список учасників — це " +"список рядків. (Зауважте, що більшість користувачів явно не вказані як члени " +"групи, до якої вони належать, відповідно до бази даних паролів. Перевірте " +"обидві бази даних, щоб отримати повну інформацію про членство. Також " +"зауважте, що ``gr_name``, яке починається з ``+`` або ``-``, ймовірно, є " +"посиланням на YP/NIS і може бути недоступним через :func:`getgrnam` або :" +"func:`getgrgid`.)" + +msgid "It defines the following items:" +msgstr "Він визначає такі пункти:" + +msgid "" +"Return the group database entry for the given numeric group ID. :exc:" +"`KeyError` is raised if the entry asked for cannot be found." +msgstr "" +"Повертає запис бази даних групи для вказаного числового ідентифікатора " +"групи. :exc:`KeyError` виникає, якщо запитуваний запис не знайдено." + +msgid "" +":exc:`TypeError` is raised for non-integer arguments like floats or strings." +msgstr "" + +msgid "" +"Return the group database entry for the given group name. :exc:`KeyError` is " +"raised if the entry asked for cannot be found." +msgstr "" +"Повертає запис бази даних групи для заданої назви групи. :exc:`KeyError` " +"виникає, якщо запитуваний запис не знайдено." + +msgid "Return a list of all available group entries, in arbitrary order." +msgstr "Повертає список усіх доступних групових записів у довільному порядку." + +msgid "Module :mod:`pwd`" +msgstr "Модуль :mod:`pwd`" + +msgid "An interface to the user database, similar to this." +msgstr "Подібний до цього інтерфейс до бази даних користувача." diff --git a/library/gzip.po b/library/gzip.po new file mode 100644 index 000000000..0fda21480 --- /dev/null +++ b/library/gzip.po @@ -0,0 +1,430 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 01:07+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!gzip` --- Support for :program:`gzip` files" +msgstr "" + +msgid "**Source code:** :source:`Lib/gzip.py`" +msgstr "**Вихідний код:** :source:`Lib/gzip.py`" + +msgid "" +"This module provides a simple interface to compress and decompress files " +"just like the GNU programs :program:`gzip` and :program:`gunzip` would." +msgstr "" +"Цей модуль надає простий інтерфейс для стиснення та розпакування файлів, як " +"це робили б програми GNU :program:`gzip` і :program:`gunzip`." + +msgid "The data compression is provided by the :mod:`zlib` module." +msgstr "Стиснення даних забезпечується модулем :mod:`zlib`." + +msgid "" +"The :mod:`gzip` module provides the :class:`GzipFile` class, as well as the :" +"func:`.open`, :func:`compress` and :func:`decompress` convenience functions. " +"The :class:`GzipFile` class reads and writes :program:`gzip`\\ -format " +"files, automatically compressing or decompressing the data so that it looks " +"like an ordinary :term:`file object`." +msgstr "" +"Модуль :mod:`gzip` забезпечує клас :class:`GzipFile`, а також :func:`." +"open`, :func:`compress` і :func:`decompress` зручні функції. Клас :class:" +"`GzipFile` читає та записує файли у форматі :program:`gzip`\\, автоматично " +"стискаючи або розпаковуючи дані, щоб вони виглядали як звичайний :term:`file " +"object`." + +msgid "" +"Note that additional file formats which can be decompressed by the :program:" +"`gzip` and :program:`gunzip` programs, such as those produced by :program:" +"`compress` and :program:`pack`, are not supported by this module." +msgstr "" +"Зауважте, що додаткові формати файлів, які можна розпакувати програмами :" +"program:`gzip` і :program:`gunzip`, наприклад ті, створені :program:" +"`compress` і :program:`pack`, не підтримуються цим модуль." + +msgid "The module defines the following items:" +msgstr "Модуль визначає такі елементи:" + +msgid "" +"Open a gzip-compressed file in binary or text mode, returning a :term:`file " +"object`." +msgstr "" +"Відкрийте файл, стиснутий gzip, у двійковому або текстовому режимі, " +"повертаючи :term:`file object`." + +msgid "" +"The *filename* argument can be an actual filename (a :class:`str` or :class:" +"`bytes` object), or an existing file object to read from or write to." +msgstr "" +"Аргументом *filename* може бути фактичне ім’я файлу (об’єкт :class:`str` " +"або :class:`bytes`) або наявний файловий об’єкт для читання або запису." + +msgid "" +"The *mode* argument can be any of ``'r'``, ``'rb'``, ``'a'``, ``'ab'``, " +"``'w'``, ``'wb'``, ``'x'`` or ``'xb'`` for binary mode, or ``'rt'``, " +"``'at'``, ``'wt'``, or ``'xt'`` for text mode. The default is ``'rb'``." +msgstr "" +"Аргумент *mode* може бути будь-яким із ``'r'``, ``'rb'``, ``'a'``, ``'ab'``, " +"``'w'``, ``'wb'``, ``'x'`` або ``'xb'`` для бінарного режиму або ``'rt'``, " +"``'at'``, ``'wt'`` або ``'xt''`` для текстового режиму. Типовим є ``'rb'``." + +msgid "" +"The *compresslevel* argument is an integer from 0 to 9, as for the :class:" +"`GzipFile` constructor." +msgstr "" +"Аргумент *compresslevel* є цілим числом від 0 до 9, як і для конструктора :" +"class:`GzipFile`." + +msgid "" +"For binary mode, this function is equivalent to the :class:`GzipFile` " +"constructor: ``GzipFile(filename, mode, compresslevel)``. In this case, the " +"*encoding*, *errors* and *newline* arguments must not be provided." +msgstr "" +"Для бінарного режиму ця функція еквівалентна конструктору :class:`GzipFile`: " +"``GzipFile(filename, mode, compresslevel)``. У цьому випадку аргументи " +"*encoding*, *errors* і *newline* не повинні надаватися." + +msgid "" +"For text mode, a :class:`GzipFile` object is created, and wrapped in an :" +"class:`io.TextIOWrapper` instance with the specified encoding, error " +"handling behavior, and line ending(s)." +msgstr "" +"Для текстового режиму створюється об’єкт :class:`GzipFile`, який " +"загортається в екземпляр :class:`io.TextIOWrapper` із вказаним кодуванням, " +"поведінкою обробки помилок і закінченнями рядків." + +msgid "" +"Added support for *filename* being a file object, support for text mode, and " +"the *encoding*, *errors* and *newline* arguments." +msgstr "" +"Додано підтримку того, що *ім’я файлу* є об’єктом файлу, підтримується " +"текстовий режим, а також аргументи *кодування*, *помилки* та *новий рядок*." + +msgid "Added support for the ``'x'``, ``'xb'`` and ``'xt'`` modes." +msgstr "Додано підтримку режимів ``'x'``, ``'xb'`` і ``'xt'``." + +msgid "Accepts a :term:`path-like object`." +msgstr "Приймає :term:`path-like object`." + +msgid "" +"An exception raised for invalid gzip files. It inherits from :exc:" +"`OSError`. :exc:`EOFError` and :exc:`zlib.error` can also be raised for " +"invalid gzip files." +msgstr "" + +msgid "" +"Constructor for the :class:`GzipFile` class, which simulates most of the " +"methods of a :term:`file object`, with the exception of the :meth:`~io." +"IOBase.truncate` method. At least one of *fileobj* and *filename* must be " +"given a non-trivial value." +msgstr "" + +msgid "" +"The new class instance is based on *fileobj*, which can be a regular file, " +"an :class:`io.BytesIO` object, or any other object which simulates a file. " +"It defaults to ``None``, in which case *filename* is opened to provide a " +"file object." +msgstr "" +"Новий екземпляр класу базується на *fileobj*, який може бути звичайним " +"файлом, об’єктом :class:`io.BytesIO` або будь-яким іншим об’єктом, який " +"імітує файл. За замовчуванням встановлено ``None``, у цьому випадку " +"*ім’я_файлу* відкривається, щоб надати об’єкт файлу." + +msgid "" +"When *fileobj* is not ``None``, the *filename* argument is only used to be " +"included in the :program:`gzip` file header, which may include the original " +"filename of the uncompressed file. It defaults to the filename of " +"*fileobj*, if discernible; otherwise, it defaults to the empty string, and " +"in this case the original filename is not included in the header." +msgstr "" +"Якщо *fileobj* не є ``None``, аргумент *filename* використовується лише для " +"включення в заголовок файлу :program:`gzip`, який може містити оригінальну " +"назву нестисненого файлу. За замовчуванням ім’я файлу *fileobj*, якщо воно " +"помітне; інакше за замовчуванням буде порожній рядок, і в цьому випадку " +"оригінальна назва файлу не буде включена в заголовок." + +msgid "" +"The *mode* argument can be any of ``'r'``, ``'rb'``, ``'a'``, ``'ab'``, " +"``'w'``, ``'wb'``, ``'x'``, or ``'xb'``, depending on whether the file will " +"be read or written. The default is the mode of *fileobj* if discernible; " +"otherwise, the default is ``'rb'``. In future Python releases the mode of " +"*fileobj* will not be used. It is better to always specify *mode* for " +"writing." +msgstr "" +"Аргумент *mode* може бути будь-яким із ``'r'``, ``'rb'``, ``'a'``, ``'ab'``, " +"``'w'``, ``'wb'``, ``'x'`` або ``'xb'``, залежно від того, чи буде файл " +"читатися чи записуватися. Типовим є режим *fileobj*, якщо він помітний; " +"інакше за замовчуванням буде ``'rb'``. У майбутніх випусках Python режим " +"*fileobj* не використовуватиметься. Краще завжди вказувати *режим* для " +"запису." + +msgid "" +"Note that the file is always opened in binary mode. To open a compressed " +"file in text mode, use :func:`.open` (or wrap your :class:`GzipFile` with " +"an :class:`io.TextIOWrapper`)." +msgstr "" +"Зауважте, що файл завжди відкривається у двійковому режимі. Щоб відкрити " +"стислий файл у текстовому режимі, використовуйте :func:`.open` (або " +"загорніть свій :class:`GzipFile` у :class:`io.TextIOWrapper`)." + +msgid "" +"The *compresslevel* argument is an integer from ``0`` to ``9`` controlling " +"the level of compression; ``1`` is fastest and produces the least " +"compression, and ``9`` is slowest and produces the most compression. ``0`` " +"is no compression. The default is ``9``." +msgstr "" +"Аргумент *compresslevel* є цілим числом від ``0`` до ``9``, що контролює " +"рівень стиснення; ``1`` є найшвидшим і забезпечує найменше стиснення, а " +"``9`` є найповільнішим і забезпечує найбільше стиснення. ``0`` не стискає. " +"Типовим значенням є ``9``." + +msgid "" +"The optional *mtime* argument is the timestamp requested by gzip. The time " +"is in Unix format, i.e., seconds since 00:00:00 UTC, January 1, 1970. If " +"*mtime* is omitted or ``None``, the current time is used. Use *mtime* = 0 to " +"generate a compressed stream that does not depend on creation time." +msgstr "" + +msgid "" +"See below for the :attr:`mtime` attribute that is set when decompressing." +msgstr "" + +msgid "" +"Calling a :class:`GzipFile` object's :meth:`!close` method does not close " +"*fileobj*, since you might wish to append more material after the compressed " +"data. This also allows you to pass an :class:`io.BytesIO` object opened for " +"writing as *fileobj*, and retrieve the resulting memory buffer using the :" +"class:`io.BytesIO` object's :meth:`~io.BytesIO.getvalue` method." +msgstr "" + +msgid "" +":class:`GzipFile` supports the :class:`io.BufferedIOBase` interface, " +"including iteration and the :keyword:`with` statement. Only the :meth:`~io." +"IOBase.truncate` method isn't implemented." +msgstr "" + +msgid ":class:`GzipFile` also provides the following method and attribute:" +msgstr ":class:`GzipFile` також надає наступний метод і атрибут:" + +msgid "" +"Read *n* uncompressed bytes without advancing the file position. The number " +"of bytes returned may be more or less than requested." +msgstr "" + +msgid "" +"While calling :meth:`peek` does not change the file position of the :class:" +"`GzipFile`, it may change the position of the underlying file object (e.g. " +"if the :class:`GzipFile` was constructed with the *fileobj* parameter)." +msgstr "" +"Хоча виклик :meth:`peek` не змінює позицію файлу :class:`GzipFile`, він може " +"змінити позицію основного файлового об’єкта (наприклад, якщо :class:" +"`GzipFile` було створено за допомогою *fileobj* параметр)." + +msgid "``'rb'`` for reading and ``'wb'`` for writing." +msgstr "" + +msgid "In previous versions it was an integer ``1`` or ``2``." +msgstr "" + +msgid "" +"When decompressing, this attribute is set to the last timestamp in the most " +"recently read header. It is an integer, holding the number of seconds since " +"the Unix epoch (00:00:00 UTC, January 1, 1970). The initial value before " +"reading any headers is ``None``." +msgstr "" + +msgid "" +"The path to the gzip file on disk, as a :class:`str` or :class:`bytes`. " +"Equivalent to the output of :func:`os.fspath` on the original input path, " +"with no other normalization, resolution or expansion." +msgstr "" + +msgid "" +"Support for the :keyword:`with` statement was added, along with the *mtime* " +"constructor argument and :attr:`mtime` attribute." +msgstr "" +"Додано підтримку оператора :keyword:`with` разом з аргументом конструктора " +"*mtime* і атрибутом :attr:`mtime`." + +msgid "Support for zero-padded and unseekable files was added." +msgstr "" +"Було додано підтримку файлів із нульовою підкладкою та файлів, які неможливо " +"знайти." + +msgid "The :meth:`io.BufferedIOBase.read1` method is now implemented." +msgstr "Метод :meth:`io.BufferedIOBase.read1` тепер реалізовано." + +msgid "Added support for the ``'x'`` and ``'xb'`` modes." +msgstr "Додано підтримку режимів ``'x'`` і ``'xb'``." + +msgid "" +"Added support for writing arbitrary :term:`bytes-like objects `. The :meth:`~io.BufferedIOBase.read` method now accepts an argument " +"of ``None``." +msgstr "" +"Додано підтримку запису довільних :term:`байт-подібних об’єктів `. Метод :meth:`~io.BufferedIOBase.read` тепер приймає аргумент " +"``None``." + +msgid "" +"Opening :class:`GzipFile` for writing without specifying the *mode* argument " +"is deprecated." +msgstr "" +"Відкриття :class:`GzipFile` для запису без вказівки аргументу *mode* " +"застаріло." + +msgid "" +"Remove the ``filename`` attribute, use the :attr:`~GzipFile.name` attribute " +"instead." +msgstr "" + +msgid "" +"Compress the *data*, returning a :class:`bytes` object containing the " +"compressed data. *compresslevel* and *mtime* have the same meaning as in " +"the :class:`GzipFile` constructor above." +msgstr "" + +msgid "Added the *mtime* parameter for reproducible output." +msgstr "Додано параметр *mtime* для відтворюваного виведення." + +msgid "" +"Speed is improved by compressing all data at once instead of in a streamed " +"fashion. Calls with *mtime* set to ``0`` are delegated to :func:`zlib." +"compress` for better speed. In this situation the output may contain a gzip " +"header \"OS\" byte value other than 255 \"unknown\" as supplied by the " +"underlying zlib implementation." +msgstr "" + +msgid "" +"The gzip header OS byte is guaranteed to be set to 255 when this function is " +"used as was the case in 3.10 and earlier." +msgstr "" + +msgid "" +"Decompress the *data*, returning a :class:`bytes` object containing the " +"uncompressed data. This function is capable of decompressing multi-member " +"gzip data (multiple gzip blocks concatenated together). When the data is " +"certain to contain only one member the :func:`zlib.decompress` function with " +"*wbits* set to 31 is faster." +msgstr "" + +msgid "" +"Speed is improved by decompressing members at once in memory instead of in a " +"streamed fashion." +msgstr "" + +msgid "Examples of usage" +msgstr "Приклади вживання" + +msgid "Example of how to read a compressed file::" +msgstr "Приклад читання стисненого файлу::" + +msgid "" +"import gzip\n" +"with gzip.open('/home/joe/file.txt.gz', 'rb') as f:\n" +" file_content = f.read()" +msgstr "" + +msgid "Example of how to create a compressed GZIP file::" +msgstr "Приклад створення стисненого файлу GZIP::" + +msgid "" +"import gzip\n" +"content = b\"Lots of content here\"\n" +"with gzip.open('/home/joe/file.txt.gz', 'wb') as f:\n" +" f.write(content)" +msgstr "" + +msgid "Example of how to GZIP compress an existing file::" +msgstr "Приклад того, як GZIP стиснути існуючий файл::" + +msgid "" +"import gzip\n" +"import shutil\n" +"with open('/home/joe/file.txt', 'rb') as f_in:\n" +" with gzip.open('/home/joe/file.txt.gz', 'wb') as f_out:\n" +" shutil.copyfileobj(f_in, f_out)" +msgstr "" + +msgid "Example of how to GZIP compress a binary string::" +msgstr "Приклад того, як GZIP стиснути двійковий рядок::" + +msgid "" +"import gzip\n" +"s_in = b\"Lots of content here\"\n" +"s_out = gzip.compress(s_in)" +msgstr "" + +msgid "Module :mod:`zlib`" +msgstr "Модуль :mod:`zlib`" + +msgid "" +"The basic data compression module needed to support the :program:`gzip` file " +"format." +msgstr "" +"Базовий модуль стиснення даних, необхідний для підтримки формату файлу :" +"program:`gzip`." + +msgid "" +"In case gzip (de)compression is a bottleneck, the `python-isal`_ package " +"speeds up (de)compression with a mostly compatible API." +msgstr "" + +msgid "Command Line Interface" +msgstr "Інтерфейс командного рядка" + +msgid "" +"The :mod:`gzip` module provides a simple command line interface to compress " +"or decompress files." +msgstr "" +"Модуль :mod:`gzip` забезпечує простий інтерфейс командного рядка для " +"стиснення або розпакування файлів." + +msgid "Once executed the :mod:`gzip` module keeps the input file(s)." +msgstr "Після виконання модуль :mod:`gzip` зберігає вхідні файли." + +msgid "" +"Add a new command line interface with a usage. By default, when you will " +"execute the CLI, the default compression level is 6." +msgstr "" +"Додайте новий інтерфейс командного рядка з використанням. За замовчуванням, " +"коли ви будете виконувати CLI, рівень стиснення за замовчуванням становить 6." + +msgid "Command line options" +msgstr "Параметри командного рядка" + +msgid "If *file* is not specified, read from :data:`sys.stdin`." +msgstr "" + +msgid "Indicates the fastest compression method (less compression)." +msgstr "Вказує найшвидший метод стиснення (з меншим стисненням)." + +msgid "Indicates the slowest compression method (best compression)." +msgstr "Вказує найповільніший метод стиснення (найкраще стиснення)." + +msgid "Decompress the given file." +msgstr "Розпакуйте вказаний файл." + +msgid "Show the help message." +msgstr "Показати довідкове повідомлення." diff --git a/library/hashlib.po b/library/hashlib.po new file mode 100644 index 000000000..7358b9fa4 --- /dev/null +++ b/library/hashlib.po @@ -0,0 +1,1077 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2023 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 01:07+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2023\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!hashlib` --- Secure hashes and message digests" +msgstr "" + +msgid "**Source code:** :source:`Lib/hashlib.py`" +msgstr "**Вихідний код:** :source:`Lib/hashlib.py`" + +msgid "" +"This module implements a common interface to many different hash algorithms. " +"Included are the FIPS secure hash algorithms SHA224, SHA256, SHA384, SHA512, " +"(defined in `the FIPS 180-4 standard`_), the SHA-3 series (defined in `the " +"FIPS 202 standard`_) as well as the legacy algorithms SHA1 (`formerly part " +"of FIPS`_) and the MD5 algorithm (defined in internet :rfc:`1321`)." +msgstr "" + +msgid "" +"If you want the adler32 or crc32 hash functions, they are available in the :" +"mod:`zlib` module." +msgstr "" +"Якщо вам потрібні хеш-функції adler32 або crc32, вони доступні в модулі :mod:" +"`zlib`." + +msgid "Hash algorithms" +msgstr "Хеш-алгоритми" + +msgid "" +"There is one constructor method named for each type of :dfn:`hash`. All " +"return a hash object with the same simple interface. For example: use :func:" +"`sha256` to create a SHA-256 hash object. You can now feed this object with :" +"term:`bytes-like objects ` (normally :class:`bytes`) " +"using the :meth:`update` method. At any point you can ask it " +"for the :dfn:`digest` of the concatenation of the data fed to it so far " +"using the :meth:`digest()` or :meth:`hexdigest()` methods." +msgstr "" + +msgid "" +"To allow multithreading, the Python :term:`GIL` is released while computing " +"a hash supplied more than 2047 bytes of data at once in its constructor or :" +"meth:`.update` method." +msgstr "" + +msgid "" +"Constructors for hash algorithms that are always present in this module are :" +"func:`sha1`, :func:`sha224`, :func:`sha256`, :func:`sha384`, :func:" +"`sha512`, :func:`sha3_224`, :func:`sha3_256`, :func:`sha3_384`, :func:" +"`sha3_512`, :func:`shake_128`, :func:`shake_256`, :func:`blake2b`, and :func:" +"`blake2s`. :func:`md5` is normally available as well, though it may be " +"missing or blocked if you are using a rare \"FIPS compliant\" build of " +"Python. These correspond to :data:`algorithms_guaranteed`." +msgstr "" + +msgid "" +"Additional algorithms may also be available if your Python distribution's :" +"mod:`hashlib` was linked against a build of OpenSSL that provides others. " +"Others *are not guaranteed available* on all installations and will only be " +"accessible by name via :func:`new`. See :data:`algorithms_available`." +msgstr "" + +msgid "" +"Some algorithms have known hash collision weaknesses (including MD5 and " +"SHA1). Refer to `Attacks on cryptographic hash algorithms`_ and the `hashlib-" +"seealso`_ section at the end of this document." +msgstr "" + +msgid "" +"SHA3 (Keccak) and SHAKE constructors :func:`sha3_224`, :func:`sha3_256`, :" +"func:`sha3_384`, :func:`sha3_512`, :func:`shake_128`, :func:`shake_256` were " +"added. :func:`blake2b` and :func:`blake2s` were added." +msgstr "" + +msgid "" +"All hashlib constructors take a keyword-only argument *usedforsecurity* with " +"default value ``True``. A false value allows the use of insecure and blocked " +"hashing algorithms in restricted environments. ``False`` indicates that the " +"hashing algorithm is not used in a security context, e.g. as a non-" +"cryptographic one-way compression function." +msgstr "" +"Усі конструктори хешлібів приймають лише ключовий аргумент *usedforsecurity* " +"зі значенням за замовчуванням ``True``. Помилкове значення дозволяє " +"використовувати небезпечні та заблоковані алгоритми хешування в обмежених " +"середовищах. ``False`` вказує на те, що алгоритм хешування не " +"використовується в контексті безпеки, напр. як некриптографічна функція " +"одностороннього стиснення." + +msgid "Hashlib now uses SHA3 and SHAKE from OpenSSL if it provides it." +msgstr "" + +msgid "" +"For any of the MD5, SHA1, SHA2, or SHA3 algorithms that the linked OpenSSL " +"does not provide we fall back to a verified implementation from the `HACL\\* " +"project`_." +msgstr "" + +msgid "Usage" +msgstr "Використання" + +msgid "" +"To obtain the digest of the byte string ``b\"Nobody inspects the spammish " +"repetition\"``::" +msgstr "" + +msgid "" +">>> import hashlib\n" +">>> m = hashlib.sha256()\n" +">>> m.update(b\"Nobody inspects\")\n" +">>> m.update(b\" the spammish repetition\")\n" +">>> m.digest()\n" +"b'\\x03\\x1e\\xdd}Ae\\x15\\x93\\xc5\\xfe\\\\" +"\\x00o\\xa5u+7\\xfd\\xdf\\xf7\\xbcN\\x84:" +"\\xa6\\xaf\\x0c\\x95\\x0fK\\x94\\x06'\n" +">>> m.hexdigest()\n" +"'031edd7d41651593c5fe5c006fa5752b37fddff7bc4e843aa6af0c950f4b9406'" +msgstr "" + +msgid "More condensed:" +msgstr "Більш стисло:" + +msgid "Constructors" +msgstr "" + +msgid "" +"Is a generic constructor that takes the string *name* of the desired " +"algorithm as its first parameter. It also exists to allow access to the " +"above listed hashes as well as any other algorithms that your OpenSSL " +"library may offer." +msgstr "" + +msgid "Using :func:`new` with an algorithm name:" +msgstr "" + +msgid "" +"Named constructors such as these are faster than passing an algorithm name " +"to :func:`new`." +msgstr "" + +msgid "Attributes" +msgstr "Атрибути" + +msgid "Hashlib provides the following constant module attributes:" +msgstr "" + +msgid "" +"A set containing the names of the hash algorithms guaranteed to be supported " +"by this module on all platforms. Note that 'md5' is in this list despite " +"some upstream vendors offering an odd \"FIPS compliant\" Python build that " +"excludes it." +msgstr "" +"Набір, що містить назви геш-алгоритмів, які гарантовано підтримуватимуться " +"цим модулем на всіх платформах. Зауважте, що \"md5\" є в цьому списку, " +"незважаючи на те, що деякі постачальники вищого рівня пропонують дивну " +"\"FIPS-сумісну\" збірку Python, яка виключає його." + +msgid "" +"A set containing the names of the hash algorithms that are available in the " +"running Python interpreter. These names will be recognized when passed to :" +"func:`new`. :attr:`algorithms_guaranteed` will always be a subset. The " +"same algorithm may appear multiple times in this set under different names " +"(thanks to OpenSSL)." +msgstr "" +"Набір, що містить імена геш-алгоритмів, доступних у запущеному " +"інтерпретаторі Python. Ці назви буде розпізнано, коли передано :func:`new`. :" +"attr:`algorithms_guaranteed` завжди буде підмножиною. Той самий алгоритм " +"може з’являтися кілька разів у цьому наборі під різними назвами (завдяки " +"OpenSSL)." + +msgid "Hash Objects" +msgstr "" + +msgid "" +"The following values are provided as constant attributes of the hash objects " +"returned by the constructors:" +msgstr "" +"Наступні значення надаються як постійні атрибути хеш-об’єктів, які " +"повертаються конструкторами:" + +msgid "The size of the resulting hash in bytes." +msgstr "Розмір отриманого хешу в байтах." + +msgid "The internal block size of the hash algorithm in bytes." +msgstr "Розмір внутрішнього блоку хеш-алгоритму в байтах." + +msgid "A hash object has the following attributes:" +msgstr "Хеш-об’єкт має такі атрибути:" + +msgid "" +"The canonical name of this hash, always lowercase and always suitable as a " +"parameter to :func:`new` to create another hash of this type." +msgstr "" +"Канонічна назва цього хешу, завжди в нижньому регістрі та завжди підходить " +"як параметр для :func:`new` для створення іншого хешу цього типу." + +msgid "" +"The name attribute has been present in CPython since its inception, but " +"until Python 3.4 was not formally specified, so may not exist on some " +"platforms." +msgstr "" +"Атрибут name був присутній у CPython з моменту його створення, але до Python " +"3.4 не було офіційно визначено, тому може не існувати на деяких платформах." + +msgid "A hash object has the following methods:" +msgstr "Хеш-об’єкт має такі методи:" + +msgid "" +"Update the hash object with the :term:`bytes-like object`. Repeated calls " +"are equivalent to a single call with the concatenation of all the arguments: " +"``m.update(a); m.update(b)`` is equivalent to ``m.update(a+b)``." +msgstr "" +"Оновіть хеш-об’єкт за допомогою :term:`bytes-like object`. Повторні виклики " +"еквівалентні одному виклику з конкатенацією всіх аргументів: ``m.update(a); " +"m.update(b)`` еквівалентно ``m.update(a+b)``." + +msgid "" +"Return the digest of the data passed to the :meth:`update` method so far. " +"This is a bytes object of size :attr:`digest_size` which may contain bytes " +"in the whole range from 0 to 255." +msgstr "" +"Повертає дайджест даних, переданих до цього моменту методу :meth:`update`. " +"Це байтовий об’єкт розміром :attr:`digest_size`, який може містити байти в " +"усьому діапазоні від 0 до 255." + +msgid "" +"Like :meth:`digest` except the digest is returned as a string object of " +"double length, containing only hexadecimal digits. This may be used to " +"exchange the value safely in email or other non-binary environments." +msgstr "" +"Подібно до :meth:`digest`, за винятком того, що дайджест повертається як " +"рядковий об’єкт подвійної довжини, що містить лише шістнадцяткові цифри. Це " +"можна використовувати для безпечного обміну значенням в електронній пошті чи " +"в інших небінарних середовищах." + +msgid "" +"Return a copy (\"clone\") of the hash object. This can be used to " +"efficiently compute the digests of data sharing a common initial substring." +msgstr "" +"Повертає копію (\"клон\") хеш-об'єкта. Це можна використовувати для " +"ефективного обчислення дайджестів даних, які спільно використовують " +"загальний початковий підрядок." + +msgid "SHAKE variable length digests" +msgstr "Дайджести змінної довжини SHAKE" + +msgid "" +"The :func:`shake_128` and :func:`shake_256` algorithms provide variable " +"length digests with length_in_bits//2 up to 128 or 256 bits of security. As " +"such, their digest methods require a length. Maximum length is not limited " +"by the SHAKE algorithm." +msgstr "" +"Алгоритми :func:`shake_128` і :func:`shake_256` забезпечують дайджести " +"змінної довжини з length_in_bits//2 до 128 або 256 біт безпеки. Таким чином, " +"їх методи дайджесту вимагають довжини. Максимальна довжина не обмежена " +"алгоритмом SHAKE." + +msgid "" +"Return the digest of the data passed to the :meth:`~hash.update` method so " +"far. This is a bytes object of size *length* which may contain bytes in the " +"whole range from 0 to 255." +msgstr "" + +msgid "" +"Like :meth:`digest` except the digest is returned as a string object of " +"double length, containing only hexadecimal digits. This may be used to " +"exchange the value in email or other non-binary environments." +msgstr "" + +msgid "Example use:" +msgstr "" + +msgid "File hashing" +msgstr "" + +msgid "" +"The hashlib module provides a helper function for efficient hashing of a " +"file or file-like object." +msgstr "" + +msgid "" +"Return a digest object that has been updated with contents of file object." +msgstr "" + +msgid "" +"*fileobj* must be a file-like object opened for reading in binary mode. It " +"accepts file objects from builtin :func:`open`, :class:`~io.BytesIO` " +"instances, SocketIO objects from :meth:`socket.socket.makefile`, and " +"similar. *fileobj* must be opened in blocking mode, otherwise a :exc:" +"`BlockingIOError` may be raised." +msgstr "" + +msgid "" +"The function may bypass Python's I/O and use the file descriptor from :meth:" +"`~io.IOBase.fileno` directly. *fileobj* must be assumed to be in an unknown " +"state after this function returns or raises. It is up to the caller to close " +"*fileobj*." +msgstr "" + +msgid "" +"*digest* must either be a hash algorithm name as a *str*, a hash " +"constructor, or a callable that returns a hash object." +msgstr "" + +msgid "Example:" +msgstr "приклад:" + +msgid "" +"Now raises a :exc:`BlockingIOError` if the file is opened in blocking mode. " +"Previously, spurious null bytes were added to the digest." +msgstr "" + +msgid "Key derivation" +msgstr "Виведення ключів" + +msgid "" +"Key derivation and key stretching algorithms are designed for secure " +"password hashing. Naive algorithms such as ``sha1(password)`` are not " +"resistant against brute-force attacks. A good password hashing function must " +"be tunable, slow, and include a `salt `_." +msgstr "" +"Алгоритми виведення та розтягування ключа створені для безпечного хешування " +"паролів. Наївні алгоритми, такі як ``sha1(password)``, не стійкі до атак " +"грубої сили. Хороша функція хешування пароля має бути настроюваною, " +"повільною та містити `salt `_." + +msgid "" +"The function provides PKCS#5 password-based key derivation function 2. It " +"uses HMAC as pseudorandom function." +msgstr "" +"Ця функція забезпечує функцію виведення ключа на основі пароля PKCS#5 2. " +"Вона використовує HMAC як псевдовипадкову функцію." + +msgid "" +"The string *hash_name* is the desired name of the hash digest algorithm for " +"HMAC, e.g. 'sha1' or 'sha256'. *password* and *salt* are interpreted as " +"buffers of bytes. Applications and libraries should limit *password* to a " +"sensible length (e.g. 1024). *salt* should be about 16 or more bytes from a " +"proper source, e.g. :func:`os.urandom`." +msgstr "" +"Рядок *hash_name* є бажаною назвою алгоритму хеш-дайджесту для HMAC, " +"наприклад. \"sha1\" або \"sha256\". *password* і *salt* інтерпретуються як " +"буфери байтів. Програми та бібліотеки мають обмежувати *пароль* розумною " +"довжиною (наприклад, 1024). *salt* має бути приблизно 16 або більше байтів " +"із належного джерела, напр. :func:`os.urandom`." + +msgid "" +"The number of *iterations* should be chosen based on the hash algorithm and " +"computing power. As of 2022, hundreds of thousands of iterations of SHA-256 " +"are suggested. For rationale as to why and how to choose what is best for " +"your application, read *Appendix A.2.2* of NIST-SP-800-132_. The answers on " +"the `stackexchange pbkdf2 iterations question`_ explain in detail." +msgstr "" +"Кількість *ітерацій* слід вибирати, виходячи з алгоритму хешування та " +"обчислювальної потужності. Станом на 2022 рік пропонуються сотні тисяч " +"ітерацій SHA-256. Для обґрунтування того, чому та як вибрати те, що найкраще " +"підходить для вашої програми, прочитайте *Додаток A.2.2* NIST-SP-800-132_. " +"Відповіді на `stackexchange pbkdf2 iterations question`_ пояснюють детально." + +msgid "" +"*dklen* is the length of the derived key in bytes. If *dklen* is ``None`` " +"then the digest size of the hash algorithm *hash_name* is used, e.g. 64 for " +"SHA-512." +msgstr "" + +msgid "Function only available when Python is compiled with OpenSSL." +msgstr "" + +msgid "" +"Function now only available when Python is built with OpenSSL. The slow pure " +"Python implementation has been removed." +msgstr "" + +msgid "" +"The function provides scrypt password-based key derivation function as " +"defined in :rfc:`7914`." +msgstr "" +"Функція забезпечує функцію виведення ключа на основі пароля scrypt, як " +"визначено в :rfc:`7914`." + +msgid "" +"*password* and *salt* must be :term:`bytes-like objects `. Applications and libraries should limit *password* to a sensible " +"length (e.g. 1024). *salt* should be about 16 or more bytes from a proper " +"source, e.g. :func:`os.urandom`." +msgstr "" +"*пароль* і *соль* мають бути :term:`байтоподібними об’єктами `. Програми та бібліотеки повинні обмежувати *пароль* розумною " +"довжиною (наприклад, 1024). *salt* має бути приблизно 16 або більше байтів " +"із належного джерела, напр. :func:`os.urandom`." + +msgid "" +"*n* is the CPU/Memory cost factor, *r* the block size, *p* parallelization " +"factor and *maxmem* limits memory (OpenSSL 1.1.0 defaults to 32 MiB). " +"*dklen* is the length of the derived key in bytes." +msgstr "" + +msgid "BLAKE2" +msgstr "БЛЕЙК2" + +msgid "" +"BLAKE2_ is a cryptographic hash function defined in :rfc:`7693` that comes " +"in two flavors:" +msgstr "" +"BLAKE2_ — це криптографічна хеш-функція, визначена в :rfc:`7693`, яка має " +"два варіанти:" + +msgid "" +"**BLAKE2b**, optimized for 64-bit platforms and produces digests of any size " +"between 1 and 64 bytes," +msgstr "" +"**BLAKE2b**, оптимізований для 64-розрядних платформ і створює дайджести " +"будь-якого розміру від 1 до 64 байтів," + +msgid "" +"**BLAKE2s**, optimized for 8- to 32-bit platforms and produces digests of " +"any size between 1 and 32 bytes." +msgstr "" +"**BLAKE2s**, оптимізований для платформ від 8 до 32 біт і створює дайджести " +"будь-якого розміру від 1 до 32 байтів." + +msgid "" +"BLAKE2 supports **keyed mode** (a faster and simpler replacement for HMAC_), " +"**salted hashing**, **personalization**, and **tree hashing**." +msgstr "" +"BLAKE2 підтримує **ключовий режим** (швидша та простіша заміна HMAC_), " +"**солі хешування**, **персоналізацію** та **хешування дерева**." + +msgid "" +"Hash objects from this module follow the API of standard library's :mod:" +"`hashlib` objects." +msgstr "" +"Хеш-об’єкти з цього модуля відповідають API об’єктів :mod:`hashlib` " +"стандартної бібліотеки." + +msgid "Creating hash objects" +msgstr "Створення хеш-об'єктів" + +msgid "New hash objects are created by calling constructor functions:" +msgstr "Нові хеш-об’єкти створюються шляхом виклику функцій конструктора:" + +msgid "" +"These functions return the corresponding hash objects for calculating " +"BLAKE2b or BLAKE2s. They optionally take these general parameters:" +msgstr "" +"Ці функції повертають відповідні хеш-об’єкти для обчислення BLAKE2b або " +"BLAKE2s. Вони необов'язково приймають такі загальні параметри:" + +msgid "" +"*data*: initial chunk of data to hash, which must be :term:`bytes-like " +"object`. It can be passed only as positional argument." +msgstr "" +"*data*: початкова частина даних для хешування, яка має бути :term:`bytes-" +"like object`. Його можна передати лише як позиційний аргумент." + +msgid "*digest_size*: size of output digest in bytes." +msgstr "*digest_size*: розмір вихідного дайджесту в байтах." + +msgid "" +"*key*: key for keyed hashing (up to 64 bytes for BLAKE2b, up to 32 bytes for " +"BLAKE2s)." +msgstr "" +"*key*: ключ для хешування з ключем (до 64 байтів для BLAKE2b, до 32 байтів " +"для BLAKE2s)." + +msgid "" +"*salt*: salt for randomized hashing (up to 16 bytes for BLAKE2b, up to 8 " +"bytes for BLAKE2s)." +msgstr "" +"*salt*: сіль для рандомізованого хешування (до 16 байт для BLAKE2b, до 8 " +"байт для BLAKE2s)." + +msgid "" +"*person*: personalization string (up to 16 bytes for BLAKE2b, up to 8 bytes " +"for BLAKE2s)." +msgstr "" +"*особа*: рядок персоналізації (до 16 байт для BLAKE2b, до 8 байт для " +"BLAKE2s)." + +msgid "The following table shows limits for general parameters (in bytes):" +msgstr "" +"У наступній таблиці показано обмеження для загальних параметрів (у байтах):" + +msgid "Hash" +msgstr "Хеш" + +msgid "digest_size" +msgstr "digest_size" + +msgid "len(key)" +msgstr "len (ключ)" + +msgid "len(salt)" +msgstr "лен (сіль)" + +msgid "len(person)" +msgstr "len (особа)" + +msgid "BLAKE2b" +msgstr "BLAKE2b" + +msgid "64" +msgstr "64" + +msgid "16" +msgstr "16" + +msgid "BLAKE2s" +msgstr "BLAKE2s" + +msgid "32" +msgstr "32" + +msgid "8" +msgstr "8" + +msgid "" +"BLAKE2 specification defines constant lengths for salt and personalization " +"parameters, however, for convenience, this implementation accepts byte " +"strings of any size up to the specified length. If the length of the " +"parameter is less than specified, it is padded with zeros, thus, for " +"example, ``b'salt'`` and ``b'salt\\x00'`` is the same value. (This is not " +"the case for *key*.)" +msgstr "" +"Специфікація BLAKE2 визначає постійну довжину параметрів солі та " +"персоналізації, однак для зручності ця реалізація приймає рядки байтів будь-" +"якого розміру до вказаної довжини. Якщо довжина параметра менша за вказану, " +"вона доповнюється нулями, таким чином, наприклад, ``b'salt`` і " +"``b'salt\\x00`` є однаковими значеннями. (Це не стосується *ключа*.)" + +msgid "These sizes are available as module `constants`_ described below." +msgstr "Ці розміри доступні як `constants`_ модуля, описані нижче." + +msgid "" +"Constructor functions also accept the following tree hashing parameters:" +msgstr "Функції конструктора також приймають такі параметри хешування дерева:" + +msgid "*fanout*: fanout (0 to 255, 0 if unlimited, 1 in sequential mode)." +msgstr "" +"*fanout*: розхід (від 0 до 255, 0, якщо необмежений, 1 у послідовному " +"режимі)." + +msgid "" +"*depth*: maximal depth of tree (1 to 255, 255 if unlimited, 1 in sequential " +"mode)." +msgstr "" +"*depth*: максимальна глибина дерева (від 1 до 255, 255, якщо необмежено, 1 у " +"послідовному режимі)." + +msgid "" +"*leaf_size*: maximal byte length of leaf (0 to ``2**32-1``, 0 if unlimited " +"or in sequential mode)." +msgstr "" +"*leaf_size*: максимальна довжина листа в байтах (від 0 до ``2**32-1``, 0, " +"якщо необмежений або в послідовному режимі)." + +msgid "" +"*node_offset*: node offset (0 to ``2**64-1`` for BLAKE2b, 0 to ``2**48-1`` " +"for BLAKE2s, 0 for the first, leftmost, leaf, or in sequential mode)." +msgstr "" +"*node_offset*: зміщення вузла (від 0 до ``2**64-1`` для BLAKE2b, від 0 до " +"``2**48-1`` для BLAKE2s, 0 для першого, крайнього лівого листа, або в " +"послідовному режимі )." + +msgid "" +"*node_depth*: node depth (0 to 255, 0 for leaves, or in sequential mode)." +msgstr "" +"*node_depth*: глибина вузла (від 0 до 255, 0 для листів або в послідовному " +"режимі)." + +msgid "" +"*inner_size*: inner digest size (0 to 64 for BLAKE2b, 0 to 32 for BLAKE2s, 0 " +"in sequential mode)." +msgstr "" +"*inner_size*: розмір внутрішнього дайджесту (від 0 до 64 для BLAKE2b, від 0 " +"до 32 для BLAKE2s, 0 у послідовному режимі)." + +msgid "" +"*last_node*: boolean indicating whether the processed node is the last one " +"(``False`` for sequential mode)." +msgstr "" + +msgid "Explanation of tree mode parameters." +msgstr "" + +msgid "" +"See section 2.10 in `BLAKE2 specification `_ for comprehensive review of tree hashing." +msgstr "" + +msgid "Constants" +msgstr "Константи" + +msgid "Salt length (maximum length accepted by constructors)." +msgstr "Довжина солі (максимальна довжина, прийнята конструкторами)." + +msgid "" +"Personalization string length (maximum length accepted by constructors)." +msgstr "" +"Довжина рядка персоналізації (максимальна довжина, прийнята конструкторами)." + +msgid "Maximum key size." +msgstr "Максимальний розмір ключа." + +msgid "Maximum digest size that the hash function can output." +msgstr "Максимальний розмір дайджесту, який може вивести хеш-функція." + +msgid "Examples" +msgstr "Приклади" + +msgid "Simple hashing" +msgstr "Просте хешування" + +msgid "" +"To calculate hash of some data, you should first construct a hash object by " +"calling the appropriate constructor function (:func:`blake2b` or :func:" +"`blake2s`), then update it with the data by calling :meth:`~hash.update` on " +"the object, and, finally, get the digest out of the object by calling :meth:" +"`~hash.digest` (or :meth:`~hash.hexdigest` for hex-encoded string)." +msgstr "" + +msgid "" +"As a shortcut, you can pass the first chunk of data to update directly to " +"the constructor as the positional argument:" +msgstr "" +"Як ярлик, ви можете передати перший фрагмент даних для оновлення " +"безпосередньо в конструктор як позиційний аргумент:" + +msgid "" +"You can call :meth:`hash.update` as many times as you need to iteratively " +"update the hash:" +msgstr "" +"Ви можете викликати :meth:`hash.update` стільки разів, скільки потрібно для " +"повторного оновлення хешу:" + +msgid "Using different digest sizes" +msgstr "Використання різних розмірів дайджесту" + +msgid "" +"BLAKE2 has configurable size of digests up to 64 bytes for BLAKE2b and up to " +"32 bytes for BLAKE2s. For example, to replace SHA-1 with BLAKE2b without " +"changing the size of output, we can tell BLAKE2b to produce 20-byte digests:" +msgstr "" +"BLAKE2 має настроюваний розмір дайджестів до 64 байтів для BLAKE2b і до 32 " +"байтів для BLAKE2s. Наприклад, щоб замінити SHA-1 на BLAKE2b без зміни " +"розміру виведення, ми можемо наказати BLAKE2b створювати 20-байтові " +"дайджести:" + +msgid "" +"Hash objects with different digest sizes have completely different outputs " +"(shorter hashes are *not* prefixes of longer hashes); BLAKE2b and BLAKE2s " +"produce different outputs even if the output length is the same:" +msgstr "" +"Хеш-об’єкти з різними розмірами дайджестів мають абсолютно різні результати " +"(коротші хеші *не* є префіксами більш довгих хешів); BLAKE2b і BLAKE2s " +"створюють різні результати, навіть якщо довжина виводу однакова:" + +msgid "Keyed hashing" +msgstr "Ключове хешування" + +msgid "" +"Keyed hashing can be used for authentication as a faster and simpler " +"replacement for `Hash-based message authentication code `_ (HMAC). BLAKE2 can be securely used in prefix-MAC " +"mode thanks to the indifferentiability property inherited from BLAKE." +msgstr "" +"Хешування з ключем можна використовувати для автентифікації як швидшу та " +"простішу заміну `коду автентифікації повідомлення на основі хешу `_ (HMAC). BLAKE2 можна безпечно використовувати в " +"режимі prefix-MAC завдяки властивості індиференційованості, успадкованій від " +"BLAKE." + +msgid "" +"This example shows how to get a (hex-encoded) 128-bit authentication code " +"for message ``b'message data'`` with key ``b'pseudorandom key'``::" +msgstr "" +"У цьому прикладі показано, як отримати (в шістнадцятковому кодуванні) 128-" +"бітний код автентифікації для повідомлення ``b'message data`` з ключем " +"``b'pseudorandom key``::" + +msgid "" +">>> from hashlib import blake2b\n" +">>> h = blake2b(key=b'pseudorandom key', digest_size=16)\n" +">>> h.update(b'message data')\n" +">>> h.hexdigest()\n" +"'3d363ff7401e02026f4a4687d4863ced'" +msgstr "" + +msgid "" +"As a practical example, a web application can symmetrically sign cookies " +"sent to users and later verify them to make sure they weren't tampered with::" +msgstr "" +"Як практичний приклад, веб-додаток може симетрично підписувати файли cookie, " +"надіслані користувачам, а потім перевіряти їх, щоб переконатися, що вони не " +"були змінені:" + +msgid "" +">>> from hashlib import blake2b\n" +">>> from hmac import compare_digest\n" +">>>\n" +">>> SECRET_KEY = b'pseudorandomly generated server secret key'\n" +">>> AUTH_SIZE = 16\n" +">>>\n" +">>> def sign(cookie):\n" +"... h = blake2b(digest_size=AUTH_SIZE, key=SECRET_KEY)\n" +"... h.update(cookie)\n" +"... return h.hexdigest().encode('utf-8')\n" +">>>\n" +">>> def verify(cookie, sig):\n" +"... good_sig = sign(cookie)\n" +"... return compare_digest(good_sig, sig)\n" +">>>\n" +">>> cookie = b'user-alice'\n" +">>> sig = sign(cookie)\n" +">>> print(\"{0},{1}\".format(cookie.decode('utf-8'), sig))\n" +"user-alice,b'43b3c982cf697e0c5ab22172d1ca7421'\n" +">>> verify(cookie, sig)\n" +"True\n" +">>> verify(b'user-bob', sig)\n" +"False\n" +">>> verify(cookie, b'0102030405060708090a0b0c0d0e0f00')\n" +"False" +msgstr "" + +msgid "" +"Even though there's a native keyed hashing mode, BLAKE2 can, of course, be " +"used in HMAC construction with :mod:`hmac` module::" +msgstr "" +"Незважаючи на те, що існує режим хешування з рідним ключем, BLAKE2, " +"звичайно, можна використовувати в конструкції HMAC за допомогою модуля :mod:" +"`hmac`::" + +msgid "" +">>> import hmac, hashlib\n" +">>> m = hmac.new(b'secret key', digestmod=hashlib.blake2s)\n" +">>> m.update(b'message')\n" +">>> m.hexdigest()\n" +"'e3c8102868d28b5ff85fc35dda07329970d1a01e273c37481326fe0c861c8142'" +msgstr "" + +msgid "Randomized hashing" +msgstr "Рандомізоване хешування" + +msgid "" +"By setting *salt* parameter users can introduce randomization to the hash " +"function. Randomized hashing is useful for protecting against collision " +"attacks on the hash function used in digital signatures." +msgstr "" +"Установивши параметр *salt*, користувачі можуть запровадити рандомізацію хеш-" +"функції. Рандомізоване хешування корисне для захисту від колізійних атак на " +"хеш-функцію, яка використовується в цифрових підписах." + +msgid "" +"Randomized hashing is designed for situations where one party, the message " +"preparer, generates all or part of a message to be signed by a second party, " +"the message signer. If the message preparer is able to find cryptographic " +"hash function collisions (i.e., two messages producing the same hash value), " +"then they might prepare meaningful versions of the message that would " +"produce the same hash value and digital signature, but with different " +"results (e.g., transferring $1,000,000 to an account, rather than $10). " +"Cryptographic hash functions have been designed with collision resistance as " +"a major goal, but the current concentration on attacking cryptographic hash " +"functions may result in a given cryptographic hash function providing less " +"collision resistance than expected. Randomized hashing offers the signer " +"additional protection by reducing the likelihood that a preparer can " +"generate two or more messages that ultimately yield the same hash value " +"during the digital signature generation process --- even if it is practical " +"to find collisions for the hash function. However, the use of randomized " +"hashing may reduce the amount of security provided by a digital signature " +"when all portions of the message are prepared by the signer." +msgstr "" +"Рандомізоване хешування призначене для ситуацій, коли одна сторона, яка " +"готує повідомлення, створює все або частину повідомлення для підпису другою " +"стороною, особою, яка підписує повідомлення. Якщо готувач повідомлення може " +"знайти колізії криптографічної хеш-функції (тобто два повідомлення, що " +"створюють однакове хеш-значення), тоді він може підготувати значущі версії " +"повідомлення, які створять те саме хеш-значення та цифровий підпис, але з " +"різними результатами (наприклад, , переказуючи на рахунок 1 000 000 доларів " +"США, а не 10 доларів США). Основною метою криптографічних хеш-функцій було " +"розроблено стійкість до зіткнень, але поточна концентрація на атакуючих " +"криптографічних хеш-функціях може призвести до того, що дана криптографічна " +"хеш-функція забезпечить меншу стійкість до зіткнень, ніж очікувалося. " +"Рандомізоване хешування пропонує підписувачу додатковий захист, зменшуючи " +"ймовірність того, що підготовник зможе згенерувати два або більше " +"повідомлень, які в кінцевому підсумку дають однакове хеш-значення під час " +"процесу генерації цифрового підпису --- навіть якщо практично знайти колізії " +"для хеш-функції. Однак використання рандомізованого хешування може знизити " +"рівень безпеки, який забезпечує цифровий підпис, коли всі частини " +"повідомлення готуються підписувачем." + +msgid "" +"(`NIST SP-800-106 \"Randomized Hashing for Digital Signatures\" `_)" +msgstr "" + +msgid "" +"In BLAKE2 the salt is processed as a one-time input to the hash function " +"during initialization, rather than as an input to each compression function." +msgstr "" +"У BLAKE2 сіль обробляється як одноразовий вхід до хеш-функції під час " +"ініціалізації, а не як вхід для кожної функції стиснення." + +msgid "" +"*Salted hashing* (or just hashing) with BLAKE2 or any other general-purpose " +"cryptographic hash function, such as SHA-256, is not suitable for hashing " +"passwords. See `BLAKE2 FAQ `_ for more " +"information." +msgstr "" + +msgid "Personalization" +msgstr "Персоналізація" + +msgid "" +"Sometimes it is useful to force hash function to produce different digests " +"for the same input for different purposes. Quoting the authors of the Skein " +"hash function:" +msgstr "" +"Іноді корисно змусити хеш-функцію виробляти різні дайджести для одного " +"введення для різних цілей. Цитую авторів хеш-функції Skein:" + +msgid "" +"We recommend that all application designers seriously consider doing this; " +"we have seen many protocols where a hash that is computed in one part of the " +"protocol can be used in an entirely different part because two hash " +"computations were done on similar or related data, and the attacker can " +"force the application to make the hash inputs the same. Personalizing each " +"hash function used in the protocol summarily stops this type of attack." +msgstr "" +"Ми рекомендуємо всім розробникам додатків серйозно подумати про це; ми " +"бачили багато протоколів, де хеш, який обчислюється в одній частині " +"протоколу, може використовуватися в зовсім іншій частині, оскільки два хеш-" +"обчислення були виконані на подібних або пов’язаних даних, і зловмисник може " +"змусити програму зробити вхідні дані хешу те саме. Персоналізація кожної хеш-" +"функції, яка використовується в протоколі, швидко зупиняє цей тип атаки." + +msgid "" +"(`The Skein Hash Function Family `_, p. 21)" +msgstr "" + +msgid "BLAKE2 can be personalized by passing bytes to the *person* argument::" +msgstr "BLAKE2 можна персоналізувати, передаючи байти в аргумент *person*::" + +msgid "" +">>> from hashlib import blake2b\n" +">>> FILES_HASH_PERSON = b'MyApp Files Hash'\n" +">>> BLOCK_HASH_PERSON = b'MyApp Block Hash'\n" +">>> h = blake2b(digest_size=32, person=FILES_HASH_PERSON)\n" +">>> h.update(b'the same content')\n" +">>> h.hexdigest()\n" +"'20d9cd024d4fb086aae819a1432dd2466de12947831b75c5a30cf2676095d3b4'\n" +">>> h = blake2b(digest_size=32, person=BLOCK_HASH_PERSON)\n" +">>> h.update(b'the same content')\n" +">>> h.hexdigest()\n" +"'cf68fb5761b9c44e7878bfb2c4c9aea52264a80b75005e65619778de59f383a3'" +msgstr "" + +msgid "" +"Personalization together with the keyed mode can also be used to derive " +"different keys from a single one." +msgstr "" +"Персоналізацію разом із режимом ключа також можна використовувати для " +"отримання різних ключів з одного." + +msgid "Tree mode" +msgstr "Режим дерева" + +msgid "Here's an example of hashing a minimal tree with two leaf nodes::" +msgstr "Ось приклад хешування мінімального дерева з двома листовими вузлами:" + +msgid "" +" 10\n" +" / \\\n" +"00 01" +msgstr "" + +msgid "" +"This example uses 64-byte internal digests, and returns the 32-byte final " +"digest::" +msgstr "" +"У цьому прикладі використовуються 64-байтові внутрішні дайджести та " +"повертається 32-байтовий остаточний дайджест:" + +msgid "" +">>> from hashlib import blake2b\n" +">>>\n" +">>> FANOUT = 2\n" +">>> DEPTH = 2\n" +">>> LEAF_SIZE = 4096\n" +">>> INNER_SIZE = 64\n" +">>>\n" +">>> buf = bytearray(6000)\n" +">>>\n" +">>> # Left leaf\n" +"... h00 = blake2b(buf[0:LEAF_SIZE], fanout=FANOUT, depth=DEPTH,\n" +"... leaf_size=LEAF_SIZE, inner_size=INNER_SIZE,\n" +"... node_offset=0, node_depth=0, last_node=False)\n" +">>> # Right leaf\n" +"... h01 = blake2b(buf[LEAF_SIZE:], fanout=FANOUT, depth=DEPTH,\n" +"... leaf_size=LEAF_SIZE, inner_size=INNER_SIZE,\n" +"... node_offset=1, node_depth=0, last_node=True)\n" +">>> # Root node\n" +"... h10 = blake2b(digest_size=32, fanout=FANOUT, depth=DEPTH,\n" +"... leaf_size=LEAF_SIZE, inner_size=INNER_SIZE,\n" +"... node_offset=0, node_depth=1, last_node=True)\n" +">>> h10.update(h00.digest())\n" +">>> h10.update(h01.digest())\n" +">>> h10.hexdigest()\n" +"'3ad2a9b37c6070e374c7a8c508fe20ca86b6ed54e286e93a0318e95e881db5aa'" +msgstr "" + +msgid "Credits" +msgstr "Кредити" + +msgid "" +"BLAKE2_ was designed by *Jean-Philippe Aumasson*, *Samuel Neves*, *Zooko " +"Wilcox-O'Hearn*, and *Christian Winnerlein* based on SHA-3_ finalist BLAKE_ " +"created by *Jean-Philippe Aumasson*, *Luca Henzen*, *Willi Meier*, and " +"*Raphael C.-W. Phan*." +msgstr "" +"BLAKE2_ був розроблений *Jean-Philippe Aumasson*, *Samuel Neves*, *Zooko " +"Wilcox-O'Hearn* і *Christian Winnerlein* на основі фіналіста SHA-3_ BLAKE_, " +"створеного *Jean-Philippe Aumasson*, *Luca Henzen*, *Willi Meier* і*Raphael " +"C.-W. Phan*." + +msgid "" +"It uses core algorithm from ChaCha_ cipher designed by *Daniel J. " +"Bernstein*." +msgstr "" +"Він використовує основний алгоритм із шифру ChaCha_, розробленого *Daniel J. " +"Bernstein*." + +msgid "" +"The stdlib implementation is based on pyblake2_ module. It was written by " +"*Dmitry Chestnykh* based on C implementation written by *Samuel Neves*. The " +"documentation was copied from pyblake2_ and written by *Dmitry Chestnykh*." +msgstr "" +"Реалізація stdlib базується на модулі pyblake2_. Його написав *Dmitry " +"Chestnykh* на основі реалізації C, написаної *Samuel Neves*. Документація " +"була скопійована з pyblake2_ і написана *Дмитром Честних*." + +msgid "The C code was partly rewritten for Python by *Christian Heimes*." +msgstr "Код C був частково переписаний для Python *Christian Heimes*." + +msgid "" +"The following public domain dedication applies for both C hash function " +"implementation, extension code, and this documentation:" +msgstr "" +"Наведені нижче правила загальнодоступного домену застосовуються до " +"реалізації хеш-функції C, коду розширення та цієї документації:" + +msgid "" +"To the extent possible under law, the author(s) have dedicated all copyright " +"and related and neighboring rights to this software to the public domain " +"worldwide. This software is distributed without any warranty." +msgstr "" +"Наскільки це можливо згідно із законодавством, автор(и) передали всі " +"авторські права, суміжні та суміжні права на це програмне забезпечення у " +"суспільне надбання в усьому світі. Це програмне забезпечення " +"розповсюджується без будь-яких гарантій." + +msgid "" +"You should have received a copy of the CC0 Public Domain Dedication along " +"with this software. If not, see https://creativecommons.org/publicdomain/" +"zero/1.0/." +msgstr "" +"Ви повинні були отримати копію CC0 Public Domain Dedication разом із цим " +"програмним забезпеченням. Якщо ні, перегляньте https://creativecommons.org/" +"publicdomain/zero/1.0/." + +msgid "" +"The following people have helped with development or contributed their " +"changes to the project and the public domain according to the Creative " +"Commons Public Domain Dedication 1.0 Universal:" +msgstr "" +"Наступні люди допомогли з розробкою або внесли свої зміни до проекту та " +"суспільного надбання відповідно до Creative Commons Public Domain Dedication " +"1.0 Universal:" + +msgid "*Alexandr Sokolovskiy*" +msgstr "*Олександр Соколовський*" + +msgid "Module :mod:`hmac`" +msgstr "Модуль :mod:`hmac`" + +msgid "A module to generate message authentication codes using hashes." +msgstr "" +"Модуль для створення кодів автентифікації повідомлень за допомогою хешів." + +msgid "Module :mod:`base64`" +msgstr "Модуль :mod:`base64`" + +msgid "Another way to encode binary hashes for non-binary environments." +msgstr "Інший спосіб кодування двійкових хешів для небінарних середовищ." + +msgid "https://nvlpubs.nist.gov/nistpubs/fips/nist.fips.180-4.pdf" +msgstr "" + +msgid "The FIPS 180-4 publication on Secure Hash Algorithms." +msgstr "" + +msgid "https://csrc.nist.gov/pubs/fips/202/final" +msgstr "" + +msgid "The FIPS 202 publication on the SHA-3 Standard." +msgstr "" + +msgid "https://www.blake2.net/" +msgstr "" + +msgid "Official BLAKE2 website." +msgstr "Офіційний сайт BLAKE2." + +msgid "https://en.wikipedia.org/wiki/Cryptographic_hash_function" +msgstr "" + +msgid "" +"Wikipedia article with information on which algorithms have known issues and " +"what that means regarding their use." +msgstr "" +"Стаття у Вікіпедії з інформацією про те, які алгоритми мають відомі проблеми " +"та що це означає щодо їх використання." + +msgid "https://www.ietf.org/rfc/rfc8018.txt" +msgstr "https://www.ietf.org/rfc/rfc8018.txt" + +msgid "PKCS #5: Password-Based Cryptography Specification Version 2.1" +msgstr "PKCS #5: Специфікація криптографії на основі пароля, версія 2.1" + +msgid "" +"https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf" +msgstr "" +"https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf" + +msgid "NIST Recommendation for Password-Based Key Derivation." +msgstr "Рекомендації NIST щодо виведення ключів на основі пароля." + +msgid "message digest, MD5" +msgstr "" + +msgid "" +"secure hash algorithm, SHA1, SHA2, SHA224, SHA256, SHA384, SHA512, SHA3, " +"Shake, Blake2" +msgstr "" + +msgid "OpenSSL" +msgstr "OpenSSL" + +msgid "(use in module hashlib)" +msgstr "" + +msgid "blake2b, blake2s" +msgstr "" diff --git a/library/heapq.po b/library/heapq.po new file mode 100644 index 000000000..313ebe66e --- /dev/null +++ b/library/heapq.po @@ -0,0 +1,572 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 01:07+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!heapq` --- Heap queue algorithm" +msgstr "" + +msgid "**Source code:** :source:`Lib/heapq.py`" +msgstr "**Вихідний код:** :source:`Lib/heapq.py`" + +msgid "" +"This module provides an implementation of the heap queue algorithm, also " +"known as the priority queue algorithm." +msgstr "" +"Цей модуль забезпечує реалізацію алгоритму черги купи, також відомого як " +"алгоритм пріоритетної черги." + +msgid "" +"Heaps are binary trees for which every parent node has a value less than or " +"equal to any of its children. We refer to this condition as the heap " +"invariant." +msgstr "" + +msgid "" +"This implementation uses arrays for which ``heap[k] <= heap[2*k+1]`` and " +"``heap[k] <= heap[2*k+2]`` for all *k*, counting elements from zero. For " +"the sake of comparison, non-existing elements are considered to be " +"infinite. The interesting property of a heap is that its smallest element " +"is always the root, ``heap[0]``." +msgstr "" + +msgid "" +"The API below differs from textbook heap algorithms in two aspects: (a) We " +"use zero-based indexing. This makes the relationship between the index for " +"a node and the indexes for its children slightly less obvious, but is more " +"suitable since Python uses zero-based indexing. (b) Our pop method returns " +"the smallest item, not the largest (called a \"min heap\" in textbooks; a " +"\"max heap\" is more common in texts because of its suitability for in-place " +"sorting)." +msgstr "" +"Наведений нижче API відрізняється від алгоритмів купи підручників двома " +"аспектами: (a) ми використовуємо індексування на основі нуля. Це робить " +"зв’язок між індексом для вузла та індексами для його дочірніх елементів дещо " +"менш очевидним, але є більш придатним, оскільки Python використовує " +"індексування від нуля. (b) Наш метод pop повертає найменший елемент, а не " +"найбільший (у підручниках називається \"мінімальна купа\"; \"максимальна " +"купа\" більш поширена в текстах через її придатність для сортування на " +"місці)." + +msgid "" +"These two make it possible to view the heap as a regular Python list without " +"surprises: ``heap[0]`` is the smallest item, and ``heap.sort()`` maintains " +"the heap invariant!" +msgstr "" +"Ці два параметри дають змогу переглядати купу як звичайний список Python без " +"сюрпризів: ``heap[0]`` є найменшим елементом, а ``heap.sort()`` підтримує " +"незмінність купи!" + +msgid "" +"To create a heap, use a list initialized to ``[]``, or you can transform a " +"populated list into a heap via function :func:`heapify`." +msgstr "" +"Щоб створити купу, використовуйте список, ініціалізований ``[]``, або ви " +"можете перетворити заповнений список на купу за допомогою функції :func:" +"`heapify`." + +msgid "The following functions are provided:" +msgstr "Передбачені такі функції:" + +msgid "Push the value *item* onto the *heap*, maintaining the heap invariant." +msgstr "Перемістіть значення *item* у *купу*, зберігаючи незмінність купи." + +msgid "" +"Pop and return the smallest item from the *heap*, maintaining the heap " +"invariant. If the heap is empty, :exc:`IndexError` is raised. To access " +"the smallest item without popping it, use ``heap[0]``." +msgstr "" +"Витягніть і поверніть найменший елемент із *купи*, зберігаючи незмінність " +"купи. Якщо купа порожня, виникає :exc:`IndexError`. Щоб отримати доступ до " +"найменшого елемента, не відкриваючи його, використовуйте ``heap[0]``." + +msgid "" +"Push *item* on the heap, then pop and return the smallest item from the " +"*heap*. The combined action runs more efficiently than :func:`heappush` " +"followed by a separate call to :func:`heappop`." +msgstr "" +"Натисніть *item* на купу, а потім витягніть і поверніть найменший елемент із " +"*купи*. Комбінована дія працює ефективніше, ніж :func:`heappush`, після " +"якого слід окремий виклик :func:`heappop`." + +msgid "Transform list *x* into a heap, in-place, in linear time." +msgstr "Перетворення списку *x* на купу, на місці, за лінійний час." + +msgid "" +"Pop and return the smallest item from the *heap*, and also push the new " +"*item*. The heap size doesn't change. If the heap is empty, :exc:" +"`IndexError` is raised." +msgstr "" +"Витягніть і поверніть найменший предмет із *купи*, а також натисніть новий " +"*предмет*. Розмір купи не змінюється. Якщо купа порожня, виникає :exc:" +"`IndexError`." + +msgid "" +"This one step operation is more efficient than a :func:`heappop` followed " +"by :func:`heappush` and can be more appropriate when using a fixed-size " +"heap. The pop/push combination always returns an element from the heap and " +"replaces it with *item*." +msgstr "" +"Ця одноетапна операція є ефективнішою, ніж :func:`heappop`, за якою слідує :" +"func:`heappush`, і може бути більш доцільною, якщо використовується купа " +"фіксованого розміру. Комбінація pop/push завжди повертає елемент із купи та " +"замінює його на *item*." + +msgid "" +"The value returned may be larger than the *item* added. If that isn't " +"desired, consider using :func:`heappushpop` instead. Its push/pop " +"combination returns the smaller of the two values, leaving the larger value " +"on the heap." +msgstr "" +"Повернене значення може бути більшим за доданий *елемент*. Якщо це небажано, " +"подумайте про використання замість цього :func:`heappushpop`. Його " +"комбінація push/pop повертає менше з двох значень, залишаючи більше значення " +"в купі." + +msgid "The module also offers three general purpose functions based on heaps." +msgstr "" +"Модуль також пропонує три функції загального призначення, засновані на купах." + +msgid "" +"Merge multiple sorted inputs into a single sorted output (for example, merge " +"timestamped entries from multiple log files). Returns an :term:`iterator` " +"over the sorted values." +msgstr "" +"Об’єднайте кілька відсортованих вхідних даних в один відсортований вихід " +"(наприклад, об’єднайте записи з мітками часу з кількох файлів журналу). " +"Повертає :term:`iterator` над відсортованими значеннями." + +msgid "" +"Similar to ``sorted(itertools.chain(*iterables))`` but returns an iterable, " +"does not pull the data into memory all at once, and assumes that each of the " +"input streams is already sorted (smallest to largest)." +msgstr "" +"Подібно до ``sorted(itertools.chain(*iterables))``, але повертає iterable, " +"не затягує дані в пам’ять усі одночасно та передбачає, що кожен із вхідних " +"потоків уже відсортовано (від найменшого до найбільшого)." + +msgid "" +"Has two optional arguments which must be specified as keyword arguments." +msgstr "" +"Має два необов’язкові аргументи, які необхідно вказати як аргументи " +"ключового слова." + +msgid "" +"*key* specifies a :term:`key function` of one argument that is used to " +"extract a comparison key from each input element. The default value is " +"``None`` (compare the elements directly)." +msgstr "" +"*key* визначає :term:`key function` одного аргументу, який використовується " +"для отримання ключа порівняння з кожного вхідного елемента. Значення за " +"замовчуванням – ``None`` (пряме порівняння елементів)." + +msgid "" +"*reverse* is a boolean value. If set to ``True``, then the input elements " +"are merged as if each comparison were reversed. To achieve behavior similar " +"to ``sorted(itertools.chain(*iterables), reverse=True)``, all iterables must " +"be sorted from largest to smallest." +msgstr "" +"*reverse* — це логічне значення. Якщо встановлено значення ``True``, то " +"вхідні елементи об’єднуються так, ніби кожне порівняння було зворотним. Щоб " +"досягти поведінки, подібної до ``sorted(itertools.chain(*iterables), " +"reverse=True)``, усі ітератори мають бути відсортовані від найбільшого до " +"найменшого." + +msgid "Added the optional *key* and *reverse* parameters." +msgstr "Додано додаткові параметри *key* і *reverse*." + +msgid "" +"Return a list with the *n* largest elements from the dataset defined by " +"*iterable*. *key*, if provided, specifies a function of one argument that " +"is used to extract a comparison key from each element in *iterable* (for " +"example, ``key=str.lower``). Equivalent to: ``sorted(iterable, key=key, " +"reverse=True)[:n]``." +msgstr "" +"Повертає список із *n* найбільшими елементами з набору даних, визначеного " +"*iterable*. *key*, якщо надається, визначає функцію одного аргументу, який " +"використовується для отримання ключа порівняння з кожного елемента в " +"*iterable* (наприклад, ``key=str.lower``). Еквівалент: ``sorted(iterable, " +"key=key, reverse=True)[:n]``." + +msgid "" +"Return a list with the *n* smallest elements from the dataset defined by " +"*iterable*. *key*, if provided, specifies a function of one argument that " +"is used to extract a comparison key from each element in *iterable* (for " +"example, ``key=str.lower``). Equivalent to: ``sorted(iterable, key=key)[:" +"n]``." +msgstr "" +"Повертає список із *n* найменшими елементами з набору даних, визначеного " +"*iterable*. *key*, якщо надається, визначає функцію одного аргументу, який " +"використовується для отримання ключа порівняння з кожного елемента в " +"*iterable* (наприклад, ``key=str.lower``). Еквівалент: ``sorted(iterable, " +"key=key)[:n]``." + +msgid "" +"The latter two functions perform best for smaller values of *n*. For larger " +"values, it is more efficient to use the :func:`sorted` function. Also, when " +"``n==1``, it is more efficient to use the built-in :func:`min` and :func:" +"`max` functions. If repeated usage of these functions is required, consider " +"turning the iterable into an actual heap." +msgstr "" +"Дві останні функції працюють найкраще для менших значень *n*. Для більших " +"значень ефективніше використовувати функцію :func:`sorted`. Крім того, коли " +"``n==1``, ефективніше використовувати вбудовані функції :func:`min` і :func:" +"`max`. Якщо потрібне повторне використання цих функцій, подумайте про те, " +"щоб перетворити iterable на справжню купу." + +msgid "Basic Examples" +msgstr "Основні приклади" + +msgid "" +"A `heapsort `_ can be implemented by " +"pushing all values onto a heap and then popping off the smallest values one " +"at a time::" +msgstr "" +"`heapsort `_ може бути реалізовано " +"шляхом переміщення всіх значень у купу, а потім вилучення найменших значень " +"по одному:" + +msgid "" +">>> def heapsort(iterable):\n" +"... h = []\n" +"... for value in iterable:\n" +"... heappush(h, value)\n" +"... return [heappop(h) for i in range(len(h))]\n" +"...\n" +">>> heapsort([1, 3, 5, 7, 9, 2, 4, 6, 8, 0])\n" +"[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]" +msgstr "" + +msgid "" +"This is similar to ``sorted(iterable)``, but unlike :func:`sorted`, this " +"implementation is not stable." +msgstr "" +"Це схоже на ``sorted(iterable)``, але на відміну від :func:`sorted`, ця " +"реалізація не є стабільною." + +msgid "" +"Heap elements can be tuples. This is useful for assigning comparison values " +"(such as task priorities) alongside the main record being tracked::" +msgstr "" +"Елементи купи можуть бути кортежами. Це корисно для призначення порівняльних " +"значень (наприклад, пріоритетів завдань) поряд із основним записом, який " +"відстежується:" + +msgid "" +">>> h = []\n" +">>> heappush(h, (5, 'write code'))\n" +">>> heappush(h, (7, 'release product'))\n" +">>> heappush(h, (1, 'write spec'))\n" +">>> heappush(h, (3, 'create tests'))\n" +">>> heappop(h)\n" +"(1, 'write spec')" +msgstr "" + +msgid "Priority Queue Implementation Notes" +msgstr "Примітки щодо реалізації пріоритетної черги" + +msgid "" +"A `priority queue `_ is common " +"use for a heap, and it presents several implementation challenges:" +msgstr "" +"`Пріоритетна черга `_ зазвичай " +"використовується для купи, і це створює кілька проблем реалізації:" + +msgid "" +"Sort stability: how do you get two tasks with equal priorities to be " +"returned in the order they were originally added?" +msgstr "" +"Стабільність сортування: як повернути два завдання з однаковими пріоритетами " +"в тому порядку, в якому вони були спочатку додані?" + +msgid "" +"Tuple comparison breaks for (priority, task) pairs if the priorities are " +"equal and the tasks do not have a default comparison order." +msgstr "" +"Порівняння кортежу розривається для пар (пріоритет, завдання), якщо " +"пріоритети рівні, а завдання не мають порядку порівняння за замовчуванням." + +msgid "" +"If the priority of a task changes, how do you move it to a new position in " +"the heap?" +msgstr "" +"Якщо пріоритет завдання змінюється, як перемістити його на нове місце в купі?" + +msgid "" +"Or if a pending task needs to be deleted, how do you find it and remove it " +"from the queue?" +msgstr "" +"Або якщо завдання, що очікує на виконання, потрібно видалити, як його знайти " +"та видалити з черги?" + +msgid "" +"A solution to the first two challenges is to store entries as 3-element list " +"including the priority, an entry count, and the task. The entry count " +"serves as a tie-breaker so that two tasks with the same priority are " +"returned in the order they were added. And since no two entry counts are the " +"same, the tuple comparison will never attempt to directly compare two tasks." +msgstr "" +"Рішенням перших двох проблем є збереження записів у вигляді списку з 3 " +"елементів, включаючи пріоритет, кількість записів і завдання. Підрахунок " +"записів служить вирішальним, щоб два завдання з однаковим пріоритетом " +"поверталися в порядку їх додавання. А оскільки немає двох однакових " +"підрахунків записів, порівняння кортежів ніколи не намагатиметься " +"безпосередньо порівняти два завдання." + +msgid "" +"Another solution to the problem of non-comparable tasks is to create a " +"wrapper class that ignores the task item and only compares the priority " +"field::" +msgstr "" +"Іншим вирішенням проблеми непорівнюваних завдань є створення класу-оболонки, " +"який ігнорує елемент завдання та порівнює лише поле пріоритету:" + +msgid "" +"from dataclasses import dataclass, field\n" +"from typing import Any\n" +"\n" +"@dataclass(order=True)\n" +"class PrioritizedItem:\n" +" priority: int\n" +" item: Any=field(compare=False)" +msgstr "" + +msgid "" +"The remaining challenges revolve around finding a pending task and making " +"changes to its priority or removing it entirely. Finding a task can be done " +"with a dictionary pointing to an entry in the queue." +msgstr "" +"Проблеми, що залишилися, пов’язані з пошуком незавершеного завдання та " +"внесенням змін до його пріоритету або його повним видаленням. Знайти " +"завдання можна за допомогою словника, який вказує на запис у черзі." + +msgid "" +"Removing the entry or changing its priority is more difficult because it " +"would break the heap structure invariants. So, a possible solution is to " +"mark the entry as removed and add a new entry with the revised priority::" +msgstr "" +"Видалити запис або змінити його пріоритет складніше, оскільки це порушить " +"інваріанти структури купи. Отже, можливим рішенням є позначення запису як " +"видаленого та додавання нового запису зі зміненим пріоритетом::" + +msgid "" +"pq = [] # list of entries arranged in a heap\n" +"entry_finder = {} # mapping of tasks to entries\n" +"REMOVED = '' # placeholder for a removed task\n" +"counter = itertools.count() # unique sequence count\n" +"\n" +"def add_task(task, priority=0):\n" +" 'Add a new task or update the priority of an existing task'\n" +" if task in entry_finder:\n" +" remove_task(task)\n" +" count = next(counter)\n" +" entry = [priority, count, task]\n" +" entry_finder[task] = entry\n" +" heappush(pq, entry)\n" +"\n" +"def remove_task(task):\n" +" 'Mark an existing task as REMOVED. Raise KeyError if not found.'\n" +" entry = entry_finder.pop(task)\n" +" entry[-1] = REMOVED\n" +"\n" +"def pop_task():\n" +" 'Remove and return the lowest priority task. Raise KeyError if empty.'\n" +" while pq:\n" +" priority, count, task = heappop(pq)\n" +" if task is not REMOVED:\n" +" del entry_finder[task]\n" +" return task\n" +" raise KeyError('pop from an empty priority queue')" +msgstr "" + +msgid "Theory" +msgstr "Теорія" + +msgid "" +"Heaps are arrays for which ``a[k] <= a[2*k+1]`` and ``a[k] <= a[2*k+2]`` for " +"all *k*, counting elements from 0. For the sake of comparison, non-existing " +"elements are considered to be infinite. The interesting property of a heap " +"is that ``a[0]`` is always its smallest element." +msgstr "" +"Купи — це масиви, для яких ``a[k] <= a[2*k+1]`` і ``a[k] <= a[2*k+2]`` для " +"всіх *k*, підрахунок елементів від 0. Для порівняння, неіснуючі елементи " +"вважаються нескінченними. Цікавою властивістю купи є те, що ``a[0]`` завжди " +"є її найменшим елементом." + +msgid "" +"The strange invariant above is meant to be an efficient memory " +"representation for a tournament. The numbers below are *k*, not ``a[k]``::" +msgstr "" +"Дивний інваріант вище призначений для ефективного представлення пам’яті для " +"турніру. Цифри нижче *k*, а не ``a[k]``::" + +msgid "" +" 0\n" +"\n" +" 1 2\n" +"\n" +" 3 4 5 6\n" +"\n" +" 7 8 9 10 11 12 13 14\n" +"\n" +"15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30" +msgstr "" + +msgid "" +"In the tree above, each cell *k* is topping ``2*k+1`` and ``2*k+2``. In a " +"usual binary tournament we see in sports, each cell is the winner over the " +"two cells it tops, and we can trace the winner down the tree to see all " +"opponents s/he had. However, in many computer applications of such " +"tournaments, we do not need to trace the history of a winner. To be more " +"memory efficient, when a winner is promoted, we try to replace it by " +"something else at a lower level, and the rule becomes that a cell and the " +"two cells it tops contain three different items, but the top cell \"wins\" " +"over the two topped cells." +msgstr "" +"У наведеному вище дереві кожна комірка *k* є вершиною ``2*k+1`` і ``2*k+2``. " +"У звичайному бінарному турнірі, який ми бачимо у спорті, кожна клітина є " +"переможцем над двома клітинками, які вона очолює, і ми можемо відстежити " +"переможця вниз по дереву, щоб побачити всіх суперників, які він/вона мали. " +"Однак у багатьох комп’ютерних програмах таких турнірів нам не потрібно " +"відстежувати історію переможця. Щоб підвищити ефективність пам’яті, коли " +"переможець підвищується, ми намагаємося замінити його чимось іншим на " +"нижчому рівні, і правило стає таким, що клітинка та дві верхні клітинки " +"містять три різні елементи, але верхня клітинка \"перемагає\". над двома " +"верхніми клітинами." + +msgid "" +"If this heap invariant is protected at all time, index 0 is clearly the " +"overall winner. The simplest algorithmic way to remove it and find the " +"\"next\" winner is to move some loser (let's say cell 30 in the diagram " +"above) into the 0 position, and then percolate this new 0 down the tree, " +"exchanging values, until the invariant is re-established. This is clearly " +"logarithmic on the total number of items in the tree. By iterating over all " +"items, you get an *O*\\ (*n* log *n*) sort." +msgstr "" + +msgid "" +"A nice feature of this sort is that you can efficiently insert new items " +"while the sort is going on, provided that the inserted items are not " +"\"better\" than the last 0'th element you extracted. This is especially " +"useful in simulation contexts, where the tree holds all incoming events, and " +"the \"win\" condition means the smallest scheduled time. When an event " +"schedules other events for execution, they are scheduled into the future, so " +"they can easily go into the heap. So, a heap is a good structure for " +"implementing schedulers (this is what I used for my MIDI sequencer :-)." +msgstr "" +"Приємною особливістю цього сортування є те, що ви можете ефективно вставляти " +"нові елементи під час сортування, за умови, що вставлені елементи не " +"\"кращі\", ніж останній нульовий елемент, який ви витягли. Це особливо " +"корисно в контекстах симуляції, де дерево містить усі вхідні події, а умова " +"\"виграш\" означає найменший запланований час. Коли подія планує інші події " +"для виконання, вони плануються в майбутньому, тому їх можна легко " +"перемістити в купу. Отже, купа є хорошою структурою для реалізації " +"планувальників (це те, що я використовував для свого MIDI-секвенсора :-)." + +msgid "" +"Various structures for implementing schedulers have been extensively " +"studied, and heaps are good for this, as they are reasonably speedy, the " +"speed is almost constant, and the worst case is not much different than the " +"average case. However, there are other representations which are more " +"efficient overall, yet the worst cases might be terrible." +msgstr "" +"Різноманітні структури для реалізації планувальників були ретельно вивчені, " +"і для цього добре підійдуть купи, оскільки вони досить швидкі, швидкість " +"майже постійна, а найгірший випадок не сильно відрізняється від середнього " +"випадку. Однак існують інші представлення, які в цілому є більш ефективними, " +"але найгірші випадки можуть бути жахливими." + +msgid "" +"Heaps are also very useful in big disk sorts. You most probably all know " +"that a big sort implies producing \"runs\" (which are pre-sorted sequences, " +"whose size is usually related to the amount of CPU memory), followed by a " +"merging passes for these runs, which merging is often very cleverly " +"organised [#]_. It is very important that the initial sort produces the " +"longest runs possible. Tournaments are a good way to achieve that. If, " +"using all the memory available to hold a tournament, you replace and " +"percolate items that happen to fit the current run, you'll produce runs " +"which are twice the size of the memory for random input, and much better for " +"input fuzzily ordered." +msgstr "" +"Купи також дуже корисні для сортування великих дисків. Напевно, ви всі " +"знаєте, що велике сортування передбачає створення \"запусків\" (це " +"попередньо відсортовані послідовності, розмір яких зазвичай пов’язаний з " +"обсягом пам’яті процесора), після чого слід об’єднання проходів для цих " +"запусків, яке часто є дуже спритним. організовано [#]_. Дуже важливо, щоб " +"початкове сортування створювало якнайдовші серії. Хорошим способом досягти " +"цього є турніри. Якщо, використовуючи всю пам’ять, доступну для проведення " +"турніру, ви замінюєте та просочуєте елементи, які випадково відповідають " +"поточному циклу, ви створите цикли, які вдвічі перевищують розмір пам’яті " +"для випадкового введення, і набагато краще для нечітко впорядкованого " +"введення." + +msgid "" +"Moreover, if you output the 0'th item on disk and get an input which may not " +"fit in the current tournament (because the value \"wins\" over the last " +"output value), it cannot fit in the heap, so the size of the heap " +"decreases. The freed memory could be cleverly reused immediately for " +"progressively building a second heap, which grows at exactly the same rate " +"the first heap is melting. When the first heap completely vanishes, you " +"switch heaps and start a new run. Clever and quite effective!" +msgstr "" +"Більше того, якщо ви виведете 0-й елемент на диску та отримаєте вхідні дані, " +"які можуть не відповідати поточному турніру (оскільки значення \"перемагає\" " +"над останнім вихідним значенням), воно не може поміститися у купу, тому " +"розмір купа зменшується. Звільнену пам’ять можна негайно використати " +"повторно для поступового створення другої купи, яка росте з тією ж " +"швидкістю, що й перша купа тане. Коли перша купа повністю зникає, ви " +"змінюєте купи та починаєте новий запуск. Розумно і досить ефективно!" + +msgid "" +"In a word, heaps are useful memory structures to know. I use them in a few " +"applications, and I think it is good to keep a 'heap' module around. :-)" +msgstr "" +"Одним словом, купи - це корисні структури пам'яті, які слід знати. Я " +"використовую їх у кількох програмах, і я вважаю, що добре тримати модуль " +"\"купи\". :-)" + +msgid "Footnotes" +msgstr "Виноски" + +msgid "" +"The disk balancing algorithms which are current, nowadays, are more annoying " +"than clever, and this is a consequence of the seeking capabilities of the " +"disks. On devices which cannot seek, like big tape drives, the story was " +"quite different, and one had to be very clever to ensure (far in advance) " +"that each tape movement will be the most effective possible (that is, will " +"best participate at \"progressing\" the merge). Some tapes were even able " +"to read backwards, and this was also used to avoid the rewinding time. " +"Believe me, real good tape sorts were quite spectacular to watch! From all " +"times, sorting has always been a Great Art! :-)" +msgstr "" +"Сучасні алгоритми балансування дисків радше дратують, ніж розумні, і це є " +"наслідком можливостей пошуку дисків. На пристроях, які не можуть шукати, як-" +"от великі стрічкові накопичувачі, історія була зовсім іншою, і потрібно було " +"бути дуже кмітливим, щоб переконатися (заздалегідь), що кожен рух стрічки " +"буде максимально ефективним (тобто найкраще братиме участь у \" " +"просувається\" злиття). Деякі стрічки навіть могли читати назад, і це також " +"використовувалося, щоб уникнути перемотування часу. Повірте, дивитися " +"справді гарні стрічки було дуже вражаюче! З усіх часів сортування завжди " +"було Великим Мистецтвом! :-)" diff --git a/library/hmac.po b/library/hmac.po new file mode 100644 index 000000000..7f0b03fdd --- /dev/null +++ b/library/hmac.po @@ -0,0 +1,199 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 01:07+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!hmac` --- Keyed-Hashing for Message Authentication" +msgstr "" + +msgid "**Source code:** :source:`Lib/hmac.py`" +msgstr "**Вихідний код:** :source:`Lib/hmac.py`" + +msgid "This module implements the HMAC algorithm as described by :rfc:`2104`." +msgstr "Цей модуль реалізує алгоритм HMAC, як описано в :rfc:`2104`." + +msgid "" +"Return a new hmac object. *key* is a bytes or bytearray object giving the " +"secret key. If *msg* is present, the method call ``update(msg)`` is made. " +"*digestmod* is the digest name, digest constructor or module for the HMAC " +"object to use. It may be any name suitable to :func:`hashlib.new`. Despite " +"its argument position, it is required." +msgstr "" +"Повернути новий об’єкт hmac. *key* — це об’єкт bytes або bytearray, що надає " +"секретний ключ. Якщо присутній *msg*, виконується виклик методу " +"``update(msg)``. *digestmod* — назва дайджесту, конструктор дайджесту або " +"модуль для використання об’єктом HMAC. Це може бути будь-яке ім’я, яке " +"підходить для :func:`hashlib.new`. Незважаючи на свою аргументовану позицію, " +"вона потрібна." + +msgid "" +"Parameter *key* can be a bytes or bytearray object. Parameter *msg* can be " +"of any type supported by :mod:`hashlib`. Parameter *digestmod* can be the " +"name of a hash algorithm." +msgstr "" +"Параметр *key* може бути об’єктом bytes або bytearray. Параметр *msg* може " +"бути будь-якого типу, який підтримується :mod:`hashlib`. Параметр " +"*digestmod* може бути назвою хеш-алгоритму." + +msgid "" +"The *digestmod* argument is now required. Pass it as a keyword argument to " +"avoid awkwardness when you do not have an initial *msg*." +msgstr "" + +msgid "" +"Return digest of *msg* for given secret *key* and *digest*. The function is " +"equivalent to ``HMAC(key, msg, digest).digest()``, but uses an optimized C " +"or inline implementation, which is faster for messages that fit into memory. " +"The parameters *key*, *msg*, and *digest* have the same meaning as in :func:" +"`~hmac.new`." +msgstr "" +"Повернути дайджест *повідомлення* для заданого секретного *ключа* та " +"*дайджесту*. Функція еквівалентна ``HMAC(key, msg, digest).digest()``, але " +"використовує оптимізовану C або вбудовану реалізацію, яка є швидшою для " +"повідомлень, які вміщуються в пам’ять. Параметри *key*, *msg* і *digest* " +"мають те саме значення, що й у :func:`~hmac.new`." + +msgid "" +"CPython implementation detail, the optimized C implementation is only used " +"when *digest* is a string and name of a digest algorithm, which is supported " +"by OpenSSL." +msgstr "" +"Деталі реалізації CPython, оптимізована реалізація C використовується лише " +"тоді, коли *digest* є рядком і назвою алгоритму дайджесту, який " +"підтримується OpenSSL." + +msgid "An HMAC object has the following methods:" +msgstr "Об’єкт HMAC має такі методи:" + +msgid "" +"Update the hmac object with *msg*. Repeated calls are equivalent to a " +"single call with the concatenation of all the arguments: ``m.update(a); m." +"update(b)`` is equivalent to ``m.update(a + b)``." +msgstr "" +"Оновіть об’єкт hmac за допомогою *msg*. Повторні виклики еквівалентні одному " +"виклику з конкатенацією всіх аргументів: ``m.update(a); m.update(b)`` " +"еквівалентно ``m.update(a + b)``." + +msgid "Parameter *msg* can be of any type supported by :mod:`hashlib`." +msgstr "" +"Параметр *msg* може бути будь-якого типу, який підтримується :mod:`hashlib`." + +msgid "" +"Return the digest of the bytes passed to the :meth:`update` method so far. " +"This bytes object will be the same length as the *digest_size* of the digest " +"given to the constructor. It may contain non-ASCII bytes, including NUL " +"bytes." +msgstr "" +"Повертає дайджест байтів, переданих до цього моменту методу :meth:`update`. " +"Цей об’єкт bytes матиме таку саму довжину, що й *digest_size* дайджесту, " +"наданого конструктору. Він може містити байти, відмінні від ASCII, включаючи " +"байти NUL." + +msgid "" +"When comparing the output of :meth:`digest` to an externally supplied digest " +"during a verification routine, it is recommended to use the :func:" +"`compare_digest` function instead of the ``==`` operator to reduce the " +"vulnerability to timing attacks." +msgstr "" + +msgid "" +"Like :meth:`digest` except the digest is returned as a string twice the " +"length containing only hexadecimal digits. This may be used to exchange the " +"value safely in email or other non-binary environments." +msgstr "" +"Подібно до :meth:`digest`, за винятком того, що дайджест повертається як " +"рядок подвійної довжини, що містить лише шістнадцяткові цифри. Це можна " +"використовувати для безпечного обміну значенням в електронній пошті чи в " +"інших небінарних середовищах." + +msgid "" +"When comparing the output of :meth:`hexdigest` to an externally supplied " +"digest during a verification routine, it is recommended to use the :func:" +"`compare_digest` function instead of the ``==`` operator to reduce the " +"vulnerability to timing attacks." +msgstr "" + +msgid "" +"Return a copy (\"clone\") of the hmac object. This can be used to " +"efficiently compute the digests of strings that share a common initial " +"substring." +msgstr "" +"Повертає копію (\"клон\") об'єкта hmac. Це можна використовувати для " +"ефективного обчислення дайджестів рядків, які мають спільний початковий " +"підрядок." + +msgid "A hash object has the following attributes:" +msgstr "Хеш-об’єкт має такі атрибути:" + +msgid "The size of the resulting HMAC digest in bytes." +msgstr "Розмір отриманого дайджесту HMAC у байтах." + +msgid "The internal block size of the hash algorithm in bytes." +msgstr "Розмір внутрішнього блоку хеш-алгоритму в байтах." + +msgid "The canonical name of this HMAC, always lowercase, e.g. ``hmac-md5``." +msgstr "" +"Канонічна назва цього HMAC, завжди в нижньому регістрі, напр. ``hmac-md5``." + +msgid "" +"Removed the undocumented attributes ``HMAC.digest_cons``, ``HMAC.inner``, " +"and ``HMAC.outer``." +msgstr "" + +msgid "This module also provides the following helper function:" +msgstr "Цей модуль також надає такі допоміжні функції:" + +msgid "" +"Return ``a == b``. This function uses an approach designed to prevent " +"timing analysis by avoiding content-based short circuiting behaviour, making " +"it appropriate for cryptography. *a* and *b* must both be of the same type: " +"either :class:`str` (ASCII only, as e.g. returned by :meth:`HMAC." +"hexdigest`), or a :term:`bytes-like object`." +msgstr "" +"Повернути ``a == b``. Ця функція використовує підхід, призначений для " +"запобігання аналізу часу шляхом уникнення короткого замикання на основі " +"вмісту, що робить її придатною для криптографії. *a* і *b* мають бути одного " +"типу: або :class:`str` (тільки ASCII, як, наприклад, повертає :meth:`HMAC." +"hexdigest`), або :term:`bytes-like object`." + +msgid "" +"If *a* and *b* are of different lengths, or if an error occurs, a timing " +"attack could theoretically reveal information about the types and lengths of " +"*a* and *b*—but not their values." +msgstr "" +"Якщо *a* і *b* мають різну довжину або якщо сталася помилка, атака на " +"синхронізацію теоретично може відкрити інформацію про типи та довжини *a* і " +"*b*, але не їхні значення." + +msgid "" +"The function uses OpenSSL's ``CRYPTO_memcmp()`` internally when available." +msgstr "" +"Функція внутрішньо використовує ``CRYPTO_memcmp()`` OpenSSL, якщо доступний." + +msgid "Module :mod:`hashlib`" +msgstr "Модуль :mod:`hashlib`" + +msgid "The Python module providing secure hash functions." +msgstr "Модуль Python, що забезпечує безпечні хеш-функції." diff --git a/library/html.po b/library/html.po new file mode 100644 index 000000000..b24ae149c --- /dev/null +++ b/library/html.po @@ -0,0 +1,72 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# Yuliia Shevchenko, 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-18 14:18+0000\n" +"PO-Revision-Date: 2021-06-28 01:07+0000\n" +"Last-Translator: Yuliia Shevchenko, 2024\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!html` --- HyperText Markup Language support" +msgstr ":mod:`!html` --- Підтримка мови розмітки гіпертексту (HTML)" + +msgid "**Source code:** :source:`Lib/html/__init__.py`" +msgstr "**Вихідний код:** :source:`Lib/html/__init__.py`" + +msgid "This module defines utilities to manipulate HTML." +msgstr "Цей модуль визначає утиліти для роботи з HTML." + +msgid "" +"Convert the characters ``&``, ``<`` and ``>`` in string *s* to HTML-safe " +"sequences. Use this if you need to display text that might contain such " +"characters in HTML. If the optional flag *quote* is true, the characters " +"(``\"``) and (``'``) are also translated; this helps for inclusion in an " +"HTML attribute value delimited by quotes, as in ````." +msgstr "" +"Перетворіть символи ``&``, ``<`` and ``>`` у рядку *s* на послідовності, " +"безпечні для HTML. Використовуйте це, якщо вам потрібно відобразити текст, " +"який може містити такі символи в HTML. Якщо необов’язковий прапорець *quote* " +"має значення true, символи (``\"``) і (``'``) також перекладаються; це " +"допомагає включити значення атрибута HTML, розділене лапками, як у ````." + +msgid "" +"Convert all named and numeric character references (e.g. ``>``, ``>" +"``, ``>``) in the string *s* to the corresponding Unicode characters. " +"This function uses the rules defined by the HTML 5 standard for both valid " +"and invalid character references, and the :data:`list of HTML 5 named " +"character references `." +msgstr "" +"Перетворіть усі іменовані та цифрові посилання на символи (наприклад, ``>" +"``, ``>``, ``>``) у рядку *s* на відповідні символи Unicode. Ця " +"функція використовує правила, визначені стандартом HTML 5 для дійсних і " +"недійсних посилань на символи, а також :data:`список іменованих посилань на " +"символи HTML 5 `." + +msgid "Submodules in the ``html`` package are:" +msgstr "Підмодулі в пакеті ``html``:" + +msgid ":mod:`html.parser` -- HTML/XHTML parser with lenient parsing mode" +msgstr ":mod:`html.parser` -- аналізатор HTML/XHTML із м'яким режимом аналізу" + +msgid ":mod:`html.entities` -- HTML entity definitions" +msgstr ":mod:`html.entities` -- визначення сутностей HTML" diff --git a/library/html_entities.po b/library/html_entities.po new file mode 100644 index 000000000..5d169f09c --- /dev/null +++ b/library/html_entities.po @@ -0,0 +1,74 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-25 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 01:07+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!html.entities` --- Definitions of HTML general entities" +msgstr "" + +msgid "**Source code:** :source:`Lib/html/entities.py`" +msgstr "**Вихідний код:** :source:`Lib/html/entities.py`" + +msgid "" +"This module defines four dictionaries, :data:`html5`, :data:" +"`name2codepoint`, :data:`codepoint2name`, and :data:`entitydefs`." +msgstr "" +"Цей модуль визначає чотири словники: :data:`html5`, :data:`name2codepoint`, :" +"data:`codepoint2name` і :data:`entitydefs`." + +msgid "" +"A dictionary that maps HTML5 named character references [#]_ to the " +"equivalent Unicode character(s), e.g. ``html5['gt;'] == '>'``. Note that the " +"trailing semicolon is included in the name (e.g. ``'gt;'``), however some of " +"the names are accepted by the standard even without the semicolon: in this " +"case the name is present with and without the ``';'``. See also :func:`html." +"unescape`." +msgstr "" +"Словник, який відображає іменовані символи HTML5, посилаються на [#]_ на " +"еквівалентні символи Unicode, наприклад. ``html5['gt;'] == '>'``. Зауважте, " +"що кінцева крапка з комою включена в назву (наприклад, ``'gt;''``), однак " +"деякі з імен прийнятні стандартом навіть без крапки з комою: у цьому випадку " +"назва присутня з і без нього. ``';'``. Дивіться також :func:`html.unescape`." + +msgid "" +"A dictionary mapping XHTML 1.0 entity definitions to their replacement text " +"in ISO Latin-1." +msgstr "" +"Словник, що зіставляє визначення сутностей XHTML 1.0 із текстом заміни в ISO " +"Latin-1." + +msgid "A dictionary that maps HTML4 entity names to the Unicode code points." +msgstr "" + +msgid "A dictionary that maps Unicode code points to HTML4 entity names." +msgstr "" + +msgid "Footnotes" +msgstr "Виноски" + +msgid "" +"See https://html.spec.whatwg.org/multipage/named-characters.html#named-" +"character-references" +msgstr "" diff --git a/library/html_parser.po b/library/html_parser.po new file mode 100644 index 000000000..f4aa33c49 --- /dev/null +++ b/library/html_parser.po @@ -0,0 +1,499 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Dmytro Kazanzhy, 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-11 14:19+0000\n" +"PO-Revision-Date: 2021-06-28 01:07+0000\n" +"Last-Translator: Dmytro Kazanzhy, 2022\n" +"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/" +"uk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != " +"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % " +"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || " +"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +msgid ":mod:`!html.parser` --- Simple HTML and XHTML parser" +msgstr "" + +msgid "**Source code:** :source:`Lib/html/parser.py`" +msgstr "**Вихідний код:** :source:`Lib/html/parser.py`" + +msgid "" +"This module defines a class :class:`HTMLParser` which serves as the basis " +"for parsing text files formatted in HTML (HyperText Mark-up Language) and " +"XHTML." +msgstr "" +"Цей модуль визначає клас :class:`HTMLParser`, який служить основою для " +"аналізу текстових файлів, відформатованих у HTML (HyperText Mark-up " +"Language) і XHTML." + +msgid "Create a parser instance able to parse invalid markup." +msgstr "Створіть екземпляр парсера, здатний аналізувати недійсну розмітку." + +msgid "" +"If *convert_charrefs* is ``True`` (the default), all character references " +"(except the ones in ``script``/``style`` elements) are automatically " +"converted to the corresponding Unicode characters." +msgstr "" +"Якщо *convert_charrefs* має значення ``True`` (за замовчуванням), усі " +"посилання на символи (крім тих, що містяться в елементах ``script``/" +"``style``) автоматично перетворюються на відповідні символи Unicode." + +msgid "" +"An :class:`.HTMLParser` instance is fed HTML data and calls handler methods " +"when start tags, end tags, text, comments, and other markup elements are " +"encountered. The user should subclass :class:`.HTMLParser` and override its " +"methods to implement the desired behavior." +msgstr "" +"Екземпляр :class:`.HTMLParser` отримує дані HTML і викликає методи обробки, " +"коли зустрічаються початкові теги, кінцеві теги, текст, коментарі та інші " +"елементи розмітки. Користувач повинен створити підклас :class:`.HTMLParser` " +"і перевизначити його методи для реалізації бажаної поведінки." + +msgid "" +"This parser does not check that end tags match start tags or call the end-" +"tag handler for elements which are closed implicitly by closing an outer " +"element." +msgstr "" +"Цей синтаксичний аналізатор не перевіряє відповідність кінцевих тегів " +"початковим тегам і не викликає обробник кінцевих тегів для елементів, які " +"закриваються неявно шляхом закриття зовнішнього елемента." + +msgid "*convert_charrefs* keyword argument added." +msgstr "Додано аргумент ключового слова *convert_charrefs*." + +msgid "The default value for argument *convert_charrefs* is now ``True``." +msgstr "" +"Значення за замовчуванням для аргументу *convert_charrefs* тепер ``True``." + +msgid "Example HTML Parser Application" +msgstr "Приклад програми аналізатора HTML" + +msgid "" +"As a basic example, below is a simple HTML parser that uses the :class:" +"`HTMLParser` class to print out start tags, end tags, and data as they are " +"encountered::" +msgstr "" +"Як базовий приклад, нижче наведено простий аналізатор HTML, який " +"використовує клас :class:`HTMLParser` для виведення початкових тегів, " +"кінцевих тегів і даних у міру їх зустрічі::" + +msgid "" +"from html.parser import HTMLParser\n" +"\n" +"class MyHTMLParser(HTMLParser):\n" +" def handle_starttag(self, tag, attrs):\n" +" print(\"Encountered a start tag:\", tag)\n" +"\n" +" def handle_endtag(self, tag):\n" +" print(\"Encountered an end tag :\", tag)\n" +"\n" +" def handle_data(self, data):\n" +" print(\"Encountered some data :\", data)\n" +"\n" +"parser = MyHTMLParser()\n" +"parser.feed('Test'\n" +" '

Parse me!

')" +msgstr "" + +msgid "The output will then be:" +msgstr "Результат буде таким:" + +msgid "" +"Encountered a start tag: html\n" +"Encountered a start tag: head\n" +"Encountered a start tag: title\n" +"Encountered some data : Test\n" +"Encountered an end tag : title\n" +"Encountered an end tag : head\n" +"Encountered a start tag: body\n" +"Encountered a start tag: h1\n" +"Encountered some data : Parse me!\n" +"Encountered an end tag : h1\n" +"Encountered an end tag : body\n" +"Encountered an end tag : html" +msgstr "" + +msgid ":class:`.HTMLParser` Methods" +msgstr ":class:`.HTMLParser` Методи" + +msgid ":class:`HTMLParser` instances have the following methods:" +msgstr "Екземпляри :class:`HTMLParser` мають такі методи:" + +msgid "" +"Feed some text to the parser. It is processed insofar as it consists of " +"complete elements; incomplete data is buffered until more data is fed or :" +"meth:`close` is called. *data* must be :class:`str`." +msgstr "" +"Подати текст до синтаксичного аналізатора. Він обробляється, оскільки " +"складається з повних елементів; неповні дані буферизуються, поки не буде " +"подано більше даних або не буде викликано :meth:`close`. *data* має бути :" +"class:`str`." + +msgid "" +"Force processing of all buffered data as if it were followed by an end-of-" +"file mark. This method may be redefined by a derived class to define " +"additional processing at the end of the input, but the redefined version " +"should always call the :class:`HTMLParser` base class method :meth:`close`." +msgstr "" +"Примусова обробка всіх буферизованих даних так, ніби за ними стоїть позначка " +"кінця файлу. Цей метод може бути перевизначений похідним класом, щоб " +"визначити додаткову обробку в кінці введення, але перевизначена версія " +"завжди повинна викликати метод базового класу :class:`HTMLParser` :meth:" +"`close`." + +msgid "" +"Reset the instance. Loses all unprocessed data. This is called implicitly " +"at instantiation time." +msgstr "" +"Скинути примірник. Втрачає всі необроблені дані. Це викликається неявно під " +"час створення екземпляра." + +msgid "Return current line number and offset." +msgstr "Повернути поточний номер рядка та зсув." + +msgid "" +"Return the text of the most recently opened start tag. This should not " +"normally be needed for structured processing, but may be useful in dealing " +"with HTML \"as deployed\" or for re-generating input with minimal changes " +"(whitespace between attributes can be preserved, etc.)." +msgstr "" +"Повертає текст останнього відкритого початкового тегу. Зазвичай це не " +"потрібно для структурованої обробки, але може бути корисним для роботи з " +"HTML \"у розгорнутому стані\" або для повторного створення вхідних даних із " +"мінімальними змінами (можна зберегти пробіли між атрибутами тощо)." + +msgid "" +"The following methods are called when data or markup elements are " +"encountered and they are meant to be overridden in a subclass. The base " +"class implementations do nothing (except for :meth:`~HTMLParser." +"handle_startendtag`):" +msgstr "" +"Наступні методи викликаються, коли зустрічаються дані або елементи розмітки, " +"і вони призначені для перевизначення в підкласі. Реалізації базового класу " +"нічого не роблять (крім :meth:`~HTMLParser.handle_startendtag`):" + +msgid "" +"This method is called to handle the start tag of an element (e.g. ``
``)." +msgstr "" +"Цей метод викликається для обробки початкового тегу елемента (наприклад, " +"``
``)." + +msgid "" +"The *tag* argument is the name of the tag converted to lower case. The " +"*attrs* argument is a list of ``(name, value)`` pairs containing the " +"attributes found inside the tag's ``<>`` brackets. The *name* will be " +"translated to lower case, and quotes in the *value* have been removed, and " +"character and entity references have been replaced." +msgstr "" +"Аргумент *тег* — це назва тегу, перетворена в нижній регістр. Аргумент " +"*attrs* — це список пар ``(ім’я, значення)``, що містить атрибути, що " +"містяться в дужках ``<>`` тегу. *Ім’я* буде перекладено на нижній регістр, а " +"лапки в *значенні* видалено, а посилання на символи та сутності замінено." + +msgid "" +"For instance, for the tag ````, this method " +"would be called as ``handle_starttag('a', [('href', 'https://www.cwi." +"nl/')])``." +msgstr "" +"Наприклад, для тегу ```` цей метод буде " +"називатися ``handle_starttag('a', [('href', 'https://www.cwi.nl/')])``." + +msgid "" +"All entity references from :mod:`html.entities` are replaced in the " +"attribute values." +msgstr "" +"Усі посилання на сутності з :mod:`html.entities` замінюються в значеннях " +"атрибутів." + +msgid "" +"This method is called to handle the end tag of an element (e.g. ``
``)." +msgstr "" +"Цей метод викликається для обробки кінцевого тегу елемента (наприклад, ````)." + +msgid "The *tag* argument is the name of the tag converted to lower case." +msgstr "Аргумент *тег* — це назва тегу, перетворена в нижній регістр." + +msgid "" +"Similar to :meth:`handle_starttag`, but called when the parser encounters an " +"XHTML-style empty tag (````). This method may be overridden by " +"subclasses which require this particular lexical information; the default " +"implementation simply calls :meth:`handle_starttag` and :meth:" +"`handle_endtag`." +msgstr "" +"Подібно до :meth:`handle_starttag`, але викликається, коли аналізатор " +"зустрічає порожній тег у стилі XHTML (````). Цей метод може бути " +"замінений підкласами, які потребують саме цієї лексичної інформації; " +"стандартна реалізація просто викликає :meth:`handle_starttag` і :meth:" +"`handle_endtag`." + +msgid "" +"This method is called to process arbitrary data (e.g. text nodes and the " +"content of ```` and ````)." +msgstr "" +"Цей метод викликається для обробки довільних даних (наприклад, текстових " +"вузлів і вмісту ```` і ````)." + +msgid "" +"This method is called to process a named character reference of the form " +"``&name;`` (e.g. ``>``), where *name* is a general entity reference (e.g. " +"``'gt'``). This method is never called if *convert_charrefs* is ``True``." +msgstr "" +"Цей метод викликається для обробки іменованого посилання на символ у формі " +"``&name;`` (наприклад, ``>``), де *name* є загальним посиланням на " +"сутність (наприклад ``'gt'``). Цей метод ніколи не викликається, якщо " +"*convert_charrefs* має значення ``True``." + +msgid "" +"This method is called to process decimal and hexadecimal numeric character " +"references of the form :samp:`&#{NNN};` and :samp:`&#x{NNN};`. For example, " +"the decimal equivalent for ``>`` is ``>``, whereas the hexadecimal is " +"``>``; in this case the method will receive ``'62'`` or ``'x3E'``. " +"This method is never called if *convert_charrefs* is ``True``." +msgstr "" + +msgid "" +"This method is called when a comment is encountered (e.g. ````)." + +msgid "" +"For example, the comment ```` will cause this method to be " +"called with the argument ``' comment '``." +msgstr "" +"Наприклад, коментар ```` призведе до виклику цього методу з " +"аргументом ``' comment ''``." + +msgid "" +"The content of Internet Explorer conditional comments (condcoms) will also " +"be sent to this method, so, for ````, this method will receive ``'[if IE 9]>IE9-specific content IE9-специфічного вмісту `` цей метод отримає ``'[if IE 9]>IE9-специфічний вміст< ![endif]''``." + +msgid "" +"This method is called to handle an HTML doctype declaration (e.g. ````)." +msgstr "" +"Цей метод викликається для обробки декларації типу документа HTML " +"(наприклад, ````)." + +msgid "" +"The *decl* parameter will be the entire contents of the declaration inside " +"the ```` markup (e.g. ``'DOCTYPE html'``)." +msgstr "" +"Параметр *decl* буде повним вмістом оголошення всередині розмітки ```` " +"(наприклад, ``'DOCTYPE html'``)." + +msgid "" +"Method called when a processing instruction is encountered. The *data* " +"parameter will contain the entire processing instruction. For example, for " +"the processing instruction ````, this method would be " +"called as ``handle_pi(\"proc color='red'\")``. It is intended to be " +"overridden by a derived class; the base class implementation does nothing." +msgstr "" +"Метод викликається, коли зустрічається інструкція обробки. Параметр *data* " +"міститиме всю інструкцію обробки. Наприклад, для інструкції обробки ````, цей метод мав би викликатися як ``handle_pi(\"proc " +"color='red'\")``. Він призначений для перевизначення похідним класом; " +"реалізація базового класу нічого не робить." + +msgid "" +"The :class:`HTMLParser` class uses the SGML syntactic rules for processing " +"instructions. An XHTML processing instruction using the trailing ``'?'`` " +"will cause the ``'?'`` to be included in *data*." +msgstr "" +"Клас :class:`HTMLParser` використовує синтаксичні правила SGML для обробки " +"інструкцій. Інструкція з обробки XHTML із використанням кінцевого ``'?''`` " +"призведе до включення ``'?''`` до *даних*." + +msgid "" +"This method is called when an unrecognized declaration is read by the parser." +msgstr "Цей метод викликається, коли аналізатор читає нерозпізнану декларацію." + +msgid "" +"The *data* parameter will be the entire contents of the declaration inside " +"the ```` markup. It is sometimes useful to be overridden by a " +"derived class. The base class implementation does nothing." +msgstr "" +"Параметр *data* буде повним вмістом оголошення всередині розмітки ````. Іноді корисно бути перевизначеним похідним класом. Реалізація " +"базового класу нічого не робить." + +msgid "Examples" +msgstr "Приклади" + +msgid "" +"The following class implements a parser that will be used to illustrate more " +"examples::" +msgstr "" +"Наступний клас реалізує синтаксичний аналізатор, який використовуватиметься " +"для ілюстрації інших прикладів:" + +msgid "" +"from html.parser import HTMLParser\n" +"from html.entities import name2codepoint\n" +"\n" +"class MyHTMLParser(HTMLParser):\n" +" def handle_starttag(self, tag, attrs):\n" +" print(\"Start tag:\", tag)\n" +" for attr in attrs:\n" +" print(\" attr:\", attr)\n" +"\n" +" def handle_endtag(self, tag):\n" +" print(\"End tag :\", tag)\n" +"\n" +" def handle_data(self, data):\n" +" print(\"Data :\", data)\n" +"\n" +" def handle_comment(self, data):\n" +" print(\"Comment :\", data)\n" +"\n" +" def handle_entityref(self, name):\n" +" c = chr(name2codepoint[name])\n" +" print(\"Named ent:\", c)\n" +"\n" +" def handle_charref(self, name):\n" +" if name.startswith('x'):\n" +" c = chr(int(name[1:], 16))\n" +" else:\n" +" c = chr(int(name))\n" +" print(\"Num ent :\", c)\n" +"\n" +" def handle_decl(self, data):\n" +" print(\"Decl :\", data)\n" +"\n" +"parser = MyHTMLParser()" +msgstr "" + +msgid "Parsing a doctype::" +msgstr "Розбір doctype::" + +msgid "" +">>> parser.feed('')\n" +"Decl : DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3." +"org/TR/html4/strict.dtd\"" +msgstr "" + +msgid "Parsing an element with a few attributes and a title::" +msgstr "Розбір елемента з декількома атрибутами та заголовком::" + +msgid "" +">>> parser.feed('\"The')\n" +"Start tag: img\n" +" attr: ('src', 'python-logo.png')\n" +" attr: ('alt', 'The Python logo')\n" +">>>\n" +">>> parser.feed('

Python

')\n" +"Start tag: h1\n" +"Data : Python\n" +"End tag : h1" +msgstr "" + +msgid "" +"The content of ``script`` and ``style`` elements is returned as is, without " +"further parsing::" +msgstr "" +"Вміст елементів ``script`` і ``style`` повертається як є, без подальшого " +"аналізу::" + +msgid "" +">>> parser.feed('