On Aug 28, 1:13 pm, rodrigo <[EMAIL PROTECTED]> wrote: > evan, > > yes, it does help. Works like it should: > > class CountingDictionary(dict): > def increment(self, key, delta=1): > self[key] = self.get(key, 0) + delta > > d = CountingDictionary() > d.increment('cat') > d.increment('dog',72) > print d > > >>> {'dog': 72, 'cat': 1} > > Thanks!
You responded to the answer that made the least use of already existing recourses in python. Just letting you know. -- http://mail.python.org/mailman/listinfo/python-list