accepts 0.0.17
pip install accepts==0.0.17
Newer version available (2020.12.3)
Released:
@accepts decorator to check arguments types
Navigation
Unverified details
These details have not been verified by PyPIProject links
Meta
- License: UNKNOWN
- Author: UNKNOWN
- Tags type , decorator
Classifiers
- Development Status
- Programming Language
- Topic
Project description
Install
[sudo] pip install accepts
Features
support multiple types argument
support None argument
human readable detailed exception message
Usage
>>> from accepts import accepts
>>> @accepts(arg1type,arg2type,...)
Example
>>> @accepts(int)
def inc(value):
return value+1
>>> inc(1) # ok
>>> inc(1.5) # exception
TypeError: ....
# multiple types
>>> @accepts((int,float))
# None
>>> @accepts((int,float,None))
Sources:
russianidiot.github.io/python/ - Python packages
russianidiot.github.io/cli/ - command line scripts
README.rst - generated with readmemako.py (python+ mako templates) and .README dotfiles
Project details
Unverified details
These details have not been verified by PyPIProject links
Meta
- License: UNKNOWN
- Author: UNKNOWN
- Tags type , decorator
Classifiers
- Development Status
- Programming Language
- Topic
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
File details
Details for the file accepts-0.0.17.tar.gz
.
File metadata
- Download URL: accepts-0.0.17.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
0bf2d511669140e07a353d48b18b91d542aa48922d06d5f7e5c1313b29268c7d
|
|
MD5 |
62592659d7990f43e0e8fe8b2e4a651e
|
|
BLAKE2b-256 |
c3fc3bc56a22765612f4b7c983f30851b766cb5977a28574c56f5746c83b6a39
|