Skip to content

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

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

charliermarsh merged 1 commit into
astral-sh:mainfrom
InSyncWithFoo:UP028

Conversation

@InSyncWithFoo

Copy link
Copy Markdown
Contributor

Summary

Resolves #15540.

Test Plan

cargo nextest run and cargo insta test.

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

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

Thanks, this makes sense to me.

@charliermarsh

Copy link
Copy Markdown
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
@InSyncWithFoo
InSyncWithFoo deleted the UP028 branch January 17, 2025 01:42
@dhruvmanila dhruvmanila added the bug An issue describing something that isn't working, or a PR that fixes a bug label Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug An issue describing something that isn't working, or a PR that fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UP028 fix fails on unparenthesized tuple

3 participants