who to call a list of method inside the class itself

Fredrik Lundh fredrik at pythonware.com
Tue Aug 19 11:12:29 EDT 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

why?

</F>




More information about the Python-list mailing list