python / python/typing_extensions

Bug: `typing_extensions.Generic` not support `TypeVar` defaults

Open
#672 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
583
Forks
146
Avg merge
10h 11m
Merged PRs (30d)
5

Description

Work MRE.

Setup

>> python version: 3.13.5 (main, Jun 21 2025, 09:35:00) [GCC 15.1.1 20250425]

MRE

from typing import TypeVar, Generic, get_args

R = TypeVar("R")
T = TypeVar("T", default=int)

class A(Generic[R, T]):
    pass

assert get_args(A[str]) == (str, int)

Not work MRE.

Setup

>> python version: 3.10.17 (main, Apr  9 2025, 04:03:39) [Clang 20.1.0 ]

>> uv pip show typing-extensions
Name: typing-extensions
Version: 4.15.0

MRE

from typing_extensions import TypeVar, Generic, get_args

R = TypeVar("R")
T = TypeVar("T", default=int)

class A(Generic[R, T]):
    pass

assert get_args(A[str]) == (str,)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the Python 3.13 MRE and the typing_extensions MRE to compare their get_args results. Trace the TypeVar default handling used by Generic in typing_extensions, then verify that A[str] includes int as in the standard-library example.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.