caesar0301 / treelib

An efficient implementation of tree data structure in python 2/3.
http://treelib.readthedocs.io/en/latest/
Other
801 stars 185 forks source link

problem of method `subtree` #168

Closed Freakwill closed 2 years ago

Freakwill commented 3 years ago

I subclass Tree as DecisionTree. Any Node has its own attrs different with others. If I get a subtree with method subtree, I would loose the attrs. Overriding _clone is inconvenient for this case, it only clones the attrs of the original tree, and you have to redefine the attrs of the subtree manually. Why not just clone the node, the root of the subtree, at least copy its attrs?

It is not a serious issue. I would be glad that you could consider it.