[issue11733] Implement a `Counter.elements_count` method

STINNER Victor report at bugs.python.org
Thu Mar 31 23:51:54 CEST 2011


STINNER Victor <victor.stinner at haypocalc.com> added the comment:

It would be interesting to have Counter.elements_count() if it has a complexity of O(1): if the collections maintains a total (in a private attribute).

Otherwise, I think that sum(c.values()) is enough and can be documented as an example in the Counter doc.

----------
nosy: +haypo

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


More information about the Python-bugs-list mailing list