Why does super take a class name as the argument?

Chris Green cmg at dok.org
Fri Oct 15 11:07:48 EDT 2004


Good day,

I've done a bit of searching in the language reference and a couple
pages referring the behavior of super() but I can't find any
discussion of why super needs the name of the class as an argument.
Feel free to point me into the bowels of google if this has been
discussed to death already.

super(self).method() seems like super could just do the right
thing...

super(kls).method() could also work if you needed access up the tree
to from a classmethod. Maybe I'm missing something with Metaclasses.

The reason I'm asking about this is I find myself cursing super every
time I want to change the name of the class I'm working on when one of
the reason's that super was implemented (I'm guessing) was to insulate
derived classes from the name changes of where they inherited from.

Thanks,
Chris
-- 
Chris Green <cmg at dok.org>
"Yeah, but you're taking the universe out of context."



More information about the Python-list mailing list