anytree
anytree copied to clipboard
Implement and test AscendingIter
This iterator ascends from a starting node upwards toward the root of the tree. Iteration stops when it reaches the root. Somewhat different from the other iterators, as it will not iterate downward and/or over an entire subtree but seems to fit into the AbstractIter mold alright.
Updated tests and documentation. Hope this can be a useful addition.
Coverage decreased (-0.003%) to 99.758% when pulling 9630cdbc76852c887a5f0355902965b9a9c2335d on mmore500:mmore500-ascending-iter into d63289b65644c6e8c9c1d83d339c2c235d9ecc31 on c0fec0de:master.
Coverage decreased (-0.05%) to 99.706% when pulling 9630cdbc76852c887a5f0355902965b9a9c2335d on mmore500:mmore500-ascending-iter into d63289b65644c6e8c9c1d83d339c2c235d9ecc31 on c0fec0de:master.
Sorry to say. But this implementation is identical to https://anytree.readthedocs.io/en/latest/api/anytree.node.html#anytree.node.nodemixin.NodeMixin.iter_path_reverse
So i will not add this iterator, as it is redundant. Thanks for your efforts. Sorry.