(self)
Recursively destroys the contents of this tree.
Recursively destroys the contents of this tree.
Recursively destroys the contents of this tree .
def decompose(self):
        """Recursively destroys the contents of this tree."""
        self.extract()
        if len(self.contents) == 0:
            return
        current = self.contents[0]
        while current is not None:
            next = current.next
            if isinstance(current, Tag):
                del current.contents[:]
            current.parent = None
            current.previous = None
            current.previousSibling = None
            current.next = None
            current.nextSibling = None
            current = next
def decompose ( self ) : self . extract ( ) if len ( self . contents ) == 0 : return current = self . contents [ 0 ] while current is not None : next = current . next if isinstance ( current , Tag ) : del current . contents [ : ] current . parent = None current . previous = None current . previousSibling = None current . next = None current . nextSibling = None current = next