New submission from Ram Rachum <cool...@cool-rr.com>: bool(Counter({'a': 0'})) is True.
Is this wise? I want to be able to do: if my_counter: whatever To check whether my counter has any elements. Currently this seems to be impossible because of this bug. Will we have to keep this weird behavior because of backwards compatibility? If so, perhaps `.elements` could be turned into a smart object so we could at least do `if my_counter.elements():` and get the expected result. If you want a patch let me know and I'll write one. ---------- components: Library (Lib) messages: 133076 nosy: cool-RR priority: normal severity: normal status: open title: `bool(Counter({'a': 0'})) is True` versions: Python 3.3, Python 3.4 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue11775> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com