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

python.md

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

1> **Источник:** https://python-all.ru/3.14/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.14/library/sys.html)12- [`sys.monitoring` – Мониторинг событий выполнения](https://python-all.ru/3.14/library/sys.monitoring.html)1314  - [Идентификаторы инструментов](https://python-all.ru/3.14/library/sys.monitoring.html#tool-identifiers)1516    - [Регистрация и использование инструментов](https://python-all.ru/3.14/library/sys.monitoring.html#registering-and-using-tools)17  - [События](https://python-all.ru/3.14/library/sys.monitoring.html#events)1819    - [Локальные события](https://python-all.ru/3.14/library/sys.monitoring.html#local-events)20    - [Устаревшее событие](https://python-all.ru/3.14/library/sys.monitoring.html#deprecated-event)21    - [Вспомогательные события](https://python-all.ru/3.14/library/sys.monitoring.html#ancillary-events)22    - [Прочие события](https://python-all.ru/3.14/library/sys.monitoring.html#other-events)23    - [Событие STOP\_ITERATION](https://python-all.ru/3.14/library/sys.monitoring.html#the-stop-iteration-event)24  - [Включение и отключение событий](https://python-all.ru/3.14/library/sys.monitoring.html#turning-events-on-and-off)2526    - [Глобальная настройка событий](https://python-all.ru/3.14/library/sys.monitoring.html#setting-events-globally)27    - [События для каждого объекта кода](https://python-all.ru/3.14/library/sys.monitoring.html#per-code-object-events)28    - [Отключение событий](https://python-all.ru/3.14/library/sys.monitoring.html#disabling-events)29  - [Регистрация функций обратного вызова](https://python-all.ru/3.14/library/sys.monitoring.html#registering-callback-functions)3031    - [Аргументы функции обратного вызова](https://python-all.ru/3.14/library/sys.monitoring.html#callback-function-arguments)32- [`sysconfig` – Предоставление доступа к конфигурационной информации Python](https://python-all.ru/3.14/library/sysconfig.html)3334  - [Переменные конфигурации](https://python-all.ru/3.14/library/sysconfig.html#configuration-variables)35  - [Пути установки](https://python-all.ru/3.14/library/sysconfig.html#installation-paths)36  - [Схема пользователя](https://python-all.ru/3.14/library/sysconfig.html#user-scheme)3738    - [`posix_user`](https://python-all.ru/3.14/library/sysconfig.html#posix-user)39    - [`nt_user`](https://python-all.ru/3.14/library/sysconfig.html#nt-user)40    - [`osx_framework_user`](https://python-all.ru/3.14/library/sysconfig.html#osx-framework-user)41  - [Домашняя схема](https://python-all.ru/3.14/library/sysconfig.html#home-scheme)4243    - [`posix_home`](https://python-all.ru/3.14/library/sysconfig.html#posix-home)44  - [Схема префикса](https://python-all.ru/3.14/library/sysconfig.html#prefix-scheme)4546    - [`posix_prefix`](https://python-all.ru/3.14/library/sysconfig.html#posix-prefix)47    - [`nt`](https://python-all.ru/3.14/library/sysconfig.html#nt)48  - [Функции путей установки](https://python-all.ru/3.14/library/sysconfig.html#installation-path-functions)49  - [Другие функции](https://python-all.ru/3.14/library/sysconfig.html#other-functions)50  - [Использование командной строки](https://python-all.ru/3.14/library/sysconfig.html#command-line-usage)51- [`builtins` – Встроенные объекты](https://python-all.ru/3.14/library/builtins.html)52- [`__main__` – Окружение кода верхнего уровня](https://python-all.ru/3.14/library/__main__.html)5354  - [`__name__ == '__main__'`](https://python-all.ru/3.14/library/__main__.html#name-main)5556    - [Что такое «окружение кода верхнего уровня»?](https://python-all.ru/3.14/library/__main__.html#what-is-the-top-level-code-environment)57    - [Идиоматическое использование](https://python-all.ru/3.14/library/__main__.html#idiomatic-usage)58    - [Особенности упаковки](https://python-all.ru/3.14/library/__main__.html#packaging-considerations)59  - [`__main__.py` в пакетах Python](https://python-all.ru/3.14/library/__main__.html#main-py-in-python-packages)6061    - [Идиоматическое использование](https://python-all.ru/3.14/library/__main__.html#id1)62  - [`import __main__`](https://python-all.ru/3.14/library/__main__.html#import-main)63- [`warnings` – Управление предупреждениями](https://python-all.ru/3.14/library/warnings.html)6465  - [Категории предупреждений](https://python-all.ru/3.14/library/warnings.html#warning-categories)66  - [Фильтр предупреждений](https://python-all.ru/3.14/library/warnings.html#the-warnings-filter)6768    - [Критерии подавления повторяющихся предупреждений](https://python-all.ru/3.14/library/warnings.html#repeated-warning-suppression-criteria)69    - [Описание фильтров предупреждений](https://python-all.ru/3.14/library/warnings.html#describing-warning-filters)70    - [Фильтр предупреждений по умолчанию](https://python-all.ru/3.14/library/warnings.html#default-warning-filter)71    - [Переопределение фильтра по умолчанию](https://python-all.ru/3.14/library/warnings.html#overriding-the-default-filter)72  - [Временное подавление предупреждений](https://python-all.ru/3.14/library/warnings.html#temporarily-suppressing-warnings)73  - [Тестирование предупреждений](https://python-all.ru/3.14/library/warnings.html#testing-warnings)74  - [Обновление кода для новых версий зависимостей](https://python-all.ru/3.14/library/warnings.html#updating-code-for-new-versions-of-dependencies)75  - [Доступные функции](https://python-all.ru/3.14/library/warnings.html#available-functions)76  - [Доступные контекстные менеджеры](https://python-all.ru/3.14/library/warnings.html#available-context-managers)77  - [Безопасность контекстных менеджеров при параллельном выполнении](https://python-all.ru/3.14/library/warnings.html#concurrent-safety-of-context-managers)78- [`dataclasses` – Классы данных](https://python-all.ru/3.14/library/dataclasses.html)7980  - [Содержание модуля](https://python-all.ru/3.14/library/dataclasses.html#module-contents)81  - [Обработка после инициализации](https://python-all.ru/3.14/library/dataclasses.html#post-init-processing)82  - [Переменные класса](https://python-all.ru/3.14/library/dataclasses.html#class-variables)83  - [Переменные только для инициализации](https://python-all.ru/3.14/library/dataclasses.html#init-only-variables)84  - [Неизменяемые экземпляры](https://python-all.ru/3.14/library/dataclasses.html#frozen-instances)85  - [Наследование](https://python-all.ru/3.14/library/dataclasses.html#inheritance)86  - [Переупорядочивание именованных параметров в `__init__()`](https://python-all.ru/3.14/library/dataclasses.html#re-ordering-of-keyword-only-parameters-in-init)87  - [Функции-фабрики по умолчанию](https://python-all.ru/3.14/library/dataclasses.html#default-factory-functions)88  - [Изменяемые значения по умолчанию](https://python-all.ru/3.14/library/dataclasses.html#mutable-default-values)89  - [Поля с типом дескриптора](https://python-all.ru/3.14/library/dataclasses.html#descriptor-typed-fields)90- [`contextlib` – Утилиты для контекстов оператора `with`](https://python-all.ru/3.14/library/contextlib.html)9192  - [Утилиты](https://python-all.ru/3.14/library/contextlib.html#utilities)93  - [Примеры и рецепты](https://python-all.ru/3.14/library/contextlib.html#examples-and-recipes)9495    - [Поддержка переменного числа менеджеров контекста](https://python-all.ru/3.14/library/contextlib.html#supporting-a-variable-number-of-context-managers)96    - [Перехват исключений из методов `__enter__`](https://python-all.ru/3.14/library/contextlib.html#catching-exceptions-from-enter-methods)97    - [Очистка в реализации `__enter__`](https://python-all.ru/3.14/library/contextlib.html#cleaning-up-in-an-enter-implementation)98    - [Замена использования `try-finally` и флаговых переменных](https://python-all.ru/3.14/library/contextlib.html#replacing-any-use-of-try-finally-and-flag-variables)99    - [Использование менеджера контекста в качестве декоратора функции](https://python-all.ru/3.14/library/contextlib.html#using-a-context-manager-as-a-function-decorator)100  - [Одноразовые, многократно используемые и реентерабельные менеджеры контекста](https://python-all.ru/3.14/library/contextlib.html#single-use-reusable-and-reentrant-context-managers)101102    - [Реентерабельные менеджеры контекста](https://python-all.ru/3.14/library/contextlib.html#reentrant-context-managers)103    - [Повторно используемые менеджеры контекста](https://python-all.ru/3.14/library/contextlib.html#reusable-context-managers)104- [`abc` – Абстрактные базовые классы](https://python-all.ru/3.14/library/abc.html)105- [`atexit` – Обработчики выхода](https://python-all.ru/3.14/library/atexit.html)106107  - [`atexit` Пример](https://python-all.ru/3.14/library/atexit.html#atexit-example)108- [`traceback` – Печать или получение трассировки стека](https://python-all.ru/3.14/library/traceback.html)109110  - [Функции уровня модуля](https://python-all.ru/3.14/library/traceback.html#module-level-functions)111  - [Объекты `TracebackException`](https://python-all.ru/3.14/library/traceback.html#tracebackexception-objects)112  - [Объекты `StackSummary`](https://python-all.ru/3.14/library/traceback.html#stacksummary-objects)113  - [Объекты `FrameSummary`](https://python-all.ru/3.14/library/traceback.html#framesummary-objects)114  - [Примеры использования функций уровня модуля](https://python-all.ru/3.14/library/traceback.html#examples-of-using-the-module-level-functions)115  - [Примеры использования `TracebackException`](https://python-all.ru/3.14/library/traceback.html#examples-of-using-tracebackexception)116- [`__future__` – Определения операторов future](https://python-all.ru/3.14/library/__future__.html)117118  - [Содержимое модуля](https://python-all.ru/3.14/library/__future__.html#module-contents)119- [`gc` – Интерфейс сборщика мусора](https://python-all.ru/3.14/library/gc.html)120- [`inspect` – Инспекция живых объектов](https://python-all.ru/3.14/library/inspect.html)121122  - [Типы и члены](https://python-all.ru/3.14/library/inspect.html#types-and-members)123  - [Получение исходного кода](https://python-all.ru/3.14/library/inspect.html#retrieving-source-code)124  - [Интроспекция вызываемых объектов с помощью объекта Signature](https://python-all.ru/3.14/library/inspect.html#introspecting-callables-with-the-signature-object)125  - [Классы и функции](https://python-all.ru/3.14/library/inspect.html#classes-and-functions)126  - [Стек интерпретатора](https://python-all.ru/3.14/library/inspect.html#the-interpreter-stack)127  - [Получение атрибутов статически](https://python-all.ru/3.14/library/inspect.html#fetching-attributes-statically)128  - [Текущее состояние генераторов, корутин и асинхронных генераторов](https://python-all.ru/3.14/library/inspect.html#current-state-of-generators-coroutines-and-asynchronous-generators)129  - [Битовые флаги объектов кода](https://python-all.ru/3.14/library/inspect.html#code-objects-bit-flags)130  - [Флаги буфера](https://python-all.ru/3.14/library/inspect.html#buffer-flags)131  - [Интерфейс командной строки](https://python-all.ru/3.14/library/inspect.html#command-line-interface)132- [`annotationlib` – Функциональность для интроспекции аннотаций](https://python-all.ru/3.14/library/annotationlib.html)133134  - [Семантика аннотаций](https://python-all.ru/3.14/library/annotationlib.html#annotation-semantics)135  - [Классы](https://python-all.ru/3.14/library/annotationlib.html#classes)136  - [Функции](https://python-all.ru/3.14/library/annotationlib.html#functions)137  - [Рецепты](https://python-all.ru/3.14/library/annotationlib.html#recipes)138139    - [Использование аннотаций в метаклассе](https://python-all.ru/3.14/library/annotationlib.html#using-annotations-in-a-metaclass)140    - [Создание пользовательской вызываемой функции annotate](https://python-all.ru/3.14/library/annotationlib.html#creating-a-custom-callable-annotate-function)141  - [Ограничения формата `STRING`](https://python-all.ru/3.14/library/annotationlib.html#limitations-of-the-string-format)142  - [Ограничения формата `FORWARDREF`](https://python-all.ru/3.14/library/annotationlib.html#limitations-of-the-forwardref-format)143  - [Проблемы безопасности при интроспекции аннотаций](https://python-all.ru/3.14/library/annotationlib.html#security-implications-of-introspecting-annotations)144- [`site` – Перехватчик конфигурации для конкретного сайта](https://python-all.ru/3.14/library/site.html)145146  - [`sitecustomize`](https://python-all.ru/3.14/library/site.html#module-sitecustomize)147  - [`usercustomize`](https://python-all.ru/3.14/library/site.html#module-usercustomize)148  - [Конфигурация readline](https://python-all.ru/3.14/library/site.html#readline-configuration)149  - [Содержание модуля](https://python-all.ru/3.14/library/site.html#module-contents)150  - [Интерфейс командной строки](https://python-all.ru/3.14/library/site.html#command-line-interface)151152> **См. также**153>154> - Смотрите модуль [`concurrent.interpreters`](https://python-all.ru/3.14/library/concurrent.interpreters.html#module-concurrent.interpreters), который аналогичным образом предоставляет основные функции времени выполнения.155