You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee='https://github.com/rhettinger'closed_at=<Date2021-11-30.03:46:38.855>created_at=<Date2021-11-30.02:43:03.801>labels= ['invalid', 'type-bug', '3.8']
title='collections.Counter drops key if value is 0 and updating using += operator'updated_at=<Date2021-11-30.03:47:26.253>user='https://bugs.python.org/crypdick'
>>> help(Counter.update)
Help on function update in module collections:
update(self, iterable=None, /, **kwds)
Likedict.update() butaddcountsinsteadofreplacingthem.
Sourcecanbeaniterable, adictionary, oranotherCounterinstance.
>>>c=Counter('which')
>>>c.update('witch') # add elements from another iterable>>>d=Counter('watch')
>>>c.update(d) # add elements from another counter>>>c['h'] # four 'h' in which, witch, and watch4
I don't think there is a need to list the inplace methods. They were put in to optimize what was already occurring when only the __add__ method was defined. Also, other container typically don't specifically call out the inplace methods.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: