8. 数据类型¶
The modules described in this chapter provide a variety of specialized data types such as dates and times, fixed-type arrays, heap queues, synchronized queues, and sets.
Python also provides some built-in data types, in particular,
dict
, list
, set
and frozenset
, and
tuple
. The str
class is used to hold
Unicode strings, and the bytes
class is used to hold binary data.
本章包含以下模块的文档:
- 8.1.
datetime
— 基本的日期和时间类型 - 8.2.
calendar
— 日历相关函数 - 8.3.
collections
— 容器数据类型 - 8.4.
collections.abc
— 容器的抽象基类 - 8.5.
heapq
— 堆队列算法 - 8.6.
bisect
— 数组二分查找算法 - 8.7.
array
— 高效的数值数组 - 8.8.
weakref
— 弱引用 - 8.9.
types
— 动态类型创建和内置类型名称 - 8.10.
copy
— 浅层 (shallow) 和深层 (deep) 复制操作 - 8.11.
pprint
— 数据美化输出 - 8.12.
reprlib
— 另一种repr()
实现 - 8.13.
enum
— 枚举类型支持