On Fri, 03 Oct 2008 16:03:22 +0200, TP wrote: > Hi everybody, > > I would like to be able to specialize an existing class A, so as to > obtain a class B(A), with all methods of B being the methods of A > preceded by a special method of B called _before_any_method_of_A( self > ), and followed by a special method of B called _after_any_method_of_A( > self ). > > The goal is to avoid to redefine explicitly in B all methods of A. > > Is this possible in Python?
You may be able to adapt this code to do what you are after: http://code.activestate.com/recipes/91192/ -- Steven -- http://mail.python.org/mailman/listinfo/python-list