Re: How to subclass a family

2013-04-08 Thread Steven D'Aprano
On Mon, 08 Apr 2013 11:44:51 +0200, Antoon Pardon wrote: > Here is the idea. I have a number of classes with the same interface. > Something like the following: > > class Foo1: > def bar(self, ...): > work > def boo(self, ...): > do something > self.bar(...) > > W

Re: How to subclass a family

2013-04-08 Thread Devin Jeanpierre
On Mon, Apr 8, 2013 at 5:44 AM, Antoon Pardon wrote: > Now of course I could subclass every class from the original family > from Foo1 to Foon but that would mean a lot of duplicated code. Is > there a way to reduce the use of duplicated code in such circumstances? As a rule, if there's duplicate

Re: How to subclass a family

2013-04-08 Thread Arnaud Delobelle
On 8 April 2013 10:44, Antoon Pardon wrote: > Here is the idea. I have a number of classes with the same interface. > Something like the following: > > class Foo1: > def bar(self, ...): > work > def boo(self, ...): > do something > self.bar(...) > > What I want is t

How to subclass a family

2013-04-08 Thread Antoon Pardon
Here is the idea. I have a number of classes with the same interface. Something like the following: class Foo1: def bar(self, ...): work def boo(self, ...): do something self.bar(...) What I want is the equivallent of: class Far1(Foo1): def boo(self, ...)