exception-safe-0.0.3
توضیحات
Catch all exceptions and return None
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | exception-safe-0.0.3 |
| نام | exception-safe |
| نسخه کتابخانه | 0.0.3 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Thomas Deniffel |
| ایمیل نویسنده | tdeniffel@gmail.com |
| آدرس صفحه اصلی | https://github.com/tom-010/exception-safe |
| آدرس اینترنتی | https://pypi.org/project/exception-safe/ |
| مجوز | Apache2 |
Safe
====
This is quite a simple package. It catches all exceptions within a given
callable and returns None, if they occur and the return-value of the
callable if not.
```python
def boom():
raise Exception()
return 1
def non_boom():
return 2
a = safe(lambda: boom())
b = safe(lambda: non_boom())
assert a == None
assert b == 2
```
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3 | Python |
نحوه نصب
نصب پکیج whl exception-safe-0.0.3:
pip install exception-safe-0.0.3.whl
نصب پکیج tar.gz exception-safe-0.0.3:
pip install exception-safe-0.0.3.tar.gz