Smalltalk and Python

Ian Wild ian at cfmu.eurocontrol.be
Thu Dec 14 05:02:37 EST 2000


Alex Martelli wrote:
>  
> I can't find a source any more, but one of the most interesting
> arguments I've heard for "only inherit from abstract classes"
[...otherwise...]
> it would break the idea that your concrete
> classes partition the universe of discourse, if it were.

Where does this partitioning requirement come from?
 
> This is based on the idea of subclassing as asserting IS-A.

?

It seems to me you'd need an "(e) None of the above"
class very frequently if your world doesn't happen to have
any genuine structural divisions.

Dragging in that old favourite, "Squares and Rectangles",
your partitioning clause means I'd have to invent a new class,
"NonSquareRectangle", adding no interesting features, just so
I can have aSquare behave like aRectangle.  This seems like
unnecessary work, just to keep some C++ guru happy.



More information about the Python-list mailing list