Installation
$ [sudo] pip install accepts
Features
- support multiple types argument
- support None argument
- human readable detailed exception message
Examples
>>> from accepts import accepts
>>> @accepts(int)
def inc(value):
return value+1
>>> inc(1) # ok
# multiple types
>>> @accepts((int,float))
>>> inc(1.5) # ok
>>> inc("string")
TypeError: inc() argument #0 is not instance of (<class 'int'>, <class 'float'>)
# None
>>> @accepts((int,float,type(None)))
Metadata
Release files for accepts 2020.12.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| accepts-2020.12.3.tar.gz | 1.9 kB | Without provenance | Details for accepts-2020.12.3.tar.gz |
Release files / accepts-2020.12.3.tar.gz
| Download URL | accepts-2020.12.3.tar.gz |
|---|---|
| Size | 1.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
72111ad4b8640f68c2d5081fcddc736c1c99cec0b6fad4fabfb8c13ff0966713
|
|
BLAKE2b-256 checksum How to use checksums |
964257f92319a5b4d0336f8cdcfd8833e2d00104d7dfae8cead6da720383f461
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6
|
Security for accepts 2020.12.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.