def __init__(self, obj): # {{{ if not isinstance(obj, tuple): obj = (obj,) for o in obj: if not isclass(o): raise TypeError("SubType objects can only initialize on class objects") def checker(o): # {{{ return isclass(o) and issubclass(o, obj) # End def #}}} super(SubType, self).__init__(checker)
def __transform__(self, obj): # {{{ if not isclass(obj): obj = obj.__class__ return obj
def __init__(self, obj): # {{{ if not isclass(obj): obj = obj.__class__ obj = tuple(o for o in mro(obj) if o is not object) super(ObjectType, self).__init__(obj)
def checker(o): # {{{ return isclass(o) and issubclass(o, obj)