Каретин Николай Ильич, 522 DefCounter 13014
Михаил Успенский 616 ВМК МГУ DefCounter 12635
f1from collections import Counterf1from collections import Counter
22
3class DefCounter(Counter):3class DefCounter(Counter):
44
5    def __init__(self, iterable=None, **kwargs):5    def __init__(self, iterable=None, **kwargs):
n6        self.missing_value = kwargs.pop('missing', -1)n6        self.missing = kwargs.pop('missing', -1)
7        super().__init__(iterable, **kwargs)7        super().__init__(iterable, **kwargs)
88
9    def __missing__(self, key):9    def __missing__(self, key):
t10        return self.missing_valuet10        return self.missing
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