Talin wrote:

>      r = Rectangle( x, y, w, h )
>      r = Rectangle( minpos, maxpos )
>      r = Rectangle( position, size )

This sort of thing is better done in Python using
keyword arguments:

   Rectangle(left = x, top = y, width = w, height = h)
   Rectangle(topleft = (x, y), size = (w,h))
   Rectangle(topleft = (x0, y0), botright = (x1, y1))

This is actually more flexible, because if implemented
appropriately it also allows things like

   Rectangle(size = (w, h), botright = (x, y))

which I've never seen anyone bother to provide in
a statically-typed Rectangle constructor -- it's
just too tedious to implement all the possible
combinations as separate function signatures.

--
Greg
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to