[docs] [issue32770] collections.counter examples are misleading

Anthony Flury report at bugs.python.org
Mon Feb 5 08:11:56 EST 2018


Anthony Flury <anthony.flury at btinternet.com> added the comment:

Raymond, 
I completely understand your comment but I do disagree.

My view would be that the documentation of the stdlib should document the entry level use cases.
The first example given uses nothing special from the Counter class - you could implement exactly the same with a defaultdict(int) - the only difference would be that output will read defaultdict(<type 'int'>,{'blue': 3, 'red': 2, 'green': 1}).

I think the examples in the documentation should at least demonstrate something important on the class being documented - and the first example doesn't.

I am very tempted to re-open - but I wont - no benefit in bouncing the status as we discuss this.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32770>
_______________________________________


More information about the docs mailing list