[ZCM] [ZC] 1332/ 2 Comment "Catalog needs to wean itself off of BTrees Length as __len__ for HEAD"

Collector: Zope Bugs, Features, and Patches ... zope-coders-admin at zope.org
Mon Oct 4 15:20:45 EDT 2004


Issue #1332 Update (Comment) "Catalog needs to wean itself off of BTrees Length as __len__ for HEAD"
 Status Pending, Zope/bug critical
To followup, visit:
  http://collector.zope.org/Zope/1332

==============================================================
= Comment - Entry #2 by ajung on Oct 4, 2004 3:20 pm

Fixing the problem in the code is not the real problem but migration is. 

We could change the code for 2.7.4 and add some migration mechanism (a dedicated method that moves the counter from
__len__ to some other attribute. Upgrading from 2.7 to 2.8
would require a former migration under 2.7.4 and we could
clean up the implementation on the SVN trunk.
________________________________________
= Request - Entry #1 by mcdonc on May 15, 2004 5:46 pm

The Catalog uses a BTrees Length object as it's instance's __len__, but this no longer works as expected on the HEAD when the Catalog is a new-style class (as per BTrees Length module docs):

    It is tempting to to assign length objects to __len__ attributes
    to provide instance-specific __len__ methods. However, this no
    longer works as expected, because new-style classes cache
    class-defined slot methods (like __len__) in C type slots.  Thus,
    instance-define slot fillers are ignores.

==============================================================



More information about the Zope-Collector-Monitor mailing list