Skip to content

A function returning TypeVar should receive at least one argument containing the same Typevar #13765

Closed
@Xophmeister

Description

@Xophmeister

Documentation

mypy recently (first noticed today: 2022-09-29) started failing my code with the following:

A function returning TypeVar should receive at least one argument containing the same Typevar

I did a cursory search and found no reference to this rule. Personally, I find it unnecessarily restrictive. For example, an object method could return that TypeVar without having any arguments; i.e., just relying on the object's state. Nonetheless, I assume it was added for good reason. Can that reason please be elaborated on somewhere in the documentation and/or mypy's output?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions