ThinkSSL🔒 一键申购 5分钟快速签发 30天无理由退款 购买更放心 广告
### 导航 - [索引](../genindex.xhtml "总目录") - [模块](../py-modindex.xhtml "Python 模块索引") | - [下一页](type.xhtml "Type 对象") | - [上一页](objbuffer.xhtml "Old Buffer Protocol") | - ![](https://box.kancloud.cn/a721fc7ec672275e257bbbfde49a4d4e_16x16.png) - [Python](https://www.python.org/) » - zh\_CN 3.7.3 [文档](../index.xhtml) » - [Python/C API 参考手册](index.xhtml) » - $('.inline-search').show(0); | # 具体的对象层 本章中的函数特定于某些 Python 对象类型。 将错误类型的对象传递给它们并不是一个好主意;如果您从 Python 程序接收到一个对象,但不确定它是否具有正确的类型,则必须首先执行类型检查;例如,要检查对象是否为字典,请使用 [`PyDict_Check()`](dict.xhtml#c.PyDict_Check "PyDict_Check")。 本章的结构类似于 Python 对象类型的“家族树”。 警告 虽然本章描述的函数会仔细检查传入的对象的类型,但是其中许多函数不会检查传入的对象是否为NULL,而不是一个有效的对象。允许NULL传入可能会导致内存访问冲突和解释器的立即终止。 ## 基本对象 本节描述Python类型对象和单一实例对象 象None。 - [Type 对象](type.xhtml) - [`None` 对象](none.xhtml) ## 数值对象 - [整数型对象](long.xhtml) - [布尔对象](bool.xhtml) - [浮点数对象](float.xhtml) - [复数对象](complex.xhtml) - [表示复数的C结构体](complex.xhtml#complex-numbers-as-c-structures) - [表示复数的Python对象](complex.xhtml#complex-numbers-as-python-objects) ## 序列对象 序列对象的一般操作在前一章中讨论过;本节介绍Python语言固有的特定类型的序列对象。 - [字节对象](bytes.xhtml) - [字节数组对象](bytearray.xhtml) - [类型检查宏](bytearray.xhtml#type-check-macros) - [直接 API 函数](bytearray.xhtml#direct-api-functions) - [宏](bytearray.xhtml#macros) - [Unicode Objects and Codecs](unicode.xhtml) - [Unicode对象](unicode.xhtml#unicode-objects) - [Unicode类型](unicode.xhtml#unicode-type) - [Unicode字符属性](unicode.xhtml#unicode-character-properties) - [Creating and accessing Unicode strings](unicode.xhtml#creating-and-accessing-unicode-strings) - [Deprecated Py\_UNICODE APIs](unicode.xhtml#deprecated-py-unicode-apis) - [Locale Encoding](unicode.xhtml#locale-encoding) - [File System Encoding](unicode.xhtml#file-system-encoding) - [wchar\_t Support](unicode.xhtml#wchar-t-support) - [Built-in Codecs](unicode.xhtml#built-in-codecs) - [Generic Codecs](unicode.xhtml#generic-codecs) - [UTF-8 Codecs](unicode.xhtml#utf-8-codecs) - [UTF-32 Codecs](unicode.xhtml#utf-32-codecs) - [UTF-16 Codecs](unicode.xhtml#utf-16-codecs) - [UTF-7 Codecs](unicode.xhtml#utf-7-codecs) - [Unicode-Escape Codecs](unicode.xhtml#unicode-escape-codecs) - [Raw-Unicode-Escape Codecs](unicode.xhtml#raw-unicode-escape-codecs) - [Latin-1 Codecs](unicode.xhtml#latin-1-codecs) - [ASCII Codecs](unicode.xhtml#ascii-codecs) - [Character Map Codecs](unicode.xhtml#character-map-codecs) - [MBCS codecs for Windows](unicode.xhtml#mbcs-codecs-for-windows) - [Methods & Slots](unicode.xhtml#methods-slots) - [Methods and Slot Functions](unicode.xhtml#methods-and-slot-functions) - [元组对象](tuple.xhtml) - [Struct Sequence Objects](tuple.xhtml#struct-sequence-objects) - [列表对象](list.xhtml) ## 容器对象 - [字典对象](dict.xhtml) - [集合对象](set.xhtml) ## 函数对象 - [函数对象](function.xhtml) - [实例方法对象](method.xhtml) - [方法对象](method.xhtml#method-objects) - [Cell 对象](cell.xhtml) - [代码对象](code.xhtml) ## 其他对象 - [文件对象](file.xhtml) - [Module Objects](module.xhtml) - [Initializing C modules](module.xhtml#initializing-c-modules) - [Single-phase initialization](module.xhtml#single-phase-initialization) - [Multi-phase initialization](module.xhtml#multi-phase-initialization) - [Low-level module creation functions](module.xhtml#low-level-module-creation-functions) - [Support functions](module.xhtml#support-functions) - [Module lookup](module.xhtml#module-lookup) - [迭代器对象](iterator.xhtml) - [描述符对象](descriptor.xhtml) - [切片对象](slice.xhtml) - [Ellipsis Object](slice.xhtml#ellipsis-object) - [MemoryView 对象](memoryview.xhtml) - [弱引用对象](weakref.xhtml) - [胶囊](capsule.xhtml) - [生成器对象](gen.xhtml) - [协程对象](coro.xhtml) - [Context Variables Objects](contextvars.xhtml) - [DateTime 对象](datetime.xhtml) ### 导航 - [索引](../genindex.xhtml "总目录") - [模块](../py-modindex.xhtml "Python 模块索引") | - [下一页](type.xhtml "Type 对象") | - [上一页](objbuffer.xhtml "Old Buffer Protocol") | - ![](https://box.kancloud.cn/a721fc7ec672275e257bbbfde49a4d4e_16x16.png) - [Python](https://www.python.org/) » - zh\_CN 3.7.3 [文档](../index.xhtml) » - [Python/C API 参考手册](index.xhtml) » - $('.inline-search').show(0); | © [版权所有](../copyright.xhtml) 2001-2019, Python Software Foundation. Python 软件基金会是一个非盈利组织。 [请捐助。](https://www.python.org/psf/donations/) 最后更新于 5月 21, 2019. [发现了问题](../bugs.xhtml)? 使用[Sphinx](http://sphinx.pocoo.org/)1.8.4 创建。