[Tutor] 'Right' way to implement mixins in Python?

Alan Gauld alan.gauld at btinternet.com
Thu May 29 19:13:22 CEST 2008


"Kent Johnson" <kent37 at tds.net> wrote
>> Mixins should be as independant
>> as possible from any other classes. Unfortunately thats not
>> always possible so you should try to create an abstract
>> superclass/interface and use that in your mixins. You can then
>> subclass the mixin and replace the abstract class with the local
>> concrete manifestation. It means one extra level of inheritance 
>> because
>> you wind up with an abstract mixin plus the localised mixin.
>
> I don't understand what you mean by this.

Umm, no not my clearest prose ever is it! :-)

I'll try to rephrase it later, unfortunately I'm serving on a
jury this week so reading tutor is evenings only... and I'm
going out tonight!

Alahn G. 




More information about the Tutor mailing list