In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Alex Martelli) wrote:

> Roy Smith <[EMAIL PROTECTED]> wrote:
> 
> > Peter Maas  <[EMAIL PROTECTED]> 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
> 
> There's a _tiny_ bit more -- accidental clashes of methodnames are more
> likely to be avoided.  I.e.,
> 
> interface ILottery {
>     void draw();
> };
> 
> interface IGunslinger {
>     void draw();
> };
> 
> interface IPainter {
>     void draw();
> };
> 
> A class asserting, e.g., "implements IPainter", doesn't thereby risk
> being accidentally misused where an IGunslinger is required (OTOH,
> implementing >1 of these IS a bother, but that's sort of inevitable).

I suppose, but all you've really done is move the problem to a different 
namespace.  Which IPainter did you have in mind?  The one that has to do 
with people who apply oils to canvas, or the one that has to do with ropes 
that are used to tie up rowboats?
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to