New submission from HaiYun Yan <lyricco...@gmail.com>:

for example:

def calc(params):
    """ i am factoring numbers. """
    # an expensive CPU cost function but 
    # passin params and return result are both lightweight

cachedcalc = collections.defaultdict(calc)
result = cachedcalc[0xFFFFFFFFFFFFFFFFFFF0AC0FFF1]

----------
components: Library (Lib)
messages: 139624
nosy: lyricconch
priority: normal
severity: normal
status: open
title: factory func of collections.defaultdict should receive the "missing key" 
as args when called.
type: behavior
versions: Python 2.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue12473>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to