Closed
Description
Bug Report
({},)
is incompatible with Iterable[Mapping[str, Any]]
/ Iterable[Dict[str, Any]]
To Reproduce
Have a file like this (test.py
):
from typing import Any, Iterable, Mapping
def foo(foo: Iterable[Mapping[str, Any]]) -> None:
pass
foo(({},))
then, run mypy test.py
Expected Behavior
Expected to succeed:
Success: no issues found in 1 source file
Actual Behavior
Got an error:
test.py:8: error: Argument 1 to "foo" has incompatible type "Tuple[Dict[<nothing>, <nothing>]]"; expected "Iterable[Mapping[str, Any]]"
Found 1 error in 1 file (checked 1 source file)
Using more specific Iterable
s, like List
or Tuple
, does not result in an error (as expected).
Your Environment
- Mypy version used: 0.812
- Mypy command-line flags: test.py
- Mypy configuration options from
mypy.ini
(and other config files): <none> - Python version used: 3.8.9
- Operating system and version: Debian 10 (buster) (
docker run --rm -i -t --entrypoint bash python:3.8.9
)