Re: example from the book

2007-01-17 Thread Paul McGuire
"questions?" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I am a little confused by an example in python book: > > class wrapper: >def __init__(self,object): >self.wrapped=object >def __getattr__(self,attrname): >print "Trace:",attrname (<<

example from the book

2007-01-17 Thread questions?
I am a little confused by an example in python book: class wrapper: def __init__(self,object): self.wrapped=object def __getattr__(self,attrname): print "Trace:",attrname print getattr(self.wrapped,attrname) (*) return getattr(self.wrapped,attrname)