I've never used metaclasses in real life before and while searching through the online Cookbook I found this gorgeous example:
"Wrapping method calls (meta-class example)" http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/198078 What I want to do in my app is to log all method calls and seems that the metaclass example above do this fine but it fails when it's needed to instantiate the class I'm in in a method. So if I do: class Test(object): __metaclass__ = LogTheMethods def foo(self): return Test() this generate a Runtime Error cause recursion never stops :( Any hint to enhance the example? -- Lawrence - http://www.oluyede.org/blog "Anyone can freely use whatever he wants but the light at the end of the tunnel for most of his problems is Python" -- http://mail.python.org/mailman/listinfo/python-list