From: "Tim Delaney" <[EMAIL PROTECTED]> > I've been off sick from work for over a week - I've been following this > discussion, but now I think I've got something which matches all the > criteria we've been discussing, so I've changed my subscription address > temporarily to my home one. > > It involves bytecode hacking for now, as well as a metaclass. The code is > attached. It's based partially off my 'self.super' recipe, but doesn't > need > to use sys._getframe().
Oh - some output ... >>> class autosuper(object): ... __metaclass__ = _autosuper ... >>> class A(autosuper): ... def f(self): ... print 'A:', super ... >>> class B(A): ... def f(self): ... print 'B:', super ... super.f() ... >>> class C(A): ... def f(self): ... print 'C:', super ... super.f() ... >>> class D(B, C): ... def f(self): ... print 'D:', super ... super.f() ... >>> D().f() D: <super: <class 'D'>, <D object>> B: <super: <class 'B'>, <D object>> C: <super: <class 'C'>, <D object>> A: <super: <class 'A'>, <D object>> Tim Delaney _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com