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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 2 Python 3

File details

Details for the file undecorate-0.1.tar.gz.

File metadata

  • Download URL: undecorate-0.1.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for undecorate-0.1.tar.gz
Algorithm Hash digest
SHA256 fd2cbbab30ac39e3ce693313491b3d6f21094f1413191115ee87fd9f9a4790bc
MD5 bce1c4f77c8f4b6d45cac9c5a4146e70
BLAKE2b-256 2583bdb4b6212082126ca71bb65dc5bbb7ab177600a0fb6c26c7d346790911ac

See more details on using hashes here.

File details

Details for the file undecorate-0.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for undecorate-0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 4b716ea798c8eb5896aeea5eb76cdcc22d56c054823515d234d8eacf661f91dd
MD5 663d7ce5995b133cc0dea0efe385bb03
BLAKE2b-256 12e073631e5c63be9b2620fe1ad37269c2c59976f45741570aafb56e5c4e0bd4

See more details on using hashes here.

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