summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2023-10-31 16:27:37 (GMT)
committerGitHub <noreply@github.com>2023-10-31 16:27:37 (GMT)
commit71e138d93e10fcbb0c0bc746e0eec6b254c73d58 (patch)
tree99f586e3cec2e12d6504bbc48d2f6c2200cf3370
parentc21387c6b22bc6b85cf7fa8fecc3f257f5d782c0 (diff)
downloadcpython-71e138d93e10fcbb0c0bc746e0eec6b254c73d58.zip
cpython-71e138d93e10fcbb0c0bc746e0eec6b254c73d58.tar.gz
cpython-71e138d93e10fcbb0c0bc746e0eec6b254c73d58.tar.bz2
[3.12] gh-93607: document `root` attribute of `iterparse` (GH-99410) (#111555)
Co-authored-by: Prometheus3375 <35541026+Prometheus3375@users.noreply.github.com> Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com> Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
-rw-r--r--Doc/library/xml.etree.elementtree.rst4
1 files changed, 3 insertions, 1 deletions
diff --git a/Doc/library/xml.etree.elementtree.rst b/Doc/library/xml.etree.elementtree.rst
index c9b3263..57cfbb8 100644
--- a/Doc/library/xml.etree.elementtree.rst
+++ b/Doc/library/xml.etree.elementtree.rst
@@ -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