cmath
math
uarray
ubinascii
ucollections
uerrno
uhashlib
uheapq
uio
ujson
uos
ure
uselect
usocket
ussl
ustruct
usys
utime
uzlib
_thread
该模块实现相应CPython模块的子集,主要提供命名元组功能
>>> import ucollections >>> >>> mytuple = ucollections.namedtuple('mytuple', ('id', 'name')) >>> t1 = mytuple(1, 'foo') >>> t2 = mytuple(3, 'bar') >>> >>> print(t1.id) 1 >>> print(t1.name) foo >>> print(t2.id) 3 >>> print(t2.name) bar >>>
ucollections.
namedtuple
用以创建具有特定名称和字段集的命名元组函数。命名元组为元组的子类, 它可以通过数值索引或具有符号字段名的属性访问语法来访问其字段,字段是指定字段名的字符串序列。