summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-01-01 11:46:51 (GMT)
committerGeorg Brandl <georg@python.org>2009-01-01 11:46:51 (GMT)
commitfb222635866ced44125822482230a0cf24d0d132 (patch)
tree01f0234b098e88dbe77ba5eb48e34b1729042f07
parent6060d5e3fad5bb278b0516430cacf4b51536ecad (diff)
downloadcpython-fb222635866ced44125822482230a0cf24d0d132.zip
cpython-fb222635866ced44125822482230a0cf24d0d132.tar.gz
cpython-fb222635866ced44125822482230a0cf24d0d132.tar.bz2
#4100: note that element children are not necessarily present on "start" events.
-rw-r--r--Doc/library/xml.etree.elementtree.rst10
1 files changed, 10 insertions, 0 deletions
diff --git a/Doc/library/xml.etree.elementtree.rst b/Doc/library/xml.etree.elementtree.rst
index cdc774e..b17d510 100644
--- a/Doc/library/xml.etree.elementtree.rst
+++ b/Doc/library/xml.etree.elementtree.rst
@@ -94,6 +94,16 @@ Functions
*events* is a list of events to report back. If omitted, only "end" events are
reported. Returns an :term:`iterator` providing ``(event, elem)`` pairs.
+ .. note::
+
+ :func:`iterparse` only guarantees that it has seen the ">"
+ character of a starting tag when it emits a "start" event, so the
+ attributes are defined, but the contents of the text and tail attributes
+ are undefined at that point. The same applies to the element children;
+ they may or may not be present.
+
+ If you need a fully populated element, look for "end" events instead.
+
.. function:: parse(source[, parser])