Issue #9257: clarify the events iterparse accepts

This commit is contained in:
Eli Bendersky 2012-03-16 08:42:36 +02:00
commit 3405001491
1 changed files with 8 additions and 5 deletions

View File

@ -96,11 +96,14 @@ Functions
.. function:: iterparse(source, events=None, parser=None) .. function:: iterparse(source, events=None, parser=None)
Parses an XML section into an element tree incrementally, and reports what's 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 going on to the user. *source* is a filename or :term:`file object`
XML data. *events* is a list of events to report back. If omitted, only "end" containing XML data. *events* is a list of events to report back. The
events are reported. *parser* is an optional parser instance. If not supported events are the strings ``"start"``, ``"end"``, ``"start-ns"``
given, the standard :class:`XMLParser` parser is used. Returns an and ``"end-ns"`` (the "ns" events are used to get detailed namespace
:term:`iterator` providing ``(event, elem)`` pairs. 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:: .. note::