Why does super take a class name as the argument?

Michele Simionato michele.simionato at gmail.com
Sat Oct 16 06:11:56 EDT 2004


Chris Green <cmg at dok.org> wrote in message news:<87wtxshvej.fsf at ion.xlipstream.com>...
> 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.

Others have already answered your question. I want just to point out
that there exists recipes to avoid retyping the class name: the first
of these is Guido's autosuper recipe. A very sophysticated one is this one:

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/286195

I also wrote one of such recipes -;)

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/284528

          Michele Simionato



More information about the Python-list mailing list