Skip to content

Add rule for using PEP696 default type params #12286

@janosh

Description

@janosh

PEP 696 allows cleaning up code like

from typing import Generator

def gen() -> Generator[int, None, None]:  # bad (on 3.13+)
    yield 42

def gen() -> Generator[int]:  # good
    yield 42

would be great if ruff had an auto-fix for that if the target version is at least 3.13

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedReady for implementationgood first issueGood for newcomerspython313Related to Python 3.13ruleImplementing or modifying a lint rule

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions