[Python-3000] PEP: rename it.next() to it.next(), add a next() built-in (original) (raw)
Greg Ewing greg.ewing at canterbury.ac.nz
Mon Mar 5 23:45:18 CET 2007
- Previous message: [Python-3000] PEP: rename it.next() to it.__next__(), add a next() built-in
- Next message: [Python-3000] PEP: rename it.next() to it.__next__(), add a next() built-in
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Ka-Ping Yee wrote:
Just like getattr, two-argument next(iter, sentinel) returns sentinel if StopException is caught.
+1. I've written a number of pieces of code where this would have made things neater. Just about any place where I've used .next() explicitly, in fact -- it always seems awkward having to deal with StopIteration.
-- Greg
- Previous message: [Python-3000] PEP: rename it.next() to it.__next__(), add a next() built-in
- Next message: [Python-3000] PEP: rename it.next() to it.__next__(), add a next() built-in
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]