multiple inheritance in Python?

Sam Wun swun at esec.com.au
Sun Jul 2 21:57:02 EDT 2000


Thanks.

Alex wrote:

> > 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.

--
Sam Wun                            Firewalls / Security
OneGuard Senior Software Engineer  Electronic Commerce
eSec Limited                       Phone: +61 3 83715376
mailto:swun at eSec.com.au            C++/JAVA/UNIX/OOP/OOD


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20000703/232dd1d9/attachment.html>


More information about the Python-list mailing list