Luckily, Python programmers do not need to know what is happening here, since all the familiar built-in types produce their iterators automatically.
2
实际上,现在字典里有. iterkeys 、. iteritems和. itervalues方法来产生迭代器;首要的是在新的习惯用法for key in dct:中使用了什么。
In fact, now dictionaries have the methods.iterkeys ,.iteritems , and.itervalues to produce iterators; the first is what gets used in the new idiom for key in DCT:.
3
实际上,为序列编制索引可能是最常用的序列操作——究竟为什么在迭代器上无法使用索引呢?
In fact, indexing into a sequence is probably the most common thing you ever do with a sequence — why on earth does it fall down so badly on iterators? For example.