Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CIMultiDict: No overload variant of "get" of "Mapping" matches argument type "str" #687

Closed
ewjoachim opened this issue Jan 24, 2022 · 2 comments

Comments

@ewjoachim
Copy link

ewjoachim commented Jan 24, 2022

Long story short

CIMultiDict().get("str") fails in mypy

Expected behaviour

import multidict

a = multidict.CIMultiDict({"a": "b"})

a.get("Hey")

Should pass in mypy

Actual behaviour

foo.py:5: error: No overload variant of "get" of "Mapping" matches argument type "str"
foo.py:5: note: Possible overload variants:
foo.py:5: note:     def get(self, key: istr) -> Optional[str]
foo.py:5: note:     def [_T] get(self, istr, Union[str, _T]) -> Union[str, _T]

Steps to reproduce

Write the above code in foo.py, run mypy foo.py with the most recent multidict & mypy

Your environment

Python 3.8.10

mypy==0.931
multidict==6.0.1
@asvetlov
Copy link
Member

Fixed by #688
Sorry for the inconvinience.

@ewjoachim
Copy link
Author

Ow thank you for the quick fix !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants