KotlinIsland / KotlinIsland/basedmypy

generic bounds don't work with bare typevar

Open
#402 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.