def isolate_element ( self , x ) : members = list ( self . members ( x ) ) self . delete_set ( x ) self . union ( * ( v for v in members if v != x ) )
python remove element set
Isolates x from its equivalence class .
def isolate_element(self, x):
        """Isolates `x` from its equivalence class."""
        members = list(self.members(x))
        self.delete_set(x)
        self.union(*(v for v in members if v != x))