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

0.3.5

History Node

0.3.4

History Node

0.3.3

History Node

0.3.2

History Node

0.3.1

History Node

0.3.0

This version
History Node

0.2.0

History Node

0.1.6

History Node

0.1.4

History Node

0.1.3

History Node

0.1.2

History Node

0.1.1

History Node

0.1.0

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
typecheck-0.2.0.zip (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