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

Add rule to check for unnecessary generator expressions #581

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tjkuson
Copy link
Contributor

@tjkuson tjkuson commented Jul 1, 2024

Adds C421 that checks for unnecessary generator expressions that simply yield items from an iterable.

This patch contains a recursive function to determine if two tuple match whilst handling nesting (for example, (a, ((b, c) d))). I can change it to not check nested tuples if you would rather not have that complexity.

Closes #503

@tjkuson tjkuson marked this pull request as ready for review July 1, 2024 13:03
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

Successfully merging this pull request may close these issues.

Feature Request: (New Rule) Detect useless generator pattern
1 participant