Message407348
In brief:
```
from collections import Counter
x = Counter({'a': 0, 'b': 1})
x.update(x) # works: Counter({'a': 0, 'b': 2})
x += x # expected: Counter({'a': 0, 'b': 3}) actual: Counter({'b': 3})
```
I expect `+=` and `.update()` to be synonymous. However, the += operator is deleting keys if the source Counter has a zero count to begin with:
```
x = Counter({'a': 1})
x += Counter({'a': 0}) # ok: Counter({'a': 1})
y = Counter({'a': 0})
y += y # expected: Counter({'a': 0}) actual: Counter()
``` |
|
Date |
User |
Action |
Args |
2021-11-30 02:43:03 | crypdick | set | recipients:
+ crypdick |
2021-11-30 02:43:03 | crypdick | set | messageid: <1638240183.83.0.336191695201.issue45936@roundup.psfhosted.org> |
2021-11-30 02:43:03 | crypdick | link | issue45936 messages |
2021-11-30 02:43:03 | crypdick | create | |
|