Composition instead of inheritance

Ben Finney ben+python at benfinney.id.au
Thu Apr 28 23:38:56 CEST 2011


Ethan Furman <ethan at stoneleaf.us> 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):
>
> http://code.activestate.com/recipes/577658-composition-of-classes-instead-of-multiple-inherit/
>
> 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__)                                             http://kuro5hin.org/ |
Ben Finney



More information about the Python-list mailing list