comparison-with-itself (PLR0124)
Added in v0.0.273 · Related issues · View source
Derived from the Pylint linter.
What it does
Checks for operations that compare a name to itself.
Why is this bad?
Comparing a name to itself typically results in a truthy value, and is likely a mistake.
Example
In some cases, self-comparisons are used to determine whether a float is
NaN. Instead, prefer math.isnan: