Stylistic question about inheritance
invalidemail at aerojockey.com
Thu Mar 31 22:15:27 CEST 2005
Andrew Koenig wrote:
> Of course, there are reasons to have a base class anyway. For
> might want it so that type queries such as isinstance(foo, Expr)
> question is: Are there other reasons to create a base class when I
> really need it right now?
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.
More information about the Python-list