数据类型¶
本章节描述的模块提供了一系列专门的数据类型例如日期与实践,固定类型的数组,堆队列,同步队列与集合。
Python 同样提供一些内置的数据类型,特别的, dict
, list
, set
与 fromzenset
以及 tuple
。 str
类通常指 Unicode 字符串,并且 bytes
通常指二进制数据。
本章记录以下模块:
datetime
--- 基础日期/时间数据类型calendar
--- General calendar-related functionscollections
--- 容器数据类型collections.abc
--- 容器的抽象基类heapq
--- Heap queue algorithmbisect
--- Array bisection algorithmarray
--- Efficient arrays of numeric valuesweakref
--- 弱引用types
--- Dynamic type creation and names for built-in typescopy
--- 浅层 (shallow) 和深层 (deep) 复制操作pprint
--- 数据美化输出reprlib
--- Alternaterepr()
implementationenum
--- Support for enumerations- 模块内容
- Creating an Enum
- Programmatic access to enumeration members and their attributes
- Duplicating enum members and values
- Ensuring unique enumeration values
- Using automatic values
- Iteration
- 比较
- Allowed members and attributes of enumerations
- Restricted Enum subclassing
- Pickling
- Functional API
- Derived Enumerations
- Interesting examples
- How are Enums different?