"Steven D'Aprano" <[EMAIL PROTECTED]> wrote:
> I've just found this:
>
> [quote]
> A mixin class is a parent class that is inherited from - but not as
> a means of specialization. Typically, the mixin will export services to a
> child class, but no semantics will be implied about the child "being
>So mixins are just a sub-class [pun intended] of sub-classing?
>
>I've just found this:
>
>[quote]
>A mixin class is a parent class that is inherited from - but not as
>a means of specialization. Typically, the mixin will export services to a
>child class, but no semantics will be implied about t
Paul Rubin wrote:
> Yeah, I wonder though how much of that is a result of Python's
> cavalier approach to multiple inheritance. Does that happen much in
> CLOS? In Java because of multiple interfaces? I've studied Flavors a
> little and mix-ins were used in some extensive ways, but maybe
> progr
Steven D'Aprano <[EMAIL PROTECTED]> writes:
> On Thu, 06 Oct 2005 21:03:33 -0700, barnesc wrote:
>> I added some recipes to the Python Cookbook:
>>
>> - listmixin
>>
>>Use ListMixin to create custom list classes from a small subset of
>>list methods:
>>
>>http://aspn.activestate.com
On Fri, 07 Oct 2005 05:11:00 -0700, Michele Simionato wrote:
> Well, suppose you have a class MyObject and you want to add to it some
> methods to make its instances into a database. You could put these
> methods into another class called Storable (the mixin class).
> Then you can mix MyObject wit
"Michele Simionato" <[EMAIL PROTECTED]> writes:
> Once in a time, I thought mixins where a good idea; now I don't think
> so since they are too easily abused (see Zope 2) and as a consequence
> you get spaghetti-inheritance, where you have objects with methods
> inherited from everywhere. So be ver
Steven D'Aprano <[EMAIL PROTECTED]> writes:
> That looks great. Now, if only I understood mixins: what are they, and
> what they are for, and in particular, how they differ from mere
> subclassing.
I'm not sure what you mean by "mere subclassing" so maybe there is no
difference. Mixins are sort o
Well, suppose you have a class MyObject and you want to add to it some
methods to make its instances into a database. You could put these
methods into another class called Storable (the mixin class).
Then you can mix MyObject with Storable and get what you want,
a class StorableObject inheriting bo
On Thu, 06 Oct 2005 21:03:33 -0700, barnesc wrote:
> I added some recipes to the Python Cookbook:
>
> - listmixin
>
>Use ListMixin to create custom list classes from a small subset of
>list methods:
>
>http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440656
That looks great
I added some recipes to the Python Cookbook:
- listmixin
Use ListMixin to create custom list classes from a small subset of
list methods:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440656
- pytime
Improves on timeit by allowing you to time a function directly
(no
10 matches
Mail list logo