On Jul 8, 12:34 pm, Ethan Furman <[EMAIL PROTECTED]> wrote:

> Anybody have an example of when the unary + actually does something?
> Besides the below Decimal example.  I'm curious under what circumstances
> it would be useful for more than just completeness (although
> completeness for it's own sake is important, IMO).

Well, as in Decimal, it would be a good operator to use for
canonization.  Let's say you implement complex numbers as an angle and
radius.  Then, unary plus could be used to normalize the angle to +/-
Pi and the radius to a positive number (by inverting the angle).
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to