Stylistic question about inheritance

Donn Cave donn at u.washington.edu
Thu Mar 31 15:55:06 EST 2005


In article 
<P_Y2e.493283$w62.145022 at bgtnsc05-news.ops.worldnet.att.net>,
 "Andrew Koenig" <ark at acm.org> wrote:

> "Carl Banks" <invalidemail at aerojockey.com> wrote in message 
> news:1112300127.449931.146470 at o13g2000cwo.googlegroups.com...
> 
> > 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?

No -- inheritance is for implementation, not to express conceptual
relationship.

   Donn Cave, donn at u.washington.edu



More information about the Python-list mailing list