<div dir="ltr">On Mon, Mar 10, 2014 at 10:16 AM, Oscar Benjamin <span dir="ltr"><<a href="mailto:oscar.j.benjamin@gmail.com" target="_blank">oscar.j.benjamin@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">On 10 March 2014 08:32, Mark Dickinson <<a href="mailto:dickinsm@gmail.com">dickinsm@gmail.com</a>> wrote:<br>
><br>
> Another option would be to change the behaviour of + and - on Decimal<br>
> objects by binding `__pos__` and `__neg__` to the specification's 'copy' and<br>
> 'copy-negate' operations instead of (as currently) to the 'plus' and 'minus'<br>
> operations. Those behaviours are more in keeping with the way that + and -<br>
> operate on other objects.<br>
<br>
Hi Mark and thanks for responding,<br>
<br>
Do you think it's really feasible to make such a change?</blockquote><div><br></div><div>Probably not. :-( As you point out, there are significant backward compatibility issues. It's the solution I'd adopt if those concerns didn't exists, and the one I'd still look for a way to get to even *with* those concerns, but the level of breakage may make this out of the question. I doubt we're going to get to Decimal literals without breaking at least *some* code, but this may be too much breakage.</div>
<div><br></div><div>I guess I have ulterior motives; (ab)using '+' to mean 'round to the current context' has always felt way too implicit for my tastes, and I'd jump at the chance to see it go away. The unconventional behaviour with respect to signed zeros bugs me, too.</div>
<div><br></div><div><p style="margin:0px;font-size:12px;font-family:Monaco">>>> -0.0</p>
<p style="margin:0px;font-size:12px;font-family:Monaco">-0.0</p>
<p style="margin:0px;font-size:12px;font-family:Monaco">>>> -Decimal(0.0) # negative sign mysteriously disappears.</p>
<p style="margin:0px;font-size:12px;font-family:Monaco">Decimal('0')</p></div><div><br></div><div>It's perfectly legitimate, and part of the standard, but ... ugh. I argued with Mike Cowlishaw about it at one point. I lost.</div>
<div><br></div><div>Mark</div><div><br></div></div></div></div>