How to communicate between sibling objects in Python, when using Composition, not Inheritance
How to communicate between sibling objects in Python, when using Composition, not Inheritance Question: I have a parent object which is composed of 2 (different) child objects. The 2 child instances need to communicate. For example, assume child1 needs to send something to child2: import children class Parent: def __init__(self): self.child1 = children.Child1(self.q) self.child2 = …
Total answers: 2