Amaury Forgeot d'Arc <amaur...@gmail.com> added the comment:

-1. Besides compatibility issues, defaultdict is a dict: it contains data, and 
is not meant to consume CPU when accessing items. Its "default" function should 
return initial values, like 0 or an empty list.

I think what you want is "memoization"; a memoized function still looks like a 
function! there are many implementations for python, one of these is here: 
http://wiki.python.org/moin/PythonDecoratorLibrary#Memoize

----------
nosy: +amaury.forgeotdarc
resolution:  -> invalid
status: open -> closed

_______________________________________
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