basedpyright icon indicating copy to clipboard operation
basedpyright copied to clipboard

`reportUnnecessaryIsinstance` for calls that always return false

Open BarrensZeppelin opened this issue 5 months ago • 4 comments

A continuation of the upstream issue https://github.com/microsoft/pyright/issues/8961.

Eric was kind and implemented the feature for classes annotated with @final.

I still think my idea of using instance lay-out conflicts to rule out inheritance relations is useful, but it requires a hard-coded set of built-in types that use special instance lay-outs. Since basedpyright values pragmatism over purity, it may be something you are interested in implementing. :slightly_smiling_face:

BarrensZeppelin avatar Sep 16 '24 06:09 BarrensZeppelin