[ZODB-Dev] BTrees and setdefault

Michel Pelletier michel at dialnetwork.com
Sat Aug 27 14:45:42 EDT 2005


> >
> > http://mail.zope.org/pipermail/zodb-dev/2004-September/008034.html
> > http://mail.zope.org/pipermail/zodb-dev/2004-October/008040.html
> 
> Dmitry, it's nearly a year since you first suggested this.  Have you missed
> these methods in practice (i.e., do you have use cases), or it still just a
> matter of making BTrees formally "more like" newer Python dictionaries?

I've had a use for it, porting existing dictionary code to a BTree.  It
was reasonably easy to simulate but did make the code slightly less
readable to the person who originally wrote the code with setdefault.
They were suprised I took such a "naive" approach until I told them
BTrees had no setdefault.

-Michel




More information about the ZODB-Dev mailing list