首页 > Python > Python 3 标准库实例教程 > 数据结构
3.3. collections — 数据类型容器
目标:数据类型容器
collections
模块包含内置类型 list
、dict
和 tuple
之上的数据类型。
- ChainMap --- 多字典查询
- Counter --- 可哈希对象计数
- defaultdict --- 默认值字典
- deque --- 双向队列
- namedtuple --- 命名元组
- OrderedDict --- 有序字典
- collections.abc --- 容器的抽象基类
另请参阅
- 标准库 collections 的官方文档
- Python 2 到 3 的移植笔记 --- collections
- PEP 342 -- 通过增强生成器的协程
- PEP 492 -- async 和 await 语法的协程