I have a class that is a wrapper: class wrapper: def __init__(self, object): self.wrapped = object def __getattr__(self, attrname): print 'Trace: ', attrname #print arguments to attrname, how? return getattr(self.wrapped, attrname)
I can run it this way: >>> x = wrapper([1,2,3]) >>> x.append(4) Trace: append >>> x.wrapped [1, 2, 3, 4] I am able to capture the attribute name to x (that is, append). However, I do not know how to capture and print all of its arguments (in this case number 4). How should I proceed? Thank you -- http://mail.python.org/mailman/listinfo/python-list