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

---

# Справочник по языку Python

Данное справочное руководство описывает синтаксис и «основную семантику» языка. Оно лаконично, но стремится к точности и полноте. Семантика необязательных встроенных типов объектов, а также встроенных функций и модулей описана в [Стандартной библиотеке Python](https://python-all.ru/3/library/index.html#library-index). Для неформального введения в язык см. [Руководство по языку Python](https://python-all.ru/3/tutorial/index.html#tutorial-index). Для программистов на C или C++ существуют два дополнительных руководства: [Расширение и встраивание интерпретатора Python](https://python-all.ru/3/extending/index.html#extending-index) описывает общую картину написания модулей расширения Python, а [справочное руководство по Python/C API](https://python-all.ru/3/c-api/index.html#c-api-index) подробно описывает интерфейсы, доступные программистам на C/C++.

- [1. Введение](https://python-all.ru/3/reference/introduction.html)

  - [1.1. Альтернативные реализации](https://python-all.ru/3/reference/introduction.html#alternate-implementations)
  - [1.2. Обозначения](https://python-all.ru/3/reference/introduction.html#notation)
- [2. Лексический анализ](https://python-all.ru/3/reference/lexical_analysis.html)

  - [2.1. Структура строк](https://python-all.ru/3/reference/lexical_analysis.html#line-structure)
  - [2.2. Другие токены](https://python-all.ru/3/reference/lexical_analysis.html#other-tokens)
  - [2.3. Имена (идентификаторы и ключевые слова)](https://python-all.ru/3/reference/lexical_analysis.html#names-identifiers-and-keywords)
  - [2.4. Литералы](https://python-all.ru/3/reference/lexical_analysis.html#literals)
  - [2.5. Строковые и байтовые литералы](https://python-all.ru/3/reference/lexical_analysis.html#string-and-bytes-literals)
  - [2.6. Числовые литералы](https://python-all.ru/3/reference/lexical_analysis.html#numeric-literals)
  - [2.7. Операторы и разделители](https://python-all.ru/3/reference/lexical_analysis.html#operators-and-delimiters)
- [3. Модель данных](https://python-all.ru/3/reference/datamodel.html)

  - [3.1. Объекты, значения и типы](https://python-all.ru/3/reference/datamodel.html#objects-values-and-types)
  - [3.2. Стандартная иерархия типов](https://python-all.ru/3/reference/datamodel.html#the-standard-type-hierarchy)
  - [3.3. Имена специальных методов](https://python-all.ru/3/reference/datamodel.html#special-method-names)
  - [3.4. Корутины](https://python-all.ru/3/reference/datamodel.html#coroutines)
- [4. Модель выполнения](https://python-all.ru/3/reference/executionmodel.html)

  - [4.1. Структура программы](https://python-all.ru/3/reference/executionmodel.html#structure-of-a-program)
  - [4.2. Имена и связывание](https://python-all.ru/3/reference/executionmodel.html#naming-and-binding)
  - [4.3. Исключения](https://python-all.ru/3/reference/executionmodel.html#exceptions)
  - [4.4. Компоненты времени выполнения](https://python-all.ru/3/reference/executionmodel.html#runtime-components)
- [5. Система импорта](https://python-all.ru/3/reference/import.html)

  - [5.1. `importlib`](https://python-all.ru/3/reference/import.html#importlib)
  - [5.2. Пакеты](https://python-all.ru/3/reference/import.html#packages)
  - [5.3. Поиск](https://python-all.ru/3/reference/import.html#searching)
  - [5.4. Загрузка](https://python-all.ru/3/reference/import.html#loading)
  - [5.5. Искатель на основе путей](https://python-all.ru/3/reference/import.html#the-path-based-finder)
  - [5.6. Замена стандартной системы импорта](https://python-all.ru/3/reference/import.html#replacing-the-standard-import-system)
  - [5.7. Относительные импорты в пакетах](https://python-all.ru/3/reference/import.html#package-relative-imports)
  - [5.8. Особые соображения для \_\_main\_\_](https://python-all.ru/3/reference/import.html#special-considerations-for-main)
  - [5.9. Ссылки](https://python-all.ru/3/reference/import.html#references)
- [6. Выражения](https://python-all.ru/3/reference/expressions.html)

  - [6.1. Арифметические преобразования](https://python-all.ru/3/reference/expressions.html#arithmetic-conversions)
  - [6.2. Атомы](https://python-all.ru/3/reference/expressions.html#atoms)
  - [6.3. Первичные выражения](https://python-all.ru/3/reference/expressions.html#primaries)
  - [6.4. Выражение await](https://python-all.ru/3/reference/expressions.html#await-expression)
  - [6.5. Оператор возведения в степень](https://python-all.ru/3/reference/expressions.html#the-power-operator)
  - [6.6. Унарные арифметические и битовые операции](https://python-all.ru/3/reference/expressions.html#unary-arithmetic-and-bitwise-operations)
  - [6.7. Бинарные арифметические операции](https://python-all.ru/3/reference/expressions.html#binary-arithmetic-operations)
  - [6.8. Операции сдвига](https://python-all.ru/3/reference/expressions.html#shifting-operations)
  - [6.9. Двоичные поразрядные операции](https://python-all.ru/3/reference/expressions.html#binary-bitwise-operations)
  - [6.10. Сравнения](https://python-all.ru/3/reference/expressions.html#comparisons)
  - [6.11. Булевы операции](https://python-all.ru/3/reference/expressions.html#boolean-operations)
  - [6.12. Присваивающие выражения](https://python-all.ru/3/reference/expressions.html#assignment-expressions)
  - [6.13. Условные выражения](https://python-all.ru/3/reference/expressions.html#conditional-expressions)
  - [6.14. Лямбда-выражения](https://python-all.ru/3/reference/expressions.html#lambda)
  - [6.15. Списки выражений](https://python-all.ru/3/reference/expressions.html#expression-lists)
  - [6.16. Порядок вычисления](https://python-all.ru/3/reference/expressions.html#evaluation-order)
  - [6.17. Приоритет операторов](https://python-all.ru/3/reference/expressions.html#operator-precedence)
- [7. Простые инструкции](https://python-all.ru/3/reference/simple_stmts.html)

  - [7.1. Инструкции-выражения](https://python-all.ru/3/reference/simple_stmts.html#expression-statements)
  - [7.2. Инструкции присваивания](https://python-all.ru/3/reference/simple_stmts.html#assignment-statements)
  - [7.3. Инструкция `assert`](https://python-all.ru/3/reference/simple_stmts.html#the-assert-statement)
  - [7.4. Инструкция `pass`](https://python-all.ru/3/reference/simple_stmts.html#the-pass-statement)
  - [7.5. Инструкция `del`](https://python-all.ru/3/reference/simple_stmts.html#the-del-statement)
  - [7.6. Инструкция `return`](https://python-all.ru/3/reference/simple_stmts.html#the-return-statement)
  - [7.7. Инструкция `yield`](https://python-all.ru/3/reference/simple_stmts.html#the-yield-statement)
  - [7.8. Инструкция `raise`](https://python-all.ru/3/reference/simple_stmts.html#the-raise-statement)
  - [7.9. Инструкция `break`](https://python-all.ru/3/reference/simple_stmts.html#the-break-statement)
  - [7.10. Инструкция `continue`](https://python-all.ru/3/reference/simple_stmts.html#the-continue-statement)
  - [7.11. Инструкция `import`](https://python-all.ru/3/reference/simple_stmts.html#the-import-statement)
  - [7.12. Инструкция `global`](https://python-all.ru/3/reference/simple_stmts.html#the-global-statement)
  - [7.13. Инструкция `nonlocal`](https://python-all.ru/3/reference/simple_stmts.html#the-nonlocal-statement)
  - [7.14. Инструкция `type`](https://python-all.ru/3/reference/simple_stmts.html#the-type-statement)
- [8. Составные инструкции](https://python-all.ru/3/reference/compound_stmts.html)

  - [8.1. Инструкция `if`](https://python-all.ru/3/reference/compound_stmts.html#the-if-statement)
  - [8.2. Инструкция `while`](https://python-all.ru/3/reference/compound_stmts.html#the-while-statement)
  - [8.3. Инструкция `for`](https://python-all.ru/3/reference/compound_stmts.html#the-for-statement)
  - [8.4. Инструкция `try`](https://python-all.ru/3/reference/compound_stmts.html#the-try-statement)
  - [8.5. Инструкция `with`](https://python-all.ru/3/reference/compound_stmts.html#the-with-statement)
  - [8.6. Инструкция `match`](https://python-all.ru/3/reference/compound_stmts.html#the-match-statement)
  - [8.7. Определения функций](https://python-all.ru/3/reference/compound_stmts.html#function-definitions)
  - [8.8. Определения классов](https://python-all.ru/3/reference/compound_stmts.html#class-definitions)
  - [8.9. Корутины](https://python-all.ru/3/reference/compound_stmts.html#coroutines)
  - [8.10. Списки параметров типов](https://python-all.ru/3/reference/compound_stmts.html#type-parameter-lists)
  - [8.11. Аннотации](https://python-all.ru/3/reference/compound_stmts.html#annotations)
- [9. Компоненты верхнего уровня](https://python-all.ru/3/reference/toplevel_components.html)

  - [9.1. Полные программы на Python](https://python-all.ru/3/reference/toplevel_components.html#complete-python-programs)
  - [9.2. Ввод из файла](https://python-all.ru/3/reference/toplevel_components.html#file-input)
  - [9.3. Интерактивный ввод](https://python-all.ru/3/reference/toplevel_components.html#interactive-input)
  - [9.4. Ввод выражений](https://python-all.ru/3/reference/toplevel_components.html#expression-input)
- [10. Полная спецификация грамматики](https://python-all.ru/3/reference/grammar.html)
