IS:
When using Item.SetParent to set an item to be a child of one of its own children, a TimeoutError occurs.
REQUESTED CHANGE:
When using Item.SetParent to set an item to be a child of one of its own children, a descriptive exception is thrown. (I would suggest something like a "GenealogyError".)
Example:
When using Item.SetParent to set an item to be a child of one of its own children, a TimeoutError occurs.
REQUESTED CHANGE:
When using Item.SetParent to set an item to be a child of one of its own children, a descriptive exception is thrown. (I would suggest something like a "GenealogyError".)
Example:
Code:
RDK = robolink.Robolink()
item_a = RDK.AddFrame('item_a')
item_b = RDK.AddFrame('item_b', itemparent=item_a)
item_c = RDK.AddFrame('item_c', itemparent=item_b)
try:
item_a.setParent(item_b)
except robolink.GenealogyError as e:
print(e)
>> CannotSetItemToChildOfItsOwnDescendant
try:
item_a.setParentStatic(item_b)
except robolink.GenealogyError as e:
print(e)
>> CannotSetItemToChildOfItsOwnDescendant
try:
item_a.setParent(item_c)
except robolink.GenealogyError as e:
print(e)
>> CannotSetItemToChildOfItsOwnDescendant