Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ use crate::fix::snippet::SourceCodeSnippet;
/// Checks for operations that compare a name to itself.
///
/// ## Why is this bad?
/// Comparing a name to itself always results in the same value, and is likely
/// a mistake.
/// Comparing a name to itself is likely a mistake, as `__eq__` may be
/// overridden to return a non-trivial value.
Comment on lines +15 to +16
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is quite the change we were picturing. This phrasing suggests that __eq__ returning an unusual value causes the issue, but the opposite is true. The lint rule applies except when you've overriden __eq__ to return something weird.

///
/// ## Example
/// ```python
Expand Down