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.
I subclass Tree as DecisionTree. Any
Node
has its own attrs different with others. If I get a subtree with methodsubtree
, 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.