内容表

  • 具体对象层
    • 基础对象
    • 数值对象
    • 序列对象
    • 容器对象
    • 函数对象
    • 就业培训     下载中心     Wiki     联络
      登录   注册

      Log
      1. 首页
      2. Python 3.12.4
      3. 索引
      4. 模块
      5. 下一
      6. 上一
      7. Python/C API 参考手册
      8. 具体对象层

      具体对象层 ¶

      The functions in this chapter are specific to certain Python object types. Passing them an object of the wrong type is not a good idea; if you receive an object from a Python program and you are not sure that it has the right type, you must perform a type check first; for example, to check that an object is a dictionary, use PyDict_Check() . The chapter is structured like the “family tree” of Python object types.

      警告

      While the functions described in this chapter carefully check the type of the objects which are passed in, many of them do not check for NULL being passed instead of a valid object. Allowing NULL to be passed in can cause memory access violations and immediate termination of the interpreter.

      基础对象 ¶

      This section describes Python type objects and the singleton object None .

      • 类型对象
        • Creating Heap-Allocated Types
      • The None 对象

      数值对象 ¶

      • 整数对象
      • 布尔对象
      • 浮点对象
        • Pack and Unpack functions
          • Pack functions
          • Unpack functions
      • 复数对象
        • 作为 C 结构的复数
        • 作为 Python 对象的复数

      序列对象 ¶

      Generic operations on sequence objects were discussed in the previous chapter; this section deals with the specific kinds of sequence objects that are intrinsic to the Python language.

      • bytes 对象
      • 字节数组对象
        • 类型校验宏
        • 直接 API 函数
        • 宏
      • Unicode 对象和编解码器
        • Unicode 对象
          • Unicode 类型
          • Unicode 字符特性
          • 创建和访问 Unicode 字符串
          • 区域设置编码
          • 文件系统编码
          • wchar_t 支持
        • 内置编解码器
          • 一般编解码器
          • UTF-8 编解码器
          • UTF-32 编解码器
          • UTF-16 编解码器
          • UTF-7 编解码器
          • Unicode 转义编解码器
          • 原生 Unicode 转义编解码器
          • Latin-1 编解码器
          • ASCII 编解码器
          • 字符映射编解码器
          • 用于 Windows 的 MBCS 编解码器
          • Methods & Slots
        • 方法和槽函数
      • 元组对象
      • 结构序列对象
      • 列表对象

      容器对象 ¶

      • 字典对象
      • 集对象

      函数对象 ¶

      • 函数对象
      • 实例方法对象
      • 方法对象
      • 单元格对象
      • 代码对象
      • Extra information

      其它对象 ¶

      • 文件对象
      • 模块对象
        • 初始化 C 模块
          • 单阶段初始化
          • 多阶段初始化
          • 低级模块创建函数
          • 支持函数
        • 模块查找
      • 迭代器对象
      • 描述符对象
      • 切片对象
        • 省略对象
      • 内存视图对象
      • 弱引用对象
      • 胶囊
      • Frame Objects
        • Internal Frames
      • 生成器对象
      • 协程对象
      • Context Variables Objects
      • 日期时间对象
      • 用于类型提示的对象

      内容表

      • 具体对象层
        • 基础对象
        • 数值对象
        • 序列对象
        • 容器对象
        • 函数对象
        • 其它对象

      上一话题

      旧缓冲协议

      下一话题

      类型对象

      本页

      • 报告 Bug
      • 展示源

      快速搜索

      键入搜索术语或模块、类、函数名称。

      1. 首页
      2. Python 3.12.4
      3. 索引
      4. 模块
      5. 下一
      6. 上一
      7. Python/C API 参考手册
      8. 具体对象层

    版权所有  © 2014-2026 乐数软件    

    工业和信息化部: 粤ICP备14079481号-1