Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bdf1f19

Browse files
committed
[Apply patch #500457 from the PyXML tracker]
Add iterator support to pulldom.DOMEventStream New feature, so not a bugfix candidate (though it should be safe for inclusion)
1 parent 3afb2d2 commit bdf1f19

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

Lib/xml/dom/pulldom.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,15 @@ def __getitem__(self, pos):
227227
return rc
228228
raise IndexError
229229

230+
def next(self):
231+
rc = self.getEvent()
232+
if rc:
233+
return rc
234+
raise StopIteration
235+
236+
def __iter__(self):
237+
return self
238+
230239
def expandNode(self, node):
231240
event = self.getEvent()
232241
parents = [node]

0 commit comments

Comments
 (0)