Python - Class __bases__ attribute

Introduction

Classes have a __bases__ attribute, which is a tuple of references to their superclass objects.

Demo

class rec: pass              # Empty namespace object 
rec.name = 'Bob'             # Just objects with attributes 
rec.age  = 40 # from  w ww.  j  a va 2 s . co m

d = rec.__bases__            # Class to superclasses link, () in 2.X 
print( d )

Result

Related Topic