[Python-Dev] defaultdict proposal round three (original) (raw)

"Martin v. Löwis" martin at v.loewis.de
Tue Feb 21 22:25:49 CET 2006


Raymond Hettinger wrote:

Yes, I now agree. This means that I'm withdrawing proposal A (new method) and championing only B (a subclass that implements getitem() calling onmissing() and onmissing() defined in that subclass as before, calling defaultfactory unless it's None). I don't think this crisis is big enough to need two solutions, and this example shows B's superiority over A.

FWIW, I'm happy with the proposal and think it is a nice addition to Py2.5.

I agree. I would have preferred if dict itself was modified, but after ruling out changes to dict.getitem, d[k]+=1 is too important to not support it.

Regards, Martin



More information about the Python-Dev mailing list