Apologies if title was a little unclear. A little shaky on Python object-oriented fundamentals, but here is a basic example: Let's say I have a "Body" class and a "Legs" class, and I have an instance of "Legs" (rightLeg) as a property of a "Body" instance (georgesBody). If I call a function like rightLeg.break()
, how can I, inside of break()
for the "Legs" class, ping the corresponding "Body" instance and pass it some information (maybe through a setter method of "Body" set up to accept said ping)?
I need to be able to trigger code that calls the specific instance of "Body", georgesBody, from within rightLeg dynamically (without referencing the actual name georgesBody). Any help is much appreciated!