[Zope] Deleting several items from BTrees

Oliver Bleutgen myzope@gmx.net
Wed, 09 Apr 2003 11:10:02 +0200


Dieter Maurer wrote:

>       self.manage_delObjects(list(self.objectIds()))
> 
> "manage_delObjects" wants to get a list passed, not a tuple.

Uhm, this shows what I wrote in another mail about what ObjectManager 
does is very wrong, I should have looked at the source.

Can anybody explain why manage_delObjects in ObjectManager uses this 
code to delete objects:

while ids:
   id=ids[-1]
   v=self._getOb(id, self)
   if v is self:
     raise 'BadRequest', '%s does not exist' % escape(ids[-1])
   self._delObject(id)
   del ids[-1]

instead of just using a "for id in ids:" loop?

Just curios.

oliver