-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
gh-93607: document root
attribute of iterparse
#99410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-93607: document root
attribute of iterparse
#99410
Conversation
d72e468
to
ff6423a
Compare
ff6423a
to
7a568ff
Compare
Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm no expert on this, but looks right and testing shows the same:
>>> f = io.StringIO('<data><to></to></data>')
>>> iter1 = iterparse(f)
>>> iter1.root
>>> [_ for _ in iter1]
[('end', <Element 'to' at 0x000001EF004B75B0>), ('end', <Element 'data' at 0x000001EF004B7560>)]
>>> iter1.root
<Element 'data' at 0x000001EF004B7560>
It can be note that
or
Both variants have weird wording in my opinion, but I couldn't think of a more acceptable one; suggestions are welcome. Maybe such clarification is not necessary at all. |
Perhaps
I think it may be fine to omit the mention of |
I think your variant is acceptable. Committed variant
states (imho) that attribute is added only at the end of parsing. This not correct. Variant
does not hold information when attribute is added, but still notes when this attribute has a valid reference. Therefore, it is fine. |
Thanks @Prometheus3375 for the PR, and @hugovk for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12. |
) (cherry picked from commit 5cc6c80) 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>
) (cherry picked from commit 5cc6c80) 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>
GH-111555 is a backport of this pull request to the 3.12 branch. |
GH-111556 is a backport of this pull request to the 3.11 branch. |
…111556) 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>
…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>
Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com> Co-authored-by: Hugo van Kemenade <hugovk@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>
Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com> Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Issue #93607
root
attribute ofxml.etree.ElementTree.iterparse
is not documented #93607