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

Move map to Iterator #7

Open
Tadaboody opened this issue Nov 29, 2018 · 1 comment
Open

Move map to Iterator #7

Tadaboody opened this issue Nov 29, 2018 · 1 comment
Labels
help wanted Extra attention is needed smell A new smell to report and fix

Comments

@Tadaboody
Copy link
Owner

New smell

Smelly code

for x in seq:
    a = transform(x)
    # Only use a or transform(x)

Fixed code

for a in (transform(x) for x in seq):
    # Only use a or transform(x)

Needs to be compatible with the rest of the smell fixes, especially #6

@Tadaboody Tadaboody added the smell A new smell to report and fix label Nov 29, 2018
Tadaboody added a commit that referenced this issue Dec 31, 2018
@Tadaboody Tadaboody changed the title Missing Map Move map to Iterator Jan 1, 2019
@Tadaboody
Copy link
Owner Author

This is proving harder than expected, not sure how to do it without subclassing the AST module with things like parent-pointers, which seems costly both in runtime and refactoring

@Tadaboody Tadaboody added the help wanted Extra attention is needed label Jan 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed smell A new smell to report and fix
Projects
None yet
Development

No branches or pull requests

1 participant