Skip to main content

A runtime type-checking module for Python

Project description

A runtime type-checking module for Python supporting both parameter-type checking and return-type checking for functions, methods and generators.

The main workhorses of this module, the functions accepts and returns, are used as function/method decorators. A yields decorator provides a mechanism to typecheck the values yielded by generators.

Four utility classes, IsAllOf(), IsOneOf(), IsNoneOf() and IsOnlyOneOf() are provided to assist in building more complex signatures by creating boolean expressions based on classes and/or types.

A number of other utility classes exist to aid in type signature creation; for a full list, see the README.txt file or the project’s website.

The module also includes support for type variables, a concept borrowed from languages such as Haskell.

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 typecheck, version 0.3.5
Filename, size File type Python version Upload date Hashes
Filename, size typecheck-0.3.5-py2.4.egg (37.1 kB) File type Egg Python version 2.4 Upload date Hashes View
Filename, size typecheck-0.3.5-py2.5.egg (36.3 kB) File type Egg Python version 2.5 Upload date Hashes View
Filename, size typecheck-0.3.5.tar.gz (44.6 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