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 funcitons, methods and generators.

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

Three utility classes, And(), Or() and Not() are provided to assist in building more complex signatures by creating boolean expressions based on classes and/or types. A similar class, Any(), can be used to indicate that you don’t care about the type of the object.

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.

Source Distribution

typecheck-0.3.0.tar.gz (28.7 kB view hashes)

Uploaded Source

Built Distributions

typecheck-0.3.0.win32.exe (93.3 kB view hashes)

Uploaded Source

typecheck-0.3.0-py2.4.egg (87.4 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page