On PEP 322 (ireverse)
Alex Martelli
aleax at aleax.it
Wed Oct 29 09:54:56 EST 2003
Gonçalo Rodrigues wrote:
> I've lost the original thread on my news reader so I'm opening a new
> one.
>
> 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...!
> Just a simple comment/question:
>
> - Why a builtin function? Why not just stuff it in the itertools
It's inappropriate for itertools according to detailed criteria that
Raymond has recently posted here.
> module? The builtins is already fat as it is, making it fatter is not
Yes, builtins should indeed be reserved strictly for the indispensable
cases (and trimmed a LOT in 3.0 -- but that's years away). 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"...
Alex
More information about the Python-list
mailing list