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

Matthew Barnett report at bugs.python.org
Tue Apr 5 21:13:44 CEST 2011


Matthew Barnett <python at mrabarnett.plus.com> added the comment:

It depends on what kind of object it's like. If it's like a dict then your example is clearly not empty, but if it's like a set then it /is/ empty, in which case it's empty if:

    all(count == 0 for count in my_counter.values())

----------
nosy: +mrabarnett

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


More information about the Python-bugs-list mailing list