[issue11775] `bool(Counter({'a': 0})) is True`

Raymond Hettinger report at bugs.python.org
Tue Apr 5 22:44:18 CEST 2011


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

We could do that, but that's not the Python way :-)

Really, you should be posting recipes somewhere else to see if there is interest and uptake.  The tracker is not the right place to toss one random idea after another.

We need to place some value on API simplicity.  At its core, a Counter is just a dict with an __missing__ method to supply implied zeros.  Much of its ease of use, speed, and flexibility all derive from that basic design.  For the most part, the best thing that could happen to this API is to become stable and remain completely untouched.  I only added subtract() in Py3.2 because there was substantial demand for it; otherwise, all the other ideas for expansion were rejected.

----------

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


More information about the Python-bugs-list mailing list