(self, decompose=False)
Extract all children. If decompose is True, decompose instead.
Extract all children. If decompose is True, decompose instead.
Extract all children . If decompose is True decompose instead .
def clear(self, decompose=False):
        """
        Extract all children. If decompose is True, decompose instead.
        """
        if decompose:
            for element in self.contents[:]:
                if isinstance(element, Tag):
                    element.decompose()
                else:
                    element.extract()
        else:
            for element in self.contents[:]:
                element.extract()
def clear ( self , decompose = False ) : if decompose : for element in self . contents [ : ] : if isinstance ( element , Tag ) : element . decompose ( ) else : element . extract ( ) else : for element in self . contents [ : ] : element . extract ( )