def _set_prop(self, prop_name, value):
        # Checks
        if not isinstance(prop_name, str):
            raise TypeError("_set_prop's first arg must be str, not %s" %
                             prop_name.__class__)
        if prop_name not in self.__properties__:
            cname = self.__class__.__name__
            raise AttributeError('%s object has no property %r' % (cname, prop_name))
        if self._he_props_being_set.get(prop_name, False):
            return
        # Prepare
        private_name = '_' + prop_name + '_value'
        func_name = '_' + prop_name + '_func'
        # Validate value
        self._he_props_being_set[prop_name] = True
        try:
            func = getattr(self, func_name)
            if this_is_js():
                value2 = func.apply(self, [value])
            else:
                value2 = func(self, value)
        finally:
            self._he_props_being_set[prop_name] = False
        # Update value and emit event
        old = getattr(self, private_name, None)
        if value2 != old:
            setattr(self, private_name, value2)
            self.emit(prop_name, dict(new_value=value2, old_value=old))
Set the value of a (readonly) property.
dataset/ETHPy150Open zoofIO/flexx/flexx/event/_hasevents.py/HasEvents._set_prop