Generic object attribute with contraints wrongly seen as TypeVar
or Generic
type in isinstance
#1730
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
Code Snippet
Expected behaviour
I'd expect pylance to not throw an
Second argument to "isinstance" must be a class or tuple of classes
TypeVar or generic type with type arguments not allowed
error on the second argument passed toisisntance()
.Actual behaviour
Error is thrown.
Additional information
Possibly related/in addition to #1294 and
using a
TypeVar
without constraints works well.(removing the constraints
TypeVar("T", int, str)
->TypeVar("T")
does not lead to an error)The text was updated successfully, but these errors were encountered: