Skip to content

None comparison is not possible in new versions #3688

Answered by erictraut
bloussou asked this question in Q&A
Discussion options

You must be logged in to vote

The current behavior is "as designed" even if it's not entirely expected.

I see that you have enabled the strict-mode check reportUnnecessaryComparison. This check needs to make some assumptions about the way comparisons work. These assumptions work in most use cases, but there are edge cases where the heuristic will fail.

You're overriding __eq__ in a very unusual way in this code. In fact, you're overriding the __eq__ method for object in an incompatible manner and then ignoring the error using a # type: ignore comment.

I've fixed many bugs and made other changes since version 1.1.224, so I can't say specifically what caused this to work previously. If you can find the specific version …

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@bloussou
Comment options

@erictraut
Comment options

@bloussou
Comment options

Answer selected by bloussou
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants