Closed uKaigo closed 2 months ago
As you mentioned, this is already covered under the reportUnecessaryComparision
rule. I don't think that a separate redundant check makes sense here.
Yes, to be honest my reasoning was to make it not require strict mode to be caught. But I guess if someone needs this type of thing they should have it on.
Is your feature request related to a problem? Please describe. Currently, if you reference a callable that returns a bool inside a comparision statement without calling it, pyright does not detect an error under normal mode. In strict mode, it does error with
reportUnecessaryComparision
but that's because the callable is truthy.Describe the solution you’d like Ideally, pyright could provide a slightly different message from
reportUnecessaryComparision
, under default mode. Something likeConditional expression references callable which returns a bool
.