A link on https://en.wikipedia.org/wiki/Liskov_substitution_principle goes to
http://www.engr.mun.ca/~theo/Courses/sd/5895-downloads/sd-principles-3.ppt.pdf
which has a very nice example (slides 14 and 15).

Slide 14: Is immutable Square a behavioural subtype of immutable
Rectangle? And vice versa?
Slide 15: Is mutable Square a behavioural subtype of mutable
Rectangle? And vice versa? And relationship between mutable and
immutable Square (resp Rectangle).

-- 
Jonathan
_______________________________________________
Python-ideas mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to