make type annotations on overload implementation signature optional
Open
Nobody has claimed this yet.
feature
topic-overloads
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- PR merge metrics
- PR metrics pending
Description
Feature
I want to be able to do this:
@overload
def foo(a: int) -> int: ...
@overload
def foo(a: str) -> str: ...
def foo(a): ... # inferred as (a: int | str) -> int | str
I think I might develop RSI if I have to implement too many more overload signatures, making the type annotations optional on the implementation might ease my wrist pain a little.
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.
Research direction
No file, test, or entry point is named. Start by searching the mypy codebase for overload implementation handling and type inference, then use the example in the issue as the acceptance case. Done means an unannotated implementation after overload declarations is accepted and inferred as accepting int | str and returning int | str.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- compilers, devtools
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 38/100