Returns a copy of self using an iterative approach
Perform an iterative deepcopy of self. It is not assured that the copy of node attributes will be performed iteratively as that depends on the copy method of the types being copied
Returns: | TreeNode
|
---|
See also
Examples
>>> from six import StringIO
>>> from skbio import TreeNode
>>> tree = TreeNode.read(StringIO("((a,b)c,(d,e)f)root;"))
>>> tree_copy = tree.copy()
>>> tree_nodes = set([id(n) for n in tree.traverse()])
>>> tree_copy_nodes = set([id(n) for n in tree_copy.traverse()])
>>> print(len(tree_nodes.intersection(tree_copy_nodes)))
0