摘要: 在 python 中我们常用 for in 来遍历 list, set, dict, str 等。 for in 的本质就干了两件事: 1. 调用 _\_iter__() 获取迭代器; 2. 调用 next() 直到 StopIteration 异常; (python3 中是 _\_next__() 阅读全文
posted @ 2018-04-23 14:42 leesea 阅读(140) 评论(0) 推荐(0)