hi, i have some code where i set a bool type variable and if the value is false i would like to return from the method with an error msg.. being a beginner I wd like some help here
class myclass: ......... def mymethod(self): success=True msg="all validation OK" success=validateSthing() if(success==False): msg="sthing failed" return (success,msg) dosomeprocessing() ..... success=validateSthingelse() if(success==False): msg="sthingelse failed" return (success,msg) domoreprocessing() .... return(success,msg) i would like to know if this way of doing this is OK..I have need of many kinds of validations in this ..is there a better way of doing this ? thank you -- http://mail.python.org/mailman/listinfo/python-list