Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark PLE1141 fix as unsafe #13629

Merged
merged 3 commits into from
Oct 4, 2024
Merged

Mark PLE1141 fix as unsafe #13629

merged 3 commits into from
Oct 4, 2024

Conversation

zanieb
Copy link
Member

@zanieb zanieb commented Oct 4, 2024

Closes #13343

@zanieb zanieb added rule Implementing or modifying a lint rule fixes Related to suggested fixes for violations labels Oct 4, 2024
Comment on lines 37 to 47
/// ## Fix safety
/// If the dictionary key is a tuple, e.g.:
///
/// ```python
/// d = {(1, 2): 3, (3, 4): 5}
/// for x, y in d:
/// print(x, y)
/// ```
///
/// The tuple key is unpackaged into `x` and `y` instead of the key and values. This means that
/// the suggested fix of using `d.items()` would result in different runtime behavior.
Copy link
Member Author

Choose a reason for hiding this comment

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

See also #13627

Copy link
Contributor

github-actions bot commented Oct 4, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@zanieb zanieb merged commit 2a365bb into main Oct 4, 2024
20 checks passed
@zanieb zanieb deleted the zb/ple1141-unsafe branch October 4, 2024 19:22
zanieb added a commit that referenced this pull request Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixes Related to suggested fixes for violations rule Implementing or modifying a lint rule
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid fix for PLE1141
2 participants