老师,您好,请求您的解惑!

来源:3-2 如何实现可迭代对象和迭代器对象(2)

何永灿

2018-04-07

定义这个方法时报错:

def __iter__(self):

return WeatherIterator(self.cities)

报错:Can't instantiate abstract class WeatherIterator with abstract methods __next__(不能用抽象的方法实例化抽象类WeatherIterator)

写回答

1回答

程序员硕

2018-04-08

python3的话实现__next__ 

0
1
何永灿
非常感谢!
2018-04-09
共1条回复

Python高效编程技巧实战

精选50个Python案例,源自实战,全面提升Python编程能力

2582 学习 · 360 问题

查看课程