def set_hp(self, hp): if type(hp) in [ types.IntType, types.FloatType]: self._DistributedInteractiveProp__hp = hp else: self._DistributedInteractiveProp__hp = 1