Missing interfaces in Python...

Roy Smith roy at panix.com
Tue Apr 18 15:40:34 EDT 2006


Peter Maas  <peter.maas at somewhere.com> wrote:
> He probably means that with interfaces one could test compliance
> with the interface as a whole instead of testing each member and
> each signature as a single piece.

All interfaces (as implemented by Java) prove is that your class has a
bunch of methods with the right names and signatures.  It doesn't
prove that those methods do the right things.  It's like having a
bouncer in front of a nightclub stopping people saying, "You can't
come in here unless you tell me you're over 21 and aren't wearing
scruffy jeans".  OK, I'm happy to tell you that, but if you don't
check to make sure it's true, you're going to have a lot of scruffy 18
year olds crashing your party.




More information about the Python-list mailing list