def symmetric_difference(self, E):
        """
        Return the symmetric difference of the sets of self with the
        sets of E.
        
        (i.e. for each DictSet all elements that are in exactly one
         of the sets .)

        DS^E  <==> DS.symmetric_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].symmetric_difference_update(E.get(k, []))
            if not foo[k]:
                del foo[k] # delete if empty set

        return foo

        Return the symmetric difference of the sets of self with the
        sets of E.
        
        (i.e. for each DictSet all elements that are in exactly one
         of the sets .)

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