KotlinIsland / KotlinIsland/basedmypy

generic bounds don't work with a generic tuple

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

Description

```python
from typing import Generic, TypeVar
from basedtyping import T

class Foo(Generic[T]): ...

U = TypeVar("U", bound=Foo[T])

class G(Generic[T]): ...

class C(G[tuple[U, T]]): ...

# error: Value of type variable "U" of "C" cannot be "int"
reveal_type(C[Foo[int], int])
```

Contributor guide

Open the contributing guide

Research direction

Start by running the provided Python snippet with basedmypy and confirm the erroneous type-variable diagnostic. Trace generic bound handling for Foo[T] when it appears inside tuple[U, T]; done means C[Foo[int], int] is accepted and its revealed type is reported without that error.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.