Super reps a class, not an instance

Darren New dnew at san.rr.com
Tue Oct 10 12:09:23 EDT 2000


Thomas Gagne wrote:
> 2) references from within an instance to its superclass (however that is
> accomplished) are intended to access the superclass's methods/data as an
> instance not a class, aren't they? 

In Smalltalk,
  super message
is identical to
  self message
except that the method search starts at the superclass of the class
containing the call to "super" instead of starting at the class of "self".

That is, "super message" does exactly the same as "self message" if the
"message" routine is not defined in the class containing "super message" or
any of its descendants.

-- 
Darren New / Senior MTS & Free Radical / Invisible Worlds Inc.
San Diego, CA, USA (PST).  Cryptokeys on demand.
The tragedy of the commons applies to monitizing eyeballs, too.



More information about the Python-list mailing list