wraptitude

Wrap the results of your Python functions


Keywords
wrapper
License
MIT
Install
pip install wraptitude==0.0.0

Documentation

Wraptitude: wrap the results of your Python functions

Wraptitude provides a decorator that wraps result of a function call in a call to another function.

>>> from wraptitude import Wrapper
>>> @Wrapper(dict)
... def f(x):
...     for i in range(x):
...         yield i, i ** 2
...
>>> f(3)
{0: 0, 1: 1, 2: 4}
>>> @Wrapper(lambda x, y: x + y, 4)
... def g(x):
...     return x * 5
...
>>> g(2)
14