Composition instead of inheritance

Ben Finney ben+python at
Thu Apr 28 17:38:56 EDT 2011

Ethan Furman <ethan at> writes:

> For anybody interested in composition instead of multiple inheritance,
> I have posted this recipe on ActiveState (for python 2.6/7, not 3.x):
> Comments welcome!

It doesn't look like composition at all, though. I understand
composition to be the setting of attributes on a class or instance; that
recipe doesn't show it very well IMO.

 \     “[The RIAA] have the patience to keep stomping. They're playing |
  `\         whack-a-mole with an infinite supply of tokens.” —kennon, |
_o__)                                    |
Ben Finney

More information about the Python-list mailing list