MCPcopy Index your code
hub / github.com/clips/pattern / decompose

Method decompose

pattern/web/soup/BeautifulSoup.py:781–796  ·  view source on GitHub ↗

Recursively destroys the contents of this tree.

(self)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

lenFunction · 0.85
extractMethod · 0.80

Tested by

no test coverage detected