[Python-ideas] Changing Decimal.__pos__ and Decimal.__neg__ [Was: Re: Python Numbers as Human Concept Decimal System]

Oscar Benjamin oscar.j.benjamin at gmail.com
Mon Mar 10 21:58:18 CET 2014


On 10 March 2014 19:30, Mark Dickinson <dickinsm at gmail.com> wrote:
> On Mon, Mar 10, 2014 at 7:08 PM, Tim Peters <tim.peters at gmail.com> wrote:
>
>> Can't win!  That -x loses the sign when x is a positive 0 (under most
>> rounding modes) is jarring; but that the results of "-x" and "0-x" may
>> not be the same would also be jarring.
>
> Hmm. I find the second option a lot less jarring than the first,

I agree. Needing to call copy_negate just to flip the sign when unary
- is exact for every other numeric seems very unfortunate to me.


Oscar


More information about the Python-ideas mailing list