[Python-ideas] Consider making enumerate a sequence if its argument is a sequence

Terry Reedy tjreedy at udel.edu
Wed Sep 30 21:57:03 CEST 2015

On 9/30/2015 1:28 PM, Chris Barker wrote:

> But again, we could add indexing to enumerate, and have it do the ugly
> inefficient thing when it's using an underlying non-indexable iterator,

If the ugly inefficient thing is to call list(iterable), then that does 
not work with unbounded iterables.  Or the input iterable might produce 
inputs at various times in the future.

Terry Jan Reedy

More information about the Python-ideas mailing list