accepts-2020.7.1
توضیحات
@accepts decorator to check arguments types
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | accepts-2020.7.1 |
| نام | accepts |
| نسخه کتابخانه | 2020.7.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | - |
| ایمیل نویسنده | - |
| آدرس صفحه اصلی | https://github.com/andrewp-as-is/accepts.py |
| آدرس اینترنتی | https://pypi.org/project/accepts/ |
| مجوز | Unlicense |
<!--
https://readme42.com
-->
[](https://pypi.org/project/accepts/)
[](https://unlicense.org/)
### Installation
```bash
$ [sudo] pip install accepts
```
#### Features
* support **multiple types** argument
* support **None** argument
* human readable detailed exception message
#### Examples
```python
>>> 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)))
```
<p align="center">
<a href="https://readme42.com/">readme42.com</a>
</p>
نحوه نصب
نصب پکیج whl accepts-2020.7.1:
pip install accepts-2020.7.1.whl
نصب پکیج tar.gz accepts-2020.7.1:
pip install accepts-2020.7.1.tar.gz