2.3 list reverse() bug?

Andrew MacIntyre andymac at bullseye.apana.org.au
Sun Dec 28 04:32:00 EST 2003


On Sun, 28 Dec 2003, Alex Martelli wrote:

> Close enough, for me, that the words "essentially equivalent" appear
> to be quite justified.

I realised after sending that I should have qualified my comment, as the
performance differential of course disappears into the noise as the number
of elements increases.  For lists of 10s of elements and fewer, the slice
has a noticeable advantage over the other 2.

It is also a fair question whether any useful algorithm would be
noticeably affected by the performance difference.

Raymond Hettinger's work on a function/method for returning sorted lists
will further reduce the need for the shallow copy as a specific operation.

Regards,
Andrew.

--
Andrew I MacIntyre                     "These thoughts are mine alone..."
E-mail: andymac at bullseye.apana.org.au  (pref) | Snail: PO Box 370
        andymac at pcug.org.au             (alt) |        Belconnen  ACT  2616
Web:    http://www.andymac.org/               |        Australia





More information about the Python-list mailing list