Re: [Tutor] a class that may not be instantiated

2015-11-25 Thread Albert-Jan Roskam
Hi all, Thanks a lot for your replies! > Date: Wed, 25 Nov 2015 05:19:57 +1100 > From: st...@pearwood.info > To: tutor@python.org > Subject: Re: [Tutor] a class that may not be instantiated > > On Tue, Nov 24, 2015 at 03:36:21PM +, Albert-Jan Roskam wrote: > >

Re: [Tutor] a class that may not be instantiated

2015-11-24 Thread Steven D'Aprano
On Tue, Nov 24, 2015 at 03:36:21PM +, Albert-Jan Roskam wrote: > Hi, > > I have two classes with a number of methods that are the same, so I > want to define a super class that holds these methods. Sounds like a misuse of classes to me. DRY is not a good reason to make two otherwise unrelat

Re: [Tutor] a class that may not be instantiated

2015-11-24 Thread Oscar Benjamin
On 24 November 2015 at 15:36, Albert-Jan Roskam wrote: > Hi, > > I have two classes with a number of methods that are the same, so I want to > define a super class that holds these methods. But the super class (below > called _Generic) should not be instantiated, because it serves no purpose >

Re: [Tutor] a class that may not be instantiated

2015-11-24 Thread Alan Gauld
On 24/11/15 15:36, Albert-Jan Roskam wrote: > I have two classes with a number of methods that are the same, > so I want to define a super class that holds these methods. So far so good. > But the super class (below called _Generic) should not be instantiated, But here it starts to feel a tad

Re: [Tutor] a class that may not be instantiated

2015-11-24 Thread Peter Otten
Albert-Jan Roskam wrote: > I have two classes with a number of methods that are the same, so I want to define a super class that holds these methods. But the super class (below called _Generic) should not be instantiated, because it serves no purpose other than the DRY principle. I raise a NotI

[Tutor] a class that may not be instantiated

2015-11-24 Thread Albert-Jan Roskam
Hi, I have two classes with a number of methods that are the same, so I want to define a super class that holds these methods. But the super class (below called _Generic) should not be instantiated, because it serves no purpose other than the DRY principle. I raise a NotImplementedError in case