[Python-talk] Changing defaultdict
Ray Cote
rgacote at AppropriateSolutions.com
Mon Sep 1 10:14:16 EDT 2008
At 5:03 PM -0400 8/30/08, Ric Werme wrote:
>One of the items we talked about on Thursday was collections.defaultdict.
>...
>
>So, dict calls __missing__ on a failed reference and that it's trivial to
>create a variant that passes the key to the factory.
Hi Ric:
Thanks for the follow-up.
Creating a custom variant where the key could be used to determine
the return indeed looks pretty straight forward. Definitely keeping
this in mind for some future projects (and thanks Kent for
introducing collections.defaultdict).
--Ray
--
Raymond Cote
Appropriate Solutions, Inc.
PO Box 458 ~ Peterborough, NH 03458-0458
Phone: 603.924.6079 ~ Fax: 603.924.8668
rgacote(at)AppropriateSolutions.com
www.AppropriateSolutions.com
More information about the Python-talk
mailing list