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

Self doesn't support an async iterator protocol #118

Closed
erwinkinn opened this issue Feb 20, 2023 · 3 comments
Closed

Self doesn't support an async iterator protocol #118

erwinkinn opened this issue Feb 20, 2023 · 3 comments

Comments

@erwinkinn
Copy link

Hello.
I've got a problem with Self type when using it as it's done in types-aiofiles
I've made a merge request, trying to fix it in there, but to be honest it looks like this problem relates to the async iterator protocol's support for the tying_extensions.Self type.
Whether it's possible to make such a thing?

@JelleZijlstra
Copy link
Member

This seems like a mypy bug to me. typing-extensions doesn't really affect how type checkers interpret Self: the runtime Self object does very little. Please report your issue to mypy instead (ideally with a full, standalone sample that reproduces the bug).

@JelleZijlstra JelleZijlstra closed this as not planned Won't fix, can't repro, duplicate, stale Feb 20, 2023
@Gobot1234
Copy link
Contributor

Hi, I think you've stumbled across a mypy bug, there is nothing in PEP 673 that stipulates that Self cannot be used inside of the async iterator protocol furthermore, running your code in your issue pyright there are no complaints.
image
Source for aiofiles stubs:
image

@hauntsaninja
Copy link
Collaborator

Make sure you're using mypy 1.0 or newer

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

4 participants