<div dir="ltr">[Originally posted to python-list but on further reflection and some feedback I think it might be more appropriate here.]<br><br>I noticed when trying out Python&#39;s 2.6b2 release that the repr of Decimal has changed since 2.5.&nbsp; On 2.5:<br>
<br>Python 2.5.1 (r251:54863, Mar&nbsp; 7 2008, 04:10:12) <br>[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2<br>
Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.<br>&gt;&gt;&gt; import decimal<br>&gt;&gt;&gt; decimal.Decimal(7)<br>Decimal(&quot;7&quot;)<br>&gt;&gt;&gt; <br>

<br>double quotes were used whereas on 2.6b2:<br><br>Python 2.6b2 (r26b2:65082, Jul 18 2008, 13:36:54) <br>[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2<br>Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.<br>

&gt;&gt;&gt; import decimal<br>&gt;&gt;&gt; decimal.Decimal(7)<br>Decimal(&#39;7&#39;)<br>&gt;&gt;&gt; <br><br>single quotes are used.&nbsp; Searching around I see this was done in r60773 with the log message:<br><br>Fix decimal repr which should have used single quotes like other reprs.<br>
<br>but I can&#39;t find any discussion other than that.&nbsp; <br><br>My
problem is this breaks a bunch of doctests that were written assuming
the prior repr.&nbsp; I can&#39;t just update the tests to assume the new single
quotes because they are for code that is supposed to run on everything
back to Python 2.3.&nbsp; <br>
<br>So my questions:<br><br>Is this backwards-incompatible change really necessary and could it be reconsidered?<br><br>If
it&#39;s here to stay, is there some straightforward way that I am unaware
of to construct tests that use Decimal repr but will work correctly on
Python 2.3-2.6?<br>
<br>Thanks for any feedback,<br>Karen<br></div>