[Python-ideas] ElementTree iterparse string
Antoine Pitrou
solipsis at pitrou.net
Wed Aug 7 08:04:23 CEST 2013
On Tue, 06 Aug 2013 20:52:15 -0500
Ryan <rymg19 at gmail.com> wrote:
> ElementTree iterparse only works with file names or file objects. What if there was an iterparse for strings? Like iterparsestring or iterfromstring or iterstring, etc. Even though the string is stored in memory, storing the entire tree along with the string is a major minus, especially since a string takes less memory than an ElementTree instance or a root element.
Take a look at IncrementalParser:
http://docs.python.org/dev/library/xml.etree.elementtree.html#incremental-parsing
Regards
Antoine.
More information about the Python-ideas
mailing list