asyncinit -- Enable async __init__
This package provides the asyncinit decorator, which enables an asynchronous constructor
to be called like any other asynchronous function.
Example
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
Release files for asyncinit 0.2.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| asyncinit-0.2.4.tar.gz | 2.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| asyncinit-0.2.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 5.2 kB
Release files / asyncinit-0.2.4.tar.gz
| Download URL | asyncinit-0.2.4.tar.gz |
|---|---|
| Size | 2.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4acaf614f4d6f78babd278bbacf21bd9f7756efc17cd5d7e1bae31ff770b3cfa
|
|
BLAKE2b-256 checksum How to use checksums |
de120679675f7acadba277a29d6a056e72be0b6486d60c689767b4bc7153f850
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.27.0 CPython/3.6.6
|
Release files / asyncinit-0.2.4-py3-none-any.whl
| Download URL | asyncinit-0.2.4-py3-none-any.whl |
|---|---|
| Size | 2.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9f11291943488abd15a1463dad98452e3bd6b39e8e6d45bc7cc008a09825b11e
|
|
BLAKE2b-256 checksum How to use checksums |
b412a73bd1bcba7f99738d1f644ed17b526f84e97aaabda301800435ca202570
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.27.0 CPython/3.6.6
|