Re: Question about subclassing - version 2

2006-09-09 Thread Bruno Desthuilliers
Maric Michaud a écrit : > Le vendredi 08 septembre 2006 10:15, Bruno Desthuilliers a écrit : > >>You >>mentioned NotImplementedError, which is indeed the usual way to make >>something "abstract" in Python. > > > Hummm, some more thoughts about this. > > I can imagine class hierarchies where the

Re: Question about subclassing - version 2

2006-09-08 Thread Steve Holden
Frank Millman wrote: > Bruno Desthuilliers wrote: > >>Frank Millman wrote: >> >>>I have not gone to the trouble of raising NotImplementedError - the >>>methods that the subclasses *must* override just have a 'pass' >>>statement. I guess it would be more correct to raise the error, as it >>>would g

Re: Question about subclassing - version 2

2006-09-08 Thread Frank Millman
Bruno Desthuilliers wrote: > Frank Millman wrote: > > > > I have not gone to the trouble of raising NotImplementedError - the > > methods that the subclasses *must* override just have a 'pass' > > statement. I guess it would be more correct to raise the error, as it > > would give me a quicker ind

Re: Question about subclassing - version 2

2006-09-08 Thread Bruno Desthuilliers
Frank Millman wrote: > Bruno Desthuilliers wrote: >> Frank Millman wrote: >>> [EMAIL PROTECTED] wrote: There aren't abstract classes in Python. They are all concrete. >> (snip) >>> I use the term 'abstract class' in the abstract sense :-) >>> >>> Say I have three classes where 90% of the

Re: Question about subclassing - version 2

2006-09-08 Thread Maric Michaud
Le vendredi 08 septembre 2006 10:15, Bruno Desthuilliers a écrit : > You > mentioned NotImplementedError, which is indeed the usual way to make > something "abstract" in Python. Hummm, some more thoughts about this. I can imagine class hierarchies where the presence of not implemented methods do

Re: Question about subclassing - version 2

2006-09-08 Thread Maric Michaud
Le vendredi 08 septembre 2006 09:51, [EMAIL PROTECTED] a écrit : > Frank Millman, just a short note, more expert people can give you > better answers. There aren't abstract classes in Python. They are all > concrete. Really ? This is like saying there is no singleton in Python... class AbstractCla

Re: Question about subclassing - version 2

2006-09-08 Thread Frank Millman
Bruno Desthuilliers wrote: > Frank Millman wrote: > > [EMAIL PROTECTED] wrote: > >> There aren't abstract classes in Python. They are all > >> concrete. > (snip) > > I use the term 'abstract class' in the abstract sense :-) > > > > Say I have three classes where 90% of the attributes and methods a

Re: Question about subclassing - version 2

2006-09-08 Thread Bruno Desthuilliers
Frank Millman wrote: > [EMAIL PROTECTED] wrote: >> There aren't abstract classes in Python. They are all >> concrete. (snip) > I use the term 'abstract class' in the abstract sense :-) > > Say I have three classes where 90% of the attributes and methods are > common. It makes sense to create a ba

Re: Question about subclassing - version 2

2006-09-08 Thread Bruno Desthuilliers
Frank Millman wrote: > Hi all > > I recently posted a question about subclassing. I did not explain my > full requirement very clearly, and my proposed solution was not pretty. > I will attempt to explain what I am trying to do more fully, and > describe a possible solution. It is still not pretty

Re: Question about subclassing - version 2

2006-09-08 Thread Bruno Desthuilliers
[EMAIL PROTECTED] wrote: > Frank Millman, just a short note, more expert people can give you > better answers. There aren't abstract classes in Python. Well... There's no "abstract" modifier at least - but there still are abstract classes, ie not meant to be directly instanciated. You mentioned No

Re: Question about subclassing - version 2

2006-09-08 Thread Frank Millman
[EMAIL PROTECTED] wrote: > Frank Millman, just a short note, more expert people can give you > better answers. There aren't abstract classes in Python. They are all > concrete. You may have classes with undefined methods (they may raise > NotImplementedError). > Multiple inheritance isn't supporte

Re: Question about subclassing - version 2

2006-09-08 Thread bearophileHUGS
Frank Millman, just a short note, more expert people can give you better answers. There aren't abstract classes in Python. They are all concrete. You may have classes with undefined methods (they may raise NotImplementedError). Multiple inheritance isn't supported by Java and Ruby, but it is suppor