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

merge-list-extend should work with generators #376

Open
2 tasks done
barredterra opened this issue Aug 8, 2023 · 0 comments
Open
2 tasks done

merge-list-extend should work with generators #376

barredterra opened this issue Aug 8, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@barredterra
Copy link

Checklist

  • I think this refactoring is useful for everyone (if it's too specific, consider a custom rule)
  • I have checked there are no similar issues suggesting the same thing

Description

After running append-to-extend, I get a lot of snippets like the one below. I expected merge-list-extend to further compress this, but so far it only triggers, when a list is passed to extend.

Code Before

my_list = []
my_list.extend(n ** n for n in range(10))

Code After

my_list = [n ** n for n in range(10))]
@barredterra barredterra added the enhancement New feature or request label Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant