Typing information lost while calling __iter__ #12446
Labels
bug
mypy got something wrong
topic-inference
When to infer types or require explicit annotations
topic-literal-types
With the following example:
I'm getting:
Trying to dig with
reveal_type
:I get:
So it looks OK, but digging with pdb, in
mypy/checker.py:analyze_iterable_item_type()
, after calling:I see:
I think some information is lost here, should iterator get:
typing.Iterator[Literal['foo', 'bar']]
instead?The text was updated successfully, but these errors were encountered: