Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #4272

Re: Composition instead of inheritance

From Ben Finney <ben+python@benfinney.id.au>
Newsgroups comp.lang.python
Subject Re: Composition instead of inheritance
References <mailman.946.1304010200.9059.python-list@python.org>
Date 2011-04-29 07:38 +1000
Message-ID <8762pykqdr.fsf@benfinney.id.au> (permalink)
Organization Unlimited download news at news.astraweb.com

Show all headers | View raw


Ethan Furman <ethan@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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Composition instead of inheritance Ethan Furman <ethan@stoneleaf.us> - 2011-04-28 10:15 -0700
  Re: Composition instead of inheritance Ben Finney <ben+python@benfinney.id.au> - 2011-04-29 07:38 +1000
  Re: Composition instead of inheritance Alan Meyer <ameyer2@yahoo.com> - 2011-05-02 13:30 -0400

csiph-web