Skip to content

Check for redundant types in more places #8137

@nickdrozd

Description

@nickdrozd

Current problem

Currently the redundant typehint check only runs against variable type annotations. But that isn't the only place where redundant types can occur. For example, they can occur in function signatures:

def f(p: int | int) -> str | str: ...

They can occur in compound types:

z: dict[int | int, str | str]

And they can occur in type aliases:

Q = int | int

Desired solution

Check for redundant types anywhere they can occur, or at least in as many places as possible.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions