PEP 322: Reverse Iteration (REVISED, please comment)

Terry Reedy tjreedy at udel.edu
Wed Oct 29 11:58:37 EST 2003


"Werner Schiendl" <n17999950.temp.werner at neverbox.com> wrote in
message news:3f9f9d2a$1 at brateggebdc5.br-automation.co.at...
> > Problem is, iter is currently a built-in function, not a type...

Since iter() constructs and returns a type 'iterator' object, I
expected that it might be a type object, just like int(), etc.  If it
were turned into one, like int(), etc, have been, then

> L = list.sorted(seq)
> i = iter.reversed(seq)
> seems very consistent to me.

would be exactly parallel and hence very consistent.

Unless there is a good reason to not make iter a type object, then
making it so could be part of the suggested implementation of the PEP.

Terry J. Reedy






More information about the Python-list mailing list