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

Feature Request: No Useless List Unpack-Repack #534

Open
Skylion007 opened this issue Sep 30, 2023 · 1 comment
Open

Feature Request: No Useless List Unpack-Repack #534

Skylion007 opened this issue Sep 30, 2023 · 1 comment

Comments

@Skylion007
Copy link
Contributor

Description

Saw this is in a discussion on RUFF: astral-sh/ruff#7618

Thread just mentions this construct[*x] as opposed to just calling list(x). Not only is the later more readable, I would assume it's more efficient because lack of arg unpack (we should benchmark it though)? You may want to add a rule to flag this weird construct.

@adamchainz
Copy link
Owner

Sounds sensible but let’s not assume and do a benchmark first. dicts can also be constructed via unpack so the rule could cover both.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants