Does 'super' exist?

Tim Peters tim.one at home.com
Sun Dec 9 12:09:11 EST 2001


[Bruce Eckel]
> Thanks. Looks like the syntax for calling the base-class B's
> constructor would then be:
> super(B, self).__init__()
> I see the value of super() for MI but I was thinking I might get a
> free ride in the form of less typing for SI base-class calls. Oh
> well.

You may someday, but not in 2.2.  The new 2.2 class features, from super()
to staticmethod(), are spelled in a very Lispish way.  Guido is keen to add
nicer syntax for some (perhaps all) of them, but in later releases.  For SI,
you can get less typing today by doing, e.g.,

    B.__init__(self)

Another idea is in

    http://aspn.activestate.com/ASPN/Mail/Message/248323





More information about the Python-list mailing list