a function decorator for enforcing function signatures
Project description
checksignature
a function decorator for enforcing function signatures
Setup
Ensure nox
is installed.
pip install nox
Run nox
to build, install, and run checksignature
tests.
Usage
Decorate any funciton with @checksignature
.
@checksignature
def function(a: str, b: int, c, **kwargs):
return a, b, c, kwargs
Upon invocation of function
, the signature check is evaluated.
function('one', 2, 3.0, **{'four': 4}) #=> functions as usual--no problem.
function(1, 2, 3.0, **{'four': 4}) #=> raises a TypeError
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
File details
Details for the file checksignature-0.0.1rc2.tar.gz
.
File metadata
- Download URL: checksignature-0.0.1rc2.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 806febc2012688dcefad1bf41485517f8dd8146984dfa6394432c925536d53b7 |
|
MD5 | ab69cd4b7792e3c1e99506af92061b55 |
|
BLAKE2b-256 | 3c1efc7f6a03f14853aa306d95745e08a9a6ca51603a181949faeba18c08f3ef |