wrapping all class methods

Robin Becker robin at jessikat.fsnet.co.uk
Fri Nov 15 16:19:51 EST 2002


.
......
>> ie the traceback seems to get stuck in the wrapper method. What's
>> the 'proper' pythonic way to do this kind of global wrapping?
>
>Metaclasses.  What else?  :-) Ok, it looks like you want to do this on
>the fly, and I don't think you can set a class's type after it's been
>defined.  (Maybe you can assign to it's __class__ attribute, but I
>recall that assigning to __class__ is being phased out.)
>
>
..... yes well we're not all into the bleeding edge, the real problem is
that tracebacks don't continue back above the catch point.

Providing the linenos etc have been set up you can simulate a traceback
beyond that, but there are many places where C python doesn't fix up the
frame properly (eg import module) so it may not be possible to do what I
want.

My previous post based on the aspect thread seems to do what I want
modulo the incomplete traceback info.
-- 
Robin Becker



More information about the Python-list mailing list