◐ Shell
clean mode source ↗

Issue 16573: 2to3 should treat enumerate like sorted for zip, map, filter, dict, xrange

enumerate() is a "consuming_call", as defined in fixer_util.py, because it takes an iterable (not necessarily a collection).  Therefore whenever we have something like enumerate(zip(...)), we don't need to replace it with enumerate(list(zip(...))) in 2to3, because enumerate doesn't care that zip no longer returns a list.

Patch attached.