If my class has a variable that I have mapped to something else. Almost as if the class is wrapping an object in a software package, like a 3d node or something.
When a variable in the class is changed, that simple attribute change I would then want to run a function that set that attribute on the 3d node. Like myClass.translateX, changing this attr would then run a function to update the translateX of the 3d node.
Hope that makes sense, my google foo has failed so maybe I am not using the right terminology.
I think you want a
property. It allows you to map attribute access on instances of a class to function calls, which you can use to perform the necessary operations on your 3d object: