Skip to main content
Help us improve PyPI by participating in user testing. All experience levels needed!

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.

The main workhorses of this module, the functions typecheck_args and typecheck_return, are used as function/method decorators (see Examples section).

Typecheck supports arbitrarily complex data-structures, able to deal with nested arrangements of tuples, lists and dictionaries.

Two utility classes, And() and Or(), 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.

Note that typechecking can be {en,dis}abled at runtime by toggling the typecheck.enable_checking global boolean; a value of True (the default) causes all typechecks (both for parameters and return values) to be run, while False disables them.

Project details

Release history Release notifications

History Node


History Node


History Node


History Node


History Node


History Node


This version
History Node


History Node


History Node


History Node


History Node


History Node


History Node


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
typecheck-0.2.0-py2.4.egg (39.0 kB) Copy SHA256 hash SHA256 Egg 2.4 Nov 22, 2005
typecheck-0.2.0.win32.exe (75.8 kB) Copy SHA256 hash SHA256 Windows Installer 2.4 Nov 22, 2005 (183.6 kB) Copy SHA256 hash SHA256 Source None Nov 22, 2005

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page