Open minacode opened 2 years ago
I got a ValueError from applying treetransforms.collapseunary on (B (E (C (a 0) (b 1)) (c 2))), ecpecting (B+E (C (a 0) (b 1)) (c 2)):
treetransforms.collapseunary
(B (E (C (a 0) (b 1)) (c 2)))
(B+E (C (a 0) (b 1)) (c 2))
ValueError: Cannot insert a subtree that already has a parent.
I found, that this occurs, because the parent reference E is not deleted in Es children before they are assigned to the new parent B+E.
E
B+E
I got a ValueError from applying
treetransforms.collapseunary
on(B (E (C (a 0) (b 1)) (c 2)))
, ecpecting(B+E (C (a 0) (b 1)) (c 2))
:ValueError: Cannot insert a subtree that already has a parent.
I found, that this occurs, because the parent reference
E
is not deleted inE
s children before they are assigned to the new parentB+E
.