Skip to main content

checksignature

a function decorator for enforcing function signatures

tests publish codecov

Setup

Install build dependencies.

pip install -r requirements

Run nox to build, install, and run checksignature tests.

Usage

Decorate any funciton with @checksignature.

@checksignature
def function(a: str, b: int, c, *args: int, **kwargs: int)::
    return a, b, c, args, kwargs

Upon invocation of function, the signature check is evaluated.

function('one', 2, 3.0, 1, 2, 3, **{'four': 4})   #=> functions as usual--no problem.
function('one', 2, 3.0, 1, 2, 3, **{'four': 4.0}) #=> raises a TypeError
function('one', 2, 'x', 1, 2, 3, **{'four': 4})   #=> raises a TypeError

Release files for checksignature 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for checksignature 0.1.1
File Size Uploaded
checksignature-0.1.1.tar.gz 6.6 kB Details

Release files / checksignature-0.1.1.tar.gz

Download URL checksignature-0.1.1.tar.gz
Size 6.6 kB
Tags Source
SHA-256 checksum
How to use checksums
54ec49a2248d7d6bf44f70244075a77a2b8dd9d8077326ac76453de270870e67
BLAKE2b-256 checksum
How to use checksums
5b426416bf6b64a84e03e0271bd3b88cdbc8383bea031fd8756ba1ec305064bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page