super() and automatic method combination

Michele Simionato michele.simionato at gmail.com
Wed May 18 10:30:23 EDT 2005


Paul Rubin:
> It would be nice to make some decorators to do CLOS-like > automatic
method combination ...

You can't do that with decorators (I mean the automatic
call of the supermethod) but you can with a metaclass.
There is an example in my ACCU lectures:

http://www.reportlab.org/~andy/accu2005/pyuk2005_simionato_wondersofpython.zip

You can also define a custom super that
does not give an error when the superclass doesn't have the
corresponding method (I posted an example
some time ago to somebody complaining for the same reason).

               Michele Simionato




More information about the Python-list mailing list