No one mentions this simple solution ?
class MyClass:
def __init__(self):
self._is_ready = asyncio.Event()
asyncio.create_task(self._init_async())
async def _init_async(self):
await something_eventually()
# set your event
self._is_ready.set()
async def my_method(self):
# wait for the event
await self._is_ready.wait()
print("now the _init_async is done")