asyncinit-0.2.4
توضیحات
Class decorator to enable async __init__
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | asyncinit-0.2.4 |
| نام | asyncinit |
| نسخه کتابخانه | 0.2.4 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Mick Koch |
| ایمیل نویسنده | mick@kochm.co |
| آدرس صفحه اصلی | https://github.com/kchmck/pyasyncinit |
| آدرس اینترنتی | https://pypi.org/project/asyncinit/ |
| مجوز | MIT |
# asyncinit -- Enable async `__init__`
[Documentation](http://kchmck.github.io/pdoc/asyncinit/)
This package provides the `asyncinit` decorator, which enables an asynchronous constructor
to be called like any other asynchronous function.
## Example
```python
from asyncinit import asyncinit
@asyncinit
class MyClass:
async def __init__(self, param):
self.val = await self.deferredFn(param)
async def deferredFn(self, x):
# ...
return x + 2
obj = await MyClass(42)
assert obj.val == 44
```
## Installation
This package requires Python >= 3.5.0 and can be installed with `pip`:
```
pip install asyncinit
```
نیازمندی
| مقدار | نام |
|---|---|
| ~=2.1) | pylint |
| ~=3.6) | pytest |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.5 | Python |
نحوه نصب
نصب پکیج whl asyncinit-0.2.4:
pip install asyncinit-0.2.4.whl
نصب پکیج tar.gz asyncinit-0.2.4:
pip install asyncinit-0.2.4.tar.gz