From: Eli Bendersky Date: Fri, 16 Mar 2012 06:41:30 +0000 (+0200) Subject: Issue #9257: clarify the events iterparse accepts X-Git-Tag: v3.3.0a2~160^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=604c4ff43de7246c5103ec7b9f581a819da70b33;p=python Issue #9257: clarify the events iterparse accepts --- diff --git a/Doc/library/xml.etree.elementtree.rst b/Doc/library/xml.etree.elementtree.rst index a46d99d969..c5c880290c 100644 --- a/Doc/library/xml.etree.elementtree.rst +++ b/Doc/library/xml.etree.elementtree.rst @@ -95,11 +95,14 @@ Functions .. function:: iterparse(source, events=None, parser=None) Parses an XML section into an element tree incrementally, and reports what's - going on to the user. *source* is a filename or :term:`file object` containing - XML data. *events* is a list of events to report back. If omitted, only "end" - events are reported. *parser* is an optional parser instance. If not - given, the standard :class:`XMLParser` parser is used. Returns an - :term:`iterator` providing ``(event, elem)`` pairs. + going on to the user. *source* is a filename or :term:`file object` + containing XML data. *events* is a list of events to report back. The + supported events are the strings ``"start"``, ``"end"``, ``"start-ns"`` + and ``"end-ns"`` (the "ns" events are used to get detailed namespace + information). If *events* is omitted, only ``"end"`` events are reported. + *parser* is an optional parser instance. If not given, the standard + :class:`XMLParser` parser is used. Returns an :term:`iterator` providing + ``(event, elem)`` pairs. .. note::