On 4/28/2011 1:15 PM, Ethan Furman wrote:
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
Ben Finney wrote:
Ethan Furman et...@stoneleaf.us writes:
Carl Banks wrote:
That's not what we mean by composition. Composition is when one
object calls upon another object that it owns to implement some of
its behavior. Often used to model a part/whole relationship, hence
the name.
James Mills wrote:
On Fri, Apr 29, 2011 at 11:43 AM, Ethan Furman et...@stoneleaf.us wrote:
Hmmm. Okay -- any ideas for a better term? Something that describes taking
different source classes and fusing them into a new whole, possibly using
single-inheritance... Frankenstein, maybe? ;)
I'd
On Thursday, April 28, 2011 6:43:35 PM UTC-7, Ethan Furman wrote:
Carl Banks wrote:
The sorts of class that this decorator will work for are probably not
the ones that are going to have problems cooperating in the first place.
So you might as well just use inheritance; that way people
Carl Banks wrote:
Here is my advice on mixins:
[snip]
Cool. Thanks!
~Ethan
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, Apr 29, 2011 at 3:09 PM, Carl Banks pavlovevide...@gmail.com wrote:
Here is my advice on mixins:
Mixins should almost always be listed first in the bases. (The only
exception is to work around a technicality. Otherwise mixins go first.)
If a mixin defines __init__, it should
Ian Kelly wrote:
On Thu, Apr 28, 2011 at 11:15 AM, Ethan Furman et...@stoneleaf.us wrote:
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
On Friday, April 29, 2011 2:44:56 PM UTC-7, Ian wrote:
On Fri, Apr 29, 2011 at 3:09 PM, Carl Banks
wrote:
Here is my advice on mixins:
Mixins should almost always be listed first in the bases. (The only
exception is to work around a technicality. Otherwise mixins go first.)
If a
On Fri, Apr 29, 2011 at 5:54 PM, Carl Banks pavlovevide...@gmail.com wrote:
Really, *any* class that uses super().__init__ should take its
arguments and pass them along in this manner.
If you are programming defensively for any possible scenario, you might try
this (and you'd still fail).
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!
~Ethan~
--
http://mail.python.org
On Thu, Apr 28, 2011 at 11:15 AM, Ethan Furman et...@stoneleaf.us wrote:
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
Ethan Furman wrote:
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!
~Ethan~
Sounds
Ethan Furman et...@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
On Thursday, April 28, 2011 10:15:02 AM UTC-7, Ethan Furman wrote:
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
Carl Banks wrote:
That's not what we mean by composition. Composition is when one object
calls upon another object that it owns to implement some of its behavior.
Often used to model a part/whole relationship, hence the name.
Hmmm. Okay -- any ideas for a better term? Something that
On 29/04/2011 02:43, Ethan Furman wrote:
Carl Banks wrote:
That's not what we mean by composition. Composition is when one object
calls upon another object that it owns to implement some of its
behavior.
Often used to model a part/whole relationship, hence the name.
Hmmm. Okay -- any
On Thu, 28 Apr 2011 15:35:47 -0700, Carl Banks wrote:
On Thursday, April 28, 2011 10:15:02 AM UTC-7, Ethan Furman wrote:
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
On Fri, Apr 29, 2011 at 11:43 AM, Ethan Furman et...@stoneleaf.us wrote:
Hmmm. Okay -- any ideas for a better term? Something that describes taking
different source classes and fusing them into a new whole, possibly using
single-inheritance... Frankenstein, maybe? ;)
I'd have to say that
Ethan Furman et...@stoneleaf.us writes:
Carl Banks wrote:
That's not what we mean by composition. Composition is when one
object calls upon another object that it owns to implement some of
its behavior. Often used to model a part/whole relationship, hence
the name.
Hmmm. Okay -- any
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info writes:
On Thu, 28 Apr 2011 15:35:47 -0700, Carl Banks wrote:
That's not what we mean by composition. Composition is when one
object calls upon another object that it owns to implement some of
its behavior.
I thought that was
On Thu, Apr 28, 2011 at 3:35 PM, Carl Banks pavlovevide...@gmail.com wrote:
On Thursday, April 28, 2011 10:15:02 AM UTC-7, Ethan Furman wrote:
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
Dan Stromberg drsali...@gmail.com writes:
On Thu, Apr 28, 2011 at 3:35 PM, Carl Banks pavlovevide...@gmail.com wrote:
That's not what we mean by composition. Composition is when one
object calls upon another object that it owns to implement some of
its behavior. Often used to model a
On Thu, Apr 28, 2011 at 11:15 AM, Ethan Furman et...@stoneleaf.us wrote:
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
On 4/28/2011 3:35 PM, Carl Banks wrote:
On Thursday, April 28, 2011 10:15:02 AM UTC-7, Ethan Furman wrote:
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
24 matches
Mail list logo