Skip to content

A rudimentary type checking library for python.

Notifications You must be signed in to change notification settings

zeeman/promises

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Promises is a very basic type checking library for Python.

from numbers import Number
from promises import promise

@promise.returns(str)
def add(a, b):
    return a + b

@promise.accepts(Number, Number)
@promise.returns(Number)
def sub(a, b):
    return a - b

sub(5, 2)        # works
sub('5', '2')    # raises TypeError

add('Hel', 'lo') # works
add(1, 2)        # raises ReturnError

About

A rudimentary type checking library for python.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages