generator/coroutine terminology

Rustom Mody rustompmody at gmail.com
Fri Mar 13 05:12:18 EDT 2015


On Friday, March 13, 2015 at 1:53:50 PM UTC+5:30, Chris Angelico wrote:
> On Fri, Mar 13, 2015 at 4:28 PM, Rustom Mody  wrote:
> > And even there I would expect generators to close with StopIteration
> > Whereas I would expect coroutines to close (on close method) with GeneratorExit
> > [Ive not thought all this through properly so may be off the mark]
> 
> I expect both of them to close with "return".

Nice demo of the same confusing terminology we are talking about.

When I say "expect generators to close" I mean 'generator-instances' ie at runtime

When you say "expect both to close with return" you are talking of program-texts
ie the 'factory'

[Or I am guilty of the same I am accusing python of]



More information about the Python-list mailing list