On 1/6/07, Eduardo EdCrypt O. Padoan firstname.lastname@example.org wrote:
I was bitten by the urge to play with this today, and modified my previous "self" hack to handle "super" also, so that the following code works:
class D (C): @method def sum(n): return super.sum(n * 2) - self.base
Posted as "evil2.py" here:
Because hacking "super" requires having the class object handy, this one needs a metaclass to do its magic, which is a shame. I guess if it was implemented inside the cpython compiler, it would be less of a problem.
BTW, a "super-only" version of this decortor (that I think could be called "implement") has some more chances in Python. But think belongs more to Python-Ideas list, ok?
Ops: But *I* think *it* belongs more to Python-Ideas list, ok?