[Zope-dev] ZCatalog problem: PATCH
Steve Alexander
steve@cat-box.net
Mon, 24 Sep 2001 21:48:52 +0100
Steve Alexander wrote:
>
>
> Patch coming up soon...
Patch against Catalog.py, from CVS:
*** lib/python/Products/ZCatalog/Catalog.py.original
--- lib/python/Products/ZCatalog/Catalog.py.patched
***************
*** 673,679 ****
if (type(so) is type('') and
lower(so) in ('reverse', 'descending')):
r.reverse()
! r=LazyCat(map(lambda i: i[1], r), len(r))
return r
--- 673,681 ----
if (type(so) is type('') and
lower(so) in ('reverse', 'descending')):
r.reverse()
! r=map(lambda i: i[1], r)
! r=LazyCat(r, reduce(lambda x,y: x+len(y), r, 0))
!
return r
I'd use a list comprehension instead of a map(lambda...) if I thought it
would get past Jim ;-)
--
Steve Alexander
Software Engineer
Cat-Box limited