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
inspect.getclasstree() will create a nested list of classes and their bases. Usage:
inspect.getclasstree()
inspect.getclasstree(inspect.getmro(IOError)) # Insert your Class instead of IOError.