basedpyright
basedpyright copied to clipboard
`reportUnnecessaryIsinstance` for calls that always return false
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: