What is the difference between getiterator () and iter () relative to lxml

As the question says, what is the difference between:

x.getiterator()and x.iter(), where xis the ElementTree element or element? Because it works for both, I tried.

If I'm wrong somewhere, please correct me.

+3
source share
2 answers

getiterator- standard spelling ElementTreefor this method; iteris the lxml-only equivalent method , which will stop your code from working in ElementTreeif you need it, and it seems to have no redeeming qualities other than saving you from entering another 7 characters for the method name;).

0
source

Python ElementTree , getiterator() , 2.7, Element.iter(). API lxml , , getiterator() lxml ElementTree.

, , " , tree.iter()". "", , getiterator() iter(), 100% .

, - , , , .

+6

Source: https://habr.com/ru/post/1750838/


All Articles