You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Self doesn't support an async iterator protocol #118
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?
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).
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.
Source for aiofiles stubs:
Activity
JelleZijlstra commentedon Feb 20, 2023
This seems like a mypy bug to me.
typing-extensionsdoesn't really affect how type checkers interpretSelf: the runtimeSelfobject does very little. Please report your issue to mypy instead (ideally with a full, standalone sample that reproduces the bug).Gobot1234 commentedon Feb 20, 2023
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.


Source for aiofiles stubs:
hauntsaninja commentedon Feb 20, 2023
Make sure you're using mypy 1.0 or newer