def __init__(self, name, parent=RootTopic):
        # Validate name
        if not isinstance(name, basestring):
            message = 'name must be an instance of basestring, not {}'
            raise TypeError(message.format(type(name)))

        # Validate parent
        if parent != RootTopic and not isinstance(parent, Topic):
            message = 'parent must be an instance of Topic, not {}'
            raise TypeError(message.format(type(parent)))

        super(Topic, self).__init__()
        self._name = name
        self._parent = parent
dataset/ETHPy150Open foxdog-studios/pyddp/ddp/pubsub/topic.py/Topic.__init__/original