[Python-ideas] defaultdict factory argument

Zac Burns zac256 at gmail.com
Sun Jan 18 06:22:05 CET 2009


Ah, excellent.
--
Zachary Burns
(407)590-4814
Aim - Zac256FL
Production Engineer (Digital Overlord)
Zindagi Games



On Sat, Jan 17, 2009 at 6:32 PM, Steven Bethard
<steven.bethard at gmail.com> wrote:
> On Sat, Jan 17, 2009 at 5:35 PM, Zac Burns <zac256 at gmail.com> wrote:
>> I think defaultdict would be more useful if one could initialize it
>> with the option to have the key that is being looked up passed to
>> default_factory.
>
> Are you sure you can't get what you want by using __missing__?
>
> http://www.python.org/doc/2.5.2/lib/defaultdict-objects.html
>
> Steve
> --
> I'm not *in*-sane. Indeed, I am so far *out* of sane that you appear a
> tiny blip on the distant coast of sanity.
>        --- Bucky Katt, Get Fuzzy
>



More information about the Python-ideas mailing list