[Gllug] OSS CMSs

Bruce Richardson itsbruce at uklinux.net
Thu Apr 28 09:36:17 UTC 2005


On Thu, Apr 28, 2005 at 09:36:51AM +0100, Doug wrote:
> 
> >>> l = [1,2,3,4,5,6]
> >>> def func(x): return -x
> ...
> >>> l.sort(lambda x,y: cmp(func(x), func(y)))
> >>> l
> [6, 5, 4, 3, 2, 1]
> 
> Clean, obvious what it does and quick (the built in sort method is very 
> efficient).

Last time I looked, the sort method suffered when using a user-defined
compare function, so DSU was the recommended approach.  Has this
changed?

-- 
Bruce

I must admit that the existence of Disneyland (which I know is real)
proves that we are not living in Judea in AD 50. -- Philip K. Dick
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: Digital signature
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20050428/d5462c70/attachment.pgp>
-------------- next part --------------
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug


More information about the GLLUG mailing list