Jeremy
Jeremy

Reputation: 393

Are Python coroutines actually used in a project?

I read this page on coroutines from David Beazley a while ago, and I wondered if any actual Python-based software made use of them ?

How is it coroutines seem like the most unused feature in Python ?

Upvotes: 8

Views: 1129

Answers (5)

achennu
achennu

Reputation: 1608

There are plenty of projects in python3 that use coroutines. Check on www.asyncio.org for resources.

For an arbitrary listing:

  • Curio is a concurrency framework by David Beazley (doesn't use asyncio)
  • aiozmq implements async ZMQ transport, using coroutines
  • aioredis allows async Redis operations using coroutines

Upvotes: 0

gaborous
gaborous

Reputation: 16600

Also Tornado advises to use them in their documentation.

Upvotes: 1

NewPtone
NewPtone

Reputation: 3075

Since Python is really rich with (asynchronous) frameworks,I show two framework here which is based coroutine:

1.Eventlet is a concurrent networking library for Python,Coroutines ensure that the developer uses a blocking style of programming that is similar to threading, but provide the benefits of non-blocking I/O.

2.Chiral is a lightweight coroutine-based networking framework for high-performance internet and Web services.

Upvotes: 2

Jochen Ritzel
Jochen Ritzel

Reputation: 107666

Twisted's defer.inlineCallbacks turns your functions into coroutines.

Upvotes: 3

user395760
user395760

Reputation:

The LEPL parsing library uses coroutines to implement trampolines, which allow "infinite recursion".

Upvotes: 4

Related Questions