KotlinIsland / KotlinIsland/basedmypy
generic bounds don't work with bare typevar
Open
bug
p-1
- Dominant language
- Python
- Stars
- 202
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Description
```py
from typing import TypeVar
T = TypeVar("T")
R = TypeVar("R", bound=T)
def foo(t: T, r: R): ...
o: object
f: float
foo(f, o) # no error
```
Contributor guide
Research direction
Run the supplied Python reproducer through basedmypy first and confirm that foo(f, o) is accepted. Then trace the type-variable bound-checking path and add a regression test showing that this call is rejected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100