Classes

Tim Delaney timothy.c.delaney at gmail.com
Sun Nov 2 05:32:13 EST 2014


On 2 November 2014 20:50, Denis McMahon <denismfmcmahon at gmail.com> wrote:

>
> The question (I thought) was to write a class for Square that inherited a
> class Rectangle but imposed on it the additional constraints of a square
> over a rectangle, namely that length == width.
>

I'm late to the party and this has already been partially addressed in the
thread, but it always annoys me. A square is as much a rhombus with 90
degree angles as it is a rectangle with equal length and width, and yet I
*never* see the former given as an option.

If course, that's probably because rectangles have a multitude of uses for
user interfaces, whilst other quadrilaterals are somewhat less useful.

Tim Delaney
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20141102/1842d5f1/attachment.html>


More information about the Python-list mailing list