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

concrete.md

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

1> **Источник:** https://python-all.ru/3.4/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.4/c-api/dict.html#c.PyDict_Check). Глава построена по принципу «родословного дерева» типов объектов Python.1011> **Предупреждение**12>13> Хотя функции, описанные в этой главе, тщательно проверяют тип передаваемых объектов, многие из них не проверяют, не передан ли *NULL* вместо допустимого объекта. Передача *NULL* может привести к нарушениям доступа к памяти и немедленному завершению интерпретатора.1415## Фундаментальные объекты1617В этом разделе описываются объекты типов Python и объект-одиночка `None`.1819- [Объекты типов](https://python-all.ru/3.4/c-api/type.html)20- [Объект None](https://python-all.ru/3.4/c-api/none.html)2122## Числовые объекты2324- [Объекты целых чисел](https://python-all.ru/3.4/c-api/long.html)25- [Объекты логических значений](https://python-all.ru/3.4/c-api/bool.html)26- [Объекты чисел с плавающей запятой](https://python-all.ru/3.4/c-api/float.html)27- [Объекты комплексных чисел](https://python-all.ru/3.4/c-api/complex.html)2829  - [Комплексные числа как структуры C](https://python-all.ru/3.4/c-api/complex.html#complex-numbers-as-c-structures)30  - [Комплексные числа как объекты Python](https://python-all.ru/3.4/c-api/complex.html#complex-numbers-as-python-objects)3132## Объекты последовательностей3334Общие операции над объектами последовательностей были рассмотрены в предыдущей главе; в этом разделе рассматриваются конкретные виды объектов последовательностей, встроенные в язык Python.3536- [Объекты bytes](https://python-all.ru/3.4/c-api/bytes.html)37- [Объекты массива байтов](https://python-all.ru/3.4/c-api/bytearray.html)3839  - [Макросы проверки типа](https://python-all.ru/3.4/c-api/bytearray.html#type-check-macros)40  - [Функции прямого API](https://python-all.ru/3.4/c-api/bytearray.html#direct-api-functions)41  - [Макросы](https://python-all.ru/3.4/c-api/bytearray.html#macros)42- [Объекты Unicode и кодеки](https://python-all.ru/3.4/c-api/unicode.html)4344  - [Объекты Unicode](https://python-all.ru/3.4/c-api/unicode.html#unicode-objects)4546    - [Тип Юникода](https://python-all.ru/3.4/c-api/unicode.html#unicode-type)47    - [Свойства символов Юникода](https://python-all.ru/3.4/c-api/unicode.html#unicode-character-properties)48    - [Создание и доступ к строкам Юникода](https://python-all.ru/3.4/c-api/unicode.html#creating-and-accessing-unicode-strings)49    - [Устаревшие API Py\_UNICODE](https://python-all.ru/3.4/c-api/unicode.html#deprecated-py-unicode-apis)50    - [Локальная кодировка](https://python-all.ru/3.4/c-api/unicode.html#locale-encoding)51    - [Кодировка файловой системы](https://python-all.ru/3.4/c-api/unicode.html#file-system-encoding)52    - [Поддержка wchar\_t](https://python-all.ru/3.4/c-api/unicode.html#wchar-t-support)53    - [Поддержка UCS4](https://python-all.ru/3.4/c-api/unicode.html#ucs4-support)54  - [Встроенные кодеки](https://python-all.ru/3.4/c-api/unicode.html#built-in-codecs)5556    - [Общие кодеки](https://python-all.ru/3.4/c-api/unicode.html#generic-codecs)57    - [Кодеки UTF-8](https://python-all.ru/3.4/c-api/unicode.html#utf-8-codecs)58    - [Кодеки UTF-32](https://python-all.ru/3.4/c-api/unicode.html#utf-32-codecs)59    - [Кодеки UTF-16](https://python-all.ru/3.4/c-api/unicode.html#utf-16-codecs)60    - [Кодеки UTF-7](https://python-all.ru/3.4/c-api/unicode.html#utf-7-codecs)61    - [Кодеки Unicode-Escape](https://python-all.ru/3.4/c-api/unicode.html#unicode-escape-codecs)62    - [Кодеки Raw-Unicode-Escape](https://python-all.ru/3.4/c-api/unicode.html#raw-unicode-escape-codecs)63    - [Кодеки Latin-1](https://python-all.ru/3.4/c-api/unicode.html#latin-1-codecs)64    - [Кодеки ASCII](https://python-all.ru/3.4/c-api/unicode.html#ascii-codecs)65    - [Кодеки символьной карты](https://python-all.ru/3.4/c-api/unicode.html#character-map-codecs)66    - [Кодеки MBCS для Windows](https://python-all.ru/3.4/c-api/unicode.html#mbcs-codecs-for-windows)67    - [Методы и слоты](https://python-all.ru/3.4/c-api/unicode.html#methods-slots)68  - [Методы и слот-функции](https://python-all.ru/3.4/c-api/unicode.html#methods-and-slot-functions)69- [Кортежи](https://python-all.ru/3.4/c-api/tuple.html)70- [Объекты структурных последовательностей](https://python-all.ru/3.4/c-api/tuple.html#struct-sequence-objects)71- [Списки](https://python-all.ru/3.4/c-api/list.html)7273## Объекты-контейнеры7475- [Объекты словарей](https://python-all.ru/3.4/c-api/dict.html)76- [Множества](https://python-all.ru/3.4/c-api/set.html)7778## Объекты функций7980- [Объекты функций](https://python-all.ru/3.4/c-api/function.html)81- [Объекты методов экземпляра](https://python-all.ru/3.4/c-api/method.html)82- [Объекты методов](https://python-all.ru/3.4/c-api/method.html#method-objects)83- [Объекты ячеек](https://python-all.ru/3.4/c-api/cell.html)84- [Объекты кода](https://python-all.ru/3.4/c-api/code.html)8586## Другие объекты8788- [Объекты файлов](https://python-all.ru/3.4/c-api/file.html)89- [Объекты модулей](https://python-all.ru/3.4/c-api/module.html)9091  - [Инициализация C-модулей](https://python-all.ru/3.4/c-api/module.html#initializing-c-modules)92- [Объекты итераторов](https://python-all.ru/3.4/c-api/iterator.html)93- [Объекты дескрипторов](https://python-all.ru/3.4/c-api/descriptor.html)94- [Объекты срезов](https://python-all.ru/3.4/c-api/slice.html)95- [Объекты memoryview](https://python-all.ru/3.4/c-api/memoryview.html)96- [Объекты слабых ссылок](https://python-all.ru/3.4/c-api/weakref.html)97- [Капсулы](https://python-all.ru/3.4/c-api/capsule.html)98- [Объекты-генераторы](https://python-all.ru/3.4/c-api/gen.html)99- [Объекты datetime](https://python-all.ru/3.4/c-api/datetime.html)100