Finding a class' superclasses

Hallvard B Furuseth h.b.furuseth at usit.uio.no
Mon Aug 23 14:09:52 EDT 2004


How do I find a class' immediate superclasses?
That is, given
  class A:       pass
  class B(A):    pass
  class C(A):    pass
  class D(B, C): pass
I want a function foo where foo(D) or foo(D()) returns (B, C).
(Well, the order of the classes is not important.)

-- 
Hallvard



More information about the Python-list mailing list