'Return a rudimental \'affinity\' value expressing the general class
of type.'

@util.memoized_property
def _type_affinity(self):

    typ = None
    for t in self.__class__.__mro__:
        if (t in (TypeEngine, UserDefinedType)):
            return typ
        elif issubclass(t, (TypeEngine, UserDefinedType)):
            typ = t
    else:
        return self.__class__
