[Cython] PEP 492 implemented (async/await)

Stefan Behnel stefan_ml at behnel.de
Sat May 30 09:28:37 CEST 2015


I invested a couple of days implementing PEP 492 in Cython.


It turned out nicely, so it's now merged into master to become part of
Cython 0.23. I also spent some time testing and debugging it against Python
3.5 so that Yury Selivanov could adapt their side for interoperability. The
second beta of 3.5 will be released tomorrow and it should "just work".
Testing is very welcome.

Note that the language feature is available in Cython for all Python
versions (2.6+), but usage from Python code with async/await is obviously
limited to Python 3.5 where this syntax is available. My guess is that one
of the next asyncio (and trollius) backport package releases will add
support as well, so that you could run Cython coroutines on top of asyncio
also in older Python releases. It's mostly about dropping some explicit
type checks here and there or replacing them with ABC isinstance checks.

Have fun,


More information about the cython-devel mailing list