Skip to content

Use starred unpacking for RUF017 in Python 3.15+#23789

Merged
charliermarsh merged 1 commit intomainfrom
charlie/starred-unpack-rule
Mar 9, 2026
Merged

Use starred unpacking for RUF017 in Python 3.15+#23789
charliermarsh merged 1 commit intomainfrom
charlie/starred-unpack-rule

Conversation

@charliermarsh
Copy link
Copy Markdown
Member

Summary

Closes #22230.

@charliermarsh charliermarsh added rule Implementing or modifying a lint rule fixes Related to suggested fixes for violations preview Related to preview mode features labels Mar 7, 2026
@charliermarsh charliermarsh marked this pull request as ready for review March 7, 2026 15:55
@astral-sh-bot astral-sh-bot bot requested a review from amyreese March 7, 2026 15:55
@astral-sh-bot
Copy link
Copy Markdown

astral-sh-bot bot commented Mar 7, 2026

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Formatter (stable)

✅ ecosystem check detected no format changes.

Formatter (preview)

✅ ecosystem check detected no format changes.

@AlexWaygood AlexWaygood linked an issue Mar 7, 2026 that may be closed by this pull request
@charliermarsh charliermarsh force-pushed the charlie/starred-unpack-rule branch from 6d45238 to 9bf07fd Compare March 7, 2026 16:53
Base automatically changed from charlie/starred-unpack to main March 9, 2026 14:23
@charliermarsh charliermarsh force-pushed the charlie/starred-unpack-rule branch from 9bf07fd to 50e22cb Compare March 9, 2026 14:24
Comment on lines +83 to +88
const fn title(self) -> &'static str {
match self {
Self::FunctoolsReduce => "Replace with `functools.reduce`",
Self::StarredListComprehension => "Replace with a starred list comprehension",
}
}
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.

Would it be better to just have this inline in fix_title()?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes thank you

@charliermarsh charliermarsh force-pushed the charlie/starred-unpack-rule branch from 50e22cb to fe61d69 Compare March 9, 2026 19:10
@charliermarsh charliermarsh enabled auto-merge (squash) March 9, 2026 19:10
@charliermarsh charliermarsh merged commit a76a6bf into main Mar 9, 2026
42 checks passed
@charliermarsh charliermarsh deleted the charlie/starred-unpack-rule branch March 9, 2026 19:15
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 preview Related to preview mode features rule Implementing or modifying a lint rule

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use PEP 798 in RUF017 autofix

2 participants