Andrew Koenig wrote:
> In other words, whether or not we choose to define a family of types that
> stand for particular abilities, I think we should not use inheritance as the
> mechanism for specifying that a particular class has a particular ability.
> I don't know what the mechanism should be, but it shouldn't be inheritance.
>
> Am I missing something?
It seems to me to be an excellent write-up of why using concrete classes for
interface definitions is potentially problematic. (Although I will point out
that most protocols for things like len() *do* involve checks for special
methods by name, and the check for iterability is typically a non-destructive
call to iter(x), rather than a destructive one to x.next()).
To make multiple dispatch practical, I suspect we will end up with something
more along of the lines of Zope.interface to 'formalise' Python interface
definitions.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---------------------------------------------------------------
http://www.boredomandlaziness.org
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe:
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com