KotlinIsland / KotlinIsland/basedmypy
Support `Overload` types to properly handle overload signatures and implementations
Open
Nobody has claimed this yet.
feature
- Dominant language
- Python
- Stars
- 202
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Description
@overload
def foo(a: int) -> str: ...
@overload
def foo(a: str) -> int: ...
def foo(a: Overload) -> Overload:
reveal_type(a) # a is part of an overloaded type, it could be `int` or `str` (not a union)
return a # error, incorrect overloaded types:
# when expecting str, found int
# when expecting int, found str
The actual Overload type sounds fairly useless, it's just in this egg for demonstration purposes.
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 files, tests, or entry points are named. Start with the overload-signature example in the issue and locate the relevant type-checking behavior; done means Overload values are handled as overloaded types rather than unions, with the shown reveal and compatibility errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100