Тушин Арсений 425 DefCounter 11952
Каретин Николай Ильич, 522 DefCounter 13014
f1from collections import Counterf1from collections import Counter
22
3class DefCounter(Counter):3class DefCounter(Counter):
44
n5    def __init__(self, iterable=None, **kwds):n5    def __init__(self, iterable=None, **kwargs):
6        self.missing = kwds.pop('missing', -1)6        self.missing_value = kwargs.pop('missing', -1)
7        super().__init__(iterable, **kwds)7        super().__init__(iterable, **kwargs)
88
9    def __missing__(self, key):9    def __missing__(self, key):
t10        return self.missingt10        return self.missing_value
1111
12    def __abs__(self):12    def __abs__(self):
13        return sum((value for value in self.values() if value > 0))13        return sum((value for value in self.values() if value > 0))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op