Skip to content

Ban typing.TypeVar in favor of typing_extensions.TypeVar#3350

Merged
sobolevn merged 1 commit into
typeddjango:masterfrom
UnknownPlatypus:ban-typing-typevar
May 2, 2026
Merged

Ban typing.TypeVar in favor of typing_extensions.TypeVar#3350
sobolevn merged 1 commit into
typeddjango:masterfrom
UnknownPlatypus:ban-typing-typevar

Conversation

@UnknownPlatypus

@UnknownPlatypus UnknownPlatypus commented May 1, 2026

Copy link
Copy Markdown
Contributor

I have made things!

We declare a dependency on typing_extensions so this ensure default=... works with all supported python.
I've added a banned-api ruff rule to ensure if cannot regress

Related issues

Had issue in ci for #3317 which made me think of this

AI Policy

  • I have read and agree to the AI Policy, removed any "Co-Authored-By" lines attributing coding agents, and manually reviewed the final result

@sobolevn sobolevn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically, this is only needed for default= argument, but we can use it for all cases with no problems.

@sobolevn sobolevn merged commit 75ec809 into typeddjango:master May 2, 2026
55 checks passed
@UnknownPlatypus UnknownPlatypus deleted the ban-typing-typevar branch May 2, 2026 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants