multiple inheritance in Python?

Alex cut_me_out at hotmail.com
Sun Jul 2 21:19:51 EDT 2000


> Does anyone have example of implement multiple inheritance in Python?

What sort of example are you looking for?  The basic syntax is pretty
straightforward, as I understand it.

>>> class A:
    t = 1

... ... >>> 
>>> class B:
    s = 2
... ... 
>>> class C(A, B):
    pass
... ... 
>>> C.t
1
>>> C.s
2
>>> 

C would also inherit methods from A and B, if they had any.

Alex.



More information about the Python-list mailing list