Stylistic question about inheritance

Steven Bethard steven.bethard at
Thu Mar 31 23:20:42 CEST 2005

Andrew Koenig wrote:
> "Carl Banks" <invalidemail at> wrote in message 
> news:1112300127.449931.146470 at
>>Well, Python seems to get along fine without the ability to do
>>isinstance(foo,file_like_object); probably better off in the end for
>>it.  So I'd say you should generally not do it.  Inheritence is for
>>when different classes need to share functionality.
> That's really the question:  Is it for when they need to share 
> functionality, or when they are conceptually related in ways that might lead 
> to shared functionality later?

I've typically only done the former.  But I've definitely extracted 
common ancestors later when I did find that two different classes should 
share functionality.


More information about the Python-list mailing list