Skip to content

Test testPassingMappingSubclassForKeywordVarArg is wrong #13675

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

Closed
davidhalter opened this issue Sep 17, 2022 · 0 comments · Fixed by #18850
Closed

Test testPassingMappingSubclassForKeywordVarArg is wrong #13675

davidhalter opened this issue Sep 17, 2022 · 0 comments · Fixed by #18850
Labels
bug mypy got something wrong

Comments

@davidhalter
Copy link

The test looks like this:

from typing import Mapping
class MappingSubclass(Mapping[str, str]): pass
def f(**kwargs: 'A') -> None: pass
d = None # type: MappingSubclass
f(**d)
class A: pass

but line 5 should be something like:

f(**d)  # E: Argument 1 to "f" has incompatible type "**MappingSubclass"; expected "A"

This is because the value type str does not match A. I feel like this is a bug somewhere in Mypy.

I have tried to find an issue about kwargs and super types, but could not find anything.

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

Successfully merging a pull request may close this issue.

1 participant