Tres Seaver tseaver at
Thu Feb 17 13:15:01 EST 2000

In article <Pine.GSO.4.21.0002171227410.16470-100000 at>,
Joshua C. Marshall <jayantha at> wrote:
>Given a class object, is there a way to get at its superclass object?  I'm
>looking for something like:
>  class A: pass
>  class B(A): pass
>  B.__superclass__ == A  # where this is true
>Please CC jayantha at

Nowhere, but try:

  >>> B.__bases__
  (<class __main__.A at 7f57d0>,)

Note that Python classes can have multiple superclasses.

  >>> class C: pass
  >>> class D( B, C ): pass
  >>> D.__bases__
  (<class __main__.B at 7f5630>, <class __main__.C at 7f5bf0>)


Tres Seaver           tseaver at       713-523-6582
Palladion Software

More information about the Python-list mailing list