Skip to main content
Warning: You are using the test version of PyPI. This is a pre-production deployment of Warehouse. Changes made here affect the production instance of TestPyPI (
Help us improve Python packaging - Donate today!

python decorators to enable type-safety on python functions, classes, and generators.

Project Description
# type-safety
[![Build Status](](

`typesafety` makes it easy to write type-safe functions and classes in python with a simple decorator that stops incorrect types being parsed at run-time.

Based upon a blog-post by [Aaron Schleigner](

An example of a type-safe function,

@typesrequired(float, float, bool)
def maths_function(value_a, value_b, flag):
if flag:
return value_a + value_b
return value_a * value_b
`typesafety` is available on pip, so install it directly or add it to your `requirements.txt` if you like,

pip install typesafety

## Whats left?
A few key features are still missing, if you've got time, pull requests are welcome!

* Support optional arguments
* Support use on class methods
* Static Analysis
Release History

Release History

This version
History Node


Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
typesafety-0.1.tar.gz (2.5 kB) Copy SHA256 Checksum SHA256 Source Jan 25, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting