KotlinIsland / KotlinIsland/basedmypy
infer type-guards
Open
feature
p-1
topic-inference
TypeGuard
- Dominant language
- Python
- Stars
- 202
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Description
```py
def guard(x: object) -> bool: # inferred as "x is int"
return isinstance(x, int)
def is_even(x: object) -> bool: # inferred as "x is int if True else False"
return isinstance(x, int) and x > 0
Contributor guide
Research direction
Start with the two Python examples in the issue and trace the type-inference paths for functions returning isinstance checks and compound conditions. Done means the checker infers the illustrated type-guard behavior for both guard and is_even, with tests covering those results.
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