> **Источник:** https://python-all.ru/3.8/library/python.html
>
> «Документация Python на русском» – неофициальный перевод официальной документации Python: версии от 2.6 до 3.16, полнотекстовый поиск, английский оригинал рядом с переводом. Эта Markdown-версия страницы предназначена для работы с LLM: вставьте её в ChatGPT, Claude или Cursor.

---

# Службы времени выполнения Python

Модули, описанные в этой главе, предоставляют широкий спектр сервисов, связанных с интерпретатором Python и его взаимодействием с окружением. Вот обзор:

- [`sys` – Системно-зависимые параметры и функции](https://python-all.ru/3.8/library/sys.html)
- [`sysconfig` – Предоставление доступа к конфигурационной информации Python](https://python-all.ru/3.8/library/sysconfig.html)

  - [Переменные конфигурации](https://python-all.ru/3.8/library/sysconfig.html#configuration-variables)
  - [Пути установки](https://python-all.ru/3.8/library/sysconfig.html#installation-paths)
  - [Другие функции](https://python-all.ru/3.8/library/sysconfig.html#other-functions)
  - [Использование `sysconfig` в качестве скрипта](https://python-all.ru/3.8/library/sysconfig.html#using-sysconfig-as-a-script)
- [`builtins` – Встроенные объекты](https://python-all.ru/3.8/library/builtins.html)
- [`__main__` – среда сценария верхнего уровня](https://python-all.ru/3.8/library/__main__.html)
- [`warnings` – Управление предупреждениями](https://python-all.ru/3.8/library/warnings.html)

  - [Категории предупреждений](https://python-all.ru/3.8/library/warnings.html#warning-categories)
  - [Фильтр предупреждений](https://python-all.ru/3.8/library/warnings.html#the-warnings-filter)

    - [Описание фильтров предупреждений](https://python-all.ru/3.8/library/warnings.html#describing-warning-filters)
    - [Фильтр предупреждений по умолчанию](https://python-all.ru/3.8/library/warnings.html#default-warning-filter)
    - [Переопределение фильтра по умолчанию](https://python-all.ru/3.8/library/warnings.html#overriding-the-default-filter)
  - [Временное подавление предупреждений](https://python-all.ru/3.8/library/warnings.html#temporarily-suppressing-warnings)
  - [Тестирование предупреждений](https://python-all.ru/3.8/library/warnings.html#testing-warnings)
  - [Обновление кода для новых версий зависимостей](https://python-all.ru/3.8/library/warnings.html#updating-code-for-new-versions-of-dependencies)
  - [Доступные функции](https://python-all.ru/3.8/library/warnings.html#available-functions)
  - [Доступные контекстные менеджеры](https://python-all.ru/3.8/library/warnings.html#available-context-managers)
- [`dataclasses` – Классы данных](https://python-all.ru/3.8/library/dataclasses.html)

  - [Декораторы, классы и функции уровня модуля](https://python-all.ru/3.8/library/dataclasses.html#module-level-decorators-classes-and-functions)
  - [Обработка после инициализации](https://python-all.ru/3.8/library/dataclasses.html#post-init-processing)
  - [Переменные класса](https://python-all.ru/3.8/library/dataclasses.html#class-variables)
  - [Переменные только для инициализации](https://python-all.ru/3.8/library/dataclasses.html#init-only-variables)
  - [Неизменяемые экземпляры](https://python-all.ru/3.8/library/dataclasses.html#frozen-instances)
  - [Наследование](https://python-all.ru/3.8/library/dataclasses.html#inheritance)
  - [Функции-фабрики по умолчанию](https://python-all.ru/3.8/library/dataclasses.html#default-factory-functions)
  - [Изменяемые значения по умолчанию](https://python-all.ru/3.8/library/dataclasses.html#mutable-default-values)
  - [Исключения](https://python-all.ru/3.8/library/dataclasses.html#exceptions)
- [`contextlib` – Утилиты для контекстов оператора `with`](https://python-all.ru/3.8/library/contextlib.html)

  - [Утилиты](https://python-all.ru/3.8/library/contextlib.html#utilities)
  - [Примеры и рецепты](https://python-all.ru/3.8/library/contextlib.html#examples-and-recipes)

    - [Поддержка переменного числа менеджеров контекста](https://python-all.ru/3.8/library/contextlib.html#supporting-a-variable-number-of-context-managers)
    - [Перехват исключений из методов `__enter__`](https://python-all.ru/3.8/library/contextlib.html#catching-exceptions-from-enter-methods)
    - [Очистка в реализации `__enter__`](https://python-all.ru/3.8/library/contextlib.html#cleaning-up-in-an-enter-implementation)
    - [Замена использования `try-finally` и флаговых переменных](https://python-all.ru/3.8/library/contextlib.html#replacing-any-use-of-try-finally-and-flag-variables)
    - [Использование менеджера контекста в качестве декоратора функции](https://python-all.ru/3.8/library/contextlib.html#using-a-context-manager-as-a-function-decorator)
  - [Одноразовые, многократно используемые и реентерабельные менеджеры контекста](https://python-all.ru/3.8/library/contextlib.html#single-use-reusable-and-reentrant-context-managers)

    - [Реентерабельные менеджеры контекста](https://python-all.ru/3.8/library/contextlib.html#reentrant-context-managers)
    - [Повторно используемые менеджеры контекста](https://python-all.ru/3.8/library/contextlib.html#reusable-context-managers)
- [`abc` – Абстрактные базовые классы](https://python-all.ru/3.8/library/abc.html)
- [`atexit` – Обработчики выхода](https://python-all.ru/3.8/library/atexit.html)

  - [`atexit` Пример](https://python-all.ru/3.8/library/atexit.html#atexit-example)
- [`traceback` – Печать или получение трассировки стека](https://python-all.ru/3.8/library/traceback.html)

  - [Объекты `TracebackException`](https://python-all.ru/3.8/library/traceback.html#tracebackexception-objects)
  - [Объекты `StackSummary`](https://python-all.ru/3.8/library/traceback.html#stacksummary-objects)
  - [Объекты `FrameSummary`](https://python-all.ru/3.8/library/traceback.html#framesummary-objects)
  - [Примеры Traceback](https://python-all.ru/3.8/library/traceback.html#traceback-examples)
- [`__future__` – Определения операторов future](https://python-all.ru/3.8/library/__future__.html)
- [`gc` – Интерфейс сборщика мусора](https://python-all.ru/3.8/library/gc.html)
- [`inspect` – Инспекция живых объектов](https://python-all.ru/3.8/library/inspect.html)

  - [Типы и члены](https://python-all.ru/3.8/library/inspect.html#types-and-members)
  - [Получение исходного кода](https://python-all.ru/3.8/library/inspect.html#retrieving-source-code)
  - [Интроспекция вызываемых объектов с помощью объекта Signature](https://python-all.ru/3.8/library/inspect.html#introspecting-callables-with-the-signature-object)
  - [Классы и функции](https://python-all.ru/3.8/library/inspect.html#classes-and-functions)
  - [Стек интерпретатора](https://python-all.ru/3.8/library/inspect.html#the-interpreter-stack)
  - [Получение атрибутов статически](https://python-all.ru/3.8/library/inspect.html#fetching-attributes-statically)
  - [Текущее состояние генераторов и корутин](https://python-all.ru/3.8/library/inspect.html#current-state-of-generators-and-coroutines)
  - [Битовые флаги объектов кода](https://python-all.ru/3.8/library/inspect.html#code-objects-bit-flags)
  - [Интерфейс командной строки](https://python-all.ru/3.8/library/inspect.html#command-line-interface)
- [`site` – Перехватчик конфигурации для конкретного сайта](https://python-all.ru/3.8/library/site.html)

  - [Конфигурация readline](https://python-all.ru/3.8/library/site.html#readline-configuration)
  - [Содержание модуля](https://python-all.ru/3.8/library/site.html#module-contents)
  - [Интерфейс командной строки](https://python-all.ru/3.8/library/site.html#command-line-interface)
