diff -r a415b03809f3 Lib/collections/__init__.py --- a/Lib/collections/__init__.py Wed Oct 29 10:57:42 2014 +0100 +++ b/Lib/collections/__init__.py Wed Oct 29 08:53:01 2014 -0400 @@ -735,6 +735,8 @@ Counter({'b': 4, 'c': 2, 'a': 1}) ''' + if not isinstance(other, Counter): + return NotImplemented for elem, count in other.items(): self[elem] += count return self._keep_positive() @@ -748,6 +750,8 @@ Counter({'b': 2, 'a': 1}) ''' + if not isinstance(other, Counter): + return NotImplemented for elem, count in other.items(): self[elem] -= count return self._keep_positive() @@ -761,6 +765,8 @@ Counter({'b': 3, 'c': 2, 'a': 1}) ''' + if not isinstance(other, Counter): + return NotImplemented for elem, other_count in other.items(): count = self[elem] if other_count > count: @@ -776,6 +782,8 @@ Counter({'b': 1}) ''' + if not isinstance(other, Counter): + return NotImplemented for elem, count in self.items(): other_count = other[elem] if other_count < count: