lxml / lxml-stubs

Type stubs for the lxml package
Other
43 stars 29 forks source link

etree: Missing parameter `keep_tail` to `_Element.clear()` #92

Open slahn opened 1 year ago

slahn commented 1 year ago

_Element.clear() takes a boolean parameter named keep_tail.

This parameter does not exist in the stdlib ElementTree, but does exist in lxml.etree. See https://lxml.de/api/lxml.etree._Element-class.html#clear

The docstring for clear in lxml.etree reads

Resets an element.  This function removes all subelements, clears
all attributes and sets the text and tail properties to None.

Pass ``keep_tail=True`` to leave the tail text untouched.