MCPcopy Index your code
hub / github.com/csev/py4e / decompose

Method decompose

code/BeautifulSoup.py:776–791  ·  view source on GitHub ↗

Recursively destroys the contents of this tree.

(self)

Source from the content-addressed store, hash-verified

774 return s
775
776 def decompose(self):
777 """Recursively destroys the contents of this tree."""
778 self.extract()
779 if len(self.contents) == 0:
780 return
781 current = self.contents[0]
782 while current is not None:
783 next = current.next
784 if isinstance(current, Tag):
785 del current.contents[:]
786 current.parent = None
787 current.previous = None
788 current.previousSibling = None
789 current.next = None
790 current.nextSibling = None
791 current = next
792
793 def prettify(self, encoding=DEFAULT_OUTPUT_ENCODING):
794 return self.__str__(encoding, True)

Callers

nothing calls this directly

Calls 1

extractMethod · 0.45

Tested by

no test coverage detected