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 welcome
On Fri, Apr 29, 2011 at 5:54 PM, Carl Banks 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).
>
> In the real worl
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.)
Ian Kelly wrote:
On Thu, Apr 28, 2011 at 11:15 AM, 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-multi
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 mixin defines __init__, it should always accept self, *arg
Carl Banks wrote:
Here is my advice on mixins:
[snip]
Cool. Thanks!
~Ethan
--
http://mail.python.org/mailman/listinfo/python-list
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 peop
James Mills wrote:
On Fri, Apr 29, 2011 at 11:43 AM, Ethan Furman 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 th
Ben Finney wrote:
Ethan Furman 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 -
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-comp
On Thu, Apr 28, 2011 at 11:15 AM, 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/
Dan Stromberg writes:
> On Thu, Apr 28, 2011 at 3:35 PM, 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 n
On Thu, Apr 28, 2011 at 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.c
Steven D'Aprano 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 delegation. As in, when one object
Ethan Furman 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 ideas for
On Fri, Apr 29, 2011 at 11:43 AM, Ethan Furman 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 this is typical of
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.activesta
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 ide
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 descr
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-of-mult
Ethan Furman 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'
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
On Thu, Apr 28, 2011 at 11:15 AM, 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-inheri
23 matches
Mail list logo