ElementTree should parse string and file in the same way

Steven D'Aprano steve at REMOVE-THIS-cybersource.com.au
Mon Dec 31 22:02:24 EST 2007


On Tue, 01 Jan 2008 01:53:47 +0000, Peter Pei wrote:

> You are talking shit. It is never about whether it is hard to write a
> wrapper. It is about bad design. I should be able to parse a string and
> a file in exactly same way, and that should be provided as part of the
> package.

Oh my, somebody decided to start the new year with all guns blazing.

Before abusing anyone else, have you considered asking *why* ElementTree 
does not treat files and strings the same way? I believe the writer of 
ElementTree, Fredrik Lundh, frequents this newsgroup.

It may be that Fredrik doesn't agree with you that you should be able to 
parse a string and a file the same way, in which case there's nothing you 
can do but work around it. On the other hand, perhaps he just hasn't had 
a chance to implement that functionality, and would welcome a patch.

Fredrik, if you're reading this, I'm curious what your reason is. I don't 
have an opinion on whether you should or shouldn't treat files and 
strings the same way. Over to you...



-- 
Steven



More information about the Python-list mailing list