typesafe - formal type asserting decorators
Project description
typesafe - formal type asserting decorators
Usage:
from typesafe import *
@types_hard( name=str, age=(int,float))
def func_or_method(name, age):
pass
@types_hard(dict( name=str, age=(int,float) ))
def func_or_method(name, age):
pass
The @types_hard() decorator raises HardTypesException unless
calling arguments are of the specified type or types:
@types_hard(argname=type, [...])
@types_hard(argname=types, [...])
The @types_soft() decorator raises SoftTypesException unless
calling argument types match, or are subtypes, of the specified
type or types.
@types_soft(argname=type, [...])
@types_soft(argname=types, [...])
Usage:
from typesafe import *
@types_hard( name=str, age=(int,float))
def func_or_method(name, age):
pass
@types_hard(dict( name=str, age=(int,float) ))
def func_or_method(name, age):
pass
The @types_hard() decorator raises HardTypesException unless
calling arguments are of the specified type or types:
@types_hard(argname=type, [...])
@types_hard(argname=types, [...])
The @types_soft() decorator raises SoftTypesException unless
calling argument types match, or are subtypes, of the specified
type or types.
@types_soft(argname=type, [...])
@types_soft(argname=types, [...])
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
typesafe-0.9.1.tar.gz
(2.6 kB
view hashes)