who to call a list of method inside the class itself

Fredrik Lundh fredrik at pythonware.com
Tue Aug 19 17:12:29 CEST 2008

Edwin.Madari at VerizonWireless.com wrote:

> 1. return string names of required methods in getAllMethod
> 	return ['method1', 'method2', 'method3']
> 2. use gettattr on self and then exetute methods in applyAll
> 	def applyAll(self):
> 	    for method_name in self.getAllMethod():
> 	        method = gettattr(self,method_name)
> 		  method() #execute method now



More information about the Python-list mailing list