Commits

Anonymous committed 922bd71

added remove_all method to remove all subelements without clearing attr (like clear method does)

  • Participants
  • Parent commits 1481eb8

Comments (0)

Files changed (1)

emeraldtree/tree.py

         self._children.remove(element)
 
     ##
+    # Removes all subelements.
+
+    def remove_all(self):
+        self._children = []
+
+    ##
     # Finds the first matching subelement, by tag name or path.
     #
     # @param path What element to look for.
 
     def clear(self):
         self.attrib.clear()
-        self._children = []
+        self.remove_all()
 
     ##
     # Gets an element attribute.