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
base: main
Are you sure you want to change the base?
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>
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. |


Issue #93607
rootattribute ofxml.etree.ElementTree.iterparseis not documented #93607