A suggestion for a possible Python module

Terry Reedy tjreedy at udel.edu
Tue Mar 4 15:39:26 CET 2003


"Alex Martelli" <aleax at aleax.it> wrote in message
news:nKZ8a.2029$zo2.77091 at news2.tin.it...
> Still, I do think Gries' algorithm would be a good reason to add
> optional start and stop arguments to Python lists' *reverse*
> method.  Hmmm...

Pending such an addition (which I would like) would something using
the new 2.3 stride feature work? Something like (untested, since I
don't have 2.3 yet):

alist[start:stop] = alist[stop:start:-1] # But at least twice as slow
as in-place reverse

TJR






More information about the Python-list mailing list