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

Tim Peters tim.peters at gmail.com
Mon Mar 10 22:54:05 CET 2014


[Mark Dickinson]
> Yes, I'm pretty sure that's what he intended.  It's clearly spelled out in
> the standard: "the operations plus(a) and minus(a) (where a and b refer to
> any numbers) are calculated as the operations add('0', a) and subtract('0',
> b)respectively",

Ah.  The great thing about standards is that there are so many of them
:-(  I was staring at 754-2008, and found nary a mention of "plus" or
"minus" operations.  But I found the quoted text at:

    http://speleotrove.com/decimal/daops.html#refplusmin

where it also says they "correspond to the prefix minus and plus
operators in programming languages".  That doesn't leave much wiggle
room for a conforming implementation.

Next ;-)


More information about the Python-ideas mailing list