durusmail: durus-users: Eliminate __dict__ from persistent btree, bnode, dict, list and set
Eliminate __dict__ from persistent btree, bnode, dict, list and set
Eliminate __dict__ from persistent btree, bnode, dict, list and set
2006-07-05
2006-07-05
2006-07-05
2006-07-06
2006-07-06
2006-07-06
XMPP/Jabber chatting (was: Re: [Durus-users] Eliminate __dict__ from persistent btree, bnode, dict, list and set)
2006-10-31
Re: XMPP/Jabber chatting
2006-10-31
Eliminate __dict__ from persistent btree, bnode, dict, list and set
David Binger
2006-07-05
On Jul 5, 2006, at 3:10 PM, Patrick K. O'Brien wrote:

> Any reason not to incorporate this idea into Durus itself?  The only
> change required on the Persistent class was to define __slots__ on it.
> But this shouldn't have any impact on custom subclasses.  So I think
> these changes could be made to Durus in a completely backward
> compatible
> fashion.  Thoughts?  Reactions

I like the spirit of this idea, but you might be overly optimistic
about the backward compatibility of this change.  Just the other day,
someone asked
me if it was safe to assign attributes to a PersistentDict:  it is,
as long
as you avoid "data" and the other inherited names.  Your change would
change the answer from "yes, with care" to "no".  I bet that does break
some existing code.  Also, existing subclasses of the container classes
might possibly override the methods you override or others under the
assumption
that the base classes *do* use a dict.  The code that would break
might not
follow my favorite patterns or yours, but it would still be broken.

It would be nice, also, while reducing the RAM requirements for these
things,
to also reduce the disk requirement by leaving the dict with 'data'
out of the
state.  I know that you did that so that old pickles would still work
the same
way, and that is reasonable.  Is there a way to achieve that
objective at the
same time?  I'm thinking about it more.






reply