Le 16/12/2011 07:53, Stefan Behnel a écrit : > Additionally, the documentation on the xml.sax page would benefit from > the following paragraph: > > """ > [[Note: The xml.sax package provides an implementation of the SAX > interface whose API is similar to that in other programming languages. > Users who are unfamiliar with the SAX interface or who would like to > write less code for efficient stream processing of XML files should > consider using the iterparse() function in the xml.etree.ElementTree > module instead.]] > """ >
A small caveat to note about iterparse(), which I otherwise like a lot: when processing very big data (I encountered this with a region-wide openstreetmap XML dump), you have to remove the processed nodes from the root element. Otherwise, its memory footprint increases with the size of the document. _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com