[Python-3000] rename it.next() to it.next(), add a next() built-in (original) (raw)
Terry Reedy tjreedy at udel.edu
Tue Mar 6 02:37:33 CET 2007
- Previous message: [Python-3000] rename it.next() to it.__next__(), add a next() built-in
- Next message: [Python-3000] rename it.next() to it.__next__(), add a next() built-in
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
"Greg Ewing" <greg.ewing at canterbury.ac.nz> wrote in message news:45ECA6CA.6010309 at canterbury.ac.nz... | Terry Reedy wrote: || > One of the virtues, and as I recall, design purposes, of .next calls is to | > be fast. After the first call, execution jumps directly into the | > pre-existing stack frame. || You're thinking of generators,
I noticed after sending
| > It is then fairly | > standard to factor out the attribute lookup with with 'xnext = x.next' || You could still do xnext = x.next if you wanted.
Of course. And one of my points is that the translater must make this translation, which seems not to be in the current proposal, to avoid breaking code. The other is that this idiom makes the use cases for a builtin rather rare.
tjr
- Previous message: [Python-3000] rename it.next() to it.__next__(), add a next() built-in
- Next message: [Python-3000] rename it.next() to it.__next__(), add a next() built-in
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]