第80页 collections.namedtuple
jerryleooo (Time will tell)
- 章节名:collections.namedtuple
- 页码:第80页
`namedtuple`即可以用`dotted notation`(obj.attr)来引用属性,也可以用索引来引用。 `namedtuple`的key值必须是合法的,而且不能重复。但是加上`rename=True`选项之后就可以了。其中非法的key值将被改为合法key值。
16人阅读
jerryleooo对本书的所有笔记 · · · · · ·
-
第77页 collections.deque
Since deques are thread-safe, the contents can even be consumed from both ends at the s...
-
第80页 collections.namedtuple
-
第82页 collections.OrderedDict
普通的`dict`的顺序是根据key在哈希表里的排序。在OrderDict中,是根据创建时候的顺序。
-
第110页
到底什么是回调和代理?以及引用???
> 查看全部8篇
说明 · · · · · ·
表示其中内容是对原文的摘抄