cotoolz-0.1.6
توضیحات
A set of utility functions for coroutines.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | POSIX |
| نام فایل | cotoolz-0.1.6 |
| نام | cotoolz |
| نسخه کتابخانه | 0.1.6 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Joe Jevnik |
| ایمیل نویسنده | joejev@gmail.com |
| آدرس صفحه اصلی | https://github.com/llllllllll/cotoolz |
| آدرس اینترنتی | https://pypi.org/project/cotoolz/ |
| مجوز | GPL-2 |
``cotoolz 0.1``
===============
|build status|
A set of utility functions for coroutines.
Example
-------
In this example we will be showing ``comap``.
``comap`` is like ``__builtins__.map``; 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.
.. code-block:: python
>>> def my_coroutine():
... yield (yield (yield 1))
>>> from cotoolz import comap
>>> cm = comap(lambda a: a + 1, my_coroutine())
>>> next(cm)
2
>>> cm.send(2)
3
>>> cm.send(3)
4
>>> cm.send(4)
Traceback (most recent call last):
...
StopIteration
Dependencies
------------
``cotoolz`` depends on CPython 3 and some means of compiling C99.
We recommend using ``gcc`` to compile ``cotoolz``.
.. |build status| image:: https://travis-ci.org/llllllllll/cotoolz.svg?branch=master
:target: https://travis-ci.org/llllllllll/cotoolz
نحوه نصب
نصب پکیج whl cotoolz-0.1.6:
pip install cotoolz-0.1.6.whl
نصب پکیج tar.gz cotoolz-0.1.6:
pip install cotoolz-0.1.6.tar.gz