-
-
Notifications
You must be signed in to change notification settings - Fork 121
CIMultiDict has incompatible type Dict[istr, str] #644
Copy link
Copy link
Closed
Description
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels