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
This looks related to the case mypy has where if multiple overloads match due to the presence of Any, in some situations it will infer Any. It looks like that code path is getting triggered by the Any in Generator's send type. (I think the semantics here are a little ad hoc, the Typing Council does have specifying behaviour here on its list)
See last line (Playground):
Mypy doesn't like this code:
Please remember that Generator is a subtype of Iterator:
I think this is a bug in Mypy. The
Generator
should match the signature ofdef read_iterator(iterable: Iterator[T]) -> list[T]
Versions:
Related: python/typing#253
The text was updated successfully, but these errors were encountered: