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.
Metadata
Release files for dynatype 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| dynatype-0.0.1.tar.gz | 2.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dynatype-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 5.9 kB
Release files / dynatype-0.0.1.tar.gz
| Download URL | dynatype-0.0.1.tar.gz |
|---|---|
| Size | 2.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2d98e7a56c071bfc78ee1668da1296912dcef3851f162060ce946973c052c9ef
|
|
BLAKE2b-256 checksum How to use checksums |
0e13ecb795f110469fbd0352ca71d24f4215bdbeb0a1b4976e897a7e4eb09c74
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.18
|
Release files / dynatype-0.0.1-py3-none-any.whl
| Download URL | dynatype-0.0.1-py3-none-any.whl |
|---|---|
| Size | 3.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a7cc9a0c9505ae7b5ee1b97e9e64b59c667452ba48b9e306775bf90c9699c76a
|
|
BLAKE2b-256 checksum How to use checksums |
c0746a01ff5da38408336e7b67abf9c41f91d672c96862706280f163920c20bf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.18
|