Skip to content

Repository files navigation

Decs Build StatuscodecovPyPI versionLicense: MIT

A handful of useful general-purpose python decorators.

Installing

$ pip install decs

How to use

Verify functions inputs and outputs types:

fromdecsimportaccepts, returns@returns(str)@accepts(str)defmy_print(string):
print(string)
returnstring

Verify methods inputs and outputs types:

fromdecsimportaccepts, returnsclassSomeClass:
@returns(float)@accepts('self', int, float)defclass_method(self, int_arg, float_arg):
returnint_arg+float_arg

Repeat test case N times:

fromdecsimportrepeatN=42@repeat(N)deftest_something(arg):
pass

About

General-purpose python decorators.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages