Guido van Rossum wrote: >> and the cumbersome way in which you have to invoke super. > > Given Python's dynamic nature I couldn't think of a way to make it > less cumbersome. I see you tried (see below) and couldn't either. At > this point I tend to say "put up or shut up."
Well, there's my autosuper recipe you've seen before: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/286195 which does basically what Philip descibes ... >>> import autosuper >>> >>> class A (autosuper.autosuper): ... def test (self, a): ... print 'A.test: %s' % (a,) ... >>> class B (A): ... def test (self, a): ... print 'B.test: %s' % (a,) ... self.super(a + 1) ... >>> class C (A): ... def test (self, a): ... print 'C.test: %s' % (a,) ... self.super.test(a + 1) ... >>> class D (B, C): ... def test (self, a): ... print 'D.test: %s' % (a,) ... self.super(a + 1) ... >>> D().test(1) D.test: 1 B.test: 2 C.test: 3 A.test: 4 It uses sys._getframe() of course ... Tim Delaney _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com