Are there 'Interfaces' in Python??

tszeto tszeto at
Wed Sep 26 06:08:50 CEST 2001

Yes. I like interfaces. Very helpful. I like interfaces. Yes.

"Richard Jones" <richard at> wrote in message
news:mailman.1001472149.684.python-list at
> On Wednesday 26 September 2001 11:50, Paul Rubin wrote:
> > "tszeto" <tszeto at> writes:
> > > Was wondering if Python supported 'Interfaces' (something akin to Java
> > > interfaces)? Or if there's a workaround to get the same thing.
> >
> > Java interfaces are a workaround for java's non-support of multiple
> > base classes in objects.  Python supports multiple base classes, so
> > it doesn't need a workaround for their absence.
> Er, no. They may be percieved as that, but since interfaces can't actually
> _do_ anything, whereas multiple inheritance _can_, I believe this is a
> herring.
> Interfaces are an extremely useful form of "type" checking for OO systems.
> Python already has "interfaces" in the form of agreed methods - witness
> "pass a file-like object" requirements in a lot of APIs. An interface
> just formalise that.
> There are proposals for interfaces floating around - I believe the Python
> Enhancement Proposal 245 is gaining popularity.
>    "Python Interface Syntax"
>       Richard

More information about the Python-list mailing list