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 details)
File details
Details for the file typesafe-0.9.1.tar.gz
.
File metadata
- Download URL: typesafe-0.9.1.tar.gz
- Upload date:
- Size: 2.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3619f454f05b1628c1830660d19b7e2fdc5ec9475265f67171bade3e63e91ee |
|
MD5 | aeaf05bfbe0fb1d9d17fc1bd1453a7f6 |
|
BLAKE2b-256 | 775183dd5b0163f735c53c598d72bbee8843d1f67c1256f0ac230f68f3db9c26 |