クラスの__bases__属性は そのクラスの親クラスをタプルで返します:

$ ipython
Python 3.8.0 (default, Dec  4 2019, 10:58:43)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.10.1 -- An enhanced Interactive Python. Type '?' for help.

In [1]: class A1: ...

In [2]: class A2: ...

In [3]: class A(A1, A2): ...

In [4]: A.__bases__
Out[4]: (__main__.A1, __main__.A2)

これを使うと クラスの親クラス一覧を取得する関数を作ることができます:

#!/usr/bin/env python
# -*- coding: utf-8 -*-

from typing import Optional


def inherits(cls: Optional[type]) -> Optional[dict]:
    if cls is None:
        return None
    return {base: inherits(base) for base in cls.__bases__}


class Base:
    ...


class A11(Base):
    ...


class A12(Base):
    ...


class A21(A12, A11):
    ...


if __name__ == '__main__':
    print(inherits(A21))
    # Outputs:
    # {<class '__main__.A12'>: {<class '__main__.Base'>: {<class 'object'>: {}}}, <class '__main__.A11'>: {<class '__main__.Base'>: {<class 'object'>: {}}}}
graph TD object --> Base Base --> A11 Base --> A12 A11 --> A21 A12 --> A21