treelib icon indicating copy to clipboard operation
treelib copied to clipboard

Documentation says method name is `tree.all_nodes_iter()`, but it is actually `itr` without an `e`

Open GalacticStarfish opened this issue 7 years ago • 0 comments

The documentation says the tree class has a method named tree.all_nodes_iter(), but the method name is actually itr without an e

http://treelib.readthedocs.io/en/latest/pyapi.html#tree-objects http://treelib.readthedocs.io/en/latest/pyapi.html#tree.all_nodes_iter

Attempts to call all_nodes_iter() raise AttributeError Recommend creating an alias so that Tree.all_nodes_iter and Tree.all_nodes_itr are references to the same function object.

Inside the tree class just write all_nodes_itr = all_nodes_iter

An alias is a better solution than correcting the documentation, because -- I assure you -- users will sometimes type "iter," out of habit, instead of writing "itr." You can prevent alot of interpreter errors from occurring by making an alias.

GalacticStarfish avatar Apr 21 '18 20:04 GalacticStarfish