Interfaces != Multiple Inheritance [was Re: python development practices?]

Richard Jones richard at bizarsoftware.com.au
Tue Oct 30 20:29:12 EST 2001


On Wednesday 31 October 2001 12:11, Paul Rubin wrote:
> Peter Wang <pzw1 at cor-no-spam-nell.edu> writes:
> > while i feel that Python makes me far more productive as a programmer
> > for all the projects on which i've worked, i'm inclined to agree that
> > the lack of data hiding coupled with lack of a standard interface
> > specification would cause problems in a team.
>
> If by "interfaces" you mean Java-like interfaces, that's a bogus
> criticism since Python supports multiple base classes, which let
> you do the same things and then some.

Java interfaces != multiple inheritance.

They address completely different issues. Mutliple inheritance allows one to 
include functionality from multiple base classes in one step. An interface 
indicates that your class implements a specific set of methods. Interfaces 
don't implement functionality, therefore indicating that your class 
implements multiple interfaces doesn't add any additional functionality.


   Richard




More information about the Python-list mailing list