def vars_class ( cls ) : return dict ( chain . from_iterable ( vars ( cls ) . items ( ) for cls in reversed ( cls . __mro__ ) ) )
get attributes of all ancestors python
Return a dict of vars for the given class including all ancestors .
def vars_class(cls):
    """Return a dict of vars for the given class, including all ancestors.

    This differs from the usual behaviour of `vars` which returns attributes
    belonging to the given class and not its ancestors.
    """
    return dict(chain.from_iterable(
        vars(cls).items() for cls in reversed(cls.__mro__)))