8000 bpo-40755: Add missing multiset operations to Counter() by rhettinger · Pull Request #20339 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-40755: Add missing multiset operations to Counter() #20339

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
May 28, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Fa 8000 iled to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove the NotImplemented return values
  • Loading branch information
rhettinger committed May 24, 2020
commit 987532ff02846ffb7c162b4d75d6079366823ac3
6 changes: 0 additions & 6 deletions Lib/collections/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -894,20 +894,14 @@ def isequal(self, other):
Unlike the __eq__() method, this test ignores counts that
are zero or negative.
'''
if not isinstance(other, Counter):
return NotImplemented
return +self == +other

def issubset(self, other):
'True if positive counts in self <= counts in other.'
if not isinstance(other, Counter):
return NotImplemented
return not self - other

def issuperset(self, other):
'True if positive counts in self >= counts in other.'
if not isinstance(other, Counter):
return NotImplemented
return not other - self

def isdisjoint(self, other):
Expand Down
0