Nick Coghlan added the comment:

Eli's summary left out an exchange between us that happened after he'd already 
written the summary - he pointed out the same problem with the EventParser name 
that you noticed: it's really an alternative XMLParser that exposes 
read_events(), rather than an event parser. So a completely different name like 
"EventScanner" or "EventStream" may be more appropriate. (I quite like 
EventStream, since it further suggests the destructive nature of read_events()).

As for why we think it's worth keeping this as a separate API, it's really 
about turning XMLParser's "push" API for events (where the events are pushed 
into the target object by the parser calling the appropriate methods), into an 
iterparse style pull API where the events can be retrieved via calls to 
read_events().

The back end implementation for the event streaming API *should* be a custom 
target object combined with a regular XMLParser object, but there are 
implementation issues currently preventing that.

We also discussed adding the event streaming interface directly to XMLParser, 
but I agreed with Eli that it's worth keeping that base API simple, especially 
since in the long run we want the new class to just be a convenience API for 
combining XMLParser and a custom target object, even if it can't be implemented 
that way right now.

----------

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

Reply via email to