Re: python interfaces
- From: r.grimm@xxxxxxxxxxxxxxxxxxxx
- Date: Sat, 5 Jan 2008 23:31:02 -0800 (PST)
On Jan 4, 6:01 pm, Sion Arrowsmith <si...@xxxxxxxxxxxxxxxxxxxxxx>
wrote:
hyperboreean <hyperbore...@xxxxxxxxxxxxx> wrote:Hallo,
Why doesn't python provide interfaces trough its standard library?
Because they're pointless. Java interfaces are a hack around the
complexities of multiple inheritence. Python does multiple
inheritence Just Fine (give or take the subtleties of super()) so
does not need them.
Interfaces are a extremly smart Design Principle in static typed
languages
like Java and C++.
C++ support Interfaces in a form of abstract base classes. They aren't
pointless.
They force the user of a framework to use it in a defined way. You
prescribe in
the base class the usage of a classsystem and allow only in derived
classes
to variate the behavior.
To appreciate Interfaces look at the Template Methode Pattern (http://
en.wikipedia.org/wiki/Template_method_pattern )
or especially at the Non Virtual Interface ( http://www.gotw.ca/publications/mill18.htm
) Idiom from Herb Sutter.
To be short C++ support Interfaces and multiple inheritace.
Greetings Rainer
.
- Follow-Ups:
- Re: python interfaces
- From: Carl Banks
- Re: python interfaces
- From: Fredrik Lundh
- Re: python interfaces
- References:
- python interfaces
- From: hyperboreean
- Re: python interfaces
- From: Sion Arrowsmith
- python interfaces
- Prev by Date: list property fires get on append
- Next by Date: Re: how to use bool
- Previous by thread: Re: python interfaces
- Next by thread: Re: python interfaces
- Index(es):
Relevant Pages
|