Mike Meyer <[EMAIL PROTECTED]> wrote:

> Noam Raphael <[EMAIL PROTECTED]> writes:
> 
> > The answer is that a subclass is guaranteed to have the same
> > *interface* as the base class. And that's what matters.
> 
> This is false. For instance:
> 
> class A(object):
>  def method(self, a):
>     print a
> 
> class B(A):
>  def method(self, a, b):
>    print a, b
> 
> B implements a different interface than A. Statically typed OO
> languages either use multi-methods or disallow changing the signature
> of an overridden method.
> 
> A tool to detect such cases would probably be almost as useful as the
> tool you've proposed.

Agreed, and besides, the two tools can usefully be one.  Look at the
inspect module for signature checking helpers...


Alex
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to