Skip to content

Test testPassingMappingSubclassForKeywordVarArg is wrongΒ #13675

Closed
@davidhalter

Description

@davidhalter

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrong

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions