Skip to content

docs: fix PLR0124 description to not claim self-comparison always returns the same value#24749

Open
avasis-ai wants to merge 1 commit intoastral-sh:mainfrom
avasis-ai:fix/plr0124-docs-v2
Open

docs: fix PLR0124 description to not claim self-comparison always returns the same value#24749
avasis-ai wants to merge 1 commit intoastral-sh:mainfrom
avasis-ai:fix/plr0124-docs-v2

Conversation

@avasis-ai
Copy link
Copy Markdown

Closes #22160

Summary

PLR0124 documentation previously stated that comparing a name to itself "always results in the same value". This is incorrect because __eq__ can be overridden (e.g., float('nan') == float('nan') returns False).

Updated to match the suggestion in the issue: Comparing a name to itself typically results in a truthy value, and is likely a mistake.

@astral-sh-bot astral-sh-bot Bot requested a review from ntBre April 20, 2026 16:53
@MichaReiser MichaReiser added the documentation Improvements or additions to documentation label Apr 20, 2026
@astral-sh-bot
Copy link
Copy Markdown

astral-sh-bot Bot commented Apr 21, 2026

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+2 -0 violations, +0 -0 fixes in 2 projects; 54 projects unchanged)

binary-husky/gpt_academic (+1 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --no-fix --output-format concise --preview

+ shared_utils/nltk_downloader.py:2141:17: B909 Mutation to loop iterable `self._download_msg_queue` during iteration

pytest-dev/pytest (+1 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --no-fix --output-format concise --preview

+ scripts/release.py:65:17: B909 Mutation to loop iterable `lines` during iteration

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
B909 2 2 0 0 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PLR0124 Documentation Issue

4 participants