Skip to content

Commit

Permalink
refactor(docs): update features
Browse files Browse the repository at this point in the history
  • Loading branch information
h2non committed Oct 25, 2016
1 parent f27939f commit 811de43
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
5 changes: 3 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ Features
- Simple and idiomatic API, extending Python `stdlib` with async coroutines gotchas.
- Built-in configurable control-flow concurrency support.
- Useful iterables, decorators and functors.
- Provides coroutine-ready compose, throttle, partial, until, race and other functional helpers.
- Coroutine-based functional helpers: compose, throttle, partial, until, throttle, race...
- Asynchronous coroutine port of Python built-in functions: `filter`, `map`, `dropwhile`, `filterfalse`, `reduce`...
- Concurrent iterables and higher-order functions.
- Better `asyncio.gather()` and `asyncio.wait()` implementations with optional concurrency control and ordered results.
- Good interoperability with `asyncio` and Python `stdlib` functions.
- Works with both `async/await`_ and `yield from`_ coroutines syntax.
- Designed for intensive I/O-bound concurrent non-blocking tasks.
- Good interoperability with `asyncio` and Python `stdlib` functions.
- Small and dependency free.
- Compatible with Python +3.4.

Expand Down
11 changes: 10 additions & 1 deletion paco/wraps.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def wraps(fn):
"""
Wraps a given function as coroutine function.
This is a convenient helper function.
This function can be used as decorator.
Arguments:
fn (function): function object to wrap.
Expand All @@ -17,12 +17,21 @@ def wraps(fn):
Usage::
# Use as function wrapper
def mult(num, foo=None):
return num * 2
coro = paco.wraps(mult)
await coro(2, foo='bar')
=> 4
# Use as decorator
@paco.wraps
def mult(num):
return num * 2
await mult(2)
=> 4
"""
@functools.wraps(fn)
@asyncio.coroutine
Expand Down

0 comments on commit 811de43

Please sign in to comment.