def __check_mot(self, mot): # Old way doesn't handle subclasses: """ if (type(mot) is motor.Motor): m = mot elif (type(mot) is virtualmotor.VirtualMotor): m = mot elif (type(mot) is motor_PV.motorPV): m = mot """ # New way, which handles subclasses: if isinstance(mot, motor.Motor) \ or isinstance(mot, virtualmotor.VirtualMotor) \ or isinstance(mot, motor_PV.motorPV): m = mot else: m = motor_PV.motorPV(mot, mot) return m
def __check_mot(self,mot): if (type(mot) is motor.Motor): m = mot elif (type(mot) is virtualmotor.VirtualMotor): m = mot elif (type(mot) is motor_PV.motorPV): m = mot else: m=motor_PV.motorPV(mot,mot) return m