Nemeskey Dávid added the comment:

OK, then this issue has a "bug" part, too: it is not mentioned in the 
documentation that exceptions from the handler methods propagate through the 
Parse() method. I guess the parser can be then stopped in this way too, but it 
is a dirty method as opposed to calling StopParser().

To answer your question, there are several situations where StopParser() could 
come in handy. For instance, the XML file might contain records (such as the 
output of a search engine), from which we only need the first n. Another 
example would be that reading through the file we realize halfway that e.g. it 
does not contain the information we need, contains wrong information, etc. so 
we want to skip the rest of it. Since the file might be huge and since XML 
parsing can in now way be considered fast, being able to stop the parsing in a 
clear way would spare the superfluous and possible lengthy computation.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue15775>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to