[lxml-dev] Checking whether a node is a comment/element

Geoffrey Sneddon foolistbar at googlemail.com
Fri Jul 18 20:44:09 CEST 2008


Hi,

What's the best way to check whether a given node is a comment or an  
element? For the former, I'm currently using isinstance(node,  
etree._Comment), which is rather obviously sub-optimal.


--
Geoffrey Sneddon
<http://gsnedders.com/>



More information about the lxml-dev mailing list