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

---

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

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

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

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

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

    - [28.5.2.1. Фильтры предупреждений по умолчанию](https://python-all.ru/3.3/library/warnings.html#default-warning-filters)
  - [28.5.3. Временное подавление предупреждений](https://python-all.ru/3.3/library/warnings.html#temporarily-suppressing-warnings)
  - [28.5.4. Тестирование предупреждений](https://python-all.ru/3.3/library/warnings.html#testing-warnings)
  - [28.5.5. Обновление кода для новых версий Python](https://python-all.ru/3.3/library/warnings.html#updating-code-for-new-versions-of-python)
  - [28.5.6. Доступные функции](https://python-all.ru/3.3/library/warnings.html#available-functions)
  - [28.5.7. Доступные менеджеры контекста](https://python-all.ru/3.3/library/warnings.html#available-context-managers)
- [28.6. `contextlib` – Утилиты для контекстов оператора `with`](https://python-all.ru/3.3/library/contextlib.html)

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

    - [28.6.2.1. Поддержка переменного числа менеджеров контекста](https://python-all.ru/3.3/library/contextlib.html#supporting-a-variable-number-of-context-managers)
    - [28.6.2.2. Упрощение поддержки одного опционального менеджера контекста](https://python-all.ru/3.3/library/contextlib.html#simplifying-support-for-single-optional-context-managers)
    - [28.6.2.3. Перехват исключений из методов `__enter__`](https://python-all.ru/3.3/library/contextlib.html#catching-exceptions-from-enter-methods)
    - [28.6.2.4. Очистка в реализации `__enter__`](https://python-all.ru/3.3/library/contextlib.html#cleaning-up-in-an-enter-implementation)
    - [28.6.2.5. Замена любого использования `try-finally` и флаговых переменных](https://python-all.ru/3.3/library/contextlib.html#replacing-any-use-of-try-finally-and-flag-variables)
    - [28.6.2.6. Использование менеджера контекста в качестве декоратора функции](https://python-all.ru/3.3/library/contextlib.html#using-a-context-manager-as-a-function-decorator)
- [28.7. `abc` – Абстрактные базовые классы](https://python-all.ru/3.3/library/abc.html)
- [28.8. `atexit` – Обработчики завершения](https://python-all.ru/3.3/library/atexit.html)

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

  - [28.9.1. Примеры трассировки](https://python-all.ru/3.3/library/traceback.html#traceback-examples)
- [28.10. `__future__` – Определения операторов future](https://python-all.ru/3.3/library/__future__.html)
- [28.11. `gc` – Интерфейс сборщика мусора](https://python-all.ru/3.3/library/gc.html)
- [28.12. `inspect` – Инспекция активных объектов](https://python-all.ru/3.3/library/inspect.html)

  - [28.12.1. Типы и члены](https://python-all.ru/3.3/library/inspect.html#types-and-members)
  - [28.12.2. Получение исходного кода](https://python-all.ru/3.3/library/inspect.html#retrieving-source-code)
  - [28.12.3. Интроспекция вызываемых объектов с помощью объекта Signature](https://python-all.ru/3.3/library/inspect.html#introspecting-callables-with-the-signature-object)
  - [28.12.4. Классы и функции](https://python-all.ru/3.3/library/inspect.html#classes-and-functions)
  - [28.12.5. Стек интерпретатора](https://python-all.ru/3.3/library/inspect.html#the-interpreter-stack)
  - [28.12.6. Статическое получение атрибутов](https://python-all.ru/3.3/library/inspect.html#fetching-attributes-statically)
  - [28.12.7. Текущее состояние генератора](https://python-all.ru/3.3/library/inspect.html#current-state-of-a-generator)
- [28.13. `site` – Привязка конфигурации к конкретному сайту](https://python-all.ru/3.3/library/site.html)
- [28.14. `fpectl` – Управление исключениями с плавающей запятой](https://python-all.ru/3.3/library/fpectl.html)

  - [28.14.1. Пример](https://python-all.ru/3.3/library/fpectl.html#example)
  - [28.14.2. Ограничения и прочие замечания](https://python-all.ru/3.3/library/fpectl.html#limitations-and-other-considerations)
- [28.15. `distutils` – Сборка и установка модулей Python](https://python-all.ru/3.3/library/distutils.html)
