[Zope3-Users] Deleting subobjects works "half" only
    Stephan Richter 
    srichter at cosmos.phy.tufts.edu
       
    Fri May 19 07:56:24 EDT 2006
    
    
  
On Friday 19 May 2006 07:47, Frank Burkhardt wrote:
> Unfortunately, the view removes just half the objects - independently of
> how much objects are left inside the container.
That is the correct behavior. BTrees change their internal data structure with 
every change, such as deletion of an item, and thus the keys() method is not 
guaranteed to iterate over all items. Use one of the following instead:
for entry in tuple(tree.keys())
for entry in tree.iterkeys()
Regards,
Stephan
-- 
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
    
    
More information about the Zope3-users
mailing list