In my example below in Python, the object is x 'has-an' object y. I would like to be able to reference methods x from y.
I can achieve this using @staticmethod, however, I am not recommended to do this.
Is there a way to refer to the entire object x from the object y?
class X(object): def __init__(self): self.count = 5 self.y = Y()
Thanks in advance.
source share