Exemple #1
0
    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)
Exemple #2
0
 def __transform__(self, obj):  # {{{
     if not isclass(obj):
         obj = obj.__class__
     return obj
Exemple #3
0
 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)
Exemple #4
0
 def checker(o):  # {{{
     return isclass(o) and issubclass(o, obj)