Skip to main content

A set of utility functions for coroutines.

Project description

build status

A set of utility functions for coroutines.


In this example we will be showing comap. comap is like; however, it knows about the coroutine protocol (send, throw, and close). Here we will show how you can map over a coroutine while still being able to send into it.

>>> def my_coroutine():
...     yield (yield (yield 1))
>>> from cotoolz import comap
>>> cm = comap(lambda a: a + 1, my_coroutine())
>>> next(cm)
>>> cm.send(2)
>>> cm.send(3)
>>> cm.send(4)
Traceback (most recent call last):


cotoolz depends on CPython 3 and some means of compiling C99. We recommend using gcc to compile cotoolz.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for cotoolz, version 0.1.6
Filename, size File type Python version Upload date Hashes
Filename, size cotoolz-0.1.6.tar.gz (19.1 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page