Stylistic question about inheritance
Michele Simionato
michele.simionato at gmail.com
Thu Mar 31 22:36:21 EST 2005
Koenig:
> want to know about the Python community's stylistic
> preferences for defing
> such hierarchies that don't absolutely need a root.
I don't know if there is an official style guide or a Guido's
prononcement on the issue. Personally
I found such hierarchies attractive in the past, but
recently I realized that they look better on the paper
than in practice. A non-needed class just adds cognitive
burden to the maintainer. Also, I don't like to use
isinstance if I can avoid it. Finally, It is always easy to
refactor later and to add a base class
if there is a real need for it.
Paraphrasing Occam, I would say "don't multiply base classes without
necessity" ;)
Michele Simionato
More information about the Python-list
mailing list