skip to navigation
skip to content

optypecheck 14

A non intrusive and optional *type checking for Python 3* using annotations

Latest Version: 17

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:


pip3 install optypecheck


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__)
File Type Py Version Uploaded on Size
optypecheck-14.tar.gz (md5) Source 2014-07-20 5KB