Skip to content

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

Merged
charliermarsh merged 1 commit intoastral-sh:mainfrom
InSyncWithFoo:UP028
Jan 17, 2025
Merged

[pyupgrade] Avoid syntax error when the iterable is an non-parenthesized tuple (UP028)#15543
charliermarsh merged 1 commit intoastral-sh:mainfrom
InSyncWithFoo:UP028

Conversation

@InSyncWithFoo
Copy link
Contributor

Summary

Resolves #15540.

Test Plan

cargo nextest run and cargo insta test.

@github-actions
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