[ZODB-Dev] Re: setdefault branch

Tim Peters tim at zope.com
Tue Aug 30 14:33:13 EDT 2005


[Ruslan Spivak]
> Really, that usage of calling setdefault without explicit default is
> confusing and useless IMHO too. I just wanted to think about possible
> solution if someone ever could think about usefulness of setdefault
> without default, but definitely in that case
> {float,int,object}valuemacros.h is much better and easier, thanks for
> pointing that.

Note that I've since brought this up on python-dev, and consensus there so
far is that Python's dict.setdefault() should change to require both
arguments too.  Alas, I did find one use of 1-argument dict.setdefault() in
real code, in the docutils package.  It was a bad use, though, using a
1-argument dict.setdefault() call followed by a "del" statement to achieve
what dict.pop() does directly.

...

>> I'm happy with the branch now.

> Me too :) kudos to Tim!

Thank _you_!  I'm still not entirely sure why, but adding a new feature on a
branch works really well under SVN -- the mechanics of this have been dead
easy.



More information about the ZODB-Dev mailing list