George Sakkis wrote: >>>>z = Z() >>>>z.__class__.__mro__ > > (<class '__main__.Z'>, <class '__main__.Y1'>, <class '__main__.Y2'>, > <class '__main__.X'>, <type 'object'>) > > Old style classes don't have __mro__, so you have to write it yourself; > in any case, writing old style classes in new code is discouraged.
Notice also that George's __mro__ solution returns the bases in reverse order than what you requested (in your example, you said B should come last). So use list(reversed(z.__class__.__mro__)) or z.__class__.__mro__[::-1] -- Brian Beck Adventurer of the First Order -- http://mail.python.org/mailman/listinfo/python-list