generator/coroutine terminology

Steven D'Aprano steve+comp.lang.python at pearwood.info
Mon Mar 16 08:02:36 EDT 2015


Marko Rauhamaa wrote:

> Anyway, calling close() on an iterator can be a necessary requirement
> even in ordinary generator usage. Only now they have to know if the
> underlying iterator was sired by a generator or some other constructor.

Can you give an actual example of that?

(To be honest, I'm not even sure what the use-case for close() on coroutines
is in the first place. If you don't want to send any more items into it,
just don't send any more items into it.)


-- 
Steven




More information about the Python-list mailing list