python iterator
2017-02-27 22:48:15 0 举报
AI智能生成
python iterater
作者其他创作
大纲/内容
iteration
build-in iter()
iter(iterable) -> iterator
iter(callable, sentinel) -> iterator
for loop
__iter__ / __getitem__
dict
if k in dict
for k in dict
iterkeys / itervalues / iteritems
file
for line in file
iterable
hasattr(obj, '__iter__') or or be a sequence
iterator
__next__
__iter__
iterator protocol
__iter__
return iter(iterable)
to be a generator
return generator
收藏
收藏
0 条评论
下一页