Skip to content

keyword unpack isn't checked for anything that's not dict #11144

Description

@KotlinIsland

😳

fromtypingimportGeneric, TypeVar, MappingT=TypeVar("T")
T2=TypeVar("T2")
classA(dict[T, T2]):
...
deffoo(**i: float) ->None:
...
a: A[str, str]
d= {"a": "b"}
foo(**a) # no errorfoo(**d) # error: Argument 1 to "foo" has incompatible type "**Dict[str, str]"; expected "float"

https://mypy-play.net/?mypy=latest&python=3.10&gist=1cbdc48546f3a1bc61476936c3dc9af7

Might be related to #11138

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