Skip to main content

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, [...])

Project details


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)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page