generator/coroutine terminology

Rustom Mody rustompmody at gmail.com
Mon Mar 16 10:55:43 EDT 2015


On Monday, March 16, 2015 at 8:07:22 PM UTC+5:30, Rustom Mody wrote:
> 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

And portmanteaus like generator-function are really the worst issue of all

I gave the example of 'pineapple'.

Steven gave another dozen examples that according to him are all ok.
Combine them with his earlier:
> Hopefully it is clear from context what we actually mean. When in doubt, we
> should be explicit. 

So if there is no ambiguity
pineapple can be apple (or is it pine)?
butterfly can be butter
And of course mush is much better than mushroom!

If anything the last 15 years have shown that portmanteaus will be shortformed;
they will be shortformed randomly and inconsistently;
even in the official docs and implementation -- not to mention all over the net.



More information about the Python-list mailing list