Message230699
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. |
|
Date |
User |
Action |
Args |
2014-11-05 17:44:31 | ethan.furman | set | recipients:
+ ethan.furman, rhettinger |
2014-11-05 17:44:31 | ethan.furman | set | messageid: <1415209471.77.0.966779934151.issue22801@psf.upfronthosting.co.za> |
2014-11-05 17:44:31 | ethan.furman | link | issue22801 messages |
2014-11-05 17:44:31 | ethan.furman | create | |
|