Are Python coroutines actually used in the project?

I read this page on a coroutine from David Basley some time ago, and I wondered if any Python-based software had used them?

What does it look like the most unused function in Python?

+8
python coroutine
source share
5 answers

The LEPL library uses coroutines to implement trampolines that allow "infinite recursion".

+4
source share

Twisted defer.inlineCallbacks turns your functions into coroutines.

+3
source share

Since Python is really rich in (asynchronous) frameworks, I show here two structures that are based on coroutines:

1. Eventlet is a parallel network library for Python, Coroutines ensures that the developer uses a programming blocking style that is similar to threads, but provides the benefits of non-blocking I / O.

2. Chiral is a lightweight console network for high-performance Internet and web services.

+2
source share

Tornado also recommends using them in your documentation .

+1
source share

There are many projects in python3 that use coroutines. Check out the resources at www.asyncio.org.

For an arbitrary list:

  • Curio is a concurrency structure by David Beasley (doesn't use asyncio)
  • aiozmq implements async ZMQ transport using coroutines
  • aioredis allows you to perform async Redis operations using coroutines
0
source share

All Articles