Skip to content

Support overloading with TypedDict arguments #3609

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
JukkaL opened this issue Jun 26, 2017 · 0 comments
Closed

Support overloading with TypedDict arguments #3609

JukkaL opened this issue Jun 26, 2017 · 0 comments
Assignees
Labels

Comments

@JukkaL
Copy link
Collaborator

JukkaL commented Jun 26, 2017

Overloading isn't properly supported with TypedDict. Example:

from typing import overload, Iterable
from mypy_extensions import TypedDict

A = TypedDict('A', {'x': int})

@overload
def f(x: Iterable[str]) -> None: ...

@overload
def f(x: int) -> None: ...

def f(x): pass

a: A
f(a)  # No overload variant matches    <--- Should be fine due to Mapping fallback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant