Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

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:


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__)

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for optypecheck, version 17
Filename, size File type Python version Upload date Hashes
Filename, size optypecheck-17.tar.gz (6.8 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page