Collection interfaces

Alex Martelli aleaxit at yahoo.com
Fri Mar 2 04:17:15 EST 2001


"Greg Ewing" <greg at cosc.canterbury.ac.nz> wrote in message
news:3A9EEDD8.9102C3A at cosc.canterbury.ac.nz...
> Alex Martelli wrote:
> >
> > the indisputable success
> > of Smalltalk does show that single-inheritance is *practically
> > workable* for many tasks
>
> Smalltalk is like Python in that its inheritance hierarchy
> is more about implementation inheritance than subtype
> relationships. So I don't think you can conclude much
> from Smalltalk about whether single inheritance is adequate
> for classification purposes.

Sorry for lack of clarity (but I do believe the snippet you
quote here was clearer in context): I do *NOT* think "single
inheritance" (taxonomy) is good for _classification_; I +do+
believe it's _practically workable_ ('adequate', if you will)
for many actual/practical programming, aka implementation,
tasks (although multiple inheritance, allowing mixin, is often
handier, using delegation won't destroy your productivity,
particularly if you can automate it with a little bit of
metaprogramming/introspection black magick).

I consider this similar to single dispatch (as in Python or
Smalltalk) vs multimethods (as in Dylan)... the latter is a
superior approach, but, _in practice_, one can get away with
the (simpler) former approach more often than not.  (Actually,
if I somehow had to choose between multimethods and multiple
inheritance for practical use, I think I'd take multimethods;
multiple-dispatching issues often prove less tractable, without
direct language support, than implementation multi-inheritance
issues do, in my actual programming experience).


Alex






More information about the Python-list mailing list