KotlinIsland / KotlinIsland/basedmypy
Warn on redundant union entries
- Dominant language
- Python
- Stars
- 202
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Description
I think it would help with understand-ability and discover-ability of certain parts of the python type system.
things such as:
- duck typing
- `bool` extends `int`
- `NoneType` extends `object`
```py
i: int | bool = 1
f: float | int = 1
b: bytes | bytearray | memoryview = b''
o: object | None = "AMONGUS"
```
I would expect all these to trigger warnings that the types are redundant.
Contributor guide
Research direction
No source file, test, or entry point is identified in the issue. Start by finding where basedmypy analyzes union members and emits type diagnostics, then trace how subtype relationships are represented. Done means redundant entries such as int | bool and object | None produce warnings, with coverage for the examples in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100