PEP 322: Reverse Iteration (REVISED, please comment)
Alex Martelli
aleax at aleax.it
Tue Oct 28 18:37:20 EST 2003
Werner Schiendl wrote:
...
> Another possibility would be to have a static method for iter:
>
> for elem in iter.reversed(sed):
> print elem
>
> (in that case I'd use an attribute rather than a verb, because
> the generated iter(ator) will be reverse_d_).
>
> The static method approach would clearly document that the
> result is an iterator (which none of the other names proposed
> really does IMHO)
I like this one! Another advantage is, one fewer built-in.
Problem is, iter is currently a built-in function, not a type...
Alex
More information about the Python-list
mailing list