implement util.defaultdict() + general usage

Issue #582 resolved
Mike Bayer repo owner created an issue

py2.5 has collections.defaultdict() which uses a callable to set a missing value. its natively implemented so should be far faster than in-python methods of doing the same thing.

implement util.defaultdict() which will try to call 2.5's version of it, then fall back to a regular dict with a "if key not in self: create" type of paradigm, then implement wherever the usual pattern is used. key place: base.py/ResultProxy._convert_key, in fact remove the _convert_key call altogether and place its "create value" code within the defaultdict.

Comments (3)

  1. Log in to comment