A non intrusive and optional *type checking for Python 3* using annotations
Project description
This package implements a non intrusive and optional type checking in functions and methods by using annotations. Once types are defined in annotations, no changes are required to make the verification of types. And, because it is completely optional, it can be used only in the desired environments, like unit testings. This way, the performance of production code is not affected.
Learn more in:
Installation
pip3 install optypecheck
Example
def gencode(a: bytes, b: str) -> str:
return '{}{}'.format(a[0], b)
def valid_number(n) -> 'decimal.Decimal':
return n
# enable type checking in DEBUG mode
assert __import__('typecheck').typecheck(__name__)
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
optypecheck-15.tar.gz
(6.0 kB
view details)
File details
Details for the file optypecheck-15.tar.gz
.
File metadata
- Download URL: optypecheck-15.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2a319da7bc2d2da24e57862ebb75bfeb0650878b09ce6074c5215fd01dd0910 |
|
MD5 | de3835c1f35ff2a74dd76a8f624a0444 |
|
BLAKE2b-256 | 7e8537a073ea699db660fa09cd27850aac73296c2da0cb27a47d26739786d06b |