Issue 28314: ElementTree: Element.getiterator(tag ... - Python
https://bugs.python.org/issue28314The documentation says that getiterator() still accepts a tag argument, but it does not: >>> from xml.etree.ElementTree import Element >>> el = Element('foo') >>> el.getiterator('bar') Traceback (most recent call last): File "<stdin>", line 1, in <module> SystemError: ../Python/getargs.c:1508: bad argument to internal function >>> el.getiterator(tag='bar') Traceback (most recent call last ...
Python Iterators - W3Schools
www.w3schools.com › python › python_iteratorsTo create an object/class as an iterator you have to implement the methods __iter__ () and __next__ () to your object. As you have learned in the Python Classes/Objects chapter, all classes have a function called __init__ (), which allows you to do some initializing when the object is being created. The __iter__ () method acts similar, you can do operations (initializing etc.), but must always return the iterator object itself.