-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
singledispatch and TypeVar return type #5560
Comments
Unfortunately, I don't see a way to express this using the current type system. This is possibly something where PEP 646 can help with. For now, I will marks this as "inexpressable" and close it, but we can revisit this if and when a solution becomes available in the type system. |
Or possibly PEP 612, for which we have a tracker issue: #4827. |
Reopening as PEP 612 is now mostly available. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It seems that
singledispatch
typing is not very accurate. In particular, it does not respectTypeVar
used in the return type:Here the type of the returned value would always be revealed as
List[T]
instead of different types for different inputs.The text was updated successfully, but these errors were encountered: