You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think Node.child should be named Node.first_child, as the access to the last child is named Node.last_child.
BTW, I am surprised that there is no children property.
The text was updated successfully, but these errors were encountered:
I agree about Node.child to be renamed in Node.first_child because I haven't seen any Node.childs or Node.children so I was expecting Node.child to do that. But it doesn't, it's only the first child and sometime the first child even doesn't work.
I was not expecting Node.iter() to act like what would be a Node.children. I was expecting Node.iter() to "Iterate over nodes on the current level" (what is written in the documentation) meaning I was expecting it to iterate over the rest of nodes that are on the same level than the node I am on, not children of the node.
Because of that I have tried to do Node.child.iter() to iterate over children and it was my last best guess until I found this report.
I think that :
the current behavior of Node.iter() should become a Node.children() (and say in the documentation that it "iterate over children of the current node", not saying Iterate "on the current level").
Node.child should be renamed Node.first_child and say that it "Return the first child node" instead of "Return the child node"
and bugs with using the two dedicated function instead of .iter() needs to be fixed : getting the first child and last child seems buggy when using those function when those child are in a separated line in the html than the start or end of the current node (see issue 114).
I think
Node.child
should be namedNode.first_child
, as the access to the last child is namedNode.last_child
.BTW, I am surprised that there is no
children
property.The text was updated successfully, but these errors were encountered: