Brilliant! Except I think a syntax change isn't even needed. You can
do this now, as follows:
parent = a
class b(parent):
def m(self): ... parent.m(self) ... # Calls a.m()
This essentially defines a symbolic name for b's parent class, so if
you want to change the base class you simply change the assignment to
parent.
If you are defining multiple classes in one module (not unlikely :-),
you need to introduce different variable names for each parent, e.g.
b_parent = a
class b(b_parent):
def m(self): ... b_parent.m(self) ... # Calls a.m()
c_parent = b
class c(c_parent):
.....
Or, if you don't mind writing the base class name twice, you could
make it a class variable:
class b(a):
parent = a
def m(self): ... b.parent.m(self) ... # Calls a.m()
The solution for multiple bases is obvious as well...
--Guido van Rossum, CWI, Amsterdam <Guido.van.Rossum@cwi.nl>
<URL:http://www.cwi.nl/cwi/people/Guido.van.Rossum.html>