Skip to main content

Let your decorations be undone

Project description

Let your decorations be undone

Installation

$ pip install undecorate

Usage

>>> from undecorate import unwrap, unwrappable
>>>
>>> @unwrappable
... def pack(func):
...     def wrapper(args, kwargs):
...        return func(*args, **kwargs)
...     return wrapper
...
>>> @pack
... def myfunc(a, b=None, c=None):
...     return (a, b, c)
...
>>> myfunc('a', b='b')
Traceback (most recent call last):
    ...
TypeError: wrapper() got an unexpected keyword argument 'b'
>>>
>>> unwrap(myfunc)('a', b='b')
('a', 'b', None)

Project details


Download files

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

Source Distribution

undecorate-0.1.tar.gz (2.7 kB view hashes)

Uploaded Source

Built Distribution

undecorate-0.1-py2.py3-none-any.whl (3.4 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page