From: Andrew M. Kuchling Date: Wed, 20 Mar 2002 23:56:34 +0000 (+0000) Subject: [Apply patch #500457 from the PyXML tracker] X-Git-Tag: v2.3c1~6426 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bdf1f19feeda0953d30447d7ee4adbbf78a89d8b;p=python [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) --- diff --git a/Lib/xml/dom/pulldom.py b/Lib/xml/dom/pulldom.py index adc978e9a9..255689c488 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]