Message235193
@SilentGhost I was playing with a voting algorithm (Instant Runoff, rather than traditional majority). Ultimately, I ended up using Counter in place of a defaultdict, but that's how I ended up noticing it.
Not so much ensuring the content so much as setting an initial default state to mutate.
@rhettinger I had considered a comprehension and passing it into a defaultdict (or Counter) to get that nice missing key handling.
Implicitly assigning the factory is a pretty good compromise, like I said fromkeys accepting the factory would be a nice convenience rather than correcting a major oversight. |
|
Date |
User |
Action |
Args |
2015-02-01 18:38:31 | justanr | set | recipients:
+ justanr, rhettinger, SilentGhost |
2015-02-01 18:38:31 | justanr | set | messageid: <1422815911.9.0.457206103108.issue23372@psf.upfronthosting.co.za> |
2015-02-01 18:38:31 | justanr | link | issue23372 messages |
2015-02-01 18:38:31 | justanr | create | |
|