a type constraint tool for python function
Project description
from type_constraint import BasicCheck, CheckMeta, Check
class A:
__metaclass__ = CheckMeta()
def f(self, i, j):
"""
@param i str
@param j str
"""
return i + j
a = A()
a.f('1', '2')
@BasicCheck
def test_func(i, j):
"""
this is a test function for type constraint
@param i int :this is the first operand
@param j float :this is the second operand
@return float
"""
return i / j
class A:
__metaclass__ = CheckMeta()
def f(self, i, j):
"""
@param i str
@param j str
"""
return i + j
a = A()
a.f('1', '2')
@BasicCheck
def test_func(i, j):
"""
this is a test function for type constraint
@param i int :this is the first operand
@param j float :this is the second operand
@return float
"""
return i / j
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
type_constraint-0.0.10.tar.gz
(2.3 kB
view hashes)
Built Distribution
Close
Hashes for type_constraint-0.0.10-py2.7.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0d1f82be2918b7d39b139d6dc75175b3207e74567da74b9229ad2a873973de5 |
|
MD5 | 487c8bec38c8980ce0b5c36f1c9c1496 |
|
BLAKE2b-256 | 76bc5113e34d8ec75a55d7d6cecab75f69b944d8a854b5b941a45e1650a53b35 |