[issue20068] collections.Counter documentation leaves out interesting usecase

2014-06-19 Thread Raymond Hettinger
Raymond Hettinger added the comment: The introductory example already shows both ways of using a Counter: 1) How to tally one at a time: cnt = Counter() for word in ['red', 'blue', 'red', 'green', 'blue', 'blue']: cnt[word] += 1 2) How to count directly from a list: words = r

[issue20068] collections.Counter documentation leaves out interesting usecase

2014-06-19 Thread Mark Lawrence
Mark Lawrence added the comment: I'm -0 on this as it seems to be six of one, half a dozen of the other, but I don't get the final say :) -- nosy: +BreamoreBoy ___ Python tracker _

[issue20068] collections.Counter documentation leaves out interesting usecase

2013-12-25 Thread Julian Gindi
New submission from Julian Gindi: I think the documentation for collections.Counter can be updated slightly to include an example showing the initialization of a counter object from a list. For example, it explains how to manually iterate through a list and increment the values... for word in