def add(self, elem):
        """ Adds _elem_ to the collection.

        # Parameters

        _elem_ : `object`

        > The object to be added
        """
        if isinstance(elem, self._allowedTypes):
            self._collection.add(elem)
            self._collectedTypes.add(type(elem).__name__)
        else:
            raise CollectionTypeError("{} can only contain '{}', '{}' is not allowed.".format(type(self).__name__, self._allowedTypes, elem))
def add ( self , elem ) : if isinstance ( elem , self . _allowedTypes ) : self . _collection . add ( elem ) self . _collectedTypes . add ( type ( elem ) . __name__ ) else : raise CollectionTypeError ( "{} can only contain '{}', '{}' is not allowed." . format ( type ( self ) . __name__ , self . _allowedTypes , elem ) )
Adds _elem_ to the collection.

        # Parameters

        _elem_ : `object`

        > The object to be added