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 environmens, 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__)
Release files for optypecheck 14
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| optypecheck-14.tar.gz | 5.9 kB | Details |
Release files / optypecheck-14.tar.gz
| Download URL | optypecheck-14.tar.gz |
|---|---|
| Size | 5.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d37599882f5f6abc4a08122d1d7c59b24616d96ed16bbd68b5b418578109f3b7
|
|
BLAKE2b-256 checksum How to use checksums |
7325da84064d6d83817fac40b7cb2d007507d412893dc5ead2100c8753664292
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |