Skip to content

RFC: upgrade from typing.TypeVar (legacy) to PEP 695 syntactic typevars #20225

Description

@neutrinoceros

In #20223, I'm choosing to (temporarily) ignore PEP 695 lint rules, that suggests using syntactic type variables. This is for a couple reasons:

  • while most of the violations can be auto-fixed by ruff, the fix isn't safe (subtle differences might creep in, in particular around variance)
  • I'd like to keep DEP: drop support for Python 3.11, require 3.12+ #20223 as clean as possible. It does contain (100% safe) cleanups, but I'd rather not scope creep it with unnecessary upgrades.

linked PRs:

Activity

  1. neutrinoceros commented on Sep 8, 2026

    @neutrinoceros
    ContributorAuthor

    The set of open PRs is complete in that it will resolve all remaining violations to rules UP046 and UP047 in existing code. What remains to be done besides merging these is to re-enable the rules globally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions