Assume we have an object a and we want modify data which is structures like this
a.substructure1.subsubstructure1.name_of_the_data1
and this
a.substructure2.subsubstructure2.name_of_the_data2
To access this structure we call an external method get_the_data_shortcut(a) which is heavily parameterized (for example the parameter subsstructure specifies which substructure to return). This seems very redundant but there is a very good default setting for all these parameter which makes sense. Also, this function will return another branch of data if the default branch is not available.
How do I modify get_the_data_shortcut(a) ?
b = get_the_data_shortcut(a)
b = b + 1
Then, get_the_data_shortcut(a) is unchanged because well Python is not Java.
Do I need a setter? Mostly, this is not my code and written by people who write pythonic code, and I am trying to keep up with those standards.
b = a.substructure1.subsubstructure1; b.name_of_the_data1 += 1. But maybe you should write a minimal reproducible example so we have something more tangible to discuss.