advice on programming style: is multiple inheritance bad?

Uwe Mayer merkosh at hadiko.de
Sun Feb 1 13:48:00 EST 2004


Hi,

I got a class A2 that needs to inherit from class A1. 
A2, as well as some other classes implement a same functionality and in
order to prevent code duplication I'd like to factorize that (potentially)
duplicate code into a class SuperA from which then A2 and all other classes
could inherrit.
However, this would cause A2 to have two super classes A1 and SuperA - which
is possible of course in Python.

My question is: is that bad programming style?
>From C++ and Java we "learn" that you shouldn't do that.

Class A is automatically generated from other tools, so I can't solve the
problem by just letting A1 inherit from SuperA.

Your opinions?

Ciao
Uwe
-- 
        



More information about the Python-list mailing list