On Feb 23, 2006, at 4:41 PM, Thomas Wouters wrote:
On Wed, Feb 22, 2006 at 10:29:08PM -0500, Barry Warsaw wrote:
d.getdefault('foo', list).append('bar')
Anyway, I don't think it's an either/or choice with Guido's subclass.
Instead I think they are different use cases. I would add
On Wed, Feb 22, 2006 at 10:29:08PM -0500, Barry Warsaw wrote:
d.getdefault('foo', list).append('bar')
Anyway, I don't think it's an either/or choice with Guido's subclass.
Instead I think they are different use cases. I would add getdefault()
to the standard dict API, remove (eventually)
Guido's on_missing() proposal is pretty good for what it is, but it is
not a replacement for set_default(). The use cases for a derivable,
definition or instantiation time framework is different than the
call-site based decision being made with setdefault(). The difference
is that in the former