[Python-Dev] defaultdict proposal round three (original) (raw)
Raymond Hettinger python at rcn.com
Tue Feb 21 02:05:33 CET 2006
- Previous message: [Python-Dev] defaultdict proposal round three
- Next message: [Python-Dev] defaultdict proposal round three
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
[Alex]
I see d[k]+=1 as a substantial improvement -- conceptually more direct, "I've now seen one more k than I had seen before".
[Guido]
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.
Raymond
- Previous message: [Python-Dev] defaultdict proposal round three
- Next message: [Python-Dev] defaultdict proposal round three
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]