summaryrefslogtreecommitdiffstats
path: root/Lib/xml
diff options
context:
space:
mode:
authorAndrew M. Kuchling <amk@amk.ca>2002-03-20 23:56:34 (GMT)
committerAndrew M. Kuchling <amk@amk.ca>2002-03-20 23:56:34 (GMT)
commitbdf1f19feeda0953d30447d7ee4adbbf78a89d8b (patch)
tree66988daeb9c598ff8fd62dd824df12dce2a64c56 /Lib/xml
parent3afb2d2bba9d492c1f2c889954bc0d32d93955ab (diff)
downloadcpython-bdf1f19feeda0953d30447d7ee4adbbf78a89d8b.zip
cpython-bdf1f19feeda0953d30447d7ee4adbbf78a89d8b.tar.gz
cpython-bdf1f19feeda0953d30447d7ee4adbbf78a89d8b.tar.bz2
[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)
Diffstat (limited to 'Lib/xml')
-rw-r--r--Lib/xml/dom/pulldom.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/xml/dom/pulldom.py b/Lib/xml/dom/pulldom.py
index adc978e..255689c 100644
--- a/Lib/xml/dom/pulldom.py
+++ b/Lib/xml/dom/pulldom.py
@@ -227,6 +227,15 @@ class DOMEventStream:
return rc
raise IndexError
+ def next(self):
+ rc = self.getEvent()
+ if rc:
+ return rc
+ raise StopIteration
+
+ def __iter__(self):
+ return self
+
def expandNode(self, node):
event = self.getEvent()
parents = [node]