[issue1696199] Add collections.counts()

Raymond Hettinger report at bugs.python.org
Tue Jan 13 00:05:14 CET 2009


Raymond Hettinger <rhettinger at users.sourceforge.net> added the comment:

Thanks for the review comments.  Incorporated all suggested changes and
did some other minor tidying-up.  Extended the update example to include
c.update(Counter('abcdee')).  Committed as r68559 .

Decided to leave __repr__() with a sort.  Though it's not strictly
necessary, it's a nice convenience saving a user from doing the same
thing mentally.  Also, it helps with doctests by giving a reliable
ordering when element counts are non-equal.  For datasets small enough
that someone would want to display their repr, the time spent sorting is
negligible.

----------
assignee: georg.brandl -> rhettinger
resolution:  -> accepted
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue1696199>
_______________________________________


More information about the Python-bugs-list mailing list