摘要: 在Python语法中如果用for-in循环,那么就要使用迭代器协议,只要对象支持__iter__和__next__双下划线方法,那么就能够使用for-in循环。 1 class RepeaterIterator: 2 def __init__(self, source): 3 self.source 阅读全文
posted @ 2020-11-10 09:25 蟹老板bb 阅读(485) 评论(0) 推荐(0) 编辑