This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author cool-RR
Recipients cool-RR
Date 2011-04-05.18:57:09
SpamBayes Score 4.42982e-07
Marked as misclassified No
Message-id <1302029831.74.0.558006617631.issue11775@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2011-04-05 18:57:11cool-RRsetrecipients: + cool-RR
2011-04-05 18:57:11cool-RRsetmessageid: <1302029831.74.0.558006617631.issue11775@psf.upfronthosting.co.za>
2011-04-05 18:57:10cool-RRlinkissue11775 messages
2011-04-05 18:57:09cool-RRcreate