generator/coroutine terminology

Rustom Mody rustompmody at gmail.com
Mon Mar 16 10:37:11 EDT 2015


On Monday, March 16, 2015 at 7:57:08 PM UTC+5:30, Mark Lawrence wrote:
> On 16/03/2015 14:19, Rustom Mody wrote:
> > ======================
> > Anyways...
> >
> > Yes 15 years are past.
> > I dont expect the def can be revoked now.
> > [As far as I am concerned its a minor wart]
> > But the mess around the docs can certainly be cleaned up.
> >
> 
> So write the patches to correct the docs, then raise the issue on the 
> bug tracker to get the patches accepted.  IIRC for doc patches you don't 
> even have to provide diff files against the rst files, plain text will 
> do, the core devs will do the rest for you.

I would gladly do that if it was a minor correction here and there.
But the problem is a bit deeper even though it can be kept mostly¹ in the docs
and not modify any syntax/semantics of python.

In particular for:

def potato(x):
  yield x+1

tomato = potato(3)

what shall we call potato and tomato.
I believe this thread clearly shows that the docs are confused and inconsistent.
Yet I dont see any consensus on what/how to classify tomato/potato.

Function -- trouble on one side
Generator -- trouble on another
Iterator -- trouble on third 
etc

¹ Grey areas excepted eg output of help(); inspect module etc



More information about the Python-list mailing list