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)
0.2.1 (2014-09-29)
Fix bug in create_class_wrapper and class_wraps that caused them to always throw an error when used.
Remove CLASS_WRAPPER_DELETES, and corresponding deleted arguments on create_class_wrapper and class_wraps.
0.2 (2014-09-29)
Add create_class_wrapper and class_wraps.
Internally use __wrapped__ to match Python 3.2+.
Add backport versions of functools wraps and update_wrapper. They wrap the stdlib versions, and ensure that __wrapped__ is set.
0.1 (2014-09-04)
Initial Release
unwrappable and unwrap functions
Project details
Release history Release notifications | RSS feed
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.2.1.tar.gz
(4.3 kB
view hashes)
Built Distribution
Close
Hashes for undecorate-0.2.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b221138176aeeafb7e121589b0829f8ba121e9e5320db569ce0173db771328ba |
|
MD5 | 39cfe1a7d40be9b78d548420d40cc80a |
|
BLAKE2b-256 | 7b91d48dfb3830de993c3012cf627d06314ee9a82e2e95c0eff5415f76b2a22c |