Given a class Foo (whether it is a new-style class or not), how do you generate all the base classes - anywhere in the inheritance hierarchy -
Foo
In python 3.7 you don't need to import inspect, type.mro will give you the result.
>>> class A: ... pass ... >>> class B(A): ... pass ... >>> type.mro(B) [, , ] >>>
attention that in python 3.x every class inherits from base object class.