[ZODB-Dev] Re: [Zope-dev] [BUG] maybe yet unknown BTREES bug

Christian Reis kiko@async.com.br
Sun, 26 Jan 2003 14:04:52 -0200


On Sat, Jan 25, 2003 at 09:02:16AM -0500, Tim Peters wrote:
> [Chris McDonough]
> > You would think so, but if you do this:
> >
> > for k in btree.keys():
> >    btree[k] = 1
> >
> > ... what comes back from "keys()" is not a list or tuple, its a
> > BTreeItems object, which (from what I understand) itself is a data

[snip]

> > It is possible that a KeyError would be raised in this scenario (maybe
> > not this exact scenario, but one a lot like it).
> 
> That one's a stretch <wink>.  Mutating while iterating may give surprising
> results, but it shouldn't be possible to *damage* a BTree this way, and a

Can you elaborate a bit on what "surprising results" might mean? I don't
think we do that in IC but it never hurts to know.

Take care,
--
Christian Reis, Senior Engineer, Async Open Source, Brazil.
http://async.com.br/~kiko/ | [+55 16] 261 2331 | NMFL