good_smell
good_smell copied to clipboard
Move map to Iterator
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
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