def _getBaseAttr(instance, klass, attr_name):
    """ traverses the base classes of the 'instance' object; returns the
        first class attribute 'attr_name' in a base class that is AFTER
        'klass' in the base class hierarchy.  useful for determining
        which superclass method to call from a mix-in class. """
    bases = instance.__class__.__bases__
    past = 0
    for base in bases:
        if past:
            if hasattr(base, attr_name):
                return getattr(base, attr_name)
        if base == klass:
            past = 1
    return None
