generator/coroutine terminology

Marko Rauhamaa marko at pacujo.net
Mon Mar 16 09:13:26 EDT 2015


Rustom Mody <rustompmody at gmail.com>:

> On Monday, March 16, 2015 at 6:02:48 PM UTC+5:30, Marko Rauhamaa wrote:
>> So what we have now is:
>>   (1) plain iterators
>>   (2) generator iterators
>>   (3) coroutine generator iterators
>
>> (1) and (2) are not unified, which I don't like.
>
> Can you expand on that a bit?

(2) contains methods, most notably close(), that (1) does not provide.
If I get an iterator from a black box source, I don't know if I'm
allowed/supposed to call close() on it.


Marko



More information about the Python-list mailing list