Re: who to call a list of method inside the class itself

2008-08-20 Thread John Machin
On Aug 20, 11:19 pm, Ricardo Aráoz <[EMAIL PROTECTED]> wrote: > Terry Reedy wrote: > > > [EMAIL PROTECTED] wrote: > >> Is the following code is ok. who to call all method. > >> It is working but the call to m() without a reference to self seems > >> strange > > > The reference to self is bound to

Re: who to call a list of method inside the class itself

2008-08-20 Thread Ricardo Aráoz
Terry Reedy wrote: [EMAIL PROTECTED] wrote: Is the following code is ok. who to call all method. It is working but the call to m() without a reference to self seems strange The reference to self is bound to the methods by the way you look them up. class CustomMethod: def method1(self)

Re: who to call a list of method inside the class itself

2008-08-20 Thread maduma
On Aug 20, 8:14 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Tue, 19 Aug 2008 11:18:00 -0300, <[EMAIL PROTECTED]> escribi : > > > Is the following code is ok. who to call all method. > > It is working but the call to m() without a reference to self seems > > strange > > Ok, so you alread

Re: who to call a list of method inside the class itself

2008-08-19 Thread Gabriel Genellina
En Tue, 19 Aug 2008 11:18:00 -0300, <[EMAIL PROTECTED]> escribi�: Is the following code is ok. who to call all method. It is working but the call to m() without a reference to self seems strange Ok, so you already know it works - and you want to know why! class CustomMethod: def method1(

Re: who to call a list of method inside the class itself

2008-08-19 Thread Terry Reedy
[EMAIL PROTECTED] wrote: Is the following code is ok. who to call all method. It is working but the call to m() without a reference to self seems strange The reference to self is bound to the methods by the way you look them up. class CustomMethod: def method1(self): d

Re: who to call a list of method inside the class itself

2008-08-19 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : [EMAIL PROTECTED] wrote: Hi, Is the following code is ok. who to call all method. It is working but the call to m() without a reference to self seems strange Thanks for your help class CustomMethod: def method1(self): def method2(self):

Re: who to call a list of method inside the class itself

2008-08-19 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > [EMAIL PROTECTED] wrote: >> >> [EMAIL PROTECTED] 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

Re: who to call a list of method inside the class itself

2008-08-19 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: ensure instance's method invocation with all > state information to that point, rather than > relying on implemenation. Did you read the stuff I wrote about "bound methods" in the other post? That's a fundamental Python feature, not an implementation artifact. For

Re: who to call a list of method inside the class itself

2008-08-19 Thread Edwin . Madari
[EMAIL PROTECTED] wrote: > > [EMAIL PROTECTED] 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.

Re: who to call a list of method inside the class itself

2008-08-19 Thread Fredrik Lundh
[EMAIL PROTECTED] 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

Re: who to call a list of method inside the class itself

2008-08-19 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: def getAllMethod(self): return [self.method1, self.method2, self.method3] def applyAll(self): for m in self.getAllMethod(): # how to call all methods ? # is it correct m() what happens when you run the code?

Re: who to call a list of method inside the class itself

2008-08-19 Thread Edwin . Madari
[EMAIL PROTECTED] wrote: > Hi, > > Is the following code is ok. who to call all method. > It is working but the call to m() without a reference to self seems > strange > > Thanks for your help > > class CustomMethod: > def method1(self): > > def method2(self): > ...

Re: who to call a list of method inside the class itself

2008-08-19 Thread maduma
On Aug 19, 4:33 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Is the following code is ok. who to call all method. > > It is working but the call to m() without a reference to self seems > > strange > > > Thanks for your help > > > class CustomMethod: > > def metho

Re: who to call a list of method inside the class itself

2008-08-19 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: Is the following code is ok. who to call all method. It is working but the call to m() without a reference to self seems strange Thanks for your help class CustomMethod: def method1(self): def method2(self): def method3(self):

who to call a list of method inside the class itself

2008-08-19 Thread maduma
Hi, Is the following code is ok. who to call all method. It is working but the call to m() without a reference to self seems strange Thanks for your help class CustomMethod: def method1(self): def method2(self): def method3(self): def getAll