Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Async context reports unawaited in pycharm #15

Open
Evgenus opened this issue Jul 24, 2022 · 1 comment
Open

Async context reports unawaited in pycharm #15

Evgenus opened this issue Jul 24, 2022 · 1 comment

Comments

@Evgenus
Copy link
Contributor

Evgenus commented Jul 24, 2022

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.

@jhnnsrs
Copy link
Owner

jhnnsrs commented Jul 24, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants