> How about > > def __getattr__(self,name): > try: > return self.__dict__[name] > except KeyError: > return getattr(self.ptr, name) It even looks like the first 'return' is not needed. If the attribute is found in the instance then __getattr__() is not called at all. Armin