Needed: Real-world examples for Python's Cooperative Multiple Inheritance

Gregory Ewing greg.ewing at canterbury.ac.nz
Mon Nov 29 17:27:38 EST 2010


Paul Rubin wrote:

> The classic example though is a window system, where you have a "window"
> class, and a "scroll bar" class, and a "drop-down menu" class, etc. and
> if you want a window with a scroll bar and a drop-down menu, you inherit
> from all three of those classes.

Not in any GUI library I've ever seen. Normally there would
be three objects involved in such an arrangement, a Window,
a ScrollBar and a DropDownMenu, connected to each other in
some way.

-- 
Greg



More information about the Python-list mailing list