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
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)
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
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(
[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
[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):
[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
[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
[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.
[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
[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?
[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):
> ...
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
[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):
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
15 matches
Mail list logo