Skip to content

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

@slahn

Description

@slahn

_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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions