[lxml-dev] Is it bug?

Stefan Behnel stefan_ml at behnel.de
Tue Jun 12 15:15:07 CEST 2007


Hi,

Alexander Kozlovsky wrote:
> I discover some counterintuitive behavior of 'tail' attribute:
> 
>     >>> from lxml import etree
>     >>> a = etree.XML('<a><b>text</b>tail</a>')
>     >>> b = a[0]
>     >>> print b.tail
>     tail
>     >>> a[:] = []
>     >>> print b.tail
>     None  #  EXPECTED: tail
> 
> I think, it is bug or at least worth note in documentation

Definitely looks like a bug to me. The tail should stay with the unlinked
element. Thanks for the report, I'll look into this.


> Thank you for the great library, anyway! :)

:)

Stefan


More information about the lxml-dev mailing list