Should I use a dictionary?

Rainer Deyke root at rainerdeyke.com
Tue Jun 26 23:18:12 EDT 2001


"phil hunt" <philh at comuno.freeserve.co.uk> wrote in message
news:slrn9ji5aq.dqn.philh at comuno.freeserve.co.uk...
> On 25 Jun 2001 21:41:13 -0700, Aahz Maruch <aahz at panix.com> wrote:
> >In article <sTTZ6.248652$p33.5007707 at news1.sttls1.wa.home.com>,
> >Greg Jorgensen <gregj at pdxperts.com> wrote:
> >>
> >>When you want to sort the messages, use your own sort function to
compare
> >>the message date/time:
> >
> >That's a Bad Idea if there are a lot of messages; such comparison
> >functions are expensive.
>
> How else do you do sorting, without comparisons?

Counting sort or bucket sort, but I think he's really refering to the fact
that this:

l.sort()

is much faster than this:

l.sort(f)

on the current implementation of Python, where 'l' is any long list and 'f'
is any function or other callable object.


--
Rainer Deyke (root at rainerdeyke.com)
Shareware computer games           -           http://rainerdeyke.com
"In ihren Reihen zu stehen heisst unter Feinden zu kaempfen" - Abigor





More information about the Python-list mailing list