Mypy appears to infer the correct type, but throws an error. #8517
Labels
topic-descriptors
Properties, class vs. instance attributes
topic-runtime-semantics
mypy doesn't model runtime semantics correctly
Uh oh!
There was an error while loading. Please reload this page.
Thanks so much for Mypy! It's a very useful tool.
I was messing around to see if I could write a generic iterator type in Python that would be faster than a generator function. (needless to say, I did not succeed). However, I got a rather unusual message from mypy:
So, it expected the thing it got and then showed an error anyway.
Code is here:
When I add generic parameters to the class, I get a different error.
defining the class this way:
produces this error:
It says it expected
<nothing>
in there. I don't know what that is.Sorry if this is a duplicate.
The text was updated successfully, but these errors were encountered: