[Zope] problems sorting list

Oleg Broytmann Oleg Broytmann <phd@phd.pp.ru>
Fri, 28 Sep 2001 17:41:23 +0400


On Fri, Sep 28, 2001 at 03:33:28PM +0200, Sebastian Kügler wrote:
> I can not imagine that this can not be done with sort()

   Of course it can be done.

> > #list.sort(lambda a,
> b:cmp(a.bobobase_modification_time,b.bobobase_modification_time))

   bobobase_modification_time is a function - call it:

list.sort(lambda a, b: \
   cmp(a.bobobase_modification_time(), b.bobobase_modification_time()))

Oleg.
---- 
     Oleg Broytmann     http://www.zope.org/Members/phd/     phd@phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.