I want to take the node of a tree created with AnyTree and copy the whole tree so I can make changes to it without changing the original.
The only thing that I can think of is looping through the whole tree and copying the nodes one by one adding the new nodes as children to each other in the right order. But that seems awfully intricate, i.e. not very pythonic.
Is there an easy way of doing this?
If AnyThree
doesn't have any function to duplicate then you may try to use standard module copy.deepcopy() (or you will have to copy nodes one by one).