Message169913
| Author |
loewis |
| Recipients |
amaury.forgeotdarc, docs@python, loewis, nemeskeyd |
| Date |
2012年09月06日.11:26:28 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1346930789.95.0.816868694586.issue15775@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Dávid: Another (similar) example is the Python for loop. In it's original form, it would increase an index and invoke __getitem__ until that *raised* IndexError. In the current definition, it converts the iterated-over object into an iterator, and keeps calling .next until that *raises* StopIteration.
So raising an exception to indicate that something is finished is an established Python idiom.
In any case, I still think adding StopParser is a useful addition, in particular since that would also allow giving True as the "resumable" argument. Any such change needs to be accompanied by also exposing XML_ResumeParser, and possibly XML_GetParsingStatus.
Since we all agree that this is not an important change, I don't mind keeping this issue around until someone comes along to contribute code for it. |
|