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

Ian Bicking ianb at colorstudy.com
Mon Mar 10 09:19:17 CET 2008


I've noticed in html5lib that they do (in html5lib.treebuilder.etree_lxml):

try:
     import lxml.html as etree
except ImportError:
     from lxml import etree

with the expectation that the two work the same way.  They don't work 
the same, specifically there's no etree.Comment.

Is it a reasonable expectation that they act the same?  (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)

   Ian


More information about the lxml-dev mailing list