index.md
1> **Источник:** https://python-all.ru/3/reference/index.html2>3> «Документация Python на русском» – неофициальный перевод официальной документации Python: версии от 2.6 до 3.16, полнотекстовый поиск, английский оригинал рядом с переводом. Эта Markdown-версия страницы предназначена для работы с LLM: вставьте её в ChatGPT, Claude или Cursor.45---67# Справочник по языку Python89Данное справочное руководство описывает синтаксис и «основную семантику» языка. Оно лаконично, но стремится к точности и полноте. Семантика необязательных встроенных типов объектов, а также встроенных функций и модулей описана в [Стандартной библиотеке 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++.1011- [1. Введение](https://python-all.ru/3/reference/introduction.html)1213 - [1.1. Альтернативные реализации](https://python-all.ru/3/reference/introduction.html#alternate-implementations)14 - [1.2. Обозначения](https://python-all.ru/3/reference/introduction.html#notation)15- [2. Лексический анализ](https://python-all.ru/3/reference/lexical_analysis.html)1617 - [2.1. Структура строк](https://python-all.ru/3/reference/lexical_analysis.html#line-structure)18 - [2.2. Другие токены](https://python-all.ru/3/reference/lexical_analysis.html#other-tokens)19 - [2.3. Имена (идентификаторы и ключевые слова)](https://python-all.ru/3/reference/lexical_analysis.html#names-identifiers-and-keywords)20 - [2.4. Литералы](https://python-all.ru/3/reference/lexical_analysis.html#literals)21 - [2.5. Строковые и байтовые литералы](https://python-all.ru/3/reference/lexical_analysis.html#string-and-bytes-literals)22 - [2.6. Числовые литералы](https://python-all.ru/3/reference/lexical_analysis.html#numeric-literals)23 - [2.7. Операторы и разделители](https://python-all.ru/3/reference/lexical_analysis.html#operators-and-delimiters)24- [3. Модель данных](https://python-all.ru/3/reference/datamodel.html)2526 - [3.1. Объекты, значения и типы](https://python-all.ru/3/reference/datamodel.html#objects-values-and-types)27 - [3.2. Стандартная иерархия типов](https://python-all.ru/3/reference/datamodel.html#the-standard-type-hierarchy)28 - [3.3. Имена специальных методов](https://python-all.ru/3/reference/datamodel.html#special-method-names)29 - [3.4. Корутины](https://python-all.ru/3/reference/datamodel.html#coroutines)30- [4. Модель выполнения](https://python-all.ru/3/reference/executionmodel.html)3132 - [4.1. Структура программы](https://python-all.ru/3/reference/executionmodel.html#structure-of-a-program)33 - [4.2. Имена и связывание](https://python-all.ru/3/reference/executionmodel.html#naming-and-binding)34 - [4.3. Исключения](https://python-all.ru/3/reference/executionmodel.html#exceptions)35 - [4.4. Компоненты времени выполнения](https://python-all.ru/3/reference/executionmodel.html#runtime-components)36- [5. Система импорта](https://python-all.ru/3/reference/import.html)3738 - [5.1. `importlib`](https://python-all.ru/3/reference/import.html#importlib)39 - [5.2. Пакеты](https://python-all.ru/3/reference/import.html#packages)40 - [5.3. Поиск](https://python-all.ru/3/reference/import.html#searching)41 - [5.4. Загрузка](https://python-all.ru/3/reference/import.html#loading)42 - [5.5. Искатель на основе путей](https://python-all.ru/3/reference/import.html#the-path-based-finder)43 - [5.6. Замена стандартной системы импорта](https://python-all.ru/3/reference/import.html#replacing-the-standard-import-system)44 - [5.7. Относительные импорты в пакетах](https://python-all.ru/3/reference/import.html#package-relative-imports)45 - [5.8. Особые соображения для \_\_main\_\_](https://python-all.ru/3/reference/import.html#special-considerations-for-main)46 - [5.9. Ссылки](https://python-all.ru/3/reference/import.html#references)47- [6. Выражения](https://python-all.ru/3/reference/expressions.html)4849 - [6.1. Арифметические преобразования](https://python-all.ru/3/reference/expressions.html#arithmetic-conversions)50 - [6.2. Атомы](https://python-all.ru/3/reference/expressions.html#atoms)51 - [6.3. Первичные выражения](https://python-all.ru/3/reference/expressions.html#primaries)52 - [6.4. Выражение await](https://python-all.ru/3/reference/expressions.html#await-expression)53 - [6.5. Оператор возведения в степень](https://python-all.ru/3/reference/expressions.html#the-power-operator)54 - [6.6. Унарные арифметические и битовые операции](https://python-all.ru/3/reference/expressions.html#unary-arithmetic-and-bitwise-operations)55 - [6.7. Бинарные арифметические операции](https://python-all.ru/3/reference/expressions.html#binary-arithmetic-operations)56 - [6.8. Операции сдвига](https://python-all.ru/3/reference/expressions.html#shifting-operations)57 - [6.9. Двоичные поразрядные операции](https://python-all.ru/3/reference/expressions.html#binary-bitwise-operations)58 - [6.10. Сравнения](https://python-all.ru/3/reference/expressions.html#comparisons)59 - [6.11. Булевы операции](https://python-all.ru/3/reference/expressions.html#boolean-operations)60 - [6.12. Присваивающие выражения](https://python-all.ru/3/reference/expressions.html#assignment-expressions)61 - [6.13. Условные выражения](https://python-all.ru/3/reference/expressions.html#conditional-expressions)62 - [6.14. Лямбда-выражения](https://python-all.ru/3/reference/expressions.html#lambda)63 - [6.15. Списки выражений](https://python-all.ru/3/reference/expressions.html#expression-lists)64 - [6.16. Порядок вычисления](https://python-all.ru/3/reference/expressions.html#evaluation-order)65 - [6.17. Приоритет операторов](https://python-all.ru/3/reference/expressions.html#operator-precedence)66- [7. Простые инструкции](https://python-all.ru/3/reference/simple_stmts.html)6768 - [7.1. Инструкции-выражения](https://python-all.ru/3/reference/simple_stmts.html#expression-statements)69 - [7.2. Инструкции присваивания](https://python-all.ru/3/reference/simple_stmts.html#assignment-statements)70 - [7.3. Инструкция `assert`](https://python-all.ru/3/reference/simple_stmts.html#the-assert-statement)71 - [7.4. Инструкция `pass`](https://python-all.ru/3/reference/simple_stmts.html#the-pass-statement)72 - [7.5. Инструкция `del`](https://python-all.ru/3/reference/simple_stmts.html#the-del-statement)73 - [7.6. Инструкция `return`](https://python-all.ru/3/reference/simple_stmts.html#the-return-statement)74 - [7.7. Инструкция `yield`](https://python-all.ru/3/reference/simple_stmts.html#the-yield-statement)75 - [7.8. Инструкция `raise`](https://python-all.ru/3/reference/simple_stmts.html#the-raise-statement)76 - [7.9. Инструкция `break`](https://python-all.ru/3/reference/simple_stmts.html#the-break-statement)77 - [7.10. Инструкция `continue`](https://python-all.ru/3/reference/simple_stmts.html#the-continue-statement)78 - [7.11. Инструкция `import`](https://python-all.ru/3/reference/simple_stmts.html#the-import-statement)79 - [7.12. Инструкция `global`](https://python-all.ru/3/reference/simple_stmts.html#the-global-statement)80 - [7.13. Инструкция `nonlocal`](https://python-all.ru/3/reference/simple_stmts.html#the-nonlocal-statement)81 - [7.14. Инструкция `type`](https://python-all.ru/3/reference/simple_stmts.html#the-type-statement)82- [8. Составные инструкции](https://python-all.ru/3/reference/compound_stmts.html)8384 - [8.1. Инструкция `if`](https://python-all.ru/3/reference/compound_stmts.html#the-if-statement)85 - [8.2. Инструкция `while`](https://python-all.ru/3/reference/compound_stmts.html#the-while-statement)86 - [8.3. Инструкция `for`](https://python-all.ru/3/reference/compound_stmts.html#the-for-statement)87 - [8.4. Инструкция `try`](https://python-all.ru/3/reference/compound_stmts.html#the-try-statement)88 - [8.5. Инструкция `with`](https://python-all.ru/3/reference/compound_stmts.html#the-with-statement)89 - [8.6. Инструкция `match`](https://python-all.ru/3/reference/compound_stmts.html#the-match-statement)90 - [8.7. Определения функций](https://python-all.ru/3/reference/compound_stmts.html#function-definitions)91 - [8.8. Определения классов](https://python-all.ru/3/reference/compound_stmts.html#class-definitions)92 - [8.9. Корутины](https://python-all.ru/3/reference/compound_stmts.html#coroutines)93 - [8.10. Списки параметров типов](https://python-all.ru/3/reference/compound_stmts.html#type-parameter-lists)94 - [8.11. Аннотации](https://python-all.ru/3/reference/compound_stmts.html#annotations)95- [9. Компоненты верхнего уровня](https://python-all.ru/3/reference/toplevel_components.html)9697 - [9.1. Полные программы на Python](https://python-all.ru/3/reference/toplevel_components.html#complete-python-programs)98 - [9.2. Ввод из файла](https://python-all.ru/3/reference/toplevel_components.html#file-input)99 - [9.3. Интерактивный ввод](https://python-all.ru/3/reference/toplevel_components.html#interactive-input)100 - [9.4. Ввод выражений](https://python-all.ru/3/reference/toplevel_components.html#expression-input)101- [10. Полная спецификация грамматики](https://python-all.ru/3/reference/grammar.html)102