"TypeVar bound type cannot be generic" reported for non-Generic
types
#2017
Labels
bug
Something isn't working
fixed in next version (main)
A fix has been implemented and will appear in an upcoming version
Environment data
Expected behaviour
No issue reported.
Actual behaviour
Pylance reports "TypeVar bound type cannot be generic" when using
typing.TypeVar
and specifying, for thebound=
parameter, a non-generic class with some very specific conditions (see code snippets)__init__
method, and__init__
has none of its declared positional or keyword arguments annotated with types (excluding *args and **kwargs), andLogs
Code Snippet / Additional information
The issue is suppressed if:
Generic
type variableThe text was updated successfully, but these errors were encountered: