def add ( self, value ):
        if not hasattr(self, 'trait'):
            return set.add(self, value)
        if value not in self:
            try:
                object   = self.object()
                validate = self.trait.item_trait.handler.validate
                if validate is not None:
                    value = validate( object, self.name, value )

                set.add( self, value )

                if self.name_items is not None:
                    self._send_trait_items_event( self.name_items,
                        TraitSetEvent( None, set( [ value ] ) ) )
            except TraitError, excp:
                excp.set_prefix( 'Each element of the' )
                raise excp
dataset/ETHPy150Open enthought/traits/traits/trait_handlers.py/TraitSetObject.add/original