| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
It was said that iterparse() can be useful for reading a large document without holding it wholly in memory, but the tree is only built incrementally, it is not freed incrementally. Document how to remove the processed elements, and that a custom target does not build a tree at all.
Documentation build overview1 file changed ± library/xml.etree.elementtree.html |
Sorry, something went wrong.
|
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15. |
Sorry, something went wrong.
|
GH-157419 is a backport of this pull request to the 3.15 branch. |
Sorry, something went wrong.
|
GH-157420 is a backport of this pull request to the 3.14 branch. |
Sorry, something went wrong.
|
GH-157421 is a backport of this pull request to the 3.13 branch. |
Sorry, something went wrong.
…GH-156763) (GH-157420) It was said that iterparse() can be useful for reading a large document without holding it wholly in memory, but the tree is only built incrementally, it is not freed incrementally. Document how to remove the processed elements, and that a custom target does not build a tree at all. (cherry picked from commit e7a3937) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
…GH-156763) (GH-157421) It was said that iterparse() can be useful for reading a large document without holding it wholly in memory, but the tree is only built incrementally, it is not freed incrementally. Document how to remove the processed elements, and that a custom target does not build a tree at all. (cherry picked from commit e7a3937) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
…ythonGH-156763) It was said that iterparse() can be useful for reading a large document without holding it wholly in memory, but the tree is only built incrementally, it is not freed incrementally. Document how to remove the processed elements, and that a custom target does not build a tree at all.
…GH-156763) (#157419) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
| Back | FazBrowse Home | New Git URL |
The documentation said that iterparse() "can be useful when you're reading a large XML document and don't want to hold it wholly in memory", but the tree is only built incrementally, it is not freed incrementally: every parsed element is kept until the whole document is read.
The claim is replaced with an explanation and two examples for common cases: clearing large processed elements, and removing the processed children of an element with many of them. Both are in the "Pull API for non-blocking parsing" section, because this applies to XMLPullParser as well.
They are not universal, they only give an idea; the note ends with the way to avoid the tree entirely, an XMLParser with a custom target.