Re: [Python-3000] rename it.next() to it.__next__(), add a next() built-in

2007-03-06 Thread Martin v. Löwis
Terry Reedy schrieb: > On the consistency argument: sorted(somelist) calls copy(somelist).sort, > not copy(somelist).__sort__. Actually, it calls list(somelist).sort, so it requires iteration, not copying, and the result will be known to be a list. So the important difference is that .sort is

Re: [Python-3000] rename it.next() to it.__next__(), add a next() built-in

2007-03-05 Thread Terry Reedy
"Greg Ewing" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | 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 o

Re: [Python-3000] rename it.next() to it.__next__(), add a next() built-in

2007-03-05 Thread Greg Ewing
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, but not all iterators are implemented by generators. The built-in ones a

Re: [Python-3000] rename it.next() to it.__next__(), add a next() built-in

2007-03-05 Thread Terry Reedy
"Ka-Ping Yee" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] On the consistency argument: sorted(somelist) calls copy(somelist).sort, not copy(somelist).__sort__. But I don't expect to see this change proposed. | Transition Plan | === | | Two additional transformati