Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
slahn opened this issue Oct 17, 2023 · 0 comments
Open

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

slahn opened this issue Oct 17, 2023 · 0 comments

Comments

@slahn
Copy link

slahn commented Oct 17, 2023

_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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant