Offer the community a choice for a simpler, limited alternative.
This commit is contained in:
parent
9939002fc5
commit
6f412ebc5e
10
pep-0322.txt
10
pep-0322.txt
|
@ -153,6 +153,16 @@ library and comments on why reverse iteration was necessary:
|
||||||
underlying list is altered during iteration.
|
underlying list is altered during iteration.
|
||||||
|
|
||||||
|
|
||||||
|
Active Alternative
|
||||||
|
==================
|
||||||
|
|
||||||
|
A simpler, but limited alternative is to create a builtin called
|
||||||
|
reverse_range() that takes the same arguments as range() but returns a
|
||||||
|
reverse iterator over the range. The idea is that much of the benefit
|
||||||
|
of inreverse() comes reducing the intellectual effort it takes to
|
||||||
|
express the arguments for [x]range() when going backwards.
|
||||||
|
|
||||||
|
|
||||||
Rejected Alternative
|
Rejected Alternative
|
||||||
====================
|
====================
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue