KotlinIsland / KotlinIsland/basedmypy

infer literal generics

Open
#712 0 comments 0 reactions 0 assignees View on GitHub
topic-inference
Dominant language
Python
Stars
202
Forks
6
PR merge metrics
No merged PRs in 30d

Description

```py
def f[T](t: T) -> T: ..

f(1) # int, should be 1
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the generic function example in basedmypy and trace how its type inference handles the call f(1). Done means the inferred result preserves the literal value as 1 rather than widening it to int.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.