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

[pyupgrade] Avoid syntax error when the iterable is an non-parenthesized tuple (UP028) #15543

Merged
merged 1 commit into from
Jan 17, 2025

Conversation

InSyncWithFoo
Copy link
Contributor

Summary

Resolves #15540.

Test Plan

cargo nextest run and cargo insta test.

Copy link
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Copy link
Member

@charliermarsh charliermarsh left a comment

Choose a reason for hiding this comment

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

Thanks, this makes sense to me.

@charliermarsh
Copy link
Member

I think an unparenthesized generator might have a similar problem, but isn't syntactically valid in the for, like:

for _ in x for y in z:
    pass

@charliermarsh charliermarsh merged commit fa239f7 into astral-sh:main Jan 17, 2025
21 checks passed
@InSyncWithFoo InSyncWithFoo deleted the UP028 branch January 17, 2025 01:42
@dhruvmanila dhruvmanila added the bug Something isn't working label Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UP028 fix fails on unparenthesized tuple
3 participants