'Returns subclass of Repl of given type eq. SubprocessRepl'

@classmethod
def subclass(cls, type):

    todo = [cls]
    seen = set()
    while True:
        if (not todo):
            raise NoReplError
        cur = todo.pop()
        if (cur in seen):
            continue
        if (cur.TYPE == type):
            return cur
        todo.extend(cur.__subclasses__())
