Skip to content

Commit

Permalink
pythongh-93607: document root attribute of iterparse (python#99410)
Browse files Browse the repository at this point in the history
Co-authored-by: Stanley <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
  • Loading branch information
3 people authored Oct 31, 2023
1 parent cf3dbe4 commit 5cc6c80
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Doc/library/xml.etree.elementtree.rst
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,9 @@ Functions
*parser* is an optional parser instance. If not given, the standard
:class:`XMLParser` parser is used. *parser* must be a subclass of
:class:`XMLParser` and can only use the default :class:`TreeBuilder` as a
target. Returns an :term:`iterator` providing ``(event, elem)`` pairs.
target. Returns an :term:`iterator` providing ``(event, elem)`` pairs;
it has a ``root`` attribute that references the root element of the
resulting XML tree once *source* is fully read.

Note that while :func:`iterparse` builds the tree incrementally, it issues
blocking reads on *source* (or the file it names). As such, it's unsuitable
Expand Down

0 comments on commit 5cc6c80

Please sign in to comment.