Long story short
The mypy checks fail if the dictionary keys passed to the constructor are of the istr type.
Expected behaviour
The mypy checks have passed.
Actual behaviour
Error from mypy:
headers.py:5: error: Argument 1 to "CIMultiDict" has incompatible type "Dict[istr, str]"; expected "Union[Mapping[Union[str, istr], Any], Dict[Union[str, istr], Any], MultiMapping[Any], Iterable[Tuple[Union[str, istr], Any]]]"
Steps to reproduce
Run mypy on this script:
from aiohttp import hdrs
from multidict import CIMultiDict, CIMultiDictProxy
headers = CIMultiDictProxy(
CIMultiDict({
hdrs.CONTENT_LENGTH: "40",
hdrs.CONTENT_TYPE: "text/xml",
})
)
Your environment
Python v3.9.4
aiohttp v3.7.4.post0
multidict v5.1.0
mypy v0.910
Long story short
The
mypychecks fail if the dictionary keys passed to the constructor are of theistrtype.Expected behaviour
The
mypychecks have passed.Actual behaviour
Error from
mypy:Steps to reproduce
Run
mypyon this script:Your environment
Python v3.9.4
aiohttp v3.7.4.post0
multidict v5.1.0
mypy v0.910