[Python-Dev] Coroutines and PEP 380

Glyph glyph at twistedmatrix.com
Wed Jan 18 00:37:31 CET 2012

On Jan 17, 2012, at 5:03 PM, Mark Shannon wrote:

> Lets start controversially: I don't like PEP 380, I think it's a kludge.

Too late; it's already accepted.  There's not much point in making controversial statements about it now.

> I think that CPython should have proper coroutines, rather than add more bits and pieces to generators in an attempt to make them more like coroutines.

By "proper" coroutines, you mean implicit coroutines (cooperative threads) rather than explicit coroutines (cooperative generators).  Python has been going in the "explicit" direction on this question for a long time.  (And, in my opinion, this is the right direction to go, but that's not really relevant here.)

I think this discussion would be more suitable for python-ideas though, since you have a long row to hoe here.  There's already a PEP - http://www.python.org/dev/peps/pep-0219/ - apparently deferred and not rejected, which you may want to revisit.

There are several libraries which can give you cooperative threading already; I assume you're already aware of greenlet and stackless, but I didn't see what advantages your proposed implementation provides over those.  I would guess that one of the first things you should address on python-ideas is why adopting your implementation would be a better idea than just bundling one of those with the standard library :).


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20120117/9f4da3cc/attachment.html>

More information about the Python-Dev mailing list