#!/usr/local/bin/python2 from itertools import chain, starmap from operator import attrgetter get_mro = attrgetter('__mro__') class A(object): pass class B(A): pass class C(object): pass class D(C): pass class E(B, D): pass print E.__bases__ for base in (base.__mro__ for base in E.__bases__): print base