PEP 255: Simple Generators

Just van Rossum just at letterror.com
Thu Jun 21 03:44:06 EDT 2001


Roman Suzi wrote:

> I've not been heard or commented. It seems that everybody is happy with
> simple generators (and discuss syntax) while I am not.
> 
> I dare think that proposed gen/generator/def-yield thing is doomed to be
> phased out in some future Python version, because it creates frozen
> context for very narrow task of providing generators and in the future (I
> hope) there will be normal parallel programming in Python, which will
> solve the problem simply and efficiently.
> 
> I am not against PEP 255. The feature is cool. But it is a feature which
> requires new keyword, new function class, etc. In one way or another, it
> modifies function and it implicitely lead to the same syntax beasts
> as in C++/Java/Pascal.
> 
> PEP 255 is not Pythonish enough.
> 
> Let's better think about more general things like:
> * co-routines (which "generator" is an example, if I understand it
> correctly)
> * adding parallel programming paradigm (which is even better
> for long term), where objects live their lifes and could serve
> other objects as generators, gatherers, services, etc.
> 
> OOP was made easy by python. I hope parallel programming
> to be added and made equally easy, without all those
> modifiers and zillion of new keywords and modifiers.

All interesting points, but the point of "Simple Generators" is that
they were implementable in CPython without a major overhaul of the
interpreter. For the things you suggest you need Stackless Python,
which *is* indeed a major overhaul of the interpreter...

Just



More information about the Python-list mailing list