Finding Which Superclass Provides a Method

Here's a quick hack to help when you're lost in a too-large Python inheritance tree. What class provides the most specific implementation of a method or attribute?

def find(cls, name):
    for sup in cls.mro():
        if name in sup.__dict__:
            return sup.__name__
    return None

def find_all_vars ...
more ...