[issue9212] dict_keys purports to implement the Set ABC, but is missing the isdisjoint method

Daniel Urban report at bugs.python.org
Fri Jul 23 18:47:36 CEST 2010


Daniel Urban <urban.dani+py at gmail.com> added the comment:

The attached patch adds the isdisjoint method to dict_keys and dict_items.
Pseudocode for the method:

def isdisjoint(self, other):
    if self is other:
        if len(self) == 0:
            return True
        else:
            return False
    else:
        for item in other:
            if item in self:
                return False
        return True

----------
keywords: +patch
nosy: +durban
Added file: http://bugs.python.org/file18158/issue9212.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9212>
_______________________________________


More information about the Python-bugs-list mailing list