Open DetachHead opened 2 weeks ago
It doesn't seem like there's enough information here to come to this conclusion because the other
argument has no generic connection to self
(The T
is never used to annotate anything about other
).
So the only conclusion I can see here is that other
should be of type Foo[BoundOfT]
yeah that's what i meant sorry, updated the example to be more clear
Code sample in basedpyright playground
if the generic is covariant it should narrow to
Foo[int | str]
(or whatever the generic's bound is), and if it's contravariant it should narrow toFoo[Never]
i think