数据类型¶
本章所描述的模块提供了许多专门的数据类型,如日期和时间、固定类型的数组、堆队列、双端队列、以及枚举。
Python也提供一些内置数据类型,特别是,dict、 list、set、frozenset、以及 tuple。str 这个类是用来存储Unicode字符串的,而 bytes 和 bytearray 这两个类是用来存储二进制数据的。
本章包含以下模块的文档:
- datetime--- 基本日期和时间类型- 感知型对象和简单型对象
- 常量
- 有效的类型
- timedelta类对象
- date对象
- datetime对象- datetime
- today()
- now()
- utcnow()
- fromtimestamp()
- utcfromtimestamp()
- fromordinal()
- combine()
- fromisoformat()
- fromisocalendar()
- strptime()
- min
- max
- resolution
- year
- month
- day
- hour
- minute
- second
- microsecond
- tzinfo
- fold
- date()
- time()
- timetz()
- replace()
- astimezone()
- utcoffset()
- dst()
- tzname()
- timetuple()
- utctimetuple()
- toordinal()
- timestamp()
- weekday()
- isoweekday()
- isocalendar()
- isoformat()
- __str__()
- ctime()
- strftime()
- __format__()
- 用法示例: datetime
 
- time对象
- tzinfo对象
- timezone对象
- strftime()和- strptime()的行为
 
- zoneinfo--- IANA 时区支持
- calendar--- 通用日历相关函数- Calendar
- TextCalendar
- HTMLCalendar
- LocaleTextCalendar
- LocaleHTMLCalendar
- setfirstweekday()
- firstweekday()
- isleap()
- leapdays()
- weekday()
- weekheader()
- monthrange()
- monthcalendar()
- prmonth()
- month()
- prcal()
- calendar()
- timegm()
- day_name
- day_abbr
- MONDAY
- TUESDAY
- WEDNESDAY
- THURSDAY
- FRIDAY
- SATURDAY
- SUNDAY
- Day
- month_name
- month_abbr
- JANUARY
- FEBRUARY
- MARCH
- APRIL
- MAY
- JUNE
- JULY
- AUGUST
- SEPTEMBER
- OCTOBER
- NOVEMBER
- DECEMBER
- Month
- IllegalMonthError
- IllegalWeekdayError
- 命令行用法
 
- collections--- 容器数据类型
- collections.abc--- 容器的抽象基类
- heapq--- 堆队列算法
- bisect--- 数组二分算法
- array--- 高效的数字值数组
- weakref--- 弱引用
- types--- 动态类型创建和内置类型名称- 动态类型创建
- 标准解释器类型- NoneType
- FunctionType
- LambdaType
- GeneratorType
- CoroutineType
- AsyncGeneratorType
- CodeType
- CellType
- MethodType
- BuiltinFunctionType
- BuiltinMethodType
- WrapperDescriptorType
- MethodWrapperType
- NotImplementedType
- MethodDescriptorType
- ClassMethodDescriptorType
- ModuleType
- EllipsisType
- GenericAlias
- UnionType
- TracebackType
- FrameType
- GetSetDescriptorType
- MemberDescriptorType
- MappingProxyType
- CapsuleType
 
- 附加工具类和函数
- 协程工具函数
 
- copy--- 浅层及深层拷贝操作
- pprint--- 数据美化输出
- reprlib--- 替代性- repr()实现
- enum--- 对枚举的支持
- graphlib--- 操作类似图的结构的功能