We hit an incompatibility of "ManagableIndex" with "Zope 2.8+".

   For Python new style classes, "__len__" instance attributes are no
   longer taken into account
   in the implementation of the "len" builtin.
   "len" now only looks for "__len__" class attributes.

   From "Zope 2.8+" on, all persistent Zope objects
   are instances of new style classes. Especially,
   "ManagableIndex"es are new style classes.
   "ManagableIndex"'s "__len__" instance attribute
   is no longer used by "len".

   Some Zope base class defines the class method "__len__"
   to return 1.

   As a consequence, "len" applied to a "ManagableIndex"
   always returns 1 in Zope 2.8 and later (until "ManagableIndex 1.3.1").

The badly behaving "len" can seriously confuse "AdvancedQuery"
(and other similar query frameworks) that uses "len(index)" to
guide the implementation of sorting.

In our observed case, "AdvancedQuery" sorting was 3 to 5 times
slower and read 3 times more objects than necessary.

The bug is fixed in "ManagableIndex 1.3.1".



Zope-Announce maillist  -  Zope-Announce@zope.org

  Zope-Announce for Announcements only - no discussions

(Related lists - 
 Users: http://mail.zope.org/mailman/listinfo/zope
 Developers: http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to