8. 数据类型¶
本章节描述的模块提供了一系列专门的数据类型例如日期与实践,固定类型的数组,堆队列,同步队列与集合。
Python also provides some built-in data types, in particular,
dict
, list
, set
(which along with
frozenset
, replaces the deprecated sets
module), and
tuple
. The str
class can be used to handle binary data
and 8-bit text, and the unicode
class to handle Unicode text.
本章记录以下模块:
- 8.1.
datetime
— 基础日期/时间数据类型 - 8.2.
calendar
— General calendar-related functions - 8.3.
collections
— High-performance container datatypes - 8.4.
heapq
— Heap queue algorithm - 8.5.
bisect
— Array bisection algorithm - 8.6.
array
— Efficient arrays of numeric values - 8.7.
sets
— Unordered collections of unique elements - 8.8.
sched
— 事件调度器 - 8.9.
mutex
— Mutual exclusion support - 8.10.
Queue
— A synchronized queue class - 8.11.
weakref
— 弱引用 - 8.12.
UserDict
— Class wrapper for dictionary objects - 8.13.
UserList
— Class wrapper for list objects - 8.14.
UserString
— Class wrapper for string objects - 8.15.
types
— Names for built-in types - 8.16.
new
— Creation of runtime internal objects - 8.17.
copy
— 浅层 (shallow) 和深层 (deep) 复制操作 - 8.18.
pprint
— 数据美化输出 - 8.19.
repr
— Alternaterepr()
implementation