clean up from some experiments
@@ -492,7 +492,6 @@ class Counter(object):
self._d = d
self.total = sum(self.values())
- self._len = None
def __le__(self, other):
return (self._d.keys() <= other._d.keys() and
@@ -502,9 +501,6 @@ class Counter(object):
return self._d == other._d
def __len__(self):
- if self._len:
- return self._len
- else:
return len(self._d)
def values(self):
@@ -521,7 +517,9 @@ class Counter(object):
# of 'larger' than in the dict directly
larger_keys = viewkeys(larger)
- common = {k: v * larger[k] for k, v in viewitems(smaller) if k in larger_keys}
+ common = {k: v * larger[k]
+ for k, v in viewitems(smaller)
+ if k in larger_keys}
return Counter(common)
