[New-bugs-announce] [issue16573] 2to3 should treat enumerate like sorted for zip, map, filter, dict, xrange

Jonathan Kotta report at bugs.python.org
Thu Nov 29 00:58:00 CET 2012


New submission from Jonathan Kotta:

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.

----------
components: 2to3 (2.x to 3.x conversion tool)
files: enumerate.patch
keywords: patch
messages: 176590
nosy: jpkotta
priority: normal
severity: normal
status: open
title: 2to3 should treat enumerate like sorted for zip, map, filter, dict, xrange
type: behavior
Added file: http://bugs.python.org/file28152/enumerate.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16573>
_______________________________________


More information about the New-bugs-announce mailing list