Closed rotu closed 4 years ago
Thanks for reporting this. Based on the referenced documentation wouldn't it be sufficient to replace the following line:
with:
children = list(root)
Yes, it would. I find this way is more idiomatic and it removes the repetition of "children[0]
". You can think of it as children = list(root); testing = children[0]
.
I rather keep the diff minimal (7922b617655884ae9538b68291e6eebf863d8d86) and the code more readable (compared to the proposed implicit conversion in [testing] = root
). I also don't think the repetition of children[0]
is worth introducing another variable.
As per docs:
https://docs.python.org/3.8/library/xml.etree.elementtree.html#xml.etree.ElementTree.Element.getchildren