Skip to content

Clarify motivation for E713 and E714 - #11483

Merged
zanieb merged 1 commit into
astral-sh:mainfrom
mnme:e713-e714-improve-description
May 21, 2024
Merged

zanieb merged 1 commit into
astral-sh:mainfrom
mnme:e713-e714-improve-description

Conversation

@mnme

@mnme mnme commented May 21, 2024

Copy link
Copy Markdown
Contributor

The wording 'negative comparison' is a rather vague description of the 'is not' operation and does not describe what the 'not in' operation does (potentially copied from 'is not'). This was replaced with more precise language to describe the operators taken from the official python docs1.

Both rules didn't have a strong reasoning besides 'it's bad, use the other'. The origin of these rules seems to be PEP82 which prefers 'is not' over 'not ... is' for readability. This is now reflected in the description.

The wording 'negative comparison' is a rather vague description of the
'is not' operation and does not describe what the 'not in' operation
does (potentially copied from 'is not'). This was replaced with more
precise language to describe the operators taken from the official
python docs[1].

Both rules didn't have a strong reasoning besides 'it's bad, use the
other'. The origin of these rules seems to be PEP8[2] which prefers 'is
not' over 'not ... is' for readability. This is now reflected in the
description.

[1]: https://docs.python.org/3/reference/expressions.html#membership-test-operations
[2]: https://peps.python.org/pep-0008/#programming-recommendations
@github-actions

Copy link
Copy Markdown
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@zanieb zanieb 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.

Thank you!

@zanieb zanieb added the documentation Improvements or additions to public-facing documentation label May 21, 2024
@zanieb
zanieb merged commit 84531d1 into astral-sh:main May 21, 2024
@mnme
mnme deleted the e713-e714-improve-description branch May 21, 2024 19:24
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