Skip to content

eugene-eeo/promises

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Promises

https://travis-ci.org/eugene-eeo/promises.png?branch=master http://pypip.in/v/Promises/badge.png https://pypip.in/d/Promises/badge.png

Promises is a simple Python library for the runtime enforcement of types during function calls. It has the unfortunate fate of being the same name as the Javascript pattern. Usage examples:

@accepts(AnyOf[int,float])
@returns(str)
def f(x):
    return str(x)

Note the getitem magic implemented in the AnyOf pseudo-type. These pseudo-types can be combined like logical operators to create long, hard-to-grok type signatures. The current iteration of Promises hopes to streamline the library from it's previous cluttered state.

About

type checking for Python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages