[Python-Dev] please back out changeset f903cf864191 before alpha-2 (original) (raw)
Antoine Pitrou solipsis at pitrou.net
Mon Aug 26 14:51:59 CEST 2013
- Previous message: [Python-Dev] please back out changeset f903cf864191 before alpha-2
- Next message: [Python-Dev] please back out changeset f903cf864191 before alpha-2
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Le Mon, 26 Aug 2013 08:24:58 -0400, Tres Seaver <tseaver at palladion.com> a écrit :
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 08/26/2013 04:36 AM, Antoine Pitrou wrote: > event-driven processing using network librarie Maybe I missed something: why should considerations from that topic influence the design of an API for XML processing?
Because this API is mostly useful when the data is received (*) at a slow enough speed - which usually means from the network, not from a hard drive.
((*) "data" ... "received"; does it ring a bell? ;-))
If you want iterative processing from a fast data source, you can already use iterparse(): it's blocking, but it's not a problem with disk I/O (not to mention that non-blocking disk I/O doesn't really exist under Linux, AFAIK: I haven't been able to get EAGAIN with os.read() on a non-blocking file, even when reading from a huge uncached file).
The whole point of adding IncrementalParser was to parse incoming XML data in a way that is friendly with event-driven network programming, other use cases being already covered by existing APIs. This is why it's far from nonsensical to re-use an existing terminology from that world.
If you don't do any non-blocking network I/O, then fine - you won't even need the API, and can safely ignore its existence.
- Previous message: [Python-Dev] please back out changeset f903cf864191 before alpha-2
- Next message: [Python-Dev] please back out changeset f903cf864191 before alpha-2
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]