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 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.
Four utility classes, And(), Or(), Not() and Xor() 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.