list
of dict
is reported as not compatible with list
of Mapping
#17752
Labels
bug
mypy got something wrong
Bug Report
Then have a function that returns a list of dicts and assigns it to a variable annotated as list of Mapping the mypy reports error, however when change annotation to
Sequence[Mapping]
it works.To Reproduce
Code that generates mypy warning
code that do not generate error:
https://mypy-play.net/?mypy=latest&python=3.12&gist=a3a7cf085ceed0a395392a6adaa74a29
Expected Behavior
Both presented type annotation above should work.
Actual Behavior
Your Environment
The text was updated successfully, but these errors were encountered: