This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eric.smith
Recipients eric.smith, holdenweb, lukasz.langa, michael.foord
Date 2010-11-25.17:48:06
SpamBayes Score 0.029905701
Marked as misclassified No
Message-id <1290707290.51.0.623270227124.issue10533@psf.upfronthosting.co.za>
In-reply-to
Content
How about:

from collections import defaultdict

class defaultdict_value(defaultdict):
    def __init__(self, value):
        defaultdict.__init__(self, lambda : value)

x = defaultdict_value(3)
print(x[1])
History
Date User Action Args
2010-11-25 17:48:10eric.smithsetrecipients: + eric.smith, holdenweb, michael.foord, lukasz.langa
2010-11-25 17:48:10eric.smithsetmessageid: <1290707290.51.0.623270227124.issue10533@psf.upfronthosting.co.za>
2010-11-25 17:48:06eric.smithlinkissue10533 messages
2010-11-25 17:48:06eric.smithcreate