Документация Python неофициальный перевод

python.md

137 строк · 14.0 КБ · обычная страница · сырой текст · скачать

1> **Источник:** https://python-all.ru/3.12/library/python.html2>3> «Документация Python на русском» – неофициальный перевод официальной документации Python: версии от 2.6 до 3.16, полнотекстовый поиск, английский оригинал рядом с переводом. Эта Markdown-версия страницы предназначена для работы с LLM: вставьте её в ChatGPT, Claude или Cursor.45---67# Службы времени выполнения Python89Модули, описанные в этой главе, предоставляют широкий спектр сервисов, связанных с интерпретатором Python и его взаимодействием с окружением. Вот обзор:1011- [`sys` – Системно-зависимые параметры и функции](https://python-all.ru/3.12/library/sys.html)12- [`sys.monitoring` – Мониторинг событий выполнения](https://python-all.ru/3.12/library/sys.monitoring.html)1314  - [Идентификаторы инструментов](https://python-all.ru/3.12/library/sys.monitoring.html#tool-identifiers)1516    - [Регистрация и использование инструментов](https://python-all.ru/3.12/library/sys.monitoring.html#registering-and-using-tools)17  - [События](https://python-all.ru/3.12/library/sys.monitoring.html#events)1819    - [Локальные события](https://python-all.ru/3.12/library/sys.monitoring.html#local-events)20    - [Вспомогательные события](https://python-all.ru/3.12/library/sys.monitoring.html#ancillary-events)21    - [Прочие события](https://python-all.ru/3.12/library/sys.monitoring.html#other-events)22    - [Событие STOP\_ITERATION](https://python-all.ru/3.12/library/sys.monitoring.html#the-stop-iteration-event)23  - [Включение и отключение событий](https://python-all.ru/3.12/library/sys.monitoring.html#turning-events-on-and-off)2425    - [Глобальная настройка событий](https://python-all.ru/3.12/library/sys.monitoring.html#setting-events-globally)26    - [События для каждого объекта кода](https://python-all.ru/3.12/library/sys.monitoring.html#per-code-object-events)27    - [Отключение событий](https://python-all.ru/3.12/library/sys.monitoring.html#disabling-events)28  - [Регистрация функций обратного вызова](https://python-all.ru/3.12/library/sys.monitoring.html#registering-callback-functions)2930    - [Аргументы функции обратного вызова](https://python-all.ru/3.12/library/sys.monitoring.html#callback-function-arguments)31- [`sysconfig` – Предоставление доступа к конфигурационной информации Python](https://python-all.ru/3.12/library/sysconfig.html)3233  - [Переменные конфигурации](https://python-all.ru/3.12/library/sysconfig.html#configuration-variables)34  - [Пути установки](https://python-all.ru/3.12/library/sysconfig.html#installation-paths)35  - [Схема пользователя](https://python-all.ru/3.12/library/sysconfig.html#user-scheme)3637    - [`posix_user`](https://python-all.ru/3.12/library/sysconfig.html#posix-user)38    - [`nt_user`](https://python-all.ru/3.12/library/sysconfig.html#nt-user)39    - [`osx_framework_user`](https://python-all.ru/3.12/library/sysconfig.html#osx-framework-user)40  - [Домашняя схема](https://python-all.ru/3.12/library/sysconfig.html#home-scheme)4142    - [`posix_home`](https://python-all.ru/3.12/library/sysconfig.html#posix-home)43  - [Схема префикса](https://python-all.ru/3.12/library/sysconfig.html#prefix-scheme)4445    - [`posix_prefix`](https://python-all.ru/3.12/library/sysconfig.html#posix-prefix)46    - [`nt`](https://python-all.ru/3.12/library/sysconfig.html#nt)47  - [Функции путей установки](https://python-all.ru/3.12/library/sysconfig.html#installation-path-functions)48  - [Другие функции](https://python-all.ru/3.12/library/sysconfig.html#other-functions)49  - [Использование `sysconfig` в качестве скрипта](https://python-all.ru/3.12/library/sysconfig.html#using-sysconfig-as-a-script)50- [`builtins` – Встроенные объекты](https://python-all.ru/3.12/library/builtins.html)51- [`__main__` – Окружение кода верхнего уровня](https://python-all.ru/3.12/library/__main__.html)5253  - [`__name__ == '__main__'`](https://python-all.ru/3.12/library/__main__.html#name-main)5455    - [Что такое «окружение кода верхнего уровня»?](https://python-all.ru/3.12/library/__main__.html#what-is-the-top-level-code-environment)56    - [Идиоматическое использование](https://python-all.ru/3.12/library/__main__.html#idiomatic-usage)57    - [Особенности упаковки](https://python-all.ru/3.12/library/__main__.html#packaging-considerations)58  - [`__main__.py` в пакетах Python](https://python-all.ru/3.12/library/__main__.html#main-py-in-python-packages)5960    - [Идиоматическое использование](https://python-all.ru/3.12/library/__main__.html#id1)61  - [`import __main__`](https://python-all.ru/3.12/library/__main__.html#import-main)62- [`warnings` – Управление предупреждениями](https://python-all.ru/3.12/library/warnings.html)6364  - [Категории предупреждений](https://python-all.ru/3.12/library/warnings.html#warning-categories)65  - [Фильтр предупреждений](https://python-all.ru/3.12/library/warnings.html#the-warnings-filter)6667    - [Критерии подавления повторяющихся предупреждений](https://python-all.ru/3.12/library/warnings.html#repeated-warning-suppression-criteria)68    - [Описание фильтров предупреждений](https://python-all.ru/3.12/library/warnings.html#describing-warning-filters)69    - [Фильтр предупреждений по умолчанию](https://python-all.ru/3.12/library/warnings.html#default-warning-filter)70    - [Переопределение фильтра по умолчанию](https://python-all.ru/3.12/library/warnings.html#overriding-the-default-filter)71  - [Временное подавление предупреждений](https://python-all.ru/3.12/library/warnings.html#temporarily-suppressing-warnings)72  - [Тестирование предупреждений](https://python-all.ru/3.12/library/warnings.html#testing-warnings)73  - [Обновление кода для новых версий зависимостей](https://python-all.ru/3.12/library/warnings.html#updating-code-for-new-versions-of-dependencies)74  - [Доступные функции](https://python-all.ru/3.12/library/warnings.html#available-functions)75  - [Доступные контекстные менеджеры](https://python-all.ru/3.12/library/warnings.html#available-context-managers)76- [`dataclasses` – Классы данных](https://python-all.ru/3.12/library/dataclasses.html)7778  - [Содержание модуля](https://python-all.ru/3.12/library/dataclasses.html#module-contents)79  - [Обработка после инициализации](https://python-all.ru/3.12/library/dataclasses.html#post-init-processing)80  - [Переменные класса](https://python-all.ru/3.12/library/dataclasses.html#class-variables)81  - [Переменные только для инициализации](https://python-all.ru/3.12/library/dataclasses.html#init-only-variables)82  - [Неизменяемые экземпляры](https://python-all.ru/3.12/library/dataclasses.html#frozen-instances)83  - [Наследование](https://python-all.ru/3.12/library/dataclasses.html#inheritance)84  - [Переупорядочивание именованных параметров в `__init__()`](https://python-all.ru/3.12/library/dataclasses.html#re-ordering-of-keyword-only-parameters-in-init)85  - [Функции-фабрики по умолчанию](https://python-all.ru/3.12/library/dataclasses.html#default-factory-functions)86  - [Изменяемые значения по умолчанию](https://python-all.ru/3.12/library/dataclasses.html#mutable-default-values)87  - [Поля с типом дескриптора](https://python-all.ru/3.12/library/dataclasses.html#descriptor-typed-fields)88- [`contextlib` – Утилиты для контекстов оператора `with`](https://python-all.ru/3.12/library/contextlib.html)8990  - [Утилиты](https://python-all.ru/3.12/library/contextlib.html#utilities)91  - [Примеры и рецепты](https://python-all.ru/3.12/library/contextlib.html#examples-and-recipes)9293    - [Поддержка переменного числа менеджеров контекста](https://python-all.ru/3.12/library/contextlib.html#supporting-a-variable-number-of-context-managers)94    - [Перехват исключений из методов `__enter__`](https://python-all.ru/3.12/library/contextlib.html#catching-exceptions-from-enter-methods)95    - [Очистка в реализации `__enter__`](https://python-all.ru/3.12/library/contextlib.html#cleaning-up-in-an-enter-implementation)96    - [Замена использования `try-finally` и флаговых переменных](https://python-all.ru/3.12/library/contextlib.html#replacing-any-use-of-try-finally-and-flag-variables)97    - [Использование менеджера контекста в качестве декоратора функции](https://python-all.ru/3.12/library/contextlib.html#using-a-context-manager-as-a-function-decorator)98  - [Одноразовые, многократно используемые и реентерабельные менеджеры контекста](https://python-all.ru/3.12/library/contextlib.html#single-use-reusable-and-reentrant-context-managers)99100    - [Реентерабельные менеджеры контекста](https://python-all.ru/3.12/library/contextlib.html#reentrant-context-managers)101    - [Повторно используемые менеджеры контекста](https://python-all.ru/3.12/library/contextlib.html#reusable-context-managers)102- [`abc` – Абстрактные базовые классы](https://python-all.ru/3.12/library/abc.html)103- [`atexit` – Обработчики выхода](https://python-all.ru/3.12/library/atexit.html)104105  - [`atexit` Пример](https://python-all.ru/3.12/library/atexit.html#atexit-example)106- [`traceback` – Печать или получение трассировки стека](https://python-all.ru/3.12/library/traceback.html)107108  - [Функции уровня модуля](https://python-all.ru/3.12/library/traceback.html#module-level-functions)109  - [Объекты `TracebackException`](https://python-all.ru/3.12/library/traceback.html#tracebackexception-objects)110  - [Объекты `StackSummary`](https://python-all.ru/3.12/library/traceback.html#stacksummary-objects)111  - [Объекты `FrameSummary`](https://python-all.ru/3.12/library/traceback.html#framesummary-objects)112  - [Примеры использования функций уровня модуля](https://python-all.ru/3.12/library/traceback.html#examples-of-using-the-module-level-functions)113  - [Примеры использования `TracebackException`](https://python-all.ru/3.12/library/traceback.html#examples-of-using-tracebackexception)114- [`__future__` – Определения операторов future](https://python-all.ru/3.12/library/__future__.html)115116  - [Содержимое модуля](https://python-all.ru/3.12/library/__future__.html#module-contents)117- [`gc` – Интерфейс сборщика мусора](https://python-all.ru/3.12/library/gc.html)118- [`inspect` – Инспекция живых объектов](https://python-all.ru/3.12/library/inspect.html)119120  - [Типы и члены](https://python-all.ru/3.12/library/inspect.html#types-and-members)121  - [Получение исходного кода](https://python-all.ru/3.12/library/inspect.html#retrieving-source-code)122  - [Интроспекция вызываемых объектов с помощью объекта Signature](https://python-all.ru/3.12/library/inspect.html#introspecting-callables-with-the-signature-object)123  - [Классы и функции](https://python-all.ru/3.12/library/inspect.html#classes-and-functions)124  - [Стек интерпретатора](https://python-all.ru/3.12/library/inspect.html#the-interpreter-stack)125  - [Получение атрибутов статически](https://python-all.ru/3.12/library/inspect.html#fetching-attributes-statically)126  - [Текущее состояние генераторов, корутин и асинхронных генераторов](https://python-all.ru/3.12/library/inspect.html#current-state-of-generators-coroutines-and-asynchronous-generators)127  - [Битовые флаги объектов кода](https://python-all.ru/3.12/library/inspect.html#code-objects-bit-flags)128  - [Флаги буфера](https://python-all.ru/3.12/library/inspect.html#buffer-flags)129  - [Интерфейс командной строки](https://python-all.ru/3.12/library/inspect.html#command-line-interface)130- [`site` – Перехватчик конфигурации для конкретного сайта](https://python-all.ru/3.12/library/site.html)131132  - [`sitecustomize`](https://python-all.ru/3.12/library/site.html#module-sitecustomize)133  - [`usercustomize`](https://python-all.ru/3.12/library/site.html#module-usercustomize)134  - [Конфигурация readline](https://python-all.ru/3.12/library/site.html#readline-configuration)135  - [Содержание модуля](https://python-all.ru/3.12/library/site.html#module-contents)136  - [Интерфейс командной строки](https://python-all.ru/3.12/library/site.html#command-line-interface)137