[issue2831] Adding start to enumerate()

Raymond Hettinger report at bugs.python.org
Mon May 12 09:00:03 CEST 2008


Raymond Hettinger <rhettinger at users.sourceforge.net> added the comment:

FWIW, at one point, Guido rejected all variants of the idea.  His first 
objection was that enumerate() is all about pairing values with 
sequence indices, so starting from anything other than zero is in 
conflict with the core concept.  His second objection is that all 
variants can easily be misread as starting at the nth item in the 
sequence (much like islice() does now):   enumerate(3, 'abcdefg') --> 
(3,'d') (4,'e') (5, 'f') (6, 'g').  The latter mis-reading becomes more 
likely for those who think of enumerate as providing indices.  In fact, 
one of the suggested names for enumerate was "indices".

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2831>
__________________________________


More information about the Python-bugs-list mailing list