def _get_subclasses(classname):
    """Recursively obtains all subclasses of the given class."""

    subclasses = []

    for p in classname.__subclasses__():
        subclasses.append(p)
        subclasses.extend(_get_subclasses(p))

    return subclasses