Re: python interfaces



Sion Arrowsmith wrote:
hyperboreean <hyperboreean@xxxxxxxxxxxxx> wrote:
Why doesn't python provide interfaces trough its standard library?

Because they're pointless.

Wrong. I'm using Eclipse with the Java Development Tools (JDT) who do
a wonderful job using interfaces to perform lots of checking, warning
and code generation *nearly in real time while I am editing my code*.
Because JDT knows interfaces it knows what to do and to suggest.

Java interfaces are a hack around the complexities of multiple
inheritence.

A hack is something applied subsequently to solve a software problem while
avoiding large changes. Java interfaces originate from careful language
design. You are free to dislike Java interfaces but calling them a hack is
just plain wrong.

Once software becomes really big interfaces are very useful to handle
complexity. Ever wondered why the Zope people introduced interfaces in
their Python code?

Interfaces used purely with the idea of type safety provide
precious little gain for the added clutter and inconvenience.

An interface is a software specification allowing you to use a software
package without extensive code studies. This is a good thing. Interfaces
have nothing to do with multiple inheritance and are not about type safety
in the first place. They just tell you how to connect, how to plug in.

--
Regards/Gruesse,

Peter Maas, Aachen
E-mail 'cGV0ZXIubWFhc0B1dGlsb2cuZGU=\n'.decode('base64')
.



Relevant Pages

  • Re: Java Feature Proposal
    ... > conflict. ... No, there is no naming conflict with Java interfaces, since they contain ... class to inherit multiple conflicting implementations of a method. ... I don't see why multiple inheritance of fields is any more of a problem ...
    (comp.lang.java.programmer)
  • Re: Java Feature Proposal
    ... implementation of interfaces. ... multiple inheritance of fields which was the only big problem of [poorly ... > classes can provide the same functionality as you're proposing. ... Yes abstract base classes could be used similarly except that you can't have ...
    (comp.lang.java.programmer)
  • Re: IDropSource and IDataObject Multiple Inheritance
    ... COM does not support multiple inheritance for interfaces. ... apartment model of the object and the apartment model of the ... One of this is invoked by ActiveXContainer and anothere by WindowsShell. ...
    (microsoft.public.win32.programmer.ole)
  • Re: Former C++ Programmer Approaches Lisp
    ... >> multiple inheritance but this is as close as we can get. ... > I think this is an overly simplistic way to view interfaces. ... Interfaces compromise by not allowing state to ... interfaces can only contain abstract methods. ...
    (comp.lang.lisp)
  • Re: interface question
    ... IRoadVehicle and RoadVehicle are ... and is certainly a water vehicle. ... Interfaces and inheritance both represent ...
    (microsoft.public.dotnet.languages.csharp)