I want to have a python class that just acts as a wrapper for another python class.
Something like this
class xxx:
name = property( fset=lambda self, v: setattr(self.inner, 'name', v), fget=lambda self: getattr(self.inner, 'name' ))
def setWrapper( self, obj )
self.inner = obj
So when someone says xxx().x = 'hello' I want it to set the value on xxx().inner.whatever and not xxx().x.
Is this possible, I have been trying lambdas, but to no avail.
Edit:
Now my wife isn't rushing me to bed so I can flush out the code a bit more. I kind of had an idea about what you guys had below, but from the docs it seemed that you should avoid overriding __setattr__/__getattr__ and use property instead. If it is not possible to do this via the property function then I will use the __setattr__/__getattr__? Thanks