数据类型
********

The modules described in this chapter provide a variety of specialized
data types such as dates and times, fixed-type arrays, heap queues,
double-ended queues, and enumerations.

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" and "bytearray" classes are
used to hold binary data.

本章包含以下模块的文档：

* "datetime" --- 基本的日期和时间类型

  * Aware and Naive Objects

  * Constants

  * 有效的类型

    * Common Properties

    * Determining if an Object is Aware or Naive

  * "timedelta" 类对象

    * Examples of usage: "timedelta"

  * "date" 对象

    * Examples of Usage: "date"

  * "datetime" 对象

    * Examples of Usage: "datetime"

  * "time" 对象

    * Examples of Usage: "time"

  * "tzinfo" 对象

  * "timezone" 对象

  * "strftime()" 和 "strptime()" 的行为

    * "strftime()" and "strptime()" Format Codes

    * Technical Detail

* "calendar" --- 日历相关函数

* "collections" --- 容器数据类型

  * "ChainMap" 对象

    * "ChainMap" 例子和方法

  * "Counter" 对象

  * "deque" 对象

    * "deque" 用法

  * "defaultdict" 对象

    * "defaultdict" 例子

  * "namedtuple()" 命名元组的工厂函数

  * "OrderedDict" 对象

    * "OrderedDict" 例子和用法

  * "UserDict" 对象

  * "UserList" 对象

  * "UserString" 对象

* "collections.abc" --- 容器的抽象基类

  * 容器抽象基类

* "heapq" --- 堆队列算法

  * 基本示例

  * 优先队列实现说明

  * 理论

* "bisect" --- 数组二分查找算法

  * 搜索有序列表

  * 其他示例

* "array" --- 高效的数值数组

* "weakref" --- 弱引用

  * 弱引用对象

  * 示例

  * 终结器对象

  * 比较终结器与 "__del__()" 方法

* "types" --- 动态类型创建和内置类型名称

  * 动态类型创建

  * 标准解释器类型

  * 附加工具类和函数

  * Coroutine Utility Functions

* "copy" --- 浅层 (shallow) 和深层 (deep) 复制操作

* "pprint" --- 数据美化输出

  * PrettyPrinter Objects

  * 示例

* "reprlib" --- Alternate "repr()" implementation

  * Repr Objects

  * Subclassing Repr Objects

* "enum" --- 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

    * IntEnum

    * IntFlag

    * 标志

    * Others

  * When to use "__new__()" vs. "__init__()"

  * Interesting examples

    * Omitting values

      * Using "auto"

      * Using "object"

      * Using a descriptive string

      * Using a custom "__new__()"

    * OrderedEnum

    * DuplicateFreeEnum

    * Planet

    * TimePeriod

  * How are Enums different?

    * Enum Classes

    * Enum Members (aka instances)

    * Finer Points

      * Supported "__dunder__" names

      * Supported "_sunder_" names

      * "Enum" member type

      * Boolean value of "Enum" classes and members

      * "Enum" classes with methods

      * Combining members of "Flag"
