super() doesn't get superclass
Ben Finney
bignose+hates-spam at benfinney.id.au
Wed Sep 19 22:04:48 EDT 2007
Scott David Daniels <Scott.Daniels at Acm.Org> writes:
> Ben Finney wrote:
> > aleax at mac.com (Alex Martelli) writes:
> >
> >> In general, "a superclass of foo" means "a class X such that foo is a
> >> sublass of X"
> >
> > Sure. However, this doesn't equate to the assertion that "next class
> > in the MRO is the superclass", which is what I was responding to.
> >
> One thing not pointed out in this thread is that the chain of classes
> on the MRO starting with super(A, obj) _will_ include all superclasses
> of A. That is the guarantee of the MRO, and that is why super is an
> appropriate name.
Yes, it does include those classes. The problem is it also includes an
unknown (to the implementation of A) number of classes that are *not*
superclasses of A. Thus, 'super' is a *bad* name for such a function.
--
\ "There are always those who think they know what is your |
`\ responsibility better than you do." -- Ralph Waldo Emerson |
_o__) |
Ben Finney
More information about the Python-list
mailing list