Steven D'Aprano <[EMAIL PROTECTED]> wrote: > Now you can monkey patch class A if you want. It's probably not a great > idea to do this in production code, as it will effect class A everywhere. >
This is perfect for me. The code in question is basically a protocol translator... it receives requests over the network, makes some calls, and returns the result translated back to the original protocol, so there's a single instance of each A,B, etc. > A.p1 = precall(pre)(postcall(post)(A.p1)) Is there a way to do this for all callable methods of A? e.g. for x in callable_methods(A): x = precall(pre)(postcall(post)(x)) Thanks! Mark -- Mark Harrison Pixar Animation Studios -- http://mail.python.org/mailman/listinfo/python-list