[Python-3000] Implementations: A syntax for extending method dispatching beyond type/class inheritance

Hasan Diwan hasan.diwan at gmail.com
Thu Dec 7 16:57:23 CET 2006

On 07/12/06, Dave Anderson <python3000 at davious.org> wrote:
> I feel on a different page from you.
> My best guess it is that
> def typeOfSuper(self):
>         pass(subclass)
> is ceding its implementation to its subclasses, kind of like what an
> abstract class or interface would do
> but I feel my guess is wrong.  Please clarify.

No, that is spot-on.
> The former is an example of someone writing a function whose first
> parameter is expected to be any object that is derived from
> MutableContainer (including dict), or is derived from a class that
> implements MutableContainer (including those implementing dict), or is
> derived from a class that specifically implements MutableContainer.add
> using a declaration like:
> class CanAdd:
>         implements MutableContainer.add
>         def add(self, key, value):

I find you're making the whole "implements" procedure, a little too complex.
Hasan Diwan <hasan.diwan at gmail.com>

More information about the Python-3000 mailing list