[lxml-dev] should lxml.html have the same API as lxml.etree?

Stefan Behnel stefan_ml at behnel.de
Mon Mar 10 11:27:47 CET 2008


Hi Ian,

Ian Bicking wrote:
> I think they 
> haven't tested the code much with lxml 2, so basically they haven't 
> exercised the first case... though looking at the code some I'm not sure 
> it works with the second case either

I guess you are referring to fromstring()? There /is/ a fromstring() in etree,
which does the same as XML(). The reasoning is that for XML literals it reads
well to write

    XML("< ... >")

while when parsing from a string variable, it's more readable to write

    fromstring(some_content)

Stefan



More information about the lxml-dev mailing list