Skip to content

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