(self, topicsMap: MutableMapping[str, Topic])
Unsubscribe all our listeners, remove all subtopics from self,
        then detach from parent. Parent is not notified, because method
        assumes it has been called by parent
Unsubscribe all our listeners, remove all subtopics from self,
        then detach from parent. Parent is not notified, because method
        assumes it has been called by parent
Unsubscribe all our listeners remove all subtopics from self then detach from parent . Parent is not notified because method assumes it has been called by parent
def __undefineBranch(self, topicsMap: MutableMapping[str, Topic]):
        """
        Unsubscribe all our listeners, remove all subtopics from self,
        then detach from parent. Parent is not notified, because method
        assumes it has been called by parent
        """
        # print 'Remove %s listeners (%s)' % (self.getName(), self.getNumListeners())
        self.unsubscribeAllListeners()
        self.__parentTopic = None

        for subName, subObj in self.__subTopics.items():
            assert isinstance(subObj, Topic)
            # print 'Unlinking %s from parent' % subObj.getName()
            subObj.__undefineBranch(topicsMap)

        self.__subTopics = {}
        del topicsMap[self.getName()]
def __undefineBranch ( self , topicsMap : MutableMapping [ str , Topic ] ) : # print 'Remove %s listeners (%s)' % (self.getName(), self.getNumListeners()) self . unsubscribeAllListeners ( ) self . __parentTopic = None for subName , subObj in self . __subTopics . items ( ) : assert isinstance ( subObj , Topic ) # print 'Unlinking %s from parent' % subObj.getName() subObj . __undefineBranch ( topicsMap ) self . __subTopics = { } del topicsMap [ self . getName ( ) ]