Proposal: Add new method to `HTMLParser`: `flush(self) -> str: ...`
Discussions on Python.org
Proposal: Add new method to `HTMLParser`: `flush(self) -> str: ...`
I’d like to propose adding a method named flushto HTMLParserwhich flushes any buffered unparsed data so that all complete elements are processed and then returns the remaining unprocessed data, a str, to the caller. Before closing an HTMLParserI would like to be able to make inferences about the remaining unprocessed input data before it is “forced” to be processed upon reaching end of file. These inferences primarily involve providing helpful messages when it appears that the input was not co...
0 comments
No comments yet.