Message139625
| Author |
amaury.forgeotdarc |
| Recipients |
amaury.forgeotdarc, lyricconch |
| Date |
2011年07月02日.08:31:11 |
| SpamBayes Score |
0.011504081 |
| Marked as misclassified |
No |
| Message-id |
<1309595472.0.0.288482265636.issue12473@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
-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 |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2011年07月02日 08:31:12 | amaury.forgeotdarc | set | recipients:
+ amaury.forgeotdarc, lyricconch |
| 2011年07月02日 08:31:11 | amaury.forgeotdarc | set | messageid: <1309595472.0.0.288482265636.issue12473@psf.upfronthosting.co.za> |
| 2011年07月02日 08:31:11 | amaury.forgeotdarc | link | issue12473 messages |
| 2011年07月02日 08:31:11 | amaury.forgeotdarc | create |
|