super() doesn't get superclass

Ben Finney bignose+hates-spam at benfinney.id.au
Tue Sep 18 01:52:15 EDT 2007


Sorry, I read your message too fast and responded to the wrong point
:-)

aleax at mac.com (Alex Martelli) writes:

> Ben Finney <bignose+hates-spam at benfinney.id.au> wrote:
> > Am I mistaken in thinking that "superclass of foo" is equivalent
> > to "parent class of foo"? If so, I'd lay heavy odds that I'm not
> > alone in that thinking.
> 
> In general, "a superclass of foo" means "a class X such that foo is a
> sublass of X"

Read "ancestor" where I wrote "parent", then. It seems that (with that
substitution) my thinking is correct. Yes?

Why, then, does super() traverse the MRO of class 'A', instead of the
ancestors of class 'A'? And, since that's what it does, is it not
misnamed, since "next in the MRO" is *not* the same thing as
"superclass"?

-- 
 \      "Remember:  every member of your 'target audience' also owns a |
  `\        broadcasting station. These 'targets' can shoot back."  -- |
_o__)       Michael Rathbun to advertisers, news.admin.net-abuse.email |
Ben Finney



More information about the Python-list mailing list