Callable[..., T] causes false positive in overload checks
Open
@Michael0x2a is already working on this.
Since Jan 4, 2019.
bug
false-positive
priority-1-normal
topic-overloads
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- PR merge metrics
- PR metrics pending
Description
This example:
@overload
def deco(f: Callable[[], int]) -> Callable[[], str]: ...
@overload
def deco(f: Callable[..., int]) -> Callable[..., str]: ...
def deco(f):
pass
causes
Overloaded function signature 2 will never be matched: signature 1's parameter type(s) are the same or broader
But it should be allowed (the same way we allow various last overloads with Any types).
cc @Michael0x2a
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.