def update ( self, value ):
        if not hasattr(self, 'trait'):
            return set.update(self, value)
        try:
            added = value.difference( self )
            if len( added ) > 0:
                object   = self.object()
                validate = self.trait.item_trait.handler.validate
                if validate is not None:
                    name  = self.name
                    added = set( [ validate( object, name, item )
                                   for item in added ] )

                set.update( self, added )

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