r...@zedat.fu-berlin.de (Stefan Ram) writes [that Barbara Liskov said]:

|If for each object o1 of type S there is an object o2 of
|type T such that for all programs P defined in terms of T,
|the behavior of P is unchanged when o1 is substituted for o2
|then S is a subtype of T.

That seems overly restrictive, because it wouldn't allow S to
override a method of T and make it do something different --
which we do all the time in practice.

Class contracts must hold for subclasses.

That sounds like a much better way of saying it!

--
Greg
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to