def get_subclasses(classes, level=0):
    """Return the list of all subclasses given class (or list of classes) has.

    Also see https://stackoverflow.com/q/3862310/84349.
    """
    if not isinstance(classes, list):
        classes = [classes]

    if level < len(classes):
        classes += classes[level].__subclasses__()
        return get_subclasses(classes, level + 1)
    else:
        return classes