typesafe - formal type checking decorators
Project description
typesafe - formal type checking decorators
Usage:
from typesafe import *
@hard_types( name=str, age=(int,float))
def func_or_method(name, age):
pass
@hard_types(dict( name=str, age=(int,float) ))
def func_or_method(name, age):
pass
The @hard_types() decorator raises HardTypesException unless
arguments are of the specified type or types:
@hard_types(argname=type, [...])
@hard_types(argname=types, [...])
The @soft_types() decorator raises SoftTypesException unless
argument types match, or are subtypes, of the specified
type or types.
@soft_types(argname=type, [...])
@soft_types(argname=types, [...])
Usage:
from typesafe import *
@hard_types( name=str, age=(int,float))
def func_or_method(name, age):
pass
@hard_types(dict( name=str, age=(int,float) ))
def func_or_method(name, age):
pass
The @hard_types() decorator raises HardTypesException unless
arguments are of the specified type or types:
@hard_types(argname=type, [...])
@hard_types(argname=types, [...])
The @soft_types() decorator raises SoftTypesException unless
argument types match, or are subtypes, of the specified
type or types.
@soft_types(argname=type, [...])
@soft_types(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.0.tar.gz
(2.7 kB
view details)
File details
Details for the file typesafe-0.9.0.tar.gz
.
File metadata
- Download URL: typesafe-0.9.0.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57bae173d766a227b2b20637b91e74bbb3b325013f6bbc13206e813374d5fbc0 |
|
MD5 | 55ea86201ff4e289154010ac495fbf9d |
|
BLAKE2b-256 | cfd34e904e4667451628519feaf17ad4a35eb7f09f7015c9eb46a795069914a2 |