Missing interfaces in Python...

Sybren Stuvel sybrenUSE at YOURthirdtower.com.imagination
Mon Apr 17 16:53:10 EDT 2006


redefined.horizons at gmail.com enlightened us with:
> I see that Python is missing "interfaces".

No it isn't. It just hasn't got them.

> The concept of an interface is a key to good programming design in
> Java, but I've read that they aren't really necessary in Python.


> In Java I would accomplish this by defining an IFixable interface
> that would be implemented by both the Car and Bus objects. Mechanic
> objects would work with any object implementing this interface.

In Python, you would simply call the functions you need. No need to
make things that rigidly defined.

Sybren
-- 
The problem with the world is stupidity. Not saying there should be a
capital punishment for stupidity, but why don't we just take the
safety labels off of everything and let the problem solve itself? 
                                             Frank Zappa



More information about the Python-list mailing list