__base__ and __bases__[0]

Michele Simionato mis6 at pitt.edu
Mon Apr 28 12:13:21 EDT 2003


I thought __base__ and __bases__[0] where just equivalent, but it
seems it is not so:

>>> class C(object): pass
...
>>> class M(C,type): pass
...
>>> M.__bases__[0]
<class '__main__.C'>
>>> M.__base__
<type 'type'>

Question: how __base__ is computed and what's the rationale about it ?

TIA,

                                           Michele




More information about the Python-list mailing list