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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
KotlinIsland opened this issue Sep 19, 2021 · 1 comment 路 Fixed by #11151
Closed

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

KotlinIsland opened this issue Sep 19, 2021 · 1 comment 路 Fixed by #11151
Labels
bug mypy got something wrong

Comments

@KotlinIsland
Copy link
Contributor

馃槼

from typing import Generic, TypeVar, Mapping
T = TypeVar("T")
T2 = TypeVar("T2")

class A(dict[T, T2]):
    ...

def foo(**i: float) -> None:
    ...

a: A[str, str]
d = {"a": "b"}

foo(**a)  # no error
foo(**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

@KotlinIsland KotlinIsland added the bug mypy got something wrong label Sep 19, 2021
@KotlinIsland KotlinIsland changed the title keyword unpack isn't checked keyword unpack isn't checked for anything that's not dict Sep 19, 2021
@sobolevn
Copy link
Member

sobolevn commented Sep 20, 2021

I think I might know what is the case here. PR is on its way.

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.

2 participants