jhnnsrs/rath

Async context reports unawaited in pycharm

Opened this issue · 1 comments

I found a strange warning in pycharm.

зображення

Maybe that is their problem. Maybe it is because of koil. Maybe because rath is a context and async context at the same time. It works well in runtime.

hm that indeed seems to be a bit strange, in vscode i don't experience any of this. I would think that its maybe due to the fact that async def aenter is typed with TypeVars on the KoiledModel (iwas trying to get around using only the >3.10 compatible "Self" type).

Could you see if that error persists if you change rath to

from typing_extensions import Self

class Rath(KoiledModel):
    ....

    async def __aenter__(self) -> Self:
        self._entered = True
        if self.context:
            self.context.set(self)
        await self.link.__aenter__()
        return self