Michele Simionato michele.simion...@gmail.com writes on Fri, 25 Sep 2009
22:58:32 -0700 (PDT):
...
You know that in an ideal world I would just
throw
away multiple inheritance, it is just not worth the complication.
I am a fan of multiple inheritance: it lets the compliler/language runtime
do
En Sat, 26 Sep 2009 01:48:08 -0300, Steven D'Aprano
st...@remove-this-cybersource.com.au escribió:
I'm aiming for some sort of polymorphic inheritance: in a method, if the
argument meets some condition, inherit from PClass, if it meets another
condition inherit from NClass, and so on. Is
On Fri, Sep 25, 2009 at 9:30 PM, Steven D'Aprano
st...@remove-this-cybersource.com.au wrote:
On Fri, 25 Sep 2009 20:15:54 -0700, Chris Rebert wrote:
Inside MyClass().method(n), I dispatch to either NClass.method() or
PClass.method() depending on the value of the argument n. The correct
class
On Sep 26, 8:02 am, Gabriel Genellina gagsl-...@yahoo.com.ar
wrote:
If you decide at every invocation which method to call, it's a dispatcher;
you may use a dictionary to map each alternative to the function to be
invoked. If it only depends on the type of the argument, there is a hidden
On Sep 26, 4:36 am, Steven D'Aprano st...@remove-this-
cybersource.com.au wrote:
I don't understand why I'm getting the following behaviour when using
super() with multiple inheritance.
super is working as intended. If you do not want cooperative methods,
don't use super
and call directly
On Fri, Sep 25, 2009 at 9:36 PM, Steven D'Aprano
st...@remove-this-cybersource.com.au wrote:
I don't understand why I'm getting the following behaviour when using
super() with multiple inheritance. The following is a minimal example
demonstrating the behaviour.
super() does not have
On Fri, 25 Sep 2009 20:15:54 -0700, Chris Rebert wrote:
Inside MyClass().method(n), I dispatch to either NClass.method() or
PClass.method() depending on the value of the argument n. The correct
class is called, but then the *other* class method is called as well.
E.g. this is what I expect:
On Fri, 25 Sep 2009 21:03:09 -0700, Michele Simionato wrote:
On Sep 26, 4:36 am, Steven D'Aprano st...@remove-this-
cybersource.com.au wrote:
I don't understand why I'm getting the following behaviour when using
super() with multiple inheritance.
super is working as intended. If you do
Michele Simionato michele.simion...@gmail.com writes:
You may want to read Things to know about super:
http://www.artima.com/weblogs/viewpost.jsp?thread=236275
http://www.artima.com/weblogs/viewpost.jsp?thread=236278
http://www.artima.com/weblogs/viewpost.jsp?thread=237121
Thanks for these
Steven D'Aprano st...@remove-this-cybersource.com.au writes:
On Fri, 25 Sep 2009 21:03:09 -0700, Michele Simionato wrote:
I usually recommend avoiding multiple inheritance altogether.
In my case, PClass and NClass are actually private classes, and it
seemed like a nice way to avoid having
Hermy:
So, for the moment my conclusion is that although Python has some
syntax for multiple inheritance, it doesn't support it very well, and I should
probably stick to single inheritance.
This is not much a problem of Python, the problem is that multiple
inheritance is
intrinsically HARD to
Hi,
I'm trying to figure out how to pass constructor arguments to my
superclasses in a multiple inheritance situation.
As I understand it, using super() is the preferred way to call
the next method in method-resolution-order. When I have parameterless
__init__ methods, this works as expected.
hermy wrote:
As I understand it, using super() is the preferred way to call
the next method in method-resolution-order. When I have parameterless
__init__ methods, this works as expected.
However, how do you solve the following simple multiple inheritance
situation in python ?
class
hermy wrote:
Hi,
I'm trying to figure out how to pass constructor arguments to my
superclasses in a multiple inheritance situation.
As I understand it, using super() is the preferred way to call
the next method in method-resolution-order. When I have parameterless
__init__ methods, this
Carl Banks schreef:
hermy wrote:
Hi,
I'm trying to figure out how to pass constructor arguments to my
superclasses in a multiple inheritance situation.
As I understand it, using super() is the preferred way to call
the next method in method-resolution-order. When I have
hermy wrote:
Thanx, I think I got it (please correct me if I'm wrong):
o super(C,self) determines the next class in the inheritance hierarchy
according to
method resolution order, and simply calls the specified method on it
(in this case
__init__ with the specified argument list.
o since
16 matches
Mail list logo