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 ethan.furman
Recipients ethan.furman, rhettinger
Date 2014-11-05.17:44:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1415209471.77.0.966779934151.issue22801@psf.upfronthosting.co.za>
In-reply-to
Content
test script:
---------------------------------------
from collections import Counter
empty_counter = Counter()
counter = Counter('abbc')
empty_counter &= 5
counter &= 5
---------------------------------------

results:
---------------------------------------
Traceback (most recent call last):
  File "blah.py", line 5, in <module>
    counter &= 5
  File "/home/ethan/source/python/issue22778/Lib/collections/__init__.py", line 780, in __iand__
    other_count = other[elem]
TypeError: 'int' object is not subscriptable
----------------------------------------

As can be seen, the error does not show up when the Counter is empty, which could lead to hard to diagnose bugs.
History
Date User Action Args
2014-11-05 17:44:31ethan.furmansetrecipients: + ethan.furman, rhettinger
2014-11-05 17:44:31ethan.furmansetmessageid: <1415209471.77.0.966779934151.issue22801@psf.upfronthosting.co.za>
2014-11-05 17:44:31ethan.furmanlinkissue22801 messages
2014-11-05 17:44:31ethan.furmancreate