I’m taking a stub at implementing this question, but when traversing UNO hierarchy I’ll need to keep track of things came across.
The usual way in python to determine if 2 objects are the same (as in, not in terms of properties and values, but really are the same thing) is id() function, but…
>>> list_of_same_objects = [model.CurrentController.ActiveSheet for i in range(0,10)]
>>> [id(obj) for obj in list_of_same_objects]
[140159220049672, 140159220049696, 140159220049720, 140159220049744, 140159220049768, 140159220049792, 140159220049816, 140159220049840, 140159220049864, 140159220049888]
Oops. These are the same objects, and yet id() says otherwise. Using plain == doesn’t work either btw. How do I determine that then?
Oh, well) Hmm…Does it say, the function returns a new object on every access? Sounds inefficient.