""" Some utilities to help with async stuff. """ class Aobject(object): """ Inheriting this class allows you to define an async __init__. So you can create objects by doing something like `await MyClass(params)` Copied from https://newbedev.com/how-to-set-class-attribute-with-await-in-init """ async def __new__(cls, *a, **kw): instance = super().__new__(cls) await instance.__init__(*a, **kw) return instance async def __init__(self): pass