[ZODB-Dev] BTrees package problems

Jim Fulton jim at zope.com
Tue Jul 23 19:18:53 CEST 2013


On Mon, Jul 22, 2013 at 9:06 PM, Christian Tismer <tismer at stackless.com> wrote:
...
>>> Actually, I would like to add a callable-check instead, to allow for more
>>> flexible derivatives.
>>
>> I don't understand this.
>
>
> Simple: I am writing BTree forests for versioned, read-only databases.
>
> For that, I need a way to create a version of Bucket that allows to
> override the _next field by maybe a callable.
> Otherwise all the buckets are chained together and I have no way
> to let frozen BTrees share buckets.

In retrospect, it might make more sense to do the chaining a level up.
Buckets themselves don't care about chaining. The tree wants buckets
to be chained to support iteration.  I'm not really sure if that helps your
use case.

> When I played with the structure, I was happy/astonished to see the _next
> field
> being writable and thought it was intended to be so.
> It was not, in the end ;-)

It's clearly a bug.  The code has a comment right above the attribute definition
stating that it's (supposed to be) read only, but the implementation makes
them writable.

There doesn't seem to be anything that depends on writing this attribute.
I verified this by adding a fix and running the tests (in 3.10).

For what you're trying to do, I suspect you want to fork BTrees, or start
over.

Jim

-- 
Jim Fulton
http://www.linkedin.com/in/jimfulton


More information about the ZODB-Dev mailing list