Skip to content

adamdeprince/bdl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

=BDL Python=

bdl is the begining of what I hope will become a collection of decorators and a rich domain specific lanugage to describe the acceptable types for parameters and return values. Right now its usage is limited to a single @returns dectorator that confirms the return type of a function - its not very flexiable.

Example usage:

>>> from bdl import returns
>>> @returns(int)
... def a():
...     return 1
... 
>>> a()
1
>>> @returns(str)
... def b():
...     return 1
... 
>>> b()
TypeError: Expected a return value of <type 'str'>, returned a <type 'int'> instead

About

Python can be a BDL - Add a bit of type safey to function calls.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages