def difference(self, E):
        """
        Return the difference of the sets of self with the sets of E.
        
        (i.e. all elements that are in the sets of this DictSet but
         not the others.)

        DS-E  <==> DS.difference(E)
        """   
        if not isinstance(E, DictSet):
            E = DictSet(copy(E))

        foo = deepcopy(self)
        for k in set(foo.keys()) | set(E.keys()):
            foo.setdefault(k, [])
            foo[k].difference_update(E.get(k, []))
            if not foo[k]:
                del foo[k] # delete if empty set

        return foo

        Return the difference of the sets of self with the sets of E.
        
        (i.e. all elements that are in the sets of this DictSet but
         not the others.)

        DS-E  <==> DS.difference(E)
        
recipes/Python/577702_DictSet__specialized_Pythcontainer_datatype/recipe-577702.py