def conforms(classes):
    """A class decorator factory for validating against an ABC."""
    def decorator(cls):
        if not __debug__:
            return cls
        if not isinstance(cls, type):
            raise TypeError("Can only validate classes")
        validate(cls, classes)
        return cls
    return decorator
A class decorator factory for validating against an ABC.
recipes/Python/577711_Validating_classes_objects_against_Abstract/recipe-577711.py