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

input type for lambda with union of Callables is inferred as Any #11423

Open
DetachHead opened this issue Nov 1, 2021 · 0 comments
Open

input type for lambda with union of Callables is inferred as Any #11423

DetachHead opened this issue Nov 1, 2021 · 0 comments
Labels
bug mypy got something wrong

Comments

@DetachHead
Copy link
Contributor

from typing import Callable


def foo(fn: Callable[[int, str], None] | Callable[[int], None]) -> None:
    ...


foo(lambda value: reveal_type(value)) #revealed type is Any

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

@DetachHead DetachHead added the bug mypy got something wrong label Nov 1, 2021
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

No branches or pull requests

1 participant