On PEP 322 (ireverse)

Terry Reedy tjreedy at udel.edu
Wed Oct 29 12:03:54 EST 2003


"Alex Martelli" <aleax at aleax.it> wrote in message
news:4xQnb.373812$R32.12367046 at news2.tin.it...
> Gonçalo Rodrigues wrote:
> > First, i like the name ireverse, much better then inreverse
(eek!).
>
> I still prefer Werner Schiendl's idea of iter.reversed, IF we find a
> way to have builtin function iter grow a 'staticmethod' of sorts...!

As I suggested elsewhere, make iter() the type object for iterator.
Then iter.reversed is closely parallel to list.sorted.

> Which is
> why, e.g., list.sorted was made a classmethod of type list, rather
> than a built-in.  Similarly, IF iter was a type, iter.reversed would
> be the "one obvious way to do it"...

Any good reason not to make iter so?  int, str, and float were once
bifs also.  I'm +1 on iter.reversed, along with list.sorted.

Terry J. Reedy






More information about the Python-list mailing list