Alec Nikolas Reiter added the comment:

@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.

----------

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

Reply via email to