Message79694
The whole point was to have a function (or class) that accumulates a
sequence and counts it. collections.defaultdict(lambda: 0) doesn't
achieve this on its own because it only knows how to handle sequences of
(key, value):
>>> d = collections.defaultdict(lambda: 0)
>>> d.update('aaabbac')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: dictionary update sequence element #0 has length 1; 2 is
required
The feature request here was mainly a request to provide an abbreviation
of a very common 4-line function. |
|
Date |
User |
Action |
Args |
2009-01-12 18:55:11 | bethard | set | recipients:
+ bethard, gvanrossum, georg.brandl, rhettinger, amaury.forgeotdarc, pitrou |
2009-01-12 18:55:10 | bethard | set | messageid: <1231786510.88.0.83764793202.issue1696199@psf.upfronthosting.co.za> |
2009-01-12 18:55:10 | bethard | link | issue1696199 messages |
2009-01-12 18:55:09 | bethard | create | |
|