[Python-Dev] Re: [Python-checkins] CVS: python/dist/src/Lib sre_constants.py (etc)

Greg Ewing greg@cosc.canterbury.ac.nz
Fri, 16 Feb 2001 12:41:53 +1300 (NZDT)


Fredrik Lundh <fredrik@effbot.org>:

> for _i in range(len(__all__)-1,-1,-1):

On a slightly wider topic, it might be nice to have
a clearer way of iterating backwards over a range.

How about a function such as

  revrange(n1, n2)

which would produce the same sequence of numbers
as range(n1, n2) but in the opposite order.
(Plus corresponding xrevrange() of course.)

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg@cosc.canterbury.ac.nz	   +--------------------------------------+