A handful of useful general-purpose python decorators.
Project description
Decs
A handful of useful general-purpose python decorators.
Installing
$ git clone
TODO: add the package to pip.
How to use
Verify functions inputs and outputs types:
from decs import accepts, returns
@returns(str)
@accepts(str)
def my_print(string):
print(string)
return string
Verify methods inputs and outputs types:
from decs import accepts, returns
class SomeClass:
@returns(float)
@accepts('self', int, float)
def class_method(self, int_arg, float_arg):
return int_arg + float_arg
Repeat test case N times:
from decs import repeat
N = 42
@repeat(N)
def test_something(arg):
pass
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
decs-0.0.2-py3-none-any.whl
(4.8 kB
view hashes)