Skip to main content

A dynamic type checker in Python.

Project description

dynatype

A dynamic type checker for Python.

What happens?

When you import the module, it silently decorates all your functions with a type checker.

How do I use it?

Type annotate it like you would in regular Python except using the annotation object (e.g. def f(a: dynatype.annotation(lambda x: type(x) is float or type(x) is int, lambda x: x < 0.5))). That annotation only allows numbers less than 0.5 to be passed into the function.

What happens when an innapropriate value is passed?

A TypeError is raised, allowing you to catch the error if you don't want the program to stop.

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

dynatype-0.0.1.tar.gz (2.8 kB view hashes)

Uploaded Source

Built Distribution

dynatype-0.0.1-py3-none-any.whl (3.1 kB view hashes)

Uploaded 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