I apologize for reopening this discussion, but I'm considering reversing our earlier decision and adding an error (or at least a warning) in pyright for a TypeVar that appears only once in a function signature.
We continue to receive a stream of bug reports filed against pyright that are actually bugs in the user's code based on misuse (and a misunderstanding) of TypeVars in generic functions. Most of these misunderstandings could be avoided if we introduction an error message in this case.
Rebecca, I'm curious what decision you made for pytype. Does it still emit an error in this case, or did you decide to remove the check based on this discussion?
-Eric
-- Eric Traut Contributor to pyright & pylance Microsoft Corp.