[Python-Dev] Adding start to enumerate() (original) (raw)
Brett Cannon brett at python.org
Mon May 12 00:44:22 CEST 2008
- Previous message: [Python-Dev] Adding start to enumerate()
- Next message: [Python-Dev] Adding start to enumerate()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Sun, May 11, 2008 at 3:20 PM, Georg Brandl <g.brandl at gmx.net> wrote:
I believe the following is a common use-case for enumerate() (at least, I've used it quite some times):
for lineno, line in enumerate(fileobject): ... For this, it would be nice to have a start parameter for enumerate(). The changes are minimal -- okay for 2.6?
Taking a new argument that has a default shouldn't be an issue. +1 from me. I assume it is just going to start the count at that number, not advance the iterable to that point, right?
-Brett
- Previous message: [Python-Dev] Adding start to enumerate()
- Next message: [Python-Dev] Adding start to enumerate()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]