your reply code shows it getting the attribute of something else using the name object. but i don't have that. i need to have it return the attribute of itself. thus, i need to find a way to get the attribute of itself without calling itself.
i want to have object A behave like object B except for intended differences. i implement the methods intended to be different. for the remaining methods, i don't even know what all they are, or will be in the future, so i implement __getattribute__ to pass references. that method ends up referencing itself to reference object B. because it references itself, it ends up calling itself.
even your code will have this problem since it gets attributes inside itself.
i want to have object A behave like object B except for intended differences. i implement the methods intended to be different. for the remaining methods, i don't even know what all they are, or will be in the future, so i implement __getattribute__ to pass references. that method ends up referencing itself to reference object B. because it references itself, it ends up calling itself.
def __getattribute__(self,attr): print(f'getting attribute {attr!r}',flush=True) # so i can see what is happening return self.objectb.__getattribute__(attr)output will be one line for the first attribute then a few hundred for 'objectb', hence the recursion loop.
even your code will have this problem since it gets attributes inside itself.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.