Decs

A handful of useful general-purpose python decorators.
Installing
$ pip install decs
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
Metadata
Release files for decs 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| decs-0.0.4.tar.gz | 3.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| decs-0.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.6 kB
Release files / decs-0.0.4.tar.gz
| Download URL | decs-0.0.4.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bb2291c45a7154e7460f3166a05276972f731786cc21bfd6b7482a079d303b1e
|
|
BLAKE2b-256 checksum How to use checksums |
96f7f3c21611ec887d167702aae6b09f191d0b99b1a47e9a0a5657d3d684e248
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.3
|
Release files / decs-0.0.4-py3-none-any.whl
| Download URL | decs-0.0.4-py3-none-any.whl |
|---|---|
| Size | 5.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1cccc3a9cad8f1bf45dca4d7c698e8145e2f042a5749eeef3571286c43266a2e
|
|
BLAKE2b-256 checksum How to use checksums |
dc527d7d76b415570419d371b350359bb579c46841c5fb10ea69965d86e440b2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.3
|