very good reasons?

Grant Griffin g2 at seebelow.org
Fri Sep 29 21:17:49 CEST 2000


Bjorn Pettersen wrote:
> 
> Grant Griffin wrote:
> >
> > Hi Gang,
> >
> > I was trying to chain "sort" and "reverse" together the other day <<confess>>,
> > ala Perl, but I found that it didn't work, e.g.:
...
> > I would have expected sort and reverse to return the list in question, but
> > instead they return None.
> 
> That's because sort is inefficient on very big lists (it takes over
> 9/100 seconds to sort a 20,000 item list of floating point numbers!).
> Since we know it's so slow, we wouldn't want you to write code like "for
> i in a.sort()" without having to jump through some loops...

But how long does it take to sort on the _second_ call? <wink>

bubble-sorts-may-not-be-so-bad-after-all-ly y'rs,

=g2
-- 
_____________________________________________________________________

Grant R. Griffin                                       g2 at dspguru.com
Publisher of dspGuru                           http://www.dspguru.com
Iowegian International Corporation	      http://www.iowegian.com



More information about the Python-list mailing list