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

concrete.md

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

1> **Источник:** https://python-all.ru/3.13/c-api/concrete.html2>3> «Документация Python на русском» – неофициальный перевод официальной документации Python: версии от 2.6 до 3.16, полнотекстовый поиск, английский оригинал рядом с переводом. Эта Markdown-версия страницы предназначена для работы с LLM: вставьте её в ChatGPT, Claude или Cursor.45---67# Слой конкретных объектов89Функции из этой главы относятся к определённым типам объектов Python. Передача им объекта неправильного типа не рекомендуется; если объект получен из программы на Python и нет уверенности, что он имеет правильный тип, необходимо сначала выполнить проверку типа; например, чтобы проверить, является ли объект словарём, используйте [`PyDict_Check()`](https://python-all.ru/3.13/c-api/dict.html#c.PyDict_Check). Глава построена по принципу «родословного дерева» типов объектов Python.1011> **Предупреждение**12>13> Хотя функции, описанные в этой главе, тщательно проверяют тип передаваемых объектов, многие из них не проверяют, не передан ли `NULL` вместо допустимого объекта. Допуск `NULL` может привести к нарушениям доступа к памяти и немедленному завершению интерпретатора.1415## Фундаментальные объекты1617В этом разделе описаны объекты типов Python и синглтон `None`.1819- [Объекты типов](https://python-all.ru/3.13/c-api/type.html)2021  - [Создание типов, размещаемых в куче](https://python-all.ru/3.13/c-api/type.html#creating-heap-allocated-types)22- [Объект `None`](https://python-all.ru/3.13/c-api/none.html)2324## Числовые объекты2526- [Объекты целых чисел](https://python-all.ru/3.13/c-api/long.html)27- [Объекты логических значений](https://python-all.ru/3.13/c-api/bool.html)28- [Объекты чисел с плавающей запятой](https://python-all.ru/3.13/c-api/float.html)2930  - [Функции упаковки и распаковки](https://python-all.ru/3.13/c-api/float.html#pack-and-unpack-functions)3132    - [Функции упаковки](https://python-all.ru/3.13/c-api/float.html#pack-functions)33    - [Функции распаковки](https://python-all.ru/3.13/c-api/float.html#unpack-functions)34- [Объекты комплексных чисел](https://python-all.ru/3.13/c-api/complex.html)3536  - [Комплексные числа как структуры C](https://python-all.ru/3.13/c-api/complex.html#complex-numbers-as-c-structures)37  - [Комплексные числа как объекты Python](https://python-all.ru/3.13/c-api/complex.html#complex-numbers-as-python-objects)3839## Объекты последовательностей4041Общие операции над объектами последовательностей были рассмотрены в предыдущей главе; в этом разделе рассматриваются конкретные виды объектов последовательностей, встроенные в язык Python.4243- [Объекты bytes](https://python-all.ru/3.13/c-api/bytes.html)44- [Объекты массива байтов](https://python-all.ru/3.13/c-api/bytearray.html)4546  - [Макросы проверки типа](https://python-all.ru/3.13/c-api/bytearray.html#type-check-macros)47  - [Функции прямого API](https://python-all.ru/3.13/c-api/bytearray.html#direct-api-functions)48  - [Макросы](https://python-all.ru/3.13/c-api/bytearray.html#macros)49- [Объекты Unicode и кодеки](https://python-all.ru/3.13/c-api/unicode.html)5051  - [Объекты Unicode](https://python-all.ru/3.13/c-api/unicode.html#unicode-objects)5253    - [Тип Юникода](https://python-all.ru/3.13/c-api/unicode.html#unicode-type)54    - [Свойства символов Юникода](https://python-all.ru/3.13/c-api/unicode.html#unicode-character-properties)55    - [Создание и доступ к строкам Юникода](https://python-all.ru/3.13/c-api/unicode.html#creating-and-accessing-unicode-strings)56    - [Локальная кодировка](https://python-all.ru/3.13/c-api/unicode.html#locale-encoding)57    - [Кодировка файловой системы](https://python-all.ru/3.13/c-api/unicode.html#file-system-encoding)58    - [Поддержка wchar\_t](https://python-all.ru/3.13/c-api/unicode.html#wchar-t-support)59  - [Встроенные кодеки](https://python-all.ru/3.13/c-api/unicode.html#built-in-codecs)6061    - [Общие кодеки](https://python-all.ru/3.13/c-api/unicode.html#generic-codecs)62    - [Кодеки UTF-8](https://python-all.ru/3.13/c-api/unicode.html#utf-8-codecs)63    - [Кодеки UTF-32](https://python-all.ru/3.13/c-api/unicode.html#utf-32-codecs)64    - [Кодеки UTF-16](https://python-all.ru/3.13/c-api/unicode.html#utf-16-codecs)65    - [Кодеки UTF-7](https://python-all.ru/3.13/c-api/unicode.html#utf-7-codecs)66    - [Кодеки Unicode-Escape](https://python-all.ru/3.13/c-api/unicode.html#unicode-escape-codecs)67    - [Кодеки Raw-Unicode-Escape](https://python-all.ru/3.13/c-api/unicode.html#raw-unicode-escape-codecs)68    - [Кодеки Latin-1](https://python-all.ru/3.13/c-api/unicode.html#latin-1-codecs)69    - [Кодеки ASCII](https://python-all.ru/3.13/c-api/unicode.html#ascii-codecs)70    - [Кодеки символьной карты](https://python-all.ru/3.13/c-api/unicode.html#character-map-codecs)71    - [Кодеки MBCS для Windows](https://python-all.ru/3.13/c-api/unicode.html#mbcs-codecs-for-windows)72  - [Методы и слот-функции](https://python-all.ru/3.13/c-api/unicode.html#methods-and-slot-functions)73- [Кортежи](https://python-all.ru/3.13/c-api/tuple.html)74- [Объекты структурных последовательностей](https://python-all.ru/3.13/c-api/tuple.html#struct-sequence-objects)75- [Списки](https://python-all.ru/3.13/c-api/list.html)7677## Объекты-контейнеры7879- [Объекты словарей](https://python-all.ru/3.13/c-api/dict.html)8081  - [Объекты представлений словарей](https://python-all.ru/3.13/c-api/dict.html#dictionary-view-objects)82  - [Упорядоченные словари](https://python-all.ru/3.13/c-api/dict.html#ordered-dictionaries)83- [Множества](https://python-all.ru/3.13/c-api/set.html)8485## Объекты функций8687- [Объекты функций](https://python-all.ru/3.13/c-api/function.html)88- [Объекты методов экземпляра](https://python-all.ru/3.13/c-api/method.html)89- [Объекты методов](https://python-all.ru/3.13/c-api/method.html#method-objects)90- [Объекты ячеек](https://python-all.ru/3.13/c-api/cell.html)91- [Объекты кода](https://python-all.ru/3.13/c-api/code.html)92- [Флаги объектов кода](https://python-all.ru/3.13/c-api/code.html#code-object-flags)93- [Дополнительная информация](https://python-all.ru/3.13/c-api/code.html#extra-information)9495## Другие объекты9697- [Объекты файлов](https://python-all.ru/3.13/c-api/file.html)98- [Объекты модулей](https://python-all.ru/3.13/c-api/module.html)99100  - [Инициализация C-модулей](https://python-all.ru/3.13/c-api/module.html#initializing-c-modules)101102    - [Однофазная инициализация](https://python-all.ru/3.13/c-api/module.html#single-phase-initialization)103    - [Многофазная инициализация](https://python-all.ru/3.13/c-api/module.html#multi-phase-initialization)104    - [Функции низкоуровневого создания модулей](https://python-all.ru/3.13/c-api/module.html#low-level-module-creation-functions)105    - [Вспомогательные функции](https://python-all.ru/3.13/c-api/module.html#support-functions)106  - [Поиск модуля](https://python-all.ru/3.13/c-api/module.html#module-lookup)107- [Объекты итераторов](https://python-all.ru/3.13/c-api/iterator.html)108109  - [Объекты range](https://python-all.ru/3.13/c-api/iterator.html#range-objects)110  - [Встроенные типы итераторов](https://python-all.ru/3.13/c-api/iterator.html#builtin-iterator-types)111  - [Прочие объекты итераторов](https://python-all.ru/3.13/c-api/iterator.html#other-iterator-objects)112- [Объекты дескрипторов](https://python-all.ru/3.13/c-api/descriptor.html)113114  - [Встроенные дескрипторы](https://python-all.ru/3.13/c-api/descriptor.html#built-in-descriptors)115- [Объекты срезов](https://python-all.ru/3.13/c-api/slice.html)116117  - [Объект Ellipsis](https://python-all.ru/3.13/c-api/slice.html#ellipsis-object)118- [Объекты memoryview](https://python-all.ru/3.13/c-api/memoryview.html)119- [Объекты буфера pickle](https://python-all.ru/3.13/c-api/picklebuffer.html)120- [Объекты слабых ссылок](https://python-all.ru/3.13/c-api/weakref.html)121- [Капсулы](https://python-all.ru/3.13/c-api/capsule.html)122- [Объекты фреймов](https://python-all.ru/3.13/c-api/frame.html)123124  - [Прокси локальных переменных фрейма](https://python-all.ru/3.13/c-api/frame.html#frame-locals-proxies)125  - [Устаревшие API для локальных переменных](https://python-all.ru/3.13/c-api/frame.html#legacy-local-variable-apis)126  - [Внутренние фреймы](https://python-all.ru/3.13/c-api/frame.html#internal-frames)127- [Объекты-генераторы](https://python-all.ru/3.13/c-api/gen.html)128129  - [Объекты асинхронных генераторов](https://python-all.ru/3.13/c-api/gen.html#asynchronous-generator-objects)130- [Объекты корутин](https://python-all.ru/3.13/c-api/coro.html)131- [Объекты контекстных переменных](https://python-all.ru/3.13/c-api/contextvars.html)132- [Объекты для аннотации типов](https://python-all.ru/3.13/c-api/typehints.html)133134## C API для модулей расширения135136- [C API библиотеки curses](https://python-all.ru/3.13/c-api/curses.html)137- [Внутренние данные](https://python-all.ru/3.13/c-api/curses.html#internal-data)138- [Объекты datetime](https://python-all.ru/3.13/c-api/datetime.html)139- [Внутренние данные](https://python-all.ru/3.13/c-api/datetime.html#internal-data)140