Re: invoking a method from two superclasses

2009-07-02 Thread Lie Ryan
Carl Banks wrote: > On Jun 30, 6:23 pm, Carl Banks wrote: >> On Jun 30, 5:34 pm, Mitchell L Model wrote: >> >>> Allow me to add to my previous question that certainly the superclass >>> methods can be called explicitly without resorting to super(), e.g.: >>> class C(A, B): >>> def __i

Re: invoking a method from two superclasses

2009-07-01 Thread Carl Banks
On Jun 30, 9:57 pm, Mitchell L Model wrote: > [Continuing the discussion about super() and __init__] > > The documentation of super points out that good design of > diamond patterns require the methods to have the same > signature throughout the diamond. That's fine for non-mixin > classes where t

Re: invoking a method from two superclasses

2009-07-01 Thread Mitchell L Model
[Continuing the discussion about super() and __init__] The documentation of super points out that good design of diamond patterns require the methods to have the same signature throughout the diamond. That's fine for non-mixin classes where the diamond captures different ways of handling the sa

Re: invoking a method from two superclasses

2009-07-01 Thread Michele Simionato
On Jul 1, 2:34 am, Mitchell L Model wrote: > I suspect we should have a Multiple Inheritance HOWTO, though details and > recommendations would be controversial. I've accumulated lots of abstract > examples along the lines of my question, using multiple inheritance both to > create combination clas

Re: invoking a method from two superclasses

2009-07-01 Thread Scott David Daniels
> Mitchell L Model wrote: Sorry, after looking over some other responses, I went back and re-read your reply. I'm just making sure here, but: > Scott David Daniels wrote: Below compressed for readability in comparison: class A: def __init__(self): super().__init__(); print('A') cl

Re: invoking a method from two superclasses

2009-07-01 Thread Carl Banks
On Jun 30, 9:15 pm, "Gabriel Genellina" wrote: > En Tue, 30 Jun 2009 21:34:02 -0300, Mitchell L Model   > escribi : > > > Allow me to add to my previous question that certainly the superclass > > methods can be called explicitly without resorting to super(), e.g.: > > >     class C(A, B): > >    

Re: invoking a method from two superclasses

2009-06-30 Thread Gabriel Genellina
En Tue, 30 Jun 2009 21:34:02 -0300, Mitchell L Model escribió: Allow me to add to my previous question that certainly the superclass methods can be called explicitly without resorting to super(), e.g.: class C(A, B): def __init__(self): A.__init__(self) B.

Re: invoking a method from two superclasses

2009-06-30 Thread Scott David Daniels
Mitchell L Model wrote: From: Scott David Daniels Date: Tue, 30 Jun 2009 16:49:18 -0700 Message-ID: Subject: Re: invoking a method from two superclasses Mitchell L Model wrote: In Python 3, how should super() be used to invoke a method defined in C that overrides its two superclasses A and B

Re: invoking a method from two superclasses

2009-06-30 Thread Mitchell L Model
>From: Scott David Daniels >Date: Tue, 30 Jun 2009 16:49:18 -0700 >Message-ID: >Subject: Re: invoking a method from two superclasses > >Mitchell L Model wrote: >>In Python 3, how should super() be used to invoke a method defined in C > > that overrides its two super

Re: invoking a method from two superclasses

2009-06-30 Thread Carl Banks
On Jun 30, 6:23 pm, Carl Banks wrote: > On Jun 30, 5:34 pm, Mitchell L Model wrote: > > > Allow me to add to my previous question that certainly the superclass > > methods can be called explicitly without resorting to super(), e.g.: > > >     class C(A, B): > >         def __init__(self): > >    

Re: invoking a method from two superclasses

2009-06-30 Thread Carl Banks
On Jun 30, 5:34 pm, Mitchell L Model wrote: > Allow me to add to my previous question that certainly the superclass > methods can be called explicitly without resorting to super(), e.g.: > >     class C(A, B): >         def __init__(self): >             A.__init__(self) >             B.__init__(se

Re: invoking a method from two superclasses

2009-06-30 Thread Mitchell L Model
Allow me to add to my previous question that certainly the superclass methods can be called explicitly without resorting to super(), e.g.: class C(A, B): def __init__(self): A.__init__(self) B.__init__(self) My question is really whether there is any way of get

Re: invoking a method from two superclasses

2009-06-30 Thread Scott David Daniels
Mitchell L Model wrote: In Python 3, how should super() be used to invoke a method defined in C > that overrides its two superclasses A and B, in particular __init__? ... I've discovered the surprising fact described in the documentation of super

invoking a method from two superclasses

2009-06-30 Thread Mitchell L Model
In Python 3, how should super() be used to invoke a method defined in C that overrides its two superclasses A and B, in particular __init__? class A: def __init__(self): print('A') class B: def __init__(self): print('B') class C(A, B):