How can I define a class with await in the constructor or class body?
await
For example what I want:
im
[Almost] canonical answer by @ojii
@dataclass class Foo: settings: Settings pool: Pool @classmethod async def create(cls, settings: Settings, dsn): return cls(settings, await create_pool(dsn))