[Zope] Re: Sorting objectValues in Python Script

Andreas Tille tillea@rki.de
Mon, 21 Oct 2002 10:30:58 +0200 (CEST)


On Fri, 18 Oct 2002, Jerome Alet wrote:

> On Fri, Oct 18, 2002 at 09:35:47AM -0400, Casey Duncan wrote:
> > Ick, no lambda needed:
> >
> > items = context.objectItems()
> > items.sort()
> > for id, object in items:
> >     print id, object
> > return printed
> >
> > sort is *much* faster when you don't use a comparison function as well (though sometimes you do need them).
>
> then you'd have to call reverse() too, because he wanted them in reverse
> order.
Thanks to both of you for the further hint

      Andreas.