python 3.x 错误 ‘generator’ object has no attribute ‘next’
原因是在python 3.x中 generator(有yield关键字的函数则会被识别为generator函数)中的next变为__next__了,
next是python 3.x以前版本中的方法
修改为下面这样运行正常
f=fab(5)
f.__next__() # 两个下划线__
python 3.x 错误 ‘generator’ object has no attribute ‘next’
原因是在python 3.x中 generator(有yield关键字的函数则会被识别为generator函数)中的next变为__next__了,
next是python 3.x以前版本中的方法
修改为下面这样运行正常
f=fab(5)
f.__next__() # 两个下划线__