Re: Method resolution for super(Class, obj).

2006-09-10 Thread Bruno Desthuilliers
ddtl a écrit : > On 7 Sep 2006 10:42:54 -0700, in comp.lang.python you wrote: > > >>Let's examine what the mro order is for class D: >> >D.mro() >> >>[, , , >>>n__.A'>, ] >> >>When you call d.met(), the call dispatches to the D.met() method. >>After printing out 'D.met', you use super() to ge

Re: Method resolution for super(Class, obj).

2006-09-07 Thread Steve Holden
ddtl wrote: > On 7 Sep 2006 10:42:54 -0700, in comp.lang.python you wrote: > > >>Let's examine what the mro order is for class D: >> >D.mro() >> >>[, , , >>>n__.A'>, ] >> >>When you call d.met(), the call dispatches to the D.met() method. >>After printing out 'D.met', you use super() to get t

Re: Method resolution for super(Class, obj).

2006-09-07 Thread ddtl
On 7 Sep 2006 10:42:54 -0700, in comp.lang.python you wrote: >Let's examine what the mro order is for class D: D.mro() >[, , , >n__.A'>, ] > >When you call d.met(), the call dispatches to the D.met() method. >After printing out 'D.met', you use super() to get the next class in >the mro order,

Re: Method resolution for super(Class, obj).

2006-09-07 Thread Jason
ddtl wrote: > Hello everybody. > > Consider the following code: > > > class A(object): > def met(self): > print 'A.met' > class B(A): > def met(self): > print 'B.met' > super(B,self).met() > class C(A): > def met(self): > print 'C.met' > super(C,

Method resolution for super(Class, obj).

2006-09-07 Thread ddtl
Hello everybody. Consider the following code: class A(object): def met(self): print 'A.met' class B(A): def met(self): print 'B.met' super(B,self).met() class C(A): def met(self): print 'C.met' super(C,self).met() class D(B,C): def met(self