[Python-Dev] Classes and Metaclasses in Smalltalk

Donald Beaudry Donald Beaudry <donb@abinitio.com>
Wed, 02 May 2001 11:31:45 -0400


Guido van Rossum <guido@digicool.com> wrote,
> AFAIK, Smalltalk has only single inheritance, and so does Java, so
> there 'super' is enough.  Will we need to add a "::" operator to
> Python???

Multiple inheritance introduces a potential wrinkle in my definition
of the unbound instance.  The problem is that search starts one level
too high.  That is in:

    class foo(b1, b2):
          def __repr__(self):
              super = b1._  #this one
              super = b2._  #or this one?
              return super.__repr__(self)

we dont know which base class to choose as the starting point for the
search.  This problem already exist.  Now, if we want to avoid it,
this:

    class foo(b1, b2):
          def __repr__(self):
              super = foo.__super__
              return super.__repr__(self)


comes to mind.

--
Donald Beaudry                                     Ab Initio Software Corp.
                                                   201 Spring Street
donb@init.com                                      Lexington, MA 02421
                      ...Will hack for sushi...