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

Switch itertools.groupby closures to class implementation #96

Open
maxfischer2781 opened this issue Nov 22, 2022 · 0 comments
Open

Switch itertools.groupby closures to class implementation #96

maxfischer2781 opened this issue Nov 22, 2022 · 0 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@maxfischer2781
Copy link
Owner

The itertools.groupby implementation currently follows the standard library pure-python implementation. This heavily uses closures to share state between three interlocked async generator functions.

This is confusing for code scanning (https://github.com/maxfischer2781/asyncstdlib/security/code-scanning/85, https://github.com/maxfischer2781/asyncstdlib/security/code-scanning/84) and admittedly for humans as well.

In the interest of maintainability, the code should be refactored with the goal of being more readable/understandable. Similar to other cases, prominently itertools.tee, a class based approach seems appropriate.

@maxfischer2781 maxfischer2781 added help wanted Extra attention is needed good first issue Good for newcomers labels Nov 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant