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

index.md

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

1> **Источник:** https://python-all.ru/3.11/c-api/index.html2>3> «Документация Python на русском» – неофициальный перевод официальной документации Python: версии от 2.6 до 3.16, полнотекстовый поиск, английский оригинал рядом с переводом. Эта Markdown-версия страницы предназначена для работы с LLM: вставьте её в ChatGPT, Claude или Cursor.45---67# Справочное руководство по Python/C API89В данном руководстве описано API для программистов на C и C++, которые хотят создавать модули расширения или встраивать Python. Оно является дополнением к [Расширение и встраивание интерпретатора Python](https://python-all.ru/3.11/extending/index.html#extending-index), в котором описаны общие принципы написания расширений, но нет подробной документации по функциям API.1011- [Введение](https://python-all.ru/3.11/c-api/intro.html)1213  - [Стандарты кодирования](https://python-all.ru/3.11/c-api/intro.html#coding-standards)14  - [Заголовочные файлы](https://python-all.ru/3.11/c-api/intro.html#include-files)15  - [Полезные макросы](https://python-all.ru/3.11/c-api/intro.html#useful-macros)16  - [Объекты, типы и счетчики ссылок](https://python-all.ru/3.11/c-api/intro.html#objects-types-and-reference-counts)17  - [Исключения](https://python-all.ru/3.11/c-api/intro.html#exceptions)18  - [Встраивание Python](https://python-all.ru/3.11/c-api/intro.html#embedding-python)19  - [Отладочные сборки](https://python-all.ru/3.11/c-api/intro.html#debugging-builds)20- [Стабильность C API](https://python-all.ru/3.11/c-api/stable.html)2122  - [Стабильный ABI](https://python-all.ru/3.11/c-api/stable.html#stable-application-binary-interface)23  - [Особенности платформ](https://python-all.ru/3.11/c-api/stable.html#platform-considerations)24  - [Содержимое ограниченного API](https://python-all.ru/3.11/c-api/stable.html#contents-of-limited-api)25- [Очень высокоуровневый слой](https://python-all.ru/3.11/c-api/veryhigh.html)26- [Подсчёт ссылок](https://python-all.ru/3.11/c-api/refcounting.html)27- [Обработка исключений](https://python-all.ru/3.11/c-api/exceptions.html)2829  - [Вывод и очистка](https://python-all.ru/3.11/c-api/exceptions.html#printing-and-clearing)30  - [Возбуждение исключений](https://python-all.ru/3.11/c-api/exceptions.html#raising-exceptions)31  - [Выдача предупреждений](https://python-all.ru/3.11/c-api/exceptions.html#issuing-warnings)32  - [Запрос индикатора ошибки](https://python-all.ru/3.11/c-api/exceptions.html#querying-the-error-indicator)33  - [Обработка сигналов](https://python-all.ru/3.11/c-api/exceptions.html#signal-handling)34  - [Классы исключений](https://python-all.ru/3.11/c-api/exceptions.html#exception-classes)35  - [Объекты исключений](https://python-all.ru/3.11/c-api/exceptions.html#exception-objects)36  - [Объекты исключений Unicode](https://python-all.ru/3.11/c-api/exceptions.html#unicode-exception-objects)37  - [Управление рекурсией](https://python-all.ru/3.11/c-api/exceptions.html#recursion-control)38  - [Стандартные исключения](https://python-all.ru/3.11/c-api/exceptions.html#standard-exceptions)39  - [Стандартные категории предупреждений](https://python-all.ru/3.11/c-api/exceptions.html#standard-warning-categories)40- [Утилиты](https://python-all.ru/3.11/c-api/utilities.html)4142  - [Утилиты операционной системы](https://python-all.ru/3.11/c-api/sys.html)43  - [Системные функции](https://python-all.ru/3.11/c-api/sys.html#system-functions)44  - [Управление процессами](https://python-all.ru/3.11/c-api/sys.html#process-control)45  - [Импорт модулей](https://python-all.ru/3.11/c-api/import.html)46  - [Поддержка маршалинга данных](https://python-all.ru/3.11/c-api/marshal.html)47  - [Разбор аргументов и сборка значений](https://python-all.ru/3.11/c-api/arg.html)48  - [Преобразование и форматирование строк](https://python-all.ru/3.11/c-api/conversion.html)49  - [API PyHash](https://python-all.ru/3.11/c-api/hash.html)50  - [Рефлексия](https://python-all.ru/3.11/c-api/reflection.html)51  - [Реестр кодировок и вспомогательные функции](https://python-all.ru/3.11/c-api/codec.html)52- [Слой абстрактных объектов](https://python-all.ru/3.11/c-api/abstract.html)5354  - [Протокол объекта](https://python-all.ru/3.11/c-api/object.html)55  - [Протокол вызова](https://python-all.ru/3.11/c-api/call.html)56  - [Протокол чисел](https://python-all.ru/3.11/c-api/number.html)57  - [Протокол последовательностей](https://python-all.ru/3.11/c-api/sequence.html)58  - [Протокол отображений](https://python-all.ru/3.11/c-api/mapping.html)59  - [Протокол итератора](https://python-all.ru/3.11/c-api/iter.html)60  - [Протокол буфера](https://python-all.ru/3.11/c-api/buffer.html)61  - [Старый буферный протокол](https://python-all.ru/3.11/c-api/objbuffer.html)62- [Слой конкретных объектов](https://python-all.ru/3.11/c-api/concrete.html)6364  - [Базовые объекты](https://python-all.ru/3.11/c-api/concrete.html#fundamental-objects)65  - [Числовые объекты](https://python-all.ru/3.11/c-api/concrete.html#numeric-objects)66  - [Объекты последовательностей](https://python-all.ru/3.11/c-api/concrete.html#sequence-objects)67  - [Объекты контейнеров](https://python-all.ru/3.11/c-api/concrete.html#container-objects)68  - [Объекты функций](https://python-all.ru/3.11/c-api/concrete.html#function-objects)69  - [Прочие объекты](https://python-all.ru/3.11/c-api/concrete.html#other-objects)70- [Инициализация, финализация и потоки](https://python-all.ru/3.11/c-api/init.html)7172  - [Перед инициализацией Python](https://python-all.ru/3.11/c-api/init.html#before-python-initialization)73  - [Глобальные переменные конфигурации](https://python-all.ru/3.11/c-api/init.html#global-configuration-variables)74  - [Инициализация и финализация интерпретатора](https://python-all.ru/3.11/c-api/init.html#initializing-and-finalizing-the-interpreter)75  - [Параметры уровня процесса](https://python-all.ru/3.11/c-api/init.html#process-wide-parameters)76  - [Состояние потока и глобальная блокировка интерпретатора](https://python-all.ru/3.11/c-api/init.html#thread-state-and-the-global-interpreter-lock)77  - [Поддержка под-интерпретаторов](https://python-all.ru/3.11/c-api/init.html#sub-interpreter-support)78  - [Асинхронные уведомления](https://python-all.ru/3.11/c-api/init.html#asynchronous-notifications)79  - [Профилирование и трассировка](https://python-all.ru/3.11/c-api/init.html#profiling-and-tracing)80  - [Расширенная поддержка отладчика](https://python-all.ru/3.11/c-api/init.html#advanced-debugger-support)81  - [Поддержка локального хранилища потоков](https://python-all.ru/3.11/c-api/init.html#thread-local-storage-support)82- [Конфигурация инициализации Python](https://python-all.ru/3.11/c-api/init_config.html)8384  - [Пример](https://python-all.ru/3.11/c-api/init_config.html#example)85  - [PyWideStringList](https://python-all.ru/3.11/c-api/init_config.html#pywidestringlist)86  - [PyStatus](https://python-all.ru/3.11/c-api/init_config.html#pystatus)87  - [PyPreConfig](https://python-all.ru/3.11/c-api/init_config.html#pypreconfig)88  - [Предварительная инициализация Python с помощью PyPreConfig](https://python-all.ru/3.11/c-api/init_config.html#preinitialize-python-with-pypreconfig)89  - [PyConfig](https://python-all.ru/3.11/c-api/init_config.html#pyconfig)90  - [Инициализация с помощью PyConfig](https://python-all.ru/3.11/c-api/init_config.html#initialization-with-pyconfig)91  - [Изолированная конфигурация](https://python-all.ru/3.11/c-api/init_config.html#isolated-configuration)92  - [Конфигурация Python](https://python-all.ru/3.11/c-api/init_config.html#python-configuration)93  - [Конфигурация путей Python](https://python-all.ru/3.11/c-api/init_config.html#python-path-configuration)94  - [Py\_RunMain()](https://python-all.ru/3.11/c-api/init_config.html#py-runmain)95  - [Py\_GetArgcArgv()](https://python-all.ru/3.11/c-api/init_config.html#py-getargcargv)96  - [Приватный предварительный API многофазной инициализации](https://python-all.ru/3.11/c-api/init_config.html#multi-phase-initialization-private-provisional-api)97- [Управление памятью](https://python-all.ru/3.11/c-api/memory.html)9899  - [Обзор](https://python-all.ru/3.11/c-api/memory.html#overview)100  - [Домены аллокаторов](https://python-all.ru/3.11/c-api/memory.html#allocator-domains)101  - [Интерфейс низкоуровневой памяти](https://python-all.ru/3.11/c-api/memory.html#raw-memory-interface)102  - [Интерфейс памяти](https://python-all.ru/3.11/c-api/memory.html#memory-interface)103  - [Аллокаторы объектов](https://python-all.ru/3.11/c-api/memory.html#object-allocators)104  - [Аллокаторы памяти по умолчанию](https://python-all.ru/3.11/c-api/memory.html#default-memory-allocators)105  - [Настройка аллокаторов памяти](https://python-all.ru/3.11/c-api/memory.html#customize-memory-allocators)106  - [Отладочные перехватчики аллокаторов памяти Python](https://python-all.ru/3.11/c-api/memory.html#debug-hooks-on-the-python-memory-allocators)107  - [Аллокатор pymalloc](https://python-all.ru/3.11/c-api/memory.html#the-pymalloc-allocator)108  - [C API модуля tracemalloc](https://python-all.ru/3.11/c-api/memory.html#tracemalloc-c-api)109  - [Примеры](https://python-all.ru/3.11/c-api/memory.html#examples)110- [Поддержка реализации объектов](https://python-all.ru/3.11/c-api/objimpl.html)111112  - [Выделение объектов в куче](https://python-all.ru/3.11/c-api/allocation.html)113  - [Общие структуры объектов](https://python-all.ru/3.11/c-api/structures.html)114  - [Объекты типов](https://python-all.ru/3.11/c-api/typeobj.html)115  - [Структуры числовых объектов](https://python-all.ru/3.11/c-api/typeobj.html#number-object-structures)116  - [Структуры объектов отображений](https://python-all.ru/3.11/c-api/typeobj.html#mapping-object-structures)117  - [Структуры объектов последовательностей](https://python-all.ru/3.11/c-api/typeobj.html#sequence-object-structures)118  - [Структуры буферных объектов](https://python-all.ru/3.11/c-api/typeobj.html#buffer-object-structures)119  - [Структуры асинхронных объектов](https://python-all.ru/3.11/c-api/typeobj.html#async-object-structures)120  - [typedefs типов слотов](https://python-all.ru/3.11/c-api/typeobj.html#slot-type-typedefs)121  - [Примеры](https://python-all.ru/3.11/c-api/typeobj.html#examples)122  - [Поддержка циклической сборки мусора](https://python-all.ru/3.11/c-api/gcsupport.html)123- [Версионирование API и ABI](https://python-all.ru/3.11/c-api/apiabiversion.html)124