>>x = (lambda : ((yield 666),(yield 777),(yield 888)))()
666
777
888
(None, None, None)
666
777
888
Traceback (most recent call last):
File "<pyshell#2 9>", line 1, in <module>
x.next()
StopIteration
>>x.next()
>>x.next()
>>x.next()
>>x.next()
>>x = (lambda : ((yield 666),(yield 777),(yield 888)) and None)()
>>x.next()
>>x.next()
>>x.next()
>>x.next()
>>x.next()
File "<pyshell#2 9>", line 1, in <module>
x.next()
StopIteration
>>>
Comment