(self, element)
Add an element to a set.

        This has no effect if the element is already present.
Add an element to a set.
Add an element to a set .
def add(self, element):
        """Add an element to a set.

        This has no effect if the element is already present.
        """
        try:
            self._data[element] = True
        except TypeError:
            transform = getattr(element, "__as_immutable__", None)
            if transform is None:
                raise # re-raise the TypeError exception we caught
            self._data[transform()] = True
def add ( self , element ) : try : self . _data [ element ] = True except TypeError : transform = getattr ( element , "__as_immutable__" , None ) if transform is None : raise # re-raise the TypeError exception we caught self . _data [ transform ( ) ] = True