Skip to content

[pylint] De-emphasize __hash__ = Parent.__hash__ (PLW1641) - #18613

Merged
ntBre merged 2 commits into
mainfrom
brent/plw1641-docs
Jun 10, 2025
Merged

ntBre merged 2 commits into
mainfrom
brent/plw1641-docs

Conversation

@ntBre

@ntBre ntBre commented Jun 10, 2025

Copy link
Copy Markdown
Contributor

Summary

This PR updates the docs for PLW1641 to place less emphasis on the example of inheriting a parent class's __hash__ implementation by both reducing the length of the example and warning that it may be unsound in general, as @AlexWaygood pointed out on Notion.

Test plan

Existing tests

Summary
--

This PR updates the docs for PLW1641 to place less emphasis on the example of
inheriting a parent class's `__hash__` implementation by both reducing the
length of the example and warning that it may be unsound in general, as
@AlexWaygood pointed out on Notion.

Test plan
--

Existing tests
@ntBre
ntBre requested a review from AlexWaygood June 10, 2025 18:04

@AlexWaygood AlexWaygood left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Perfect, thank you! Some unrelated wordsmithing that we could also do while we're here:

Comment thread crates/ruff_linter/src/rules/pylint/rules/eq_without_hash.rs Outdated
Comment thread crates/ruff_linter/src/rules/pylint/rules/eq_without_hash.rs Outdated
@AlexWaygood AlexWaygood added the documentation Improvements or additions to public-facing documentation label Jun 10, 2025
@github-actions

github-actions Bot commented Jun 10, 2025 •

Copy link
Copy Markdown
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
@ntBre
ntBre enabled auto-merge (squash) June 10, 2025 18:19
@ntBre
ntBre merged commit 6cd0669 into main Jun 10, 2025
@ntBre
ntBre deleted the brent/plw1641-docs branch June 10, 2025 18:21
dcreager added a commit that referenced this pull request Jun 10, 2025
* main:
  [`pylint`] De-emphasize `__hash__ = Parent.__hash__` (`PLW1641`) (#18613)
  [`flake8-pyi`] Avoid syntax error in the case of starred and keyword arguments (`PYI059`) (#18611)
  [ty] Add support for global __debug__ constant (#18540)
  [`ruff`] Preserve parentheses around `deque` in fix for `unnecessary-empty-iterable-within-deque-call` (`RUF037`) (#18598)
  [`refurb`] Parenthesize lambda and ternary expressions in iter (`FURB122`, `FURB142`) (#18592)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to public-facing documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants