[ZODB-Dev] Re: setdefault branch

Ruslan Spivak rspivak at nuxeo.com
Tue Aug 30 03:30:35 EDT 2005


"Tim Peters" <tim at zope.com> writes:

[snip]
>>> Proposal:  make BTree/Bucket setdefault() a two-argument function (3 if
>>> you count ``self`` too).  In practice, an explicit default is always
>>> passed, and not even in theory could we come up with a sane
>>> default-default that works across all tree types.
>
>> I think we can handle that without additional argument:
>
> Why even try?  Nobody presented a use case for leaving out the default, and,
> indeed, Python's default of None seems essentially useless even in Python.
>
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.

[snip]

> I'm happy with the branch now.
Me too :) kudos to Tim!

[snip]


Regards,
Ruslan



More information about the ZODB-Dev mailing list